; Ootw .include "zp.inc" .include "hardware.inc" ootw: ;=========================== ; Enable graphics bit LORES bit SET_GR bit FULLGR ;=========================== ; Clear both bottoms lda #$4 sta DRAW_PAGE jsr clear_bottom lda #$0 sta DRAW_PAGE jsr clear_bottom lda #0 sta DRAW_PAGE lda #1 sta DISP_PAGE ;============================= ; Load background to $c00 lda #$0c sta BASH lda #$00 sta BASL ; load image off-screen $c00 lda #>(planet_rle) sta GBASH lda #<(planet_rle) sta GBASL jsr load_rle_gr ;================================= ; copy to both pages $400/$800 jsr gr_copy_to_current jsr page_flip jsr gr_copy_to_current ;================================= ; setup vars lda #22 sta PHYSICIST_Y lda #20 sta PHYSICIST_X lda #1 sta DIRECTION lda #0 sta GAIT game_loop: ; check keyboard jsr handle_keypress ; copy background to current page jsr gr_copy_to_current ;======================= ; draw pool ripples lda FRAMEL and #$30 ; 0110 1100 lsr lsr lsr tax lda pool_ripples,X sta INL lda pool_ripples+1,X sta INH lda #9 sta XPOS lda #30 sta YPOS jsr put_sprite lda FRAMEL and #$30 ; 0110 1100 lsr lsr lsr clc adc #2 and #$6 tax lda pool_ripples,X sta INL lda pool_ripples+1,X sta INH lda #27 sta XPOS lda #30 sta YPOS jsr put_sprite lda FRAMEL and #$30 ; 0110 1100 lsr lsr lsr clc adc #4 and #$6 tax lda #18 sta XPOS lda #28 sta YPOS jsr put_sprite ; draw physicist jsr draw_physicist ; draw slugs jsr draw_slugs ; draw foreground lda #>foreground_plant sta INH lda #slug1 sta INH bne slug_selected slug_squinched: lda #slug2 sta INH slug_selected: lda slugg0_x sta XPOS lda #34 sta YPOS lda DIRECTION bmi slug_right slug_left: jsr put_sprite jmp slug_done slug_right: jsr put_sprite_flipped slug_done: rts remove_slug: lda #0 sta slugg0_out rts ;=========================== ; quit_level ;=========================== quit_level: jsr TEXT jsr HOME lda KEYRESET ; clear strobe lda #0 sta DRAW_PAGE lda #end_message sta OUTH jsr move_and_print jsr move_and_print wait_loop: lda KEYPRESS bpl wait_loop lda KEYRESET ; clear strobe jmp ootw end_message: .byte 8,10,"PRESS RETURN TO CONTINUE",0 .byte 11,20,"ACCESS CODE: IH8S",0 .include "text_print.s" .include "gr_pageflip.s" .include "gr_unrle.s" .include "gr_fast_clear.s" .include "gr_copy.s" .include "gr_putsprite.s" .include "gr_offsets.s" .include "ootw_backgrounds.inc" .include "ootw_sprites.inc"