FDS: Update IRQ based on latest hardware notes
- IRQ updates based on latest notes. Verified with test rom. https://www.nesdev.org/wiki/Family_Computer_Disk_System#IRQ_control_($4022) Discussion and test rom file: https://forums.nesdev.org/viewtopic.php?f=3&t=16507 test rom: https://forums.nesdev.org/viewtopic.php?p=205052#p205052 - Puff Puff Golf is still problematic and unplayable. added notes for it. - Fix typo for a previous commit.
This commit is contained in:
parent
dd35f4b12a
commit
2c85cc53c5
34
src/fds.cpp
34
src/fds.cpp
|
@ -223,14 +223,23 @@ void FCEU_FDSSelect(void)
|
||||||
FCEU_DispMessage("Disk %d Side %c Selected", 0, SelectDisk >> 1, (SelectDisk & 1) ? 'B' : 'A');
|
FCEU_DispMessage("Disk %d Side %c Selected", 0, SelectDisk >> 1, (SelectDisk & 1) ? 'B' : 'A');
|
||||||
}
|
}
|
||||||
|
|
||||||
#define IRQ_Repeat (IRQa & 0x01)
|
#define IRQ_Repeat 0x01
|
||||||
#define IRQ_Enabled (IRQa & 0x02)
|
#define IRQ_Enabled 0x02
|
||||||
|
|
||||||
static void FDSFix(int a) {
|
static void FDSFix(int a) {
|
||||||
if ((IRQa & IRQ_Enabled) && IRQCount) {
|
if (IRQa & IRQ_Enabled) {
|
||||||
IRQCount -= a;
|
IRQCount -= a;
|
||||||
if (IRQCount <= 0) {
|
if (IRQCount <= 0) {
|
||||||
IRQCount = IRQLatch;
|
IRQCount = IRQLatch;
|
||||||
|
/* Puff Puff Golf notes:
|
||||||
|
Game freezes while music playing ingame after inserting Disk Side B.
|
||||||
|
IRQ is usually fired at scanline 169 and 183 for music to work.
|
||||||
|
|
||||||
|
At some point after inserting disk B, an IRQ is fired at scanline 174 which
|
||||||
|
will just freeze game while music plays.
|
||||||
|
|
||||||
|
If you ignore triggering IRQ altogether, game plays but no music
|
||||||
|
*/
|
||||||
X6502_IRQBegin(FCEU_IQEXT);
|
X6502_IRQBegin(FCEU_IQEXT);
|
||||||
if (!(IRQa & IRQ_Repeat)) {
|
if (!(IRQa & IRQ_Repeat)) {
|
||||||
IRQa &= ~IRQ_Enabled;
|
IRQa &= ~IRQ_Enabled;
|
||||||
|
@ -574,21 +583,30 @@ void FDSSoundReset(void) {
|
||||||
static DECLFW(FDSWrite) {
|
static DECLFW(FDSWrite) {
|
||||||
switch (A) {
|
switch (A) {
|
||||||
case 0x4020:
|
case 0x4020:
|
||||||
X6502_IRQEnd(FCEU_IQEXT);
|
|
||||||
IRQLatch &= 0xFF00;
|
IRQLatch &= 0xFF00;
|
||||||
IRQLatch |= V;
|
IRQLatch |= V;
|
||||||
break;
|
break;
|
||||||
case 0x4021:
|
case 0x4021:
|
||||||
X6502_IRQEnd(FCEU_IQEXT);
|
|
||||||
IRQLatch &= 0xFF;
|
IRQLatch &= 0xFF;
|
||||||
IRQLatch |= V << 8;
|
IRQLatch |= V << 8;
|
||||||
break;
|
break;
|
||||||
case 0x4022:
|
case 0x4022:
|
||||||
X6502_IRQEnd(FCEU_IQEXT);
|
if (FDSRegs[3] & 1) {
|
||||||
|
IRQa = V & 0x03;
|
||||||
|
if (IRQa & IRQ_Enabled) {
|
||||||
IRQCount = IRQLatch;
|
IRQCount = IRQLatch;
|
||||||
IRQa = V & 3;
|
} else {
|
||||||
|
X6502_IRQEnd(FCEU_IQEXT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 0x4023:
|
||||||
|
if (!(V & 0x01)) {
|
||||||
|
IRQa &= ~IRQ_Enabled;
|
||||||
|
X6502_IRQEnd(FCEU_IQEXT);
|
||||||
|
X6502_IRQEnd(FCEU_IQEXT2);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 0x4023: break;
|
|
||||||
case 0x4024:
|
case 0x4024:
|
||||||
if (mapperFDS_diskinsert && ~mapperFDS_control & 0x04) {
|
if (mapperFDS_diskinsert && ~mapperFDS_control & 0x04) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue