/* 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_vrc3.h" static void (*VRC3_cbSync)(); static uint8 VRC3_prg; static uint8 VRC3_irq; static uint16 VRC3_count; static uint16 VRC3_reload; static SFORMAT VRC3_state[] = { {&VRC3_prg, 1, "VC3P" }, {&VRC3_irq, 1, "VC3I" }, {&VRC3_count, 1, "VC3C" }, {&VRC3_reload, 1, "VC3R" }, { 0 } }; void VRC3_syncWRAM (int OR) { if (PRGsize[0x10]) setprg8r(0x10, 0x6000, OR); } void VRC3_syncPRG (int AND, int OR) { setprg16(0x8000, VRC3_prg &AND |OR); setprg16(0xC000, 0xFF &AND |OR); } void VRC3_syncCHR (int AND, int OR) { setchr8(OR); } DECLFW (VRC3_write) { int shift; switch (A >>12 &7) { case 0: case 1: case 2: case 3: V &=0xF; shift = A >>10 &0xC; VRC3_reload = VRC3_reload &~(0xF <Power = VRC3_power; info->Reset = VRC3_cbSync; GameStateRestore = VRC3_restore; }