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

Poll

What should the new name for the "Spell" spell be?

Reveal
5 (21.7%)
Unveil
4 (17.4%)
Enigma
9 (39.1%)
Expose
5 (21.7%)

Total Members Voted: 23

Author Topic: Zelda II Redux  (Read 100306 times)

DannyPlaysSomeGames

  • Jr. Member
  • **
  • Posts: 63
  • Wait, this isn't Burger King
    • View Profile
Re: Zelda II Redux
« Reply #400 on: February 09, 2019, 10:18:02 am »
This is pretty rad. Graphics are a nice revamp and the whole feel of it is really nice, yet it does stay somewhat faithful to the original game. The only issue so far is that there's a redundancy:


Town Town is my favorite Zelda town

Still though, great work!
Hey there

njosro

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: Zelda II Redux
« Reply #401 on: February 09, 2019, 11:38:48 am »
IcePenguin, that's a creative alternative to PAUSE text! Nice idea.

For gameover stuff, I'm glad restarting from the palace is a good balance. One alternative I had right after I made that hack was to make it cost EXP at the gameover screen to continue exactly where you were, and if you didn't have enough points you could only save. It would read your highest stat, and lookup the point requirements for LIFE at that level. For example, if your highest stat was at level 4 (let's say attack for example), it would cost you 400 points to continue because that's how much is required to bring LIFE to level 4. By the time something was leveled up to 8, it would cost 4000 points to continue.

In the end, I decided it was a complicated system and dropped it.

ultimaweapon

  • Full Member
  • ***
  • Posts: 167
    • View Profile
Re: Zelda II Redux
« Reply #402 on: February 09, 2019, 01:41:03 pm »
IcePenguin, that's a creative alternative to PAUSE text! Nice idea.

For gameover stuff, I'm glad restarting from the palace is a good balance. One alternative I had right after I made that hack was to make it cost EXP at the gameover screen to continue exactly where you were, and if you didn't have enough points you could only save. It would read your highest stat, and lookup the point requirements for LIFE at that level. For example, if your highest stat was at level 4 (let's say attack for example), it would cost you 400 points to continue because that's how much is required to bring LIFE to level 4. By the time something was leveled up to 8, it would cost 4000 points to continue.

In the end, I decided it was a complicated system and dropped it.

That would have been a pretty cool system to use had you been able to work all the kinks out.

The most challenging thing I've come across even with Trax's disassembly and Optomon's notes is how to change the music. Why did Nintendo have to use such a complicated format? LOL!
Trust in the Heart of the Cards

DannyPlaysSomeGames

  • Jr. Member
  • **
  • Posts: 63
  • Wait, this isn't Burger King
    • View Profile
Re: Zelda II Redux
« Reply #403 on: February 09, 2019, 02:05:55 pm »
Actually, I ran into another bug: if you save from the overworld via Up+A on the pause menu, the screen doesn't undim until you pause again in the overworld, which is a bit annoying. It's nothing game breaking really, but it's still a bit of an issue.
Hey there

IcePenguin

  • RHDN Patreon Supporter!
  • Sr. Member
  • *****
  • Posts: 265
    • View Profile
Re: Zelda II Redux
« Reply #404 on: February 09, 2019, 03:00:08 pm »
IcePenguin, that's a creative alternative to PAUSE text! Nice idea.

For gameover stuff, I'm glad restarting from the palace is a good balance. One alternative I had right after I made that hack was to make it cost EXP at the gameover screen to continue exactly where you were, and if you didn't have enough points you could only save. It would read your highest stat, and lookup the point requirements for LIFE at that level. For example, if your highest stat was at level 4 (let's say attack for example), it would cost you 400 points to continue because that's how much is required to bring LIFE to level 4. By the time something was leveled up to 8, it would cost 4000 points to continue.

In the end, I decided it was a complicated system and dropped it.

Thanks njosro!  I'm just glad ShadowOne liked it, since it's up to him, ha ha.   :laugh:  I'm sure he'll figure out the "pause" text, but if worse comes to worse, the palette change it a suitable alternative.  The visual cue is great enough to know it's paused.  (I hope he likes Link's Shadow effect, as well!)

Your idea about spending exp to continue is very interesting!  It does seem really complicated, as you said, but it would make for some really intense game play!  Dying while try to get those high levels would become very nerve-wracking!

Actually, I ran into another bug: if you save from the overworld via Up+A on the pause menu, the screen doesn't undim until you pause again in the overworld, which is a bit annoying. It's nothing game breaking really, but it's still a bit of an issue.

Ah, I didn't consider that.  I did all the testing on a clean rom, so I didn't remember ShadowOne had implemented that save feature.  Good thing that'll be easy enough to fix.  He will just have to add a bit of code (A9 18 8D FE 00) to the moment UP+A is pressed to save the game.  Thanks for reporting that.   :)

Edit:
Actually, ShadowOne, the moment you press UP+A, you'd have to do a branch, to check if Link is on the world map or side-scrolling area using RAM address $727.  00 = world map, 01 = side scroll area.  So the code would look something like this:

AD 27 07 F0 XX (1st save code here) FF A9 18 8D FE 00 (2nd save code here) FF

If Link is on the world map (00), it will skip over the "1st save code" and reset the palette to normal while opening the save menu with the "2nd save code".  If Link is in a side scroll area (01), it will use the "1s save code" and only open the save menu.  XX = the length of bytes to branch over the 1st save code.  Hopefully I explained that easily enough.   :-\


Also, I wanna report a "bug" as well.  Currently the scrolling health tile and magic tile in the HUD is set to 09 x-position.  When you run out of magic, it still appears to have a sliver of magic left.  You should position the magic tile to 08 x-position.  The health bar is fine, since the tile is covered by the new heart gfx.   However, on a normal health bar it would similarly have this same problem.
« Last Edit: February 09, 2019, 03:40:26 pm by IcePenguin »

Trax

  • Sr. Member
  • ****
  • Posts: 491
    • View Profile
    • Trax ROM Hacking
Re: Zelda II Redux
« Reply #405 on: February 09, 2019, 09:55:47 pm »
Technical notes on the color changes used for the Pause, which is a cool idea, by the way. RAM address $FE is used to modify Register $2001, which controls how the PPU displays things. Bit 0 sets everything to black and white, effectively replacing every color (background and sprites) with color codes 00, 10, 20 or 30. Bits 5-6-7 create an emphasis on the red, green and blue channels, respectively. Mixing bits 5-6-7 with bit 0 set to 1 will effectively produce different variations of black and white. Make sure you don't touch the other bits as they are crucial to how the image is displayed. Check this page for all the details: https://wiki.nesdev.com/w/index.php/PPU_registers

As for the "PAUSE" string, I think using sprites would be easier than using background tiles. There's only 5 letters, so it would be okay, unless there are already other sprites on the same scanline. That would produce flicker or tiles that don't display at all.

IcePenguin

  • RHDN Patreon Supporter!
  • Sr. Member
  • *****
  • Posts: 265
    • View Profile
Re: Zelda II Redux
« Reply #406 on: February 10, 2019, 03:30:52 am »
Behold!

Pause display on world map:



Finally got it.  Thank you Trax for the good info, helped me in figuring this out.  :)

First thing you'll want to do is make some new tiles for the "PAUSE!" letters.  I added an exclamation so it's centered above Link.  Here is a screenshot showing where the tiles should go:

Spoiler:

Next, here is the code.

This a new version of the hack, so remove the old one first!

I had to slightly modify the location of the jumps, because I didn't realize the Flute uses the pause mechanic, as well.  So the jump is now located to where it only affects the pausing, and not the flute and pausing both.  (the previous hack did affect the flute, but we just didn't realize it)  I also cleaned the code a bit, so it uses space more efficiently.

At 0x2273, you will find the following code:

C5 00 F0 03 EE 24 05 60

Replace it with:

4C 50 AA EA EE 24 05 60

At 0x2A60, paste this code:

C5 00 F0 03 EE 24 05 AD 27 07 F0 01 60 A9 40 8D 44 02 A9 89 8D 45 02 A9 02 8D 46 02 A9 70 8D 47 02 A9 40 8D 48 02 A9 8B 8D 49 02 A9 02 8D 4A 02 A9 78 8D 4B 02 A9 40 8D 4C 02 A9 8D 8D 4D 02 A9 02 8D 4E 02 A9 80 8D 4F 02 A9 40 8D 50 02 A9 8F 8D 51 02 A9 02 8D 52 02 A9 88 8D 53 02 A9 40 8D 54 02 A9 91 8D 55 02 A9 02 8D 56 02 A9 90 8D 57 02 A9 40 8D 58 02 A9 93 8D 59 02 A9 02 8D 5A 02 A9 98 8D 5B 02 AD 24 05 D0 06 A9 18 8D FE 00 60 A9 F8 8D FE 00 60

The big chunk of code is where the "PAUSE!" text is drawn.  In RAM, the section starting at address $200 is where all the sprites are loaded, with 4 bytes each.  They are structured like this:

AA BB CC DD

AA is the Y position.  BB is the tiles used.  CC is the palette.  DD is the X position.  So with this, the big chuck of code is loading all necessary info to draw the word "PAUSE!".  It's starts just after the section where the game draws the right black border on the world map - At RAM address $244.

Actually, I ran into another bug: if you save from the overworld via Up+A on the pause menu, the screen doesn't undim until you pause again in the overworld, which is a bit annoying. It's nothing game breaking really, but it's still a bit of an issue.

Just a reminder, ShadowOne, you'll still want to fix this bug that Danny reported.  It should be quite easy to do, and I explained a possible solution in my last post.  :)

Anyway, I hope you like it!


Technical notes on the color changes used for the Pause, which is a cool idea, by the way. RAM address $FE is used to modify Register $2001, which controls how the PPU displays things. Bit 0 sets everything to black and white, effectively replacing every color (background and sprites) with color codes 00, 10, 20 or 30. Bits 5-6-7 create an emphasis on the red, green and blue channels, respectively. Mixing bits 5-6-7 with bit 0 set to 1 will effectively produce different variations of black and white. Make sure you don't touch the other bits as they are crucial to how the image is displayed. Check this page for all the details: https://wiki.nesdev.com/w/index.php/PPU_registers

As for the "PAUSE" string, I think using sprites would be easier than using background tiles. There's only 5 letters, so it would be okay, unless there are already other sprites on the same scanline. That would produce flicker or tiles that don't display at all.

Thanks for the technical info, Trax!  That's something I'm just not good at doing, ha ha.  Honestly, I don't know what I'm doing half the time.   :laugh:  It helps to know what $FE is really up to!  :)



February 10, 2019, 06:50:17 am - (Auto Merged - Double Posts are not allowed before 7 days.)

I made another little hack that displays the extra lives correctly in the inventory menu.  I always wondered why the black screen that shows your name, Link, and current lives always displayed lives in decimal, but then the inventory screen showed them in hexadecimal.  Displaying zero lives just makes no sense, ha ha.  :P

At 0x2173 you find the following code:

AD 00 07

Replace it with a jsr:

20 B0 A8

Next, go to 0x28c0 and paste the following code:  (or to any free space)

EE 00 07 AD 00 07 CE 00 07 60

Now there is probably a better way to do this, but this works perfectly fine.  It increments the value of the extra life counter by one, displaying the correct number.  The decrement just cancels it out, preventing it from actually increasing.  The result is a constant, accurate display of how many lives you have remaining.  Just to clarify, it's not actually changing your number of lives.

Again, the lives remaining screen already displays an accurate number, so I think the inventory menu should, as well.   :)
« Last Edit: February 10, 2019, 07:18:33 am by IcePenguin »

Jeville

  • Sr. Member
  • ****
  • Posts: 346
    • View Profile
Re: Zelda II Redux
« Reply #407 on: February 10, 2019, 02:40:29 pm »
I don't know if any changes are made to the Link doll, but the idea that was brought up before is to make them give a permanent increase to starting lives. The 1-up from leveling should be left temporary as is.

Trax

  • Sr. Member
  • ****
  • Posts: 491
    • View Profile
    • Trax ROM Hacking
Re: Zelda II Redux
« Reply #408 on: February 10, 2019, 09:10:08 pm »
Nice work on the PAUSE string, IcePenguin, but that code could use a loop! Anyway, if it works, it's not a big deal. As long as unused space is plenty.

IcePenguin

  • RHDN Patreon Supporter!
  • Sr. Member
  • *****
  • Posts: 265
    • View Profile
Re: Zelda II Redux
« Reply #409 on: February 11, 2019, 03:59:17 am »
Nice work on the PAUSE string, IcePenguin, but that code could use a loop! Anyway, if it works, it's not a big deal. As long as unused space is plenty.

Thanks Trax!  I was really happy to finally get it.  I'm not too familiar with loops.  I've done them in C++, but not assembly.  I wouldn't even know how to set it up, ha ha.  :P  Perhaps I should learn to because my next hack (below) could probably benefit from having loops.

Here is my latest hack!

ShadowOne, I know you made the heart tiles for the health meter, but I decided to take it a bit further and actually make traditional Zelda hearts!  No more sliding bar.  It's not quite done, yet, but when it is I will post all the details.  If you like it, feel free to use it for your hack, or anyone else.  ;)



Just so you know, health will work exactly the same way.  I just changed how the game displays the health.  So shield, life levels, and all that won't be affected.

Here is a video showing the new hearts:  :)

https://youtu.be/eLt_EgASRd8

« Last Edit: February 11, 2019, 04:15:35 am by IcePenguin »

njosro

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: Zelda II Redux
« Reply #410 on: February 11, 2019, 07:23:38 am »
I've learned that loops in asm aren't that bad as long as they're not too complicated!
I looked at your code IcePenguin. Here is a way to use a loop:

Instead of doing LDA/STA repeatedly, put in a table of values for the desired LDA values:
$2A6D: 40 89 02 70 40 8B ... etc.

Then, (assuming register X isn't being used for something else) do this:
Code: [Select]
LDX #$0
loopstart:
LDA $2A6D, X
STA $0244, X
INX
CPX number of iterations
BNE loopstart

There's a way to optimize that further by starting from the last entry and looping backwards, but it saves only 1 instruction and is a little bit confusing to keep track of (in my opinion).
« Last Edit: February 11, 2019, 07:48:59 am by njosro »

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1145
    • View Profile
Re: Zelda II Redux
« Reply #411 on: February 11, 2019, 12:23:25 pm »
Oh wow, there was a lot of progress this weekend.

First off, let me apologize for my absence these past days.
I went through a personal problem which really got a hold of me hard to a breaking point.
It has me completely depressed and drained of all motivation at the moment, and it all happened during the weekend.

Out of that, I really want to give you guys some proper recognition, the work put into those hacks has been incredible, nothing less of amazing.
Trax, IcePenguin, njosro, all of your help has really helped to bring this hack to life in such a great way, I am really grateful for all of your help so far.

I have successfully implemented the Pause message in the Overworld thanks to all of you guys' help.



Now two things to point out:
  • There's a bug with the black overlay during the Pause (which is why I left it out for the time being). If you try pressing Start several times, there are a few times in which the overlay remains on even after the screen has been un-paused. You can replicate it by walking left-right and pausing consecutively.
    At the moment I changed [A9 F8 8D FE 00 60] to [A9 18 8D FE 00 60] somewhere around 0x2BA0 and above, just to bypass the overlay.
  • I couldn't get the PAUSE message to have that black border around it, because the palette that it's being used for it is the same one used for the enemy spawns in the OW, and I changed their palette to Blue-Red-White so that it matches the colours of the enemy spawns from the Japanese Zelda II, so for me the black border showed up as blue. Still though, I feel like the way I managed to write it out looks nice, even without the border around it.

I already implemented and addressed most of the issues, bugs and other stuff that has been brought up during these days, like the redundancy in a text, the life and magic tile changed to 08, the life counter, etc.

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

@njosro:
That loop code that Trax suggest could really save up some space for sure, I am really interested in it.
The way you wrote it seems perfect, though as you say, I am not sure if register X is free for use there.
If I made the transcription correctly, this should be the code you wrote into Hex format:
[A2 00 BD 6D 2A 9D 44 02 E8 E0 06 D0 F5]
I have my doubts about the E0 06 (CPX) and the D0 F5 (BNE). I am still not sure how branches to labels before the branch opcode are handled in Hex, and also I am not sure how many iterations should the CPX count, I assumed 6 since that's the number of tiles for "PAUSE!". Any clarification on this would be really helpful.

As for the table, I think this is how the attribute table for the "PAUSE!" message would look:

Code: [Select]
40 89 02 70
40 8B 02 78
40 8D 02 80
40 8F 02 88
40 91 02 90
40 93 02 98

Let me know if that's correct or if I missed something.


@IcePenguin:

Oh you managed to get the heart meter working without the blue overlay?
That's awesome! The reason why I kept the blue border around the hearts was to hide the Life tile moving down as you get hit. That's quite impressive. I'd be interested in knowing how you did it. Best of luck with it!

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

The updated patch is found in the same link as always, for those that want to try out the latest changes:
https://www.dropbox.com/s/5dbq6pl321fj2dh/Zelda2Redux.ips?dl=0
« Last Edit: February 11, 2019, 01:57:56 pm by ShadowOne333 »

IcePenguin

  • RHDN Patreon Supporter!
  • Sr. Member
  • *****
  • Posts: 265
    • View Profile
Re: Zelda II Redux
« Reply #412 on: February 11, 2019, 12:59:26 pm »
njosro, thanks for the helpful explanation!  I'll have to do some experiments with it.  I did try to make a loop for my hearts hack, but it was complicated enough trying to them to work, ha ha.  Those things are pesky!   >:(

By the way, I finished creating the new hearts!  I ended up doing an all night-er, cause I was too focused on getting it to work.  Let's just say, I need a break, ha ha.  With this hack, the health meter has been replaced with a traditional heart gauge from the Zelda series!  Currently, it is set to half hearts, but it could be reworked into using quarter hearts.  For now, let's just stick to the easier one.  :P

NOTICE:  To anyone who wants to use this heart hack:
Feel free to use this, but keep in mind that is was intended for use with ShadowOne's Redux HUD.  You'll need to adjust some data to fit your preferences, or whatever layout you may have for your HUD.

With that out of the way, let's get started!

First thing, here is a screenshot of where the half heart tile should go.  I replaced the "L" in the life meter because the new hearts looks better without it, I think!  :)

Spoiler:

Next, you'll want to remove the sliding health tile since it is no longer used.  You could simply change its X position to FF and it'll go off screen, or you can remove it by modifying its code.  Up to you!

Also, you'll want to remove the "L" tile from the screen.  A simple F4 to make it invisible is what I suggest.  Next up, is the code!

At 0x17AC you'll find the following code:

AD 74 07 8D 65 05 4A 4A 4A 4A 4A 85 00 C6 00 30 09 A9 C7 99 09 03

Replace it with:

20 10 B0 EA 20 A0 B0 EA 20 00 B0 85 00 C6 00 30 09 EA EA EA EA EA

There are 3 jsr here, which all point to the new code.  There are 3 different parts, but I bunched them all together.  First part is 7 bytes, second part is 141 bytes, and the third part is 105 bytes.

At 0x3010, paste this code:

Spoiler:
AD 74 07 8D 65 05 60 FF FF FF FF FF FF FF FF FF A9 00 CD 74 07 D0 01 60 A9 80 CD 74 07 30 01 60 A9 C7 99 09 03 A9 C7 99 0A 03 A9 C7 99 0B 03 A9 C7 99 0C 03 A9 80 CD 74 07 30 01 60 A9 F7 99 0D 03 A9 90 CD 74 07 30 01 60 A9 C7 99 0D 03 A9 A0 CD 74 07 30 01 60 A9 F7 99 0E 03 A9 B0 CD 74 07 30 01 60 A9 C7 99 0E 03 A9 C0 CD 74 07 30 01 60 A9 F7 99 0F 03 A9 D0 CD 74 07 30 01 60 A9 C7 99 0F 03 A9 E0 CD 74 07 30 01 60 A9 F7 99 10 03 A9 F0 CD 74 07 30 01 60 A9 C7 99 10 03 60 FF FF FF A9 00 CD 74 07 30 01 60 A9 F7 99 09 03 A9 10 CD 74 07 30 01 60 A9 C7 99 09 03 A9 20 CD 74 07 30 01 60 A9 F7 99 0A 03 A9 30 CD 74 07 30 01 60 A9 C7 99 0A 03 A9 40 CD 74 07 30 01 60 A9 F7 99 0B 03 A9 50 CD 74 07 30 01 60 A9 C7 99 0B 03 A9 60 CD 74 07 30 01 60 A9 F7 99 0C 03 A9 70 CD 74 07 30 01 60 A9 C7 99 0C 03 60

This code probably could've been done more efficiently, but it works!  Basically, I removed the old health meter with a bunch of NOP (EA), and made all this new code that constantly checks your current health, and then displays the necessary amount of hearts.  The first large chunk of code is for hearts 5-8, and the second chunk is for hearts 1-4.  It turned out to be more complicated than I originally thought, so the code could probably be shortened, but I found it was a good idea to separate the hearts into two parts.  It just works better than way, and is less confusing.  I dunno, I'm too tired to think about that, ha ha.

If you have any questions, I'll try to answer them as best I can.  Also, I might have missed something.  As I mentioned, I'm quite tired, so I could've forgotten to include something.  Hopefully not, and you get it working ok.  :)

About the bug you experienced with the pause display - I couldn't replicate this.  Try adding the hack to a clean rom, to see if you can get it working.  There may have been an oversight somewhere, but we'll figure it out!

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1145
    • View Profile
Re: Zelda II Redux
« Reply #413 on: February 11, 2019, 03:03:58 pm »
About the bug you experienced with the pause display - I couldn't replicate this.  Try adding the hack to a clean rom, to see if you can get it working.  There may have been an oversight somewhere, but we'll figure it out!

I was able to replicate it in vanilla Zelda 2 as well, copy-pasting the code you wrote.

Here's a video which shows the problem in action:
https://www.youtube.com/watch?v=2Hhmb3zapss

(CHANGE THE VIDEO SPEED TO 0.5 TO PLAY IT NORMALLY)

In there, you can see I start walking to the right normally, and while walking right (holding D-Pad Right) I pause the screen (overlay activated). Then I unpause it and you can see Link continues to walk, but the overlay is still active.
Then I proceed to stop Link, pause-unpause the screen again to get the overlay off properly.

Hopefully that helps to explain how to recreate the bug.

IcePenguin

  • RHDN Patreon Supporter!
  • Sr. Member
  • *****
  • Posts: 265
    • View Profile
Re: Zelda II Redux
« Reply #414 on: February 11, 2019, 03:29:46 pm »
I don't know if any changes are made to the Link doll, but the idea that was brought up before is to make them give a permanent increase to starting lives. The 1-up from leveling should be left temporary as is.

Done!  I made a small hack that make extra lives a permanent upgrade.  I actually really like this idea because the life dolls are so pointless in the original game.  It gets my vote for being in Redux!  ;)  It would seriously improve the value of the life dolls.

Here's the code:

At 0x1E82A, you'll find the following code:

EE 00 07

Replace it with:

20 50 FF

Next, go to 0x1FF60 and paste this code:  (there's a bit of free space here)

EE 00 07 EE 95 07 60

Next, go to 0x1C368 to find the following code:

A9 03 8D 00 07

Replace this with:

20 A0 D3 EA EA

Finally, go to 0x1D3B0 and paste the following code:

A9 00 CD 95 07 F0 07 AD 95 07 8D 00 07 60 A9 03 8D 95 07 8D 00 07 60

For this hack we are using an unused location in memory.  RAM address $795.  This location was never utilized by the original game, so we will use it to keep track of extra lives collected.  When the game loads for the first time, it initiates this variable ($795) by setting it to 03.  Whenever you collect a life doll, it increments both the normal counter for lives at $700, and the new one we made at $795.  Then when you get a game over, the game uses the new variable to reset the counter, thus having permanent life upgrades!  :)

Great idea Jeville!


ShadowOne, that's strange indeed!  Maybe you could send me a copy of it so I can compare the two.  I will try to replicate it again and re-examine the code to see if I made a mistake somewhere.

Edit:

I did some testing with it, but I still couldn't get the glitch to happen.  Hmm...  Kinda wish it would so I could fix it, ha ha.  It could be some code with bad logic.  The newest version of the hack was slightly different, so it might have a mistake.  Anyway, if you can, PM me a link to the hack.  :)
« Last Edit: February 11, 2019, 03:55:47 pm by IcePenguin »

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1145
    • View Profile
Re: Zelda II Redux
« Reply #415 on: February 11, 2019, 04:11:47 pm »
These are the only changes I made to a clean ROM:

Quote
At 0x2273, you will find the following code:

C5 00 F0 03 EE 24 05 60

Replace it with:

4C 50 AA EA EE 24 05 60

At 0x2A60, paste this code:

C5 00 F0 03 EE 24 05 AD 27 07 F0 01 60 A9 40 8D 44 02 A9 89 8D 45 02 A9 02 8D 46 02 A9 70 8D 47 02 A9 40 8D 48 02 A9 8B 8D 49 02 A9 02 8D 4A 02 A9 78 8D 4B 02 A9 40 8D 4C 02 A9 8D 8D 4D 02 A9 02 8D 4E 02 A9 80 8D 4F 02 A9 40 8D 50 02 A9 8F 8D 51 02 A9 02 8D 52 02 A9 88 8D 53 02 A9 40 8D 54 02 A9 91 8D 55 02 A9 02 8D 56 02 A9 90 8D 57 02 A9 40 8D 58 02 A9 93 8D 59 02 A9 02 8D 5A 02 A9 98 8D 5B 02 AD 24 05 D0 06 A9 18 8D FE 00 60 A9 F8 8D FE 00 60

That's all I did, and with that I could recreate it in FCEUX.
Here's an IPS patch just in case it helps as well:
https://www.dropbox.com/s/9jdv9bjj0b2boyu/pausetest.ips?dl=0

Should be applied to a clean Zelda 2 ROM, that should make it so that you can replicate the problem.
The way I can get it to consistently replicate it, is by walking right, hold D-Pad Right and while still holding it, press Start to pause, while STILL holding down Right on the D-Pad, then unpause with Right still being held, and you shall be able to see Link walking again, but with the overlay still applied.
In short words, just don't let go of the Right on the D-Pad, and pause/unpause at will, that should do it.

Hope that helps.

IcePenguin

  • RHDN Patreon Supporter!
  • Sr. Member
  • *****
  • Posts: 265
    • View Profile
Re: Zelda II Redux
« Reply #416 on: February 11, 2019, 04:41:38 pm »
I still couldn't get it to happen lol.   :laugh:  No worries, let's try changing some of the code.  Instead of using this:  (for the last bit of code in the big chunk)

AD 24 05 D0 06 A9 18 8D FE 00 60 A9 F8 8D FE 00 60

Try this:

AD EA 00 F0 06 A9 F8 8D FE 00 60 A9 18 8D FE 00 60

It's basically the same, but it's using a different indicator to determine if pause is pressed.  The branch used before was expecting a 0 or 1, but instead got an incremented value from 0 to 2.  Now it's using RAM address $EA which is 0 or 1 depending on if the game is paused.  I'm not sure if that's what was causing it, but it could be.  Let me know if the new code helps.  :)  If not, more testing shall be done!


Shadic

  • Jr. Member
  • **
  • Posts: 36
    • View Profile
Re: Zelda II Redux
« Reply #417 on: February 11, 2019, 04:48:26 pm »
Just want to say that the Heart Meter is awesome! Though I definitely think it needs to support 1/4 hearts to really show life totals - Even the bar in vanilla Zelda II will show you at "Empty" while still alive.

The Pause screen is great, as well!

Also I love the Extra Lives idea! Right now you want to avoid them until you're ready to tackle the Great Palace, but having them permanently increase your maximum is genius.

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1145
    • View Profile
Re: Zelda II Redux
« Reply #418 on: February 11, 2019, 04:57:25 pm »
I still couldn't get it to happen lol.   :laugh:  No worries, let's try changing some of the code.  Instead of using this:  (for the last bit of code in the big chunk)

AD 24 05 D0 06 A9 18 8D FE 00 60 A9 F8 8D FE 00 60

Try this:

AD EA 00 F0 06 A9 F8 8D FE 00 60 A9 18 8D FE 00 60

It's basically the same, but it's using a different indicator to determine if pause is pressed.  The branch used before was expecting a 0 or 1, but instead got an incremented value from 0 to 2.  Now it's using RAM address $EA which is 0 or 1 depending on if the game is paused.  I'm not sure if that's what was causing it, but it could be.  Let me know if the new code helps.  :)  If not, more testing shall be done!
I think that made it worse on my side :/
Now the screen tends to flicker randomly at times, and the dim screen works rather odd as well.

I'd recommend that you try pausing and unpausing the game consistently while walking around (it can happen while standing still too), you might hit it eventually. Just look deeply into the PAUSE message and when Link moves to know when it happens.

IcePenguin

  • RHDN Patreon Supporter!
  • Sr. Member
  • *****
  • Posts: 265
    • View Profile
Re: Zelda II Redux
« Reply #419 on: February 11, 2019, 06:30:52 pm »
I finally got the bug, but just once.  It was very exciting.  :P  Try this code instead:

Spoiler:
C5 00 F0 03 EE 24 05 AD 27 07 F0 01 60 A9 40 8D 44 02 A9 89 8D 45 02 A9 02 8D 46 02 A9 70 8D 47 02 A9 40 8D 48 02 A9 8B 8D 49 02 A9 02 8D 4A 02 A9 78 8D 4B 02 A9 40 8D 4C 02 A9 8D 8D 4D 02 A9 02 8D 4E 02 A9 80 8D 4F 02 A9 40 8D 50 02 A9 8F 8D 51 02 A9 02 8D 52 02 A9 88 8D 53 02 A9 40 8D 54 02 A9 91 8D 55 02 A9 02 8D 56 02 A9 90 8D 57 02 A9 40 8D 58 02 A9 93 8D 59 02 A9 02 8D 5A 02 A9 98 8D 5B 02 A9 F8 8D FE 00 AD EA 00 F0 01 60 A9 18 8D FE 00 60

With this code I haven't been able to get the bug again, but doesn't really say much since I couldn't before.  I hope it fixes it...  Trying to fix what you can't see is quite difficult.  Let me know how it goes!

Just want to say that the Heart Meter is awesome! Though I definitely think it needs to support 1/4 hearts to really show life totals - Even the bar in vanilla Zelda II will show you at "Empty" while still alive.

The Pause screen is great, as well!

Also I love the Extra Lives idea! Right now you want to avoid them until you're ready to tackle the Great Palace, but having them permanently increase your maximum is genius.

It'd be totally possible to make them 1/4 hearts.  It all depends on if there is enough space for the extra gfx tiles.  There would have to be 2 extra tiles.  (4 total)  There is definitely enough free space for the code.