News: 11 March 2016 - Forum Rules

Author Topic: Dragon Warrior 1, 2 & 3 Hacking Discussion  (Read 186342 times)

Choppasmith

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: Dragon Warrior 1, 2 & 3 Hacking Discussion
« Reply #340 on: October 23, 2020, 01:26:58 am »
You wouldn't happen to have a link to that, would you? A quick check for various likely-sounding search phrases with Google doesn't turn up anything that looks interesting within the first few pages of results.

Sure :)
https://w.atwiki.jp/dq_binary/pages/31.html

If you use some kind of webpage translator the site should be more obvious but basically the list starts with hacks and then goes to developer tools underneath that. They have some RAM and ROM values for games on the left side, but it's very incomplete and mostly for the SNES games. They do have config files for BNE2, sort of a multi-game data viewer/editor that uses said config files for rom hacking. There's somewhat of a English explanation and how-to here but I haven't tried it myself:

https://www.southcape.org/2014/12/22/using-bne2-for-rom-analysis/

Oh and abw, I'm really sorry, I'm trying to update my DW2 rom with your latest Menu Upgrades patch (via asar). I must be forgetting something (it's been a while) that's different in my ROM compared to an unchanged ROM but I'm getting a glitch when I try to buy any weapon/armor in a shop (It just skips the party menu and goes straight to the "(Cannock) Can not equip this are you sure?" message and the graphics glitch out,

October 23, 2020, 08:41:18 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Also, abw, I was hoping to ask if you know how to edit the Redraw Menu text to fix a blink-and-you'll-miss-it glitch when cycling through menus (Sorry to be a pain but I figured maybe you had to touch this up a little bit when doing your Latin translation)



The format is baffling to me

Code: [Select]

AN 
D[top border-77] 
[top border-77][top border-77] 
[top border-77][top-right border] [right border]
Why do you need multiple lines for one line of the window? What are the spaces for?

I tried to simply edit it according to where the letters of the new Command window now line up but that didn't work. ND seems to work a little better than AN but I still get extra lines.
« Last Edit: October 24, 2020, 03:29:33 am by Choppasmith »

abw

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
Re: Dragon Warrior 1, 2 & 3 Hacking Discussion
« Reply #341 on: October 24, 2020, 09:47:14 pm »
https://w.atwiki.jp/dq_binary/pages/31.html
Thanks! Alas, there's not a lot of information on that page, and all the links I tried are giving me 503 errors, so I can't even try it any of it out for myself :(. Assuming they actually do have a (non-Overworld) map editor, I'm curious to see how well it works.

Oh and abw, I'm really sorry, I'm trying to update my DW2 rom with your latest Menu Upgrades patch (via asar). I must be forgetting something (it's been a while) that's different in my ROM compared to an unchanged ROM but I'm getting a glitch when I try to buy any weapon/armor in a shop (It just skips the party menu and goes straight to the "(Cannock) Can not equip this are you sure?" message and the graphics glitch out,
Probably what you're missing are the 2 new menus and their pointers. Basically I just took the 2 BUY/SELL target menus (from pointers #18 and #42), copied them to new menus (creating pointers #75 and #76, which meant shifting the entire block of menu data down by 4 bytes), updated them to include a space and the new optional E control code ($F0-$F2 depending on the hero), and adjusted their size/position to fit the new text.

Why do you need multiple lines for one line of the window? What are the spaces for?
Because it's not one line of the window, it's two lines divided up to match PPU attribute boundaries so that the game can apply the right palette when clearing and drawing the overlapping tiles (of course, the palette doesn't change between the parts of the COMMAND and EQUIP menus that overlap, but it's all part of the same system that handles rolling the EQUIP menu up and down over the map background which almost always does use a different palette, so the overlap section still has to obey the same rules). A tiny bit of experimentation will show you that that "AN  " is the "AN" of the top line and then the 2 spaces on the second line directly under the "AN". The rest of the data works the same way, e.g. "SP  " covers the "SP" on one line and the "  " directly below it.

After updating that section of data, you'll want to test getting into a battle, because despite being completely separate conceptually, the game actually uses one of the strings of 4 consecutive spaces from that block of COMMAND menu replacement text as one of the black backgrounds in battle :P.

And yes, DW2's menu clearing/redrawing is indeed a pain.

Retrolife

  • Restricted Access
  • Jr. Member
  • *
  • Posts: 55
    • View Profile
Re: Dragon Warrior 1, 2 & 3 Hacking Discussion
« Reply #342 on: October 26, 2020, 05:24:04 am »
Next year is 30th anniversary of DW III so a new hack is in order one that brings out the best of the game in every aspect(gameplay,storyline,npcs,graphics)

Chicken Knife

  • Hero Member
  • *****
  • Posts: 619
    • View Profile
Re: Dragon Warrior 1, 2 & 3 Hacking Discussion
« Reply #343 on: October 28, 2020, 04:29:16 pm »
Guess I was a few months too early on our DQ3 NES restoration / retranslation hack.  :P

I intend to eventually work on the SFC version, but even if I started it immediately, (which I don't plan to) it would definitely not get finished in 2021.

joe73ffdq

  • Full Member
  • ***
  • Posts: 207
    • View Profile
Re: Dragon Warrior 1, 2 & 3 Hacking Discussion
« Reply #344 on: December 15, 2020, 06:52:43 pm »
I have been gradually working on my DW2 mod recently, and I was wondering a few things...

In the enemy data, the 2nd byte is for enemy evade. The left nibble specifically is for evade, and the right nibble is supposed to be for HP amounts of 256, but there is no instruction to ram. There is thread on Gamfaqs from 2011, where AlexKC mentions this about enemy byte #2... Is there a way to add an instruction to ram, so specific end game enemies can have over 255 HP...

2nd question... Is there any kind of overworld map editor. There is a utility that works visually while using it, but it doesnt work properly, and screws up much of the data... There is map restoration for Hargons Castle in this thread. Do you guys possibly have a working map editor...

I would really like to add more HP specifically, and map work would just be for cosmetic differences... Right now in my notes for enemy set up, 3 of the last 5 bosses would be spamming healall, which doesnt quite work very well...

Thank you guys  :beer:

Chicken Knife

  • Hero Member
  • *****
  • Posts: 619
    • View Profile
Re: Dragon Warrior 1, 2 & 3 Hacking Discussion
« Reply #345 on: December 27, 2020, 10:39:31 am »
I have been gradually working on my DW2 mod recently, and I was wondering a few things...

In the enemy data, the 2nd byte is for enemy evade. The left nibble specifically is for evade, and the right nibble is supposed to be for HP amounts of 256, but there is no instruction to ram. There is thread on Gamfaqs from 2011, where AlexKC mentions this about enemy byte #2... Is there a way to add an instruction to ram, so specific end game enemies can have over 255 HP...

2nd question... Is there any kind of overworld map editor. There is a utility that works visually while using it, but it doesnt work properly, and screws up much of the data... There is map restoration for Hargons Castle in this thread. Do you guys possibly have a working map editor...

I would really like to add more HP specifically, and map work would just be for cosmetic differences... Right now in my notes for enemy set up, 3 of the last 5 bosses would be spamming healall, which doesnt quite work very well...

Thank you guys  :beer:
For the question about an editor, this tool: http://sonic_death.byethost31.com/DW3Bestiary.txt by abw is the most helpful thing out there. Although it is just a viewer, you can really learn the exact process that the game uses to draw. I was able to use this to do my DQ3 map edits. I didn't get too far with the concept of drawing maps more efficiently in order to create space, but I was lucky enough to have some free space to work with and unused data to eliminate, which just required some moving around of map data and adjusting of pointers in order for me to do the expansion where necessary.

For your first question about expanding enemy HP, I'm afraid I don't have much to offer there. If abw comes out of his sabbatical at some point, I'm sure he could give a helpful pointer or two.

As for me, I continue to poke around with the issue where the Zombie Killer sword sporadically does bonus damage to metal slimes. It's already well documented here: https://gamefaqs.gamespot.com/boards/587249-dragon-warrior-iii/50550773. 1whoistornapart did some valuable disassembly of the issue 11 years ago, but never exactly followed up with a solution.

It's a pretty complex issue created by weakness in a set of subroutines that check whether a monster is vulnerable to Expel/Banishasu. In some cases where a monster has already fled, the subroutines get mixed up as to which monster to be checking for resistance.

I feel like the solution probably has to do with adding a bit of code to that subroutine structure to check the status bytes of the targeted monster and determine if it has fled, and then switch to another monster in the group if it has. But I have a fair amount to learn before getting anywhere with this. Open to advice anyone has to offer.

Chicken Knife

  • Hero Member
  • *****
  • Posts: 619
    • View Profile
Re: Dragon Warrior 1, 2 & 3 Hacking Discussion
« Reply #346 on: March 06, 2021, 10:31:24 pm »
Thought I'd bring this thread back to life with a technical question about Dragon Warrior 2 NES. The game has a few bugs when it comes to monster group assignments for overworld map areas that I'd love to address for my next Delocalized update. For instance:

The far west section of the Rhone/Rondarkia plateau has early game monsters appearing.

A section of tiles northwest of Tuhn/Tepa also has incorrect enemy encounters from much earlier in the game.

Also, when traveling in the river toward Tuhn/Tepa, you have non aquatic enemies attacking you. (I suppose this one could have been intentional--monsters jumping into your ship from the shore perhaps.)

http://datacrystal.romhacking.net/wiki/Dragon_Warrior_II::ROM_map/ASM
I was reading through this partial disassembly by abw here this morning, and I didn't find much about how encounter group tile assignments work, but the notes here can be a little tough to decipher.

Was curious if anyone had any experience or knowledge of this kind of thing. I'll be needing to release an update soon anyway that addresses some text formatting inconsistencies between the three Delocalized games, and I'd absolutely love to include fixes for these bugs.

I'd appreciate any helpful tips.
« Last Edit: March 06, 2021, 10:37:16 pm by Chicken Knife »

abw

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
Re: Dragon Warrior 1, 2 & 3 Hacking Discussion
« Reply #347 on: April 04, 2021, 07:51:57 pm »
In the enemy data, the 2nd byte is for enemy evade. The left nibble specifically is for evade, and the right nibble is supposed to be for HP amounts of 256, but there is no instruction to ram. There is thread on Gamfaqs from 2011, where AlexKC mentions this about enemy byte #2... Is there a way to add an instruction to ram, so specific end game enemies can have over 255 HP...
It looks like an enemy's max HP gets set here, where ($BB) points to the start of the enemy's data within $B7F5:
Code: [Select]
0x0136C3|$04:$B6B3:A0 00    LDY #$00    ; offset for max HP of enemy type
0x0136C5|$04:$B6B5:B1 BB    LDA ($BB),Y
0x0136C7|$04:$B6B7:85 99    STA $99   
0x0136C9|$04:$B6B9:46 99    LSR $99   
0x0136CB|$04:$B6BB:46 99    LSR $99    ; $99 = enemy max HP / 4
0x0136CD|$04:$B6BD:A9 00    LDA #$00   
0x0136CF|$04:$B6BF:85 9A    STA $9A   
; call to code in a different bank ($0F:$C3AB)
0x0136D1|$04:$B6C1:20 AB C3 JSR $C3AB  ; generate a random number and store it in $32-$33 (two passes)
0x0136D4|$04:$B6C4:A5 32    LDA $32    ; RNG byte 0
0x0136D6|$04:$B6C6:85 9B    STA $9B   
0x0136D8|$04:$B6C8:20 5B A0 JSR $A05B  ; 16-bit multiplication: ($99-$9A) = ($99-$9A) * ($9B), overflow in $9E, copy of ($99-$9A) in ($A1-$9D)
0x0136DB|$04:$B6CB:A0 00    LDY #$00    ; offset for max HP of enemy type
0x0136DD|$04:$B6CD:B1 BB    LDA ($BB),Y
0x0136DF|$04:$B6CF:38      SEC       
0x0136E0|$04:$B6D0:E5 9D    SBC $9D    ; enemy's actual HP is max HP - random number between 0 and enemy max HP / 4, so anywhere between 75% and 100% of the enemy type's max HP
0x0136E2|$04:$B6D2:A0 04    LDY #$04    ; offset for enemy's actual HP, low byte
0x0136E4|$04:$B6D4:91 B7    STA ($B7),Y
0x0136E6|$04:$B6D6:C8      INY        ; offset for enemy's actual HP, high byte
0x0136E7|$04:$B6D7:A9 00    LDA #$00    ; always set high byte to 0
0x0136E9|$04:$B6D9:91 B7    STA ($B7),Y
So if you wanted to use the other half of the evade byte for max HP * 256, you'll need to incorporate it into at least three places (determining max HP / 4, calculating max HP - max HP / 4, and storing the actual HP).

We had previously determined that the game actually does use the high byte of enemy HP in many places, but of course you'll need to do lots of testing to make sure there aren't any other places where the game uses 8-bit HP instead of 16-bit HP.

2nd question... Is there any kind of overworld map editor. There is a utility that works visually while using it, but it doesnt work properly, and screws up much of the data... There is map restoration for Hargons Castle in this thread. Do you guys possibly have a working map editor...
I haven't done anything much with the overworld maps, but as Chicken Knife mentioned I do have something that lets you step through the surprisingly complicated building process for the non-overworld maps. I figured I might as well submit it, so take a look at the Dragon Warrior II/III/IV (NES) Map Building Visualizer if you want!

http://datacrystal.romhacking.net/wiki/Dragon_Warrior_II::ROM_map/ASM
I was reading through this partial disassembly by abw here this morning, and I didn't find much about how encounter group tile assignments work, but the notes here can be a little tough to decipher.
Based on joe73ffdq's notes, you'll probably want to start looking around $04:$806E, which appears to be the routine for determining which battle formation you get for overworld encounters.

joe73ffdq

  • Full Member
  • ***
  • Posts: 207
    • View Profile
Re: Dragon Warrior 1, 2 & 3 Hacking Discussion
« Reply #348 on: July 01, 2021, 12:20:20 am »
I finally got the hp for the high byte to work. I tried a bunch of combinations, and nothing worked, so I took the direct approach...

136E2 : A0 04 - LDY #$04   
136E4 : 91 B7 - STA ($B7),Y ; offset for enemy's actual HP, low byte
136E6 : C8 - INY ; offset for enemy's actual HP, high byte
136E7 : A9 00 - LDA #$00 ; always set high byte to 0
136E9 : 91 B7 - STA ($B7),Y
136EB : 60 - RTS       

136e7 - Changing 00 to to any value, gives 256 hp amounts that are fixed, and not changeable in the enemy data.

136E2 : A0 04 - LDY #$04   
136E4 : 91 B7 - STA ($B7),Y ; offset for enemy's actual HP, low byte
136E6 : ea - INY ; offset for enemy's actual HP, high byte
136E7 : ea ea - LDA #$00 ; always set high byte to 0
136E9 : ea ea - STA ($B7),Y
136EB : ea - RTS

136e6 : Jump to new location

----- : a001 - LDY #$01 - second byte enemy data - evade and high byte hp
----- : b1bb - LDA ($BB),Y
----- : 8d9406 - STA ($0694) - store second byte enemy data at $0694
----- : 60 - RTS

The low byte hp is at $0693 in ram... Now the second byte data is called, and then stored at $0694... This is what Alex KC was referring to. There is a place in ram, but no instruction to do so...

The only problem is that evade is now rendered unusable... The left nybble xx80 is for evade. The right nybble xx00 is for 256x hp amounts... The code used calls the whole byte, which means 10 ie, would be 4096 added hp + evade 1... Evade has to remain at 0 (6.25%), unless I can figure out a way to recode it correctly...

Now I only have 2 problems left, which I can deal with... Evade might be unusable... Heal and Healall dont have a check, and work randomly... Small change right now... Now I can give late game enemies 300-1000 hp, and not have to rely on spamming Healall...


///////


I want to thank those who have helped me with various things, and very specifically abw for the disassembly  :beer:  :crazy:  Many things have been fine tuned, and other things wouldnt have worked (bank 6 mostly)

Those last 2 barriers... Create new items... And have access to more hp...


///////


Last thing... Someone asked about formations and zoning. If you look at the overworld map, you will see how the grid works. The northwestern part of Rhone uses Tuhn region enemies. There is a similar thing south of Wind Tower, which is equivalent to the peninsula in FF1...

All the current data and work is in this link... I started a new post a few weeks back... Dragon Quest 2 - Dragons Reborn... This is the decided name for the eventual mod, and the hp problem solved was all I needed... I will post there once more is completed and tested... 

https://https://www.dropbox.com/s/r9n7711uq15h6vf/DW2.zip?dl=0


« Last Edit: July 01, 2021, 12:35:38 am by joe73ffdq »

Chicken Knife

  • Hero Member
  • *****
  • Posts: 619
    • View Profile
Re: Dragon Warrior 1, 2 & 3 Hacking Discussion
« Reply #349 on: July 01, 2021, 09:04:05 am »
Last thing... Someone asked about formations and zoning. If you look at the overworld map, you will see how the grid works. The northwestern part of Rhone uses Tuhn region enemies. There is a similar thing south of Wind Tower, which is equivalent to the peninsula in FF1...
Yes, I was interested in exploring whether fine tuning that grid might work at some point since there are some obvious problems with it. Those same problems exist in DQ1, but mostly in out of the way areas that you don't encounter in the normal course of travelling around. In DQ2, hitting a couple of the problem areas is almost inevitable.

Am I correct in thinking that the grid will need to remain in the form of the symmetrical big boxes that are currently used? I'd imagine that it was programmed that way to be space and/or processor efficient, and that attempting to fine tune the enemy zones in a way that isn't just big symmetrical encounter blocks would require the encounter system to be totally rebuilt, correct?

PS, I intend to check out and play around with what you did so far in the near future. Sounds pretty neat.

abw

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
Re: Dragon Warrior 1, 2 & 3 Hacking Discussion
« Reply #350 on: July 02, 2021, 09:58:52 pm »
The only problem is that evade is now rendered unusable...
There are actually a few other problems with this besides the ones you've noted, including at least the following:
  • "STA ($0694)" is invalid; I think you meant "STA $0694"
  • you're repeatedly overwriting the high byte of monster #1's HP, so the high byte of other monsters's HP doesn't get set (and could be random garbage if the game doesn't initialize those addresses elsewhere)
  • you're not setting the high byte of the monster's max HP in time to use it for calculating their actual HP, so e.g. a monster with 256 max HP would always start with 256 HP instead of anywhere between 192 and 256 HP

Something like this is closer to what you want:
Code: [Select]
; $04:$B6B3
LDY #$01 ; Monster Type Stat Offset #$01: [4-bit evade chance / 64, 4-bit Max HP bits 11-7]
LDA ($BB),Y
AND #$0F ; strip off the evade bits
PHA ; max HP, bits 11-8
STA $9A
DEY ; Monster Type Stat Offset #$00: Max HP, low byte
LDA ($BB),Y
PHA ; max HP, bits 7-0
LSR $9A
ROL
LSR $9A
ROL
STA $99 ; $99-$9A = monster type max HP / 4
JSR $C3AB ; generate a random number and store it in $32-$33 (two passes)
LDA $32 ; RNG byte 0
STA $9B
JSR $A05B ; 16-bit multiplication: ($99-$9A) = ($99-$9A) * ($9B), overflow in $9E, copy of ($99-$9A) in ($A1-$9D)
PLA ; max HP, bits 7-0
SEC
SBC $9D
LDY #$04 ; Monster Stat Offset #$04: HP, low byte
STA ($B7),Y
INY ; Monster Stat Offset #$05: HP, high byte
PLA ; max HP, bits 11-8
SBC $A1
STA ($B7),Y ; monster's actual HP is max HP - random number between 0 and enemy max HP / 4, so anywhere between 75% and 100% of the monster type's max HP
RTS

I want to thank those who have helped me with various things, and very specifically abw for the disassembly  :beer:  :crazy:  Many things have been fine tuned, and other things wouldnt have worked (bank 6 mostly)
Likewise! Figuring out what the code was doing was much easier thanks to your collected notes about what the data meant :beer:.

joe73ffdq

  • Full Member
  • ***
  • Posts: 207
    • View Profile
Re: Dragon Warrior 1, 2 & 3 Hacking Discussion
« Reply #351 on: July 03, 2021, 05:27:32 am »
Thank you  :beer:

The code structure you just gave starts at 136C3, and changes it from there, which I havent looked into yet.

I removed 136d1/d5 : 20 AB C3 A5 32. This grants full hp skipping the 75-100% random.

136e6 : ea 4c99b1 ea ea - skip the high byte set to zero
131a9 : a001 b1bb 8d9406 60 - 2nd byte enemy data enabled : evade/high byte hp

Healall restores full hp to both 0693 and 0694
12b1e:   204a98
1185a : 2067ab  a000 b1bb a9ff 8d9306  a001 b1bb a9ff 8d9406  60

This works. I tested it with final bosses 4e/52, and then practiced it with 01 Slime... e803-1000, d007-2000... The enemy is always loaded at full hp, and Healall restores the full amount for high and low... This still renders evade unusable though...

Where to place...
AND #$0F   ; strip off the evade bits
PHA      ; max HP, bits 11-8
STA $9A


///


Something interesting to note... There were a few crits that exceeded 255 against enemies, with 274 being the highest so far.

joe73ffdq

  • Full Member
  • ***
  • Posts: 207
    • View Profile
Re: Dragon Warrior 1, 2 & 3 Hacking Discussion
« Reply #352 on: July 11, 2021, 05:31:35 pm »
Ok, I hit a wall with everything I tried...

a001 b1bb 290f 8d9406... This would only work if all formations are single enemy only, which obviously doesnt work very well. Just like you described, only the first enemy is loaded correctly.

Similar thing for using Healall... a9ff 8d9406 works perfectly fine for a single enemy, but loads the full a9xx to the rest... Technically I can use this for any single enemy formation, but the high byte is still not initially loaded, requiring Healall to have to be cast.

Now to the code in question...

136E2 : A0 04      LDY #$04   
136E4 : 91 B7      STA ($B7),Y ; offset for enemy's actual HP, low byte
136E6 : C8         INY           ; offset for enemy's actual HP, high byte
136E7 : A9 00      LDA #$00      ; always set high byte to 0
136E9 : 91 B7      STA ($B7),Y
136EB : 60         RTS       


At the end here, the high byte is called - C8 INY - Then it is set to 0.

I tried a bunch of code combinations, and nothing worked...

LDY #$01   ; Monster Type Stat Offset #$01: [4-bit evade chance / 64, 4-bit Max HP bits 11-7]
LDA ($BB),Y
AND #$0F   ; strip off the evade bits

This is the specific code I was trying mix and match with other code you gave me... Placing the whole code structure you gave didnt work either.

With the RAM locations, I tried STA $85 with $99, $9a, $9b, $9c, and with $68 PLA, $38 SEC Im not sure how to actually apply them...

Uggh... What do I do here  :banghead:

Almost forgot to mention... The routine for enemy attack #05 Run Away was removed. At 131a6 place 4C AF B1, and now there is 22 bytes nearby for testing from 131a9-131be... Some form of code combination should work with that free space, and it shouldnt interfere with other DW2 roms. It just simply skips the #05 hp check of 25%.

Check out the current status of my folder if youre interested, and see if there are any errors if you care to look... DW2 patch #11 matches some of the completed work. Patch #10 rom map, and 1-unfinished data, both show the significant changes.

https://www.dropbox.com/s/r9n7711uq15h6vf/DW2.zip?dl=0

Last thing...

If the hp thing isnt able to be figured out, then I will resort to lower final attack values for each character...

I really want this to work... Only a few need above 255 hp. The final bosses, and maybe 7-8 other late game enemies... Its ultimately a 2 prong situation... The high byte loading the hp, and Healall working properly.
« Last Edit: July 11, 2021, 08:31:23 pm by joe73ffdq »

abw

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
Re: Dragon Warrior 1, 2 & 3 Hacking Discussion
« Reply #353 on: July 12, 2021, 09:45:46 pm »
I removed 136d1/d5 : 20 AB C3 A5 32. This grants full hp skipping the 75-100% random.
Ah, if you're removing the initial HP randomization, then you can chop out most of that routine's code, not just those 5 bytes, which leaves plenty of space for the extra code to load bits 11-8 of the monster's max HP:
Code: [Select]
; $04:$B6B3
LDY #$01 ; Monster Type Stat Offset #$01: [4-bit evade chance / 64, 4-bit Max HP bits 11-7]
LDA ($BB),Y
AND #$0F ; strip off the evade bits
PHA ; max HP, bits 11-8
DEY ; Monster Type Stat Offset #$00: Max HP, low byte
LDA ($BB),Y
LDY #$04 ; Monster Stat Offset #$04: HP, low byte
STA ($B7),Y
INY ; Monster Stat Offset #$05: HP, high byte
PLA ; max HP, bits 11-8
STA ($B7),Y
RTS

Similar thing for using Healall... a9ff 8d9406 works perfectly fine for a single enemy, but loads the full a9xx to the rest... Technically I can use this for any single enemy formation, but the high byte is still not initially loaded, requiring Healall to have to be cast.
I haven't really gone through much of the code for battle commands yet, so it would take a little while to figure out what all is going on there, and free time is not something I have an abundance of these days, alas :(.

joe73ffdq

  • Full Member
  • ***
  • Posts: 207
    • View Profile
Re: Dragon Warrior 1, 2 & 3 Hacking Discussion
« Reply #354 on: September 16, 2021, 02:53:47 am »
This took a while, but finally got it done... Special thanks to ABW for providing the disassembly, and giving direct code which made most of this possible  :beer:


---


|     uncurse

|   125fc/16 : 4c07a6  eaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaea
|   12689/95 : eaeaeaeaeaeaeaeaeaeaeaeaea

|   1853d/41 : eaeaeaeaea
|   18557/5d : eaeaeaeaeaeaea

|   185d0/2f : 4c2086  eaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaea
|              eaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaea

|   18a55/64 : eaeaeaeaeaeaeaeaeaeaeaeaeaeaeaea
|   18a99/9d : eaeaeaeaea
|   18ad6/f2 : 4ce38a  eaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaea
|   18b33/45 : eaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaea

|   1915d/7d : 4c4e85  eaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaea
|   199e0/e7 : eaeaeaeaeaeaeaea
|   19aa3/a7 : eaeaeaeaea
|   19ad4/da : eaeaeaeaeaeaea
|   19b0c/26 : eaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaea
|   19d04/0f : eaeaeaeaeaeaeaeaeaeaeaea



|   117f0/f5 : eaeaeaeaeaea                                                       - no restriction for duplicates
|   11857/59 : 4c6a98
|   1185a/73 : 2067ab 2014ab 2067ab 2014ab 2067ab 2014ab 2067ab 4c14ab eaea
|   12aea/f2 : a9ff 85b0 4c4a98 eaea                                              - healall-1
|   12b1a/23 : a9ff 85b0 2067ab 4cc7b6                                            - healall-2
|   136c3/d6 : a000 b1bb a004 91b7 c8 a001 b1bb 290f a005 91b7 60                 - hp 256
|   136d7/eb : 2016ab 2067ab 2016ab 2067ab 2016ab 2067ab 4c16ab


|   12996/97 : bca9 - Run Away > Fight
|   12a61/87 : eaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaea
|   131a6/be : 4cafb1 eaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaea


|   18c9d/a3 : 4cc3bf ea 4ccabf                                                        - open
|   19767/82 : 4cb9bf eaeaeaeaea c938 d004 a900 f00c c937 f006 c93a f01e d078 a901     - key for all
|   1bfc9/e0 : c939 f003 4c5f97 4c668c   202efa 3b 4c9280   202efa 58 4c9280

|   1987a/7c : 4cc98a                                                                  - charm of rubiss   open   eye of malroth
|   18ad6/f2 : 4ce38a  20cb9a 202f99 20cb9a 20668c 20cb9a 4c8996  eaeaeaeaeaeaeaea
|   1a05c/5d : 0200                                                                    - eye of malroth

|   12e5a/5c : 2061bf                                                                  - jig
|   13f71    : b1b9 4a 4a 60                                                             1/8
|   13f71    : b1b9 4a 4a 4a 60                                                          1/16

|   12ffc/fe : 4c68bf                                                                  - stopspell / sleep
|   13f78/92 : 20b0c4 a203 b011 a953 20b0c4 a203 b008 a95d 20b0c4 4cefaf 4cf5af        - d.bane  wfc  str.sh



https://www.dropbox.com/s/q6lld8gil6k2uxv/DW2%20-%20Disassembly.rar

« Last Edit: September 22, 2021, 12:55:50 am by joe73ffdq »