mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2024-06-12 06:29:30 +00:00
Merge branch 'master' of https://github.com/MoleskiCoder/EightBitNet
This commit is contained in:
commit
7942ca7085
|
@ -342,16 +342,17 @@ namespace EightBit.GameBoy
|
||||||
// Port/Mode Registers
|
// Port/Mode Registers
|
||||||
case P1:
|
case P1:
|
||||||
{
|
{
|
||||||
var p14 = this.scanP14 && !this.p14;
|
var directionKeys = this.scanP14 && !this.p14;
|
||||||
var p15 = this.scanP15 && !this.p15;
|
var miscKeys = this.scanP15 && !this.p15;
|
||||||
var live = p14 || p15;
|
var live = directionKeys || miscKeys;
|
||||||
var p10 = live && this.p10 ? 1 : 0;
|
var rightOrA = (live && !this.p10) ? 0 : Bits.Bit0;
|
||||||
var p11 = live && this.p11 ? 1 : 0;
|
var leftOrB = (live && !this.p11) ? 0 : Bits.Bit1;
|
||||||
var p12 = live && this.p12 ? 1 : 0;
|
var upOrSelect = (live && !this.p12) ? 0 : Bits.Bit2;
|
||||||
var p13 = live && this.p13 ? 1 : 0;
|
var downOrStart = (live && !this.p13) ? 0 : Bits.Bit3;
|
||||||
this.Poke(
|
var lowNibble = (byte)(rightOrA | leftOrB | upOrSelect | downOrStart);
|
||||||
port,
|
var highNibble = (byte)Chip.PromoteNibble((byte)Mask.Mask4);
|
||||||
(byte)(p10 | (p11 << 1) | (p12 << 2) | (p13 << 3) | (int)(Bits.Bit4 | Bits.Bit5 | Bits.Bit6 | Bits.Bit7)));
|
var value = (byte)(lowNibble | highNibble);
|
||||||
|
this.Poke(port, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user