Skip to content

Commit

Permalink
Make ARM tests mimic m68k behaviour of signed char by default
Browse files Browse the repository at this point in the history
This way we can use `s8` from the SGDK.
  • Loading branch information
rhargreaves committed Jul 23, 2024
1 parent b993d25 commit b8b564a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/midi.c
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ void midi_tick(void)
if (state->midiChannel == chan && state->noteOn) {

u8 pitch = state->pitch;
signed char cents = state->cents;
s8 cents = state->cents;

if (midiChannel->glideTargetPitch > pitch) {
cents += 10;
Expand All @@ -945,8 +945,8 @@ void midi_tick(void)
state->ops->pitch(state->number, pitch, cents);
state->pitch = pitch;
state->cents = cents;
} else if (midiChannel->glideTargetPitch < pitch || (midiChannel->glideTargetPitch
== pitch && cents > 0)) {
} else if (midiChannel->glideTargetPitch < pitch
|| (midiChannel->glideTargetPitch == pitch && cents > 0)) {
cents -= 10;
if (cents == -10) {
pitch--;
Expand Down
2 changes: 1 addition & 1 deletion src/midi.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ typedef struct DeviceChannel {
u8 volume;
u8 pan;
u16 pitchBend;
signed char cents;
s8 cents;
} DeviceChannel;

void midi_init(const FmChannel** defaultPresets, const PercussionPreset** defaultPercussionPresets,
Expand Down
3 changes: 2 additions & 1 deletion tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ CFLAGS=$(INCLUDE_DIRS) \
-Wno-char-subscripts \
-Wno-unused-parameter \
-Wno-builtin-declaration-mismatch \
-Wno-unused-function
-Wno-unused-function \
-fsigned-char

# list of function signature to mock
MOCKS=midi_process \
Expand Down

0 comments on commit b8b564a

Please sign in to comment.