How to simply write tile datas into PPU?
Moderator: Moderators
How to simply write tile datas into PPU?
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.
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.
Re: How to simply write tile datas into PPU?
To overwrite all tiles, use the CHR ROM to CHR RAM conversion example in this article.
Re: How to simply write tile datas into PPU?
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?
Re: How to simply write tile datas into PPU?
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.
Re: How to simply write tile datas into PPU?
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.
- rainwarrior
- Posts: 8732
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: How to simply write tile datas into PPU?
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.
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.
-
- Posts: 130
- Joined: Mon May 25, 2009 2:20 pm
Re: How to simply write tile datas into PPU?
It's megaman 4, which is CHR-RAM
Re: How to simply write tile datas into PPU?
thanks I'll check it!! And kujakiller is correct, it's mega man 4 and CHR-RAMrainwarrior 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.
Re: How to simply write tile datas into PPU?
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.
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.
Re: How to simply write tile datas into PPU?
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.