Family BASIC keyboard

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

Celius
Posts: 2157
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Family BASIC keyboard

Post by Celius » Thu Jul 20, 2006 8:08 pm

I was wondering, has anybody ever used this for any of their demos? Does anybody know how to use this? I couldn't even get this working with a family Basic ROM that I had. I've never really dealt with it, and I'm interested, because I'm working on a project that's like a NES PC (Personal Computer, not Program Counter.). It would have many different functions, but it would just be a cartridge, not like any new hardware. I've thought about calling it Nintendows, but I was wondering if there's anything with that name already. So yeah, does anyone know anything about this keyboard?

tepples
Posts: 21755
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Family BASIC keyboard

Post by tepples » Thu Jul 20, 2006 8:38 pm

Celius wrote:I'm working on a project that's like a NES PC (Personal Computer, not Program Counter.).
What kind of mapper would that have? Even a simple organizer app would need at least some sort of mass storage.
So yeah, does anyone know anything about this keyboard?
Apart from goroh's doc translated?

Celius
Posts: 2157
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius » Thu Jul 20, 2006 9:36 pm

tepples wrote:
Celius wrote:I'm working on a project that's like a NES PC (Personal Computer, not Program Counter.).
What kind of mapper would that have? Even a simple organizer app would need at least some sort of mass storage.
I was thinking of having like MMC1, because you can use SRAM. But, I was thinking of like Memory Card type things, that would just be an SRAM chip that you could stick into a slot where the SRAM would usually be. I think this is possible. It's like the concept of floppy disks, except it's more like chips. It's just a battery packed SRAM chip, maybe in cool looking Memory card type looking case. Thanks for the link!

EDIT:

Okay, so I'm looking at this doc, and I'm just missing something here.
Like this:


3.How to control the keyboard
(1)Initialization
the next read after initializing keyboard will be the first scan.
$4016 <- #$05

(2) the 1st scan
$4016 <- #$04
$4016 -> D1a
$4016 <- #$06
$4016 -> D1b

(3) 2nd - 10th scan
same as (2)
$4016 <- #$04 at this point it will automatically moves on to the
next scan
$4016 -> D2a
$4016 <- #$06
$4016 -> D2b


I have no idea what any of this means. Like, what the heck? I'm looking at everything in the doc, and looking at this, and saying, "What are they talking about?". I think I'm missing something here. Can somebody help me out?

User avatar
Quietust
Posts: 1493
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Post by Quietust » Thu Jul 20, 2006 9:53 pm

Actually, that document has a significant error - you read the keys back from $4017, not $4016.

The keyboard is mostly like a normal controller, but with the following differences:
  • When you write to $4016, you always have D2 set - if you leave it clear, you end up sending commands to the tape recorder instead.
  • You read 4 bits at a time out of $4017 D4-D1, rather than $4016/$4017 D0.
  • In between each read from $4017, you need to write again to $4016 and toggle D1 to advance it to the next set of keys.
  • You read $4017 a total of 20 times (with a $4016 write in between each one), rather than only 8.
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.

Celius
Posts: 2157
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius » Thu Jul 20, 2006 10:09 pm

Thanks, that cleared up a whole lot. But just one more thing: Do you do the strobe like you do on the regular controller? Like this:

lda #1
sta $4016
lda #0
sta $4016

And you said you have to keep D2 always set, because you'll just be sending stuff to the tape recorder, and you have to keep D2 set in between the writes to $4017? And you flip D1 to move to A1-A4 or B1-B4 like said in the doc?

User avatar
Quietust
Posts: 1493
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Post by Quietust » Thu Jul 20, 2006 10:27 pm

Celius wrote:Thanks, that cleared up a whole lot. But just one more thing: Do you do the strobe like you do on the regular controller? Like this:

lda #1
sta $4016
lda #0
sta $4016
Yes, except you do
LDA #$05
STA $4016
LDA #$04
STA $4016
Celius wrote:And you said you have to keep D2 always set, because you'll just be sending stuff to the tape recorder, and you have to keep D2 set in between the writes to $4017? And you flip D1 to move to A1-A4 or B1-B4 like said in the doc?
The overall process is like this:
LDA #$05
STA $4016

LDA #$04
STA $4016

LDA $4017
STA keys+0

LDA #$06
STA $4016

LDA $4017
STA keys+1

LDA #$04
STA $4016

LDA $4017
STA keys+2

LDA #$06
STA $4016

LDA $4017
STA keys+3

...
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.

Celius
Posts: 2157
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius » Thu Jul 20, 2006 10:37 pm

Okay, that clears up everything. Now it all works fine. Thanks for all your help, I really do appreciate it!

User avatar
dXtr
Posts: 375
Joined: Tue Sep 21, 2004 12:11 am
Location: Karlshamn (Sweden)

Re: Family BASIC keyboard

Post by dXtr » Fri Jul 21, 2006 5:27 am

tepples wrote:What kind of mapper would that have? Even a simple organizer app would need at least some sort of mass storage.
wasn't there some talk about creating a NES cartridge with CF-adapter for reading/writing here some month ago? can't find it thought as the search allways says that there where no finds regardless of what I search for :?

edit:
found it http://nesdev.com/bbs/viewtopic.php?t=530&start=0

not exactly the same.. as I was thinking of but it's something ^^
Sorry for misspellings, I'm from Sweden ^^

Celius
Posts: 2157
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius » Tue Jul 25, 2006 11:52 pm

I have another question... Would it be possible to connect the keyboard to the US NES? I was talking about NES level editors a while back, and I think tepples mentioned the idea of using the SNES mouse on the NES, and this would be great for Nintendows, because you could use the keyboard and mouse. Maybe if you could hook up the SNES mouse the the FC, or the keyboard to the US NES, you could use both.

tepples
Posts: 21755
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples » Wed Jul 26, 2006 5:28 am

I'd rather find a way to use a PS/2 keyboard, perhaps with a PIC in the middle to translate protocols.

Jagasian
Posts: 417
Joined: Wed Feb 09, 2005 9:31 am

Post by Jagasian » Wed Jul 26, 2006 10:47 am

tepples wrote:I'd rather find a way to use a PS/2 keyboard, perhaps with a PIC in the middle to translate protocols.
That'd be great, as a Family Basic Keyboard is hard to come by. But there is a catch. The Family Basic Keyboard had an audio port for a tap drive that could be used to save digital data via modulation. Do any emulators even support this feature? What games actually used it?

User avatar
Quietust
Posts: 1493
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Post by Quietust » Wed Jul 26, 2006 12:03 pm

Jagasian wrote:The Family Basic Keyboard had an audio port for a tape drive that could be used to save digital data via modulation. Do any emulators even support this feature? What games actually used it?
I seem to recall that Excitebike uses it for its "custom track" stuff. The Family Basic cartridges almost definitely used it.
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.

Celius
Posts: 2157
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius » Wed Jul 26, 2006 2:12 pm

I think maybe I'll look in to either hooking the mouse up to the FC or the Family keyboard up to the NES. I'd like to stick with NES/FC hardware, but thanks for the suggestion. Please don't tell me if you think it's impossible, because I'd like to see for myself.

tepples
Posts: 21755
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples » Wed Jul 26, 2006 2:17 pm

The new Famicom takes NES 7-pin controllers. The SFC/SNES mouse shows up as a 32-bit data stream on D0, and it would plug in to the new FC in the same way that a SFC/SNES controller would plug in to an NES.

Celius
Posts: 2157
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius » Wed Jul 26, 2006 3:36 pm

Does the new FC have an expansion port? I have an old FC with the controllers attatched.

Post Reply