mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2025-01-09 07:34:13 +00:00
First stab at getting the GbNet keyboard working properly. Better, but not perfect...
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
parent
dedc340bf5
commit
db8ad5ad5b
@ -335,16 +335,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 : 1;
|
||||||
var p11 = live && this.p11 ? 1 : 0;
|
var leftOrB = live && this.p11 ? 0 : 1;
|
||||||
var p12 = live && this.p12 ? 1 : 0;
|
var upOrSelect = live && this.p12 ? 0 : 1;
|
||||||
var p13 = live && this.p13 ? 1 : 0;
|
var downOrStart = live && this.p13 ? 0 : 1;
|
||||||
this.Poke(
|
var lowNibble = (byte)(rightOrA | (leftOrB << 1) | (upOrSelect << 2) | (downOrStart << 3));
|
||||||
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