Skip to content

Commit

Permalink
Be slow for speed sensitive OPL games
Browse files Browse the repository at this point in the history
  • Loading branch information
polpo committed Mar 26, 2024
1 parent 8fe44b8 commit 665d854
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions sw/picogus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,14 +346,11 @@ __force_inline void handle_iow(void) {
return;
break;
case 0x9:
// Fast write
pio_sm_put(pio0, IOW_PIO_SM, IO_END);
pio_sm_put(pio0, IOW_PIO_SM, IO_WAIT);
opl_buffer.cmds[opl_buffer.head++] = {
OPL_DATA_PORT,
(uint8_t)(iow_read & 0xFF)
};
// Fast write - return early as we've already written 0x0u to the PIO
return;
break;
// DSP ports
default:
Expand All @@ -373,14 +370,12 @@ __force_inline void handle_iow(void) {
// Fast write - return early as we've already written 0x0u to the PIO
return;
} else if (port == adlib_basePort + 1) {
// Fast write
pio_sm_put(pio0, IOW_PIO_SM, IO_END);
pio_sm_put(pio0, IOW_PIO_SM, IO_WAIT);
busy_wait_us(1); // busy wait for speed sensitive games :(
opl_buffer.cmds[opl_buffer.head++] = {
OPL_DATA_PORT,
(uint8_t)(iow_read & 0xFF)
};
// Fast write - return early as we've already written 0x0u to the PIO
return;
} else // if follows down below
#endif // SOUND_SB
#ifdef SOUND_MPU
Expand Down

0 comments on commit 665d854

Please sign in to comment.