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
3 (14.3%)
Unveil
4 (19%)
Enigma
9 (42.9%)
Expose
5 (23.8%)

Total Members Voted: 21

Author Topic: Zelda II Redux  (Read 51664 times)

Trax

  • Sr. Member
  • ****
  • Posts: 462
    • View Profile
    • Trax ROM Hacking
Re: Zelda II Redux
« Reply #300 on: November 11, 2018, 04:14:34 pm »
Yes, Itemdrop, I meant Magic Containers.  :laugh:  I corrected the post.

Ultimaweapon. You can change the spells names and their effect accordingly. This way, you won't touch the code and avoid potentially breaking the game. You also have to swap the dialogs for the Wise Man. You may want to make sure the spell magic requirements are correct, in table at $0D7B. Spell effects, one bit per spell, are at $0DBB. To change the spells names, it's in the Pause Pane tile mappings, at $1C1A.
« Last Edit: November 11, 2018, 06:36:09 pm by Trax »

ShadowOne333

  • Hero Member
  • *****
  • Posts: 995
    • View Profile
Re: Zelda II Redux
« Reply #301 on: November 12, 2018, 03:27:07 pm »
I haven't received any bug/glitch feedback from the newest beta, so I will assume it is going smooth for now. :P
So with that, animations on the overworld should be working, and crossed off the list thanks to Trax and the info he provided!

Now, there are still a couple more things I want to attempt to do, but in the meanwhile please be sure to try the latest beta I uploaded and give it a rough test, beginning to end, to ensure it is working properly.

Last things I want to do (beside the Pause message on the overworld) are nothing more but fancy things that I do hope I can implement, still I want to see if I can achieve them before even saying what they are, so enjoy the beta meanwhile :P

azul120

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: Zelda II Redux
« Reply #302 on: November 13, 2018, 01:29:29 am »
Going from MMC1 to MMC3 is not a piece of cake. It involves a different way of loading graphics. You can probably use the same CHR swap as the original, i.e. swap 0x2000 bytes at PPU 0x0000 or 0x1000 in one shot. But the advantage of MMC3 is that you can individually swap smaller chunks of the PPU at any given time. I think the smallest is 0x400 bytes, which is a quarter of 0x0000 or 0x01000, or 64 tiles. That would make tile animation a lot easier and less "hacky".

As far as I know, MMC1 allows a maximum of 16 banks, so the expansion of banks is possible with MMC1. Just change the ROM's header, and then make sure the correct banks are swapped as needed. As for Zelda II specifically, you have to take bank 7 and move it to 15. I think the rest can be left where it is.

In Shadow of Night, the code for the Overworld bank swapping is at 0x2A40.

There already is a MMC1 to 3 hack, but of course there's the issue of it possibly not working on Everdrive or Retrocart.

ultimaweapon

  • Full Member
  • ***
  • Posts: 132
    • View Profile
Re: Zelda II Redux
« Reply #303 on: November 21, 2018, 11:19:02 am »
How do you edit the text without using an separate text editor?

How do you edit the palettes for the final room after you beat Dark Link and wake up princess Zelda without an editor?
Trust in the Heart of the Cards

ShadowOne333

  • Hero Member
  • *****
  • Posts: 995
    • View Profile
Re: Zelda II Redux
« Reply #304 on: November 21, 2018, 11:24:52 am »
How do you edit the text without using an separate text editor?

How do you edit the palettes for the final room after you beat Dark Link and wake up princess Zelda without an editor?
Hex editing?

That's how I did the entire repointing and re-translation of the script.
Same for palette changes and such.
Editors are just the easy way of handling stuff, with them you most likely won't ever have to touch ROM addresses at all.

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


Out of that, I've been thinking about something quite neat, but I'm not sure if it would be well received.

What do you guys think about implementing a Blue tunic into the game?
Take the Shield spell as an example, once you use it, Link's tunic changes to Red.
I want to do something similar but for a Blue tunic.

I'm thinking one of two things.
  • Change Shield's color tunic to Blue, and give the Red color to another spell (maybe Fire or another one, not sure). Kind of a callback to Link's Awakening DX, where the Blue tunic gives you defense, and Red tunic gives you offense.
  • Make the Shield spell turn Link's tunic blue when used when he has a Life/Defense level from 1-4, once he gets to 5 and up to 8, his tunic will be Red. This will be kind of like a callback to Zelda I and ALttP, where you get the blue tunic first before the Red.

Shadic

  • Jr. Member
  • **
  • Posts: 29
    • View Profile
Re: Zelda II Redux
« Reply #305 on: November 21, 2018, 06:42:35 pm »
I'm a fan of the first option.

Also, I feel like the Fire spell should really be buffed in some way. Travel faster, do more damage (if feasible?), and definitely hurt all enemies.

Trax

  • Sr. Member
  • ****
  • Posts: 462
    • View Profile
    • Trax ROM Hacking
Re: Zelda II Redux
« Reply #306 on: November 21, 2018, 09:47:41 pm »
I think the final scene with Link, Zelda and the Triforce uses the same data as North Castle. If it's the case, then changing palettes could be tricky.

As for the tunic's color, the Shield spell puts the value #$16 in RAM $69DE (used for when Link flashes) and $070F (used for Link's color per se). RAM $070F is also used as the condition for Shield spell's effect, which is to half the damage received from enemies. If this variable is anything other than 0, then Shield is in effect. So, changing that color is a breeze, but having two types of tunics would require a bit of ASM.

ShadowOne333

  • Hero Member
  • *****
  • Posts: 995
    • View Profile
Re: Zelda II Redux
« Reply #307 on: November 21, 2018, 09:52:23 pm »
I think the final scene with Link, Zelda and the Triforce uses the same data as North Castle. If it's the case, then changing palettes could be tricky.

As for the tunic's color, the Shield spell puts the value #$16 in RAM $69DE (used for when Link flashes) and $070F (used for Link's color per se). RAM $070F is also used as the condition for Shield spell's effect, which is to half the damage received from enemies. If this variable is anything other than 0, then Shield is in effect. So, changing that color is a breeze, but having two types of tunics would require a bit of ASM.
Yep, that's what I suspected.
I was thinking of something like:

Code: [Select]
Shield routine:
    Jump on colour original opcode -> Is life level <5? -> Branch to blue color -> Else go to original code
Should be fairly easy to do, it's just that work and New MaternalBound have been taking all of my time recently to try it out soon enough.

Btw Trax, have you tried to do something like parsing text on the overworld pause screen by any chance?

I'm a fan of the first option.

Also, I feel like the Fire spell should really be buffed in some way. Travel faster, do more damage (if feasible?), and definitely hurt all enemies.

Is the Fire spell really that weak?
I have never used it in any playthrough to be honest (like 50+% of almost all spells lol)

Jeville

  • Sr. Member
  • ****
  • Posts: 339
    • View Profile
Re: Zelda II Redux
« Reply #308 on: November 22, 2018, 03:49:18 am »
Why Fire isn't useful is because it's generally better to just bypass the Fire-required enemies via downthrusting over them instead of killing them. Fire would have use if sword collision is removed on enemies that need Fire for the downthrust bypassing to fail.
« Last Edit: November 22, 2018, 04:00:19 am by Jeville »

Trax

  • Sr. Member
  • ****
  • Posts: 462
    • View Profile
    • Trax ROM Hacking
Re: Zelda II Redux
« Reply #309 on: November 22, 2018, 08:20:11 pm »
That's a good observation, Jeville. As far as I know, there are 2 enemies that absolutely require Fire to be killed: Tektite and Zora. Not even one boss. The spell is the most skippable of all. What makes Fire weak is that, other than the two aforementioned exceptions, it doesn't damage enemies more. Any enemy immune to the Flying Blade will also be immune against Fire. The advantage of Fire is that it goes through enemies and has unlimited range.

ShadowOne, keep in mind I'm not positive on the Ending Scene thing. Maybe there's a specific block of data in Bank 5. As for Shield, yes, it's the basic logic, so it's not complicated. And for the Pause thing, I don't really have time to check it out, mostly because I'm struggling with my own Overworld things, for my hack. I do know that RAM $79 and $7A are supposed to be the offset in the Name Table(s) for Overworld redrawing.

ShadowOne333

  • Hero Member
  • *****
  • Posts: 995
    • View Profile
Re: Zelda II Redux
« Reply #310 on: November 23, 2018, 06:39:19 pm »
Well guys, I wanted to make a little challenge and attempt to do the tunic stuff today.
This is how it turned up:
https://www.youtube.com/watch?v=2gHCbqnKAiQ

Just be careful...
The FPS are dreadful ;D

So in short words, if Link's life level is between 1 and 4, the Shield spell will turn Link's tunic to blue.
If it's 5 and above, the Shield spell will instead turn Link's tunic to red.

Let me know what you guys think :)
(Don't pay attention to any delays in the flashing or any slowdowns, the game works fine, it's just my Linux computer being absolute shit handling multiple Wine instances at once).

ShadowOne, keep in mind I'm not positive on the Ending Scene thing. Maybe there's a specific block of data in Bank 5. As for Shield, yes, it's the basic logic, so it's not complicated. And for the Pause thing, I don't really have time to check it out, mostly because I'm struggling with my own Overworld things, for my hack. I do know that RAM $79 and $7A are supposed to be the offset in the Name Table(s) for Overworld redrawing.
I'm a bit confused, I didn't mention anything about changing the Ending scene (that I recall :P).
Out of that, I will see if I can come up with something for the PAUSE message on pause in the overworld.

One more thing, Trax, do you happen to know how I would go about changing the "MAGIC", "LEVEL" and the Sword icon in the HUD/HUB?
I think the tile mapping at $962E only modifies the bars themselves and the numbers which change each level, but not those words nor the sword icon.

ultimaweapon

  • Full Member
  • ***
  • Posts: 132
    • View Profile
Re: Zelda II Redux
« Reply #311 on: November 23, 2018, 11:20:33 pm »
@Trax - You are right about the final scene with Link, Zelda, and the Triforce. It does use the same palettes as the North Castle which is why it's proving to be a challenge to change. I'm going to look into your suggestion.

@ShadowOne - To be more precise, where in the hex editor do I go to modify text? I'm having a lot of trouble locating where to go.

Everyone is right about the Fire Spell, so I'm aiming to change that with my next hack and give the Fire Spell much more meaning and if possible change when you get the downward thrust so you have to fight more of the enemies that require fire.
Trust in the Heart of the Cards

Trax

  • Sr. Member
  • ****
  • Posts: 462
    • View Profile
    • Trax ROM Hacking
Re: Zelda II Redux
« Reply #312 on: November 25, 2018, 02:51:36 am »
ShadowOne, the ending thing was aimed at Ultima, but I used the wrong name. Anyway, good job with the tunic, it seems you can actually do ASM, right? :P

As for the HUD (stands for Heads Up Display) thing (you said $962E, but it's actually $162E in the ROM), there is another part in Bank 7, starting at $1D0D1. There, you have MAGIC, LIFE, NEXT, the sword tile, the magic bag tile, and the /0000 that is subsequently overwritten by whatever needs to be there. As a guide, PPU macros always use the same pattern:

AABB CC

AABB is the address to write to, big endian (AA is the most significant byte). Usually in the 2xxx range, because it's for the PPU.
CC is the number of bytes to process. Bits 6 and 7 can be used to denote either a repetition of a single byte, or whether the tiles should be layed down horizontally or vertically.

What follows is the actual bytes. All that is usually ended with FF, just to be sure.

In this specific case, there doesn't seem to be any FF, so I guess they must be processed one after the other, in one shot. The top-left corner of the screen is address $2000. Each horizontal line has 0x20 tiles (decimal 32), so the next line is $2020, then $2040, etc. Also, be careful because the level digits will not follow the tiles if you decide to change their locations.

Ultima, if you're talking about the text dialogs in Towns, the actual text data starts at $E380. Keep in mind that ShadowOne may have changed the location of at least some of the text because certain dialogs are now longer.

ShadowOne333

  • Hero Member
  • *****
  • Posts: 995
    • View Profile
Re: Zelda II Redux
« Reply #313 on: November 27, 2018, 10:24:35 am »
Oh yeah it's in 162E :P
Sorry got confused for a bit haha.

That explanation you gave was really awesome, Trax, thanks for that.
It really helped to understand how things are written and parsed into the screen, and it helped a lot to reallocate and rework the HUD with almost no issues:



That's what I have right now :)
I'm missing the diagonal slash that separates the earned experience from the next level experience, but that was just an oversight on my part I bet.
EDIT: Indeed, oversight on my part. Already fixed it, the diagonal dash is already there.


The only problem I have right now, is that white square you see next to "-LEVEL-" is not in the position I want it to.
That's the Magic tile which lowers when magic is used.
I just need to find a way to move that very tile to the correct position on top of the life meter.

Do you have any clues as to how I would go about moving that one to the correct position?

The horizontal position for those two is located at $168B and $168C.
$168B handles the Magic white bar, while $168C handles the Life red bar.
Right now I have the value at $168C set to [58], and the Life meter works properly now.
I just need to find a way to move the Magic meter bar to the above row, and that should be it.
« Last Edit: November 27, 2018, 10:45:40 am by ShadowOne333 »

Shade Aurion

  • Full Member
  • ***
  • Posts: 113
  • Shadow Keeper
    • View Profile
    • DudeGoBack
Re: Zelda II Redux
« Reply #314 on: November 27, 2018, 06:59:53 pm »
Wow, that is a really nice HUD. Nicely done.

I was messing around with HD packs today and I wonder if when this project is complete, if it could be extended into the realms of HD graphics. The Mesen core means it'd work fine in Retroarch too. I mean the core controls and mechanics are pretty tight. There are pretty easy to understand tools to do such things and i'd be willing to donate some time to making more HD sprites if you wanted to push it past the point of perfection =P

Trax

  • Sr. Member
  • ****
  • Posts: 462
    • View Profile
    • Trax ROM Hacking
Re: Zelda II Redux
« Reply #315 on: November 28, 2018, 01:18:45 am »
Don't touch the L tile in the HUD.

This tile, as innocent as it may seem, is used to synchronize Sprite Zero, which is crucial for the timing of the HUD vs. the rest of the viewport, especially when it comes to scrolling. In the screenshot above, the L tile has been moved 2 tiles to the left. If you play the entire game and are absolutely certain that noting weird happens with vertical alignment of sprites or background tiles and scrolling, then you get a pass, but it's at your own risk.

As for the white Magic square, it's actually a sprite that is drawn in the background (there's a sprite attribute for that), and serves as the last container that is not full or empty. Full and empty containers are drawn as background tiles. Same for the Life square. These sprites move leftward as you take damage or consume magic, and rightward as you gain them.

I checked the code starting from the offset you gave me, and the code that sets the two sprites is a little further, starting at $17BB. There are 4 values written in sequence starting from $02F8 (this address is in a 2-byte table just before this routine, at $17B9), using the command STA ($00),Y. First value is 0F, which is the Y position of the sprites. This is your problem. The original game uses the same Y position for both. Your setup doesn't.

Second value is the tile code, taken from $1689 (70) or $168A (6E), depending of whether you're drawing Life or Magic. Third value is 0x21, which is the sprite attributes, and it sets the palette to 01 and activates the flag to draw the sprite in the background. Fourth value is the X position, taken from $168B or $168C, plus the value of the last unit of the meter.

Ideally, you'd have to rewrite the routine in a way that swaps the operations for X and Y positions. Your case has X position the same for both, so it would be hard-coded, and Y position different for each meter, so it would be taken from the table.

ShadowOne333

  • Hero Member
  • *****
  • Posts: 995
    • View Profile
Re: Zelda II Redux
« Reply #316 on: November 30, 2018, 12:08:09 pm »
Don't touch the L tile in the HUD.

This tile, as innocent as it may seem, is used to synchronize Sprite Zero, which is crucial for the timing of the HUD vs. the rest of the viewport, especially when it comes to scrolling. In the screenshot above, the L tile has been moved 2 tiles to the left. If you play the entire game and are absolutely certain that noting weird happens with vertical alignment of sprites or background tiles and scrolling, then you get a pass, but it's at your own risk.
I believe Shadow of Night also moves the L to the left a bit, but from what I've tested I haven't seen any particular issues so far related to sprites or backgrounds and scrolling.
Is there any particular thing I should look out for?
Like some sort of behaviour if the issue does pop up?

As for the white Magic square, it's actually a sprite that is drawn in the background (there's a sprite attribute for that), and serves as the last container that is not full or empty. Full and empty containers are drawn as background tiles. Same for the Life square. These sprites move leftward as you take damage or consume magic, and rightward as you gain them.

I checked the code starting from the offset you gave me, and the code that sets the two sprites is a little further, starting at $17BB. There are 4 values written in sequence starting from $02F8 (this address is in a 2-byte table just before this routine, at $17B9), using the command STA ($00),Y. First value is 0F, which is the Y position of the sprites. This is your problem. The original game uses the same Y position for both. Your setup doesn't.

Second value is the tile code, taken from $1689 (70) or $168A (6E), depending of whether you're drawing Life or Magic. Third value is 0x21, which is the sprite attributes, and it sets the palette to 01 and activates the flag to draw the sprite in the background. Fourth value is the X position, taken from $168B or $168C, plus the value of the last unit of the meter.

Ideally, you'd have to rewrite the routine in a way that swaps the operations for X and Y positions. Your case has X position the same for both, so it would be hard-coded, and Y position different for each meter, so it would be taken from the table.

Tried looking at the code.
I haven't come up with anything yet for it, I am trying to wrap my head around it first and see what I can do about it.
In the meanwhile, I tried looking at the same portion of code from Shadow of Night, to give me an idea on how that hack does it, but I couldn't find any difference in that particular part of the code, it seems the same as in vanilla Zelda II, so perhaps SoA does it in a different way.
I will try to continue studying the code and also try to find how SoA does it, whichever of the two ways manages to work or comes first :P



As for a little side-track, I tried to jump the gun and attempted to completely redraw the HUB yet again to something much more nice to the eye (and more close to the rest of the series).

This is a quick comparison of what I could do in-game compared to what my mockup was:

                       In-game                             /                         Mockup




Now there are some particular problems in this:
  • The same issue with one of the meter bars moving only in an X position
  • The PPU tilemap for the life meter is tied with the Exp zeroes. This is why they always tend to show up right next to each other.
  • The PPU tilemap for the magic meter is tied with the number for the Life level, hence why the magic bar begins at the very edge of the screen in my test.
  • Given the previous issue with the Magic meter, the "M" might disappear due to overscan and on CRT monitors.

I tried to locate the part of the code where it loads the tables for the tile mappings, and found it at $16BD and $172E.
So, went ahead and reimplemented the tilemaps for those two in free-space, and tried separating them into proper tile maps in the AA BB XX format for each section, but i think this goes way beyond that, since the code I believe expects them to be right next to each other and with a set number of bytes, otherwise they won't be separated from each other.

Now, I will not continue with this attempt for a HUB redraw, I will only continue trying to move the magic square that keeps track of the magic number for the current HUB I showed a couple of post back.
No biggie here, I am not attempting this after this test since it is SO much work assembly-side, it's not even worth it, I just wanted to do it for fun and see how far I could go.

I am happy with just implementing the one I showed previously haha.



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


Now with that said, guys, I decided to finally jump into the sprite editing stuff and redo some graphics for the game while still retaining their original look.
For example, I tried to be faithful to Link's original design, but retouch it in a way that makes it look much better than in vanilla Zelda II. He now has his yellow-ish stripe on his hat, his clothes closely resemble his original artwork and his sword no longer looks like a chicken drumstick.

For starters, I redid the title screen sword:



I took inspiration from the one in the "New Link Sprite" hack, but I redid it in a way that is much more close to the original artwork (original had 4 red gems in the hilt, with a big one on top).
Now there is one more think I am thinking about doing to the title screen, and that is perhaps changing the grey hue of the stones to something like Rev Edition, with a more deep brown, I feel like that colour scheme is better to the eyes than the dull grey the game uses by default. This would also make the sword stand out and pop out a lot more.
What do you guys think?


For Link, I already retouched his whole sprite sheet, all I need now is to define a shield design for Link.
I tried to go for the original Link's artwork shield design, but it looks odd when implemented into the game (image #2).
All in all, I did 3 different designs for the shield:



I would like to know which shield you guys like the most.
I'm leaning towards the first one (brown shield with beige cross), the second one is the closest I could get to the original artwork (but doesn't look as good to me), and the third one who the fuck knows, I just did it for giggles.

So please, let me know what do you guys think about the possible changes to the title screen palette and to Link's shield.
« Last Edit: November 30, 2018, 12:41:16 pm by ShadowOne333 »

Sara-chan

  • RHDN Patreon Supporter!
  • Jr. Member
  • *****
  • Posts: 86
  • Divine Blade
    • View Profile
    • Sara's Homepage
Re: Zelda II Redux
« Reply #317 on: November 30, 2018, 12:34:58 pm »
Personally think the first shield looks best.
In a sky full of people, only some want to fly.
Isn't that crazy?

ultimaweapon

  • Full Member
  • ***
  • Posts: 132
    • View Profile
Re: Zelda II Redux
« Reply #318 on: November 30, 2018, 01:02:32 pm »
@ShadowOne

The title screen does look good. Any other changes to it would be an added bonus.

Your mock up of the HUD is be excellent if you can successfully make it happen.

The 1st shield is the best looking one.


@Trax

Thanks to your disassembly, I was able to find the palettes for the final room where you wake up Zelda.


Trust in the Heart of the Cards

jimstrom

  • Jr. Member
  • **
  • Posts: 33
    • View Profile
Re: Zelda II Redux
« Reply #319 on: November 30, 2018, 03:13:43 pm »
I have to agree the first one look awesome!