diff --git a/src/core/cpu.c b/src/core/cpu.c index b0c9d1584..cd7d80281 100644 --- a/src/core/cpu.c +++ b/src/core/cpu.c @@ -219,7 +219,7 @@ enum cpu_opcode_type { RD_OP, WR_OP }; _RDD;\ _RDX((nes[nidx].c.cpu.SP | STACK), TRUE);\ nes[nidx].c.cpu.PC.b[0] = _PUL;\ - nes[nidx].c.cpu.PC.b[1] = _PUL; \ + nes[nidx].c.cpu.PC.b[1] = _PUL;\ _RDP; // RTI #define RTI\ diff --git a/src/core/emu.c b/src/core/emu.c index 357b26d0a..8c1b79923 100644 --- a/src/core/emu.c +++ b/src/core/emu.c @@ -151,7 +151,7 @@ void emu_frame(void) { // eseguo CPU, PPU e APU while (info.exec_cpu_op.w) { #if defined (DEBUG) - if (nes[1].c.cpu.PC.w == PCBREAK) { + if (nes[0].c.cpu.PC.w == PCBREAK) { BYTE pippo = 5; pippo = pippo + 1; } diff --git a/src/core/irqA12.c b/src/core/irqA12.c index 5ec3b31b5..e6a187e1e 100644 --- a/src/core/irqA12.c +++ b/src/core/irqA12.c @@ -19,7 +19,7 @@ #include "ppu_inline.h" #include "irqA12.h" -BYTE irqA12_delay; +BYTE irqA12_delay = 0; void irqA12_IO(BYTE nidx, WORD value, WORD value_old) { if (!(value_old & 0x1000) && (value & 0x1000)) { @@ -46,7 +46,7 @@ void irqA12_IO(BYTE nidx, WORD value, WORD value_old) { } } void irqA12_BS(BYTE nidx) { - BYTE n_spr; + BYTE n_spr = 0; if (nes[nidx].irqA12.a12BS || ((nes[nidx].p.ppu.frame_x & 0x0007) != 0x0003)) { return; diff --git a/src/core/mappers/mapper_004.c b/src/core/mappers/mapper_004.c index 2e0860178..80655b59d 100644 --- a/src/core/mappers/mapper_004.c +++ b/src/core/mappers/mapper_004.c @@ -19,6 +19,7 @@ #include #include "mappers.h" #include "info.h" +#include "irqA12.h" void wram_fix_004_mmc6(void); @@ -60,10 +61,9 @@ void map_init_004(void) { } nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } } - BYTE extcl_cpu_rd_mem_004_mmc6(BYTE nidx, WORD address, BYTE openbus) { if ((address >= 0x7000) && (address <= 0x7FFF)) { return (memmap_adr_is_readable(nidx, MMCPU(address)) diff --git a/src/core/mappers/mapper_012.c b/src/core/mappers/mapper_012.c index 786f15597..ac0d5ab95 100644 --- a/src/core/mappers/mapper_012.c +++ b/src/core/mappers/mapper_012.c @@ -19,6 +19,7 @@ #include #include "mappers.h" #include "save_slot.h" +#include "irqA12.h" void prg_swap_mmc3_012(WORD address, WORD value); void chr_swap_mmc3_012(WORD address, WORD value); @@ -58,7 +59,7 @@ void map_init_012(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } } void extcl_cpu_wr_mem_012(BYTE nidx, WORD address, BYTE value) { diff --git a/src/core/mappers/mapper_014.c b/src/core/mappers/mapper_014.c index 6bf76191b..b7b0f13a8 100644 --- a/src/core/mappers/mapper_014.c +++ b/src/core/mappers/mapper_014.c @@ -65,7 +65,7 @@ void map_init_014(void) { VRC2and4_chr_swap = chr_swap_vrc2and4_014; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_after_mapper_init_014(void) { if (m014.reg & 0x02) { diff --git a/src/core/mappers/mapper_037.c b/src/core/mappers/mapper_037.c index 876f1895b..147053245 100644 --- a/src/core/mappers/mapper_037.c +++ b/src/core/mappers/mapper_037.c @@ -56,7 +56,7 @@ void map_init_037(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_037(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_044.c b/src/core/mappers/mapper_044.c index 8759a6a31..d80c0838c 100644 --- a/src/core/mappers/mapper_044.c +++ b/src/core/mappers/mapper_044.c @@ -43,7 +43,7 @@ void map_init_044(void) { MMC3_chr_swap = chr_swap_mmc3_044; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_044(BYTE nidx, WORD address, BYTE value) { extcl_cpu_wr_mem_MMC3(nidx, address, value); diff --git a/src/core/mappers/mapper_045.c b/src/core/mappers/mapper_045.c index 095d86501..7e510fabc 100644 --- a/src/core/mappers/mapper_045.c +++ b/src/core/mappers/mapper_045.c @@ -59,7 +59,7 @@ void map_init_045(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_045(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_047.c b/src/core/mappers/mapper_047.c index 5a2cebe79..77ac1dc2a 100644 --- a/src/core/mappers/mapper_047.c +++ b/src/core/mappers/mapper_047.c @@ -53,7 +53,7 @@ void map_init_047(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_047(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_048.c b/src/core/mappers/mapper_048.c index 2f7546d46..46ebfbb6c 100644 --- a/src/core/mappers/mapper_048.c +++ b/src/core/mappers/mapper_048.c @@ -58,7 +58,7 @@ void map_init_048(void) { } nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 7; + irqA12_delay = 7; } void extcl_after_mapper_init_048(void) { prg_fix_048(); diff --git a/src/core/mappers/mapper_049.c b/src/core/mappers/mapper_049.c index 99238de09..fe88e5705 100644 --- a/src/core/mappers/mapper_049.c +++ b/src/core/mappers/mapper_049.c @@ -60,7 +60,7 @@ void map_init_049(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_049(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_052.c b/src/core/mappers/mapper_052.c index 73808170f..bd550f769 100644 --- a/src/core/mappers/mapper_052.c +++ b/src/core/mappers/mapper_052.c @@ -65,7 +65,7 @@ void map_init_052(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_052(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_074.c b/src/core/mappers/mapper_074.c index 0563ad028..b0424e6e5 100644 --- a/src/core/mappers/mapper_074.c +++ b/src/core/mappers/mapper_074.c @@ -46,7 +46,7 @@ void map_init_074(void) { MMC3_chr_swap = chr_swap_mmc3_074; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void prg_swap_mmc3_074(WORD address, WORD value) { diff --git a/src/core/mappers/mapper_100.c b/src/core/mappers/mapper_100.c index b26628a6a..9c1a2a1bf 100644 --- a/src/core/mappers/mapper_100.c +++ b/src/core/mappers/mapper_100.c @@ -69,7 +69,7 @@ void map_init_100(void) { m100.chr[7] = 7; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_after_mapper_init_100(void) { extcl_after_mapper_init_MMC3(); diff --git a/src/core/mappers/mapper_114.c b/src/core/mappers/mapper_114.c index 6521437ac..1c11e7cdb 100644 --- a/src/core/mappers/mapper_114.c +++ b/src/core/mappers/mapper_114.c @@ -55,7 +55,7 @@ void map_init_114(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_114(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_115.c b/src/core/mappers/mapper_115.c index 63c839096..6269bf0a2 100644 --- a/src/core/mappers/mapper_115.c +++ b/src/core/mappers/mapper_115.c @@ -57,7 +57,7 @@ void map_init_115(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_115(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_116.c b/src/core/mappers/mapper_116.c index ec2149696..01132671b 100644 --- a/src/core/mappers/mapper_116.c +++ b/src/core/mappers/mapper_116.c @@ -105,7 +105,7 @@ void map_init_116(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_after_mapper_init_116(void) { switch_mode(); diff --git a/src/core/mappers/mapper_118.c b/src/core/mappers/mapper_118.c index d084d1fd5..3a5323afb 100644 --- a/src/core/mappers/mapper_118.c +++ b/src/core/mappers/mapper_118.c @@ -44,7 +44,7 @@ void map_init_118(void) { MMC3_mirroring_fix = mirroring_fix_mmc3_118; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_118(BYTE nidx, WORD address, BYTE value) { switch (address & 0xE001) { diff --git a/src/core/mappers/mapper_119.c b/src/core/mappers/mapper_119.c index 19ebb14f9..c0d06f454 100644 --- a/src/core/mappers/mapper_119.c +++ b/src/core/mappers/mapper_119.c @@ -44,7 +44,7 @@ void map_init_119(void) { MMC3_chr_swap = chr_swap_mmc3_119; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void chr_swap_mmc3_119(WORD address, WORD value) { diff --git a/src/core/mappers/mapper_121.c b/src/core/mappers/mapper_121.c index 90f71154a..f2fa2976c 100644 --- a/src/core/mappers/mapper_121.c +++ b/src/core/mappers/mapper_121.c @@ -56,7 +56,7 @@ void map_init_121(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_121(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x5000) && (address <= 0x5FFF)) { diff --git a/src/core/mappers/mapper_123.c b/src/core/mappers/mapper_123.c index 7bde6a09f..dc8607aa5 100644 --- a/src/core/mappers/mapper_123.c +++ b/src/core/mappers/mapper_123.c @@ -55,7 +55,7 @@ void map_init_123(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_123(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x5000) && (address <= 0x5FFF)) { diff --git a/src/core/mappers/mapper_134.c b/src/core/mappers/mapper_134.c index d2cfc70ea..1ea83c35f 100644 --- a/src/core/mappers/mapper_134.c +++ b/src/core/mappers/mapper_134.c @@ -58,7 +58,7 @@ void map_init_134(void) { info.mapper.extend_rd = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_134(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_165.c b/src/core/mappers/mapper_165.c index b00fcd655..752d43e96 100644 --- a/src/core/mappers/mapper_165.c +++ b/src/core/mappers/mapper_165.c @@ -64,7 +64,7 @@ void map_init_165(void) { mmc3.reg[4] = 0; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_165(BYTE nidx, WORD address, BYTE value) { if (address >= 0x8000) { diff --git a/src/core/mappers/mapper_176.c b/src/core/mappers/mapper_176.c index 4440b7304..6a50ebbe9 100644 --- a/src/core/mappers/mapper_176.c +++ b/src/core/mappers/mapper_176.c @@ -124,7 +124,7 @@ void map_init_176(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_after_mapper_init_176(void) { prg_fix_176(); @@ -189,7 +189,7 @@ void extcl_cpu_wr_mem_176(BYTE nidx, WORD address, BYTE value) { extcl_cpu_wr_mem_MMC3(nidx, address, value); m176.cpu8xxx[0] = value; extcl_after_mapper_init_176(); - break; + return; } } BYTE extcl_save_mapper_176(BYTE mode, BYTE slot, FILE *fp) { diff --git a/src/core/mappers/mapper_187.c b/src/core/mappers/mapper_187.c index d9c255dc4..ced247766 100644 --- a/src/core/mappers/mapper_187.c +++ b/src/core/mappers/mapper_187.c @@ -56,7 +56,7 @@ void map_init_187(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_187(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x5000) && (address <= 0x5FFF)) { diff --git a/src/core/mappers/mapper_189.c b/src/core/mappers/mapper_189.c index 99226d6ad..02b41971f 100644 --- a/src/core/mappers/mapper_189.c +++ b/src/core/mappers/mapper_189.c @@ -53,7 +53,7 @@ void map_init_189(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_189(BYTE nidx, WORD address, BYTE value) { switch (address & 0xF000) { diff --git a/src/core/mappers/mapper_191.c b/src/core/mappers/mapper_191.c index e8ef1e9a5..0052fd090 100644 --- a/src/core/mappers/mapper_191.c +++ b/src/core/mappers/mapper_191.c @@ -46,7 +46,7 @@ void map_init_191(void) { MMC3_chr_swap = chr_swap_mmc3_191; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void prg_swap_mmc3_191(WORD address, WORD value) { diff --git a/src/core/mappers/mapper_192.c b/src/core/mappers/mapper_192.c index 34bc0a931..22028cb32 100644 --- a/src/core/mappers/mapper_192.c +++ b/src/core/mappers/mapper_192.c @@ -46,7 +46,7 @@ void map_init_192(void) { MMC3_chr_swap = chr_swap_mmc3_192; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void prg_swap_mmc3_192(WORD address, WORD value) { diff --git a/src/core/mappers/mapper_194.c b/src/core/mappers/mapper_194.c index 1549fd4cf..05d4598b6 100644 --- a/src/core/mappers/mapper_194.c +++ b/src/core/mappers/mapper_194.c @@ -46,7 +46,7 @@ void map_init_194(void) { MMC3_chr_swap = chr_swap_mmc3_194; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void prg_swap_mmc3_194(WORD address, WORD value) { diff --git a/src/core/mappers/mapper_195.c b/src/core/mappers/mapper_195.c index 9e923f157..d38d8519a 100644 --- a/src/core/mappers/mapper_195.c +++ b/src/core/mappers/mapper_195.c @@ -63,7 +63,7 @@ void map_init_195(void) { MMC3_wram_fix = wram_fix_mmc3_195; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_195(BYTE nidx, WORD address, BYTE value) { if ((address & 0xE001) == 0xA001) { diff --git a/src/core/mappers/mapper_196.c b/src/core/mappers/mapper_196.c index 54b6bc738..df82a788b 100644 --- a/src/core/mappers/mapper_196.c +++ b/src/core/mappers/mapper_196.c @@ -54,7 +54,7 @@ void map_init_196(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_196(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x6FFF)) { diff --git a/src/core/mappers/mapper_197.c b/src/core/mappers/mapper_197.c index ebf2ab398..bec1c2225 100644 --- a/src/core/mappers/mapper_197.c +++ b/src/core/mappers/mapper_197.c @@ -58,7 +58,7 @@ void map_init_197(void) { } nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_197(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_198.c b/src/core/mappers/mapper_198.c index b1d4b40bf..458e8d527 100644 --- a/src/core/mappers/mapper_198.c +++ b/src/core/mappers/mapper_198.c @@ -46,7 +46,7 @@ void map_init_198(void) { MMC3_wram_fix = wram_fix_mmc3_198; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void prg_swap_mmc3_198(WORD address, WORD value) { diff --git a/src/core/mappers/mapper_199.c b/src/core/mappers/mapper_199.c index cb4f311dc..8a1cca2b2 100644 --- a/src/core/mappers/mapper_199.c +++ b/src/core/mappers/mapper_199.c @@ -46,7 +46,7 @@ void map_init_199(void) { MMC3_wram_fix = wram_fix_mmc3_199; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void chr_swap_mmc3_199(WORD address, UNUSED(WORD value)) { diff --git a/src/core/mappers/mapper_205.c b/src/core/mappers/mapper_205.c index 61974a236..c2b1e9bf4 100644 --- a/src/core/mappers/mapper_205.c +++ b/src/core/mappers/mapper_205.c @@ -56,7 +56,7 @@ void map_init_205(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_205(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_208.c b/src/core/mappers/mapper_208.c index 9214f8bdc..6bdf550c5 100644 --- a/src/core/mappers/mapper_208.c +++ b/src/core/mappers/mapper_208.c @@ -95,7 +95,7 @@ void map_init_208(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_208(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x4000) && (address <= 0x5FFF)) { diff --git a/src/core/mappers/mapper_215.c b/src/core/mappers/mapper_215.c index e793c8fde..6c191e350 100644 --- a/src/core/mappers/mapper_215.c +++ b/src/core/mappers/mapper_215.c @@ -62,7 +62,7 @@ void map_init_215(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_215(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x5000) && (address <= 0x5FFF)) { diff --git a/src/core/mappers/mapper_219.c b/src/core/mappers/mapper_219.c index 3623f7b59..c7bddf7cc 100644 --- a/src/core/mappers/mapper_219.c +++ b/src/core/mappers/mapper_219.c @@ -56,7 +56,7 @@ void map_init_219(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_219(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x5000) && (address <= 0x5FFF)) { diff --git a/src/core/mappers/mapper_238.c b/src/core/mappers/mapper_238.c index b3a6b10bc..06d6d39a9 100644 --- a/src/core/mappers/mapper_238.c +++ b/src/core/mappers/mapper_238.c @@ -52,7 +52,7 @@ void map_init_238(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_238(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x4020) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_245.c b/src/core/mappers/mapper_245.c index c55941515..16bfdc1a6 100644 --- a/src/core/mappers/mapper_245.c +++ b/src/core/mappers/mapper_245.c @@ -44,7 +44,7 @@ void map_init_245(void) { MMC3_prg_swap = prg_swap_mmc3_245; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_245(BYTE nidx, WORD address, BYTE value) { if ((address & 0xE001) == 0x8001) { diff --git a/src/core/mappers/mapper_249.c b/src/core/mappers/mapper_249.c index dcc17b64c..5f0260463 100644 --- a/src/core/mappers/mapper_249.c +++ b/src/core/mappers/mapper_249.c @@ -58,7 +58,7 @@ void map_init_249(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_249(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x5000) && (address <= 0x5FFF)) { diff --git a/src/core/mappers/mapper_250.c b/src/core/mappers/mapper_250.c index d44416db4..e18840f0d 100644 --- a/src/core/mappers/mapper_250.c +++ b/src/core/mappers/mapper_250.c @@ -41,7 +41,7 @@ void map_init_250(void) { init_MMC3(info.reset); nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_250(BYTE nidx, WORD address, BYTE value) { value = address & 0xFF; diff --git a/src/core/mappers/mapper_254.c b/src/core/mappers/mapper_254.c index 1aa7ef4c1..39057e32b 100644 --- a/src/core/mappers/mapper_254.c +++ b/src/core/mappers/mapper_254.c @@ -50,7 +50,7 @@ void map_init_254(void) { init_MMC3(info.reset); nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_254(BYTE nidx, WORD address, BYTE value) { if (address == 0x8000) { diff --git a/src/core/mappers/mapper_259.c b/src/core/mappers/mapper_259.c index 29fa87cbf..78e4259d5 100644 --- a/src/core/mappers/mapper_259.c +++ b/src/core/mappers/mapper_259.c @@ -53,7 +53,7 @@ void map_init_259(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_259(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_260.c b/src/core/mappers/mapper_260.c index 793c7d6fb..4c04cf5ac 100644 --- a/src/core/mappers/mapper_260.c +++ b/src/core/mappers/mapper_260.c @@ -65,7 +65,7 @@ void map_init_260(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_after_mapper_init_260(void) { prg_fix_260(); diff --git a/src/core/mappers/mapper_262.c b/src/core/mappers/mapper_262.c index 9d4a2c7d8..bc5787b2c 100644 --- a/src/core/mappers/mapper_262.c +++ b/src/core/mappers/mapper_262.c @@ -58,7 +58,7 @@ void map_init_262(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_262(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x4000) && (address <= 0x4FFF)) { diff --git a/src/core/mappers/mapper_263.c b/src/core/mappers/mapper_263.c index c87389fa6..5c869ace1 100644 --- a/src/core/mappers/mapper_263.c +++ b/src/core/mappers/mapper_263.c @@ -41,7 +41,7 @@ void map_init_263(void) { init_MMC3(info.reset); nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_263(BYTE nidx, WORD address, BYTE value) { #define kof97_fix_value() value = (value & 0xD8) | ((value & 0x20) >> 4) |\ diff --git a/src/core/mappers/mapper_267.c b/src/core/mappers/mapper_267.c index 852c56cd6..421953b76 100644 --- a/src/core/mappers/mapper_267.c +++ b/src/core/mappers/mapper_267.c @@ -56,7 +56,7 @@ void map_init_267(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_267(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x6FFF)) { diff --git a/src/core/mappers/mapper_268.c b/src/core/mappers/mapper_268.c index 46a2d76f7..3729c4b9b 100644 --- a/src/core/mappers/mapper_268.c +++ b/src/core/mappers/mapper_268.c @@ -70,7 +70,7 @@ void map_init_268(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_268(BYTE nidx, WORD address, BYTE value) { if ((address >= m268tmp.rstart) && (address <= m268tmp.rstop)) { diff --git a/src/core/mappers/mapper_269.c b/src/core/mappers/mapper_269.c index b38054c54..c7a5f0f85 100644 --- a/src/core/mappers/mapper_269.c +++ b/src/core/mappers/mapper_269.c @@ -82,7 +82,7 @@ void map_init_269(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_269(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x5000) && (address <= 0x5FFF)) { diff --git a/src/core/mappers/mapper_287.c b/src/core/mappers/mapper_287.c index cfbaf49dd..c4ddf8da9 100644 --- a/src/core/mappers/mapper_287.c +++ b/src/core/mappers/mapper_287.c @@ -55,7 +55,7 @@ void map_init_287(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_287(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_291.c b/src/core/mappers/mapper_291.c index de8acaee0..a97810a50 100644 --- a/src/core/mappers/mapper_291.c +++ b/src/core/mappers/mapper_291.c @@ -55,7 +55,7 @@ void map_init_291(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_291(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x6FFF)) { diff --git a/src/core/mappers/mapper_292.c b/src/core/mappers/mapper_292.c index 80b73e2b9..ebed902c8 100644 --- a/src/core/mappers/mapper_292.c +++ b/src/core/mappers/mapper_292.c @@ -56,7 +56,7 @@ void map_init_292(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_292(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_313.c b/src/core/mappers/mapper_313.c index fa57b8d01..0c64e3bb4 100644 --- a/src/core/mappers/mapper_313.c +++ b/src/core/mappers/mapper_313.c @@ -102,7 +102,7 @@ void map_init_313(void) { } nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } BYTE extcl_save_mapper_313(BYTE mode, BYTE slot, FILE *fp) { save_slot_ele(mode, slot, m313.reg); diff --git a/src/core/mappers/mapper_315.c b/src/core/mappers/mapper_315.c index 198b79d14..ade2a206f 100644 --- a/src/core/mappers/mapper_315.c +++ b/src/core/mappers/mapper_315.c @@ -53,7 +53,7 @@ void map_init_315(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_315(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_322.c b/src/core/mappers/mapper_322.c index 17423ce53..9acc2404d 100644 --- a/src/core/mappers/mapper_322.c +++ b/src/core/mappers/mapper_322.c @@ -55,7 +55,7 @@ void map_init_322(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_322(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_325.c b/src/core/mappers/mapper_325.c index 53a3812e5..d6a64ffef 100644 --- a/src/core/mappers/mapper_325.c +++ b/src/core/mappers/mapper_325.c @@ -46,7 +46,7 @@ void map_init_325(void) { MMC3_chr_swap = chr_swap_mmc3_325; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_325(BYTE nidx, WORD address, BYTE value) { if (address < 0xC000) { diff --git a/src/core/mappers/mapper_327.c b/src/core/mappers/mapper_327.c index ab900550b..c851e0ad1 100644 --- a/src/core/mappers/mapper_327.c +++ b/src/core/mappers/mapper_327.c @@ -55,7 +55,7 @@ void map_init_327(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_327(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_333.c b/src/core/mappers/mapper_333.c index 9b5c3f0e4..c79acdb64 100644 --- a/src/core/mappers/mapper_333.c +++ b/src/core/mappers/mapper_333.c @@ -53,7 +53,7 @@ void map_init_333(void) { MMC3_chr_swap = chr_swap_mmc3_333; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_333(BYTE nidx, WORD address, BYTE value) { switch (address & 0xF001) { diff --git a/src/core/mappers/mapper_334.c b/src/core/mappers/mapper_334.c index 361d38087..42af064c8 100644 --- a/src/core/mappers/mapper_334.c +++ b/src/core/mappers/mapper_334.c @@ -57,7 +57,7 @@ void map_init_334(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_334(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_339.c b/src/core/mappers/mapper_339.c index ff328aae0..bdf737b45 100644 --- a/src/core/mappers/mapper_339.c +++ b/src/core/mappers/mapper_339.c @@ -56,7 +56,7 @@ void map_init_339(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_339(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_344.c b/src/core/mappers/mapper_344.c index 5c285ad9c..2a57f2e42 100644 --- a/src/core/mappers/mapper_344.c +++ b/src/core/mappers/mapper_344.c @@ -60,7 +60,7 @@ void map_init_344(void) { info.mapper.extend_rd = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_344(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_345.c b/src/core/mappers/mapper_345.c index 8188b050c..13d7a08f0 100644 --- a/src/core/mappers/mapper_345.c +++ b/src/core/mappers/mapper_345.c @@ -60,7 +60,7 @@ void map_init_345(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_345(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_348.c b/src/core/mappers/mapper_348.c index e5b4156eb..d0e086a87 100644 --- a/src/core/mappers/mapper_348.c +++ b/src/core/mappers/mapper_348.c @@ -53,7 +53,7 @@ void map_init_348(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_348(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6800) && (address <= 0x68FF)) { diff --git a/src/core/mappers/mapper_351.c b/src/core/mappers/mapper_351.c index 04318755d..3f367ea7a 100644 --- a/src/core/mappers/mapper_351.c +++ b/src/core/mappers/mapper_351.c @@ -99,7 +99,7 @@ void map_init_351(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_after_mapper_init_351(void) { switch_mode(); diff --git a/src/core/mappers/mapper_353.c b/src/core/mappers/mapper_353.c index 7385983df..3ab04ba14 100644 --- a/src/core/mappers/mapper_353.c +++ b/src/core/mappers/mapper_353.c @@ -53,7 +53,7 @@ void map_init_353(void) { MMC3_mirroring_fix = mirroring_fix_mmc3_353; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_353(BYTE nidx, WORD address, BYTE value) { if ((address & 0x0FFF) == 0x0080) { diff --git a/src/core/mappers/mapper_356.c b/src/core/mappers/mapper_356.c index 86c5e4297..901de51c7 100644 --- a/src/core/mappers/mapper_356.c +++ b/src/core/mappers/mapper_356.c @@ -60,7 +60,7 @@ void map_init_356(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_356(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_361.c b/src/core/mappers/mapper_361.c index a3cfaebe6..80233dc57 100644 --- a/src/core/mappers/mapper_361.c +++ b/src/core/mappers/mapper_361.c @@ -55,7 +55,7 @@ void map_init_361(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_361(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x7000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_366.c b/src/core/mappers/mapper_366.c index aec186195..935b2d918 100644 --- a/src/core/mappers/mapper_366.c +++ b/src/core/mappers/mapper_366.c @@ -56,7 +56,7 @@ void map_init_366(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_366(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_369.c b/src/core/mappers/mapper_369.c index 2f690426d..29b3828ce 100644 --- a/src/core/mappers/mapper_369.c +++ b/src/core/mappers/mapper_369.c @@ -66,7 +66,7 @@ void map_init_369(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_369(BYTE nidx, WORD address, BYTE value) { switch (address & 0xF000) { diff --git a/src/core/mappers/mapper_370.c b/src/core/mappers/mapper_370.c index 9a836536b..4afef8075 100644 --- a/src/core/mappers/mapper_370.c +++ b/src/core/mappers/mapper_370.c @@ -56,7 +56,7 @@ void map_init_370(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_370(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x5000) && (address <= 0x5FFF)) { diff --git a/src/core/mappers/mapper_372.c b/src/core/mappers/mapper_372.c index cb58e17fb..6111602bf 100644 --- a/src/core/mappers/mapper_372.c +++ b/src/core/mappers/mapper_372.c @@ -59,7 +59,7 @@ void map_init_372(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_372(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_377.c b/src/core/mappers/mapper_377.c index b2952ac69..487332149 100644 --- a/src/core/mappers/mapper_377.c +++ b/src/core/mappers/mapper_377.c @@ -56,7 +56,7 @@ void map_init_377(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_377(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x6FFF)) { diff --git a/src/core/mappers/mapper_393.c b/src/core/mappers/mapper_393.c index 0394adfe3..7cbb7e927 100644 --- a/src/core/mappers/mapper_393.c +++ b/src/core/mappers/mapper_393.c @@ -56,7 +56,7 @@ void map_init_393(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_393(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_394.c b/src/core/mappers/mapper_394.c index abcea7025..62896d041 100644 --- a/src/core/mappers/mapper_394.c +++ b/src/core/mappers/mapper_394.c @@ -73,7 +73,7 @@ void map_init_394(void) { MMC3_chr_swap = chr_swap_mmc3_394; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_after_mapper_init_394(void) { if (m394.reg[1] & 0x10) { diff --git a/src/core/mappers/mapper_395.c b/src/core/mappers/mapper_395.c index 9652d7e11..4766d6f0b 100644 --- a/src/core/mappers/mapper_395.c +++ b/src/core/mappers/mapper_395.c @@ -56,7 +56,7 @@ void map_init_395(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_395(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_399.c b/src/core/mappers/mapper_399.c index d20a4c291..004edcd09 100644 --- a/src/core/mappers/mapper_399.c +++ b/src/core/mappers/mapper_399.c @@ -54,7 +54,7 @@ void map_init_399(void) { MMC3_chr_fix = chr_fix_mmc3_399; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_399(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x8000) && (address <= 0x9FFF)) { diff --git a/src/core/mappers/mapper_401.c b/src/core/mappers/mapper_401.c index 15dd77e3f..578890f1c 100644 --- a/src/core/mappers/mapper_401.c +++ b/src/core/mappers/mapper_401.c @@ -59,7 +59,7 @@ void map_init_401(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_401(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_406.c b/src/core/mappers/mapper_406.c index 18a1508f2..279334c98 100644 --- a/src/core/mappers/mapper_406.c +++ b/src/core/mappers/mapper_406.c @@ -67,7 +67,7 @@ void map_init_406(void) { info.mapper.extend_rd = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_mapper_quit_406(void) { if (m406tmp.sst39sf040) { diff --git a/src/core/mappers/mapper_410.c b/src/core/mappers/mapper_410.c index 44d955c77..12363b1d0 100644 --- a/src/core/mappers/mapper_410.c +++ b/src/core/mappers/mapper_410.c @@ -59,7 +59,7 @@ void map_init_410(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_410(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_411.c b/src/core/mappers/mapper_411.c index 604f5e2cf..260726c8a 100644 --- a/src/core/mappers/mapper_411.c +++ b/src/core/mappers/mapper_411.c @@ -59,7 +59,7 @@ void map_init_411(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_411(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x5000) && (address <= 0x5FFF)) { diff --git a/src/core/mappers/mapper_412.c b/src/core/mappers/mapper_412.c index 7892b8c84..76c6a30d2 100644 --- a/src/core/mappers/mapper_412.c +++ b/src/core/mappers/mapper_412.c @@ -53,7 +53,7 @@ void map_init_412(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_412(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_420.c b/src/core/mappers/mapper_420.c index 9ff4ff917..195ef246e 100644 --- a/src/core/mappers/mapper_420.c +++ b/src/core/mappers/mapper_420.c @@ -58,7 +58,7 @@ void map_init_420(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_420(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_432.c b/src/core/mappers/mapper_432.c index e2d32c806..e3caa722a 100644 --- a/src/core/mappers/mapper_432.c +++ b/src/core/mappers/mapper_432.c @@ -64,7 +64,7 @@ void map_init_432(void) { info.mapper.extend_rd = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_432(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_446.c b/src/core/mappers/mapper_446.c index e4742153d..d2f1b725f 100644 --- a/src/core/mappers/mapper_446.c +++ b/src/core/mappers/mapper_446.c @@ -158,7 +158,7 @@ void map_init_446(void) { info.mapper.extend_rd = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_after_mapper_init_446(void) { switch_mode(); diff --git a/src/core/mappers/mapper_451.c b/src/core/mappers/mapper_451.c index abe00a91b..a40d57a29 100644 --- a/src/core/mappers/mapper_451.c +++ b/src/core/mappers/mapper_451.c @@ -71,7 +71,7 @@ void map_init_451(void) { info.mapper.extend_rd = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_after_mapper_init_451(void) { prg_fix_451(); diff --git a/src/core/mappers/mapper_455.c b/src/core/mappers/mapper_455.c index f9ac2a26c..280815771 100644 --- a/src/core/mappers/mapper_455.c +++ b/src/core/mappers/mapper_455.c @@ -57,7 +57,7 @@ void map_init_455(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_455(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x4000) && (address <= 0x5FFF)) { diff --git a/src/core/mappers/mapper_456.c b/src/core/mappers/mapper_456.c index 87e4074c9..1ffe33ba7 100644 --- a/src/core/mappers/mapper_456.c +++ b/src/core/mappers/mapper_456.c @@ -53,7 +53,7 @@ void map_init_456(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_456(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x4000) && (address <= 0x5FFF)) { diff --git a/src/core/mappers/mapper_457.c b/src/core/mappers/mapper_457.c index 4a6ec3b89..27c69b657 100644 --- a/src/core/mappers/mapper_457.c +++ b/src/core/mappers/mapper_457.c @@ -56,7 +56,7 @@ void map_init_457(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_457(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x6000) && (address <= 0x7FFF)) { diff --git a/src/core/mappers/mapper_512.c b/src/core/mappers/mapper_512.c index 154864dba..72d75c43d 100644 --- a/src/core/mappers/mapper_512.c +++ b/src/core/mappers/mapper_512.c @@ -58,7 +58,7 @@ void map_init_512(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_512(BYTE nidx, WORD address, BYTE value) { if ((address >= 0x4000) && (address <= 0x4FFF)) { diff --git a/src/core/mappers/mapper_513.c b/src/core/mappers/mapper_513.c index 1e70355f3..ffda68989 100644 --- a/src/core/mappers/mapper_513.c +++ b/src/core/mappers/mapper_513.c @@ -54,7 +54,7 @@ void map_init_513(void) { MMC3_chr_swap = chr_swap_mmc3_513; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_513(BYTE nidx, WORD address, BYTE value) { if ((address & 0xE001) == 0x8001) { diff --git a/src/core/mappers/mapper_516.c b/src/core/mappers/mapper_516.c index 22395d047..dda1575c6 100644 --- a/src/core/mappers/mapper_516.c +++ b/src/core/mappers/mapper_516.c @@ -53,7 +53,7 @@ void map_init_516(void) { MMC3_chr_swap = chr_swap_mmc3_516; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_cpu_wr_mem_516(BYTE nidx, WORD address, BYTE value) { if (address & 0x0010) { diff --git a/src/core/mappers/mapper_556.c b/src/core/mappers/mapper_556.c index 7c8b2e888..226775505 100644 --- a/src/core/mappers/mapper_556.c +++ b/src/core/mappers/mapper_556.c @@ -73,7 +73,7 @@ void map_init_556(void) { info.mapper.extend_wr = TRUE; nes[0].irqA12.present = TRUE; - nes[0].irqA12.delay = 1; + irqA12_delay = 1; } void extcl_after_mapper_init_556(void) { fix_all(); diff --git a/src/core/ppu.c b/src/core/ppu.c index d95e76e1a..5e379c57b 100644 --- a/src/core/ppu.c +++ b/src/core/ppu.c @@ -55,20 +55,20 @@ enum ppu_misc { PPU_OVERFLOW_SPR = 3 }; nes[nidx].c.nmi.cpu_cycles_from_last_nmi++;\ /* deve essere azzerato alla fine di ogni ciclo PPU */\ nes[nidx].p.r2006.changed_from_op = 0; -#define put_pixel(clr) nes[nidx].p.ppu_screen.wr->line[nes[nidx].p.ppu.screen_y][nes[nidx].p.ppu.frame_x] = nes[nidx].p.r2001.emphasis | clr; +#define put_pixel(clr) nes[nidx].p.ppu_screen.wr->line[nes[nidx].p.ppu.screen_y][nes[nidx].p.ppu.frame_x] = nes[nidx].p.r2001.emphasis | (clr); #define put_emphasis(clr) put_pixel((nes[nidx].m.memmap_palette.color[clr] & nes[nidx].p.r2001.color_mode)) #define put_bg put_emphasis(color_bg) #define put_sp put_emphasis(color_sp | 0x10) #define examine_sprites(senv, sp, vis, ty)\ /* esamino se ci sono sprite da renderizzare */\ - for (a = 0; a < senv.count; a++) {\ + for (a = 0; a < (senv).count; a++) {\ /*\ * per essercene, la differenza tra frameX e la\ * cordinata X dello sprite deve essere\ * inferiore a 8 (per questo uso il WORD, per\ * avere risultati unsigned).\ */\ - if ((WORD)(nes[nidx].p.ppu.frame_x - sp[a].x_C) < 8) {\ + if ((WORD)(nes[nidx].p.ppu.frame_x - (sp)[a].x_C) < 8) {\ /*\ * se il bit 2 del $2001 e' a 0 vuol dire\ * che e' abilitato il clipping degli sprite\ @@ -87,16 +87,16 @@ enum ppu_misc { PPU_OVERFLOW_SPR = 3 }; * intendo).\ */\ if (!color_sp) {\ - color_sp = ((sp[a].l_byte & 0x01) | (sp[a].h_byte & 0x02));\ + color_sp = (((sp)[a].l_byte & 0x01) | ((sp)[a].h_byte & 0x02));\ /*\ * se i 2 bit LSB del colore non sono uguali a\ * 0, vuol dire che il pixel non e' trasparente\ * e quindi vi aggiungo i 2 bit MSB.\ */\ if (color_sp) {\ - color_sp |= ((sp[a].attrib & 0x03) << 2);\ + color_sp |= (((sp)[a].attrib & 0x03) << 2);\ /* questo sprite non e' invisibile */\ - vis = a;\ + (vis) = a;\ unlimited_spr = ty;\ }\ }\ @@ -106,8 +106,8 @@ enum ppu_misc { PPU_OVERFLOW_SPR = 3 }; * sprite della scanlines, compresi quelli non\ * visibili.\ */\ - sp[a].l_byte >>= 1;\ - sp[a].h_byte >>= 1;\ + (sp)[a].l_byte >>= 1;\ + (sp)[a].h_byte >>= 1;\ }\ } #define get_sprites(elp, spenv, spl, sadr)\ @@ -116,15 +116,15 @@ enum ppu_misc { PPU_OVERFLOW_SPR = 3 }; * 0 -> no flip orizzontale\ * 1 -> si flip orizzontale\ */\ - if (nes[nidx].p.oam.elp[spenv.tmp_spr_plus][AT] & 0x40) {\ + if (nes[nidx].p.oam.elp[(spenv).tmp_spr_plus][AT] & 0x40) {\ /* salvo i primi 8 bit del tile dello sprite */\ - spl[spenv.tmp_spr_plus].l_byte = ppu_rd_mem(nidx, sadr);\ + (spl)[(spenv).tmp_spr_plus].l_byte = ppu_rd_mem(nidx, sadr);\ /* salvo i secondi 8 bit del tile dello sprite */\ - spl[spenv.tmp_spr_plus].h_byte = (ppu_rd_mem(nidx, sadr | 0x08) << 1);\ + (spl)[(spenv).tmp_spr_plus].h_byte = (ppu_rd_mem(nidx, (sadr) | 0x08) << 1);\ } else {\ - spl[spenv.tmp_spr_plus].l_byte = inv_chr[ppu_rd_mem(nidx, sadr)];\ + (spl)[(spenv).tmp_spr_plus].l_byte = inv_chr[ppu_rd_mem(nidx, sadr)];\ /* salvo i secondi 8 bit del tile dello sprite */\ - spl[spenv.tmp_spr_plus].h_byte = (inv_chr[ppu_rd_mem(nidx, sadr | 0x08)] << 1);\ + (spl)[(spenv).tmp_spr_plus].h_byte = (inv_chr[ppu_rd_mem(nidx, (sadr) | 0x08)] << 1);\ } static void ppu_alignment_init(BYTE nidx); diff --git a/src/core/ppu.h b/src/core/ppu.h index f7091442c..4d224983a 100644 --- a/src/core/ppu.h +++ b/src/core/ppu.h @@ -27,8 +27,8 @@ enum ppu_color_mode { PPU_CM_GRAYSCALE = 0x30, PPU_CM_NORMAL = 0x3F }; enum ppu_scanline_cycles { SHORT_SLINE_CYCLES = 340, SLINE_CYCLES }; enum ppu_alignment { PPU_ALIGMENT_DEFAULT, PPU_ALIGMENT_RANDOMIZE, PPU_ALIGMENT_INC_AT_RESET }; -#define screen_size() (SCR_ROWS * SCR_COLUMNS) * sizeof(WORD) -#define _ppu_spr_adr(sprite, epl, spl, sadr)\ +#define screen_size() ((SCR_ROWS * SCR_COLUMNS) * sizeof(WORD)) +#define _ppu_spr_adr(spr, epl, spl, sadr)\ {\ BYTE flip_v;\ /*\ @@ -36,12 +36,12 @@ enum ppu_alignment { PPU_ALIGMENT_DEFAULT, PPU_ALIGMENT_RANDOMIZE, PPU_ALIGMENT_ * 0 -> no flip verticale\ * 1 -> si flip verticale\ */\ - if (nes[nidx].p.oam.epl[sprite][AT] & 0x80) {\ + if (nes[nidx].p.oam.epl[spr][AT] & 0x80) {\ /* flip verticale */\ - flip_v = ~spl[sprite].flip_v;\ + flip_v = ~(spl)[spr].flip_v;\ } else {\ /* no flip verticale */\ - flip_v = spl[sprite].flip_v;\ + flip_v = (spl)[spr].flip_v;\ }\ /*\ * significato bit 5 del $2000:\ @@ -66,24 +66,24 @@ enum ppu_alignment { PPU_ALIGMENT_DEFAULT, PPU_ALIGMENT_RANDOMIZE, PPU_ALIGMENT_ * caso di flip verticale sara' l'esatto contrario,\ * dispari per i primi 8x8 e pari per i secondi 8x8.\ */\ - sadr = (nes[nidx].p.oam.epl[sprite][TL] & 0xFE) | ((flip_v & 0x08) >> 3);\ + (sadr) = (nes[nidx].p.oam.epl[spr][TL] & 0xFE) | ((flip_v & 0x08) >> 3);\ /* recupero la posizione nella vram del tile */\ - sadr = ((nes[nidx].p.oam.epl[sprite][TL] & 0x01) << 12) | (sadr << 4);\ + (sadr) = ((nes[nidx].p.oam.epl[spr][TL] & 0x01) << 12) | ((sadr) << 4);\ } else {\ /* -- 8x8 --\ *\ * sprite_plus[x].tile = numero del tile nella vram.\ */\ /* recupero la posizione nella vram del tile */\ - sadr = nes[nidx].p.r2000.spt_adr | (nes[nidx].p.oam.epl[sprite][TL] << 4);\ + (sadr) = nes[nidx].p.r2000.spt_adr | (nes[nidx].p.oam.epl[spr][TL] << 4);\ }\ /* aggiungo la cordinata Y dello sprite */\ - sadr += (flip_v & 0x07);\ + (sadr) += (flip_v & 0x07);\ } -#define ppu_spr_adr(sprite) _ppu_spr_adr(sprite, ele_plus, nes[nidx].p.sprite_plus, nes[nidx].p.ppu.spr_adr) +#define ppu_spr_adr(spr) _ppu_spr_adr(spr, ele_plus, nes[nidx].p.sprite_plus, nes[nidx].p.ppu.spr_adr) #define ppu_bck_adr(r2000bck, r2006vl)\ - nes[nidx].p.ppu.bck_adr = r2000bck | ((ppu_rd_mem(nidx, 0x2000 | (r2006vl & 0x0FFF)) << 4)\ - | ((r2006vl & 0x7000) >> 12)) + nes[nidx].p.ppu.bck_adr = (r2000bck) | ((ppu_rd_mem(nidx, 0x2000 | ((r2006vl) & 0x0FFF)) << 4)\ + | (((r2006vl) & 0x7000) >> 12)) #define r2006_inc()\ /* controllo se fine Y e' uguale a 7 */\ if ((nes[nidx].p.r2006.value & 0x7000) == 0x7000) {\