-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBACKGRND.S
115 lines (75 loc) · 1.69 KB
/
BACKGRND.S
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
bg_init: movem.l d0/a0,-(sp)
movem.l (sp)+,d0/a0
rts
bg_load_title: movem.l a0,-(sp)
lea background,a0
move.l #bg_title_file,filename.l
move.l #background,filebuffer.l
jsr loader
movem.l (sp)+,a0
rts
bg_load_game: movem.l a0,-(sp)
lea background,a0
move.l #bg_game_file,filename.l
move.l #background,filebuffer.l
jsr loader
movem.l (sp)+,a0
rts
bg_draw: movem.l a0-a1,-(sp)
lea background,a0
movea.l screen_adr,a1
jsr full_screen
movem.l (sp)+,a0-a1
rts
bg_draw_bb: movem.l a0-a1,-(sp)
lea background,a0
movea.l screen_adr1,a1
jsr full_screen
lea background,a0
movea.l screen_adr2,a1
jsr full_screen
movem.l (sp)+,a0-a1
rts
bg_16x16: ; 100% UNTESTED!!!!!!!
movem.l d1/a0-a1,-(sp) ; draw 16x16 of bg at d0,d1
; to screen
lea background,a1
move.l screen_adr,a0
lsl.l #1,d0 ; double x coord 2bpp
adda.l d0,a0
adda.l d0,a1
; should be able to use a LUT to
; avoid the multiplication below
mulu.l #v_scr_w*2,d1 ; y-offset
adda.l d1,a0
adda.l d1,a1
move.w #15,d0 ; draw row at a time
bg161:
move.w (a1)+,(a0)+
move.w (a1)+,(a0)+
move.w (a1)+,(a0)+
move.w (a1)+,(a0)+
move.w (a1)+,(a0)+
move.w (a1)+,(a0)+
move.w (a1)+,(a0)+
move.w (a1)+,(a0)+
move.w (a1)+,(a0)+
move.w (a1)+,(a0)+
move.w (a1)+,(a0)+
move.w (a1)+,(a0)+
move.w (a1)+,(a0)+
move.w (a1)+,(a0)+
move.w (a1)+,(a0)+
move.w (a1)+,(a0)+
adda.l #v_scr_w*2-16*2,a0 ; next row
adda.l #v_scr_w*2-16*2,a1
dbf d0,bg161
movem.l (sp)+,d1/a0-a1
rts
section bss
even
background: ds.b scr_w*scr_h*2
section data
bg_title_file dc.b 'data\title.bin',0
bg_game_file dc.b 'data\MARS.BIN',0
even