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 281923 times)

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1539
    • View Profile
Re: Zelda II Redux
« Reply #920 on: October 16, 2020, 02:55:05 pm »
But uhh... I think you've forgotten something. :-\
Seems like the main mod hasn't changed since I played it last year
(as far as most of the text is concerned anyway).
Just a few updated/new optional patches from what I can tell.

Even if you don't end up going through the actual dialogue, I figured
you'd at least want to fix that weird line in the intro text I mentioned.

Oh yeah. The thing is I didn't modify anything from the currently available stable release we had as beta.
Since that had no issues, that's what I released as v1.0.

I still have yet to do/have the disassembly of the hack itself, so once I get to that, I'll modify the text accordingly. I assume you are referring to this post here:
https://www.romhacking.net/forum/index.php?topic=26001.msg388451#msg388451

Correct?
I might do a shadow edit and modify just that line, but I'll see since I have quite a good amount of things to do atm.


As for the overworld lag, there's not much I could do about that, since that's also found in the original NES game.

King Luigi

  • Jr. Member
  • **
  • Posts: 8
    • View Profile
Re: Zelda II Redux
« Reply #921 on: October 16, 2020, 11:45:29 pm »
Oh yeah. The thing is I didn't modify anything from the currently available stable release we had as beta.
Since that had no issues, that's what I released as v1.0.
Aside from the Dragon Quest grave acting weird, yeah,
there weren't any major issues, that I know of at least.
Fair enough, I suppose.

I still have yet to do/have the disassembly of the hack itself, so once I get to that, I'll modify the text accordingly.

I assume you are referring to this post here:
https://www.romhacking.net/forum/index.php?topic=26001.msg388451#msg388451

Correct?
Yeah, my absurdly long monster post is what I was referring to.

Amusingly I actually hit the size limit for posts with that,
so I had to edit things down just enough to even post it. :laugh:
(Seems like I shoulda just cut out that last part with my questions/ideas
though, considering no one has mentioned them since... ah well.)


It's just.. after seeing all the work you've done for this
(like reworking the text to fit more of it in a box)
I'd hate to see it get wasted due to the "rewritten & revised"
script still having some errors or weird phrasings in it. :-\

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1539
    • View Profile
Re: Zelda II Redux
« Reply #922 on: October 22, 2020, 01:03:49 am »
@King Luigi I'll take those points into consideration.
I tested the gravestone in Saria, and the text does appear for me without issues.
You need to press B right in the middle cross in between the set of 3 crosses in the 2nd screen of Saria.



Also, I just started RE the whole Zelda 2 Redux project.
Progress has been going quite good so far.

However, I found one code in particular that I'm not sure what it is at all.
The code at 0x17E30. I think it's code related to the West Hyrule Battle Theme, but I haven't figured out what it is yet.

There are still a couple other routines/places I haven't quite remember what they are yet, but I'll take a dive into the whole thread to figure out what they might be.

I will try to polish the source as much as I can, similar to Zelda 1 Redux, but even more polished, as I do plan to revamp Zelda 1's source as well once I am done with Zelda 2 Redux's documentation.

elmontro42

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Zelda II Redux
« Reply #923 on: October 22, 2020, 03:13:45 am »
Yes, actually. I've had that happen several times,
but I could never figure out why it wasn't there...
Yet I'd see it just randomly show up a moment later for no discernible reason. :banghead:

Glad to know I'm not the only one. In my particular case, I'm not receiving any text prompts at all. I know it's the central cross.


Also, Shadowone333- was it intentional to leave the Western Hyrule theme, in the location where you rescue the kidnapped child (Reflect)?

itemdrop

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: Zelda II Redux
« Reply #924 on: October 22, 2020, 07:38:41 pm »
I tried the "keep xp after game over" patch not sure it was by design or intended but it doesnt keep xp on upa, only on game over.

King Luigi

  • Jr. Member
  • **
  • Posts: 8
    • View Profile
Re: Zelda II Redux
« Reply #925 on: October 23, 2020, 12:20:54 am »
I tested the gravestone in Saria, and the text does appear for me without issues.
You need to press B right in the middle cross in between the set of 3 crosses in the 2nd screen of Saria.
Yea, I'm aware of that. I've seen the message several times before.

The issue is that sometimes it doesn't seem to.. register or exist?
I dunno how to explain it. I've tried inching closer to the graves,
repeatedly trying to interact with it and nothing happens.
But then I come back like, a minute later and it's suddenly there. :-\
It's a small detail that seems like it fixes itself...

I tried random things to see if they can cause it to show/not show up,
but after like 15 mins I couldn't find any kind of pattern
so I just ignored it and decided not to mention it back then.

Maybe the game just loads the area weirdly sometimes
and the hitbox doesn't load correctly?
I dunno, just a random thought.

Trax

  • RHDN Patreon Supporter!
  • Hero Member
  • *****
  • Posts: 571
    • View Profile
    • Trax ROM Hacking
Re: Zelda II Redux
« Reply #926 on: October 24, 2020, 01:56:18 pm »
Maybe it's because all enemy slots are taken when you arrive near the loading point of the message object. Not likely, but that's the only explanation that comes to mind. Townfolks generator counts as one (and maybe two, if you consider both sides of the area, but I never tested), plus the random folks loaded at the moment, plus other fixed townfolks also present.

Twapsel

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Zelda II Redux
« Reply #927 on: October 25, 2020, 07:44:34 am »
I never plazed Zelda II. I saw a Youtube video about this hack. Now I am asking myself what version of the hack would you recommend. Basic one or with optional patches? Which ones?

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1539
    • View Profile
Re: Zelda II Redux
« Reply #928 on: October 27, 2020, 12:45:55 am »
I never plazed Zelda II. I saw a Youtube video about this hack. Now I am asking myself what version of the hack would you recommend. Basic one or with optional patches? Which ones?

It depends on what your optimal options for Zelda 2 would be.
I say default Redux is fine for that. I only apply the FDS King's Tomb and Original Title Screen Sword optional patches, but those are my personal preference.



On a side note, I tried contacting IcePenguin, but he doesn't seem to be around often, regarding an optional patch to implement the randomization of the battle themes in a 50/50 manner, like Trax suggested and IcePenguin tried to implement here:
https://www.romhacking.net/forum/index.php?topic=26001.msg372468#msg372468

But sadly, the implementation IcePenguin made has a bug in which the overworld theme gets completely mute after the first enemy encounter. If anyone has any idea how to fix his code to make such an optional patch, please let me know.



To end this post, I took some inspiration on the work DarkSamus993 showcased some pages ago, and I tried to implement a Fairy Cancel hack into Redux today, given I had some spare time during lunch, so I tried to tackle it with some success. You can convert into a Fairy and cancel the transformation by pressing the A button.
However, the only bug I'm encountering right now is that, sometimes, when I press the A button, Link gets pushed upwards with a bit of momentum, and then falls normally, and the same applies if I hold Down and then the A button, he gets pushed downwards, sometimes going through the floor.
That's the only bug, if someone knows what the issue with my code might be, and how to polish it, I'll be thankful for the little ASM lesson :)

Code: [Select]
//***********************************************************
//   Fairy Cancel by Pressing A Button (by ShadowOne333)
//***********************************************************

bank 0;
// Hijack original Fairy routine
org $91AA // 0x011BA
jsr l_A8B0 // Originally LDA #$08
nop // Originally STA $13

org $A8B0 // 0x028C0
l_A8B0:
lda.b $F5 // Load controller 1 inputs
cmp.b #$80 // Compare if Button A is pressed
beq fairy_cancel // Branch to Fairy Cancel if A is pressed
// Original code
lda.b #$08 // Load fairy state ($08)
sta.b $13 // Store at RAM $13
rts
fairy_cancel: // Fairy Cancel routine
lda.b #$00 // Load human state ($00)
sta.b $13 // Store at RAM $13
sta.w $076F // Store at RAM $076F
rts

I am working on the source code for this project, and it is coming along quite nicely, it should be ready hopefully by November.

Vanya

  • Hero Member
  • *****
  • Posts: 1821
    • View Profile
Re: Zelda II Redux
« Reply #929 on: October 27, 2020, 01:20:12 am »
Sounds like the momentum from your movement while in fairy form is still there when you turn back into Link maybe?

Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 530
  • I am the baldest romhacker
    • View Profile
Re: Zelda II Redux
« Reply #930 on: October 27, 2020, 07:49:15 am »
For random music here is what I suggest:

Code: [Select]
LDA #music_1
BIT some_address_with_random_byte
BPL @skip    ; or BMI, doesn't matter
LDA #music_2
@skip:
STA music_address

Adjust it to your needs and paste to where music for battle is selected.



As for your fairy code, we need to see more info. What happens before and after $91AA?
iromhacker.ru - NES ROM hacking tutorials for beginners. Please use Google Translate browser extension

fedorajoe

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: Zelda II Redux
« Reply #931 on: October 27, 2020, 10:04:18 am »
Yea, I'm aware of that. I've seen the message several times before.

The issue is that sometimes it doesn't seem to.. register or exist?
I dunno how to explain it. I've tried inching closer to the graves,
repeatedly trying to interact with it and nothing happens.
But then I come back like, a minute later and it's suddenly there. :-\
It's a small detail that seems like it fixes itself...

I tried random things to see if they can cause it to show/not show up,
but after like 15 mins I couldn't find any kind of pattern
so I just ignored it and decided not to mention it back then.

Maybe the game just loads the area weirdly sometimes
and the hitbox doesn't load correctly?
I dunno, just a random thought.

Hi. I'm just a rando who has never hacked Zelda II and is only speculating.

The screen in Saria with the headstone uses some type of randomizer to determine if a townsperson will or will not turn into a bat enemy when spoken to. I have to wonder if that routine is somehow being called for the headstone NPC, and is resulting in it sometimes being there, and sometimes not.

I just tried the Redux patch the other week and was blown away by the quality, but I was never able to get the headstone message to show up, even after many attempts.

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1539
    • View Profile
Re: Zelda II Redux
« Reply #932 on: October 27, 2020, 11:47:52 am »
For random music here is what I suggest:

Code: [Select]
LDA #music_1
BIT some_address_with_random_byte
BPL @skip    ; or BMI, doesn't matter
LDA #music_2
@skip:
STA music_address

Adjust it to your needs and paste to where music for battle is selected.



As for your fairy code, we need to see more info. What happens before and after $91AA?

Oh nice!
I'll check that code later today.
I forgot to say that IcePenguin modified the FDS Theme on East Hyrule code just a few posts below with a fix, since the song seemed to end whenever one got killed or respawned, which seems to grab RAM $0707 for reference fir the fix:
http://www.romhacking.net/forum/index.php?topic=26001.msg372943#msg372943

As for the Fairy hijack, you can see it here:
http://www.bwass.org/romhack/zelda2/zelda2bank0.txt

It's at 0x011ABA in the ROM, or $11AA in Trax's notes, it's a rather short routine which only affects RAM$13, but it seems RAM $076F also has something to do with the Fairy state.
I think something about the Y Velocity in RAM could fix the bug. The Y Velocity seems to start at $05 and go down to $00 when falling after a jump, and I noticed with my code, it starts at the Fairy Y Velocity around $E9, jumps to around $FF (as if it were a normal Link jump) and then tries to stabilize again going to 05->00.

Hi. I'm just a rando who has never hacked Zelda II and is only speculating.

The screen in Saria with the headstone uses some type of randomizer to determine if a townsperson will or will not turn into a bat enemy when spoken to. I have to wonder if that routine is somehow being called for the headstone NPC, and is resulting in it sometimes being there, and sometimes not.

I just tried the Redux patch the other week and was blown away by the quality, but I was never able to get the headstone message to show up, even after many attempts.

That's an interesting theory.
Though, I'm not sure if this is what actually happens in the game.
Maybe Trax or njosro could know if the townsfolk generator could be at fault for the text appearing or not sometimes.

Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 530
  • I am the baldest romhacker
    • View Profile
Re: Zelda II Redux
« Reply #933 on: October 27, 2020, 02:30:47 pm »
You need to also clear his Y velocity at $057D and $03E6, he'll stop flying upwards and will fall down much more smoothly.

If the game already has mechanics of turning him into a human, you should study it to see what else it does.
iromhacker.ru - NES ROM hacking tutorials for beginners. Please use Google Translate browser extension

ultimaweapon

  • Sr. Member
  • ****
  • Posts: 270
    • View Profile
Re: Zelda II Redux
« Reply #934 on: October 27, 2020, 04:14:52 pm »
Does anyone know how to make the cave inside New Kasuto always visible, so you don't need the "Spell" spell?
Trust in the Heart of the Cards

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1539
    • View Profile
Re: Zelda II Redux
« Reply #935 on: October 28, 2020, 09:57:56 pm »
You need to also clear his Y velocity at $057D and $03E6, he'll stop flying upwards and will fall down much more smoothly.

If the game already has mechanics of turning him into a human, you should study it to see what else it does.

Yep that worked.
I did know about $057D, but I overlooked $03E6.
Adding STAs for those two addresses at the very end makes the Fairy Cancel work just wonderfully, no bugs that I could notice whatsoever, so expect this feature once the source code is released.

Aside from that, I tried to tackle your code for the Random Battle Theme, and while it seems to work similarly to IcePenguin's, in that it does select one of the two themes at random, I am still hitting the issue of the overworld theme not getting restored after the first battle on the overworld after a clean boot.

Here's the disassembly I have of the FDS Theme on East Hyrule by IcePenguin, works 1:1 with current Redux:
https://pastebin.com/2depmyLc

And here's the disassembly of IcePenguin's implementation of the Random Battle Theme, with the current bug of not restoring the normal overworld theme after a battle (Overworld theme should be $02, NES Battle Theme is $04 and FDS Theme is $08):
https://pastebin.com/YdmvUJV5

Maybe you can find something I'm missing, @Cyneprepou4uk.
Also, probably IcePenguin's notes from a bit further on the thread might help, as he does mention something about RAM $707 and $702 regarding a fix for the themes being played here:
https://www.romhacking.net/forum/index.php?topic=26001.msg372943#msg372943



Does anyone know how to make the cave inside New Kasuto always visible, so you don't need the "Spell" spell?

Might require locating the code for the cave, and also knowing which RAM addresses/flags are used for the cave to appear, so that once it appears once, it gets saved into RAM and the game always loads it automatically (similar to the Saria Bridge implementation by IcePenguin).
« Last Edit: October 29, 2020, 10:49:30 am by ShadowOne333 »

Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 530
  • I am the baldest romhacker
    • View Profile
Re: Zelda II Redux
« Reply #936 on: October 29, 2020, 11:33:08 am »
Don't know what is not working for you.

I took original rom, and bumped into the first enemy. Here is where music is selected:


Here is my code:


Here is a jump to my code:


And no way, music is restored after I exit the battle screen in both 04 and 08 cases, just as it should be. Who would have thought it  >:D 
iromhacker.ru - NES ROM hacking tutorials for beginners. Please use Google Translate browser extension

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1539
    • View Profile
Re: Zelda II Redux
« Reply #937 on: November 01, 2020, 04:29:50 pm »
Don't know what is not working for you.

I took original rom, and bumped into the first enemy. Here is where music is selected:


Here is my code:


Here is a jump to my code:


And no way, music is restored after I exit the battle screen in both 04 and 08 cases, just as it should be. Who would have thought it  >:D

That does work, but there's still a slight issue with that code, although I have fixed it on my end.
Whenever you enter certain special tiles in the overworld (like the woods tile just above Zelda's Castle) that prompt up the battle theme, as soon as you get the black screen, the battle theme started playing. The bug here is that the original game waits until the black screen is done, and then the theme loads up alongside the graphics, which wasn't the case in your implementation. There are in total 3 parts in the ROM that set the music ($EB) in bank 0, or the music to play ($075F) in both bank 6 and 7, which were missing so that bug I described doesn't happen anymore.

For reference, this is the full code I made for the Random Battle Theme (FDS/NES) so that it rewrites the comparisons/checks from the original East Hyrule FDS Theme, so that now both the FDS/NES themes play at random on all encounters in the overworld, no matter if it's in East or West Hyrule:

Code: [Select]
//****************************************************************
//    Play FDS or NES Battle Themes at Random
//   (by Cyneprepou4uk & ShadowOne333)
//****************************************************************

// Make the FDS Battle Theme to play randomly alongside the original NES Battle Theme

bank 0;
// Hijack original overworld FDS theme loading routine to change the region check to instead play the theme at random
org $A905 // 0x02915
bne l_A910 // Original FDS Theme branch
lda.b #$04 // Load NES Battle Theme ($08)
bit.w $051A // Randomization address
bmi l_A910 // Branch if it's above $80
lda.b #$08 // Load FDS Battle Theme ($08)
l_A910:
sta.w $075F // Store in 'music to play' address
rts

fill $04,$FF

bank 6;
// Hijack original overworld FDS theme loading routine to change the region check to instead play the theme at random
org $9489 // 0x19499
jsr l_9DC0
nop

org $9DC0 // 0x19DD0
l_9DC0:
lda.b #$04 // Load NES Battle Theme ($08)
bit.w $051A // Randomization address
bmi l_9DCA // Branch if it's above $80
sta.b $EB // Store in 'music' address
rts
l_9DCA:
lda.b #$08 // Load FDS Battle Theme ($08)
sta.b $EB // Store in 'music' address
lda.b #$00 // Load $00 into accumulator
sta.w $0702 // Store to $0702 (Copied world address)
rts

fill $02,$FF

bank 7;
// Routine for playing FDS or NES theme randomly by using RAM address $051A as reference for the randomization
org $FEB4 // 0x1FEC4
// Hijack the East Hyrule routine to allow Random play
l_FEB4:
lda.b #$04 // Load NES Battle Theme ($08)
bit.w $051A // Randomization address
bmi l_FEBF // Branch if it's above $80
sta.w $075F // Store in 'music to play' address
rts
l_FEBF:
lda.b #$08 // Load FDS Battle Theme ($08)
sta.w $075F // Store in 'music to play' address
lda.b #$00 // Load $00 into accumulator
sta.w $0702 // Store to $0702 (Copied world address)
rts

fillto $FED0,$FF


I think I found out the issue with IcePenguin's implementation.
The copy of the frame counter from $12 to $F2 borked the restoration of the overworld theme, and also some code related to $0702 was missing in order to make it work properly.



Aside from that, I want to celebrate the Day of the Dead (or Dia de los Muertos) from Mexico with the full source code release of Zelda 2 Redux to the public!

You can check it out here!
https://github.com/ShadowOne333/Zelda2-Redux


It took me quite some time, but now it's finally done and ready for public view :)
Also, you guys might notice some further changes to the text, I polished some of the text in the game, as I can now make the changes easily thanks to the disassembly I made of Z2R. So now some specific texts have been revamped and more helpful.

Also, with this release there are now 2 new features!
  • Fairy Cancel: This feature is implemented by default into Zelda 2 Redux. Whenever you turn into a Fairy with the Fairy Spell, you can now turn back into Human Link by pressing the A button
  • Random Battle Theme: This is an optional patch, which replaces the "FDS Theme in East Hyrule" feature implemented by default in Redux. With this optional patch, the game will play either the FDS or NES Battle Themes at random for all encounters in the overworld

Enjoy guys!
I just sent the submission to update the Zelda 2 Redux hack page as well, so expect it there, but you can grab the updates from the repository as well :)

darthvaderx

  • Full Member
  • ***
  • Posts: 207
    • View Profile
Re: Zelda II Redux
« Reply #938 on: November 02, 2020, 08:07:12 pm »
I am having this error in v2.0.





ShadowOne333

  • Hero Member
  • *****
  • Posts: 1539
    • View Profile
Re: Zelda II Redux
« Reply #939 on: November 02, 2020, 08:08:51 pm »
@darthvaderx what town is that?
Also, I need to know the precise patches and the order you applied them.



Nevermind, I found the issue.
Stupid text overflow near the text pointers, so some of the text pointers got overwritten with text data, hence the glitched text.

I have fixed it on my end, will upload the fixed IPS in a bit.

EDIT:
It's fixed now.
Sent the submission with the fixed IPS, and the source code has also been updated with the fix.
I have also submitted a reworked make.bat file for Windows, so that Windows users can now compile the ROM with more detailed error messages, and just implemented a brand new SHA-1 hash check for the bat file as well (bash/sh Linux script already had it). So now, the script will ask for the precise base ROM with the exact SHA-1 checksum, if it fails, then the compilation will fail and the error message will prompt the user to put a correct ROM with the proper checksum in the "rom" folder.
« Last Edit: November 02, 2020, 09:56:40 pm by ShadowOne333 »