Skip to content

Commit

Permalink
Merge pull request #7 from mywave82/even-data-express
Browse files Browse the repository at this point in the history
Ensure that writes to GPIO extended writes both bank A and B (needed for OPL3 Express)
  • Loading branch information
ReimuNotMoe committed Jul 6, 2023
2 parents 1b0995b + aed3c7f commit 6480947
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions RetroWaveLib/Board/OPL3.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void retrowave_opl3_emit_port1(RetroWaveContext *ctx, uint8_t reg, uint8_t val)
}

void retrowave_opl3_reset(RetroWaveContext *ctx) {
uint8_t buf[] = {RetroWave_Board_OPL3, 0x12, 0xfe};
uint8_t buf[] = {RetroWave_Board_OPL3, 0x12, 0xfe, 0x00};
ctx->callback_io(ctx->user_data, transfer_speed / 10, buf, NULL, sizeof(buf));
buf[2] = 0xff;
ctx->callback_io(ctx->user_data, transfer_speed / 10, buf, NULL, sizeof(buf));
Expand All @@ -93,4 +93,4 @@ void retrowave_opl3_mute(RetroWaveContext *ctx) {
retrowave_opl3_emit_port0(ctx, i, i >= 0x40 && i <= 0x55 ? 0xFF : 0x00);
retrowave_opl3_emit_port1(ctx, i, i >= 0x40 && i <= 0x55 ? 0xFF : 0x00);
}
}
}
3 changes: 2 additions & 1 deletion RetroWaveLib/RetroWave.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ void retrowave_io_init(RetroWaveContext *ctx) {
uint8_t init_sequence_1[] = {
0x00,
0x0a, // IOCON register
0x28 // Enable: HAEN, SEQOP
0x28, // Enable: HAEN, SEQOP
0x28
};

uint8_t init_sequence_2[] = {
Expand Down

0 comments on commit 6480947

Please sign in to comment.