-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
651c7a4
commit b6b0785
Showing
1 changed file
with
69 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,78 @@ | ||
[test] | ||
[test_instr] | ||
cycles = 4 | ||
exit_reason = "Halt" | ||
|
||
[test.entry_state] | ||
[test_instr.entry_state] | ||
|
||
[test.exit_state] | ||
[test_instr.exit_state] | ||
pc = 0x01 | ||
|
||
[test.program] | ||
[test_instr.program] | ||
instructions = [ | ||
0x76, # halt | ||
] | ||
|
||
# Checks that the CPU actually halts | ||
[test_halted] | ||
cycles = 200 | ||
exit_reason = "Halt" | ||
|
||
[test_halted.entry_state] | ||
|
||
[test_halted.exit_state] | ||
pc = 0x01 | ||
|
||
[test_halted.program] | ||
instructions = [ | ||
0x76, # halt | ||
] | ||
|
||
[test_exit_irq_disabled] | ||
cycles = 208 | ||
interrupt_triggers = [ | ||
{ cycle = 200, triggers = ["Vblank"] } # Trigger Vblank interrupt at cycle count 200 | ||
] | ||
exit_reason = "Step" | ||
|
||
[test_exit_irq_disabled.entry_state] | ||
|
||
[test_exit_irq_disabled.exit_state] | ||
pc = 0x03 | ||
b = 4 | ||
|
||
[test_exit_irq_disabled.program] | ||
instructions = [ | ||
0x76, # halt | ||
0x06, # ld b, 0x04 | ||
0x04 | ||
] | ||
|
||
# Checks that the CPU exits the halt after an interrupt and executes the interrupt handler | ||
# Note that the halt bug is not implemented on this cpu | ||
[test_exit_irq_enabled] | ||
cycles = 220 | ||
interrupt_triggers = [ | ||
{ cycle = 200, triggers = ["Vblank"] } # Trigger Vblank interrupt at cycle count 200 | ||
] | ||
interrupt_acknowledges = [ | ||
{ cycle = 220, ack = "Vblank" } | ||
] | ||
exit_reason = "InterruptTaken" | ||
|
||
[test_exit_irq_enabled.entry_state] | ||
irq_en = true | ||
pc = 0x1234 | ||
sp = 0x8002 | ||
memory = { 0x8000 = [] } | ||
|
||
[test_exit_irq_enabled.exit_state] | ||
irq_en = false | ||
pc = 0x40 | ||
sp = 0x8000 | ||
memory = { 0x8000 = [0x35, 0x12] } | ||
|
||
[test_exit_irq_enabled.program] | ||
base = 0x1234 | ||
instructions = [ | ||
0x76, # halt | ||
] |