News:

11 March 2016 - Forum Rules

Main Menu

Extremely Confused on VRAM Issue

Started by justin3009, August 17, 2013, 02:51:25 AM

Previous topic - Next topic

justin3009

I went back to X3 and noticed that with the recent Z-Sabre 'Fix', there's an issue that causes a graphical bug due to VRAM being overwritten.  So I took notice of that, moved the Z-Sabre graphics in VRAM from C600 (6300) up to 0B00 and they get stored there, perfectly.

Now the fun issue comes around.  The game still reads from 6300 for whatever reason.  I took a look in BSNES and decided to see if there's a breakpoint somewhere that reads from 6300.. nope.  There's NOTHING reading from there yet the graphics are loading from there.  I'd say it's the Sprite Assembly but that doesn't make sense considering one of the graphics used is tile #35 (Which is reading from 6300..)  So even editing the Sprite Assembly wouldn't fix it.

I've traced the code forwards and backwards and thought maybe there's a single value that's being used to dictate which selection of VRAM to use, much like the Main Menu does, but nope.  I haven't come across anything like that.

What the heck would cause this?  This is the LAST thing I need before I can fully mess around with VRAM however I want but it's proving next to impossible to fix!
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

assassin

does BSNES catch DMA transfers in its breakpoints?  i've never used its debugger (or any version beyond some ancient one, as my computers are too slow).

MathOnNapkins

It does not log DMA transfers the way that Geiger's does, for example. However, you can set read / write breakpoints on vram in BSNES at which point it will break in the middle of the DMA transfer (continuing to "step into" I believe will remain in the dma transfer until all bytes have been written or read, then the S-CPU will resume stepping). Keep in mind I use a relatively old version of the BSNES debugger (v0.67 so the available features and dynamics might have changed).

justin3009

 It's exactly what I used.  I've tried both but it seems it's forcefully loading 6300  yet it can't be read nor is it written to anymore when the Z-Sabre  is used,  which is what confuses me.
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

LostTemplar

I can't say for certain but it's probably the case that no breakpoints are triggered if the PPU itself reads from that address. However, if it displays the wrong tiles there has to be an error in the OAM - there's nothing else that influences what tiles are displayed as sprites (well there's the base address for the sprite tiles).

Though I'm not sure I understand your problem correctly - you mean you moved the graphics to another place but it's still displaying from the old location? You say you now use 0x0b00 - how did you change the tile numbers in the OAM to reflect this? If the sprite base is set up at 0x6000 you have to change that one, too. Or is it actually not displayed as a sprite?

justin3009

 It's displayed as a sprite but if I'm remembering correctly, it only lets you use 0-FF  as sprite tile values. Since  the graphics are at 0B00 now instead of 6300,  can't really reflect that.  It's a strange issue
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

KingMike

Isn't one of the PPU registers used to set which PPU bank (8KB) is used for sprite tiles, just as for the tiles for each of the BG layers?
"My watch says 30 chickens" Google, 2018

justin3009

#7
 It's possible though I'm not 100% sure. I know there's something in the menu that can let you load/store graphics anywhere in VRAM with a single byte and something to dictate which RAM area to use.  It's just in-game I'm really unsure how it fully handles it since I can't seem to trace everything down.

Edit: I figured it out.. sort of.  I went through some other code and decided to test that 'single byte' VRAM indicator bit.  Strangely enough, setting data to store at $18 would tell in VRAM where to write the graphics.  Though this is REALLY weird considering there's already code to do so, but this $18 value seems to write graphics/read them from the correct location.  Not.. really sure why.  But I took a test, modified some code and have it storing a value of 20 to $18.  It stores the Z-Sabre graphics JUST above the PC life icons and such.  Fixes the graphics bug and such.  But the issue with this is that it's FORCED to stick between 6300 and about and around 6450.  I can't make it read beyond or before these two areas.  It's REALLY frustrating.
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'