Skip to content

Commit

Permalink
Add sm83 tests for prefixed instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
Javier-varez committed May 12, 2024
1 parent 30e51b3 commit 389b55d
Show file tree
Hide file tree
Showing 256 changed files with 11,100 additions and 0 deletions.
37 changes: 37 additions & 0 deletions sm83/tests/data/bit_0_a.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

[bit_set]
cycles = 8

[bit_set.entry_state]
a = 0x1
flags = ['N']

[bit_set.exit_state]
a = 0x1
flags = ['H']
pc = 2

[bit_set.program]
instructions = [
0xCB,
0x47, # bit, 0, a
]

[bit_unset]
cycles = 8

[bit_unset.entry_state]
a = 0xfe
flags = ['N']

[bit_unset.exit_state]
a = 0xfe
flags = ['H', 'Z']
pc = 2

[bit_unset.program]
instructions = [
0xCB,
0x47, # bit, 0, a
]

37 changes: 37 additions & 0 deletions sm83/tests/data/bit_0_b.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

[bit_set]
cycles = 8

[bit_set.entry_state]
b = 0x1
flags = ['N']

[bit_set.exit_state]
b = 0x1
flags = ['H']
pc = 2

[bit_set.program]
instructions = [
0xCB,
0x40, # bit, 0, b
]

[bit_unset]
cycles = 8

[bit_unset.entry_state]
b = 0xfe
flags = ['N']

[bit_unset.exit_state]
b = 0xfe
flags = ['H', 'Z']
pc = 2

[bit_unset.program]
instructions = [
0xCB,
0x40, # bit, 0, b
]

37 changes: 37 additions & 0 deletions sm83/tests/data/bit_0_c.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

[bit_set]
cycles = 8

[bit_set.entry_state]
c = 0x1
flags = ['N']

[bit_set.exit_state]
c = 0x1
flags = ['H']
pc = 2

[bit_set.program]
instructions = [
0xCB,
0x41, # bit, 0, c
]

[bit_unset]
cycles = 8

[bit_unset.entry_state]
c = 0xfe
flags = ['N']

[bit_unset.exit_state]
c = 0xfe
flags = ['H', 'Z']
pc = 2

[bit_unset.program]
instructions = [
0xCB,
0x41, # bit, 0, c
]

37 changes: 37 additions & 0 deletions sm83/tests/data/bit_0_d.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

[bit_set]
cycles = 8

[bit_set.entry_state]
d = 0x1
flags = ['N']

[bit_set.exit_state]
d = 0x1
flags = ['H']
pc = 2

[bit_set.program]
instructions = [
0xCB,
0x42, # bit, 0, d
]

[bit_unset]
cycles = 8

[bit_unset.entry_state]
d = 0xfe
flags = ['N']

[bit_unset.exit_state]
d = 0xfe
flags = ['H', 'Z']
pc = 2

[bit_unset.program]
instructions = [
0xCB,
0x42, # bit, 0, d
]

37 changes: 37 additions & 0 deletions sm83/tests/data/bit_0_e.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

[bit_set]
cycles = 8

[bit_set.entry_state]
e = 0x1
flags = ['N']

[bit_set.exit_state]
e = 0x1
flags = ['H']
pc = 2

[bit_set.program]
instructions = [
0xCB,
0x43, # bit, 0, e
]

[bit_unset]
cycles = 8

[bit_unset.entry_state]
e = 0xfe
flags = ['N']

[bit_unset.exit_state]
e = 0xfe
flags = ['H', 'Z']
pc = 2

[bit_unset.program]
instructions = [
0xCB,
0x43, # bit, 0, e
]

37 changes: 37 additions & 0 deletions sm83/tests/data/bit_0_h.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

[bit_set]
cycles = 8

[bit_set.entry_state]
h = 0x1
flags = ['N']

[bit_set.exit_state]
h = 0x1
flags = ['H']
pc = 2

[bit_set.program]
instructions = [
0xCB,
0x44, # bit, 0, h
]

[bit_unset]
cycles = 8

[bit_unset.entry_state]
h = 0xfe
flags = ['N']

[bit_unset.exit_state]
h = 0xfe
flags = ['H', 'Z']
pc = 2

[bit_unset.program]
instructions = [
0xCB,
0x44, # bit, 0, h
]

45 changes: 45 additions & 0 deletions sm83/tests/data/bit_0_ind_hl.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

[bit_set]
cycles = 12

[bit_set.entry_state]
h = 0x12
l = 0x34
flags = ['N']
memory = { 0x1234 = [0x1] }

[bit_set.exit_state]
h = 0x12
l = 0x34
flags = ['H']
pc = 2
memory = { 0x1234 = [0x1] }

[bit_set.program]
instructions = [
0xCB,
0x46, # bit, 0, [hl]
]

[bit_unset]
cycles = 12

[bit_unset.entry_state]
h = 0x12
l = 0x34
flags = ['N']
memory = { 0x1234 = [0xfe] }

[bit_unset.exit_state]
h = 0x12
l = 0x34
flags = ['H', 'Z']
pc = 2
memory = { 0x1234 = [0xfe] }

[bit_unset.program]
instructions = [
0xCB,
0x46, # bit, 0, [hl]
]

37 changes: 37 additions & 0 deletions sm83/tests/data/bit_0_l.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

[bit_set]
cycles = 8

[bit_set.entry_state]
l = 0x1
flags = ['N']

[bit_set.exit_state]
l = 0x1
flags = ['H']
pc = 2

[bit_set.program]
instructions = [
0xCB,
0x45, # bit, 0, l
]

[bit_unset]
cycles = 8

[bit_unset.entry_state]
l = 0xfe
flags = ['N']

[bit_unset.exit_state]
l = 0xfe
flags = ['H', 'Z']
pc = 2

[bit_unset.program]
instructions = [
0xCB,
0x45, # bit, 0, l
]

37 changes: 37 additions & 0 deletions sm83/tests/data/bit_1_a.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

[bit_set]
cycles = 8

[bit_set.entry_state]
a = 0x2
flags = ['N']

[bit_set.exit_state]
a = 0x2
flags = ['H']
pc = 2

[bit_set.program]
instructions = [
0xCB,
0x4f, # bit, 1, a
]

[bit_unset]
cycles = 8

[bit_unset.entry_state]
a = 0xfd
flags = ['N']

[bit_unset.exit_state]
a = 0xfd
flags = ['H', 'Z']
pc = 2

[bit_unset.program]
instructions = [
0xCB,
0x4f, # bit, 1, a
]

37 changes: 37 additions & 0 deletions sm83/tests/data/bit_1_b.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

[bit_set]
cycles = 8

[bit_set.entry_state]
b = 0x2
flags = ['N']

[bit_set.exit_state]
b = 0x2
flags = ['H']
pc = 2

[bit_set.program]
instructions = [
0xCB,
0x48, # bit, 1, b
]

[bit_unset]
cycles = 8

[bit_unset.entry_state]
b = 0xfd
flags = ['N']

[bit_unset.exit_state]
b = 0xfd
flags = ['H', 'Z']
pc = 2

[bit_unset.program]
instructions = [
0xCB,
0x48, # bit, 1, b
]

Loading

0 comments on commit 389b55d

Please sign in to comment.