Users browsing this thread: 3 Guest(s)
Pony Fantasy VI Remake

Posts: 734
Threads: 36
Thanks Received: 12
Thanks Given: 41
Joined: Jan 2016
Reputation: 6
Status
None
Yes, please.
  Find
Quote  

Posts: 179
Threads: 3
Thanks Received: 24
Thanks Given: 4
Joined: Apr 2015
Reputation: 18
Status
None
Code:
; fix the animation script to just use one frame
.org $D06999
.db $00, $00, $00, $00, $00, $00, $00

; use palette 200 (same as sleep)
.org $D08FA3
.db $C8

; set frame count
.org $D4D2EE
.db $01

; set tileset
.db $A0

; set frame offset
.dw $02A5

; set frame size
.db $02, $02
Try that
  Find
Quote  
[-] The following 2 users say Thank You to Everything for this post:
  • DrakeyC (06-28-2017), madsiur (06-28-2017)

Posts: 734
Threads: 36
Thanks Received: 12
Thanks Given: 41
Joined: Jan 2016
Reputation: 6
Status
None
Yup, looks great, thanks! Smile
  Find
Quote  

Posts: 734
Threads: 36
Thanks Received: 12
Thanks Given: 41
Joined: Jan 2016
Reputation: 6
Status
None
So, this is another more complex one, regarding equipment that boosts HP and MP by percentages. A lot of equipment pieces in my hack boost HP or MP to encourage party diversity (unicorn, pegasi, and earth ponies have different stat specialties, their exclusive equipment boosts their specialized stats). Looking at this coding, would it be possible to set Bit 15 to the 12.5% boost? That way, when a 12.5% equipment piece, and a 25% equipment piece, are used together, they trigger the 50% boost, giving further incentive to use the specialized equipment together for a stronger combined boost. Or I am misunderstanding the code and the game doesn't check for these bits across different equipment pieces?

http://datacrystal.romhacking.net/wiki/F...o_HP_or_MP

Code:
(Apply percentage boost to HP or MP.  Bit 14 set = 25% boost,
Bit 15 set = 50% boost, Both of those bits set = 12.5% boost)
C2/283C: DA           PHX
C2/283D: 0A           ASL
C2/283E: 2A           ROL
C2/283F: 85 EE        STA $EE
C2/2841: 2A           ROL
C2/2842: 2A           ROL         (Bit 15 is now in Bit 2, and Bit 14 is in Bit 1)
C2/2843: 29 06 00     AND #$0006  (isolate Bits 1 and 2)
C2/2846: AA           TAX         (and use them as function pointer)
C2/2847: A5 EE        LDA $EE
C2/2849: 4A           LSR
C2/284A: 4A           LSR
C2/284B: 85 EE        STA $EE     (all that crazy shifting was equivalent to
                                   $EE = A AND 16383.  gotta love Square =] )
C2/284D: 7C 59 28     JMP ($2859,X)


C2/2850 generic boost calculation
(Boost A by some fraction, if any)
C2/2850: 7B           TDC      (enter here for A = 0 + $EE)
C2/2851: 4A           LSR      (enter here for A = (A * 1/8) + $EE)
C2/2852: 4A           LSR      (enter here for A = (A * 1/4) + $EE)
C2/2853: 4A           LSR      (enter here for A = (A * 1/2) + $EE)
C2/2854: 18           CLC
C2/2855: 65 EE        ADC $EE
C2/2857: FA           PLX
C2/2858: 60           RTS

C2/2859 pointers: boosts formulae
C2/2859: 50 28  (A = A) (technically, A = $EE, but it's the same deal.)
C2/285B: 52 28  (A = A + (A * 1/4) )
C2/285D: 53 28  (A = A + (A * 1/2) )
C2/285F: 51 28  (A = A + (A * 1/8) )
  Find
Quote  

Posts: 200
Threads: 1
Thanks Received: 10
Thanks Given: 0
Joined: Oct 2015
Reputation: 18
Status
None
it merges the original flags into Variable $11D5 across equipment.  then C2/0F7D and the functions below it choose the best flag, and set one or both bits seen in your post.

you'd have to rewrite C2/0F7D and friends to factor multiple flags into their decision.
Quote  

Posts: 734
Threads: 36
Thanks Received: 12
Thanks Given: 41
Joined: Jan 2016
Reputation: 6
Status
None
So it wouldn't be as simple as just "change the bytes for 50% boosts to the ones for 12.5% and vice-versa" ?
  Find
Quote  

Posts: 200
Threads: 1
Thanks Received: 10
Thanks Given: 0
Joined: Oct 2015
Reputation: 18
Status
None
you'd still have to rewrite C2/0F7D et al, this time to make their flag setting cumulative; they currently exit after putting their first flag value in A.  you'd also need to swap entries in the C2/2859 pointer table (not hard).

the C2/0F7D rewrite i was alluding to in my previous post wouldn't mark flags cumulatively, but rather return 80h if it detected both 12.5% and 25% original flags set.  C2/2859 would be untouched.

see, C2/0F7D does two things:
- takes 3 possible input bits regarding HP or MP, and outputs a 2-bit value in Bits 6-7 (which become Bits 14-15).
- outputs to Bits 6-7 regardless of whether input is coming from $11D5 Bits 2-4 (HP) or Bits 5-7 (MP).

also, either reworking method would require rewriting Bank C3 code to use the new system.

anyway, here's a longer C2/0F85 that might work:
Code:
LSR
BIT $11D5
beq no_25
xba
lda #$40
bra try_125
no_25:
xba
lda #$00
try_125:
xba
ASL
ASL
BIT $11D5
BEQ use_25_result
xba
EOR #$C0
RTS

use_25_result:
XBA
RTS
using 16-bit Y to hold 0000h or 0040h might reduce the XBAs and branches needed.

or if we could find a way to zero the top half of A before calling C2/0F7D (+2 bytes), we could drop the "bra try_125" thru "lda #$00" (-5 bytes).
Quote  

Posts: 734
Threads: 36
Thanks Received: 12
Thanks Given: 41
Joined: Jan 2016
Reputation: 6
Status
None
Okay, nevermind then, if the coding rewrites would be that substantial and need new coding in an entirely different bank then I think it's a bit much for a relatively minor gameplay tweak. Thank you for explaining it, though.
  Find
Quote  

Posts: 200
Threads: 1
Thanks Received: 10
Thanks Given: 0
Joined: Oct 2015
Reputation: 18
Status
None
come to think of it, i believe Bank C3 calls C2 for this, as i'm not finding any $D85008 or $D85009 references in the former bank.  so it shouldn't be too involved; just this one function.

a similar-sized way to what i posted would be to use a data table:
Code:
hirom
header

org $C20EFA

lda #$05
JSR setup_boost_HP_or_MP

org $C20F0B

lda #$02
JSR setup_boost_HP_or_MP

org $C20F7D

setup_boost_HP_or_MP:
pha
tdc
pla            ; clear upper A so it doesn't corrupt upper X
phx
tax
lda $11d5
loop:
lsr
dex
bne loop       ; always iterates at least once, so not truly robust

and #$07
tax
lda.l data,x   ; hope that's proper format for 24-bit label
plx
rts

; org $C2????
data:
db $00
db $40
db $80
db $80
db $C0
db $80
db $80
db $80

;nop
;nop
;nop            ; 0 bytes to spare, now. :|


one advantage is the code and data don't require contiguous free space.
Quote  

Posts: 734
Threads: 36
Thanks Received: 12
Thanks Given: 41
Joined: Jan 2016
Reputation: 6
Status
None
Okay, I guess I'll try it, presuming that's an assembly code.

EDIT - Asar says it's improperly put together, so if it's not assembly then what is it?
  Find
Quote  



Forum Jump:

Users browsing this thread: 3 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite