Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
jaxe
Commits
1cc66501
Commit
1cc66501
authored
Jun 28, 2022
by
KurtJD
Browse files
Add new opcode test ROM and implement VF reset quirk
parent
84862432
Changes
5
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
1cc66501
...
...
@@ -121,6 +121,7 @@ Also includes flags for disabling specific S-CHIP "quirks" (which are all enable
`-6`
Allow sprite wrapping
`-7`
Disable collision enumeration
`-8`
Disable collision check with bottom of screen
`-9`
Enable VF reset on logical OR, AND, XOR
## Controls
...
...
include/chip8.h
View file @
1cc66501
...
...
@@ -29,7 +29,7 @@
#define NUM_KEYS 16
#define NUM_REGISTERS 16
#define NUM_USER_FLAGS 16
#define NUM_QUIRKS
9
#define NUM_QUIRKS
10
#define NUM_BITPLANES 3
#define NUM_FONT_BYTES 80
#define NUM_BIG_FONT_BYTES 160
...
...
roms/optests/chip8-test-suite.ch8
0 → 100644
View file @
1cc66501
File added
src/chip8.c
View file @
1cc66501
...
...
@@ -452,21 +452,42 @@ void chip8_execute(CHIP8 *chip8)
break
;
/* OR Vx, Vy (8xy1)
Set Vx = Vx OR Vy. */
Set Vx = Vx OR Vy.
Legacy: Set VF = 0.
S-CHIP: Leave VF alone. */
case
0x01
:
chip8
->
V
[
x
]
|=
chip8
->
V
[
y
];
if
(
!
chip8
->
quirks
[
9
])
{
chip8
->
V
[
0x0F
]
=
0
;
}
break
;
/* AND Vx, Vy (8xy2)
Set Vx = Vx AND Vy. */
Set Vx = Vx AND Vy.
Legacy: Set VF = 0.
S-CHIP: Leave VF alone. */
case
0x02
:
chip8
->
V
[
x
]
&=
chip8
->
V
[
y
];
if
(
!
chip8
->
quirks
[
9
])
{
chip8
->
V
[
0x0F
]
=
0
;
}
break
;
/* XOR Vx, Vy (8xy3)
Set Vx = Vx XOR Vy. */
Set Vx = Vx XOR Vy.
Legacy: Set VF = 0.
S-CHIP: Leave VF alone. */
case
0x03
:
chip8
->
V
[
x
]
^=
chip8
->
V
[
y
];
if
(
!
chip8
->
quirks
[
9
])
{
chip8
->
V
[
0x0F
]
=
0
;
}
break
;
/* ADD Vx, Vy (8xy4)
...
...
src/main.c
View file @
1cc66501
...
...
@@ -38,7 +38,7 @@ unsigned long cpu_freq = CPU_FREQ_DEFAULT;
unsigned
long
timer_freq
=
TIMER_FREQ_DEFAULT
;
unsigned
long
refresh_freq
=
REFRESH_FREQ_DEFAULT
;
bool
play_sound
=
false
;
bool
quirks
[
NUM_QUIRKS
]
=
{
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
};
bool
quirks
[
NUM_QUIRKS
]
=
{
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
};
bool
load_dmp
=
false
;
// Color/Display
...
...
@@ -285,6 +285,7 @@ bool handle_args(int argc, char **argv)
case
'6'
:
case
'7'
:
case
'8'
:
case
'9'
:
quirks
[
opt
-
'0'
]
=
false
;
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment