From 1e13b733cae4aab49b849100aac984142ebf5a05 Mon Sep 17 00:00:00 2001 From: Jesper Gravgaard Date: Mon, 14 Dec 2020 18:09:53 +0100 Subject: [PATCH] Fixed VIA addresses. #581 --- src/main/kc/include/cx16-vera.h | 2 ++ src/main/kc/include/cx16.h | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/kc/include/cx16-vera.h b/src/main/kc/include/cx16-vera.h index aa11ac149..6d72e759e 100644 --- a/src/main/kc/include/cx16-vera.h +++ b/src/main/kc/include/cx16-vera.h @@ -8,6 +8,7 @@ // These 3 registers are multiplexed using the ADDR_SEL in the CTRL register. // When ADDR_SEL = 0, ADDRx_L/ADDRx_M/ADDRx_H become ADDR0_L/ADDR0_M/ADDR0_H. // When ADDR_SEL = 1, ADDRx_L/ADDRx_M/ADDRx_H become ADDR1_L/ADDR1_M/ADDR1_H. +// See https://github.com/commanderx16/x16-emulator/wiki/(VERA-0.8)-Registers-$9F23-and-$9F24-(and-$9F25) // $9F20 VRAM Address (7:0) char * const VERA_ADDRC_L = 0x9f20; @@ -55,6 +56,7 @@ char * const VERA_ISR = 0x9f27; // Note that bit 8 of this value is present in the IEN register. // For interlaced modes the interrupt will be generated each field and the bit 0 of IRQ_LINE is ignored. char * const VERA_IRQLINE_L = 0x9f28; + // $9F29 DC_VIDEO (DCSEL=0) // Bit 7: Current Field Read-only bit which reflects the active interlaced field in composite and RGB modes. (0: even, 1: odd) // Bit 6: Sprites Enable Enable output from the Sprites renderer diff --git a/src/main/kc/include/cx16.h b/src/main/kc/include/cx16.h index 76436de25..1a416a976 100644 --- a/src/main/kc/include/cx16.h +++ b/src/main/kc/include/cx16.h @@ -9,7 +9,7 @@ // Port A Bits 0-7 RAM bank // Port B Bits 0-2 ROM bank // Port B Bits 3-7 [TBD] -struct MOS6522_VIA * const VIA1 = 0x9160; +struct MOS6522_VIA * const VIA1 = 0x9f60; // The VIA#2: Keyboard/Joy/Mouse // Port A Bit 0 KBD PS/2 DAT // Port A Bit 1 KBD PS/2 CLK @@ -23,7 +23,7 @@ struct MOS6522_VIA * const VIA1 = 0x9160; // Port B Bit 1 MOUSE PS/2 CLK // Port B Bits 2-7 [TBD] // NOTE: The pin assignment of the NES/SNES controller is likely to change. -struct MOS6522_VIA * const VIA2 = 0x9070; +struct MOS6522_VIA * const VIA2 = 0x9f70; // Interrupt Vectors // https://github.com/commanderx16/x16-emulator/wiki/(ASM-Programming)-Interrupts-and-interrupt-handling