| 169 | } |
| 170 | |
| 171 | bool LanguageCardUnit::IsOpcodeRMWabs(WORD addr) |
| 172 | { |
| 173 | BYTE param1 = ReadByteFromMemory(regs.pc - 2); |
| 174 | BYTE param2 = ReadByteFromMemory(regs.pc - 1); |
| 175 | if (param1 != (addr & 0xff) || param2 != 0xC0) |
| 176 | return false; |
| 177 | |
| 178 | // GH#404, GH#700: INC $C083,X/C08B,X (RMW) to write enable the LC (any 6502/65C02/816) |
| 179 | BYTE opcode = ReadByteFromMemory(regs.pc - 3); |
| 180 | if (opcode == 0xFE && regs.x == 0) // INC abs,x |
| 181 | return true; |
| 182 | |
| 183 | // GH#700: INC $C083/C08B (RMW) to write enable the LC (65C02 only) |
| 184 | if (GetMainCpu() != CPU_65C02) |
| 185 | return false; |
| 186 | |
| 187 | if (opcode == 0xEE || // INC abs |
| 188 | opcode == 0xCE || // DEC abs |
| 189 | opcode == 0x6E || // ROR abs |
| 190 | opcode == 0x4E || // LSR abs |
| 191 | opcode == 0x2E || // ROL abs |
| 192 | opcode == 0x0E) // ASL abs |
| 193 | return true; |
| 194 | |
| 195 | if (opcode == 0x1C || // TRB abs |
| 196 | opcode == 0x0C) // TSB abs |
| 197 | return true; |
| 198 | |
| 199 | return false; |
| 200 | } |
| 201 | |
| 202 | uint8_t LanguageCardUnit::ReadByte(uint16_t phyAddr) |
| 203 | { |
no test coverage detected