nesdev.com
http://forums.nesdev.com/

Newb CHR RAM issue
http://forums.nesdev.com/viewtopic.php?f=2&t=16065
Page 1 of 1

Author:  robroymcc [ Sun Jun 11, 2017 9:01 am ]
Post subject:  Newb CHR RAM issue

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?

Author:  Banshaku [ Sun Jun 11, 2017 10:17 am ]
Post subject:  Re: Newb CHR RAM issue

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.

Author:  robroymcc [ Sun Jun 11, 2017 10:19 am ]
Post subject:  Re: Newb CHR RAM issue

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!

Author:  robroymcc [ Sun Jun 11, 2017 10:56 am ]
Post subject:  Re: Newb CHR RAM issue

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.

Author:  AWJ [ Sun Jun 11, 2017 11:06 am ]
Post subject:  Re: Newb CHR RAM issue

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.

Author:  tepples [ Sun Jun 11, 2017 1:36 pm ]
Post subject:  Re: Newb CHR RAM issue

I posted MMC3 CHR RAM window init code in another topic.

Author:  robroymcc [ Sun Jun 11, 2017 2:08 pm ]
Post subject:  Re: Newb CHR RAM issue

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.

Author:  Banshaku [ Mon Jun 12, 2017 9:22 am ]
Post subject:  Re: Newb CHR RAM issue

Good to hear that you made it work!

Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/