It is currently Tue Jul 16, 2019 5:57 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Sun Jun 30, 2019 5:28 am 
Offline

Joined: Sun Jun 16, 2019 7:00 am
Posts: 9
It sounds like a possible solution. Thank you, Xamboni-san!

xamboni wrote:
Quote:
Oh, thank you! It sounds like progress. I do want a fifth row
after 0-9 and that's where I wish to put the Swedish
characters.


Right I get you on that I will give it another go. Worst case though we change the box to be wider left and right by one column. Then we can move the A letter left and shift the rest of the letters back one space like a snake. You would then have 5 extra spaces for new letters to be used.

I plan on finding the vertical wrap though so probably a moot point. I should probably test the horizontal addition and see if it correctly takes what is in the new row and puts it in for the name.


Top
 Profile  
 
PostPosted: Tue Jul 09, 2019 10:18 pm 
Offline

Joined: Sat Apr 27, 2019 11:56 am
Posts: 23
Ok I found the extra row test so I think the Zelda 1 problem is under control now. In the European version of the game the vertical cursor test is done at location 0x9e13. Note this is a static address rather than runtime memory.

The game will do a memory compare on the cursor's RAM location against this address. On each cursor move 0x10 is added to the RAM address holding the cursors location. This result after the add is compared to the contents of 0x9813. If you add 0x10 to 0x9813 you will see the cursor move down another row before it resets to the beginning.

My modified binary now has the byte sequence 0x23 0x30 0x10 0xd7 0x87 0xf0 0x77 0xb7 around the important locations. Let me know if you have any questions or if I made any mistakes. There are a ton of changes in my modified binary so I might have things a bit backwards here. Next time I sit down I'll work with a clean binary to test the changes.

edit: I should have mentioned the important byte in the above sequence is 0xd7. The original game vertical max is 0xc7.


Top
 Profile  
 
PostPosted: Wed Jul 10, 2019 1:08 pm 
Offline

Joined: Sun Jun 16, 2019 7:00 am
Posts: 9
Thank you so very much, Xamboni-san! ^_^

I feel a bit stupid because I'm not sure I understand, but should
I go to 0x9e13 and enter the byte sequence there? Will that add
the Swedish characters as well or do I have to add them to a
table somewhere else?

xamboni wrote:
Ok I found the extra row test so I think the Zelda 1 problem is under control now. In the European version of the game the vertical cursor test is done at location 0x9e13. Note this is a static address rather than runtime memory.

The game will do a memory compare on the cursor's RAM location against this address. On each cursor move 0x10 is added to the RAM address holding the cursors location. This result after the add is compared to the contents of 0x9813. If you add 0x10 to 0x9813 you will see the cursor move down another row before it resets to the beginning.

My modified binary now has the byte sequence 0x23 0x30 0x10 0xd7 0x87 0xf0 0x77 0xb7 around the important locations. Let me know if you have any questions or if I made any mistakes. There are a ton of changes in my modified binary so I might have things a bit backwards here. Next time I sit down I'll work with a clean binary to test the changes.

edit: I should have mentioned the important byte in the above sequence is 0xd7. The original game vertical max is 0xc7.


Top
 Profile  
 
PostPosted: Wed Jul 10, 2019 5:37 pm 
Offline

Joined: Sat Apr 27, 2019 11:56 am
Posts: 23
Quote:
I feel a bit stupid because I'm not sure I understand, but should
I go to 0x9e13 and enter the byte sequence there? Will that add
the Swedish characters as well or do I have to add them to a
table somewhere else?


No reason to feel stupid my man. I am sure I skipped a ton of steps in my explanation and as always I am still learning too.

Adding in the Swedish characters is probably the easier part of this so I didn't address it too much yet. In an earlier post I believe there was a picture showing the additional letters you want are doable so we can go over that later. First lets confirm the cursor now behaves the way you want.

You will need a hex editor in order to review the bytes I posted earlier. I pulled up a page on wikipedia which shows a few options for you. BeyondCompare is available on multiple platforms and requires a license but you can use their trial period for a bit. HxD (Windows) and Bless (Linux) are two others that I can say will get the job done.

    1. Make a copy of your European ROM.
    2. Open up the copy inside of your hex editor of choice.
    3. Confirm you are looking at a ton of game data and code (Hex bytes). The first 3 bytes are 0x4e 0x45 0x53 which spells NES in ascii characters.
    4. Either search for the byte pattern I listed (233010c787f0) or navigate to address 0x9e13. If your hex editor shows addresses in decimal rather than hexadecimal then it is 40467.
    5. Change the byte c7 to d7, save the file change, and load the game in an emulator. In BeyondCompare if you load the original game in the left pane and the copy in the right when doing a hex comparison (File->NewSession->HexCompare) then your change will be obvious.
    6. See if the menu is behaving the way you want.

Sorry for the typo in my last post. 0x9813 should be 0x9e13.


Top
 Profile  
 
PostPosted: Fri Jul 12, 2019 7:08 am 
Offline

Joined: Sun Jun 16, 2019 7:00 am
Posts: 9
Wow, it's really cool that a tiny change like that can
cause a big difference. Now it's like I wished for.

The cursor didn't move to the bottom when I moved
it to the top character and pressed up, but I guess
you will figure that out as well.

Thank you a lot, Xamboni-san!

Have a nice day!

xamboni wrote:
Quote:
I feel a bit stupid because I'm not sure I understand, but should
I go to 0x9e13 and enter the byte sequence there? Will that add
the Swedish characters as well or do I have to add them to a
table somewhere else?


No reason to feel stupid my man. I am sure I skipped a ton of steps in my explanation and as always I am still learning too.

Adding in the Swedish characters is probably the easier part of this so I didn't address it too much yet. In an earlier post I believe there was a picture showing the additional letters you want are doable so we can go over that later. First lets confirm the cursor now behaves the way you want.

You will need a hex editor in order to review the bytes I posted earlier. I pulled up a page on wikipedia which shows a few options for you. BeyondCompare is available on multiple platforms and requires a license but you can use their trial period for a bit. HxD (Windows) and Bless (Linux) are two others that I can say will get the job done.

    1. Make a copy of your European ROM.
    2. Open up the copy inside of your hex editor of choice.
    3. Confirm you are looking at a ton of game data and code (Hex bytes). The first 3 bytes are 0x4e 0x45 0x53 which spells NES in ascii characters.
    4. Either search for the byte pattern I listed (233010c787f0) or navigate to address 0x9e13. If your hex editor shows addresses in decimal rather than hexadecimal then it is 40467.
    5. Change the byte c7 to d7, save the file change, and load the game in an emulator. In BeyondCompare if you load the original game in the left pane and the copy in the right when doing a hex comparison (File->NewSession->HexCompare) then your change will be obvious.
    6. See if the menu is behaving the way you want.

Sorry for the typo in my last post. 0x9813 should be 0x9e13.


Top
 Profile  
 
PostPosted: Fri Jul 12, 2019 3:27 pm 
Offline

Joined: Sat Apr 27, 2019 11:56 am
Posts: 23
Quote:
The cursor didn't move to the bottom when I moved
it to the top character and pressed up, but I guess
you will figure that out as well.


Hmmmmm mine was working both ways as intended. Maybe I made two changes that fixed both ways and didnt realize it from my notes. I'll boot it up soon-ish and see what is going on.


Top
 Profile  
 
PostPosted: Fri Jul 12, 2019 9:50 pm 
Offline

Joined: Sat Apr 27, 2019 11:56 am
Posts: 23
Well when you are right you are right. The second change must have slipped my mind. I made two changes to account for going up as well.

0x9e13: 0xc7 -> 0xd7
0x9e17: 0xb7 -> 0xc7


Top
 Profile  
 
PostPosted: Fri Jul 12, 2019 11:29 pm 
Offline

Joined: Sat Apr 27, 2019 11:56 am
Posts: 23
I looked into the other parts of the equation here and it seems we might be looking at a bit more difficulty. I added a new row of letters into the games background code locations. Unfortunately this throws off some pointers for the initial Zelda splash screen so we will have to fix that math. Also when the cursor selects a location it does not use what is there per se. We will have to identify that dereference and fix it up. As a first test I moved the cursor to the new row and instead of the zero I put there it loaded an 'x' into my name.

If you would like to play around with the backgrounds on the enter name menu look at address 0x1a1fe. You will see a clear pattern of number bytes (0x0#) and black bytes (0x24) alternating. For example that particular row begins with the numbers 0-9. In hex we see 0x00 0x24 0x01 0x24 0x02 0x24...

You can add another row by adding the bytes 0x23 0x26 0x13 0x00 0x24 0x01... at location 0x1a211. This breaks the game due to relative offsets found throughout the code. As an easy way of fixing this I removed bytes starting at 0x1ad80. Those bytes are filler 0xff's so they are probably not used for anything. If you add in the byte pattern I listed about (0x23 0x26... ) you need to remove the exact same amount of 0xff's from the padding section.

Let me know if you have any questions. As long as you keep the byte count the same you can modify things as much as you want to get it cosmetically looking like swedish letters in the final row.


Top
 Profile  
 
PostPosted: Sun Jul 14, 2019 7:08 am 
Offline

Joined: Sun Jun 16, 2019 7:00 am
Posts: 9
There are two offsets where one can change to replace ! with Å for example. I know where, but I have my notes at home and I will return tomorrow. Unless I borrow my friends computer here.

xamboni wrote:
I looked into the other parts of the equation here and it seems we might be looking at a bit more difficulty. I added a new row of letters into the games background code locations. Unfortunately this throws off some pointers for the initial Zelda splash screen so we will have to fix that math. Also when the cursor selects a location it does not use what is there per se. We will have to identify that dereference and fix it up. As a first test I moved the cursor to the new row and instead of the zero I put there it loaded an 'x' into my name.

If you would like to play around with the backgrounds on the enter name menu look at address 0x1a1fe. You will see a clear pattern of number bytes (0x0#) and black bytes (0x24) alternating. For example that particular row begins with the numbers 0-9. In hex we see 0x00 0x24 0x01 0x24 0x02 0x24...

You can add another row by adding the bytes 0x23 0x26 0x13 0x00 0x24 0x01... at location 0x1a211. This breaks the game due to relative offsets found throughout the code. As an easy way of fixing this I removed bytes starting at 0x1ad80. Those bytes are filler 0xff's so they are probably not used for anything. If you add in the byte pattern I listed about (0x23 0x26... ) you need to remove the exact same amount of 0xff's from the padding section.

Let me know if you have any questions. As long as you keep the byte count the same you can modify things as much as you want to get it cosmetically looking like swedish letters in the final row.


Top
 Profile  
 
PostPosted: Sun Jul 14, 2019 10:09 am 
Offline

Joined: Sat Apr 27, 2019 11:56 am
Posts: 23
Quote:
There are two offsets where one can change to replace ! with Å for example. I know where, but I have my notes at home and I will return tomorrow. Unless I borrow my friends computer here.


Not quite sure what you mean but if you get something working let me know what changes you made and I will test them out.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2

All times are UTC - 7 hours


Who is online

Users browsing this forum: GreyRogue and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group