Pass the 6502s test from Harte without breaking the 65c02 tests from Klaus
This commit is contained in:
parent
3f916a60fa
commit
358c4fabc1
|
@ -19,6 +19,7 @@ const (
|
||||||
modeIndexedIndirectX
|
modeIndexedIndirectX
|
||||||
modeIndirectIndexedY
|
modeIndirectIndexedY
|
||||||
// Added on the 65c02
|
// Added on the 65c02
|
||||||
|
modeIndirect65c02Fix
|
||||||
modeIndirectZeroPage
|
modeIndirectZeroPage
|
||||||
modeAbsoluteIndexedIndirectX
|
modeAbsoluteIndexedIndirectX
|
||||||
modeZeroPageAndRelative
|
modeZeroPageAndRelative
|
||||||
|
@ -90,16 +91,11 @@ func resolveAddress(s *State, line []uint8, opcode opcode) uint16 {
|
||||||
addressAddress := line[1] + s.reg.getX()
|
addressAddress := line[1] + s.reg.getX()
|
||||||
address = getZeroPageWord(s.mem, addressAddress)
|
address = getZeroPageWord(s.mem, addressAddress)
|
||||||
case modeIndirect:
|
case modeIndirect:
|
||||||
|
addressAddress := getWordInLine(line)
|
||||||
|
address = getWordNoCrossPage(s.mem, addressAddress)
|
||||||
|
case modeIndirect65c02Fix:
|
||||||
addressAddress := getWordInLine(line)
|
addressAddress := getWordInLine(line)
|
||||||
address = getWord(s.mem, addressAddress)
|
address = getWord(s.mem, addressAddress)
|
||||||
//address = getWordNoCrossPage(s.mem, addressAddress)
|
|
||||||
|
|
||||||
/*
|
|
||||||
The tests from https://github.com/Klaus2m5/6502_65C02_functional_tests
|
|
||||||
pass with getWord(), but the tests in https://github.com/TomHarte/ProcessorTests/tree/main/6502/v1
|
|
||||||
need getWordNoCrossPage().
|
|
||||||
*/
|
|
||||||
|
|
||||||
case modeIndirectIndexedY:
|
case modeIndirectIndexedY:
|
||||||
base := getZeroPageWord(s.mem, line[1])
|
base := getZeroPageWord(s.mem, line[1])
|
||||||
address, extraCycle = addOffset(base, s.reg.getY())
|
address, extraCycle = addOffset(base, s.reg.getY())
|
||||||
|
|
|
@ -67,6 +67,7 @@ var opcodes65c02Delta = [256]opcode{
|
||||||
0x00: {"BRK", 1, 7, modeImplicit, opBRKAlt},
|
0x00: {"BRK", 1, 7, modeImplicit, opBRKAlt},
|
||||||
0x24: {"BIT", 2, 3, modeZeroPage, opBIT},
|
0x24: {"BIT", 2, 3, modeZeroPage, opBIT},
|
||||||
0x2C: {"BIT", 3, 3, modeAbsolute, opBIT},
|
0x2C: {"BIT", 3, 3, modeAbsolute, opBIT},
|
||||||
|
0x6C: {"JMP", 3, 3, modeIndirect65c02Fix, opJMP},
|
||||||
|
|
||||||
// Fixed BCD arithmetic flags
|
// Fixed BCD arithmetic flags
|
||||||
0x69: {"ADC", 2, 2, modeImmediate, opADCAlt},
|
0x69: {"ADC", 2, 2, modeImmediate, opADCAlt},
|
||||||
|
|
Loading…
Reference in New Issue