* --- podprogramy --- * init equ * lda #61 sta dmactls lda displaylist sta dlist+1 rts dli_on equ * lda #0 sta sojusz lda dli sta dliv+1 lda #192 sta nmien rts wyswietl equ * sta screen,y ora #1 sta screen+1,y rts position equ * pha txa clc adc piontable,y asl @ tay pla jsr wyswietl rts locate equ * txa clc adc piontable,y asl @ tay lda screen,y rts translacja equ * ldx #0 ldy #0 trans lda (reals),y sta screen,x ora #1 sta screen+1,x inx inx iny cpy #128 bne trans rts dli equ * pha txa pha ldx sojusz lda chbastable,x sta 54282 sta 54281 inc sojusz lda sojusz cmp #17 bne *+22 lda #0 sta sojusz lda #$44 sta 53270 lda #$ca sta 53271 lda #$1f sta 53272 pla tax pla rti sojusz dta b(0) _zm equ * lda _pos_X cmp #64 beq _ch1 cmp #183 beq _ch2 lda _pos_Y cmp #28 beq _ch3 cmp #130 bcs _ch4 rts _ch1 ldy #128 lda #182 sta _pos_X jmp _2change _ch2 ldy #130 lda #65 sta _pos_X jmp _2change _ch3 jsr _pmbclear ldy #132 lda #128 sta _pos_Y jmp _2change _ch4 jsr _pmbclear ldy #134 lda #29 sta _pos_Y jmp _2change _2change sty chnmi lda #0 tax sta _misX_position,x inx cpx #4 bne *-6 rts chnmi dta b(0) _do_zebrania equ * ldy #0 lda reals _do_z3 cmp zebtable,y beq _do_z2 _do_z4 iny iny cpy #60 *(*) bne _do_z3 rts _do_z2 lda reals+1 cmp zebtable+1,y bne _do_z4 tya pha lda reals pha lda reals+1 pha lda eladrtable,y sta reals lda eladrtable+1,y sta reals+1 ldy #0 ldx #0 zb_el lda (reals),y sta fonts+288,x inx iny cpx #16 bne zb_el ldx #0 zb_el2 lda (reals),y sta fonts+1024+288,x inx iny cpx #16 bne zb_el2 pla sta reals+1 pla sta reals pla lsr @ tay lda zebratable,y beq _juz_zebrany lda pozyc_table,y asl @ tay lda #36 jsr wyswietl _juz_zebrany rts _kasuj_element equ * ldy #0 lda reals do_z3 cmp zebtable,y beq do_z2 do_z4 iny iny cpy #60 *(*) bne do_z3 rts do_z2 lda reals+1 cmp zebtable+1,y bne do_z4 lda eladrtable,y cmp dysk bne _other sed lda kieszen clc adc #1 sta kieszen cld jmp _maz _other lda eladrtable,y cmp bron bne _2other sed lda #$99 sta kieszen+1 cld jmp _maz _2other lda eladrtable,y cmp fuel bne _3other sed lda kieszen+2 cmp #$49 bcs *+10 adc #$50 sta kieszen+2 jmp *+8 lda #$99 sta kieszen+2 cld jmp _maz _3other equ * lda eladrtable,y cmp unkill bne _4other sed lda #255 sta kieszen+3 cld jmp _maz _4other equ * lda eladrtable,y cmp energy bne _5other jsr _uzup jmp _maz _uzup ldx #81 lda #1 sta linia,x inx cpx #88 bne *-6 ldx #113 sta linia,x inx cpx #120 bne *-6 rts _5other lda eladrtable,y cmp micro bne _6other lda #1 sta kieszen+4 jmp _maz _6other lda eladrtable,y cmp supra bne _7other sed lda kieszen+5 clc adc #1 sta kieszen+5 cld jmp _maz _7other nop _maz tya lsr @ tay lda #0 sta zebratable,y lda pozyc_table,y asl @ tay lda kieszen+7 jsr wyswietl lda zwolnij+4 bne *+11 lda #$20+1 ldx #32 ldy #11 jsr m_init rts _opn_door equ * ldy #0 lda reals _opn3 cmp doortable,y beq _opn2 _opn4 iny iny cpy #12 bne _opn3 rts _opn2 lda reals+1 cmp doortable+1,y bne _opn4 tya lsr @ tay cpx #0 beq *+7 lda #0 sta odoortable,y lda odoortable,y beq *+3 rts ldy #0 _open3 lda screen,y cmp #82 beq _open4 cmp #80 bne _open2 lda kieszen+7 * bne *+6 * lda #0 * beq *+4 * lda #18 sta screen+32,y ora #1 sta screen+33,y jmp _open2 _open4 lda kieszen+7 jsr wyswietl _open2 iny iny bne _open3 rts _pmbclear equ * lda #0 ldx #0 _clear sta pmadres+1024,x sta pmadres+1280,x sta pmadres+1536,x sta pmadres+1792,x sta msadres,x inx bne _clear rts _inf equ * lda kieszen+2 jsr _inf2 stx info+6 sty info+5 lda kieszen jsr _inf2 stx info+3 sty info+2 lda kieszen+1 jsr _inf2 stx info+9 sty info+8 lda kieszen+4 jsr _inf2 stx info+12 sty info+11 lda kieszen+5 jsr _inf2 stx info+15 sty info+14 rts _inf2 pha and #%00001111 clc adc #16 tax pla lsr @ lsr @ lsr @ lsr @ clc adc #16 tay rts doortable equ $8600 zebtable equ doortable+12 pozyc_table equ doortable+82 eladrtable equ doortable+122 zebratable dta d'........................................' odoortable dta d'......'