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

Author Topic: My First Hack. Zelda 1. Several questions  (Read 3440 times)

Shadoo

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
My First Hack. Zelda 1. Several questions
« on: April 25, 2020, 05:37:49 am »
as the title said this is my first hack project and I thought I start easy. The goal is to play as Dark Link instead of Link that's it. So basically just swap Links colors (skin and clothes) to black with maybe the exception of giving him red eyes and perhaps a red (or gray) outline so he wont be completely invisible in dark caves.

here a some images to help I will refer to them later
https://imgur.com/a/xiVXMhO

I watched some tutorials and quickly found the following method using fceux -> debug -> ppu viewer looking for the colors that seem to be Link -> found a black panel for transparency followed by light green and 2 brown tones yep that should be Link -> writing the numbers down 29 27 17 -> debug again -> hex editor -> view -> rom file -> ctrl+f 29 27 17

Question 1: I found many instances I am sure not only link but also links sword for example, see image 2. How can I figured out which are actually Link? Not that important since coloring the sword black seems cool anyway

I replaced every 29 27 17 to 0F 0F 0F saved and reloaded the result was Link if fact turned black but clothes did not see image 1 and 2.

I think I know why this is the case: In Zelda 1 you can find 2 rings that change the color of Links clothes from green to light blue and finally to red. Now what I think happens is that I indeed changed the color of the clothes but afterwards they got overwritten again to green because I didn't have the 2 rings. And more importantly I have to stay black when I find the rings aswell.

Question 2: Is my assumption correct or close? And how could I fix that?

I had my own not so cool way to overcome that problem using Tile Layer Pro I was again following tutorials to change the pixels, I had to do that anyway for my outline idea, see image 2. So I loaded the ROM in TLP and after some scrolling and eyes squinting I finally found the correct images, see image 4.

Question 3: is there a more elegant way to find Links Images? I am sure I overlooked some and it was pretty hard to find these

so I recolored Link using only the two brownish colors having him just black and red and therefor not needing his clothes color but I will be in trouble if I need 3 colors. After recoloring everything I gave it a go and the result is image 3. Not bad so far in fact Id consider its almost done but as you can see there are some ugly lines at the top of Link and its half the latter using his green color. As you can see in image 4 they should not be there. I have absolutely no explanation for that so..

Question 4: Has anyone an idea how that happened and how I could fix this?


Trax

  • RHDN Patreon Supporter!
  • Hero Member
  • *****
  • Posts: 571
    • View Profile
    • Trax ROM Hacking
Re: My First Hack. Zelda 1. Several questions
« Reply #1 on: April 28, 2020, 05:47:43 pm »
The colors for Link's clothes are hard to track. Try offset 0x6B95 (+ 0x10 for ROM header), you'll see 3 values : 29 32 16, which correspond to one of Link's colors for Standard, Blue Ring and Red Ring, respectively.

Hasmal

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: My First Hack. Zelda 1. Several questions
« Reply #2 on: April 28, 2020, 07:57:08 pm »
Hi Shadoo. You will need to shift the tiles down one pixel. I use a different tile editor (YY-CHR), so I couldn't tell you exactly how it's done in Tile Editor Pro, but you should be able to. Also, viewing it in 8x16 mode will help you. Your tile editor window should look like this:

https://imgur.com/a/Y1mghT7

In addition to offset 6B95, you might need to change A287. This information is available in the Data Crystal Legend of Zelda ROM map. Have fun!

Shadoo

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Re: My First Hack. Zelda 1. Several questions
« Reply #3 on: April 29, 2020, 03:31:32 am »
I am happy for the reply but please remember I am a beginner and could need some more step by step help. I am not even sure if you refer to FCEUX or some other program. Using FCEUX and playing around a little I found windows with the title offset 0x000000 so I guess I am close? But I have no idea how to try " offset 0x6B95 (+ 0x10 for ROM header)"


Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 530
  • I am the baldest romhacker
    • View Profile
Re: My First Hack. Zelda 1. Several questions
« Reply #4 on: April 29, 2020, 01:26:58 pm »
Fceux - hex editor - view - rom file - ctrl+g - 6BA5 - enter. Change bytes and reset game.

Header is first 16 bytes at the beginning, used for emulators.

Basically any hex editor will do.
iromhacker.ru - NES ROM hacking tutorials for beginners. Please use Google Translate browser extension

Shadoo

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Re: My First Hack. Zelda 1. Several questions
« Reply #5 on: April 29, 2020, 03:10:01 pm »
I am confused I followed the instructions with a fresh new Zelda 1 ROM. Using ctrl+g 6ba5 I found the numbers 29 32 16 and replaced them with 0f 0f 0f saved loaded -nothing changed. I tried combining this new method with my first attempt replacing every instance of 29 27 17 to 0f 0f 0f saved loaded and the same as before a black link with green clothes. Also tried it with 0d 0d 0d same result.

Edit: I overlooked Hasmals last sentence I indeed had to change A287 aswell. now it works and I play as a pitch black Link. Time for step two and give him an outline and red eyes.

And about changing the tiles I tried using yy chr and it looked very different. I tried loading my first attempt with the tiles changed into a 2 color pattern and it seems there were still some pixels with the unused color - very strange I tried to override it once more but I couldn't figure out how to create a preview like in TLP so I messed it up. I also couldn't figure out how to get the 8x16 mode in any of the 2 programs if someone could explain that part one more time that would be great. I am fine with using yy chr or TLP as long as it works.
« Last Edit: April 29, 2020, 04:53:49 pm by Shadoo »

Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 530
  • I am the baldest romhacker
    • View Profile
Re: My First Hack. Zelda 1. Several questions
« Reply #6 on: April 30, 2020, 12:23:10 am »
In yy-chr selecting 8x16 is right below 2bpp nes option
iromhacker.ru - NES ROM hacking tutorials for beginners. Please use Google Translate browser extension

Shadoo

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Re: My First Hack. Zelda 1. Several questions
« Reply #7 on: April 30, 2020, 04:42:37 am »
In yy-chr selecting 8x16 is right below 2bpp nes option

Hmm weird I thought I tried that and it didn't work but today it did work oh well maybe a little overworked. Anyway I tried it again this time, now that that I am able to change Links clothes colors, changing the tiles so that Links clothes will be the outline, Links original skin will be Dark Links skin and 90% of equipment and Links hair/small details will be Dark Links eyes. Without changing the hex codes for now so I expected a light brown Link with a green outline and dark brown eyes.

But the result again had this line in the middle and this time 2 dots above Link. Also while changing the tiles I realized some pixels make no sense like a weird line or 2 random pixels under Links foot. I just painted over them maybe that was a mistake. Is this what Hasmal meant with "You will need to shift the tiles down one pixel.". Because I was wondering about that.

Now what does that mean? when I have the 8x16 view how can I imagine the final image? Must I imagine the last line to be on top? Does this count only for the image itself or for the next Link? I hope this question makes sense kinda hard to describe.

https://imgur.com/a/SooRLkd

Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 530
  • I am the baldest romhacker
    • View Profile
Re: My First Hack. Zelda 1. Several questions
« Reply #8 on: April 30, 2020, 01:06:52 pm »
Not sure what you mean. You can open another copy of the program and play around via moving tiles the way you imagine them. Not much difference compare to 8x8.

Anyway, time to get rid of that line on the body. Open code/data logger and ppu viewer in fceux. In the game go somewhere when you have that line on you, also prefebably there is no other sprites in the screen but yourself. Launch logger and activate mask unused graphics checkmark in ppu viewer. There will be shown only sprites which are currently using by the game. Find these in yy-chr and edit. And don't hesitate to cut half of his body if you need to for testing, just make backups beforehand.
iromhacker.ru - NES ROM hacking tutorials for beginners. Please use Google Translate browser extension

Shadoo

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Re: My First Hack. Zelda 1. Several questions
« Reply #9 on: April 30, 2020, 02:41:09 pm »
Interesting very Interesting.

https://imgur.com/a/kPV6jp3

it seems the game is indeed only using the tiles I changed but when I watch very carefully the tiles seem different. For example the head piece I highlighted in YY does seem to have an extra line of pixels above it and lacking the last line from below in fceux ppu viewer. I can even see the little dot. Now I am convinced the problem is what Hasmal meant. But I still don't know where the line comes from.

I also just realized that the image Hasmal sent Still looks different from my YY view of the original Zelda 1 as seen in my 4th post.
« Last Edit: April 30, 2020, 03:55:40 pm by Shadoo »

Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 530
  • I am the baldest romhacker
    • View Profile
Re: My First Hack. Zelda 1. Several questions
« Reply #10 on: April 30, 2020, 04:28:03 pm »
What do you mean you still don't know? Keep deleting until it dissapears
iromhacker.ru - NES ROM hacking tutorials for beginners. Please use Google Translate browser extension

Zynk

  • Hero Member
  • *****
  • Posts: 931
  • WIP Roll-chan: The Wily Wars
    • View Profile
Re: My First Hack. Zelda 1. Several questions
« Reply #11 on: May 01, 2020, 01:49:26 am »
Have you tried either clicking the "-" or "+" buttons? Clicking "-" until the letters appear whole, then edit the sprites.

« Last Edit: May 01, 2020, 02:13:14 am by Zynk »

Shadoo

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Re: My First Hack. Zelda 1. Several questions
« Reply #12 on: May 01, 2020, 07:21:59 am »
Oh my god that was it! The missing link! That was what Hasmal was trying to tell me in his first post.

https://imgur.com/a/vEtvucF

image 1 and image 2 demonstrate the difference now it all makes so much sense and also it was way easier to change the tiles now that they are displayed the correct way.

Now changing the tiles again and recoloring everything including the clothes and the result is image 6. Id consider it is done my first rom hack! (with some help of course). There are still some bugs to fix though. Maybe you can help me again.

The first thing is when I pick up items and Link makes his signature "holding the item up" gesture half of him is still his regular green colors or at least color scheme. I tried to find these tiles but I just cant. The other Link tiles were close to each other and not that hard to find but these 2 I just cant. I tried using the Open code/data logger and ppu viewer in fceux method in hope to find the tiles. See image 3 the two tiles should be in the center image 4 is zoomed in. Now is there a way to find these tiles now?

Another thing is shown in image 5 the 3 links on the menu when you select your savegame. I already figured these 3 links do not have the ingame color scheme of 00 29 27 17 but instead 00 29 27 07. The problem is in the hex code there is exactly one instance of 29 27 07 so I changed them into the red black scheme I use for the ingame model and the result is that only the first of the 3 Links got new colors. Again I have no idea how this happened.

About Links clothes colors I figured I only have to change A287   and not 6B95. I thought maybe one is for ingame and one for menu but nope it seems A287   is both. Now I of course wonder what 6B95 manages but that is just curiosity not that important right now. Also could someone explain to me why I have to go to the next line (instead of 6B95 the numbers are at 6BA5) just so I get a better understanding.

And finally it might be better to put images directly instead of keep referring to image 4 and image 5 and so on. But I didn't figure how to simply insert one image could someone explain that to me?

Zynk

  • Hero Member
  • *****
  • Posts: 931
  • WIP Roll-chan: The Wily Wars
    • View Profile
Re: My First Hack. Zelda 1. Several questions
« Reply #13 on: May 01, 2020, 09:23:26 am »
Another thing is shown in image 5 the 3 links on the menu when you select your savegame. I already figured these 3 links do not have the ingame color scheme of 00 29 27 17 but instead 00 29 27 07. The problem is in the hex code there is exactly one instance of 29 27 07 so I changed them into the red black scheme I use for the ingame model and the result is that only the first of the 3 Links got new colors. Again I have no idea how this happened.

And finally it might be better to put images directly instead of keep referring to image 4 and image 5 and so on. But I didn't figure how to simply insert one image could someone explain that to me?
If you found the 1st Link's palette its hex is [29 27 07], the 2nd and 3rd Links' palette are just following the 1st having [27 07] as editable. [29] seems to be hardcoded, if I'm not mistaken.


NesDraug

  • Full Member
  • ***
  • Posts: 145
    • View Profile
Re: My First Hack. Zelda 1. Several questions
« Reply #14 on: May 02, 2020, 02:14:41 am »
Posting because I'm also working on my first Zelda hack and I also have questions. But also answers!

I made a small tutorial on editing sprites a while ago, sorry I didn't see this thread earlier.

https://youtu.be/K4IGKXQ2Zl0

I've also found a way to change Links colors. Go to: 0000A297 - the color of Links tunic.
Hello! You found my shop of strange and wonderful things!
https://www.tumblr.com/blog/nesdraug

Shadoo

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Re: My First Hack. Zelda 1. Several questions
« Reply #15 on: May 02, 2020, 06:35:29 am »
Hehe this video was VERY helpful. The main sprites, colors clothes and the "+" and "-" I already found thanks to other helpful members but your video showed me it is possible to display more than 8x8 pixels makes editing even easier. Also thanks to the video I finally found the "Link holds up items" sprite and the sideway sword two of the things I didnt find yet.

I am very grateful for the help but it would actually be even better if you could help me figuring these things out by myself so I dont have to ask for every bit. For example it is nice Zynk showed me where I can edit the three Links at the menu (it worked btw so another bug fixed) but when I have a similar question I still dont know how to do it myself.

Right now Im playing the game as Dark Link I figured I changed many colors not only Link but also some merchants, the boomerang the basic sword and so on. In fact it looks surprisingly good even the merchants do look like hooded figures - kinda fitting. But now I found the white sword and it is.. well white doesnt look so good. Using ppu I figured the color code should be 02 22 30. But this time there are like 20 instances of this combination. Of course I could try and error but maybe there is a better way?

Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 530
  • I am the baldest romhacker
    • View Profile
Re: My First Hack. Zelda 1. Several questions
« Reply #16 on: May 02, 2020, 06:59:22 am »
Use code/data logger to filter unused instances
iromhacker.ru - NES ROM hacking tutorials for beginners. Please use Google Translate browser extension

Shadoo

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Re: My First Hack. Zelda 1. Several questions
« Reply #17 on: May 02, 2020, 08:58:31 am »
Again I am afraid I need more step by step help. Like how do I come from the load / data logger to find out the adress of the colors for the white sword?

Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 530
  • I am the baldest romhacker
    • View Profile
Re: My First Hack. Zelda 1. Several questions
« Reply #18 on: May 03, 2020, 02:38:20 am »
Logger logs bytes which were read by game code, they have blue color in hex editor - rom file, other are black if not used.

So when logger catches game on loading sword colors, you don't need to check all instances, just the blue ones.
iromhacker.ru - NES ROM hacking tutorials for beginners. Please use Google Translate browser extension

Shadoo

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Re: My First Hack. Zelda 1. Several questions
« Reply #19 on: May 03, 2020, 09:25:12 am »
So I started the game was in overworld equipped with the now magical sword and a magical boomerang. When I open ppu viewer I figure the colors for the magical sword should be 16 27 30 and the boomerang 02 22 30.

I now open Code/Data Logger and press the start button in the middle. I now play the game and use my sword and boomerang several times no enemies on the screen not leaving the screen. Next I open hex editor and set view to rom file. I indeed find many numbers colored blue a huge chunk of them pretty early. But when I do ctrl+f -> 16 27 30 I can not find any combination of these 3 numbers in blue they are all black and come way after the huge blue number chunk. Same goes for the 02 22 30.

Did I do something wrong or does Zelda 1 load things a little differently? Also both number pattern had so many instances that try and error seems to be no option anymore.