Added acanline rendering. Fixed interrupts. Added XInput support

This commit is contained in:
2026-05-12 23:13:23 +01:00
parent edb41bdb3a
commit d571fe7187
6 changed files with 222 additions and 255 deletions

View File

@@ -9,8 +9,9 @@ namespace Core.Io
// public Psg AudioProcessor { get; set; }
// Joypad State (0xFF means no buttons pressed - the SMS uses Active-Low logic!)
public byte Joypad1State { get; set; } = 0xFF;
public byte Joypad2State { get; set; } = 0xFF;
public byte Joypad1Keyboard = 0xFF;
public byte Joypad1Gamepad = 0xFF;
public byte Joypad2State = 0xFF;
public byte ReadPort(ushort port)
{
@@ -30,16 +31,9 @@ namespace Core.Io
if ((lowerPort & 0x01) == 0) return VideoProcessor.ReadDataPort();
else return VideoProcessor.ReadControlPort();
}
if (lowerPort == 0xDC)
{
// Port 0xDC: Player 1 (Up, Down, Left, Right, 1, 2) + Player 2 (Up, Down)
return Joypad1State;
}
if (lowerPort == 0xDD)
{
// Port 0xDD: Player 2 (Left, Right, 1, 2) + Reset Button
return Joypad2State;
}
if (lowerPort == 0xDC) return (byte)(Joypad1Keyboard & Joypad1Gamepad);
if (lowerPort == 0xDD) return Joypad2State;
return 0xFF; // Floating bus
}