Can somewhat load from audio

This commit is contained in:
2026-04-28 20:09:03 +01:00
parent 38bef38f96
commit ae685eabd6
7 changed files with 127 additions and 105 deletions

View File

@@ -19,7 +19,7 @@ namespace Core.Io
public byte ReadPort(ushort portAddress)
{
// The Spectrum ULA responds to any even port address (where the lowest bit is 0)
if ((portAddress & 0x01) == 0)
if ((portAddress & 0x01) == 0) //Port 0xFE)
{
byte highByte = (byte)(portAddress >> 8); // The B register!
byte result = 0xFF; // Start assuming no keys are pressed
@@ -40,11 +40,17 @@ namespace Core.Io
//return result;
// The top 3 bits (5, 6, 7) are unused by the keyboard and usually return 1 on a real Spectrum
return (byte)(result | 0xE0);
return (byte)(result | 0xA0);
}
// Kempston Joystick Port
if ((portAddress & 0xFF) == 0x1F)
{
return 0x00; // 0x00 means no joystick connected/no buttons pressed
}
// Return 0xFF for unhandled ports
return 0xFF;
return 0x00;
}
public void WritePort(ushort portAddress, byte portValue)