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

Author Topic: [NES] The Legend of Zelda (Italian)  (Read 7783 times)

snarfblam

  • Submission Reviewer
  • Hero Member
  • *****
  • Posts: 589
  • CANT HACK METROID
    • View Profile
    • snarfblam
Re: [NES] The Legend of Zelda (Italian)
« Reply #20 on: May 01, 2011, 10:57:43 pm »
Well... in order for the game to access the data, it needs to bank it into CPU address space. The ROM is divided into 16KB ($4000 byte) banks. It can load one at $8000, and one at $C000.

For example, when accessing data between 0x4010 and 0x800F in the ROM (bank 1), that range of data is banked it at $8000-$BFFF in RAM. To convert a ROM offset to a pointer value, you subtract the bank offset (0x4010), and add the CPU address the bank is loaded to ($8000).

If you want a pointer to 0x405C in the ROM, you get 405C-4010+8000 = $804C.

MattDragon

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: [NES] The Legend of Zelda (Italian)
« Reply #21 on: May 05, 2011, 11:14:21 am »
Thx a lot, I'd never find it out alone!

MattDragon

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: [NES] The Legend of Zelda (Italian)
« Reply #22 on: May 15, 2011, 06:39:54 am »
Guys, one of my last questions (i hope!). I have to modify the last sentences of the game (Finally, peace returns to Hyrule. This ends the story, Another quest will start from here, etc...), but i have no idea how the game know when it has to write the first row, the second row, etc... (for example, "Finally" is in the first row and "peace" is in the second). Which byte is supposed to be modified to change this pattern? Thx a lot!!!

snarfblam

  • Submission Reviewer
  • Hero Member
  • *****
  • Posts: 589
  • CANT HACK METROID
    • View Profile
    • snarfblam
Re: [NES] The Legend of Zelda (Italian)
« Reply #23 on: May 15, 2011, 02:24:32 pm »
Code: [Select]
02:AB53:AC 13 04  LDY $0413         ; Load char index
02:AB56:B9 08 AB  LDA $AB07,Y       ; (*)Load letter
02:AB59:C9 FF     CMP #$FF          ; FF indicates end of text
02:AB5B:F0 1F     BEQ $AB7C         
02:AB5D:8D 05 03  STA $0305         ; Write to memory (patched into a PPU string)
02:AB60:C9 24     CMP #$24          ; Is it a space?
02:AB62:F0 05     BEQ $AB69         

02:AB64:A9 10     LDA #$10          ;     If not, play a "blip" sound
02:AB66:8D 04 06  STA $0604         

02:AB69:EE 13 04  INC $0413         ; Increment index
02:AB6C:B9 D3 AA  LDA $AAD3,Y       ; (*)Get positioning byte
02:AB6F:8D 03 03  STA $0303         ; Write to memory (patched into PPU string)

02:AB72:C9 A0     CMP #$A0          ; Is the position byte < #$A0?
02:AB74:B0 05     BCS $AB7B

02:AB76:A9 23     LDA #$23          ; If so, change the high byte of the PPU address
02:AB78:8D 02 03  STA $0302 = #$FF

02:AB7B:60        RTS

02:AB7C:E6 13     INC $0013 = #$03  ; When the end of text is reached, $13 is incremented
02:AB7E:60        RTS

The lines I've marked with asterisks are the lines where data is read from. I'm sure you've found $AB07. The other important one is $AAD3 (0xAAE3 in the ROM). Each letter at $AB07 has a corresponding byte at $AAD3 that tells the game where to write the letter (it is the low byte of the PPU address it will be written to).

Add or subtract 1 to move a letter left or right. Add or subtract 20 to move a letter up or down.
« Last Edit: May 16, 2011, 08:10:24 am by snarfblam »

MattDragon

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: [NES] The Legend of Zelda (Italian)
« Reply #24 on: May 16, 2011, 09:25:26 am »
Perfect, thx you!!!

MattDragon

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: [NES] The Legend of Zelda (Italian)
« Reply #25 on: May 31, 2011, 05:06:16 pm »
Guys, I finally finished my translation!!! I couldn't do it without you, snarfblam and Trax. I really appreciated your availability and your kindness. I will put your names in the readme.txt that i will release with the patch! Thx for all your patient!