Package CPU
Class CPUforScreenEmulation
java.lang.Object
CPU.MC68000Cpu
CPU.CPUforScreenEmulation
Object derived from CPU, used only when emulating QL screen and copying from there to display.
-
Field Summary
Fields inherited from class CPU.MC68000Cpu
addr_regs, currentInstructionAddress, CUT_OFF, data_regs, disasmBuffer, externalInterruptHandlersList, i_table, ieh, INTERRUPT_FLAGS_MASK, interruptLevel, interruptSignaled, mainMemory, nbrOfInterruptHandlers, newInterruptGenerated, pc_reg, pcs, ramSize, reg_sr, reg_ssp, reg_usp, screen, screenStart, screenStop, stopNow, SUPERVISOR_FLAG, totMemSize, totRamSize, totRamSizeForLong, totRamSizeForWord, TRACE_FLAG, trapDispatcher
-
Constructor Summary
ConstructorsConstructorDescriptionCPUforScreenEmulation
(int size, inifile.IniFile iniFile, int romSize, int videoRamSize) Creates the object.CPUforScreenEmulation
(int size, Screen screen, inifile.IniFile iniFile, int romSize) Creates the object. -
Method Summary
Modifier and TypeMethodDescriptionprotected int
readFromBuffer
(int address, int nbrOfBytes, ByteBuffer buffer, int startInBuffer, boolean specialRead) Reads bytes from a ByteBuffer and writes them into memory.void
setCopyScreen
(int QLScreenMode, int origins) This switches QL screen emulation on or off.final void
writeMemoryByte
(int address, int value) Writes a byte to memory.final void
writeMemoryLong
(int address, int value) Writes a long to the memory.final void
writeMemoryShort
(int address, short value) Writes a short to memory.final void
writeMemoryWord
(int address, int value) Writes a word to memory.Methods inherited from class CPU.MC68000Cpu
addInstruction, combineBlocks, copyMem, debugMem, disassembleDstEA, disassembleEA, disassembleSrcEA, endEmulation, execute, executeContinuous, findInMemory, findInMemory, findInMemory, generateInterrupt, getDisplacement, getInstructionFor, getLinkageBlock, getMemory, getRamSize, getRamSizeInMiB, getRomFile, getScreen2, getScreenAddresses, getScreenStart, getTotalMemSize, getTotalRamSize, isSupervisorMode, moveBlock, raiseException, raiseSRException, readableSize, readFromBuffer, readFromFile, readFromFile, readMemoryByte, readMemoryByteSigned, readMemoryChar, readMemoryLong, readMemoryLongPC, readMemoryLongPCinc, readMemoryShort, readMemoryWord, readMemoryWordPC, readMemoryWordPCInc, readMemoryWordPCSigned, readMemoryWordPCSignedInc, readMemoryWordSigned, registerInterruptHandler, removeAllKeyrows, removeKeyrow, reset, setEmuScreenMode, setKeyrow, setScreen, setScreenMode, setSR, setTrapDispatcher, setZStatusFlag, signExtendByte, signExtendWord, testD0, testTrace, writeMemoryChar, writeMemoryWord, writeToBuffer, writeToBuffer, writeToBuffer, writeToFile
-
Constructor Details
-
CPUforScreenEmulation
Creates the object.- Parameters:
size
- the size of ram in bytes.screen
- the screen to use.iniFile
- my .ini file with options to set.romSize
- the size of the ROM image. Loaded after the RAM image.
-
CPUforScreenEmulation
public CPUforScreenEmulation(int size, inifile.IniFile iniFile, int romSize, int videoRamSize) Creates the object.- Parameters:
size
- the size of ram in bytes.iniFile
- my .ini file with options to set.romSize
- the size of the ROM image. Loaded after the RAM image.videoRamSize
- size,in bytes, of screen memory to be allocated here.
-
-
Method Details
-
writeMemoryByte
public final void writeMemoryByte(int address, int value) Writes a byte to memory.- Overrides:
writeMemoryByte
in classMC68000Cpu
- Parameters:
address
- where to write to.value
- the byte to write (in the LSB of the int).
-
writeMemoryWord
public final void writeMemoryWord(int address, int value) Writes a word to memory.- Overrides:
writeMemoryWord
in classMC68000Cpu
- Parameters:
address
- where to write to.value
- the word to write (in the LSW of the int).
-
writeMemoryShort
public final void writeMemoryShort(int address, short value) Writes a short to memory.- Overrides:
writeMemoryShort
in classMC68000Cpu
- Parameters:
address
- where to write to.value
- the short to write.
-
writeMemoryLong
public final void writeMemoryLong(int address, int value) Writes a long to the memory.- Overrides:
writeMemoryLong
in classMC68000Cpu
- Parameters:
address
- the address where to write to.value
- the value to write.
-
setCopyScreen
public void setCopyScreen(int QLScreenMode, int origins) This switches QL screen emulation on or off. If on, any writes to the QL screen area are copied to the true display.- Overrides:
setCopyScreen
in classMC68000Cpu
- Parameters:
QLScreenMode
- the screen mode the QL screen is supposed to be in.origins
- origins in y screen which should correspond to (0,0) in QL screen.
-
readFromBuffer
protected int readFromBuffer(int address, int nbrOfBytes, ByteBuffer buffer, int startInBuffer, boolean specialRead) Reads bytes from a ByteBuffer and writes them into memory. Possibly copies QL screen memory to display.- Overrides:
readFromBuffer
in classMC68000Cpu
- Parameters:
address
- where to read to.nbrOfBytes
- how many bytes are to be read.buffer
- the buffer to read from.startInBuffer
- where in the buffer to start reading from.specialRead
- =true
ONLY when loading the OS, must befalse
at all other times!- Returns:
- nbr of bytes read.
-