Added AY38912 support
This commit is contained in:
@@ -547,7 +547,7 @@ namespace Core.Cpu
|
||||
return (ushort)((high << 8) | low);
|
||||
}
|
||||
|
||||
private int ExecuteOpcode(byte opcode)
|
||||
internal int ExecuteOpcode(byte opcode)
|
||||
{
|
||||
sbyte offset = 0;
|
||||
byte oldCarry = 0;
|
||||
@@ -1588,6 +1588,32 @@ namespace Core.Cpu
|
||||
AF.Low = flags;
|
||||
return 16;
|
||||
}
|
||||
case 0xAB: // OUTD
|
||||
{
|
||||
// 1. Read the byte from memory at the HL address (Applying Wait States!)
|
||||
byte outdVal = ReadMemory(HL.Word);
|
||||
|
||||
// 2. Decrement the B register
|
||||
BC.High--;
|
||||
|
||||
// 3. Output that byte to the hardware port stored in BC
|
||||
_simpleIoBus.WritePort(BC.Word, outdVal);
|
||||
|
||||
// 4. Decrement HL
|
||||
HL.Word--;
|
||||
|
||||
// 5. Update Flags
|
||||
// The N flag (Bit 1) is always set.
|
||||
AF.Low |= 0x02;
|
||||
|
||||
// The Z flag (Bit 6) is set if B reaches 0, otherwise cleared.
|
||||
if (BC.High == 0)
|
||||
AF.Low |= 0x40;
|
||||
else
|
||||
AF.Low &= 0xBF;
|
||||
|
||||
return 16; // Takes 16 T-States
|
||||
}
|
||||
case 0xB9: // CPDR
|
||||
{
|
||||
byte memVal = ReadMemory(HL.Word);
|
||||
|
||||
Reference in New Issue
Block a user