*............... air hero _zx rts _air_hero equ * jsr _dec_fuel jsr _obs_ch_control lda portA and #%00001111 eor #%00001111 sta _old_joy lda _service_nr cmp #255 beq _zx lda _empty cmp #255 beq _emp lda _old_joy and #right bne _air_right lda _old_joy and #left bne _air_left lda _old_joy and #up beq _emp jmp _air_up _emp lda _old_joy and #down bne _airdown lda _fz05 bne *+6 jsr _ado_kolision rts lda _faza_nr cmp #3+18 bcs _rt_nothing lda #1+18 sta _faza_nr rts _rt_nothing lda #4+18 sta _faza_nr rts _airdown jmp _air_down _air_right equ * jsr _arh_kolision lda _old_joy and #up bne _up_right lda _old_joy and #down bne _do_right lda #4+18 sta _faza_nr rts _up_right jsr _aup_kolision lda #5+18 sta _faza_nr jsr _szum rts _do_right jsr _ado_kolision lda #5+18 sta _faza_nr jsr _szum rts _air_left equ * jsr _alf_kolision lda _old_joy and #up bne _up_left lda _old_joy and #down bne _do_left lda #1+18 sta _faza_nr rts _up_left jsr _aup_kolision lda #2+18 sta _faza_nr jsr _szum rts _do_left jsr _ado_kolision lda #2+18 sta _faza_nr jsr _szum rts _air_up equ * jsr _aup_kolision _page jsr _szum lda _faza_nr cmp #3+18 bcs _rt_up lda #2+18 sta _faza_nr rts _rt_up lda #5+18 sta _faza_nr rts _air_down equ * lda strig beq _air_chn jsr _ado_kolison jmp _page _air_chn equ * jsr _air_service _air_fire lda #10 sta zwolnij+5 rts _dymek equ * lda _faza_nr cmp #1+18 beq _dym_left cmp #2+18 beq _dym_left cmp #4+18 beq _dym_right cmp #5+18 beq _dym_right rts _dym_left lda _memory clc adc #24 tax lda 53770 and #%00000010 ora pmadres+1024+512,x sta pmadres+1024+512,x inx lda 53770 and #%00000111 ora pmadres+1024+512,x sta pmadres+1024+512,x inx lda 53770 and #%00000011 ora pmadres+1024+512,x sta pmadres+1024+512,x rts _dym_right lda _memory clc adc #24 tax lda 53770 and #%01000000 ora pmadres+1024+512,x sta pmadres+1024+512,x inx lda 53770 and #%11100000 ora pmadres+1024+512,x sta pmadres+1024+512,x inx lda 53770 and #%11000000 ora pmadres+1024+512,x sta pmadres+1024+512,x rts _obs_ch_contr equ * lda _faza_nr cmp #16 beq _h2 cmp #17 beq _h3 rts _h2 lda #19 sta _faza_nr rts _h3 lda #22 sta _faza_nr rts msadres equ pmadres+762 pociski jsr _movemissile jsr _miskolision lda 644 bne *+5 jsr _zapal rts _dec_fuel inc _df_contr lda _df_contr cmp #65 bne _dfuelrts lda #0 sta _df_contr lda kieszen+2 beq _2dfuelrts sed sec sbc #1 sta kieszen+2 cld _dfuelrts rts _2dfuelrts lda #255 sta _empty sta _service_nr lda zwolnij+4 bne *+11 lda #$20+2 ldx #1 ldy #12 jsr m_init ldx #0 _3df lda _pos_Y cmp rownaj,x bcc _4df inx cpx #23 bne _3df rts _4df lda _pos_Y and #%00001111 cmp #1 beq _dfuelrts lda rownaj,x sta _pos_Y rts rownaj equ * dta b($1d) dta b($21),b($25),b($29),b($2d) dta b($31),b($35),b($39),b($3d) dta b($41),b($45),b($49),b($4d) dta b($51),b($55),b($59),b($5d) dta b($61),b($65),b($69),b($6d) dta b($71),b($75) _df_contr dta b(0) _empty dta b(0) *procedura ruchu pociskow _movemissile equ * ldy #0 _mov8 jsr _mov1 iny cpy #4 bne _mov8 rts _mov1 jsr _mov0 jsr _mov5 rts _mov5 ldx #0 _mov6 lda _misX_position,x sta 53252,x inx cpx #4 bne _mov6 rts _mov0 tya tax stx Xmem lda _rejestr sta _2rejestr cpx #0 beq _mov2 _mov3 lsr _2rejestr dex bne _mov3 _mov2 ldx Xmem lda _2rejestr and #1 beq _offmissile lda _2rejestr and #16 beq _lwmissile inc _misX_position,x rts _lwmissile dec _misX_position,x _offmissile rts *procedura wystrzelenia pocisku _zapal equ * lda opoznienie beq _zap5 rts _zap5 lda kieszen+1 *(ilosc naboi) bne _zap4 rts _zap4 sed sec sbc #1 sta kieszen+1 cld lda #25 sta opoznienie lda #1 sta __maska lda #16 sta __maska+1 _zap3 lda _rejestr and __maska bne _zap2 lda zwolnij+4 bne *+11 lda #$20+1 ldx #28 ldy #16 jsr m_init lda _rejestr ora __maska sta _rejestr ldx _pos_X lda __maska cmp #1 beq _z1 cmp #2 beq _z2 cmp #4 beq _z3 stx _misX_position+3 jsr _ustYmissile stx _misY_position+3 lda msadres,x ora #%11000000 sta msadres,x jmp _kierunek _z3 stx _misX_position+2 jsr _ustYmissile stx _misY_position+2 lda msadres,x ora #%00110000 sta msadres,x jmp _kierunek _z2 stx _misX_position+1 jsr _ustYmissile stx _misY_position+1 lda msadres,x ora #%00001100 sta msadres,x jmp _kierunek _z1 stx _misX_position jsr _ustYmissile stx _misY_position lda msadres,x ora #%00000011 sta msadres,x jmp _kierunek _zap2 asl __maska asl __maska+1 lda __maska cmp #16 beq *+5 jmp _zap3 rts _kierunek equ * jsr _herokier cmp #0 beq _lewo lda _rejestr ora __maska+1 sta _rejestr rts _lewo lda __maska+1 eor #255 sta __maska+2 lda _rejestr and __maska+2 sta _rejestr rts _herokier equ * lda _faza_nr cmp #16 bne _hk2 lda #0 rts _hk2 cmp #17 bne _hk3 lda #1 rts _hk3 cmp #8 bcs _hk4 lda #0 rts _hk4 lda #1 rts *detekcja kolizji pociskow _miskolision equ * ldy #0 _kol0 tya pha jsr _kol1 pla tay iny cpy #4 bne _kol0 rts _kol1 tya tax stx Xmem lda _misX_position,x cmp #60 beq _mis_clear cmp #190 beq _mis_clear lda _misX_position,x beq _exit sec sbc #$40 lsr @ lsr @ lsr @ sta Xmissile,x lda _misY_position,x sec sbc #$24 lsr @ lsr @ lsr @ lsr @ sta Ymissile,x ldy Ymissile,x lda Xmissile,x tax jsr locate jsr r2ozpelement tax cpx #0 bne _mis_clear _exit rts _mis_clear equ * ldx Xmem lda #0 sta _misX_position,x lda _rejestr and cltable,x sta _rejestr lda _misY_position,x tay lda msadres,y and cl2table,x sta msadres,y rts _ustYmissile equ * lda _pos_Y sec sbc _jmp_Yposition clc adc #23 tax rts _szum equ * lda zwolnij+4 bne *+11 lda #$20+2 ldx #23 ldy #14 jsr m_init rts cltable equ * dta b(%11101110),b(%11011101),b(%10111011),b(%01110111) cl2table equ * dta b(%11111100),b(%11110011),b(%11001111),b(%00111111) _rejestr dta b(%00000000) _2rejestr dta b(0) Xmem dta b(0) _misX_position dta d' ' __maska dta d' ' opoznienie dta b(0) _misY_position dta d' ' Xmissile dta d' ' Ymissile dta d' '