rainbow: renaming

- removed rainbow13
- renamed rainbow2 to rainbow
This commit is contained in:
contact@brokestudio.fr 2023-11-02 18:51:28 +01:00
parent a4cc481ac5
commit 790bfeeab2
7 changed files with 55 additions and 1417 deletions

View File

@ -503,10 +503,9 @@ set(SRC_CORE
${CMAKE_CURRENT_SOURCE_DIR}/boards/vrc7p.cpp ${CMAKE_CURRENT_SOURCE_DIR}/boards/vrc7p.cpp
${CMAKE_CURRENT_SOURCE_DIR}/boards/yoko.cpp ${CMAKE_CURRENT_SOURCE_DIR}/boards/yoko.cpp
${CMAKE_CURRENT_SOURCE_DIR}/boards/inx007t.cpp ${CMAKE_CURRENT_SOURCE_DIR}/boards/inx007t.cpp
${CMAKE_CURRENT_SOURCE_DIR}/boards/RNBW/pping.c ${CMAKE_CURRENT_SOURCE_DIR}/boards/RNBW/pping.c
${CMAKE_CURRENT_SOURCE_DIR}/boards/rainbow_esp.cpp ${CMAKE_CURRENT_SOURCE_DIR}/boards/rainbow_esp.cpp
${CMAKE_CURRENT_SOURCE_DIR}/boards/rainbow13.cpp ${CMAKE_CURRENT_SOURCE_DIR}/boards/rainbow.cpp
${CMAKE_CURRENT_SOURCE_DIR}/boards/rainbow2.cpp
${CMAKE_CURRENT_SOURCE_DIR}/input/arkanoid.cpp ${CMAKE_CURRENT_SOURCE_DIR}/input/arkanoid.cpp
${CMAKE_CURRENT_SOURCE_DIR}/input/bworld.cpp ${CMAKE_CURRENT_SOURCE_DIR}/input/bworld.cpp
${CMAKE_CURRENT_SOURCE_DIR}/input/cursor.cpp ${CMAKE_CURRENT_SOURCE_DIR}/input/cursor.cpp

View File

@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
// mapper 682 - Rainbow2 board v1.0 revA and v1.1 by Broke Studio // mapper 682 - Rainbow board v1.0 revA and v1.1 by Broke Studio
// //
// documentation available here: https://github.com/BrokeStudio/rainbow-lib // documentation available here: https://github.com/BrokeStudio/rainbow-lib
@ -79,7 +79,7 @@
#define PPUON (PPU[1] & 0x18) //PPU should operate #define PPUON (PPU[1] & 0x18) //PPU should operate
#define Sprite16 (PPU[0] & 0x20) //Sprites 8x16/8x8 #define Sprite16 (PPU[0] & 0x20) //Sprites 8x16/8x8
static void Rainbow2Reset(void); static void RainbowReset(void);
static uint8 prg_rom_mode, prg_ram_mode, bootrom; static uint8 prg_rom_mode, prg_ram_mode, bootrom;
static uint16 prg[11]; // 0: $5000, 1: $6000, 2: $7000, 3: $8000, 4: $9000, etc static uint16 prg[11]; // 0: $5000, 1: $6000, 2: $7000, 3: $8000, 4: $9000, etc
@ -155,7 +155,7 @@ static SFORMAT FlashRegs[] =
{ 0 } { 0 }
}; };
static SFORMAT Rainbow2StateRegs[] = static SFORMAT RainbowStateRegs[] =
{ {
{ prg, 11, "PRG" }, { prg, 11, "PRG" },
{ chr, 16, "CHR" }, { chr, 16, "CHR" },
@ -234,7 +234,7 @@ static void IRQEnd() {
} }
} }
static void Rainbow2IRQ(int a) { static void RainbowIRQ(int a) {
// Scanline IRQ // Scanline IRQ
int sl = newppu_get_scanline()-1; int sl = newppu_get_scanline()-1;
@ -585,7 +585,7 @@ static DECLFR(RNBW_RstPowRd) {
if (A == 0xFFFC) reset_step = 1; if (A == 0xFFFC) reset_step = 1;
else if ((A == 0xFFFD) & (reset_step == 1)) else if ((A == 0xFFFD) & (reset_step == 1))
{ {
Rainbow2Reset(); RainbowReset();
reset_step = 0; reset_step = 0;
} }
else reset_step = 0; else reset_step = 0;
@ -817,7 +817,7 @@ static DECLFW(RNBW_0x4100Wr) {
break; break;
case 0x41FF: case 0x41FF:
bootrom = V & 0x01; bootrom = V & 0x01;
if (bootrom == 0) Rainbow2Reset(); // a bit hacky but does the job for testing if (bootrom == 0) RainbowReset(); // a bit hacky but does the job for testing
Sync(); Sync();
break; break;
case 0x4240: case 0x4240:
@ -834,7 +834,7 @@ static DECLFW(RNBW_0x4100Wr) {
} }
extern uint32 NTRefreshAddr; extern uint32 NTRefreshAddr;
uint8 FASTCALL Rainbow2PPURead(uint32 A) { uint8 FASTCALL RainbowPPURead(uint32 A) {
int xt = NTRefreshAddr & 31; int xt = NTRefreshAddr & 31;
int yt = (NTRefreshAddr >> 5) & 31; int yt = (NTRefreshAddr >> 5) & 31;
@ -982,7 +982,7 @@ uint8 FASTCALL Rainbow2PPURead(uint32 A) {
} }
} }
uint8 Rainbow2FlashID(uint8 chip, uint32 A) { uint8 RainbowFlashID(uint8 chip, uint32 A) {
// Software ID mode is undefined by the datasheet for all but the lowest 2 addressable bytes, // Software ID mode is undefined by the datasheet for all but the lowest 2 addressable bytes,
// but some tests of the chip currently being used found it repeats in 512-byte patterns. // but some tests of the chip currently being used found it repeats in 512-byte patterns.
// http://forums.nesdev.com/viewtopic.php?p=178728#p178728 // http://forums.nesdev.com/viewtopic.php?p=178728#p178728
@ -1030,16 +1030,16 @@ uint8 Rainbow2FlashID(uint8 chip, uint32 A) {
} }
} }
uint8 FASTCALL Rainbow2FlashChrID(uint32 A) { uint8 FASTCALL RainbowFlashChrID(uint32 A) {
return Rainbow2FlashID(CHIP_TYPE_CHR, A); return RainbowFlashID(CHIP_TYPE_CHR, A);
} }
static DECLFR(Rainbow2FlashPrgID) static DECLFR(RainbowFlashPrgID)
{ {
return Rainbow2FlashID(CHIP_TYPE_PRG, A); return RainbowFlashID(CHIP_TYPE_PRG, A);
} }
void Rainbow2FlashIDEnter(uint8 chip) void RainbowFlashIDEnter(uint8 chip)
{ {
switch (chip) switch (chip)
{ {
@ -1048,9 +1048,9 @@ void Rainbow2FlashIDEnter(uint8 chip)
return; return;
flash_id[chip] = 1; flash_id[chip] = 1;
if (bootrom) if (bootrom)
SetReadHandler(0x6000, 0xDFFF, Rainbow2FlashPrgID); SetReadHandler(0x6000, 0xDFFF, RainbowFlashPrgID);
else else
SetReadHandler(0x6000, 0xFFFF, Rainbow2FlashPrgID); SetReadHandler(0x6000, 0xFFFF, RainbowFlashPrgID);
break; break;
case CHIP_TYPE_CHR: case CHIP_TYPE_CHR:
if (CHR_FLASHROM == NULL) if (CHR_FLASHROM == NULL)
@ -1058,14 +1058,14 @@ void Rainbow2FlashIDEnter(uint8 chip)
if (flash_id[chip]) if (flash_id[chip])
return; return;
flash_id[chip] = 1; flash_id[chip] = 1;
FFCEUX_PPURead = Rainbow2FlashChrID; FFCEUX_PPURead = RainbowFlashChrID;
break; break;
default: default:
return; return;
} }
} }
void Rainbow2FlashIDExit(uint8 chip) void RainbowFlashIDExit(uint8 chip)
{ {
switch (chip) switch (chip)
{ {
@ -1079,14 +1079,14 @@ void Rainbow2FlashIDExit(uint8 chip)
if (!flash_id[chip]) if (!flash_id[chip])
return; return;
flash_id[chip] = 0; flash_id[chip] = 0;
FFCEUX_PPURead = Rainbow2PPURead; FFCEUX_PPURead = RainbowPPURead;
break; break;
default: default:
return; return;
} }
} }
void Rainbow2Flash(uint8 chip, uint32 flash_addr, uint8 V) { void RainbowFlash(uint8 chip, uint32 flash_addr, uint8 V) {
uint32 command_addr = flash_addr & 0x0FFF; uint32 command_addr = flash_addr & 0x0FFF;
@ -1110,7 +1110,7 @@ void Rainbow2Flash(uint8 chip, uint32 flash_addr, uint8 V) {
} }
else if (V == 0xF0) else if (V == 0xF0)
{ {
Rainbow2FlashIDExit(chip); RainbowFlashIDExit(chip);
} }
break; break;
case flash_mode_COMMAND: case flash_mode_COMMAND:
@ -1136,8 +1136,8 @@ void Rainbow2Flash(uint8 chip, uint32 flash_addr, uint8 V) {
case 0x20: flash_mode[chip] = flash_mode_UNLOCK_BYPASS; break; case 0x20: flash_mode[chip] = flash_mode_UNLOCK_BYPASS; break;
case 0xA0: flash_mode[chip] = flash_mode_BYTE_WRITE; break; case 0xA0: flash_mode[chip] = flash_mode_BYTE_WRITE; break;
case 0x80: flash_mode[chip] = flash_mode_ERASE; break; case 0x80: flash_mode[chip] = flash_mode_ERASE; break;
case 0x90: Rainbow2FlashIDEnter(chip); flash_mode[chip] = flash_mode_READY; break; case 0x90: RainbowFlashIDEnter(chip); flash_mode[chip] = flash_mode_READY; break;
case 0xF0: Rainbow2FlashIDExit(chip); flash_mode[chip] = flash_mode_READY; break; case 0xF0: RainbowFlashIDExit(chip); flash_mode[chip] = flash_mode_READY; break;
} }
} }
else else
@ -1438,10 +1438,10 @@ static DECLFW(RNBW_0x6000Wr) {
return CartBW(A, V); return CartBW(A, V);
} }
} }
Rainbow2Flash(CHIP_TYPE_PRG, flash_addr, V); RainbowFlash(CHIP_TYPE_PRG, flash_addr, V);
} }
static void Rainbow2PPUWrite(uint32 A, uint8 V) { static void RainbowPPUWrite(uint32 A, uint8 V) {
/* /*
// if CHR-RAM but CHR-RAM does not exist then return // if CHR-RAM but CHR-RAM does not exist then return
if (chr_chip == CHR_CHIP_RAM && CHRRAM == NULL) if (chr_chip == CHR_CHIP_RAM && CHRRAM == NULL)
@ -1479,13 +1479,13 @@ static void Rainbow2PPUWrite(uint32 A, uint8 V) {
flash_addr |= (chr[A >> 9] & 0xffff) << 9; flash_addr |= (chr[A >> 9] & 0xffff) << 9;
break; break;
} }
Rainbow2Flash(CHIP_TYPE_CHR, flash_addr, V); RainbowFlash(CHIP_TYPE_CHR, flash_addr, V);
} }
} }
FFCEUX_PPUWrite_Default(A, V); FFCEUX_PPUWrite_Default(A, V);
} }
static void Rainbow2Reset(void) { static void RainbowReset(void) {
// reset // reset
reset_step = 0; reset_step = 0;
@ -1537,12 +1537,12 @@ static void Rainbow2Reset(void) {
Sync(); Sync();
} }
static void Rainbow2Power(void) { static void RainbowPower(void) {
// mapper init // mapper init
if (MiscROMS) bootrom = 1; if (MiscROMS) bootrom = 1;
else bootrom = 0; else bootrom = 0;
Rainbow2Reset(); RainbowReset();
// reset-power vectors // reset-power vectors
SetReadHandler(0xFFFC, 0xFFFF, RNBW_RstPowRd); SetReadHandler(0xFFFC, 0xFFFF, RNBW_RstPowRd);
@ -1621,7 +1621,7 @@ static void Rainbow2Power(void) {
//rx_index = 0; //rx_index = 0;
} }
static void Rainbow2Close(void) static void RainbowClose(void)
{ {
if (WRAM) if (WRAM)
{ {
@ -1862,7 +1862,7 @@ static void DoSawVHQ(void) {
cvbc[2] = SOUNDTS; cvbc[2] = SOUNDTS;
} }
void Rainbow2Sound(int Count) { void RainbowSound(int Count) {
int x; int x;
DoSQV1(); DoSQV1();
@ -1872,22 +1872,22 @@ void Rainbow2Sound(int Count) {
cvbc[x] = Count; cvbc[x] = Count;
} }
void Rainbow2SoundHQ(void) { void RainbowSoundHQ(void) {
DoSQV1HQ(); DoSQV1HQ();
DoSQV2HQ(); DoSQV2HQ();
DoSawVHQ(); DoSawVHQ();
} }
void Rainbow2SyncHQ(int32 ts) { void RainbowSyncHQ(int32 ts) {
int x; int x;
for (x = 0; x < 3; x++) cvbc[x] = ts; for (x = 0; x < 3; x++) cvbc[x] = ts;
} }
static void Rainbow2ESI(void) { static void RainbowESI(void) {
GameExpSound.RChange = Rainbow2ESI; GameExpSound.RChange = RainbowESI;
GameExpSound.Fill = Rainbow2Sound; GameExpSound.Fill = RainbowSound;
GameExpSound.HiFill = Rainbow2SoundHQ; GameExpSound.HiFill = RainbowSoundHQ;
GameExpSound.HiSync = Rainbow2SyncHQ; GameExpSound.HiSync = RainbowSyncHQ;
memset(cvbc, 0, sizeof(cvbc)); memset(cvbc, 0, sizeof(cvbc));
memset(vcount, 0, sizeof(vcount)); memset(vcount, 0, sizeof(vcount));
@ -1917,18 +1917,18 @@ static void Rainbow2ESI(void) {
// NSF Init // NSF Init
void NSFRainbow2_Init(void) { void NSFRainbow_Init(void) {
Rainbow2ESI(); RainbowESI();
SetWriteHandler(0x8000, 0xbfff, RNBW_ExpAudioWr); SetWriteHandler(0x8000, 0xbfff, RNBW_ExpAudioWr);
} }
#endif #endif
// mapper init // mapper init
void RAINBOW2_Init(CartInfo *info) { void RAINBOW_Init(CartInfo *info) {
info->Power = Rainbow2Power; info->Power = RainbowPower;
info->Reset = Rainbow2Reset; info->Reset = RainbowReset;
info->Close = Rainbow2Close; info->Close = RainbowClose;
RNBWbattery = info->battery; RNBWbattery = info->battery;
@ -2070,11 +2070,11 @@ void RAINBOW2_Init(CartInfo *info) {
SetupCartPRGMapping(0x13, MiscROMS, MiscROMS_size, 0); SetupCartPRGMapping(0x13, MiscROMS, MiscROMS_size, 0);
} }
FFCEUX_PPURead = Rainbow2PPURead; FFCEUX_PPURead = RainbowPPURead;
FFCEUX_PPUWrite = Rainbow2PPUWrite; FFCEUX_PPUWrite = RainbowPPUWrite;
//GameHBIRQHook = Rainbow2hb; //GameHBIRQHook = Rainbowhb;
MapIRQHook = Rainbow2IRQ; MapIRQHook = RainbowIRQ;
RNBWHack = 1; RNBWHack = 1;
RNBWHackNTcontrol[0] = 0; RNBWHackNTcontrol[0] = 0;
RNBWHackNTcontrol[1] = 0; RNBWHackNTcontrol[1] = 0;
@ -2083,9 +2083,9 @@ void RAINBOW2_Init(CartInfo *info) {
RNBWHackVROMPtr = FPGA_RAM; RNBWHackVROMPtr = FPGA_RAM;
RNBWHackVROMMask = FPGA_RAMSIZE - 1; RNBWHackVROMMask = FPGA_RAMSIZE - 1;
RNBWHackExNTARAMPtr = FPGA_RAM; RNBWHackExNTARAMPtr = FPGA_RAM;
Rainbow2ESI(); RainbowESI();
GameStateRestore = StateRestore; GameStateRestore = StateRestore;
AddExState(&FlashRegs, ~0, 0, 0); AddExState(&FlashRegs, ~0, 0, 0);
AddExState(&Rainbow2StateRegs, ~0, 0, 0); AddExState(&RainbowStateRegs, ~0, 0, 0);
} }

File diff suppressed because it is too large Load Diff

View File

@ -804,8 +804,7 @@ BMAPPINGLocal bmap[] = {
{"KONAMI QTAi Board", 547, QTAi_Init }, {"KONAMI QTAi Board", 547, QTAi_Init },
{"RAINBOW2", 682, RAINBOW2_Init }, {"RAINBOW", 682, RAINBOW_Init },
{"RAINBOW13", 3872, RAINBOW13_Init },
{"", 0, NULL} {"", 0, NULL}
}; };

View File

@ -62,8 +62,7 @@ void MHROM_Init(CartInfo *info);
void QTAi_Init(CartInfo *info); void QTAi_Init(CartInfo *info);
void NROM_Init(CartInfo *info); void NROM_Init(CartInfo *info);
void Novel_Init(CartInfo *info); void Novel_Init(CartInfo *info);
void RAINBOW13_Init(CartInfo *info); void RAINBOW_Init(CartInfo *info);
void RAINBOW2_Init(CartInfo *info);
void S74LS374NA_Init(CartInfo *info); void S74LS374NA_Init(CartInfo *info);
void S74LS374N_Init(CartInfo *info); void S74LS374N_Init(CartInfo *info);
void S8259A_Init(CartInfo *info); void S8259A_Init(CartInfo *info);

View File

@ -505,9 +505,8 @@ xcopy /y /d "$(ProjectDir)\..\src\drivers\win\7z_64.dll" "$(OutDir)"</Command>
<ClCompile Include="..\src\boards\mmc2and4.cpp" /> <ClCompile Include="..\src\boards\mmc2and4.cpp" />
<ClCompile Include="..\src\boards\onebus.cpp" /> <ClCompile Include="..\src\boards\onebus.cpp" />
<ClCompile Include="..\src\boards\pec-586.cpp" /> <ClCompile Include="..\src\boards\pec-586.cpp" />
<ClCompile Include="..\src\boards\rainbow2.cpp" /> <ClCompile Include="..\src\boards\rainbow.cpp" />
<ClCompile Include="..\src\boards\rainbow_esp.cpp" /> <ClCompile Include="..\src\boards\rainbow_esp.cpp" />
<ClCompile Include="..\src\boards\rainbow13.cpp" />
<ClCompile Include="..\src\boards\RNBW\pping.c" /> <ClCompile Include="..\src\boards\RNBW\pping.c" />
<ClCompile Include="..\src\boards\rt-01.cpp" /> <ClCompile Include="..\src\boards\rt-01.cpp" />
<ClCompile Include="..\src\boards\sa-9602b.cpp" /> <ClCompile Include="..\src\boards\sa-9602b.cpp" />

View File

@ -841,9 +841,6 @@
<ClCompile Include="..\src\boards\rainbow_esp.cpp"> <ClCompile Include="..\src\boards\rainbow_esp.cpp">
<Filter>boards</Filter> <Filter>boards</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\src\boards\rainbow13.cpp">
<Filter>boards</Filter>
</ClCompile>
<ClCompile Include="..\src\boards\sa-9602b.cpp"> <ClCompile Include="..\src\boards\sa-9602b.cpp">
<Filter>boards</Filter> <Filter>boards</Filter>
</ClCompile> </ClCompile>
@ -1130,13 +1127,10 @@
<ClCompile Include="..\src\boards\rainbow_esp.cpp"> <ClCompile Include="..\src\boards\rainbow_esp.cpp">
<Filter>boards</Filter> <Filter>boards</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\src\boards\rainbow13.cpp">
<Filter>boards</Filter>
</ClCompile>
<ClCompile Include="..\src\boards\RNBW\pping.c"> <ClCompile Include="..\src\boards\RNBW\pping.c">
<Filter>boards</Filter> <Filter>boards</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\src\boards\rainbow2.cpp"> <ClCompile Include="..\src\boards\rainbow.cpp">
<Filter>boards</Filter> <Filter>boards</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\src\utils\mutex.cpp" /> <ClCompile Include="..\src\utils\mutex.cpp" />