aboutsummaryrefslogtreecommitdiffstats
path: root/src/devices.c
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2023-08-31 09:57:45 +0200
committerBad Diode <bd@badd10de.dev>2023-08-31 09:57:45 +0200
commit66daaf81e953bc0d44cf0309f945f76c97d0ede4 (patch)
treed0794be583460ac39e365ab2ddd348c4f0a5d699 /src/devices.c
parentea85184fdadf08760aa8f88871f96ddf8dde2914 (diff)
downloaduxngba-66daaf81e953bc0d44cf0309f945f76c97d0ede4.tar.gz
uxngba-66daaf81e953bc0d44cf0309f945f76c97d0ede4.zip
Fix bank switching
Diffstat (limited to 'src/devices.c')
-rw-r--r--src/devices.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/devices.c b/src/devices.c
index 2146bd3..49fc4ac 100644
--- a/src/devices.c
+++ b/src/devices.c
@@ -108,9 +108,9 @@ deo_screen(u8 *dev, u8 port) {
108void 108void
109deo_system(u8 *dev, u8 port) { 109deo_system(u8 *dev, u8 port) {
110 switch(port) { 110 switch(port) {
111 case 0x3: { 111 case 0x2: {
112 // Rom bank switching (Needs testing). 112 // Rom bank switching.
113 u16 addr = PEEK2(dev + 0x2); 113 u16 addr = PEEK2(dev + port);
114 if(uxn_ram[addr] == 0x01) { 114 if(uxn_ram[addr] == 0x01) {
115 u16 length = PEEK2(uxn_ram + addr + 1); 115 u16 length = PEEK2(uxn_ram + addr + 1);
116 u16 a_page = PEEK2(uxn_ram + addr + 1 + 2); 116 u16 a_page = PEEK2(uxn_ram + addr + 1 + 2);