lorom ;808459 todo with sounds ;CF8000 beginnning of sound data? ;CF80E8 SPC engine ;27C2EA sound start address? ;27CF81 sound effect sample table? ;27D025 sound effect sample data ;sample 1: 5C4 bytes grapple brzz ; 7E:09C6 - 7E:09C7 Samus's missiles ; 7E:09C8 - 7E:09C9 Samus's max missiles ; 7E:09CA - 7E:09CB Samus's super missiles ; 7E:09CC - 7E:09CD Samus's max super missiles ; 7E:09CE - 7E:09CF Samus's power bombs ; 7E:09D0 - 7E:09D1 Samus's max power bombs ; 7E:09D2 - 7E:09D3 Currently selected status bar item ; 7E:09D4 - 7E:09D5 Samus's max reserve tanks ; 7E:09D6 - 7E:09D7 Samus's reserve tanks ; 7E:09D8 - 7E:09D9 Samus's reserve missiles. Only used by missile pickup routine(91:DF80) ; 7E:09AA - 7E:09AB Up See ControllerInput.txt ; 7E:09AC - 7E:09AD Down ; 7E:09AE - 7E:09AF Left ; 7E:09B0 - 7E:09B1 Right ; 7E:09B2 - 7E:09B3 Shoot ; 7E:09B4 - 7E:09B5 Jump ; 7E:09B6 - 7E:09B7 Run ; 7E:09B8 - 7E:09B9 Item Cancel ; 7E:09BA - 7E:09BB Switch Item ; 7E:09BC - 7E:09BD Aim Down ; 7E:09BE - 7E:09BF Aim Up !up = $09AA !down = $09AC !left = $09AE !right = $09B0 !shoot = $09B2 !jump = $09B4 !run = $09B6 !cancel = $09B8 !select = $09BA !L = $09BC !R = $09BE !icon = $09D2 !libpos = #$0094 !sfxpos = #$009C !quepos = #$00A2 !typepos = #$00A8 org $809B44 JSR MainHUDRoutine RTL org $80CD93 CURSORPOS: DW !libpos-2 DW !sfxpos-2 DW !quepos-2 DW !typepos-2 MainHUDRoutine: PHP : PHB : PHK : PLB : REP #$30 PEA $8000 PLB PLB INIT: LDX #$0000 - LDA #$280F STA $7EC608,x ;clear HUD INX INX CPX #$0120 BNE - print " START 1 ",pc ;testing print command for xkas LDA $072D ;Used as a timer in the pause screen for selection flashing ;7E:072F - 7E:0730 Used as a timer in the pause screen for reserve tank flashing CMP #$7777 BEQ + LDA #$7777 STA $072D STZ !icon LDX #$0000 - STZ $09C6,x INX INX CPX #$0020 BNE - LDA #$0005 STA $09CC LDA #$0080 JSL $808FC1 + LDA #$8000 : STA $0A78 STA $05F7 ;place new game state here, disable automap, set game state JSL $86800B : JSL $8483B8 : JSL $87800B : JSL $8DC4CD ;disables e/r projectiles, PLMS, animations, cascade fx JSL $90F084 LDA #$0005 : STA $0CD2 : STA $0CCE ;max out projectile and bomb counter ;disable charge LDA $8F BIT !left BEQ + DEC !icon + BIT !right BEQ + INC !icon + LDA !icon BPL + LDA #$0003 STA !icon BRA ++ + CMP #$0004 BCC ++ STZ !icon ++ LDA !icon ASL TAX PHX LDA CURSORPOS,x TAX LDA #$3833 STA $7EC608,x PLX LDA $8F BIT !up BEQ + INC $09C6,x BRA ++ + BIT !down BEQ ++ DEC $09C6,x ++ LDA #NUMBERS STA $00 SEP #$20 STZ $02 REP #$20 LDA $09C6 ;defines library LDX !libpos JSR DISPLAY ;display library ; JSR $9D98 + LDA $09C8 LDX !sfxpos JSR DISPLAY ;display sound ; JSR $9D98 + LDA $09CA LDX !quepos JSR DISPLAY ;display queue ; JSR $9D98 + LDA $09CC LDX !typepos JSR DISPLAY ;display song version ; JSR $9D98 + LDA $09C6 BPL + LDA #$0003 BRA ++ + AND #$0003 CMP #$0003 BCC ++ LDA #$0000 ++ STA $09C6 ASL TAX LDA $09C8 BPL + LDA MAXLIBSFX,x DEC STA $09C8 BRA ++ + CMP MAXLIBSFX,x BCC ++ STZ $09C8 ++ LDA $8F BIT !jump BEQ + LDA $09C8 JSR (WHATLIB,x) + LDA $8F BIT !shoot BEQ +++ LDA $09CA AND #$00FF ORA #$FF00 JSL $808FC1 LDA $09CC BPL + LDA #$0007 STA $09CC BRA ++ + CMP #$0008 BCC ++ LDA #$0005 STA $09CC ++ JSL $808FC1 +++ LDX $0330 : LDA #$00C0 : STA $D0,X : INX : INX LDA #$C608 : STA $D0,X : INX : INX LDA #$007E : STA $D0,X : INX LDA #$5820 : STA $D0,X : INX : INX STX $0330 : PLB : PLP : RTS LIB1: JSL $80903F RTS LIB2: JSL $8090C1 RTS LIB3: JSL $809143 RTS DISPLAY: print " display ",pc PHA AND #$00F0 LSR LSR LSR TAY LDA [$00],y STA $7EC608,x PLA AND #$000F ASL TAY LDA [$00],y STA $7EC60A,x RTS WHATLIB: DW LIB1 DW LIB2 DW LIB3 MAXLIBSFX: DW $0043 ;maximum amount of sounds available for the current library + 1 DW $0080 DW $002F NUMBERS: DW $0C00 DW $0C01 DW $0C02 DW $0C03 DW $0C04 DW $0C05 DW $0C06 DW $0C07 DW $0C08 DW $0C09 DW $0C40 DW $0C41 DW $0C42 DW $0C43 DW $0C44 DW $0C45