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

Newb CHR RAM issue

Newb CHR RAM issue
by on (#197951)
Hello folks. I have been working with a TNROM test cart and am trying to put a simple program on it that uses CHR RAM. Everything seems to be set up correctly and it works perfectly fine in FCEUX. However, when I write it to the test cart, the tile graphics are all jumbled and wrong, but everything else works as expected (bank switching, nametables, I/O, etc). Also, I have tested the cart by writing a TNROM game to it and the board works fine.

I'm forced to assume I am doing something wrong but have failed to discover what that could be. Possibly something special for TNROM?

Before going into more detail, I was hoping that some of you out there might have run into a similar issue. It appears like the tiles are being written to (or read from) the wrong addresses. It's driving me nuts.

Anyway, I have been digging through posts and testing different things for days and everything I have done seems to be correct. It's probably something obvious. I'm a newb at this, after all.

Any advice out there?
Re: Newb CHR RAM issue
by on (#197952)
MMC3 chr-ram boards needs the chr-ram bank to be set since the value at power-on is unknown.

I had the same issue in hardware with my first mmc3 char-ram cart. The emulators sets the bank to 0 by default but this is not the case on the real thing.
Re: Newb CHR RAM issue
by on (#197953)
Banshaku wrote:
MMC3 chr-ram boards needs the chr-ram bank to be set since the value at power-on is unknown.

I had the same issue in hardware with my first mmc3 char-ram cart. The emulators sets the bank to 0 by default but this is not the case on the real thing.


You rock! I'll give it a try.

Thanks!
Re: Newb CHR RAM issue
by on (#197956)
Banshaku wrote:
MMC3 chr-ram boards needs the chr-ram bank to be set since the value at power-on is unknown.

I had the same issue in hardware with my first mmc3 char-ram cart. The emulators sets the bank to 0 by default but this is not the case on the real thing.


Well, I thought that this would be enough for me to look up how to do this myself, but it remains unclear.

How exactly do I set the chr ram bank to 0? It's not clear to me what register would have control over that.
Re: Newb CHR RAM issue
by on (#197958)
robroymcc wrote:
Banshaku wrote:
MMC3 chr-ram boards needs the chr-ram bank to be set since the value at power-on is unknown.

I had the same issue in hardware with my first mmc3 char-ram cart. The emulators sets the bank to 0 by default but this is not the case on the real thing.


Well, I thought that this would be enough for me to look up how to do this myself, but it remains unclear.

How exactly do I set the chr ram bank to 0? It's not clear to me what register would have control over that.


The same registers as if you were using MMC3 with CHR ROM. Either set the two 2KB CHR banks to 0 and 2 and the four 1K banks to 4, 5, 6, 7, or set the 1K banks to 0, 1, 2 and 3 and the 2K banks to 4 and 6. Basically, you need to set up the banks so that none of them are mirrors or overlapping and you're actually using the entire 8KB of CHR RAM.
Re: Newb CHR RAM issue
by on (#197963)
I posted MMC3 CHR RAM window init code in another topic.
Re: Newb CHR RAM issue
by on (#197968)
AWJ wrote:
robroymcc wrote:
Banshaku wrote:
MMC3 chr-ram boards needs the chr-ram bank to be set since the value at power-on is unknown.

I had the same issue in hardware with my first mmc3 char-ram cart. The emulators sets the bank to 0 by default but this is not the case on the real thing.


Well, I thought that this would be enough for me to look up how to do this myself, but it remains unclear.

How exactly do I set the chr ram bank to 0? It's not clear to me what register would have control over that.


The same registers as if you were using MMC3 with CHR ROM. Either set the two 2KB CHR banks to 0 and 2 and the four 1K banks to 4, 5, 6, 7, or set the 1K banks to 0, 1, 2 and 3 and the 2K banks to 4 and 6. Basically, you need to set up the banks so that none of them are mirrors or overlapping and you're actually using the entire 8KB of CHR RAM.


You folks kick butt. That did the trick. Thanks a lot.
Re: Newb CHR RAM issue
by on (#198035)
Good to hear that you made it work!