News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: How can you tell if a nes game uses Vram?  (Read 4516 times)

Pikachumanson

  • Hero Member
  • *****
  • Posts: 607
    • View Profile
How can you tell if a nes game uses Vram?
« on: June 17, 2013, 04:07:23 am »
This might sound like a dumb question, but I was under the assumption that vram was a given in roms in general.
Can anyone tell me if this game uses Vram? I want to try and implement DvD's Romancia Vram in Kawa no Nushi Tsuri for things like item or enemy names. Would this be feasable? Or am I better off just doing a DTE routine?

snarfblam

  • Submission Reviewer
  • Hero Member
  • *****
  • Posts: 593
  • CANT HACK METROID
    • View Profile
    • snarfblam
Re: How can you tell if a nes game uses Vram?
« Reply #1 on: June 17, 2013, 05:49:58 pm »
What do you mean when you say VRAM? You have OAM RAM and nametable/attribute RAM, which are found inside the NES, and a cart will use either CHR RAM or CHR ROM. Other than CHR ROM, those can all be considered VRAM. I'm guessing you mean CHR RAM, since that's generally the only VRAM that's optional.

Not sure exactly what you're getting at either. Are you looking to implement a VWF? Kawa no Nushi Tsuri uses CHR ROM, which isn't suitable for a VWF. It might be possible to hack it to use CHR RAM. I don't see any CHR swapping happening while video output is on.

Bregalad

  • Hero Member
  • *****
  • Posts: 2745
    • View Profile
Re: How can you tell if a nes game uses Vram?
« Reply #2 on: June 17, 2013, 06:01:01 pm »
Another optional VRAM is the 4-screen additional VRAM that a great total of 3 games used : Gauntlet 1, Rad Racer 2 and Napoleon Senki. If your game isn't in this list then it's not using 4-screen VRAM. However, it might use CHR-RAM or CHR-ROM. Many emulators, such as VirtuaNES and Nestopia, and even good old Nesticle, allows you to visualize this in a "Rom->info" dialog.

OAM and pallete are normally not considered part of VRAM in Nintendo's systems.

Quote
Kawa no Nushi Tsuri uses CHR ROM, which isn't suitable for a VWF.
Actually CHR-ROM is suitable for VWF but it's quite complex and would require to pull off some dirty trick of the NES to make it work.

Pikachumanson

  • Hero Member
  • *****
  • Posts: 607
    • View Profile
Re: How can you tell if a nes game uses Vram?
« Reply #3 on: June 17, 2013, 06:34:05 pm »
Thanks for the replies! I think I'll go with dte on this one

snarfblam

  • Submission Reviewer
  • Hero Member
  • *****
  • Posts: 593
  • CANT HACK METROID
    • View Profile
    • snarfblam
Re: How can you tell if a nes game uses Vram?
« Reply #4 on: June 17, 2013, 06:38:33 pm »
Another optional VRAM is the 4-screen additional VRAM

And there is also MMC5's optional extra attribute RAM, but those rare things are entirely beside the point.

OAM and pallete are normally not considered part of VRAM in Nintendo's systems.

Depends on who you ask, I suppose. It's all video. Palette RAM, in particular, is on the same bus as the rest of the VRAM. Anyways, it's probably beside the point.

Actually CHR-ROM is suitable for VWF but it's quite complex and would require to pull off some dirty trick of the NES to make it work.

This I would like to hear more about, but I think "quite complex"/"dirty trick" is the difference between "possible" and "suitable". The only possibility I can think of is building pre-rendered bits of VWF and pasting them together.

Gideon Zhi

  • IRC Staff
  • Hero Member
  • *****
  • Posts: 3529
    • View Profile
    • Aeon Genesis
Re: How can you tell if a nes game uses Vram?
« Reply #5 on: June 17, 2013, 09:53:16 pm »
Thanks for the replies! I think I'll go with dte on this one

This statement tells me that you either don't understand what a VWF is, don't understand what DTE is, or both. They're completely unrelated - one deals with how text appears on the screen, while the other deals with how it's stored in the ROM.

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 7002
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: How can you tell if a nes game uses Vram?
« Reply #6 on: June 17, 2013, 10:22:24 pm »
In FCEUX, it's simple to tell. Just go to the Message Log under Help, and if CHR ROM is anything but "0 x 8KB", then it's using CHR-ROM. (the same info is in the header in a hex editor. If offset 5 of the header is anything but 0, then it's CHR-ROM)
"My watch says 30 chickens" Google, 2018

Bregalad

  • Hero Member
  • *****
  • Posts: 2745
    • View Profile
Re: How can you tell if a nes game uses Vram?
« Reply #7 on: June 18, 2013, 05:22:20 am »
Quote
Palette RAM, in particular, is on the same bus as the rest of the VRAM.
It's not that obvious in fact. You access to palette RAM as if you access other parts of VAM (I mean name, attribute and pattern tables), but the address and data does not physically show on the bus, the PPU simply stores the data internally and blocks those read/writes to happen on the bus. Because the nametable chip is not entierely address decoded, it's data will mirror to $3000-$3fff and if any access to those areas would show on the bus, it would access mirrors of name/attribute tables. I know it's strange but that's what they did.

For SNES, GBA and probably many later Nintendo systems, the palette is separate form other VRAM (tilemap and tile data).

Quote
This I would like to hear more about, but I think "quite complex"/"dirty trick" is the difference between "possible" and "suitable". The only possibility I can think of is building pre-rendered bits of VWF and pasting them together.
Well there is 2 things I had in mind :
1) If a dialog is very small and uses less than 8 letters per line, a VWF can be made with sprites
2) If a dialog uses the entire screen width and that the main game uses only a single nametable, and that the total VWF area (not including whitespaces) is not more than 30 pixels in heighth, it is doable with CHR-ROM and raster timing. By having a 4k CHR-ROM page where each tile is simply it's number shown in graphics (I'm not sure how to tell this, tile #0 would be blank, tile #1 would have only a single white pixel, and tile #255 would have a entiere horizontal line), it's possible to draw arbitrary graphics by changing the vertical scroll every line.

snarfblam

  • Submission Reviewer
  • Hero Member
  • *****
  • Posts: 593
  • CANT HACK METROID
    • View Profile
    • snarfblam
Re: How can you tell if a nes game uses Vram?
« Reply #8 on: June 18, 2013, 01:04:06 pm »
It's not that obvious in fact...I know it's strange but that's what they did.
I'm not really clear on what your point is. I do understand how it works under the hood (I think). I was simply stating that palette RAM, in particular, is memory used for video that is accessed via the PPU address/data lines. My understanding of a "bus" might not be 100% accurate, so I'll give you the benefit of the doubt and assume that I'm technically wrong, because who really cares? We're talking about a VWF, not palette RAM.

1) If a dialog is very small and uses less than 8 letters per line, a VWF can be made with sprites
2) If a dialog uses the entire screen width and that the main game uses only a single nametable, and that the total VWF area (not including whitespaces) is not more than 30 pixels in heighth, it is doable with CHR-ROM and raster timing. By having a 4k CHR-ROM page where each tile is simply it's number shown in graphics (I'm not sure how to tell this, tile #0 would be blank, tile #1 would have only a single white pixel, and tile #255 would have a entiere horizontal line), it's possible to draw arbitrary graphics by changing the vertical scroll every line.
Number one seems far to restrictive to be practical. I guess it could be used for menus or something. Number two is actually pretty clever, in a Rube Goldberg sort of way. Kudos to you if you get something like that up and running in an actual game, and if it suits you, why not? I'd personally sooner convert a game to use CHR RAM if possible.