Users browsing this thread: 1 Guest(s)
Assembly Programming
03-25-2012, 04:32 AM
I just finished making the Offering behave like the Dragon Horn. With this modification, would will have 68.75% chances of dealing 2 hits, 25% chance of dealing 3 hits and 6.25% chances of dealing 4 hits.
Here are the code modifications. There might be a patch released soon and Gi Nattak is testing (and enjoying) the patch right now.
I put the code at C2/FAA4, but this space might be used by other patches, I haven't checked. I could somehow be optimized maybe because of the many NOP and the consecutives INC. Maybe there would be a better way to code this by loading either #$01, #$03, #$05 or #$07 in one of the registers and work it that way, instead of multiple INC, I'm not sure.
These are the main reasons why I'm not releasing a patch yet.
Anyone with very basic ASM understanding could move the code where he wants, this is not a problem.
Here's a video showing the result.
I'm only sure that #$07 stored in $3A70 equals 4 hits, #$01 equals probably 1 hit and for the rest I took a chance because #$02, #$03 or #$04 stored in $3A70 resulted in one or two hits instead of two to four hits. I think the odds are respected however.
Edit: Equipped with the Genji Glove, the character will deal either 4, 6 or 8 hits. It seems the game take the lowest or highest number of hit and multiply by two. I haven't looked at the code to change it to 4, 5, 6, 7, or 8 hits and I don't know if it is easy to change that way.
Here are the code modifications. There might be a patch released soon and Gi Nattak is testing (and enjoying) the patch right now.
I put the code at C2/FAA4, but this space might be used by other patches, I haven't checked. I could somehow be optimized maybe because of the many NOP and the consecutives INC. Maybe there would be a better way to code this by loading either #$01, #$03, #$05 or #$07 in one of the registers and work it that way, instead of multiple INC, I'm not sure.
These are the main reasons why I'm not releasing a patch yet.
Anyone with very basic ASM understanding could move the code where he wants, this is not a problem.
Here's a video showing the result.
Code:
C2/1620: 20 A4 FA JSR $FAA4
C2/1623: EA NOP
C2/1624: EA NOP
C2/1625: EA NOP
C2/1626: EA NOP
C2/1627: EA NOP
C2/1628: EA NOP
I'm only sure that #$07 stored in $3A70 equals 4 hits, #$01 equals probably 1 hit and for the rest I took a chance because #$02, #$03 or #$04 stored in $3A70 resulted in one or two hits instead of two to four hits. I think the odds are respected however.
Code:
C2/FAA4: A9 01 LDA #$01
C2/FAA6: 8D 70 3A STA $3A70 (Store 1 hit)
C2/FAA9: 90 1D BCC $FAC8 (branch to RTS if no offering)
C2/FAAB: 20 5A 4B JSR $4B5A (Random number from 0 to 255)
C2/FAAE: EE 70 3A INC $3A70
C2/FAB1: EE 70 3A INC $3A70 (Incremented to 2 hits ?)
C2/FAB4: C9 40 CMP #$40
C2/FAB6: B0 10 BCS $FAC8 (Branch 75% of the times)
C2/FAB8: EE 70 3A INC $3A70
C2/FABB: EE 70 3A INC $3A70 (incremented to 3 hits ?)
C2/FABE: C9 10 CMP #$10
C2/FAC0: B0 06 BCS $FAC8 (Branch 25% of the times)
C2/FAC2: EE 70 3A INC $3A70
C2/FAC5: EE 70 3A INC $3A70 (incremented to 4 hits ?)
C2/FAC8: 60 RTS (return to C2/1623)
Edit: Equipped with the Genji Glove, the character will deal either 4, 6 or 8 hits. It seems the game take the lowest or highest number of hit and multiply by two. I haven't looked at the code to change it to 4, 5, 6, 7, or 8 hits and I don't know if it is easy to change that way.
« Next Oldest | Next Newest »
Users browsing this thread: 1 Guest(s)