Jump to content

Game console as self-sufficient computer


Recommended Posts

If you really wanted to put the Computer back into "Family Computer", you really only have two options, as the RAM issue needs to be addressed:

1. Modify the board to enable more RAM. The standard board has that 2kB from $0000 to $07FF, and then mirrors that three more times. You hook up a daughter board with another 6k of RAM and bodge that in, and you could even implement some banking. This is still a ridiculously small amount of contiguous RAM, and you have to violate the integrity of the board. At that point, you might as well just design a new board around the PPU and APU chips to have a computer that looks and sounds like an NES, and could effectively emulate one.

2. Do it all in the cartridge. You have a lot more wiggle room in the "ROM" section of the memory map, nearly 48k. You could probably take 8-16k of that to make a simple development system, like an in-memory assembler and tile editor. You'd have the rest of the "ROM" and actually make it RAM. You could even make it banked so that you could build program and graphics data at the scale of latter-day NES games, which could be much bigger than 48k, thanks to banked ROMs.

Either way, you then need the ability to connect a keyboard and some mass storage. You could easily make a keyboard connect through a controller port (and Nintendo did, with FamiCom BASIC), but storage is more difficult. Since you probably want to save your programs, you'll need to connect to a tape or disk or something. The easiest thing would be to play a modulated stream through the audio RCA jack and just record that. Problem is, you have no way to load it back to work on it further. Your best option (at least on the exported NES -- this won't work on a Japanese FamiCom) is to use the expansion port on the bottom. It has the CPU data bus connected to it directly, but most of the address bus isn't there. So, you could use it as a parallel port and dump data into a storage device, which could also act as a ROM burner, or at least something that adds ROM images to an SD card that you could pop into a multicart. You could dump assembly source and metadata in there, too. It would... not be fast... but it could work.

The big "but" is that this would not give you the "code and try" immediacy you may be looking for. It would be a process, at best, of turning off the unit, swapping the SD card into a multicart, and swapping that in with the development cart. This is something you could easily do with the C64, or the Apple II or Atari 800, and you could still have all the fun of making a game with a 6502 system, and not go through all that. It also speaks to the "dream" of the X16, which gives you that immediacy along with the speed and resources to make the process as painless as possible.

  • Like 1
Link to comment
Share on other sites

  • Super Administrators
On 5/31/2022 at 6:56 AM, SlithyMatt said:

The big "but" is that this would not give you the "code and try" immediacy you may be looking for. It would be a process, at best, of turning off the unit, swapping the SD card into a multicart, and swapping that in with the development cart. This is something you could easily do with the C64, or the Apple II or Atari 800, and you could still have all the fun of making a game with a 6502 system, and not go through all that. It also speaks to the "dream" of the X16, which gives you that immediacy along with the speed and resources to make the process as painless as possible.

At this point, I'm just thinking "why not add I/O to the cartridge itself?" In theory, one could add a couple of PIO chips and run all the necessary functions from the cartridge. The NES itself would essentially just be a dumb terminal for the cartridge. I could see the cartridge starting up to a BASIC-like console, the user loading a game from disk (or flash storage) into a banked RAM system, then the system swapping out the ROM and basically rebooting directly to a RAM bank, starting the game. 

For development, the game would exit back to the command prompt by switching the bank back to the ROM. 

Of course, this doesn't solve the fact that the NES and similar consoles are terrible for text... but you could put an 80 column VDU on the cartridge, too, because why not? 

I mean, at this point, we're basically just talking about putting a whole computer on a cartridge... but then that really what you'd need to do in order to build a self-hosted system for game console development.

Link to comment
Share on other sites

  • Administrators
On 5/31/2022 at 4:56 PM, SlithyMatt said:

The big "but" is that this would not give you the "code and try" immediacy you may be looking for. It would be a process, at best, of turning off the unit, swapping the SD card into a multicart, and swapping that in with the development cart.

I also thought about this hurdle. I understand there will be limitations and compromises should be made. Turning off/on unit between different modes is not a huge deal. Swapping storage media can be avoided by combining everything in one cartridge and adding a physical switch on the cartridge.

On 6/1/2022 at 11:04 PM, TomXP411 said:

I mean, at this point, we're basically just talking about putting a whole computer on a cartridge... but then that really what you'd need to do in order to build a self-hosted system for game console development.

I thoght about this as the most easiest solution. I can put some tiny computer or MCU on the cartridge board, which will run IDE and allow all the development process. Technically this would not be much different from developing on the saparate computer, but it will give some feel of "code and try" immediacy.

When starting this thread I though that some board hacking is unavoidable to achive what I described. But after reading replies I now understand it can all be done in cartridge. It would be very complex cartridge in fact, with lots of RAM, bank switching, keyboard and storage controller, some switches and buttons, etc. But no matter how ugly this cartridge might turn out, I actually like this idea more then modifying the main board. I'm not sure if I'm ready to start this project, but discussing the possibilities is already fun. Thank you, guys! )

  • Like 1
Link to comment
Share on other sites

  • 3 months later...
  • Administrators

Here is a very close try to what I wanted to see except one big disadvantage: you can not program in this thing. But looking from different standpoint, this is very good looking OS running on NES! Maybe more to come in this project.

 

  • Like 3
Link to comment
Share on other sites

A big advantage of doing it all in a cartridge is you have the natural location for all of the I/O parts right there on the cartridge board, on the opposite edge from the cartridge port.

AFAIU, on NES powerup/reset, you'd have:

$0000-$07FF: NESRAM
$2000-$3FFF: PPU I/O ports
$4000-$5FFF: APU/Controller I/O ports
$6000-$7FFF: Work RAM if installed on CART
$8000-$FFF9: Cartridge ROM
$FFFA-$FFFF: NMI/IRQ/RESET vectors

If you have a clever enough banking scheme, you only need one RAM and one FlashROM chip. But "clever" here means setting things up so you can get from the start-up state to the normal memory map with the smallest possible boot-up code. Suppose it's 128KB each:

  • The $8000-$FFFF decode circuitry splits between the 16KB HighRAM window in $8000-$BFFF and the 16KB  ROM window in $C000-$FFFF
  • The bottom half of RAMBank 0 appears in the WRAM space in $6000-$7FFF
  • The banking latch has its reset pin hooked up, so on powerup/reset, the banking latch has is in its $00 state
  • The banking latch is: bit0-bit2 = ROM A14-A16; bit3-bit5 = RAM A14-A16, bit7=RAM/ROM, bit
  • In $00 state, ROMBank 0 is selected in $8000-$BFFF, with Bit7 of the latch selecting between ROM and RAM /OE in that space
  • In RAMBank $00 state, RAMBank 0 is selected for $8000-$BFFF
  • With RAM selected in $8000-$BFFF whether or not it's output is enabled, you can have the transition routine at the top of ROMBank 0 which copies itself to the top of RAMBank 0, toggles out the ROM, then calls code in the normal ROM window. Only JMP COLDSTART / ... / COLDSTART: ... / ENDROM is assembled for the ROM appearing at $8000, everything else is assembled for ROM appearing at $C000.
  • You have eight ROM segments and eight HighRAM segments, 2KB NES RAM and 8KB "LowRAM" that also appears in $8000-$9FFF when RAMBank 0 is selected.

While you can mask out RAM when setting ROM (and visa versa): "STA CALLROM : LDA BANK : AND #%1111100 : ORA CALLROM", you can also design code that allocates a ROM bank together with its own dedicated RAM bank, so, eg, "SYSCALL" executing in NESRam or WRAM is: "LDA THISBANK : PHA :  LDA #SYSBANKS : STA THISBANK : STA BANK : JSR + : PLA : STA THISBANK : STA BANK : RTS : + JMP DOSYS,X".

 

  • Like 2
Link to comment
Share on other sites

I seen that video the other day and thought it was a really cool idea.

I agree that there are ways you could expand on it if you really wanted to do so. Adding I/O and storage, both (RAM and ROM?) on the cart being the most obvious. However one of the comments on the video expressed one thing I was thinking the entire time, for the FamiCom, you could use the FamiCom Disk System to load and store information as well. In tandem with a cart you could probably create a pretty cool little era appropriate "Family Computer". Of course, I'm not 100% sure the FamiCom can use the FDS and a cart at the same time, but if it can, that seems like a great way to max out a potential design.

Either way, I really like that video. 🙂

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

Please review our Terms of Use