Fix mirroring on KS7030 board

This commit is contained in:
negativeExponent
2020-03-06 14:13:36 +08:00
parent b2e6d27f9a
commit b00b8031fc

View File

@@ -25,6 +25,17 @@
* *
*/ */
/* 2020-3-6 - update mirroring (negativeExponent)
/* PRG-ROM Bank Select #1/Mirroring Select ($8000-$8FFF, write)
* A~FEDC BA98 7654 3210
* -------------------
* 1000 .... .... MBBB
* |+++- Select 4 KiB PRG-ROM bank at CPU $7000-$7FFF
* +---- Select nametable mirroring type
* 0: Vertical
* 1: Horizontal
*/
#include "mapinc.h" #include "mapinc.h"
#include "../fds_apu.h" #include "../fds_apu.h"
@@ -42,8 +53,9 @@ static SFORMAT StateRegs[] =
static void Sync(void) { static void Sync(void) {
setchr8(0); setchr8(0);
setprg32(0x8000, ~0); setprg32(0x8000, ~0);
setprg4(0xb800, reg0); setprg4(0xb800, reg0 & 0x07);
setprg4(0xc800, 8 + reg1); setprg4(0xc800, 8 + reg1);
setmirror(((reg0 >> 3) & 1) ^ 1);
} }
/* 6000 - 6BFF - RAM /* 6000 - 6BFF - RAM
@@ -99,12 +111,12 @@ static DECLFR(UNLKS7030RamRead1) {
} }
static DECLFW(UNLKS7030Write0) { static DECLFW(UNLKS7030Write0) {
reg0 = A & 7; reg0 = A & 0xF;
Sync(); Sync();
} }
static DECLFW(UNLKS7030Write1) { static DECLFW(UNLKS7030Write1) {
reg1 = A & 15; reg1 = A & 0xF;
Sync(); Sync();
} }