diff --git a/src/boards/378.c b/src/boards/378.c new file mode 100644 index 0000000..8e595d0 --- /dev/null +++ b/src/boards/378.c @@ -0,0 +1,39 @@ +/* FCE Ultra - NES/Famicom Emulator + * + * Copyright notice for this file: + * Copyright (C) 2025 NewRisingSun + * + * 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 + */ + +#include "mapinc.h" +#include "asic_latch.h" + +static void sync () { + if (Latch_data &0x20) { + setprg16(0x8000, 0x10 | Latch_data <<1 &0x0E | Latch_data >>3 &0x01); + setprg16(0xC000, 0x10 | Latch_data <<1 &0x0E | 0x07); + setmirror(Latch_data &0x04? MI_H: MI_V); + } else { + setprg32(0x8000, Latch_data &0x07); + setmirror(Latch_data &0x10? MI_1: MI_0); + } + setchr8(0); +} + +void Mapper378_Init (CartInfo *info) { + Latch_init(info, sync, 0x8000, 0xFFFF, NULL); + info->Reset = Latch_clear; +} diff --git a/src/ines.c b/src/ines.c index 8e98837..fba0f83 100644 --- a/src/ines.c +++ b/src/ines.c @@ -820,6 +820,7 @@ INES_BOARD_BEGIN() INES_BOARD( "135-in-1", 375, Mapper375_Init ) INES_BOARD( "YY841155C", 376, Mapper376_Init ) INES_BOARD( "JY-111/JY-112", 377, Mapper377_Init ) + INES_BOARD( "8-in-1 AOROM+UNROM", 378, Mapper378_Init ) INES_BOARD( "42 to 80,000 (970630C)", 380, Mapper380_Init ) INES_BOARD( "KN-42", 381, Mapper381_Init ) INES_BOARD( "830928C", 382, Mapper382_Init ) diff --git a/src/ines.h b/src/ines.h index ee6f074..6c78cb4 100644 --- a/src/ines.h +++ b/src/ines.h @@ -302,6 +302,7 @@ void Mapper374_Init(CartInfo *); void Mapper375_Init(CartInfo *); void Mapper376_Init(CartInfo *); void Mapper377_Init(CartInfo *); +void Mapper378_Init(CartInfo *); void Mapper380_Init(CartInfo *); void Mapper381_Init(CartInfo *); void Mapper382_Init(CartInfo *);