kindersurprise

by snydej

Game:

Description: Eggs, lots of 'em.

!game_mode = $7e0100
!buttons2 = $7e0018
!hatch_sprite = $7e18da
!hatch_timer = $7e18de
!rng = $01acf9
!hatch_sprite_override = $7fba12

bank $00

	lda !carl_initialized
	bne skip_init
	dec
	sta !hatch_sprite_override
	sta !carl_initialized
	

skip_init:	
	lda !game_mode
	cmp #$14
	bne end

;a jump test
	lda !buttons2
	bit #$80
	beq end

;Getting off of Yoshi? That's an eggin'.
	lda #$02
	sta !hatch_timer
	
	lda !hatch_sprite_override
	cmp #$ff
	bne +
	jsl !rng
	and #$3f
	tax
	lda sprite_id_table,x
+	sta !hatch_sprite

end:
	lda #$00
	rtl

sprite_id_table:
db $06,$0e,$15,$1c,$1d,$1f,$21,$26,$27,$28,$2b,$2d,$2f,$3c,$3d,$44
db $45,$46,$49,$4a,$52,$55,$5c,$5e,$5f,$6a,$6b,$6f,$74,$75,$76,$77
db $78,$79,$7a,$7b,$7d,$7e,$7f,$80,$81,$82,$83,$86,$87,$88,$8f,$90
db $94,$9a,$9f,$a0,$a1,$a2,$a8,$ae,$b1,$b4,$b9,$c1,$c3,$c5,$c6,$c8
back to listings