Users browsing this thread: 1 Guest(s)
Zombie-friendly Color Wheel!

#1
Posts: 281
Threads: 18
Thanks Received: 12
Thanks Given: 8
Joined: Mar 2014
Reputation: 8
Status
None
Hey, here's a modification of Leet Sketcher's Color Wheel patch that allows one extra aura to cycle - specifically, the purple aura caused by Zombie in Return of the Dark Sorcerer.

Some notes from Leet Sketcher that allowed me to make this patch:

Leet Sketcher Wrote:Bit 0 - "Wait" bit (in case party members start off the battle with an outline colour status)
Bit 1 - Unused! This could be your Zombie bit, and in fact it's in exactly the right spot.
Bit 2 - Slow
Bit 3 - Haste
Bit 4 - Stop
Bit 5 - Shell
Bit 6 - Safe
Bit 7 - Rflect

A few important things to note.
One, the six status bits my patch uses are always checked against DP $38, which holds those statuses for a party member. This would translate to Regen status instead of Zombie, so you'll want to check against $36 for that.

Two, you'll need to add your Zombie purple at the beginning of the colour table (before Slow's 04).

Three, you'll have to be careful with the LDA that grabs one of those colours. In my patch, the table is indexed two bytes early because the JSR right before that sets X to some value between 2 and 7 (according to the status). In your case, it'll be between 1 and 7, so you'll have to adjust accordingly.

Four, there are some controls in the status finding loops to stop when the bits are rotated too far; you'll need to adjust those too.

I used a very hacky method to avoid having to rewrite Leet's code to check for multiple status bytes - I simply exchange Zombie for Regen (which happens to be the same bit, but in Status Byte 1 rather than 3).

Code:
; Zombie purple aura
org $C12E55
C12E55: BEQ C12E5E        ; Branch if not zombied
C12E57: LDA #$1A          ; Aura color = $1A (purple)
C12E59: JSR $2EC3         ; Change outline color for statuses

; Some branches that need to be changed. Locations are 40 bytes earlier in the Japanese ROM.
org $C12E5E
C12E5E:

org $C12E4F
C12E4F: BRA C12E7C  ; +43

org $C12E5C
C12E5C: BRA C12E7C  ; +30

org $C12E69
C12E69: BRA C12E7C  ; +17

; Status checker for outline colours.
        LDA #$02
        TRB $38         ; If Regen, ignore it
        AND $36
        TSB $38         ; If Zombie, pretend it's Regen
C12E6B: LDA $2EA9,Y     ; Current outline rotation
C12E6E: BIT $38         ; Check against status
C12E70: BNE C12E82      ; +16 ; Branch if match found
C12E72: LSR A           ; Check next status
C12E73: ADC #$00        ; Maintain "wait" bit
C12E75: STA $2EA9,Y     ; Update outline rotation
C12E78: CMP #$02        ; Loop over 6 statuses
C12E7A: BCS C12E6E      ; -14
C12E7C: LDA #$80        ; No match, reset
C12E7E: STA $2EA9,Y
C12E81: RTS

C12E82: AND #$FE        ; Remove "wait" bit
C12E84: JSR $1A0F       ; X = index of bit set
C12E87: LDA C12E8D-1,X  ; Get outline colour
C12E8B: BRA C12EC3      ; +54 ; Implement outline colour

; List of colours, in order: Slow, Haste, Stop, Shell, Safe, Reflect
print pc
C12E8D: db $1A          ; Zombie
        db $04          ; Slow
        db $03          ; Haste
        db $07          ; Stop
        db $02          ; Shell
        db $01          ; Safe
        db $00          ; Reflect

C12E93: LDA $2EA9,Y     ; Current outline rotation
C12E96: LSR A           ; Move one step forward
C12E97: BCS C12E7C      ; -29 ; If "wait" bit set, reset
C12E99: AND #$FE        ; Moved six steps?
C12E9B: BEQ C12E7C      ; -33 ; If so, reset
C12E9D: BIT $38         ; Check current status
C12E9F: BEQ C12E96      ; -11 ; Loop until match found or all statuses checked
C12EA1: BRA C12E7E      ; -37 ; Update outline rotation

; 17 bytes of free space!
C12EA3: ;NOP #17

; This is part of the outline control function. Here, $2C contains the fadedness of the sprite outline. The lower the fadedness, the greater the intensity of the outline colour.
org $C12ECF
C12ECF: LDA $C2E3AA,X   ; Get colour change offset
C12ED3: CLC
C12ED4: ADC $2C         ; Add to current fade
C12ED6: STA $36         ; Save here
C12ED8: AND #$3C        ; Isolate fade
C12EDA: LSR A
C12EDB: STA $2C         ; Update fade
C12EDD: STZ $2D
C12EDF: LDA $36
C12EE1: ASL #2          ; Is fade decreasing?
C12EE3: BCC C12EEB      ; +6  ; If so...
C12EE5: LDA #$1F        ; ...subtract from 31
C12EE7: SBC $2C
C12EE9: STA $2C
C12EEB: LDA $2C         ; Get fade amount
C12EED: CMP #$1F        ; Is it fully faded?
C12EEF: BNE C12EF7      ; +6  ; If so...
C12EF1: JSR C12E93        ; ...rotate colour
C12EF4: BRA C12EF7      ; +1
C12EF6: NOP
C12EF7: PLA

; Part of the battle variable initialization method
org $C2307D
C2307D: PHX             ; Save party member index
C2307E: LDA $FE         ; Get row
C23080: STA $3AA1,X     ; Save to special props
C23083: LDA $3ED9,X     ; Preserve special sprite
C23086: PHA
C23087: LDA $05,S       ; Get loop variable
C23089: STA $3ED9,X     ; Save to roster position
C2308C: TDC
C2308D: TXA
C2308E: ASL #4
C23092: TAX
C23093: LDA #$06
C23095: STA $FE
C23097: PHY             ; Preserve Y-loop index
C23098: LDA $1601,Y     ; Get normal sprite & name
C2309B: STA $2EAE,X     ; Store to display vars
C2309E: INX
C2309F: INY
C230A0: DEC $FE         ; 7 iterations to loop
C230A2: BPL C23098      ; -12
C230A4: PLY             ; Restore Y-loop index
C230A5: PLA             ; Restore special sprite
C230A6: CMP #$FF        ; Is it null?
C230A8: BEQ C230AD      ; +3  ; If not...
C230AA: STA $2EA7,X     ; ...overwrite sprite
C230AD: LDA #$81        ; Reflect + wait bit
C230AF: STA $2EA2,X     ; Init outline rotation
C230B2: LDA $03,S       ; Get character ID
C230B4: STA $2EBF,X     ; Save it
C230B7: CMP #$0E        ; Banon or higher?
C230B9: REP #$20        ; 16-bit A
C230BB: TAX             ; Move to X

org $C12EC3
C12EC3:
  Find
Quote  
[-] The following 1 user says Thank You to seibaby for this post:
  • Gi Nattak (10-24-2017)



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite