News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

Metconst Lost and Found

Started by OmegaDragnet9, December 06, 2022, 11:36:06 PM

Previous topic - Next topic

TobiMikami

Lets ask, that way if he didnt we can try and accredit the creator if possible, I'll try and tag him. @FelixWright did you happen to do this patch or nah? Trying to give credit where credit is due.

FelixWright

Quote from: TobiMikami on March 29, 2023, 06:03:14 AM
Lets ask, that way if he didnt we can try and accredit the creator if possible, I'll try and tag him. @FelixWright did you happen to do this patch or nah? Trying to give credit where credit is due.

When in doubt, check The resources thread

OP was alexman I think

OmegaDragnet9

Quote from: FelixWright on March 29, 2023, 04:09:51 PM
Quote from: TobiMikami on March 29, 2023, 06:03:14 AM
Lets ask, that way if he didnt we can try and accredit the creator if possible, I'll try and tag him. @FelixWright did you happen to do this patch or nah? Trying to give credit where credit is due.

When in doubt, check The resources thread

OP was alexman I think

Thanks man

TobiMikami

I concur, glad we can get him proper credits for his work!

OmegaDragnet9

#54
I came across this a month or two back researching the forums. I believe from asking around, I discovered this is Black Falcon code. This particular revision may or may not have some Quote58 modifications:

[spoiler=Morph Flash Code]
https://forum.metroidconstruction.com/index.php/topic,5065.msg67552.html#msg67552[/spoiler]

(Thanks Benox50 for sharing this to the forums!)

Here's the actual code Benox50 posted (because there have been issues with the link):

lorom

!timer = $1F60 ;unused stack

org $91FDE7    ;unmorphin'
JSR CHECKA

org $91ECFE      ;morphin'
JSR CHECKA

;org $91FFEE

;FREESPACE:
;STA $0B00
;JSL CHECK
;RTS


org $A0870D ;main hijack point, runs every frame

JSR $FD60


org $A0FD60 ; push stuff in case it's needed later
PHA : PHX : PHY
JSL MORPH_FLASH
PLY : PLX : PLA
INC $1842 ;pull stuff after the routine is run and do what the hijack jump overwrote
RTS

org $91FFFB ;little free space
CHECKA:
JSL CHECKB
RTS

org $85A000
CHECKB:
        STA $0B00 ;add back what we overwritted
PHA : CMP #$0007 : BNE +
LDA #$0015 : STA !timer
; LDA #$001C
; JSL $809143
; LDA #$0040
; JSL $8090C1 ;play sound
; LDA #$0044
; JSL $8090C1 ;play sound
+
PLA : RTL

MORPH_FLASH:

        LDA !timer : BEQ QUIT : BMI QUIT        ;should the timer ever be negative, go as well
        CMP #$0016 : BCS QUIT        ;if the timer is greater than 8 for any reason, get the hell outta here!
        DEC a           ;subtract 1 to save us an additional table entry
        ASL a
        TAX             ;used as an index now
        LDA $09A2       ;equipped items
        AND #$0021      ;wipe out the other items
        BEQ NORMAL      ;if it's equal we have power suit
        BIT #$0020      ;check for gravity suit
        BNE GRAVITY
        BIT #$0001      ;check for varia suit
        BNE VARIA


print " Power Suit ", pc
NORMAL:
        LDA #$0000      ;normal suit
        BRA FLASH

print " Grav Suit ", pc
GRAVITY:
        LDA #$0200      ;to get 9A20
        BRA FLASH

print " Var Suit ", pc
VARIA:
        LDA #$0100      ;to get 9920

FLASH:
        STA $12         ;temporary
        LDA FLASH_PATTERN, x    ;load palette pointer from pattern table (timer used as index)
        CLC
        ADC $12                 ;add our values for suit palette addresses
        TAX                    ;now we have a source pointer in X
        LDY #$C180              ;now we have a destination pointer in Y
        LDA #$0020              ;how many bytes to transfer (palette lines are 0x20 bytes each)
        MVN $9B7E               ;9B is the bank where the charge palette is, 7E is RAM
;       JSR FLASH_STORE         ;no need for this, so you can get rid of that
        DEC !timer              ;decrease timer
QUIT:                           ;at the end, pull stuff that was once pushed (very important)
        RTL                     ;end

;9820 is the start of normal suit charge palette
;9920 is the start of varia suit charge palette, 0x9820 + 0x0100
;9A20 is start start of gravity suit charge palette 0x9820 + 0x0200



FLASH_PATTERN:

    DW $9820        ; palette line 0x0, regular palette
    DW $9840        ; palette line 0x1
            DW $9840        ; palette line 0x1
            DW $9840        ; palette line 0x1
    DW $9860        ; palette line 0x2
            DW $9860        ; palette line 0x2
            DW $9860        ; palette line 0x2
    DW $9880        ; palette line 0x3
            DW $9880        ; palette line 0x3
            DW $9880        ; palette line 0x3
    DW $98A0        ; palette line 0x4
            DW $98A0        ; palette line 0x4
                DW $98A0        ; palette line 0x4
    DW $98C0        ; palette line 0x5
            DW $98C0        ; palette line 0x5
        DW $98E0        ; palette line 0x6
                DW $98E0        ; palette line 0x6
        DW $9900        ; palette line 0x7
                DW $9900        ; palette line 0x7
        DW $98A0        ; palette line 0x4
                DW $98A0        ; palette line 0x4