It is currently Sun Jul 15, 2018 10:03 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Thu Jan 04, 2018 1:48 pm 
Offline
User avatar

Joined: Sun Jun 11, 2017 5:39 pm
Posts: 60
Is there any easy tutorial to learn how to write tiles on the PPU?

I know this one : https://wiki.nesdev.com/w/index.php/PPU_registers

It's kinda hard but I can do with it if I don't have the choice.

However, I wondered if there were more easy tutorial that would guide a step-by-step? Something like a tutorial which indicates step by step how to just change 1 tile on the PPU?

What I'm trying to say is that I would be looking for something more basic.


Top
 Profile  
 
PostPosted: Thu Jan 04, 2018 1:51 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20249
Location: NE Indiana, USA (NTSC)
To overwrite all tiles, use the CHR ROM to CHR RAM conversion example in this article.


Top
 Profile  
 
PostPosted: Thu Jan 04, 2018 2:27 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10581
Location: Rio de Janeiro - Brazil
When you say "change one tile", do you mean modifying the graphics of one of the 512 tiles available for drawing sprites and backgrounds, causing all instances of that tile to reflect the change, or do you mean changing which tile one single sprite or background position is using so that only that spot changes?


Top
 Profile  
 
PostPosted: Thu Jan 04, 2018 2:28 pm 
Offline
User avatar

Joined: Sun Jun 11, 2017 5:39 pm
Posts: 60
tokumaru wrote:
When you say "change one tile", do you mean modifying the graphics of one of the 512 tiles available for drawing sprites and backgrounds, causing all instances of that tile to reflect the change, or do you mean changing which tile one single sprite or background position is using so that only that spot changes?



The first one, the tile to be changed in the ppu so every instance of that tile in the screen is changed.


Top
 Profile  
 
PostPosted: Thu Jan 04, 2018 2:34 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10581
Location: Rio de Janeiro - Brazil
Then the article tepples linked to is a good place to start. It's a simple routine that fills the pattern tables with tile data copied from PRG-ROM. This will only work in a CHR-RAM cartridge.


Top
 Profile  
 
PostPosted: Thu Jan 04, 2018 4:11 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 6390
Location: Canada
If you're using CHR-RAM you're going to need to be able to write a full set of tiles into that RAM anyway, not just one tile. (Unless your whole game has only one tile?) RAM does not start up with any contents already in it. So... tepples' article is a thing you will need to learn first, before you can get to modifying a single tile.

If you're using CHR-ROM you can't change just one tile. That can only be banked in pages (or sometimes not at all), depending on the mapper used. The more advanced mappers can page them in 1k (64 tile) sets.


Top
 Profile  
 
PostPosted: Thu Jan 04, 2018 4:22 pm 
Offline

Joined: Mon May 25, 2009 2:20 pm
Posts: 56
It's megaman 4, which is CHR-RAM


Top
 Profile  
 
PostPosted: Thu Jan 04, 2018 5:09 pm 
Offline
User avatar

Joined: Sun Jun 11, 2017 5:39 pm
Posts: 60
rainwarrior wrote:
If you're using CHR-RAM you're going to need to be able to write a full set of tiles into that RAM anyway, not just one tile. (Unless your whole game has only one tile?) RAM does not start up with any contents already in it. So... tepples' article is a thing you will need to learn first, before you can get to modifying a single tile.

If you're using CHR-ROM you can't change just one tile. That can only be banked in pages (or sometimes not at all), depending on the mapper used. The more advanced mappers can page them in 1k (64 tile) sets.


thanks I'll check it!! And kujakiller is correct, it's mega man 4 and CHR-RAM


Top
 Profile  
 
PostPosted: Thu Jan 04, 2018 5:40 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10581
Location: Rio de Janeiro - Brazil
Hacking an existing game is more complex, because you can't easily tell if you have enough time to do the extra stuff you want. The game may very well have been "tuned" to use all of the vblank time (which is the only time you're allowed to write to VRAM if rendering is on) under certain conditions, and if you try to put the extra 140 to 200 cycles that updating 16 bytes takes, you might extrapolate the allowed time for updates an end up with corrupted graphics/scroll, even though the copy procedure by itself is correct.

To hack a game you need more than just the knowledge of how to perform a certain task, you need to know how that task and the time it takes will affect the existing game engine, in order to avoid any conflicts and timing issues.


Top
 Profile  
 
PostPosted: Thu Jan 04, 2018 5:59 pm 
Offline
User avatar

Joined: Sun Jun 11, 2017 5:39 pm
Posts: 60
tokumaru wrote:
Hacking an existing game is more complex, because you can't easily tell if you have enough time to do the extra stuff you want. The game may very well have been "tuned" to use all of the vblank time (which is the only time you're allowed to write to VRAM if rendering is on) under certain conditions, and if you try to put the extra 140 to 200 cycles that updating 16 bytes takes, you might extrapolate the allowed time for updates an end up with corrupted graphics/scroll, even though the copy procedure by itself is correct.

To hack a game you need more than just the knowledge of how to perform a certain task, you need to know how that task and the time it takes will affect the existing game engine, in order to avoid any conflicts and timing issues.



Thanks I read about VBlank. I'm pretty sure I know some function which will check that and I will be able to use this

I'm glad you mentionned it I forgot about this.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group