home *** CD-ROM | disk | FTP | other *** search
- j:
- move.w #$2000,d0
- lea $60000,a0
- fill_plane:
- clr.w (a0)+
- dbf d0,fill_plane
-
- move.l $4,a6
- jsr -150(a6)
- move.l d0,sysstack
- lea gfxname,a1
- jsr -408(a6)
- move.l d0,gfxbase
- move.l d0,a6
- move.l d0,a5
- add.l #$32,a5
- move.l (a5),coppersave
- move.l #copper,(a5)
- move.w #$20,$dff096
- bsr star_init
-
- raster:
- cmp.b #$f0,$dff006
- bne raster
-
- bsr star
- mbutton:
- btst #6,$bfe001
- bne raster
-
- move.w #$8020,$dff096
- move.l $4,a6
- move.l sysstack,d0
- jsr -156(a6)
- move.l gfxbase,a5
- add.l #$32,a5
- move.l coppersave,(a5)
- move.l $4,a6
- move.l gfxbase,a1
- jsr -414(a6)
- rts
-
- even
- gfxname: dc.b 'graphics.library',0
- even
- gfxbase: dc.l 0
- coppersave: dc.l 0
- sysstack: dc.l 0
- old_irq: dc.w 0
-
- copper:
- dc.l $008e2c81 ;display window
- dc.l $009050d8
- dc.l $00920038 ;data fetch 40 bytes
- dc.l $009400d0
- dc.l $00e00006
- dc.l $00e20000
- dc.l $00e40006
- dc.l $00e61f40
- dc.l $01800000
- dc.l $01820666
- dc.l $01860aaa
- dc.l $01840fff
- dc.l $01002200
- dc.l $f007fffe
- dc.l $01000000
- dc.l -2
-
- star: ;STAR ROUTINE
- bsr star_clear_screen
-
- clr.l d6
- lea star_tabell,a0
- lea star_clear_tabell,a5
-
- star_loop: ;setter alla stars
- clr.l d0
- clr.l d1
- clr.l d2
- move.w (a0)+,d0
- move.w (a0)+,d1
- move.w (a0)+,d2
- bsr star_on ;hopp till star on
- add.l #4,a5
- add.w #1,d6
- cmp.w antal_star,d6
- bne star_loop
-
- clr.l d6
- lea star_tabell,a0
- star_flytt_loop: ;flyttar star nermare
- sub.w #1,(a0)
- cmp.w #0,(a0)
- bne star_flytt_loop1
- bsr ny_star
- star_flytt_loop1:
- add.l #6,a0
- add.w #1,d6
- cmp.w antal_star,d6
- bne star_flytt_loop
- rts
-
- ny_star: ;ny stjerna
- movem.l d0-d7/a0-a6,-(a7)
- mulu #6,d6
- lea star_tabell,a0
- add.l d6,a0
- move.w star_start_z,(a0)+
- bsr random ;slump y
- asr.w #5,d0 ;space size y
- move.w d0,(a0)+
- bsr random ;slump x
- asr.w #5,d0 ;space size x
- move.w d0,(a0)+
- movem.l (a7)+,d0-d7/a0-a6
- rts
-
- random: ;slumtal
- move.w rnd,d0
- mulu #$3723,d0
- add.w #$7646,d0
- move.w d0,rnd
- rts
- RND: dc.w $0876
-
- star_on: ;setter dit en stjerna
- movem.l d0-d7/a0-a6,-(a7)
- clr.l d3
- clr.l d4
- add.w oga_till_tv_size_z,d0 ;riktig star z
- move.w oga_till_tv_size_z,d3 ;skerm y till d3
- muls d1,d3
- divs d0,d3
- swap d3
- clr.w d3
- swap d3
- move.w oga_till_tv_size_z,d4 ;skerm x till d4
- muls d2,d4
- divs d0,d4
- swap d4
- clr.w d4
- swap d4
- add.w star_bild_centrum_y,d3 ;star till mitten
- add.w star_bild_centrum_x,d4
- cmp.w star_bild_size_y,d3 ;kollar utanfor skerm
- bhi star_ej_on
- cmp.w star_bild_size_x,d4
- bhi star_ej_on
-
- clr.l d1 ;bit on
- move.w star_bild_size_x,d1
- divu #8,d1
- mulu d3,d1
- divu #8,d4
- add.w d4,d1
- add.l #star_bild,d1
- move.l d1,a0
- swap d4
- eor.b #15,d4
- move.l a0,(a5) ;spar star poss
-
- cmp.w star_intenc_1,d0
- blt star_ej_bit_1
- bset d4,(a0) ;setter star bit 1
-
- star_ej_bit_1:
- cmp.w star_intenc_2,d0
- bgt star_ej_bit_2
- clr.l d0
- move.w star_bild_size_x,d0
- divu #8,d0
- mulu star_bild_size_y,d0
- add.l d0,a0
- bset d4,(a0) ;setter star bit 2
-
- star_ej_bit_2:
- movem.l (a7)+,d0-d7/a0-a6
- rts
-
- star_ej_on:
- jsr ny_star
- movem.l (a7)+,d0-d7/a0-a6
- rts
-
- star_CLEAR_SCREEN:
- lea star_clear_tabell,a0
- clr.l d0
- move.w star_bild_size_x,d1
- divu #8,d1
- mulu star_bild_size_y,d1
-
- star_clear_screen_loop:
- move.l (a0)+,a1
- clr.b (a1)
- add.l d1,a1
- clr.b (a1)
- add.w #1,d0
- cmp.w antal_star,d0
- bne star_clear_screen_loop
- rts
-
- star_init: ;star init
- clr.l d6
- lea star_tabell,a0
-
- star_init_loop:
- move.w d6,d0
- mulu #6,d0 ;SLUMP START Z <===--
- move.w d0,(a0)+
- bsr random ;slump av star y
- asr.w #5,d0
- move.w d0,(a0)+
- bsr random ;slump av star x
- asr.w #5,d0
- move.w d0,(a0)+
- add.w #1,d6
- cmp.w antal_star,d6
- bne star_init_loop
- clr.l d0
- move.w star_start_z,d0
- divu #3,d0
- move.w d0,star_intenc_1
- mulu #2,d0
- move.w d0,star_intenc_2
- rts
-
- star_intenc_1: dc.w 0 ;skrivs av init
- star_intenc_2: dc.w 0
-
- oga_till_tv_size_z: dc.w 3
- star_bild_size_x: dc.w 320
- star_bild_size_y: dc.w 200
- star_bild_centrum_x: dc.w 160
- star_bild_centrum_y: dc.w 100
- antal_star: dc.w 20
- star_start_z: dc.w 100
-
- star_tabell: blk.b 20*6,1 ;20 stars
- star_clear_tabell: blk.b 20*8 ;20 stars
- star_bild=$60000