X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=mappers%2F117.c;h=f7302b4a3acbe5b77b7c593981c568b119da205b;hp=aa0ea5f36559a609fb335274166ac263a6b15a12;hb=971a1d07d2f5b5a6f991ed5712275c04b933734f;hpb=c62d28102c77e19c291c78bf6bf7f0a81abd54b9 diff --git a/mappers/117.c b/mappers/117.c index aa0ea5f..f7302b4 100644 --- a/mappers/117.c +++ b/mappers/117.c @@ -1,7 +1,7 @@ /* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: - * Copyright (C) 2002 Ben Parnell + * Copyright (C) 2002 Xodnizel * * 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 @@ -24,10 +24,14 @@ DECLFW(Mapper117_write) { + //if(A>=0xc000) + //printf("$%04x:$%02x, %d,%d\n",A,V,scanline,timestamp); switch(A) { - case 0xc003:IRQCount=V;break; - case 0xc001:IRQa=V;break; + case 0xc001:IRQLatch=V;break; + case 0xc003:IRQCount=IRQLatch;IRQa|=2;break; + case 0xe000:IRQa&=~1;IRQa|=V&1;X6502_IRQEnd(FCEU_IQEXT);break; + case 0xc002:X6502_IRQEnd(FCEU_IQEXT);break; case 0xa000:VROM_BANK1(0x0000,V);break; case 0xa001:VROM_BANK1(0x0400,V);break; case 0xa002:VROM_BANK1(0x0800,V);break; @@ -45,17 +49,16 @@ DECLFW(Mapper117_write) static void Mapper117_hb(void) { - if(IRQa) + //if(scanline==0x40) X6502_IRQBegin(FCEU_IQEXT); + //return; + if(IRQa==3 && IRQCount) { - if(IRQCount<=0) - { - IRQa=0; - TriggerIRQ(); - } - else - { - IRQCount--; - } + IRQCount--; + if(!IRQCount) + { + IRQa&=1; + X6502_IRQBegin(FCEU_IQEXT); + } } }