How can i hack Graphics of a game without CHR Rom?

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
kelvin donna
Posts: 70
Joined: Sat Feb 01, 2020 5:49 am

How can i hack Graphics of a game without CHR Rom?

Post by kelvin donna »

Hello,

i'm trying to change graphics of an NES Thing called "painter" (file in the Attachments.)
but i can't do that, because the Nes file has no CHR Memory.
may i get some instructions on how to hack the graphics, despite it has no CHR?
Attachments
Painter.nes
(16.02 KiB) Downloaded 84 times
User avatar
Jarhmander
Formerly ~J-@D!~
Posts: 569
Joined: Sun Mar 12, 2006 12:36 am
Location: Rive nord de Montréal

Re: How can i hack Graphics of a game without CHR Rom?

Post by Jarhmander »

That's when it becomes complicated. If the iNES file has no CHR-ROM, then it has CHR-RAM, and the game can write to it whenever it want to, and the data in PRG-ROM is very likely to be compressed into a in-house format, specifically made for this game. You'll have to reverse-engineer the game yourself, if nobody has done it before.

Look in PRG-ROM anyway for chr data, just in case it is trivially encoded, but the odds are it won't be there in raw, uncompressed form.
((λ (x) (x x)) (λ (x) (x x)))
kelvin donna
Posts: 70
Joined: Sat Feb 01, 2020 5:49 am

Re: How can i hack Graphics of a game without CHR Rom?

Post by kelvin donna »

Jarhmander wrote: Fri Feb 26, 2021 7:57 am That's when it becomes complicated. If the iNES file has no CHR-ROM, then it has CHR-RAM, and the game can write to it whenever it want to, and the data in PRG-ROM is very likely to be compressed into a in-house format, specifically made for this game. You'll have to reverse-engineer the game yourself, if nobody has done it before.

Look in PRG-ROM anyway for chr data, just in case it is trivially encoded, but the odds are it won't be there in raw, uncompressed form.
hmm, then we'll need some tool, that adds that chr rom out of the ram?
User avatar
Jarhmander
Formerly ~J-@D!~
Posts: 569
Joined: Sun Mar 12, 2006 12:36 am
Location: Rive nord de Montréal

Re: How can i hack Graphics of a game without CHR Rom?

Post by Jarhmander »

That's... not how it works. You can't realistically add CHR-ROM to your game from its CHR-RAM, as the game can use the CHR-RAM as it want; it can even use it as scratch space if it wanted to. Moreover, it can "morph" the pattern data in runtime, as the CHR data is in a RAM after all and can be modified, so unless the game is very simple it is generally impossible to turn a CHR-RAM game into a CHR-ROM game.

Your best bet is to use an emulator with a debugger (FCEUX, Mesen ...) and look at how it generates pattern data, by looking at when and how it writes to $2007, when the PPU address is in the $0000-$1FFF range. Yes, that is quite involved and that pretty much requires that you know how the CPU and the PPU work. That will take you alot of time, especially if you don't already have a good grasp of the NES internals.
((λ (x) (x x)) (λ (x) (x x)))
User avatar
Controllerhead
Posts: 314
Joined: Tue Nov 13, 2018 4:58 am
Location: $4016
Contact:

Re: How can i hack Graphics of a game without CHR Rom?

Post by Controllerhead »

I took a quick look. Decoding the tiles is the first thing it does after vBlank wait and memory clear. GL
Image
strat
Posts: 409
Joined: Mon Apr 07, 2008 6:08 pm
Location: Missouri

Re: How can i hack Graphics of a game without CHR Rom?

Post by strat »

Hacking an existing game is dirty work, no way around it. Super Offroad has a dumb, simple compression format and it's still impossible to edit the graphics without rewriting the routines that call the decompression loop because only the first call to the loop supplies a starting address - as it is you can't change the size of the compressed data stream without throwing the tiles' locations in chr-ram out of whack. (I sent the OP a patch that replaces all the tiles with either $FE or $FF,$nn to censor the woman gfx). This painter thing might be easier, though.
http://forums.nesdev.com/viewtopic.php? ... 66#p250466
Post Reply