diff --git a/src/boards/391.c b/src/boards/391.c index 04a02d5..da66b3e 100644 --- a/src/boards/391.c +++ b/src/boards/391.c @@ -1,7 +1,7 @@ /* FCEUmm - NES/Famicom Emulator * * Copyright notice for this file: - * Copyright (C) 2020 negativeExponent + * Copyright (C) 2022 * * 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 diff --git a/src/boards/396.c b/src/boards/396.c index 002267f..ba4ae79 100644 --- a/src/boards/396.c +++ b/src/boards/396.c @@ -32,7 +32,7 @@ static void Sync (void) { setprg16(0x8000, reg[1] << 3 | reg[0] & 7); setprg16(0xC000, reg[1] << 3 | 7); setchr8(0); - setmirror(reg[1] &0x60? 0: 1); + setmirror(reg[1] & 0x60 ? 0 : 1); } static DECLFW(M396WriteInnerBank) { diff --git a/src/boards/432.c b/src/boards/432.c index 80a7ad4..817997e 100644 --- a/src/boards/432.c +++ b/src/boards/432.c @@ -24,34 +24,34 @@ #include "mmc3.h" static void M432CW(uint32 A, uint8 V) { - int chrAND = EXPREGS[1] &0x04? 0x7F: 0xFF; - int chrOR = EXPREGS[1] <<7 &0x080 | EXPREGS[1] <<5 &0x100; - setchr1(A, V &chrAND | chrOR &~chrAND); + int chrAND = (EXPREGS[1] & 0x04) ? 0x7F : 0xFF; + int chrOR = (EXPREGS[1] << 7) & 0x080 | (EXPREGS[1] << 5) & 0x100; + setchr1(A, (V & chrAND) | (chrOR & ~chrAND)); } static void M432PW(uint32 A, uint8 V) { - int prgAND = EXPREGS[1] &0x02? 0x0F: 0x1F; - int prgOR = EXPREGS[1] <<4 &0x10 | EXPREGS[1] <<1 &0x20; - if (A <0xC000 || ~EXPREGS[1] &0x40) setprg8(A, V &prgAND | prgOR &~prgAND); - if (A <0xC000 && EXPREGS[1] &0x40) setprg8(A |0x4000, V &prgAND | prgOR &~prgAND); + int prgAND = (EXPREGS[1] & 0x02) ? 0x0F : 0x1F; + int prgOR = ((EXPREGS[1] << 4) & 0x10) | (EXPREGS[1] << 1) & 0x20; + if ((A < 0xC000) || (~EXPREGS[1] & 0x40)) setprg8(A, (V & prgAND) | (prgOR & ~prgAND)); + if ((A < 0xC000) && (EXPREGS[1] & 0x40)) setprg8(A | 0x4000, (V & prgAND) | (prgOR & ~prgAND)); } static DECLFR(M432Read) { - if (EXPREGS[0] &1) - return EXPREGS[2]; + if (EXPREGS[0] & 1) + return EXPREGS[2]; return CartBR(A); } static DECLFW(M432Write) { - EXPREGS[A &1] = V; - FixMMC3PRG(MMC3_cmd); + EXPREGS[A & 1] = V; + FixMMC3PRG(MMC3_cmd); FixMMC3CHR(MMC3_cmd); } static void M432Reset(void) { EXPREGS[0] = 0; EXPREGS[1] = 0; - EXPREGS[2] = (EXPREGS[2] +1) &3; + EXPREGS[2] = (EXPREGS[2] +1) & 3; MMC3RegReset(); } diff --git a/src/boards/443.c b/src/boards/443.c index dcd2c12..034f615 100644 --- a/src/boards/443.c +++ b/src/boards/443.c @@ -1,7 +1,7 @@ /* FCEUmm - NES/Famicom Emulator * * Copyright notice for this file: - * Copyright (C) 2020 negativeExponent + * Copyright (C) 2022 * * 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 diff --git a/src/boards/456.c b/src/boards/456.c index accd201..33bf824 100644 --- a/src/boards/456.c +++ b/src/boards/456.c @@ -1,7 +1,7 @@ /* FCEUmm - NES/Famicom Emulator * * Copyright notice for this file: - * Copyright (C) 2020 negativeExponent + * Copyright (C) 2022 * * 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