Skip to content

Commit

Permalink
xenium: Double read/write banking selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryzee119 authored Mar 22, 2024
1 parent a9df318 commit d3d6cdb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/xenium/xenium.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ static uint8_t _io_input(uint16_t address) {

// IO CONTROL INTERFACE
static inline void xenium_set_bank(uint8_t bank) {
uint8_t reg = _io_input(XENIUM_REGISTER_BANKING);
uint8_t reg;
// Double read/write for extra sanity
reg = _io_input(XENIUM_REGISTER_BANKING);
reg = _io_input(XENIUM_REGISTER_BANKING);'
reg &= 0xF0;
reg |= bank & 0x0F;
_io_output(XENIUM_REGISTER_BANKING, reg);
_io_output(XENIUM_REGISTER_BANKING, reg);
}

static inline uint8_t xenium_get_bank() {
Expand Down

0 comments on commit d3d6cdb

Please sign in to comment.