Accessing the second tileset in PPU Viewer

nroflmao

New member
In the Adventure tutorial roughly around 1hour 18min mark, Joe starts talking about customizing the ASM to display sprites on the HUD.
Specifically he opens the Handle Sprite Pre-Draw script and adds code to write a sprite on the HUD.
I can replicate this by running FCEUX and opening the PPU Viewer and hovering over the tile i want to get the sprite ID.
However, there are two tile tables shown there and I can't figure out how to access the tileset on the right, it gives the same hex location as the table on the left.

Currently using the code below, I expect i need to modify the "#$2F" somehow to access the other tileset?

LDA weaponsUnlocked
AND #%00000001 ;; if weapons are unlocked and subpalette 1 ?
BEQ skipDrawingSwordInHud ;; go to skipDrawingSwordInHud
DrawSprite #$75, #$14, #$2F, #$00000000, spriteOffset
inc spriteOffset
inc spriteOffset
inc spriteOffset
inc spriteOffset
skipDrawingSwordInHud:
 

Kasumi

New member
One side is used for sprites, the other side is used for the backgrounds. (Generally.) You can't draw a background tile using sprites without changing to a thoroughly unsupported display mode. (8x16 sprites)

Tile #$2F is indeed different for the background and sprite sides, and the reason why you can't use tiles from one set in the other is because there is only one byte (with a range of 0-255), but there are 512 possible tiles. Therefore the byte will refer to only the tiles in one of the two sets. Changing it for one sprite means changing it for all sprites. (All of your sprites would be drawn with the background set.)

If you want to draw background tile, you'd create a new HUD asset as laid out in this timestamp https://youtu.be/wH6G296onhs?t=4556
If you want to add sprite tiles, you'd look at the timestamp you listed.



I take it the issue is that you want to add a tile that's not part of the HUD tileset? You can either add the tile you want (#$2F) to your sprite CHR, or add it to the HUD tiles. You can't easily use it from where it is.
 

nroflmao

New member
Thanks for the explanation, Kasumi! Now I understand. I will probably add my HUD sprite then to the other tileset so i can access it.
 

ambren

New member
This options makes it show what the PPU looks like when the screen is drawing that particular scanline. It is useful for games like SMB, that swap pattern tables mid-frame (e.g. for status bar stuff).
Right clicking on one of the PPU panels will change the palette it is shown with, cycling though pattern palettes, then sprite ones, then a ninth fixed grey palette (useful for inspecting CHR if all the palettes are currently black).
Putting the mouse cursor over a tile will display the tile address. Moving cursor over palette color will give palette address.
 
Top Bottom