예제 #1
0
  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();
      }
    }
  }
예제 #2
0
  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;
  }