; /| ; //|. ; //_| . ; __ // /| . ; /_ \/\__|. ; \\_/ _/|_ ; .g.e.n.d.a. ; ;______________________________________________________ ; ; ; nabuchodonosor 256b ; ;______________________________________________________ ; ; CODE: svoy ;______________________________________________________ ; ; Silly Venture 2017 256b intro, Party Version ;______________________________________________________ ; tomaswoj@gmail.com ; http://pl.linkedin.com/in/tomaswoj ; Cracow opt h+ org $1200 xcal_l equ $d8 ; xcalcd LSB ycal_l equ $d9 curad_h equ $e1 ; current screen line address curad_l equ $e2 xpix equ $f0 xcalcd equ $f2 yrow equ $f1 ycalcd equ $f3 frmcnt equ $f4 offset equ $fe lda #12 ; set text mode jsr $EF9C ; setup charset (on page 40=$28, so it can be used as screen line memory offset, 40b) lda #$28 sta $2f4 sta offset ; setup colors ;lda #$01 ;sta 712 ;lda #$32 ; dark pink, nice ;lda #$22 ; red, nice ;lda #$92 ; med-sea blue, nice ;asl ;lda #$81 ; blue, nice ;lda #$41 ;asl ;sta 709 ; nicer but 1b more ;sax 709 ;asl ;inx ;sta 710 ;asl ;sta 711 ; sprites setup lda #$2e ; wide, PM enabled sta 709 sta $22f ; reuse the position asl-ed to setup PMG size and screen size sta $D01D ; reuse that to enable players ;lda #$30 ; sta $D407 ; reuse that to set PM memory page - $2e asl sta $D000 ; set position - 1st (ship left half) adc #8 sta $D002 ; set position - 3rd (ship engines) adc #8 sta $D001 ; set position - 2nd (ship right half) ;lda #$90 ; ship color color ; POT2 ;sta 704 ;inc 704 ;sta 705 ;inc 705 frame: sty yrow ; set yrow to 0 on new frame lda 88 ;lda fm1_h sta curad_h lda 89 ;lda fm1_l sta curad_l lines: ldy #39 ; 39 pixels pixels: ldx #1 ; (index1: ycalcd=yrow-8) stx $D008 ; and use this #1 to set double size PMG0 stx $D009 ; and double size PMG1 stx $D00a ; and double size PMG2 stx 623 ; right sprite priorities (over playfield) lda yrow jsr subs tya sta xpix dex; -> x=0 jsr subs ; (index0: xcalcd = xpix - 8) txa ; POT pha ; use stack for xcal_l ;stx xcal_l ;(0) stx ycal_l ;(0) ldx frmcnt ; use frame count as depth offset (increasing) cast: ;lda xcal_l ; if (distx>22 || disty>16) break, just check proper bits from high parts of xcal/ycal pla pha ; we are polluting the stack, but we don't know if we reach next pha down cmp #64 ; 2c bcs beyo adc xcalcd ; 3c ; xcalc+=xcalcd ;sta xcal_l pha lda ycal_l cmp #64 bcs beyo adc ycalcd ; ycalc+=ycalcd sta ycal_l ; 3c inx bne cast beyo: ; depthmap = (depth^distx^disty)/16 ; bit shifting magic :) ;lda xcal_l pla eor ycal_l lsr sta xcal_l txa ; depth into accu , 2c lse xcal_l ; illegal, shift right xcal_l, then eor with accu, one lsr above shaved lsr lsr lsr sta (curad_h),Y ; engine color sta 706 ; engine sounds ora #%1101000 sta $D201 ; ctrl sta $D200 dey bne pixels ; if no pixels left go to next line ; update addresses by 40bytes (next line clc lda curad_h adc offset sta curad_h bcc nocarry ; if no carry - skip add inc curad_l nocarry: clc lda #24 isb yrow ; (inc memory, then subs from accumulator - illegal, but how nice! :) 2 bytes less bne lines isb frmcnt ; inc frmcnt, then subs from accumulator bne frame ; heh, this will go to frame until frmcnt reaches 255 subs: sbc #8 bcs skipneg ; we want offset to be > 0 eor #$FF ; negation if needed ;adc #1 ; looks like has no effect skipneg: sta xcalcd,x rts ; dither table ;org $2800 ;org $2820 ;org $2828 ; looks nice org $282f ; better ending chars dta b(68,0,17,0,68,0,17,0) dta b(68,17,0,68,17,0,68,17) dta b(68,17,85,68,17,85,68,17) dta b(17,85,68,85,17,85,68,85) dta b(85,85,85,85,85,85,85,85) dta b(153,85,102,85,153,85,102,85) ;dta b(153,102,85,153,102,85,153,102) ;dta b(153,102,170,153,102,170,153,102) ;dta b(102,170,153,170,102,170,153,170) ;dta b(170,170,170,170,170,170,170,170) ;dta b(238,170,187,170,238,170,187,170) ;dta b(238,187,170,238,187,170,238,187) ;dta b(238,187,255,238,187,255,238,187) ;dta b(255,255,255,255,255,255,255,255) ; nabuchodonosor ship ;org $3259 org $2e59 sp1 dta b($f,$1f,$3f,$3f,$7f,$7f,$7f,$e4,$c4,$ff) ;org $32da org $2eda sp2 dta b($c0, $e0, $f8, $fc, $fe, $93, $93, $fe) ;org $335f org $2f5f sp3 dta b($6,$36,$30) ; POT1