pce-cd: basically working pretty okay! (fixed bug causing issues with extended ADPCM playback sequences)
This commit is contained in:
parent
f3dc6068ce
commit
cf8216ac46
|
@ -44,11 +44,6 @@ namespace BizHawk.Emulation.CPUs.H6280
|
||||||
|
|
||||||
if (IRQ2Assert && FlagI == false && LagIFlag == false && (IRQControlByte & IRQ2Selector) == 0 && InBlockTransfer == false)
|
if (IRQ2Assert && FlagI == false && LagIFlag == false && (IRQControlByte & IRQ2Selector) == 0 && InBlockTransfer == false)
|
||||||
{
|
{
|
||||||
Console.WriteLine("============================================================");
|
|
||||||
Console.WriteLine(" ENTERING IRQ2");
|
|
||||||
Console.WriteLine(" 1802: {0:X2}, 1803: {1:X2}, && {2:X2}",PCEngine.CdIoPorts[2], PCEngine.CdIoPorts[3], PCEngine.CdIoPorts[2] & PCEngine.CdIoPorts[3]);
|
|
||||||
Console.WriteLine("============================================================");
|
|
||||||
|
|
||||||
WriteMemory((ushort)(S-- + 0x2100), (byte)(PC >> 8));
|
WriteMemory((ushort)(S-- + 0x2100), (byte)(PC >> 8));
|
||||||
WriteMemory((ushort)(S-- + 0x2100), (byte)PC);
|
WriteMemory((ushort)(S-- + 0x2100), (byte)PC);
|
||||||
WriteMemory((ushort)(S-- + 0x2100), (byte)(P & (~0x10)));
|
WriteMemory((ushort)(S-- + 0x2100), (byte)(P & (~0x10)));
|
||||||
|
|
|
@ -100,18 +100,16 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
|
||||||
{
|
{
|
||||||
AdpcmLength = IOAddress;
|
AdpcmLength = IOAddress;
|
||||||
EndReached = false;
|
EndReached = false;
|
||||||
//Console.WriteLine("SET LENGTH={0:X4}", adpcm_length);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AdpcmIsPlaying && (value & 0x20) == 0)
|
if (AdpcmIsPlaying && (value & 0x20) == 0)
|
||||||
AdpcmIsPlaying = false; // only plays as long as this bit is set
|
AdpcmIsPlaying = false; // clearing this bit stops playback
|
||||||
|
|
||||||
if (AdpcmIsPlaying == false && (value & 0x20) != 0)
|
if (AdpcmIsPlaying == false && (value & 0x20) != 0)
|
||||||
{
|
{
|
||||||
if ((value & 0x40) == 0)
|
if ((value & 0x40) == 0)
|
||||||
Console.WriteLine("a thing thats normally set is not set");
|
Console.WriteLine("a thing thats normally set is not set");
|
||||||
|
|
||||||
//Console.WriteLine("Start playing! READ {0:X4} LENGTH {1:X4}", ReadAddress, AdpcmLength);
|
|
||||||
AdpcmIsPlaying = true;
|
AdpcmIsPlaying = true;
|
||||||
playingSample = 2048;
|
playingSample = 2048;
|
||||||
magnitude = 0;
|
magnitude = 0;
|
||||||
|
@ -143,6 +141,7 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
|
||||||
{
|
{
|
||||||
EndReached = true;
|
EndReached = true;
|
||||||
HalfReached = false;
|
HalfReached = false;
|
||||||
|
//Port180D &= 0x9F;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,6 +160,7 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
|
||||||
{
|
{
|
||||||
byte dmaByte = SCSI.DataBits;
|
byte dmaByte = SCSI.DataBits;
|
||||||
RAM[WriteAddress++] = dmaByte;
|
RAM[WriteAddress++] = dmaByte;
|
||||||
|
AdpcmLength++;
|
||||||
|
|
||||||
SCSI.ACK = false;
|
SCSI.ACK = false;
|
||||||
SCSI.REQ = false;
|
SCSI.REQ = false;
|
||||||
|
@ -168,10 +168,7 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SCSI.DataTransferInProgress == false)
|
if (SCSI.DataTransferInProgress == false)
|
||||||
{
|
|
||||||
Port180B = 0;
|
Port180B = 0;
|
||||||
//Console.WriteLine(" ADPCM DMA COMPLETED");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pce.IntADPCM = HalfReached;
|
pce.IntADPCM = HalfReached;
|
||||||
|
|
|
@ -1,14 +1,6 @@
|
||||||
******************************************************
|
******************************************************
|
||||||
* Turbo CD Issues *
|
* Turbo CD Issues *
|
||||||
******************************************************
|
******************************************************
|
||||||
- General, issues where ADPCM cuts out after a few seconds
|
|
||||||
- Bakuretsu Hunter
|
|
||||||
- Download II
|
|
||||||
- Dracula X when you rescue Maria
|
|
||||||
- Dragon Slayer
|
|
||||||
- Dungeon Explorer II
|
|
||||||
- Magicoal
|
|
||||||
- Ys IV
|
|
||||||
|
|
||||||
- Graphics corruption:
|
- Graphics corruption:
|
||||||
- Camp California, check seagull during opening
|
- Camp California, check seagull during opening
|
||||||
|
@ -18,11 +10,9 @@
|
||||||
Still some lesser issues with cancelling a fadeout. Otherwise CDDA is working now...
|
Still some lesser issues with cancelling a fadeout. Otherwise CDDA is working now...
|
||||||
- Develo Magazine demo game
|
- Develo Magazine demo game
|
||||||
|
|
||||||
Arcade Card games:
|
|
||||||
- JANSHIN DENSETSU sets the T flag prior to an LDA instruction; MANY TIMES (ie it doesnt seem to be an accident).
|
- JANSHIN DENSETSU sets the T flag prior to an LDA instruction; MANY TIMES (ie it doesnt seem to be an accident).
|
||||||
Unclear if T flag actually affects LDA instruction.
|
Unclear if T flag actually affects LDA instruction.
|
||||||
- Ryuuko no Ken is all messed up, and I don't super care :|
|
- Ryuuko no Ken is all messed up, and I don't super care :|
|
||||||
|
|
||||||
- Record of Lodoss War wont start game from title screen
|
- Record of Lodoss War wont start game from title screen
|
||||||
- Valis: Screen is black during entire intro section
|
- Valis: Screen is black during entire intro section
|
||||||
|
|
||||||
|
|
|
@ -167,7 +167,6 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
|
||||||
{
|
{
|
||||||
if (DataIn.Count == 0)
|
if (DataIn.Count == 0)
|
||||||
{
|
{
|
||||||
//Console.WriteLine("Sector available to read!!!");
|
|
||||||
// read in a sector and shove it in the queue
|
// read in a sector and shove it in the queue
|
||||||
disc.ReadLBA_2048(CurrentReadingSector, DataIn.GetBuffer(), 0);
|
disc.ReadLBA_2048(CurrentReadingSector, DataIn.GetBuffer(), 0);
|
||||||
DataIn.SignalBufferFilled(2048);
|
DataIn.SignalBufferFilled(2048);
|
||||||
|
@ -279,7 +278,6 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
|
||||||
pce.IntDataTransferReady = false;
|
pce.IntDataTransferReady = false;
|
||||||
if (DataTransferWasDone)
|
if (DataTransferWasDone)
|
||||||
{
|
{
|
||||||
Console.WriteLine("DATA TRANSFER FINISHED!");
|
|
||||||
DataTransferInProgress = false;
|
DataTransferInProgress = false;
|
||||||
DataTransferWasDone = false;
|
DataTransferWasDone = false;
|
||||||
pce.IntDataTransferComplete = true;
|
pce.IntDataTransferComplete = true;
|
||||||
|
@ -393,7 +391,6 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
|
||||||
if (CommandBuffer[4] == 0)
|
if (CommandBuffer[4] == 0)
|
||||||
SectorsLeftToRead = 256;
|
SectorsLeftToRead = 256;
|
||||||
|
|
||||||
Console.WriteLine("STARTED READ: {0} SECTORS FROM {1}",SectorsLeftToRead, CurrentReadingSector);
|
|
||||||
DataReadWaitTimer = pce.Cpu.TotalExecutedCycles + 5000; // figure out proper read delay later
|
DataReadWaitTimer = pce.Cpu.TotalExecutedCycles + 5000; // figure out proper read delay later
|
||||||
pce.CDAudio.Stop();
|
pce.CDAudio.Stop();
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
|
||||||
{
|
{
|
||||||
public partial class PCEngine
|
public partial class PCEngine
|
||||||
{
|
{
|
||||||
public static byte[] CdIoPorts = new byte[16];
|
public byte[] CdIoPorts = new byte[16];
|
||||||
|
|
||||||
public bool IntADPCM // INTA
|
public bool IntADPCM // INTA
|
||||||
{
|
{
|
||||||
|
@ -36,7 +36,6 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
|
||||||
{
|
{
|
||||||
CDAudio.CallbackAction = () =>
|
CDAudio.CallbackAction = () =>
|
||||||
{
|
{
|
||||||
Console.WriteLine("FIRING CD-AUDIO STOP IRQ MAYBE!");
|
|
||||||
IntDataTransferReady = false;
|
IntDataTransferReady = false;
|
||||||
IntDataTransferComplete = true;
|
IntDataTransferComplete = true;
|
||||||
};
|
};
|
||||||
|
@ -64,14 +63,6 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
|
||||||
CdIoPorts[2] = value;
|
CdIoPorts[2] = value;
|
||||||
SCSI.ACK = ((value & 0x80) != 0);
|
SCSI.ACK = ((value & 0x80) != 0);
|
||||||
|
|
||||||
if ((CdIoPorts[2] & 0x04) != 0) Log.Error("CD", "INTA enable");
|
|
||||||
if ((CdIoPorts[2] & 0x08) != 0) Log.Error("CD", "INTSTOP enable");
|
|
||||||
if ((CdIoPorts[2] & 0x10) != 0) Log.Error("CD", "INTSUB enable");
|
|
||||||
if ((CdIoPorts[2] & 0x20) != 0) Log.Error("CD", "INTM enable");
|
|
||||||
if ((CdIoPorts[2] & 0x40) != 0) Log.Error("CD", "INTD enable");
|
|
||||||
if ((Cpu.IRQControlByte & 0x01) == 0 &&
|
|
||||||
(CdIoPorts[2] & 0x7C) != 0) Log.Error("CD", "BTW, IRQ2 is not masked");
|
|
||||||
|
|
||||||
SCSI.Think();
|
SCSI.Think();
|
||||||
RefreshIRQ2();
|
RefreshIRQ2();
|
||||||
break;
|
break;
|
||||||
|
@ -89,7 +80,7 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
|
||||||
|
|
||||||
case 0x1805:
|
case 0x1805:
|
||||||
case 0x1806:
|
case 0x1806:
|
||||||
// Latch CDDA data... no action needed for us
|
// Latch CDDA data... no action needed for us (because we cheat)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x1807: // BRAM Unlock
|
case 0x1807: // BRAM Unlock
|
||||||
|
@ -101,20 +92,14 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
|
||||||
ADPCM.IOAddress &= 0xFF00;
|
ADPCM.IOAddress &= 0xFF00;
|
||||||
ADPCM.IOAddress |= value;
|
ADPCM.IOAddress |= value;
|
||||||
if ((CdIoPorts[0x0D] & 0x10) != 0)
|
if ((CdIoPorts[0x0D] & 0x10) != 0)
|
||||||
{
|
|
||||||
Console.WriteLine("doing silly thing");
|
Console.WriteLine("doing silly thing");
|
||||||
ADPCM.AdpcmLength = ADPCM.IOAddress;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x1809: // ADPCM address MSB
|
case 0x1809: // ADPCM address MSB
|
||||||
ADPCM.IOAddress &= 0x00FF;
|
ADPCM.IOAddress &= 0x00FF;
|
||||||
ADPCM.IOAddress |= (ushort)(value << 8);
|
ADPCM.IOAddress |= (ushort)(value << 8);
|
||||||
if ((CdIoPorts[0x0D] & 0x10) != 0)
|
if ((CdIoPorts[0x0D] & 0x10) != 0)
|
||||||
{
|
|
||||||
Console.WriteLine("doing silly thing");
|
Console.WriteLine("doing silly thing");
|
||||||
ADPCM.AdpcmLength = ADPCM.IOAddress;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x180A: // ADPCM Memory Read/Write Port
|
case 0x180A: // ADPCM Memory Read/Write Port
|
||||||
|
@ -123,8 +108,6 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
|
||||||
|
|
||||||
case 0x180B: // ADPCM DMA Control
|
case 0x180B: // ADPCM DMA Control
|
||||||
ADPCM.Port180B = value;
|
ADPCM.Port180B = value;
|
||||||
if (ADPCM.AdpcmCdDmaRequested)
|
|
||||||
Console.WriteLine(" ADPCM DMA REQUESTED");
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x180D: // ADPCM Address Control
|
case 0x180D: // ADPCM Address Control
|
||||||
|
|
Loading…
Reference in New Issue