NES program running without cartridge

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems. See the NESdev wiki for more information.

Moderator: Moderators

Post Reply
User avatar
za909
Posts: 249
Joined: Fri Jan 24, 2014 9:05 am
Location: Mijn hart woont al in Nederland

NES program running without cartridge

Post by za909 »

I've had this crazy idea of "could an NES game cartridge be removable without the game crashing?". I realize the space issue would be huge, since there would only be a bit above 1.5k of code that could be housed by the RAM, while still leaving some zero page and stack space for variables. But the biggest issue is what to do with the display? With no CIRAM wiring connected and no tiles, the only thing I could imagine that would work would be to "go Atari 2600" and draw "pixels" after having gone through all the trouble of syncing up the CPU and the PPU. Now drawing using palette changes would not work because after every write, the PPU address is auto-incremented to point to the next palette entry, which would produce unwanted "pixels". On top of that, the time it takes to write the next color to the PPU would be too much to have acceptable pixel resolution this way (the PPU having produced too many pixels by the time a new color is written). But maybe it could be simplified by using grayscale mode and the color emphasis bits for a basic 3-bit RGB palette (whose brightness could be slightly changed by the underlying palette entry, $x0).
Would it be possible to have something as simple as Pong working this way?
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: NES program running without cartridge

Post by dougeff »

Where would the CHR data come from? ie, no tiles.
nesdoug.com -- blog/tutorial on programming for the NES
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: NES program running without cartridge

Post by lidnariq »

For the most part, an operating PPU without a cartridge will see the open bus pattern, so you can't really use the tilemap.

Sound, OAMDMA, PPU palette work as normal.

IRQ; NMI; CIC; PPU name, attribute, and character tables, don't; you have to poll for NMI/IRQ instead.

I did a ridiculous thing in the past.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: NES program running without cartridge

Post by tokumaru »

The good side of not being able to use VRAM for graphics is that you get an extra 2K for the game state and data, leaving most of the CPU RAM free for actual code.

That being said, I don't think you can pull off any kind of usable graphics when rendering is off. Manipulating the PPU address is way too slow, and even if you used 3 settings of emphasis bits (one in each of A, X and Y), the 4 cycles needed for a PPU write correspond to 12 pixels, so the horizontal resolution would be limited to 21 or so pixels. And each line would take 63 bytes of precious RAM.

Yeah, I really can't think of a way to do graphics for games other than Simon or others that can be similarly blocky.
User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2064
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: NES program running without cartridge

Post by FrankenGraphics »

Huh... Doesn't the nametable remain in memory when you eject the cartridge (which you used to inject the program with anyway)? There's easily recognizable shapes when you remove it, iirc*

*on a nes with pin four on the lockout chip disconnected/tied to gnd.
User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Re: NES program running without cartridge

Post by Bregalad »

tokumaru wrote:The good side of not being able to use VRAM for graphics is that you get an extra 2K for the game state and data, leaving most of the CPU RAM free for actual code.
Unfortunately, both the enable pin and an adress pin of that RAM chips comes from the cartridge, so without it... the whole 2k VRAM is completely unusable.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: NES program running without cartridge

Post by tokumaru »

Bregalad wrote:Unfortunately, both the enable pin and an adress pin of that RAM chips comes from the cartridge, so without it... the whole 2k VRAM is completely unusable.
Oh crap, I didn't think of that!
User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2064
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: NES program running without cartridge

Post by FrankenGraphics »

Could something be gained soldering jumpers between pins on the expansion port? Making this even worse...
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: NES program running without cartridge

Post by Dwedit »

Look at some videos of TapeDump running without cartridge, that's what it would look like.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: NES program running without cartridge

Post by tokumaru »

Obviously, but COULD it maybe look any better?
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: NES program running without cartridge

Post by lidnariq »

You certainly could add a pair of resistors to give you m218-style PPU ability, but then you've modified the console.

To me, it seems a little off track to allow any modification to the console, other than maybe disabling/removing the CIC so that all console variants start off equally capable.
slobu
Posts: 276
Joined: Tue Jul 12, 2011 10:58 am

Re: NES program running without cartridge

Post by slobu »

Sounds like graphics are out of the question without a cart on base hardware?

Would the Aladdin Deck Enhancer alleviate that restriction?
https://en.wikipedia.org/wiki/Aladdin_Deck_Enhancer
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: NES program running without cartridge

Post by Dwedit »

Once you have an Aladdin cart in there (or a Contra cart for that matter), you no longer have no cartridge.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: NES program running without cartridge

Post by lidnariq »

It's also not no graphics. You can still do blocky sprites. You can still do raster effects. (Which raster effects you can can fit in will be limited due to paucity of RAM).

In practice, I've noticed that floating pins on the NES cart connector (meaning specifically NTRAM/CE and NTRAMA10) very loosely capacitively couple with whatever's around, which in practice means "coupling with mains frequency". So a small portion of the screen will actually get valid data from RAM... See ccovell's Theremin.


(The blocky sprite tiles that you do get, when NTRAM/CE is floating high, will look like:

Code: Select all

wxyz2ttt
wxyz2tt3
wxyz2t3t
wxyz2t33
wxyz23tt
wxyz23t3
wxyz233t
wxyz2333
where "t"=transparent, "2" and "3"=palette entries 2 and 3, and "wxyz" = the lower 4 bits of the sprite #, in binary, where set bits are color 3 and clear bits are transparent.
User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2064
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: NES program running without cartridge

Post by FrankenGraphics »

other than maybe disabling/removing the CIC so that all console variants start off equally capable.
This, and that the modification is so popular that i estimate that a fair percentage (at least in EU) have been modified. Second hand vendors seem to sell them modified oftener than not. I've modified my two PAL units and have done the modification to two other units for other people. I should probably get an unmodified unit before they run out so i don't forget what blinking gray looks like. :lol:
Post Reply