i've checked out the nesdev wiki page (along with a few other resources about the keyboard) and i feel like i understand how to write the code to read the button presses of the keyboard. i just wanted verification from someone smarter than me that this was a possibility before i dropped a bunch of cash on one of these keyboards.
if this ends up working out, i will post a full picture/video tutorial on how to mod the keyboard and nintendo to work together along with some example code for reading the button presses.
http://code.google.com/p/playpower/sour ... ame%2Fcode
I wonder how much modding Family BASIC would need to work on a clone.
My thinking here is instead of hacking hardware you could go the NOAC-as-Keyboard route.
I guess that does spoil my only software hacking needed plan. From what I've heard they've been making their own UNROM boards.tepples wrote:What rewritable cartridge do they recommend for testing one's software on the clones? That's been the one reason I haven't got into the Playpower project: PowerPak incompatibility.slobu wrote:As a side the PLAYPOWER people are figuring out how to code for the NOAC clones with keyboard
I'm already going a bit off topic but what are the options besides a PowerPak or self-made UNROM board? I've got a NOAC-as-Keyboard to test on.
first thing i did was open it up and pry open the controller jack itself. here's what i've found -
pin 1 - light brown wire - ground
pin 4 - red wire - port 1 d4
pin 5 - orange wire - port 1 d3
pin 6 - yellow wire - port 1 d2
pin 7 - green wire - port 1 d1
pin 10 - blue wire - out 2
pin 11 - light purple - out 1
pin 12 - grey wire - out 0
pin 13 - white wire - port 0 d1
pin 15 - dark purple - 5v
my initial plan was to install 25 pin connector jacks to both the NES and the keyboard and remove the controller cord from the keyboard completely. the 25 pin connector jack on the NES would be connected directly to the expansion slot via soldered wires. this way, i could plug the keyboard directly in to the expansion slot.
but here's my question. i'm still very new to all this and so there's a lot that is still unclear to me. some of these points are present in the pre-existing regular nintendo controller ports, correct? could i possibly use those with only slight modification?
FYI, I'm posting blog entries about this at - http://nickmaynard.tumblr.com/tagged/ni ... rd+project
http://nickmaynard.tumblr.com/post/1386 ... -modifying
i'm posting these here with the hopes that someone will point out to me when i'm doing something wrong.
Code: Select all
;---------------------------------------- keyboardInput = $4016 keyboardOutput = $4017 keyboardMatrix: .RES 9 ;nine bytes of RAM to store keyboard bit matrix ;---------------------------------------- resetKeyboardMatrix: ldx #$08 lda #$FF ;for the keyboard, bits are set when the key is NOT held @a: sta keyboardMatrix,x dex bpl @a: rts ; ;Scan keyboard port and store any held keys in bit matrix ; ;IMPORTANT: the keyboard actually reads a '0' for a key that is held and ; a '1' for a key that is not held - opposite to the controller pads etc. ; readKeyboard: lda #$05 ;reset port sta keyboardInput ldx #$00 @a: lda #$04 ;select column 0 sta keyboardInput lda keyboardOutput ;read port lsr a and #$0F ;put in LSB sta keyboardMatrix,x lda #$06 ;select column 1 sta keyboardInput lda keyboardOutput ;read port asl a asl a asl a and #$F0 ;put into MSB ora keyboardMatrix,x ;'add' to LSB sta keyboardMatrix,x ;store in matrix inx cpx #$09 ;there are nine rows to read bne @a rts BIT_MASK: .BYTE $01,$02,$04,$08,$10,$20,$40,$80 ; ;Input: Y = row, X = column ;Output: A=0, key pressed, A=anything other than 0, key not pressed ; ;Example, Y=6, X=03 will check the 'A' key and return a 0 if the ; 'A' key is held down ; readKey: lda keyboardMatrix,y and BIT_MASK,x rts ; Row Bit0 Bit1 Bit2 Bit3 Bit4 Bit5 Bit6 Bit7 ; 0 F8 RETURN [ ] KANA R-SHFT \(Yen) STOP ; 1 F7 @ : ; _ / - ^ ; 2 F6 O L K . , P 0 ; 3 F5 I U J M N 9 8 ; 4 F4 Y G H B V 7 6 ; 5 F3 T R D F C 5 4 ; 6 F2 W S A X Z E 3 ; 7 F1 ESC Q CTRL L-SHFT GRPH 1 2 ; 8 CLR UP RIGHT LEFT DOWN SPACE DEL INS