Burger Time Hardware Information |
. Home . . Main CPU . . Sound CPU . . Ports . . Encryption . . Tiles . . Sprites . . Palette . . Rendering . . Full View . . Sourceforge Project Page .
Encryption:
during a write, if the next opcode address has bits 2 and 8 set (0x0104), then the opcode needs decrypting. watch out for jsr, since it writes to the stack during execution you will need to check the address of the opcode that jsr jumps to and see if it has the bits set. to decrypt the opcode, change around the bits from 76543210 to 65342710.
here is what the variables are:
addr = the address of the next opcode to be read tmp = the address of the current opcode mem = the real rom data being read cpumem[2] = a copy of the original rom data that is modified
here is code i used:
addr = getnextopcodepc(); tmp = getcurrentopcodepc(); if(cpumem[2][tmp] == 0x20) addr = mem[tmp + 1] + (mem[tmp + 2] << 8); if((addr & 0x0104) == 0x0104) cpumem[2][addr] = ((mem[addr] & 0x13) | ((mem[addr] & 0x80) >> 5) | ((mem[addr] & 0x64) << 1) | ((mem[addr] & 0x08) << 2));
page generated in 0.378072 seconds |