Author
|
Topic: ASM Masters, HELP!! (Read 2 times)
|
Bongo`
Guest
|
|
« on: March 30, 2008, 02:43:21 pm » |
|
Ok, I am tripping because I can't figure this problem out. This game builds a normal tilemap and DMAs the data o VRAM. But then something weird happens. It seems to use some type of H-DMA effect and expand the 8x8 text displayed on the screen. Here is a picture to show what I mean. The arrow is pointing to what should be displayed as "Potion". But it is cut off and I can't figure out why. I assume it is some form of H-DMA trickery. Anyone have an idea?
|
|
|
|
Ryusui
Guest
|
|
« Reply #1 on: March 30, 2008, 02:49:09 pm » |
|
Try disabling HDMA (I think it's toggled with 0 in Snes9x) and see what it looks like.
Am I correct in assuming that whatever the cursor is pointing at gets "doubled" like that? It might be the fault of a redraw routine.
|
|
|
|
Bongo`
Guest
|
|
« Reply #2 on: March 30, 2008, 02:58:12 pm » |
|
Try disabling HDMA (I think it's toggled with 0 in Snes9x) and see what it looks like.
Am I correct in assuming that whatever the cursor is pointing at gets "doubled" like that? It might be the fault of a redraw routine.
Thanks! I hate H-DMA... I guess I will need to figure out a way to change the menu lay out or something... Stupid H-DMA... :banghead: Thanks for the help!
|
|
|
|
Ryusui
Guest
|
|
« Reply #3 on: March 30, 2008, 03:18:02 pm » |
|
You might not need to go quite so far. See how the tilemap is composed: odds are you'll find that a second row of characters is being written to the tilemap. Set a breakpoint for where the spurious extra line is being written and see what exactly is going on: perhaps the routine that prints the extra line needs to be disabled, or maybe it just needs to be fed a different address.
|
|
|
|
creaothceann
Guest
|
|
« Reply #4 on: March 30, 2008, 03:20:20 pm » |
|
Which game is it?
|
|
|
|
byuu
Guest
|
|
« Reply #5 on: March 30, 2008, 04:55:31 pm » |
|
Ah, 8x12 text. Commonly used to display (han)dakuten.
Yes, it's HDMA. What happens is the game adjusts the background layer vertical scroll register every 4 and 8 lines in succession to "shift" each alternating line by four pixels. If you were to look at the raw tilemap, you'd see that both the 8x8 and "4x8" lines have their own tilemap entries.
What I would try first is hacking the tilemap in a savestate (unless you have one of those bitch games that re-upload the tilemap every frame, in which case just look at it) ... is "Potion" repeated on two separate lines? Or is it just there once, eg you change the P and it duplicates on both lines when you reload the savestate?
If the former, you just need to track down the duplication and replace it with something that writes spaces if needed. If it's the latter (unlikely, as that would screw up the Japanese game, too), then something's really screwy with HDMA and you're going to have to get your feet wet with HDMA tables.
Each tilemap line is going to most likely be 64 bytes long, assuming 256xN SC, with 8x8 tiles. That's 2 bytes per entry. Format for tilemap is: vhopppcc cccccccc. c = tile data #, 0 - 1023, p = palette #, 0 - 7, o = priority bit, probably 1 if this is on BG3 (likely), v/h = v/h flip bit. Probably zero.
So you'll look for 0x20(hex for P), 0x20(hex for o), etc in the savestate. Remember that data is stored in little endian. As this is ZSNES, start from 0x20c13 when searching.
|
|
|
|
Bongo`
Guest
|
|
« Reply #6 on: March 30, 2008, 09:03:05 pm » |
|
Ah, 8x12 text. Commonly used to display (han)dakuten.
Yes, it's HDMA. What happens is the game adjusts the background layer vertical scroll register every 4 and 8 lines in succession to "shift" each alternating line by four pixels. If you were to look at the raw tilemap, you'd see that both the 8x8 and "4x8" lines have their own tilemap entries.
What I would try first is hacking the tilemap in a savestate (unless you have one of those bitch games that re-upload the tilemap every frame, in which case just look at it) ... is "Potion" repeated on two separate lines? Or is it just there once, eg you change the P and it duplicates on both lines when you reload the savestate?
If the former, you just need to track down the duplication and replace it with something that writes spaces if needed. If it's the latter (unlikely, as that would screw up the Japanese game, too), then something's really screwy with HDMA and you're going to have to get your feet wet with HDMA tables.
Each tilemap line is going to most likely be 64 bytes long, assuming 256xN SC, with 8x8 tiles. That's 2 bytes per entry. Format for tilemap is: vhopppcc cccccccc. c = tile data #, 0 - 1023, p = palette #, 0 - 7, o = priority bit, probably 1 if this is on BG3 (likely), v/h = v/h flip bit. Probably zero.
So you'll look for 0x20(hex for P), 0x20(hex for o), etc in the savestate. Remember that data is stored in little endian. As this is ZSNES, start from 0x20c13 when searching.
Ah thanks for all that great info, byuu. I figured out what's up. I typed in the extra "potion" text to see what was going on and you are right! It does use that damn 8/4 format. I found the H-DMA tables for every textbox used by the game...Now I will have to spend some time figuring out what is happening and all that good stuff. Posted by: creaothceann Posted on: Today at 03:20:20 PM Which game is it? Aretha 2. Fun shit! Well, I've hacked ALMOST everything on the S-Nes. Time for some H-DMA stuff!
|
|
|
|
BRPXQZME
Guest
|
|
« Reply #7 on: March 30, 2008, 10:22:03 pm » |
|
And yes, “Merazine†heals MP.
|
|
|
|
|