Users browsing this thread: 1 Guest(s)
Assembly Programming

#33
Posts: 3,971
Threads: 279
Thanks Received: 238
Thanks Given: 58
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
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.

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.
  Find
Quote  



Messages In This Thread
Assembly Programming - by the_randomizer - 01-06-2012, 05:51 PM
RE: Assembly Programming - by Angelo26 - 01-12-2012, 08:50 PM
RE: Assembly Programming - by the_randomizer - 01-12-2012, 09:33 PM
RE: Assembly Programming - by madsiur - 01-15-2012, 03:01 AM
RE: Assembly Programming - by JCE3000GT - 01-16-2012, 04:40 PM
RE: Assembly Programming - by madsiur - 01-16-2012, 05:32 PM
RE: Assembly Programming - by JCE3000GT - 01-16-2012, 08:17 PM
RE: Assembly Programming - by madsiur - 01-23-2012, 02:47 AM
RE: Assembly Programming - by madsiur - 02-04-2012, 02:38 PM
RE: Assembly Programming - by madsiur - 03-25-2012, 04:32 AM
RE: Assembly Programming - by SSJ Rick - 03-25-2012, 01:05 PM
RE: Assembly Programming - by madsiur - 04-20-2012, 01:56 AM
RE: Assembly Programming - by Marketa Lazarova - 08-16-2016, 11:17 AM
RE: Assembly Programming - by seibaby - 08-16-2016, 01:21 PM
RE: Assembly Programming - by PinkMawile - 09-24-2016, 03:55 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite