This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

Programming through an NES controller?

Programming through an NES controller?
by on (#44879)
In this post, Hamtaro126 wrote:
tepples wrote:
There are plenty of BASIC interpreters for NES-class hardware.

Wrong! There are 2 of them, Family Basic is too limited, and the problem with the BASIC interperter (NBasic/NESASM) we have now is the incompatibility with the real NES.

I apologize for my vagueness: By NES-class I didn't necessarily mean NES-compatible. The NES with SNROM has more RAM (10+8 KiB) than a stock ZX81 (1 KiB), a stock PET (5 KiB), a stock VIC-20 (5 KiB), or even a stock Apple II (16 KiB).

The one thing stopping me from making some sort of integer BASIC myself is the lack of any sort of standard keyboard interface to a 72-pin system. Or should I try some sort of "choose keywords from a menu" program input technique like that used on TI-83, TI-86, and TI-89 series graphing calculators?

by on (#44884)
I would like to see a straight up 6502 editor on the NES, just for testing purposes. The way I envisioned it was that all code was in RAW 6502 format. So there wouldn't be any JMP Label, instead it would be JMP $xxxx. This would allow for as much code as possible without taking up extra RAM space with label names and such. This would be possible with any game that has SRAM, so you could make 8k demos, and of course have CHR RAM so that you could make your own graphics.

All code would be stored as is, so there wouldn't be much "assembling". There would have to be more than a few bytes that tell you what's code and what's data though. You would select words from a menu, like you stated, where they'd be laid out in a grid, and you'd select "LDA", and then it would take you to another menu that would allow you to choose "Immediate" or "Indirect Y", etc.

But if you choose to make a BASIC interpreter, I would suggest going with the choose from a menu method. That seems to be the only choice you have. Though I'd lay them out intelligently, so it's not just alphabetical order, but the most common keywords first or something similar.

by on (#44885)
I have thought about text entry for text adventure type games, and best I have come up with is a bar that can switch between keywords/items/keyboard and also an on screen cursor that can select any on screen word. That way you could do things like show room items and click on one of those words. Should work well for programming where you would have labels/variables to select.

The other option is to make a PS/2->NES adapter with a PIC chip.

by on (#44887)
Quote:
The other option is to make a PS/2->NES adapter with a PIC chip.

This just screams out for an on-screen virtual keyboard that you aim the Zapper at!

by on (#44889)
Did anyone ever sell an extension cord to plug Super NES controllers into an NES? If so, I could use the mouse that came with Mario Paint.

by on (#44891)
blargg wrote:
Quote:
The other option is to make a PS/2->NES adapter with a PIC chip.

This just screams out for an on-screen virtual keyboard that you aim the Zapper at!
.. except you'd get epilepsy from the screen flashing over and over :lol:

Quote:
Did anyone ever sell an extension cord to plug Super NES controllers into an NES? If so, I could use the mouse that came with Mario Paint.


if you're willing to cut the cord it looks like you could just swap the connector:


"As a matter of fact, a SNES pad can be connected to a NES by simply swapping the connector on the end. "


i need to get me a snes mouse & mario paint..

by on (#44901)
I've typed on my NES, using just normal old HyperTerminal. I've built simple RS232 adapters for the controller port before, but it's kinda useless for random input since you'd have to poll it incessantly.

I wire the same adapter up to the the PIC on Squeedo though, and it's excellent there, having a huge (256 byte) circular buffer in PIC code, and a specific IRQ for the NES. An accessory like this though is cooler through the controller port (slower though).

I've had quite a few cool ideas to do with the NES controller port, one thing that stopped me from developing more stuff like that is the limited supply of NES controller cables. I have a box of them, and SNES ones, that bunnyboy gave me quite a while back (thanks again, and since you're here - are there any more?).

There lots of stuff I'd like to build, if there were enough parts.
Things that'd be interesting - SD card, EEPROM, USB link (a MODEM!), keyboard, mouse/paddle/trackball, MIDI..

Quote:
if you're willing to cut the cord it looks like you could just swap the connector


It would seem so, according to the mouse info in here too:
http://www.repairfaq.org/REPAIR/F_SNES.html

by on (#44905)
Memblers wrote:
MIDI..


didn't that miracle piano teaching system use midi sent via a controller? and there's of course the midines made with your squeedo

midi is definitely something i'm interested in being able to use.. ideally it'd be cool to get it working with more general mappers too

by on (#44911)
frantik wrote:
if you're willing to cut the cord it looks like you could just swap the connector:

"As a matter of fact, a SNES pad can be connected to a NES by simply swapping the connector on the end. "

i need to get me a snes mouse & mario paint..

That's the problem. For each Super NES Mouse accessory I buy and destroy, a copy of Mario Paint becomes useless. It'd be like using Mario Paint as a donor cart for my own development, and the whole idea of buying a PowerPak was to get away from donor carts. That's why I wanted to go the extension cord route, so that I can still use my Mario Paint Game Pak in my Super NES.

by on (#44912)
An option that would not require hardware hacking, is to make an input system using combinations of controller buttons.

I think I saw something similar on a friends' PSP

Each character could be represented by a combination of one or two adjacent directions in the d-pad, [ and | or ] one or both the A & B buttons, or one or both the select & start buttons.

The d-pad would yield 8 different combinations, and each 2 button cluster would yield 3 ( one, the other ot both )
so it would be 8 x 3 = 24 x 2 = 48,
plus 8 d-pad combinations alone, and 3 combinations of button clusters alone, giving a total of: 48 + 8 + 3 + 3 = 62

That's a lot of characters or commands.

by on (#44920)
tepples wrote:
That's why I wanted to go the extension cord route, so that I can still use my Mario Paint Game Pak in my Super NES.


you could buy a nes extension cord and a snes extension cord and swap the connectors on one of them. then no original nintendo hardware is sacrificed

by on (#44921)
If your point is simply to have the acessory remain usable for its original purpose, you could always cut the cord like suggested, but use a more standard connector to easily connect it back again. You would then use the same standard connector on the other acessory cable you cut. It'd still be a cut acessory, but at least mario paint wouldn't be useless. (or at least not more than it already is out-of-the-box. ;)

by on (#46097)
so, there seems to be some kind of standard mouse system.. cause the educational computer cart uses a mouse, and it turns out Nestopia emulates the mouse (and the keyboard for that matter)

if th SNES mouse would work using the same code, that would be pretty cool

someone found a dump of the educaitonal computer cart so you can test out mouse support: http://cah4e3.shedevr.org.ru/dumping_2006.php

by on (#46136)
tepples wrote:
That's the problem. For each Super NES Mouse accessory I buy and destroy, a copy of Mario Paint becomes useless. It'd be like using Mario Paint as a donor cart for my own development, and the whole idea of buying a PowerPak was to get away from donor carts. That's why I wanted to go the extension cord route, so that I can still use my Mario Paint Game Pak in my Super NES.


I thought everyone cut up cheap $3 SNES and NES extension cables for this? I got fancy on mine because I got a good price on DIN-5 inline connectors and cut them in half, put the DIN-5 in-between so I can swap the SNES for the NES ends and mix NES and SNES accessories on either system. Obviously software support is necessary for it to work, but the hardware appears moderately compatible.

by on (#48291)
http://www.semsons.com/bicofltoseio.html

...Looks like it's time for an update of the PowerPak firmware. :wink:

In all seriousness, though, if programming is going to be done on the NES, we're going to need a way around memory limitations and to save our work. Unless we have an integrated development solution using something like the PowerPak, we'd be much better off interfacing the NES as a slave device.