It is currently Thu Dec 13, 2018 7:16 am

All times are UTC - 7 hours



Forum rules





Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Sun Nov 18, 2018 4:15 am 
Offline

Joined: Sat Oct 06, 2018 10:15 am
Posts: 4
Has anyone been able to interface a PC keyboard to the game port or some kind of storage device to the Super NES?
The scan codes from the Xband keyboard look identical to a PC keyboard and the pin outs are pretty much the same as PS/2 and USB with vcc, gnd, clk and data. FAT16/32 has been implemented in 6502 using SPI mode with SD cards. Can the same be done for the Super NES using one or both of the game ports for IO?


Top
 Profile  
 
PostPosted: Sun Nov 18, 2018 6:06 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20867
Location: NE Indiana, USA (NTSC)
You'd need a microcontroller (MCU) to link the two, as both the Control Deck and the keyboard want to be generating the clock signal. Years ago, tpw_rules was working on a PS/2 to NES/Super NES controller bridge, with a mouse mode and a keyboard mode, but college interfered.


Top
 Profile  
 
PostPosted: Sun Nov 18, 2018 9:00 am 
Offline

Joined: Fri Feb 24, 2012 12:09 pm
Posts: 732
To play by the rules, an SD card adaptor should have voltage conversion (for 3.3V supply/signals).
Without extra logic, the SNES could read about 1 byte per 150 cpu cycles via SPI.
That would be maybe 20Kbytes/second at 3.5MHz for opcodes in FastROM (and less MHz for controller access and main ram).


Top
 Profile  
 
PostPosted: Sun Nov 18, 2018 10:06 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20867
Location: NE Indiana, USA (NTSC)
That sounds about right. Assuming the SD card uses SPI over controller 2 bit 1, with a passthrough receptacle to connect actual controller 2 to bit 0, I count 92 master clocks per bit, or 32 + (108 * 8) - 6 = 890 clocks to read a byte, less than one 1324-clock scanline. (Correct me if I'm wrong.)
Code:
  ; Assume sep $20 and fast ROM
  lda #$01   ; 12
  sta tmp    ; 20   ; loop counter: once this 1 reaches carry, we're done
loop:
  lda $4017  ; 30   ; 401x access takes 12 clocks or two fast cycles
  lsr a      ; 12
  lsr a      ; 12   ; select adapter (bit 1), not player 1 (bit 0)
  rol tmp    ; 36
  bcc loop   ; 18
             ; -6   ; last untaken


Equivalent NES code runs in 60 + 192 * 8 - 12 = 1584 clocks, just over one 1364-clock scanline.
Code:
  lda #$01   ; 24
  sta tmp    ; 36   ; loop counter: once this 1 reaches carry, we're done
loop:
  lda $4017  ; 48
  and #$08   ; 24
  cmp #$01   ; 24   ; select adapter (bit 3), not player 1 (bit 0)
  rol tmp    ; 60
  bcc loop   ; 36
             ; -12      ; last untaken


This is why a few SPI-on-NES proposals give the SPI serialization job to cart hardware.


Top
 Profile  
 
PostPosted: Sun Nov 18, 2018 2:37 pm 
Offline

Joined: Sat Oct 06, 2018 10:15 am
Posts: 4
Loading 20Kbytes/s is not that bad if you were going to implement some kind of interpreted language like Basic. A banks worth of Basic code can go pretty far even if it's full of data statements. Audio is pretty limited since the SPC700 only has 64k, ~3 seconds to load. Only graphics data takes up a lot of space and the intent is not making a commercially saleable piece of software. As a learning tool it would be quite appealing for a kid to write something on a console that was intended just for video games. Some built-in tools like a tile/sprite editor, music tracker, assembler and disassembler/monitor to complement Basic would not require much room in ROM (a bank each). Everything could be done right on the Super NES without touching a PC.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group