hirom header !alphaList = $C2FAD0 ; -------- org $C353C1 ; Build Alphabetical Rage list C353C1: ; 3 of first 4 instructions are Square's. LDX #$9D89 ; will store list at 7E/9D89 STX $2181 SEP #$10 ; 8-bit X and Y LDX $00 ; X=0? 00/0000 holds zero in every trace i've seen.. ; X is our loop iterator JMP BuildLoop ; to hell with your Orwellian, one-size-fits-all ; Skills generator! Gau is not a brick in the wall! NOP NOP ; Define Rage's text color rgcolor: JSR $C2F2 ; Color: User's AZhook: JSR extra_rgcol ; Rage in slot ; rest of function unchanged INC A ; Learned it? BNE .exit ; Lit if so LDA #$28 ; Palette 2 STA $29 ; Color: Gray TXA ; Enemy number CMP #$FF ; Pugs? BNE .skip ; Retain if not TDC ; Pugs's tbl value <- Table value is defined in "mark6x1" function above .skip CMP $7EAA8D,X ; Roams Veldt now? BNE .exit ; Gray out if not LDA #$24 ; Palette 1 <- Use #$2C for gray-and-blue palette from Magic menu STA $29 ; Color: Turquoise .exit RTS ; --------------- org ?????? extra_rgcol: JSR $50EC ; Rage in slot pha lda !alphaList,x tax pla rts ; --------------- org ?????? BuildLoop: LDA !alphaList,x ; get monster # alphabetically from huge ass FF-block. ; may pick new location later, perhaps in 13 years. ; TAY PHX CLC ; don't want carry adding into X JSL $C2FBD0 ; call C2/5217 indirectly, since it expects a near call. ; X = A DIV 8, A = 1 SHL (A MOD 8) BIT $1D2C,X ; compare to current rage byte - 32 bytes total, 8 rages ; per byte BEQ storeNull ; if bit wasn't set, rage wasn't found, so display a null ; entry in its place ; TYA BRA store ; store non-FFh value (2 ^ n will suffice) in menu storeNull: LDA #$FF ; store FFh when there's no rage, indicating a null ; menu item. Pugs is unfortunate enough to be enemy ; #255, which is why you can never choose its Rage. ; *somebody* had to be in that slot, and there's no way ; i can think of to fix this besides implementing a ; 16-bit menu handler. store: STA $2180 ; store rage in menu PLX INX ; advance to next menu position BNE BuildLoop ; loop for all enemies, 0 to 255 REP #$10 ; restore 16-bit X and Y RTS ; ====================================================== ; (free space used = 11 + 29)