keyhole
by lineprinter
Game:
Description: spawn a keyhole
;; based on: ;; ;; Aimed Bullet/Eerie Generator, by yoshicookiezeus ;; based on mikeyk's generic.asm !SpriteToGen = $0E !TimeBetweenSpawns = $FE !RAM_MarioYPos = $96 !RAM_MarioYPosHi = $97 !RAM_MarioXPos = $94 !RAM_MarioXPosHi = $95 !RAM_SpritesLocked = $9D !addr = $0000 Main: LDA $14 ;\ if not time to spawn sprite AND #!TimeBetweenSpawns ; | ORA !RAM_SpritesLocked BNE .Return ;/ branch JSL $02A9DE ;\ find empty sprite slot BMI .Return ;/ if no slot found, return TYX LDA #!SpriteToGen ;\ set new sprite number STA $7E009E,x ;/ JSL $07F7D2 ; reset sprite properties LDA #$08 ;\ set new sprite status STA $7E14C8,x ;/ LDA !RAM_MarioYPos ;\ set new sprite y position to Mario y position CLC ; | ADC #$08 ; | STA $7E00D8,x ; | LDA !RAM_MarioYPosHi ; | ADC #$00 ; | STA $7E14D4,x ;/ LDA !RAM_MarioXPos ;\ set new sprite x position to Mario x position CLC ; | ADC #$08 ; | STA $7E00E4,x ; | LDA !RAM_MarioXPosHi ; | ADC #$00 ; | STA $7E14E0,x ;/ LDA #$DE LDX #$C0 LDY #$DE RTL .Return: RTLback to listings