/[projet1]/public/oric/games/Dungeon Demo/BAK3/GRAF.S
Defence Force logotype

Contents of /public/oric/games/Dungeon Demo/BAK3/GRAF.S

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1376 - (show annotations)
Mon Jul 25 19:48:05 2016 UTC (3 years, 3 months ago) by dbug
File size: 5011 byte(s)
Added the complete (not cleaned up, pure legacy) source code and assets for the 1996 Dungeon Master tech demo.
To get that to actually work, you need (at least):
- A dos machine (or a Windows 95/Windows 98)
- The Wacom compiler
- The old version of the Oric Compiler toolchain (the OSDK ancestor)

1 ;
2 ;
3 ; Fastgraf 6502 assembly library
4 ; (c) 1996 Micka‰l POINTIER (Dbug from NeXT)
5 ;
6 ;
7
8
9 ;
10 ; void AffText(ptr_screen,ptr_chaine)
11 ;
12 ; Nb: L'adresse de base de la fonte en Hires est $9800 (std) ou $9c00 (alt)
13 ; Chaque jeu de caracteres fait 1Ko.
14 ; Le jeu alternate est effac‚ sur 256 octets (32 premiers caracteres) et
15 ; contient une table de saut sur chaque caractere de la fonte standard
16 ;
17 _AffText
18 ldy #0
19 lda (sp),y
20 sta text_screen_adr+1
21
22 iny
23 lda (sp),y
24 sta text_screen_adr+2
25
26
27 iny
28 lda (sp),y
29 sta text_string+1
30
31 iny
32 lda (sp),y
33 sta text_string+2
34
35
36 ldy #0
37 text_string
38 lda $2211,y ; a=[127-0]
39 beq text_exit
40
41 asl a ; a*2 a=[255-0] (Nb: 'Carry' forcement nulle !)
42 tax ; x=offset sur adresse de base
43 lda $9c00,x
44 sta text_loop_car+1
45 lda $9c01,x
46 sta text_loop_car+2
47
48 ldx #0
49 text_loop_car
50 lda $2211,x
51 ora #64
52 text_screen_adr
53 sta $a000
54
55 clc ; Screen+=40
56 lda text_screen_adr+1
57 adc #40
58 sta text_screen_adr+1
59 lda text_screen_adr+2
60 adc #0
61 sta text_screen_adr+2
62
63 inx
64 cpx #8
65 bne text_loop_car
66
67 sec ; Screen-=(40*8-1)
68 lda text_screen_adr+1
69 sbc #$3f
70 sta text_screen_adr+1
71 lda text_screen_adr+2
72 sbc #$01
73 sta text_screen_adr+2
74
75 iny
76 jmp text_string
77 text_exit
78 rts
79
80
81
82
83 ;
84 ; void FillColumn(ptr_screen,height,value)
85 ;
86 _FillColumn
87 ldy #0
88 lda (sp),y
89 sta loop_y+1 ; dest
90
91 iny
92 lda (sp),y
93 sta loop_y+2 ; dest
94
95 iny
96 lda (sp),y
97 sta auto_hh+1 ; hauteur
98 iny
99
100 iny
101 lda (sp),y ; value
102 tax
103
104 auto_hh
105 ldy #5
106 loop_y
107 stx $2211 ; destination
108 clc
109 lda loop_y+1
110 adc #40
111 sta loop_y+1
112 bcc next_loop
113 lda loop_y+2
114 adc #0
115 sta loop_y+2
116
117 next_loop
118 dey
119 bne loop_y
120 rts
121
122
123
124
125
126 ;
127 ; void FillBox(ptr_screen-1,(largeur|hauteur),value)
128 ;
129 _FillBox
130 ldy #0
131 lda (sp),y
132 sta loop_x_fillbox+1 ; dest
133
134 iny
135 lda (sp),y
136 sta loop_x_fillbox+2 ; dest
137
138 iny
139 lda (sp),y
140 sta auto_l_fillbox+1 ; largeur
141 iny
142 lda (sp),y
143 sta auto_h_fillbox+1 ; hauteur
144
145 iny
146 lda (sp),y ; value
147 sta auto_v_fillbox+1
148
149 auto_h_fillbox
150 ldy #22
151 loop_y_fillbox
152 auto_l_fillbox
153 ldx #5
154 auto_v_fillbox
155 lda #3
156 loop_x_fillbox
157 sta $2211,x ; destination
158 dex
159 bne loop_x_fillbox
160
161 clc
162 lda loop_x_fillbox+1
163 adc #40
164 sta loop_x_fillbox+1
165 bcc next_loop_fill
166 lda loop_x_fillbox+2
167 adc #0
168 sta loop_x_fillbox+2
169
170 next_loop_fill
171 dey
172 bne loop_y_fillbox
173 rts
174
175
176
177
178
179 ;
180 ; void SetSpriteSize(unsigned int (offset|largeur),unsigned int hauteur);
181 ;
182 _SetSpriteSize
183 ldy #0
184 lda (sp),y ; l
185 sta auto_l+1
186 sta auto_src+1
187
188 iny
189 lda (sp),y ; offset (si 0, on touche pas !)
190 beq end_offset
191 clc
192 adc auto_src+1
193 sta auto_src+1
194 end_offset
195
196 iny
197 lda (sp),y ; h
198 sta auto_h+1
199 rts
200
201
202
203
204
205 ;
206 ; void DrawSprite(ptr_dst-1,ptr_src-1)
207 ;
208 _DrawSprite
209 ldy #0
210 lda (sp),y
211 sta draw_sprite_loop_x+4 ; dest
212
213 iny
214 lda (sp),y
215 sta draw_sprite_loop_x+5 ; dest
216
217 iny
218 lda (sp),y
219 sta draw_sprite_loop_x+1 ; source
220
221 iny
222 lda (sp),y
223 sta draw_sprite_loop_x+2 ; source
224
225 auto_h
226 ldy #22
227
228 draw_sprite_loop_y
229
230 auto_l
231 ldx #5
232
233 draw_sprite_loop_x
234 lda $2211,x ; source
235 sta $5544,x ; destination
236 dex
237 bne draw_sprite_loop_x
238
239 clc
240 lda draw_sprite_loop_x+1
241 auto_src
242 adc #5
243 sta draw_sprite_loop_x+1
244 bcc go_dest
245 lda draw_sprite_loop_x+2
246 adc #0
247 sta draw_sprite_loop_x+2
248
249 go_dest
250 clc
251 lda draw_sprite_loop_x+4
252 adc #40
253 sta draw_sprite_loop_x+4
254 bcc go_end
255 lda draw_sprite_loop_x+5
256 adc #0
257 sta draw_sprite_loop_x+5
258 go_end
259 dey
260 bne draw_sprite_loop_y
261 rts
262
263
264
265
266 ;
267 ; The first text line in hires is at adress $bf68
268 ;
269 ; void AddMessage(char *message,char color)
270 ;
271 _AddMessage
272 ;
273 ; Commence par faire scroller d'une ligne
274 ; vers le haut de l'‚cran
275 ;
276 ldx #0
277 scroll_loop
278 lda $bf90,x ; line 1
279 sta $bf68,x ; line 0
280 inx
281 cpx #80
282 bne scroll_loop
283
284 ;
285 ; Effacement de la troisieme ligne
286 ; sauf le premier caractere qui est un Attribut
287 ;
288 ldx #40
289 erase_loop
290 sta $bfb8,x ; line 2
291 dex
292 bne erase_loop
293
294 ;
295 ; Inscription de l'attribut couleur
296 ; Puis affichage en colonne 2 du texte
297 ;
298 ldy #0
299 lda (sp),y
300 sta print_loop+1
301
302 iny
303 lda (sp),y
304 sta print_loop+2
305
306 iny
307 lda (sp),y
308 sta $bfb8 ; Met l'attribut couleur
309
310 ldx #0
311 print_loop
312 lda $2211,x ; source
313 beq exit
314 sta $bfb9,x ; destination
315 inx
316 bne print_loop
317 exit
318 rts
319
320
321
322
323 ; void AddMessage(char *message,char color)
324 ; {
325 ; printf("\n%s",message);
326 ; LastTimeMessage=GetTime();
327 ; /*
328 ; memcpy(LINES+0 ,LINES+40,80);
329 ; memset(LINES+80,' ' ,40);
330 ; LINES[80]=color;
331 ; memcpy(LINES+81,message,strlen(message));
332 ; */
333 ; }
334
335
336
337 ; void DrawSprite(ptr_dst,ptr_src)
338 ; {
339 ; int x,y;
340 ; unsigned char *ptr_src;
341 ;
342 ; ptr_src=sprites+num*22*5;
343 ; for (y=0;y<22;y++)
344 ; {
345 ; memcpy(adresse,ptr_src,5);
346 ; adresse+=40;
347 ; ptr_src+=5;
348 ; }
349 ; }
350

  ViewVC Help
Powered by ViewVC 1.1.26