public abstract class C64 extends Object implements DatasetteEnvironment, C1541Environment, UserportPrinterEnvironment
Modifier and Type | Class and Description |
---|---|
protected class |
C64.ZeroRAMBank
Area backed by RAM, including cpu port addresses 0 and 1.
|
Modifier and Type | Field and Description |
---|---|
protected int |
callsToPlayRoutine
Number of entrances to play routine to determine tune speed
|
protected MOS6526 |
cia1
CIA1
|
protected MOS6526 |
cia2
CIA2
|
protected CPUClock |
clock
System clock
|
protected EventScheduler |
context
System event context
|
protected IJoystick[] |
joystickPort
Joystick port devices
|
protected Keyboard |
keyboard
Keyboard
|
protected VIC |
ntscVic
Specific VIC used for NTSC.
|
protected VIC |
palVic
Specific VIC used for PAL.
|
protected IParallelCable |
parallelCable
Attached parallel cable
|
protected IMOS6510Extension |
playRoutineObserver
The interested party for playroutine entrances.
|
protected SystemRAMBank |
ramBank
System memory array
|
Modifier and Type | Method and Description |
---|---|
void |
configureSID(int chipNum,
Consumer<SIDEmu> action)
Configure one specific SID.
|
void |
configureSIDs(BiConsumer<Integer,SIDEmu> action)
Configure all available SIDs.
|
void |
configureVICs(Consumer<VIC> action)
Configure PAL and NTSC VIC.
|
double |
determineTuneSpeed()
Determine tune speed (calls of play routine per frame).
|
void |
ejectCartridge()
Eject multi purpose cartridge from the expansion port of the C64.
|
Cartridge |
getCartridge()
Get current multi purpose cartridge of the expansion port of the C64.
|
CPUClock |
getClock()
Get system clock (PAL/NTSC).
|
MOS6510 |
getCPU()
Return CPU emulator
|
EventScheduler |
getEventScheduler()
Get C64's event scheduler
|
Keyboard |
getKeyboard()
Get current keyboard emulation.
|
byte[] |
getRAM()
Return the array backing C64 RAM
|
VIC |
getVIC()
Get VIC chip emulator (PAL/NTSC).
|
int |
getVicMemBase() |
void |
insertSIDChips(BiFunction<Integer,SIDEmu,SIDEmu> sidCreator,
IntFunction<Integer> sidLocator)
Insert SID chips to be used.
|
boolean |
isJoystickConnected(int portNumber)
Is joystick connected?
|
void |
reset()
Perform the equivalent of full power-on reset of C64, re-initializing
everything.
|
void |
setCartridge(CartridgeType type,
File file)
Insert a cartridge loading an image file.
|
void |
setCartridge(CartridgeType type,
int sizeKB)
Insert a cartridge of a given size with empty contents.
|
void |
setCartridgeCRT(InputStream is)
Insert a cartridge of type CRT loading an image.
|
protected void |
setClock(CPUClock clock)
Set system clock (PAL/NTSC).
|
void |
setCustomKernal(byte[] kernalRom)
Installs a custom Kernal ROM.
|
void |
setJoystick(int portNumber,
IJoystick joystickReader)
Set joystick implementation.
|
void |
setParallelCable(IParallelCable parallelCable) |
void |
setPlayAddr(int playAddr)
Set play routine address to watch by CPU emulation.
|
void |
setPlayRoutineObserver(IMOS6510Extension observer)
Install a play routine observer to hook the JSR command of the CPU.
|
void |
setSIDListener(SIDListener listener)
Get SID register write notifications.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getTapeSense, setMotor, toggleWriteBit
readFromIECBus, writeToIECBus
printerUserportWriteData, printerUserportWriteStrobe
protected CPUClock clock
protected final MOS6526 cia1
protected final MOS6526 cia2
protected final Keyboard keyboard
protected IParallelCable parallelCable
protected final VIC palVic
protected final VIC ntscVic
protected final SystemRAMBank ramBank
protected final EventScheduler context
protected int callsToPlayRoutine
protected IMOS6510Extension playRoutineObserver
protected final IJoystick[] joystickPort
public void setPlayAddr(int playAddr)
playAddr
- Observe calls of SID player (JSR $PlayAddr).public final double determineTuneSpeed()
public final void setParallelCable(IParallelCable parallelCable)
public void reset()
public byte[] getRAM()
public MOS6510 getCPU()
public void setPlayRoutineObserver(IMOS6510Extension observer)
observer
- play routine observerpublic VIC getVIC()
public int getVicMemBase()
public final void insertSIDChips(BiFunction<Integer,SIDEmu,SIDEmu> sidCreator, IntFunction<Integer> sidLocator)
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 needpublic void configureVICs(Consumer<VIC> action)
action
- VIC consumerpublic final void configureSIDs(BiConsumer<Integer,SIDEmu> action)
action
- SID chip consumerpublic final void configureSID(int chipNum, Consumer<SIDEmu> action)
chipNum
- SID chip numberaction
- SID chip consumerpublic void setSIDListener(SIDListener listener)
protected void setClock(CPUClock clock)
clock
- system clock (PAL/NTSC)public CPUClock getClock()
public EventScheduler getEventScheduler()
public void setCustomKernal(byte[] kernalRom)
kernalRom
- Kernal ROM replacement (null means original Kernal)public Keyboard getKeyboard()
public final void setJoystick(int portNumber, IJoystick joystickReader)
portNumber
- joystick port (0-1)joystickReader
- joystick implementation or null (disconnected)public final boolean isJoystickConnected(int portNumber)
portNumber
- joystick port (0-1)public final void setCartridge(CartridgeType type, int sizeKB) throws IOException
type
- cartridge typesizeKB
- size in KBIOException
- never thrown herepublic final void setCartridge(CartridgeType type, File file) throws IOException
type
- cartridge typefile
- file to load the RAM contentsIOException
- image read errorpublic final void setCartridgeCRT(InputStream is) throws IOException
is
- input stream to load the RAM contentsIOException
- image read errorpublic final Cartridge getCartridge()
public final void ejectCartridge()
Copyright © 2018 Ken Händel. All rights reserved.