Package libsidplay
Klasse C64
java.lang.Object
libsidplay.C64
- Alle implementierten Schnittstellen:
DatasetteEnvironment,C1541Environment,UserportPrinterEnvironment
public abstract class C64
extends Object
implements DatasetteEnvironment, C1541Environment, UserportPrinterEnvironment
Commodore 64 emulation core.
It consists of the following chips: PLA, MOS6510, MOS6526(a), VIC
6569(PAL)/6567(NTSC), RAM/ROM.
Some connectors exist additionally: Keyboard, two Joysticks, parallel cable and some memory expansions and other cartridges can be plugged in.
Some connectors exist additionally: Keyboard, two Joysticks, parallel cable and some memory expansions and other cartridges can be plugged in.
- Autor:
- Antti Lankila, Ken Händel
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungprotected classArea backed by RAM, including cpu port addresses 0 and 1. -
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprotected intNumber of entrances to play routine to determine tune speedprotected final MOS6526CIA1protected final MOS6526CIA2protected CPUClockSystem clockprotected final EventSchedulerSystem event contextprivate final MOS6510CPUprivate final IJoystickImplementation of a disconnected Joystickprotected final IJoystick[]Joystick port devicesprotected final KeyboardKeyboardprivate longLast time tune speed has been measuredprotected final VICSpecific VIC used for NTSC.protected final VICSpecific VIC used for PAL.protected IParallelCableAttached parallel cableprivate final PLAMMU chipprotected IMOS6510ExtensionThe interested party for playroutine entrances.protected final SystemRAMBankSystem memory arrayprivate doubledetected tune speedprivate final C64.ZeroRAMBankZero page memory bank -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungC64(byte[] charBin, byte[] basicBin, byte[] kernalBin) C64(Function<EventScheduler, MOS6510> cpuCreator, byte[] charBin, byte[] basicBin, byte[] kernalBin) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungfinal voidconfigureSID(int chipNum, Consumer<SIDEmu> action) Configure one specific SID.final voidconfigureSIDs(BiConsumer<Integer, SIDEmu> action) Configure all available SIDs.voidconfigureVICs(Consumer<VIC> action) Configure PAL and NTSC VIC.final doubleDetermine tune speed (calls of play routine per frame).final voidEject multi purpose cartridge from the expansion port of the C64.final CartridgeGet current multi purpose cartridge of the expansion port of the C64.getClock()Get system clock (PAL/NTSC).getCPU()Return CPU emulatorGet C64's event schedulerGet current keyboard emulation.byte[]getRAM()Return the array backing C64 RAMgetVIC()Get VIC chip emulator (PAL/NTSC).intfinal voidinsertSIDChips(BiFunction<Integer, SIDEmu, SIDEmu> sidCreator, IntFunction<Integer> sidLocator) Insert SID chips to be used.booleanfinal booleanisJoystickConnected(int portNumber) Is joystick connected?voidreset()Perform the equivalent of full power-on reset of C64, re-initializing everything.final voidsetCartridge(CartridgeType type, int sizeKB) Insert a cartridge of a given size with empty contents.final voidsetCartridge(CartridgeType type, File file) Insert a cartridge loading an image file.final voidInsert a cartridge of type CRT loading an image.protected voidSet system clock (PAL/NTSC).voidsetCustomKernal(byte[] kernalRom) Installs a custom Kernal ROM.final voidsetJoystick(int portNumber, IJoystick joystickReader) Set joystick implementation.final voidsetParallelCable(IParallelCable parallelCable) voidsetPlayAddr(int playAddr) Set play routine address to watch by CPU emulation.voidsetPlayRoutineObserver(IMOS6510Extension observer) Install a play routine observer to hook the JSR command of the CPU.voidsetSIDListener(SIDListener listener) Get SID register write notifications.Von Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitVon Schnittstelle geerbte Methoden libsidplay.components.c1541.C1541Environment
readFromIECBus, writeToIECBusVon Schnittstelle geerbte Methoden libsidplay.components.c1530.DatasetteEnvironment
getTapeSense, setMotor, toggleWriteBitVon Schnittstelle geerbte Methoden libsidplay.components.printer.UserportPrinterEnvironment
printerUserportWriteData, printerUserportWriteStrobe
-
Felddetails
-
clock
System clock -
pla
MMU chip -
cpu
CPU -
cia1
CIA1 -
cia2
CIA2 -
keyboard
Keyboard -
parallelCable
Attached parallel cable -
palVic
Specific VIC used for PAL. -
ntscVic
Specific VIC used for NTSC. -
ramBank
System memory array -
context
System event context -
callsToPlayRoutine
protected int callsToPlayRoutineNumber of entrances to play routine to determine tune speed -
lastUpdate
private long lastUpdateLast time tune speed has been measured -
tuneSpeed
private double tuneSpeeddetected tune speed -
playRoutineObserver
The interested party for playroutine entrances. -
joystickPort
Joystick port devices -
disconnectedJoystick
Implementation of a disconnected Joystick -
zeroRAMBank
Zero page memory bank
-
-
Konstruktordetails
-
C64
public C64(byte[] charBin, byte[] basicBin, byte[] kernalBin) -
C64
public C64(Function<EventScheduler, MOS6510> cpuCreator, byte[] charBin, byte[] basicBin, byte[] kernalBin)
-
-
Methodendetails
-
setPlayAddr
public void setPlayAddr(int playAddr) Set play routine address to watch by CPU emulation.- Parameter:
playAddr- Observe calls of SID player (JSR $PlayAddr).
-
determineTuneSpeed
public final double determineTuneSpeed()Determine tune speed (calls of play routine per frame).- Gibt zurück:
- current tune speed
-
setParallelCable
-
reset
public void reset()Perform the equivalent of full power-on reset of C64, re-initializing everything. -
getRAM
public byte[] getRAM()Return the array backing C64 RAM- Gibt zurück:
- the RAM
-
getCPU
Return CPU emulator- Gibt zurück:
- the cpu
-
setPlayRoutineObserver
Install a play routine observer to hook the JSR command of the CPU. It gets called, if the player address gets called.- Parameter:
observer- play routine observer
-
getVIC
Get VIC chip emulator (PAL/NTSC).- Gibt zurück:
- VIC chip
-
getVicMemBase
public int getVicMemBase() -
insertSIDChips
public final void insertSIDChips(BiFunction<Integer, SIDEmu, SIDEmu> sidCreator, IntFunction<Integer> sidLocator) Insert SID chips to be used.- Parameter:
sidCreator- Responsible to decide which SID chips we need (SIDEmu) and which we don't need (NONE). SID number and old SID are mapped to new SID.sidLocator- Responsible to determine the base address of the SID chips we need
-
configureVICs
Configure PAL and NTSC VIC.- Parameter:
action- VIC consumer
-
configureSIDs
Configure all available SIDs.- Parameter:
action- SID chip consumer
-
configureSID
Configure one specific SID.- Parameter:
chipNum- SID chip numberaction- SID chip consumer
-
setSIDListener
Get SID register write notifications. -
setClock
Set system clock (PAL/NTSC).- Parameter:
clock- system clock (PAL/NTSC)
-
getClock
Get system clock (PAL/NTSC).- Gibt zurück:
- system clock (PAL/NTSC)
-
getEventScheduler
Get C64's event scheduler- Gibt zurück:
- the scheduler
-
setCustomKernal
public void setCustomKernal(byte[] kernalRom) Installs a custom Kernal ROM.- Parameter:
kernalRom- Kernal ROM replacement (null means original Kernal)
-
getKeyboard
Get current keyboard emulation.- Gibt zurück:
- current keyboard emulation
-
setJoystick
Set joystick implementation.- Parameter:
portNumber- joystick port (0-1)joystickReader- joystick implementation or null (disconnected)
-
isJoystickConnected
public final boolean isJoystickConnected(int portNumber) Is joystick connected?- Parameter:
portNumber- joystick port (0-1)- Gibt zurück:
- joystick connected?
-
setCartridge
Insert a cartridge of a given size with empty contents.- Parameter:
type- cartridge typesizeKB- size in KB- Löst aus:
IOException- never thrown here
-
setCartridge
Insert a cartridge loading an image file.- Parameter:
type- cartridge typefile- file to load the RAM contents- Löst aus:
IOException- image read error
-
setCartridgeCRT
Insert a cartridge of type CRT loading an image.- Parameter:
is- input stream to load the RAM contents- Löst aus:
IOException- image read error
-
getCartridge
Get current multi purpose cartridge of the expansion port of the C64.- Gibt zurück:
- multi purpose cartridge
-
isCartridge
public boolean isCartridge()- Gibt zurück:
- is a multi purpose cartridge inserted into the expansion port of the C64?
-
ejectCartridge
public final void ejectCartridge()Eject multi purpose cartridge from the expansion port of the C64.
-