Author
|
Topic: [NES] The Legend of Zelda (Italian) (Read 1 times)
|
snarfblam
Guest
|
|
« Reply #15 on: April 21, 2011, 05:22:23 pm » |
|
I don't follow. Sorry if I'm not being clear, or if I'm misunderstanding you.
The level number is part of a larger macro. In the original game we have the macro, in ROM: 20 42 07 15 0E 1F 0E 15 62 01 FF PpuDest Len L E V E L __ 1 end
What the game does is load this into RAM at $681C, but as part of a larger, containing chunk of data. Then, when you enter a level, it writes the level number to $6825, overwriting the "1" with the level number. For instance, in level 4... 20 42 07 15 0E 1F 0E 15 62 01 FF PpuDest Len L E V E L __ 1 end --becomes-- 20 42 07 15 0E 1F 0E 15 62 04 FF PpuDest Len L E V E L __ 4 end
Finally, this macro is fed to the PPU. But the level number is not its own macro.
|
|
|
|
Trax
Guest
|
|
« Reply #16 on: April 22, 2011, 10:06:01 am » |
|
Yeah, now I see exactly what you mean... I just wanted to be sure of the mechanics at work...
|
|
|
|
MattDragon
Guest
|
|
« Reply #17 on: April 23, 2011, 06:46:33 am » |
|
I'm not sure I understand the question. You've identified the location of the original "LEVEL" data (19D14). This is loaded into RAM as part of a larger chunk of data that's all loaded at once. Its location in the ROM is never directly referenced. The only pointers for the "LEVEL" data point to the location where it is loaded into RAM. This is why you can't just write the new data to ROM and re-point. ; Copy source pointer to $00 (found at 8028) 06:808C: LDX #$00 06:808E: LDA $8028,X 06:8091: STA $0000 = 06:8093: INX 06:8094: LDA $8028,X 06:8097: STA $0001
; Load dest pointers (see below) 06:8099: JSR $80C6
; Copy routine 06:809C: JSR $80D7
; Unrelated crap follows
; Load copy destination pointers to $02 (start) and $04 (end) ; (67F0 - 687D) ; "LEVEL" macro is included in this (it is copied to $681C) 06:80C6: LDA #$F0 06:80C8: STA $0002 06:80CA: LDA #$67 06:80CC: STA $0003 06:80CE: LDA #$7D 06:80D0: STA $0004 06:80D2: LDA #$68 06:80D4: STA $0005
If you write the data elsewhere in the ROM (as I did), you'll need to load the additional data into RAM. (You NEED to load it into RAM, so it can be patched before it is handed to the PPU.) Or do you mean, where does the byte used to patch the "LEVEL" macro come from? If that's the case, it comes from a block of level data that is also loaded into RAM. But this really isn't the issue. The level number isn't a PPU macro in itself, it's a single byte that is patched into "LEVEL" macro: 05:B02A:AD B1 6B LDA $6BB1 ; Load level number (from level data block that has been loaded to RAM) 05:B02D:F0 EB BEQ $B01A ; Is it a level? (Overworld is level 0) 05:B02F:8D 25 68 STA $6825 ; Then write the level number into the "LEVEL" macro
So, the "LEVEL" macro is loaded into RAM, then modified, then loaded into the PPU. This solution work fine!!! Thank you guys, you are great! I have the very last question: I need to add a row here: http://img199.imageshack.us/i/immaginelim.png/How can i do? If it could help, i don't use this row in my translation: http://img35.imageshack.us/i/1immagine.png/So i left it blank. Thx a lot, you are really cool!!!
|
|
|
|
snarfblam
Guest
|
|
« Reply #18 on: April 24, 2011, 07:38:53 pm » |
|
At this rate, I'll have the entire game disassembled in no time. Here's what you need to do. - At 0x9190, change $00 to $80. This tells the game to put a line of text where you need it (below "LIFE POTION").
- At 0x91D8, change $80 to $00. This tells the game to remove a line of text ("BRACELET").
- Write the following at 0x94C9:
FE 93 99 94 01 93 15 93 1C 93 32 93 47 93 5E 93 69 93 7C 93 91 93 98 93 AB 93 C1 93 D4 93 E8 93 We are basically moving the pointer for the line we removed to the location where we need it inserted. All the pointers between just get pushed forward one space.
Now, you are free to use the data at 0x940E for your text. The first byte specifies the indent of the text. You have the next eight bytes to work with for text. If you need more room, just use some free space in the ROM. Update the pointer at 0x94C9 to the new data. Remember the format is <indent> <text> $FF.
|
|
|
|
MattDragon
Guest
|
|
« Reply #19 on: April 27, 2011, 12:42:16 pm » |
|
At this rate, I'll have the entire game disassembled in no time. Here's what you need to do. - At 0x9190, change $00 to $80. This tells the game to put a line of text where you need it (below "LIFE POTION").
- At 0x91D8, change $80 to $00. This tells the game to remove a line of text ("BRACELET").
- Write the following at 0x94C9:
FE 93 99 94 01 93 15 93 1C 93 32 93 47 93 5E 93 69 93 7C 93 91 93 98 93 AB 93 C1 93 D4 93 E8 93 We are basically moving the pointer for the line we removed to the location where we need it inserted. All the pointers between just get pushed forward one space.
Now, you are free to use the data at 0x940E for your text. The first byte specifies the indent of the text. You have the next eight bytes to work with for text. If you need more room, just use some free space in the ROM. Update the pointer at 0x94C9 to the new data. Remember the format is <indent> <text> $FF. Awesome!!! Fantastic, it works perfectly!!! Thx you for the patient!!! If I'll have other questions, i know you'll have always the right answare!!! :thumbsup: May 01, 2011, 05:19:07 am - (Auto Merged - Double Posts are not allowed before 7 days.)
Hey guys! I'm working on the translation of all the spoken text in the game (405C - 45B1), but I'm having some problems with the pointer table (4010 - 405B). For example, the first pointer is 4C 80, but the first sentence start at 405C, so the pointer should be 4C 40... This is the same thing for the other pointers... Why? Thx a lot!!!
|
|
« Last Edit: May 01, 2011, 05:19:58 am by MattDragon »
|
|
|
|
snarfblam
Guest
|
|
« Reply #20 on: May 01, 2011, 09: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
Guest
|
|
« Reply #21 on: May 05, 2011, 10:14:21 am » |
|
Thx a lot, I'd never find it out alone!
|
|
|
|
MattDragon
Guest
|
|
« Reply #22 on: May 15, 2011, 05: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
Guest
|
|
« Reply #23 on: May 15, 2011, 01:24:32 pm » |
|
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, 07:10:24 am by snarfblam »
|
|
|
|
MattDragon
Guest
|
|
« Reply #24 on: May 16, 2011, 08:25:26 am » |
|
Perfect, thx you!!!
|
|
|
|
MattDragon
Guest
|
|
« Reply #25 on: May 31, 2011, 04: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!
|
|
|
|
|