protected void writeAddress(byte val) { /* >8C02, address write */ if (vdpaddrflag) { vdpaddr = (vdpaddr & 0xff) | (val << 8); } else { vdpaddr = (vdpaddr & 0xff00) | (val & 0xff); } if ((vdpaddrflag = !vdpaddrflag) == false) { if (dumpVdpAccess.getBoolean()) { PrintWriter pw = Logging.getLog(dumpFullInstructions); if (pw != null) pw.println("Address: " + HexUtils.toHex4(vdpaddr)); } if ((vdpaddr & 0x8000) != 0) { writeRegAddr(vdpaddr); vdpaddr &= 0x3fff; } else if ((vdpaddr & 0x4000) != 0) { vdpaddr &= 0x3fff; } else { // read ahead one byte vdpreadahead = videoMemory.readByte(vdpaddr); autoIncrementAddr(); } } }
protected byte readData() { /* >8800, memory read */ byte ret; ret = vdpreadahead; vdpreadahead = videoMemory.readByte(vdpaddr); autoIncrementAddr(); return ret; }
/** @param machine */ public Vdp9918AMmio(ISettingsHandler settings, IMemory memory, IVdpChip vdp, int memorySize) { super(new VdpRamArea(memorySize)); this.settings = settings; dumpFullInstructions = settings.get(ICpu.settingDumpFullInstructions); dumpVdpAccess = settings.get(IVdpChip.settingDumpVdpAccess); this.videoMemory = vdp.getVideoMemory(); videoMemory.setSize(memorySize); initMemory(memory, memorySize); ((VdpTMS9918A) vdp).setVdpMmio(this); setVdpHandler(vdp); }
protected void writeData(byte val) { /* >8C00, data write */ /* this flag is used to verify that the VDP address was written as >4000 + vdpaddr. If not, then writing to it functions as a read-before-write. */ vdpaddrflag = false; // byte oldval = videoMemory.flatReadByte(vdpaddr); videoMemory.writeByte(vdpaddr, val); if ((vdpaddr & 0xf) == 0 && dumpVdpAccess.getBoolean()) { PrintWriter pw = Logging.getLog(dumpFullInstructions); if (pw != null) pw.println("Address: " + HexUtils.toHex4(vdpaddr)); } autoIncrementAddr(); vdpreadahead = val; }