mirror of
https://github.com/jborza/emu6502.git
synced 2024-11-21 23:31:19 +00:00
longer test for JSR and RTS
This commit is contained in:
parent
eb1134b0da
commit
6b6fcd677b
12
test6502.c
12
test6502.c
@ -44,6 +44,15 @@ void test_step(State6502 * state) {
|
||||
print_all(state);
|
||||
}
|
||||
|
||||
void test_step_until_break(State6502* state) {
|
||||
do {
|
||||
print_all(state);
|
||||
disassemble_6502(state->memory, state->pc);
|
||||
emulate_6502_op(state);
|
||||
} while (state->flags.b != 1);
|
||||
print_all(state);
|
||||
}
|
||||
|
||||
void test_cleanup(State6502 * state) {
|
||||
free(state->memory);
|
||||
}
|
||||
@ -2173,8 +2182,7 @@ void test_JSR_RTS() {
|
||||
char program[] = { JSR_ABS, 0x06, 0x00, LDA_IMM, 0xAA, BRK, LDX_IMM, 0xBB, RTS};
|
||||
memcpy(state.memory, program, sizeof(program));
|
||||
//act
|
||||
test_step(&state);
|
||||
test_step(&state);
|
||||
test_step_until_break(&state);
|
||||
//assert
|
||||
assert_pc(&state, 0x0006);
|
||||
assert_sp(&state, 0xFF);
|
||||
|
Loading…
Reference in New Issue
Block a user