News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: VBLANK in Z:PW title screen  (Read 5427 times)

The5thHerring

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
VBLANK in Z:PW title screen
« on: February 20, 2011, 03:31:27 pm »
Apologies for the double-ish post, but I have found it's better to put a single question in a single post. Also this forum seems more appropriate for this question than General Romhacking.

So: I'm trying to put Zelda: Parallel Worlds on a homebrew cart. I have actually succeeded in this, but the title screen is glitchy. I spoke to Euclid or SePH (I think Euclid) about this a few years ago, and remember getting a response like "Oh, I just forgot to clear VBLANK and that's why it doesn't work on the SNES".

Note that I'm not working with a bad rom -- the title screen worked fine in the emulator I had at the time (I forget whether ZSNES or 9x).

I would like to fix it so I can make a cart that doesn't feel like a beta. I have no idea where to start, however. It's pretty galling because it probably just needs 2-3 bytes changed in a hex editor... :P

Ryusui

  • Hero Member
  • *****
  • Posts: 4989
  • It's the greatest day.
    • View Profile
    • Tumblr
Re: VBLANK in Z:PW title screen
« Reply #1 on: February 20, 2011, 03:51:26 pm »
Eh, no. If the problem is what I think it is, it requires a code snippet compiled and inserted into the ROM. That's right - this is a job for ASM hacking.

It's a simple job, assuming you have the source code for the hack. The easiest way, therefore, would be to pester the hack's creator into fixing it - if the problem is what it sounds like, it requires only three lines of code (four if you count the label needed to make the loop work). Worst-case scenario, you'll need to hack it in yourself, which will be a tall order for a first timer. On the upside, if you have a decently fast computer, you can test the ROM in BSNES: that sucker's so accurate it actually trips the copy protection code in the BoF2 retranslation. :3
In the event of a firestorm, the salad bar will remain open.

The5thHerring

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: VBLANK in Z:PW title screen
« Reply #2 on: February 20, 2011, 05:15:42 pm »
Well, OK then. Thanks, Ryusui.

I would definitely be willing to give it a shot and learn some rudimentary ASM if I had the source code, but either way -- Euclid, if you're reading this, check your PM box.

qwertymodo

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 186
    • View Profile
Re: VBLANK in Z:PW title screen
« Reply #3 on: May 13, 2013, 03:08:42 pm »
I know this is a necrobump, but it was either that or start my own thread, and I don't like doing that when there's one already concerning exactly what I'm posting about.  There has been a patch floating around to fix this for awhile, but it created new graphical glitches in the ending sequence, though they are not often mentioned, probably due to the game's difficulty, so few people actually beat it, and even fewer will beat both the original and the intro-patched version to compare (if you're interested, this is what it looks like).  Anyway, ikari (the SD2SNES guy) created a new version of that patch that fixes the intro without breaking the ending.  I have not played through his version start-to-finish to see if anything else glitches elsewhere in the game, but I have confirmed that at least the intro and ending are both without glitches.  I was unable to find the patch myself, had to ask around until someone over at NESdev who had it gave it to me, so given its difficulty to track down, I figure that other people might not even know it exists.  Anyway, here are the Z:PW 1.0, 1.1, and Remodel patches with ikari's intro fix rolled up into them, so all you have to do is patch your chosen hack to the original aLttP ROM (UNHEADERED, but beat will yell at you if you try to use a headered ROM anyway).  This fix probably isn't enough to make it into the database, but I've seen enough people wanting it that I figured I'd at least get it out there.

RedScorpion

  • Full Member
  • ***
  • Posts: 111
    • View Profile
    • Snes-Projects
Re: VBLANK in Z:PW title screen
« Reply #4 on: May 15, 2013, 06:47:28 am »
hi,

there was already a topic with this issue on nesdev.

Maybe, show here: http://forums.nesdev.com/viewtopic.php?f=12&t=8177&hilit=Zelda+Parallel+Worlds#p84638

On real cart the tile screen works on SNES.

Thanks

red

qwertymodo

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 186
    • View Profile
Re: VBLANK in Z:PW title screen
« Reply #5 on: May 16, 2013, 11:16:20 pm »
Yeah, it was suggested that I post it over here as well... didn't think to link back to the other thread though.  Your patch is the one that glitches the credits  ;)

puzzledude

  • Sr. Member
  • ****
  • Posts: 308
    • View Profile
Re: VBLANK in Z:PW title screen
« Reply #6 on: May 17, 2013, 09:11:48 am »
This is how to fix the Parallel Worlds and Parallel Remodel title screen problem for good (no patches or ASM needed, just a plain HEX editor).

I hope this will solve the issue for good.

My post from some other forum:

We all know the problem with the Title screen of PW and PR. It displays correctly only in Zsnes (as well as Hyrule Magic), but it displays wrong anywhere else, including real hardware. This is a result of the newly inserted objects on Titlescreen in HM, which can not render them in Emu, but will display normally in HM.

---------------------------

PW title screen fix, NEW, DOESNT BREAK THE ENDING (from Red Scorpion, code made by Ikari)

Red Scorpion wrote:
Me again. I think ikari_01 could fix the bugs for intro and outro/credits

I have tried on german and english version and it works.

No header
at 9C6 -> A6 13 DA A2 80 8E 00 21 86 13 20 A1 92 FA 86 13 60
and BE3 -> C6 89

-------------------------------

Added by Puzzledude

Open the file Parallel Remodel (patched correctly) in a hex editor. The file doesn't have a header. Then go to hex address 9C6 (file with no header) and change the old FF values into:

A6 13 DA A2 80 8E 00 21 86 13 20 A1 92 FA 86 13 60.

At BE3 change A1 92 into -> C6 89. (implements the new routine, otherwise the game crashes).

The CRC of the english Parallel Remodel 1-1 with the new code is C9D9397C. (intro and ending tested)

----------------------------------

The new fix was also implemented into both PW and PR, translated into german, but only the most recent versions (1.10 ger and 1.50 ger).

I didn't implement this into english PR, since I got the code just a little to late (the 1.1 was already released) and the game has quite some other minor problems, so fixing the title screen would be a little to less fixes for the entire new version 1-2.



-----------------------------------

The OLD code which fixes the Titlescreen, but BREAKS THE ENDING SEQUENCE is

9C6 (11)
48 A9 80 85 13 8D 00 21 68 20 A1 92 A9 0F 85 13 60

old values were
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF


BE3 (2)
C6 89

old values were
A1 92

--------------------------------------

So if the main code starts with A6 13, you have the correct fix, if it starts with 48 A9, you have the wrong fix.

PS
This code works on PW eng, PR eng, PW ger, PR ger.

« Last Edit: May 17, 2013, 09:21:25 am by puzzledude »

qwertymodo

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 186
    • View Profile
Re: VBLANK in Z:PW title screen
« Reply #7 on: May 17, 2013, 03:47:03 pm »
Yep, that's the one :)

Prenz

  • Guest
Re: VBLANK in Z:PW title screen
« Reply #8 on: August 28, 2013, 12:35:00 am »
This is how to fix the Parallel Worlds and Parallel Remodel title screen problem for good (no patches or ASM needed, just a plain HEX editor).

I hope this will solve the issue for good.

[...]

I have tried on german and english version and it works.

No header
at 9C6 -> A6 13 DA A2 80 8E 00 21 86 13 20 A1 92 FA 86 13 60
and BE3 -> C6 89

I would greatly appreciate if anyone could help me apply this instruction.  I am 100% new to hex editing, and I just picked up the free HxD software.

1) I don't know what 'No header' means to do. 

(I am trying to modify my .smc file for TLOZ:PW v1.1, the patched version of the ALTTP rom)

2) I don't think I know where to find 9C6.  Closest I found was 00009C60 down the left-most column.  There are 16 two-digit figures following this.  However, in the instruction above, there are 17 two-digit figures.

3) I really don't understand the instruction above for BE3.

--------------------

Even if a viewer is unfamiliar with the main topic of this thread, but understands hex editing/ modifying, I would thoroughly appreciate the input and help.

Best regards,
Prenz

Zynk

  • Hero Member
  • *****
  • Posts: 939
  • WIP Roll-chan: The Wily Wars
    • View Profile
Re: VBLANK in Z:PW title screen
« Reply #9 on: August 28, 2013, 12:46:05 am »
Heys!  :D

I can only answer 1) for you. Get this utility:

http://www.romhacking.net/utilities/593/

Load the ROM then look for 'Remove Header'. If it is highlighted, then it has a header. If its not, use that to remove the header of that ROM, then it will be 'No Header'.

puzzledude

  • Sr. Member
  • ****
  • Posts: 308
    • View Profile
Re: VBLANK in Z:PW title screen
« Reply #10 on: August 28, 2013, 07:00:39 am »
Since you are 100 percent new to hex editing, I can help you out.
First make sure you patched Alttp correctly, so that PW 1.1 works! You need to patch the IPS to US headered rom, this is the US rom with 1.025 KB. Once you've successfully loaded PW in the emulator, you are good to go.


This is how hex works: 00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 0A, 0B, 0C, 0D, 0E, 0F, 10, 11 etc.

As you can see, there are 16 bytes (not 10 like in decimal system) before reaching 10. In the hex editor you have only even hex values on the left.

Lets start at the beginning:

1) the header is a sequence of 512 bytes (in decimal), this is 200 in hex, at the very beginning of the file (those are mostly 00 bytes!). PW has those bytes by default. Those bytes would mess up your address calculations (they will shift them for 32 lines down). That's why you need to erase them. Open the rom in the HxD editor and select the 512 bytes (200 in hex) at the beginning (those are mostly 00 bytes!), press Del and save.
The file should start like so: 78 9C 00 42 9C 0C 42 9C 0B 42 9C 40 21 9C 41 21. This must be in the very first line.


2) Where is 9C6 (if header is removed)

"Go to 9C6= 00009C6", means go to offset on the left 00009C0 (this is the row), while going on the beginning of byte 06 in this row (since there is 00 to 0F bytes in one row). You can also select: edit-go to, and type in 9C6, and the program will auto jump to this address.

Now copy this from txt
A6 13 DA A2 80 8E 00 21 86 13 20 A1 92 FA 86 13 60
then go to address 9C6 and press ctrl+B = paste-overwrite!, NOT ctrl+V (this will paste-insert and extend the rom, which will Destroy the file).
As you can see this sequence has 17 bytes, which is (11) long, so it is one row and one byte long.


3) in this case go to row BE0, and on byte 03 in the row. You should see these values there: A1 92. (the 92 is obviously on BE4). So now change this to C6 89, so that the former value A1 becomes C6 and the former 92 becomes 89. You can do this manually (no copy pasting needed).
When you are at the beginning of byte A1, just type C6 and it will be overwritten.


With this explanation, I think you can manage it now.

« Last Edit: August 28, 2013, 07:16:54 am by puzzledude »

Prenz

  • Guest
Re: VBLANK in Z:PW title screen
« Reply #11 on: August 28, 2013, 09:18:04 am »
Many, many thanks.  That was extremely helpful, and I imagine I won't be the last to reference that fine write-up.

IT WORKED!

Fellow Zelda minion,
Prenz