diff --git a/src/boards/474.cpp b/src/boards/474.cpp new file mode 100644 index 00000000..f882ed46 --- /dev/null +++ b/src/boards/474.cpp @@ -0,0 +1,71 @@ +/* FCE Ultra - NES/Famicom Emulator + * + * Copyright notice for this file: + * Copyright (C) Akerasoft 2023 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * FDS Conversion + * + */ + +#include "mapinc.h" + +static DECLFR(M474ReadCart) { + return Page[A >> 14][A]; +} + +static void Sync(void) { + setchr8(0); + setprg16(0x4000, 0); + setprg16(0x8000, 1); + setprg16(0xC000, 2); +} + + +static void M474Power(void) { + SetupCartCHRMapping(0x00, &PRGptr[0][0xC000], 0x2000, 0); + // not modify fceux other code, + // fceux load prg is 64k, have 8k chr in 0xC000 + // fceux load chr is 8k,but 0xFF or 0x00 + SetReadHandler(0x4020, 0xFFFF, M474ReadCart); + Sync(); +} + +static void M474Power_submapper1(void) { + SetupCartCHRMapping(0x00, &PRGptr[0][0xC000], 0x2000, 0); + // not modify fceux other code, + // fceux load prg is 64k, have 8k chr in 0xC000 + // fceux load chr is 8k,but 0xFF or 0x00 + SetReadHandler(0x4800, 0xFFFF, M474ReadCart); + Sync(); +} + +static void StateRestore(int version) { + Sync(); +} + +void Mapper474_Init(CartInfo* info) { + if (info->submapper == 1) + { + info->Power = M474Power_submapper1; + } + else + { + // submapper 0 + info->Power = M474Power; + } + GameStateRestore = StateRestore; +} diff --git a/src/ines.cpp b/src/ines.cpp index be7543a6..477f0abe 100644 --- a/src/ines.cpp +++ b/src/ines.cpp @@ -793,6 +793,7 @@ BMAPPINGLocal bmap[] = { {"Impact Soft MMC3 Flash Board", 406, Mapper406_Init }, {"INX_007T_V01", 470, INX_007T_Init }, + {"Akerasoft NROM3XX", 474, Mapper474_Init }, {"KONAMI QTAi Board", 547, QTAi_Init }, diff --git a/src/ines.h b/src/ines.h index f1b0d231..1a59a324 100644 --- a/src/ines.h +++ b/src/ines.h @@ -277,6 +277,7 @@ void Mapper254_Init(CartInfo *); void Mapper255_Init(CartInfo *); void Mapper354_Init(CartInfo *); void Mapper406_Init(CartInfo *); +void Mapper474_Init(CartInfo*); void INX_007T_Init(CartInfo* info); diff --git a/vc/vc14_fceux.vcxproj b/vc/vc14_fceux.vcxproj index f5197ad8..d9b7fb3e 100644 --- a/vc/vc14_fceux.vcxproj +++ b/vc/vc14_fceux.vcxproj @@ -445,6 +445,7 @@ xcopy /y /d "$(ProjectDir)\..\src\drivers\win\7z_64.dll" "$(OutDir)" + @@ -1540,4 +1541,4 @@ xcopy /y /d "$(ProjectDir)\..\src\drivers\win\7z_64.dll" "$(OutDir)" - + \ No newline at end of file diff --git a/vc/vc14_fceux.vcxproj.filters b/vc/vc14_fceux.vcxproj.filters index 9392e42e..aee2e0e4 100644 --- a/vc/vc14_fceux.vcxproj.filters +++ b/vc/vc14_fceux.vcxproj.filters @@ -1121,6 +1121,11 @@ boards + + + + boards + @@ -1630,6 +1635,9 @@ drivers\win + + +