OpenCores
URL https://opencores.org/ocsvn/395_vgs/395_vgs/trunk

Subversion Repositories 395_vgs

[/] [395_vgs/] [trunk/] [src/] [PIC18/] [intro.casm] - Blame information for rev 32

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 zuofu
;/////////////////////////////////////////////////////////////////////////////////
2
;// Code Generator: BoostC Compiler and Linker - http://www.picant.com/c2c/c.html
3 31 zuofu
;// License Type  : Full License
4
;// Limitations   : PIC18 max code size:Unlimited, max RAM banks:Unlimited, Non commercial use only
5 27 zuofu
;/////////////////////////////////////////////////////////////////////////////////
6
 
7
#include 
8
#include "gpu_pic.h"
9
 
10
//Loads the source address (registers 0, 1, and 2) into the GPU
11
void load_s_addr(unsigned long address)
12
 
13
{
14
        portc = 0x02;                                                           //Load least significant byte
15 31 zuofu
0122  0E02              MOVLW 0x02
16
0124  6E82              MOVWF gbl_portc
17 27 zuofu
 
18
        portb = (char) (0x000000FF & address);
19 31 zuofu
0126  503D              MOVF load_s_add_0000C_arg_address, W
20
0128  0BFF              ANDLW 0xFF
21
012A  6E81              MOVWF gbl_portb
22 27 zuofu
 
23
        porta = 0x01;                                                           //enable load
24 31 zuofu
012C  0E01              MOVLW 0x01
25
012E  6E80              MOVWF gbl_porta
26 27 zuofu
 
27
        porta = 0x00;                                                           //load complete
28 31 zuofu
0130  6A80              CLRF gbl_porta
29 27 zuofu
 
30
        address >>= 8;
31 31 zuofu
0132  503E              MOVF load_s_add_0000C_arg_address+D'1', W
32
0134  6E3D              MOVWF load_s_add_0000C_arg_address
33
0136  503F              MOVF load_s_add_0000C_arg_address+D'2', W
34
0138  6E3E              MOVWF load_s_add_0000C_arg_address+D'1'
35
013A  5040              MOVF load_s_add_0000C_arg_address+D'3', W
36
013C  6E3F              MOVWF load_s_add_0000C_arg_address+D'2'
37
013E  6A40              CLRF load_s_add_0000C_arg_address+D'3'
38 27 zuofu
 
39
        portc = 0x01;                                                           //Load middle byte
40 31 zuofu
0140  0E01              MOVLW 0x01
41
0142  6E82              MOVWF gbl_portc
42 27 zuofu
 
43
        portb = (char) (0x000000FF & address);
44 31 zuofu
0144  503D              MOVF load_s_add_0000C_arg_address, W
45
0146  0BFF              ANDLW 0xFF
46
0148  6E81              MOVWF gbl_portb
47 27 zuofu
 
48
        porta = 0x01;                                                           //enable load
49 31 zuofu
014A  0E01              MOVLW 0x01
50
014C  6E80              MOVWF gbl_porta
51 27 zuofu
 
52
        porta = 0x00;                                                           //load complete
53 31 zuofu
014E  6A80              CLRF gbl_porta
54 27 zuofu
 
55
        address >>= 8;
56 31 zuofu
0150  503E              MOVF load_s_add_0000C_arg_address+D'1', W
57
0152  6E3D              MOVWF load_s_add_0000C_arg_address
58
0154  503F              MOVF load_s_add_0000C_arg_address+D'2', W
59
0156  6E3E              MOVWF load_s_add_0000C_arg_address+D'1'
60
0158  5040              MOVF load_s_add_0000C_arg_address+D'3', W
61
015A  6E3F              MOVWF load_s_add_0000C_arg_address+D'2'
62
015C  6A40              CLRF load_s_add_0000C_arg_address+D'3'
63 27 zuofu
 
64
        portc = 0x00;                                                           //Load most significant byte
65 31 zuofu
015E  6A82              CLRF gbl_portc
66 27 zuofu
 
67
        portb = (char) (0x000000FF & address);
68 31 zuofu
0160  503D              MOVF load_s_add_0000C_arg_address, W
69
0162  0BFF              ANDLW 0xFF
70
0164  6E81              MOVWF gbl_portb
71 27 zuofu
 
72
        porta = 0x01;                                                           //enable load
73 31 zuofu
0166  0E01              MOVLW 0x01
74
0168  6E80              MOVWF gbl_porta
75 27 zuofu
 
76
        porta = 0x00;                                                           //load complete
77 31 zuofu
016A  6A80              CLRF gbl_porta
78 27 zuofu
 
79
        return;
80
}
81 31 zuofu
016C  0012              RETURN
82 27 zuofu
 
83
 
84
void load_t_addr(unsigned long address)
85
 
86
{
87
        portc = 0x05;
88 31 zuofu
016E  0E05              MOVLW 0x05
89
0170  6E82              MOVWF gbl_portc
90 27 zuofu
 
91
        portb = (char) (0x000000FF & address);
92 31 zuofu
0172  503D              MOVF load_t_add_0000B_arg_address, W
93
0174  0BFF              ANDLW 0xFF
94
0176  6E81              MOVWF gbl_portb
95 27 zuofu
 
96
        porta = 0x01;
97 31 zuofu
0178  0E01              MOVLW 0x01
98
017A  6E80              MOVWF gbl_porta
99 27 zuofu
 
100
        porta = 0x00;
101 31 zuofu
017C  6A80              CLRF gbl_porta
102 27 zuofu
 
103
        address >>= 8;
104 31 zuofu
017E  503E              MOVF load_t_add_0000B_arg_address+D'1', W
105
0180  6E3D              MOVWF load_t_add_0000B_arg_address
106
0182  503F              MOVF load_t_add_0000B_arg_address+D'2', W
107
0184  6E3E              MOVWF load_t_add_0000B_arg_address+D'1'
108
0186  5040              MOVF load_t_add_0000B_arg_address+D'3', W
109
0188  6E3F              MOVWF load_t_add_0000B_arg_address+D'2'
110
018A  6A40              CLRF load_t_add_0000B_arg_address+D'3'
111 27 zuofu
 
112
        portc = 0x04;
113 31 zuofu
018C  0E04              MOVLW 0x04
114
018E  6E82              MOVWF gbl_portc
115 27 zuofu
 
116
        portb = (char) (0x000000FF & address);
117 31 zuofu
0190  503D              MOVF load_t_add_0000B_arg_address, W
118
0192  0BFF              ANDLW 0xFF
119
0194  6E81              MOVWF gbl_portb
120 27 zuofu
 
121
        porta = 0x01;
122 31 zuofu
0196  0E01              MOVLW 0x01
123
0198  6E80              MOVWF gbl_porta
124 27 zuofu
 
125
        porta = 0x00;
126 31 zuofu
019A  6A80              CLRF gbl_porta
127 27 zuofu
 
128
        address >>= 8;
129 31 zuofu
019C  503E              MOVF load_t_add_0000B_arg_address+D'1', W
130
019E  6E3D              MOVWF load_t_add_0000B_arg_address
131
01A0  503F              MOVF load_t_add_0000B_arg_address+D'2', W
132
01A2  6E3E              MOVWF load_t_add_0000B_arg_address+D'1'
133
01A4  5040              MOVF load_t_add_0000B_arg_address+D'3', W
134
01A6  6E3F              MOVWF load_t_add_0000B_arg_address+D'2'
135
01A8  6A40              CLRF load_t_add_0000B_arg_address+D'3'
136 27 zuofu
 
137
        portc = 0x03;
138 31 zuofu
01AA  0E03              MOVLW 0x03
139
01AC  6E82              MOVWF gbl_portc
140 27 zuofu
 
141
        portb = (char) (0x000000FF & address);
142 31 zuofu
01AE  503D              MOVF load_t_add_0000B_arg_address, W
143
01B0  0BFF              ANDLW 0xFF
144
01B2  6E81              MOVWF gbl_portb
145 27 zuofu
 
146
        porta = 0x01;
147 31 zuofu
01B4  0E01              MOVLW 0x01
148
01B6  6E80              MOVWF gbl_porta
149 27 zuofu
 
150
        porta = 0x00;
151 31 zuofu
01B8  6A80              CLRF gbl_porta
152 27 zuofu
 
153
        return;
154
}
155 31 zuofu
01BA  0012              RETURN
156 27 zuofu
 
157
 
158
void load_s_lines(unsigned lines)
159
 
160
{
161
        portc = 0x07;
162 31 zuofu
01BC  0E07              MOVLW 0x07
163
01BE  6E82              MOVWF gbl_portc
164 27 zuofu
 
165
        portb = (char) (0x00FF & lines);
166 31 zuofu
01C0  503D              MOVF load_s_lin_0000A_arg_lines, W
167
01C2  0BFF              ANDLW 0xFF
168
01C4  6E81              MOVWF gbl_portb
169 27 zuofu
 
170
        porta = 0x01;
171 31 zuofu
01C6  0E01              MOVLW 0x01
172
01C8  6E80              MOVWF gbl_porta
173 27 zuofu
 
174
        porta = 0x00;
175 31 zuofu
01CA  6A80              CLRF gbl_porta
176 27 zuofu
 
177
        lines >>= 8;
178 31 zuofu
01CC  503E              MOVF load_s_lin_0000A_arg_lines+D'1', W
179
01CE  6E3D              MOVWF load_s_lin_0000A_arg_lines
180
01D0  6A3E              CLRF load_s_lin_0000A_arg_lines+D'1'
181 27 zuofu
 
182
        portc = 0x06;
183 31 zuofu
01D2  0E06              MOVLW 0x06
184
01D4  6E82              MOVWF gbl_portc
185 27 zuofu
 
186
        portb = (char) (0x00FF & lines);
187 31 zuofu
01D6  503D              MOVF load_s_lin_0000A_arg_lines, W
188
01D8  0BFF              ANDLW 0xFF
189
01DA  6E81              MOVWF gbl_portb
190 27 zuofu
 
191
        porta = 0x01;
192 31 zuofu
01DC  0E01              MOVLW 0x01
193
01DE  6E80              MOVWF gbl_porta
194 27 zuofu
 
195
        porta = 0x00;
196 31 zuofu
01E0  6A80              CLRF gbl_porta
197 27 zuofu
 
198
        return;
199
}
200 31 zuofu
01E2  0012              RETURN
201 27 zuofu
 
202
 
203
void load_l_size(unsigned size)
204
 
205
{
206
        portc = 0x09;
207 31 zuofu
01E4  0E09              MOVLW 0x09
208
01E6  6E82              MOVWF gbl_portc
209 27 zuofu
 
210
        portb = (char) (0x00FF & size);
211 31 zuofu
01E8  503D              MOVF load_l_siz_00009_arg_size, W
212
01EA  0BFF              ANDLW 0xFF
213
01EC  6E81              MOVWF gbl_portb
214 27 zuofu
 
215
        porta = 0x01;
216 31 zuofu
01EE  0E01              MOVLW 0x01
217
01F0  6E80              MOVWF gbl_porta
218 27 zuofu
 
219
        porta = 0x00;
220 31 zuofu
01F2  6A80              CLRF gbl_porta
221 27 zuofu
 
222
        size >>= 8;
223 31 zuofu
01F4  503E              MOVF load_l_siz_00009_arg_size+D'1', W
224
01F6  6E3D              MOVWF load_l_siz_00009_arg_size
225
01F8  6A3E              CLRF load_l_siz_00009_arg_size+D'1'
226 27 zuofu
 
227
        portc = 0x08;
228 31 zuofu
01FA  0E08              MOVLW 0x08
229
01FC  6E82              MOVWF gbl_portc
230 27 zuofu
 
231
        portb = (char) (0x000F & size);
232 31 zuofu
01FE  503D              MOVF load_l_siz_00009_arg_size, W
233
0200  0B0F              ANDLW 0x0F
234
0202  6E81              MOVWF gbl_portb
235 27 zuofu
 
236
        porta = 0x01;
237 31 zuofu
0204  0E01              MOVLW 0x01
238
0206  6E80              MOVWF gbl_porta
239 27 zuofu
 
240
        porta = 0x00;
241 31 zuofu
0208  6A80              CLRF gbl_porta
242 27 zuofu
 
243
        return;
244
}
245 31 zuofu
020A  0012              RETURN
246 27 zuofu
 
247
 
248
void load_alphaOp( bool alphaOp)
249
 
250
{
251
        portc = 0x0A;
252 31 zuofu
020C  0E0A              MOVLW 0x0A
253
020E  6E82              MOVWF gbl_portc
254 27 zuofu
 
255
        if (alphaOp)
256 31 zuofu
0210  A03D              BTFSS load_alpha_00008_arg_alphaOp,0
257
0212  D003              BRA     label268435770
258
021A            label268435770
259 27 zuofu
 
260
                portb = 0x01;
261 31 zuofu
0214  0E01              MOVLW 0x01
262
0216  6E81              MOVWF gbl_portb
263 27 zuofu
 
264
        else
265 31 zuofu
0218  D001              BRA     label268435773
266
021C            label268435773
267 27 zuofu
 
268
                portb = 0x00;
269 31 zuofu
021A  6A81              CLRF gbl_portb
270 27 zuofu
 
271
        porta = 0x01;
272 31 zuofu
021C  0E01              MOVLW 0x01
273
021E  6E80              MOVWF gbl_porta
274 27 zuofu
 
275
        porta = 0x00;
276 31 zuofu
0220  6A80              CLRF gbl_porta
277 27 zuofu
 
278
        return;
279
}
280 31 zuofu
0222  0012              RETURN
281 27 zuofu
 
282
 
283
void draw()
284
 
285
{
286
        porta = 00000010b;                                      //initialize draw
287 31 zuofu
0116  0E02              MOVLW 0x02
288
0118  6E80              MOVWF gbl_porta
289 27 zuofu
 
290
        porta = 00000000b;                                      //draw command recieved, so turn off draw bit
291 31 zuofu
011A  6A80              CLRF gbl_porta
292 27 zuofu
 
293 31 zuofu
        while ( !(portd & 10000000b) )          //hang here till we recieve idle from GPU
294
011C            label268435830
295
011C  AE83              BTFSS gbl_portd,7
296
011E  D7FE              BRA     label268435830
297 27 zuofu
 
298
        {
299
        }
300
}
301 31 zuofu
0120  0012              RETURN
302 27 zuofu
 
303
 
304
 
305
//draw a fullscreen background
306
void drawtobackground ( Bitmap source )
307
 
308
{
309
        load_t_addr(0x00000000);
310 31 zuofu
02BA  6A3D              CLRF load_t_add_0000B_arg_address
311
02BC  6A3E              CLRF load_t_add_0000B_arg_address+D'1'
312
02BE  6A3F              CLRF load_t_add_0000B_arg_address+D'2'
313
02C0  6A40              CLRF load_t_add_0000B_arg_address+D'3'
314
02C2  ECB7F000          CALL load_t_add_0000B
315 27 zuofu
 
316
        load_s_addr(source.address);
317 31 zuofu
02C6  5020              MOVF drawtoback_00007_arg_source, W
318
02C8  6E3D              MOVWF load_s_add_0000C_arg_address
319
02CA  5021              MOVF drawtoback_00007_arg_source+D'1', W
320
02CC  6E3E              MOVWF load_s_add_0000C_arg_address+D'1'
321
02CE  5022              MOVF drawtoback_00007_arg_source+D'2', W
322
02D0  6E3F              MOVWF load_s_add_0000C_arg_address+D'2'
323
02D2  5023              MOVF drawtoback_00007_arg_source+D'3', W
324
02D4  6E40              MOVWF load_s_add_0000C_arg_address+D'3'
325
02D6  EC91F000          CALL load_s_add_0000C
326 27 zuofu
 
327
        load_s_lines(source.lines);
328 31 zuofu
02DA  5026              MOVF drawtoback_00007_arg_source+D'6', W
329
02DC  6E3D              MOVWF load_s_lin_0000A_arg_lines
330
02DE  5027              MOVF drawtoback_00007_arg_source+D'7', W
331
02E0  6E3E              MOVWF load_s_lin_0000A_arg_lines+D'1'
332
02E2  ECDEF000          CALL load_s_lin_0000A
333 27 zuofu
 
334
        load_l_size(source.width);
335 31 zuofu
02E6  5024              MOVF drawtoback_00007_arg_source+D'4', W
336
02E8  6E3D              MOVWF load_l_siz_00009_arg_size
337
02EA  5025              MOVF drawtoback_00007_arg_source+D'5', W
338
02EC  6E3E              MOVWF load_l_siz_00009_arg_size+D'1'
339
02EE  ECF2F000          CALL load_l_siz_00009
340 27 zuofu
 
341
        load_alphaOp(false);
342 31 zuofu
02F2  903D              BCF load_alpha_00008_arg_alphaOp,0
343
02F4  EC06F001          CALL load_alpha_00008
344 27 zuofu
 
345
        draw();
346 31 zuofu
02F8  EC8BF000          CALL draw_00000
347 27 zuofu
 
348
}
349 31 zuofu
02FC  0012              RETURN
350 27 zuofu
 
351
 
352
void drawsprite (Sprite sprite)
353
 
354
{
355
        unsigned long destination_address = sprite.position.y * 160;
356 31 zuofu
0224  502C              MOVF drawsprite_00000_arg_sprite+D'12', W
357
0226  6E35              MOVWF __mul_32_3_00006_arg_a
358
0228  502D              MOVF drawsprite_00000_arg_sprite+D'13', W
359
022A  6E36              MOVWF __mul_32_3_00006_arg_a+D'1'
360
022C  502E              MOVF drawsprite_00000_arg_sprite+D'14', W
361
022E  6E37              MOVWF __mul_32_3_00006_arg_a+D'2'
362
0230  502F              MOVF drawsprite_00000_arg_sprite+D'15', W
363
0232  6E38              MOVWF __mul_32_3_00006_arg_a+D'3'
364
0234  0EA0              MOVLW 0xA0
365
0236  6E39              MOVWF __mul_32_3_00006_arg_b
366
0238  6A3A              CLRF __mul_32_3_00006_arg_b+D'1'
367
023A  6A3B              CLRF __mul_32_3_00006_arg_b+D'2'
368
023C  6A3C              CLRF __mul_32_3_00006_arg_b+D'3'
369
023E  EC4CF000          CALL __mul_32_3_00006
370
0242  5000              MOVF CompTempVarRet0, W
371
0244  6E31              MOVWF drawsprite_00000_1_destina_0000D
372
0246  5001              MOVF CompTempVarRet0+D'1', W
373
0248  6E32              MOVWF drawsprite_00000_1_destina_0000D+D'1'
374
024A  5002              MOVF CompTempVarRet0+D'2', W
375
024C  6E33              MOVWF drawsprite_00000_1_destina_0000D+D'2'
376
024E  5003              MOVF CompTempVarRet0+D'3', W
377
0250  6E34              MOVWF drawsprite_00000_1_destina_0000D+D'3'
378 27 zuofu
 
379
        destination_address += sprite.position.x;
380 31 zuofu
0252  5028              MOVF drawsprite_00000_arg_sprite+D'8', W
381
0254  2631              ADDWF drawsprite_00000_1_destina_0000D, F
382
0256  5029              MOVF drawsprite_00000_arg_sprite+D'9', W
383
0258  2232              ADDWFC drawsprite_00000_1_destina_0000D+D'1', F
384
025A  502A              MOVF drawsprite_00000_arg_sprite+D'10', W
385
025C  2233              ADDWFC drawsprite_00000_1_destina_0000D+D'2', F
386
025E  502B              MOVF drawsprite_00000_arg_sprite+D'11', W
387
0260  2234              ADDWFC drawsprite_00000_1_destina_0000D+D'3', F
388 27 zuofu
 
389
        load_t_addr(destination_address);
390 31 zuofu
0262  5031              MOVF drawsprite_00000_1_destina_0000D, W
391
0264  6E3D              MOVWF load_t_add_0000B_arg_address
392
0266  5032              MOVF drawsprite_00000_1_destina_0000D+D'1', W
393
0268  6E3E              MOVWF load_t_add_0000B_arg_address+D'1'
394
026A  5033              MOVF drawsprite_00000_1_destina_0000D+D'2', W
395
026C  6E3F              MOVWF load_t_add_0000B_arg_address+D'2'
396
026E  5034              MOVF drawsprite_00000_1_destina_0000D+D'3', W
397
0270  6E40              MOVWF load_t_add_0000B_arg_address+D'3'
398
0272  ECB7F000          CALL load_t_add_0000B
399 27 zuofu
 
400
        load_s_addr(sprite.image.address);
401 31 zuofu
0276  5020              MOVF drawsprite_00000_arg_sprite, W
402
0278  6E3D              MOVWF load_s_add_0000C_arg_address
403
027A  5021              MOVF drawsprite_00000_arg_sprite+D'1', W
404
027C  6E3E              MOVWF load_s_add_0000C_arg_address+D'1'
405
027E  5022              MOVF drawsprite_00000_arg_sprite+D'2', W
406
0280  6E3F              MOVWF load_s_add_0000C_arg_address+D'2'
407
0282  5023              MOVF drawsprite_00000_arg_sprite+D'3', W
408
0284  6E40              MOVWF load_s_add_0000C_arg_address+D'3'
409
0286  EC91F000          CALL load_s_add_0000C
410 27 zuofu
 
411
        load_s_lines(sprite.image.lines);
412 31 zuofu
028A  5026              MOVF drawsprite_00000_arg_sprite+D'6', W
413
028C  6E3D              MOVWF load_s_lin_0000A_arg_lines
414
028E  5027              MOVF drawsprite_00000_arg_sprite+D'7', W
415
0290  6E3E              MOVWF load_s_lin_0000A_arg_lines+D'1'
416
0292  ECDEF000          CALL load_s_lin_0000A
417 27 zuofu
 
418
        load_l_size(sprite.image.width);
419 31 zuofu
0296  5024              MOVF drawsprite_00000_arg_sprite+D'4', W
420
0298  6E3D              MOVWF load_l_siz_00009_arg_size
421
029A  5025              MOVF drawsprite_00000_arg_sprite+D'5', W
422
029C  6E3E              MOVWF load_l_siz_00009_arg_size+D'1'
423
029E  ECF2F000          CALL load_l_siz_00009
424 27 zuofu
 
425
        if (sprite.alpha)
426 31 zuofu
02A2  5230              MOVF drawsprite_00000_arg_sprite+D'16', F
427
02A4  E004              BZ      label268435755
428
02AE            label268435755
429 27 zuofu
 
430
                load_alphaOp(true);
431 31 zuofu
02A6  803D              BSF load_alpha_00008_arg_alphaOp,0
432
02A8  EC06F001          CALL load_alpha_00008
433 27 zuofu
 
434
        else
435 31 zuofu
02AC  D003              BRA     label268435761
436
02B4            label268435761
437 27 zuofu
 
438
                load_alphaOp(false);
439 31 zuofu
02AE  903D              BCF load_alpha_00008_arg_alphaOp,0
440
02B0  EC06F001          CALL load_alpha_00008
441 27 zuofu
 
442
        draw();
443 31 zuofu
02B4  EC8BF000          CALL draw_00000
444 27 zuofu
 
445
}
446 31 zuofu
02B8  0012              RETURN
447 27 zuofu
 
448
 
449
#include 
450
#include "gpu_pic.h"
451 31 zuofu
#include "input.h"
452 27 zuofu
 
453
#pragma CLOCK_FREQ 50000000                                             //required for accurate delay functionality
454 31 zuofu
//#pragma DATA 0x2007, 0x3F3A                                   //Configuration bits to prevent having to configure in programmer
455 27 zuofu
 
456
 
457 31 zuofu
void scene1(void)
458 27 zuofu
{
459
        char i = 0;
460
        char j = 0;
461
 
462 31 zuofu
        //initalize graphics to original settings
463
 
464
        Bitmap black;
465
                black.address = 0x0001C200;
466
                black.lines = 0x00F0;
467
                black.width = 0x00A0;
468 27 zuofu
 
469 31 zuofu
        Sprite near_future;
470
                near_future.image.address = 0x00025800;
471
                near_future.image.lines = 0x000B;
472
                near_future.image.width = 0x00A0;
473
                near_future.position.x = 0;
474
                near_future.position.y = 63;
475
                near_future.alpha = 0;
476 27 zuofu
 
477 31 zuofu
        Sprite eye_anim;
478
                eye_anim.image.address = 0x00026CA0;
479
                eye_anim.image.lines = 0x001B;
480
                eye_anim.image.width = 0x001F;
481
                eye_anim.position.x = 14;
482
                eye_anim.position.y = 135;
483
                eye_anim.alpha = 0;
484
 
485
        Sprite eye_mask;
486
                eye_mask.image.address = 0x0001C200;
487
                eye_mask.image.lines = 0x001B;
488
                eye_mask.image.width = 0x001F;
489
                eye_mask.position.x = 14;
490
                eye_mask.position.y = 135;
491
                eye_mask.alpha = 0;
492
 
493
        Sprite compass;
494
                compass.image.address = 0x00029A40;
495
                compass.image.lines = 0x0006;
496
                compass.image.width = 0x002D;
497
                compass.position.x = 51;
498
                compass.position.y = 134;
499
                compass.alpha = 0;
500 27 zuofu
 
501 31 zuofu
        Sprite lines;
502
                lines.image.address = 0x00029E00;
503
                lines.image.lines = 0x001A;
504
                lines.image.width = 0x004F;
505
                lines.position.x = 73;
506
                lines.position.y = 76;
507
                lines.alpha = 0;
508 27 zuofu
 
509 31 zuofu
        Sprite bars;
510
                bars.image.address = 0x0002AE94;
511
                bars.image.lines = 15;
512
                bars.image.width = 0x002F;
513
                bars.position.x = 10;
514
                bars.position.y = 81;
515
                bars.alpha = 0;
516 27 zuofu
 
517 31 zuofu
        Sprite outline;
518
                outline.image.address = 0x00027D80;
519
                outline.image.lines = 46;
520
                outline.image.width = 43;
521
                outline.position.x = 27;
522
                outline.position.y = 130;
523
                outline.alpha = 1;
524 27 zuofu
 
525 31 zuofu
//right limit is about 94,
526
//left limit is about 51
527
/*
528
        Sprite north;
529
                north.image.address = 0x00029ACA;
530
                north.image.lines = 6;
531
                north.image.width = 2;
532
                north.position.x =      92;
533
                north.position.y = 128;
534
                north.alpha = 1;
535 27 zuofu
 
536 31 zuofu
        Sprite east;
537
                east.image.address = 0x00029ACE;
538
                east.image.lines = 6;
539
                east.image.width = 2;
540
                east.position.x =       51;
541
                east.position.y = 128;
542
                east.alpha = 1;
543 27 zuofu
 
544 31 zuofu
        Sprite south;
545
                south.image.address = 0x00029AD2;
546
                south.image.lines = 6;
547
                south.image.width = 2;
548
                south.position.x =      65;
549
                south.position.y = 128;
550
                south.alpha = 1;
551 27 zuofu
 
552 31 zuofu
        Sprite west;
553
                west.image.address = 0x00029AD6;
554
                west.image.lines = 6;
555
                west.image.width = 2;
556
                west.position.x =       80;
557
                west.position.y = 128;
558
                west.alpha = 1;
559
*/
560
        //fade in introduction text
561
        drawtobackground(black);
562
        delay_s(2);
563
        drawsprite(near_future);
564
        delay_ms(255);
565
        near_future.image.address = 0X00025EE0;
566
        drawtobackground(black);
567
        drawsprite(near_future);
568
        delay_ms(255);
569
        near_future.image.address = 0X000265C0;
570
        drawtobackground(black);
571
        drawsprite(near_future);
572
        delay_s(2);
573
        //black screen - dramatic pause
574
        drawtobackground(black);
575
        delay_s(2);
576
        //draw eye open animation
577
        for (i = 0; i < 5; i++)
578
        {
579
                drawsprite(eye_mask);
580
                drawsprite(eye_anim);
581
                eye_anim.image.address += 0x00000020;
582
                delay_ms(100);
583
        }
584
        //draw and animate compass
585
        j = 30;
586
        for ( i = 0; i < 5; i++)//slow down
587
        {
588
                drawsprite(compass);//1
589
                compass.image.address += 0x0000002E;
590
                delay_ms(j);
591
                drawsprite(compass);//2
592
                compass.image.address += 0x0000002E;
593
                delay_ms(j);
594
                drawsprite(compass);//3
595
                compass.image.address -= 0x0000005C;
596
                delay_ms(j);
597
                j+= 15;
598
        }
599
        j=20;
600
        for ( i = 0; i < 5; i++)//reverse
601
        {
602
                compass.image.address += 0x0000005C;
603
                drawsprite(compass);//3
604
                compass.image.address -= 0x0000002E;
605
                delay_ms(j);
606
                drawsprite(compass);//2
607
                compass.image.address -= 0x0000002E;
608
                delay_ms(j);
609
                drawsprite(compass);//1
610
                delay_ms(j);
611
                j+= 15;
612
        }
613
        j=150;
614
        for ( i = 0; i < 3; i++)//speed up
615
        {
616
                drawsprite(compass);//1
617
                compass.image.address += 0x0000002E;
618
                delay_ms(j);
619
                drawsprite(compass);//2
620
                compass.image.address += 0x0000002E;
621
                delay_ms(j);
622
                drawsprite(compass);//3
623
                compass.image.address -= 0x0000005C;
624
                delay_ms(j);
625
                j-= 60;
626
        }
627
        drawsprite (lines);
628
        drawsprite (bars);
629 27 zuofu
 
630 31 zuofu
        j=10;
631
        for ( i = 0; i < 2; i++)//slow down
632
        {
633
                drawsprite(compass);
634
                compass.image.address += 0x0000002E;
635
                delay_ms(j);
636
                drawsprite(compass);//2
637
                compass.image.address += 0x0000002E;
638
                delay_ms(j);
639
                drawsprite(compass);//3
640
                compass.image.address -= 0x0000005C;
641
                delay_ms(j);
642
                j+= 40;
643
        }
644 27 zuofu
 
645 31 zuofu
        lines.image.address = 0x00029E50;
646
        lines.image.width = 0x004B;
647
        bars.image.address += 0x00000960;
648
        bars.image.width = 0x0035;
649
        drawsprite (lines);
650
        drawsprite (bars);
651
 
652
        drawsprite(compass);
653
        compass.image.address += 0x0000002E;
654
        delay_ms(j);
655
        drawsprite(compass);//2
656
        compass.image.address += 0x0000002E;
657
        delay_ms(j);
658
        drawsprite(compass);//3
659
        compass.image.address -= 0x0000005C;
660
        delay_ms(j);
661
        j+= 40;
662 27 zuofu
 
663 31 zuofu
        lines.image.address = 0x0002AE40;
664
        lines.image.width = 0x0053;
665
        bars.image.address += 0x0000960;
666
        drawsprite (lines);
667
        drawsprite (bars);
668
 
669
        //last compass animation
670
        //drawsprite (north);
671
        //drawsprite (south);
672
        //drawsprite (east);
673
        //drawsprite (west);
674 27 zuofu
 
675 31 zuofu
        drawsprite(compass);
676
        compass.image.address += 0x0000002E;
677
        delay_ms(j);
678
        drawsprite(compass);//2
679
        compass.image.address += 0x0000002E;
680
        delay_ms(j);
681
        drawsprite(compass);//3
682
        compass.image.address -= 0x0000005C;
683
        delay_ms(j);
684
        drawsprite(compass);//1
685
 
686
        lines.image.address = 0x0002BE80;
687
        bars.image.address += 0x00000961;
688
        bars.image.width = 0x0036;
689
        drawsprite (lines);
690
        drawsprite (bars);
691
        delay_ms(200);
692 27 zuofu
 
693 31 zuofu
        lines.image.address = 0x0002CEC0;
694
        lines.image.lines = 32;
695
        lines.image.width = 84;
696
        lines.position.x = 72;
697
        lines.position.y = 75;
698
        bars.image.address += 0x00000960;
699
        drawsprite (bars);
700
        drawsprite (lines);
701
        delay_ms(50);
702
        bars.image.address = 0x000713E0;
703
        bars.image.lines = 21;
704
        bars.image.width = 62;
705
        bars.position.x = 4;
706
        bars.position.y = 80;
707
        drawsprite (bars);
708
        drawsprite (lines);
709 27 zuofu
 
710 31 zuofu
        //glitch stuff up
711
        for (i = 0; i < 50; i++)
712
        {
713
                bars.image.address = 0x000713E0;
714
                lines.image.address = 0x000821E0;
715
                drawsprite(bars);
716
                drawsprite (lines);
717
                delay_ms(5);
718
                bars.image.address = 0x000706C0;
719
                lines.image.address = 0x0002CEC0;
720
                drawsprite(bars);
721
                drawsprite (lines);
722
                delay_ms(5);
723
        }
724 27 zuofu
 
725 31 zuofu
        //draw overlay
726 27 zuofu
 
727 31 zuofu
        drawsprite (outline);
728 27 zuofu
 
729 31 zuofu
        for (i = 0; i < 30; i++)
730
        {
731
                bars.image.address = 0x000713E0;
732
                lines.image.address = 0x000821E0;
733
                drawsprite(bars);
734
                drawsprite (lines);
735
                delay_ms(5);
736
                bars.image.address = 0x000706C0;
737
                lines.image.address = 0x0002CEC0;
738
                drawsprite(bars);
739
                drawsprite (lines);
740
                delay_ms(5);
741
        }
742 27 zuofu
 
743 31 zuofu
        //draw eye close animation with overlay
744
        eye_anim.image.address = 0x00026D20;
745
        for (i = 0; i < 5; i++)
746
        {
747
                drawsprite(eye_mask);
748
                drawsprite(eye_anim);
749
                drawsprite(outline);
750
                eye_anim.image.address -= 0x00000020;
751
                delay_ms(50);
752
        }
753
        //draw eye open with overlay
754
        eye_anim.image.address = 0x00026CA0;
755
        for (i = 0; i < 5; i++)
756
        {
757
                drawsprite(eye_mask);
758
                drawsprite(eye_anim);
759
                drawsprite(outline);
760
                eye_anim.image.address += 0x00000020;
761
                delay_ms(50);
762
        }
763 27 zuofu
 
764 31 zuofu
        delay_ms(255);
765
        //draw rest of overlay
766
        drawsprite(eye_mask);
767
        outline.position.x = 24;
768
        outline.image.address = 0x00027DAB;
769
        outline.image.width = 46;
770
        drawsprite(outline);
771
        drawsprite(compass);
772
        delay_ms(200);
773
        outline.image.address = 0x00027DD9;
774
        outline.image.width = 60;
775
        drawsprite(outline);
776
        drawsprite(compass);
777
        delay_s(2);
778
 
779
        return;
780
}
781
void scene2(void)
782
{
783
        char i = 0;
784
        char j = 0;
785
 
786
        //initalize graphics to original settings
787
 
788
        Bitmap black;
789
                black.address = 0x0001C200;
790
                black.lines = 0x00F0;
791
                black.width = 0x00A0;
792
 
793
        Sprite pilot;
794
                pilot.image.address = 0x000AB180;//0x000A4740;
795
                pilot.image.lines = 170;
796
                pilot.image.width = 77;
797
                pilot.position.x = 20;
798
                pilot.position.y = 39;
799
                pilot.alpha = 1;
800
 
801
        Sprite screen0;
802
                screen0.image.address = 0x000A86AD;
803
                screen0.image.lines = 69;
804
                screen0.image.width = 40;
805
                screen0.position.x = 72;
806
                screen0.position.y = 71;
807
                screen0.alpha = 1;
808 27 zuofu
 
809 31 zuofu
        Sprite screen1;
810
                screen1.image.address = 0x000A4F0D;
811
                screen1.image.lines = 89;
812
                screen1.image.width = 59;
813
                screen1.position.x = 72;
814
                screen1.position.y = 59;
815
                screen1.alpha = 1;
816 27 zuofu
 
817 31 zuofu
        Sprite screen2;
818
                screen2.image.address = 0x0009E5C0;
819
                screen2.image.lines = 156;
820
                screen2.image.width = 57;
821
                screen2.position.x = 49;
822
                screen2.position.y = 25;
823
                screen2.alpha = 1;
824
 
825
        Sprite screen3;
826
                screen3.image.address = 0x0009E5F9;
827
                screen3.image.lines = 156;
828
                screen3.image.width = 38;
829
                screen3.position.x = 106;
830
                screen3.position.y = 25;
831
                screen3.alpha = 1;
832
 
833
        Sprite screen4;
834
                screen4.image.address = 0x0009A060;
835
                screen4.image.lines = 111;
836
                screen4.image.width = 40;
837
                screen4.position.x = 13;
838
                screen4.position.y = 3;
839
                screen4.alpha = 1;
840
 
841
        Sprite screen5;
842
                screen5.image.address = 0x0009A095;
843
                screen5.image.lines = 111;
844
                screen5.image.width = 21;
845
                screen5.position.x = 67;
846
                screen5.position.y = 3;
847
                screen5.alpha = 1;
848
 
849
        Sprite screen6;
850
                screen6.image.address = 0x00099EEB;
851
                screen6.image.lines = 17;
852
                screen6.image.width = 17;
853
                screen6.position.x = 120;
854
                screen6.position.y = 2;
855
                screen6.alpha = 1;
856
 
857
        Sprite screen7;
858
                screen7.image.address = 0x000AA575;
859
                screen7.image.lines = 20;
860
                screen7.image.width = 16;
861
                screen7.position.x = 143;
862
                screen7.position.y = 188;
863
                screen7.alpha = 1;
864
 
865
        Sprite boot0;
866
                boot0.image.address = 0x000A478D;
867
                boot0.image.lines = 12;
868
                boot0.image.width = 59;
869
                boot0.position.x = 6;
870
                boot0.position.y = 15;
871
                boot0.alpha = 1;
872
 
873
        Sprite boot1;
874
                boot1.image.address = 0x000A0EBF;
875
                boot1.image.lines = 9;
876
                boot1.image.width = 65;
877
                boot1.position.x = 6;
878
                boot1.position.y = 29;
879
                boot1.alpha = 1;
880
 
881
        Sprite boot2;
882
                boot2.image.address = 0x000A145F;
883
                boot2.image.lines = 9;
884
                boot2.image.width = 65;
885
                boot2.position.x = 6;
886
                boot2.position.y = 44;
887
                boot2.alpha = 1;
888
 
889
        Sprite boot3;
890
                boot3.image.address = 0x000A19FF;
891
                boot3.image.lines = 9;
892
                boot3.image.width = 26;
893
                boot3.position.x = 6;
894
                boot3.position.y = 58;
895
                boot3.alpha = 1;
896 27 zuofu
 
897 31 zuofu
        Sprite boot4;
898
                boot4.image.address = 0x00099AC0;
899
                boot4.image.lines = 9;
900
                boot4.image.width = 60;
901
                boot4.position.x = 6;
902
                boot4.position.y = 73;
903
                boot4.alpha = 1;
904 27 zuofu
 
905 31 zuofu
        Sprite boot5;
906
                boot5.image.address = 0x00099AFC;
907
                boot5.image.lines = 9;
908
                boot5.image.width = 60;
909
                boot5.position.x = 66;
910
                boot5.position.y = 73;
911
                boot5.alpha = 1;
912
 
913
        drawtobackground (black);
914
        delay_s(1);
915
        drawsprite(pilot);
916
        delay_ms(200);
917
        drawsprite(screen0);
918
        //flash newest screen
919
        for (i = 0; i < 10; i++)
920
        {
921 27 zuofu
                drawtobackground(black);
922 31 zuofu
                drawsprite(pilot);
923
                delay_ms(25);
924
                drawsprite(screen0);
925
                delay_ms(25);
926
        }
927
        drawsprite(screen1);
928
        for (i = 0; i < 10; i++)
929
        {
930 27 zuofu
                drawtobackground(black);
931 31 zuofu
                drawsprite(pilot);
932
                drawsprite(screen0);
933
                delay_ms(25);
934
                drawsprite(screen1);
935
                delay_ms(25);
936
        }
937
 
938
        drawsprite(screen2);
939
        drawsprite(screen3);
940
        for (i = 0; i < 10; i++)
941
        {
942
                drawtobackground(black);
943
                drawsprite(pilot);
944
                drawsprite(screen0);
945
                drawsprite(screen1);
946
                delay_ms(25);
947
                drawsprite(screen2);
948
                drawsprite(screen3);
949
                delay_ms(25);
950
                if (i == 3)
951
                        pilot.image.address = 0x000AB1CD;
952
        }
953 27 zuofu
 
954 31 zuofu
        delay_ms(255);
955
        drawsprite(screen4);
956
        drawsprite(screen5);
957
        drawsprite(screen6);
958
        drawsprite(screen7);
959
        for (i = 0; i < 10; i++)
960
        {
961 27 zuofu
                drawtobackground(black);
962 31 zuofu
                drawsprite(pilot);
963
                drawsprite(screen0);
964
                drawsprite(screen1);
965
                drawsprite(screen2);
966
                drawsprite(screen3);
967
                delay_ms(25);
968
                drawsprite(screen4);
969
                drawsprite(screen5);
970
                drawsprite(screen6);
971
                drawsprite(screen7);
972
                delay_ms(25);
973
                if (i == 7)
974
                        pilot.image.address = 0x000A4740;
975
        }
976 27 zuofu
 
977 31 zuofu
        delay_s (1);
978
        drawsprite(boot0);
979
        delay_ms(255);
980
        delay_ms(255);
981
        drawsprite(boot1);
982
        delay_ms(255);
983
        delay_ms(255);
984
        delay_ms(255);
985
        drawsprite(boot2);
986
        delay_s(2);
987
        drawsprite(boot3);
988
        delay_ms(255);
989
        drawsprite(boot4);
990
        drawsprite(boot5);
991
        delay_s(1);
992 27 zuofu
 
993 31 zuofu
        return;
994
}
995 27 zuofu
 
996 31 zuofu
void scene4(void)
997
{
998
        char i = 0;
999
        char j = 0;
1000 27 zuofu
 
1001 31 zuofu
        Bitmap black;
1002
                black.address = 0x0001C200;
1003
                black.lines = 0x00F0;
1004
                black.width = 0x00A0;
1005
 
1006
        Sprite skyline;
1007
                skyline.image.address = 0x00090510;
1008
                skyline.image.lines = 320;
1009
                skyline.image.width = 0;
1010
                skyline.position.x = 80;
1011
                skyline.position.y = 0;
1012
                skyline.alpha = 0;
1013
 
1014
        Sprite plane_1;
1015
                plane_1.image.address = 0x0008B7E0;
1016
                plane_1.image.lines = 123;
1017
                plane_1.image.width = 40;
1018
                plane_1.position.x = 0;
1019
                plane_1.position.y = 200;
1020
                plane_1.alpha = 1;
1021
 
1022
        Sprite plane_2;
1023
                plane_2.image.address = 0x0008B808;
1024
                plane_2.image.lines = 123;
1025
                plane_2.image.width = 40;
1026
                plane_2.position.x = 40;
1027
                plane_2.position.y = 200;
1028
                plane_2.alpha = 1;
1029
 
1030
        Sprite plane_3;
1031
                plane_3.image.address = 0x0008B830;
1032
                plane_3.image.lines = 123;
1033
                plane_3.image.width = 40;
1034
                plane_3.position.x = 80;
1035
                plane_3.position.y = 200;
1036
                plane_3.alpha = 1;
1037
 
1038
        Sprite plane_4;
1039
                plane_4.image.address = 0x0008B858;
1040
                plane_4.image.lines = 123;
1041
                plane_4.image.width = 40;
1042
                plane_4.position.x = 120;
1043
                plane_4.position.y = 200;
1044
                plane_4.alpha = 1;
1045
 
1046
        drawtobackground(black);
1047
 
1048
        for (i = 0; i <80 ; i++)
1049
        {
1050
                drawsprite (skyline);
1051
                drawsprite (plane_1);
1052
                drawsprite (plane_2);
1053
                drawsprite (plane_3);
1054
                drawsprite (plane_4);
1055
                //do some slide fx here
1056
                skyline.image.width +=2;
1057
                skyline.image.address --;
1058
                skyline.position.x --;
1059
 
1060
                plane_1.position.y -= 1;
1061
                plane_2.position.y -= 1;
1062
                plane_3.position.y -= 1;
1063
                plane_4.position.y -= 1;
1064
 
1065
                delay_ms(20 + i/2);
1066
        }
1067
        delay_s(3);
1068
}
1069 27 zuofu
 
1070 31 zuofu
void scene5(void)
1071
{
1072
        char i = 0;
1073
        char j = 0;
1074
        unsigned long takeoff_addr[8] =
1075
        {
1076
                0x0002E720,
1077
                0x000332C0,
1078
                0x00037E60,
1079
                0x0003CA00,
1080
                0x00040BA0,
1081
                0x00044D40,
1082
                0x00049840,
1083
                0x0004E3E0
1084
        };
1085
        char takeoff_lines[8] =
1086
        {
1087
                121,
1088
                121,
1089
                121,
1090
                105,
1091
                105,
1092
                120,
1093
                120,
1094
                121
1095
        };
1096
        Bitmap black;
1097
                black.address = 0x0001C200;
1098
                black.lines = 0x00F0;
1099
                black.width = 0x00A0;
1100
 
1101
        Sprite takeoff;
1102
                takeoff.image.address = takeoff_addr[0];
1103
                takeoff.image.lines = takeoff_lines[0];
1104
                takeoff.image.width = 160;
1105
                takeoff.position.x = 0;
1106
                takeoff.position.y = 49;
1107
                takeoff.alpha = 0;
1108
 
1109
        drawtobackground(black);
1110
 
1111
        //accelerate plane
1112
        for (i = 0; i < 15 ; i++)
1113
        {
1114
                for ( j = 0; j < 8; j++)
1115 27 zuofu
                {
1116 31 zuofu
                        drawsprite (takeoff);
1117
                        takeoff.image.address = takeoff_addr[j];
1118
                        takeoff.image.lines = takeoff_lines[j];
1119
                        delay_ms (100 - (i * 4));
1120 27 zuofu
                }
1121 31 zuofu
        }
1122 27 zuofu
 
1123 31 zuofu
        //max speed
1124
        for (i = 0; i < 10 ; i++)
1125
        {
1126
                for ( j = 0; j < 8; j++)
1127 27 zuofu
                {
1128 31 zuofu
                        drawsprite (takeoff);
1129
                        takeoff.image.address = takeoff_addr[j];
1130
                        takeoff.image.lines = takeoff_lines[j];
1131
                        delay_ms(40);
1132 27 zuofu
                }
1133 31 zuofu
        }
1134 27 zuofu
 
1135 31 zuofu
}
1136 27 zuofu
 
1137 31 zuofu
void bootup(void)
1138 27 zuofu
 
1139 31 zuofu
{
1140
        char i = 0;
1141
0334  6A05              CLRF bootup_00000_1_i
1142 27 zuofu
 
1143 31 zuofu
        char j = 0;
1144
0336  6A06              CLRF bootup_00000_1_j
1145 27 zuofu
 
1146
 
1147 31 zuofu
        Bitmap black;
1148
                black.address = 0x0001C200;
1149
0338  6A07              CLRF bootup_00000_1_black
1150
033A  0EC2              MOVLW 0xC2
1151
033C  6E08              MOVWF bootup_00000_1_black+D'1'
1152
033E  0E01              MOVLW 0x01
1153
0340  6E09              MOVWF bootup_00000_1_black+D'2'
1154
0342  6A0A              CLRF bootup_00000_1_black+D'3'
1155 27 zuofu
 
1156 31 zuofu
                black.lines = 0x00F0;
1157
0344  0EF0              MOVLW 0xF0
1158
0346  6E0D              MOVWF bootup_00000_1_black+D'6'
1159
0348  6A0E              CLRF bootup_00000_1_black+D'7'
1160 27 zuofu
 
1161 31 zuofu
                black.width = 0x00A0;
1162
034A  0EA0              MOVLW 0xA0
1163
034C  6E0B              MOVWF bootup_00000_1_black+D'4'
1164
034E  6A0C              CLRF bootup_00000_1_black+D'5'
1165 27 zuofu
 
1166
 
1167 31 zuofu
        Sprite frame;
1168
                frame.image.address = 0x00376800;
1169
0350  6A0F              CLRF bootup_00000_1_frame
1170
0352  0E68              MOVLW 0x68
1171
0354  6E10              MOVWF bootup_00000_1_frame+D'1'
1172
0356  0E37              MOVLW 0x37
1173
0358  6E11              MOVWF bootup_00000_1_frame+D'2'
1174
035A  6A12              CLRF bootup_00000_1_frame+D'3'
1175 27 zuofu
 
1176 31 zuofu
                frame.image.lines = 160;
1177
035C  0EA0              MOVLW 0xA0
1178
035E  6E15              MOVWF bootup_00000_1_frame+D'6'
1179
0360  6A16              CLRF bootup_00000_1_frame+D'7'
1180 27 zuofu
 
1181 31 zuofu
                frame.image.width = 79;
1182
0362  0E4F              MOVLW 0x4F
1183
0364  6E13              MOVWF bootup_00000_1_frame+D'4'
1184
0366  6A14              CLRF bootup_00000_1_frame+D'5'
1185 27 zuofu
 
1186 31 zuofu
                frame.position.x = 0;
1187
0368  6A17              CLRF bootup_00000_1_frame+D'8'
1188
036A  6A18              CLRF bootup_00000_1_frame+D'9'
1189
036C  6A19              CLRF bootup_00000_1_frame+D'10'
1190
036E  6A1A              CLRF bootup_00000_1_frame+D'11'
1191 27 zuofu
 
1192 31 zuofu
                frame.position.y = 0;
1193
0370  6A1B              CLRF bootup_00000_1_frame+D'12'
1194
0372  6A1C              CLRF bootup_00000_1_frame+D'13'
1195
0374  6A1D              CLRF bootup_00000_1_frame+D'14'
1196
0376  6A1E              CLRF bootup_00000_1_frame+D'15'
1197 27 zuofu
 
1198 31 zuofu
                frame.alpha = 0;
1199
0378  6A1F              CLRF bootup_00000_1_frame+D'16'
1200 27 zuofu
 
1201
 
1202 31 zuofu
        //reset frame to center
1203
        frame.position.x = 40;
1204
037A  0E28              MOVLW 0x28
1205
037C  6E17              MOVWF bootup_00000_1_frame+D'8'
1206
037E  6A18              CLRF bootup_00000_1_frame+D'9'
1207
0380  6A19              CLRF bootup_00000_1_frame+D'10'
1208
0382  6A1A              CLRF bootup_00000_1_frame+D'11'
1209 27 zuofu
 
1210 31 zuofu
        frame.position.y = 40;
1211
0384  0E28              MOVLW 0x28
1212
0386  6E1B              MOVWF bootup_00000_1_frame+D'12'
1213
0388  6A1C              CLRF bootup_00000_1_frame+D'13'
1214
038A  6A1D              CLRF bootup_00000_1_frame+D'14'
1215
038C  6A1E              CLRF bootup_00000_1_frame+D'15'
1216 27 zuofu
 
1217
 
1218 31 zuofu
        drawtobackground(black);
1219
038E  500E              MOVF bootup_00000_1_black+D'7', W
1220
0390  6E27              MOVWF drawtoback_00007_arg_source+D'7'
1221
0392  500D              MOVF bootup_00000_1_black+D'6', W
1222
0394  6E26              MOVWF drawtoback_00007_arg_source+D'6'
1223
0396  500C              MOVF bootup_00000_1_black+D'5', W
1224
0398  6E25              MOVWF drawtoback_00007_arg_source+D'5'
1225
039A  500B              MOVF bootup_00000_1_black+D'4', W
1226
039C  6E24              MOVWF drawtoback_00007_arg_source+D'4'
1227
039E  500A              MOVF bootup_00000_1_black+D'3', W
1228
03A0  6E23              MOVWF drawtoback_00007_arg_source+D'3'
1229
03A2  5009              MOVF bootup_00000_1_black+D'2', W
1230
03A4  6E22              MOVWF drawtoback_00007_arg_source+D'2'
1231
03A6  5008              MOVF bootup_00000_1_black+D'1', W
1232
03A8  6E21              MOVWF drawtoback_00007_arg_source+D'1'
1233
03AA  5007              MOVF bootup_00000_1_black, W
1234
03AC  6E20              MOVWF drawtoback_00007_arg_source
1235
03AE  EC5DF001          CALL drawtoback_00007
1236 27 zuofu
 
1237 31 zuofu
 
1238
        delay_ms(200);
1239
03B2  0EC8              MOVLW 0xC8
1240
03B4  6E20              MOVWF delay_ms_00000_arg_del
1241
03B6  EC02F000          CALL delay_ms_00000
1242 27 zuofu
 
1243
 
1244 31 zuofu
        //play boot movie
1245
        for (i = 0; i <  21; i++)
1246
03BA  6A05              CLRF bootup_00000_1_i
1247
03BC            label268437212
1248
03BC  0E15              MOVLW 0x15
1249
03BE  6005              CPFSLT bootup_00000_1_i
1250
03C0  D072              BRA     label268437213
1251
04A2  2A05              INCF bootup_00000_1_i, F
1252
04A4  D78B              BRA     label268437212
1253
04A6            label268437213
1254 27 zuofu
 
1255 31 zuofu
        {
1256
                //show 'left' frame
1257
                drawsprite (frame);
1258
03C2  501F              MOVF bootup_00000_1_frame+D'16', W
1259
03C4  6E30              MOVWF drawsprite_00000_arg_sprite+D'16'
1260
03C6  501E              MOVF bootup_00000_1_frame+D'15', W
1261
03C8  6E2F              MOVWF drawsprite_00000_arg_sprite+D'15'
1262
03CA  501D              MOVF bootup_00000_1_frame+D'14', W
1263
03CC  6E2E              MOVWF drawsprite_00000_arg_sprite+D'14'
1264
03CE  501C              MOVF bootup_00000_1_frame+D'13', W
1265
03D0  6E2D              MOVWF drawsprite_00000_arg_sprite+D'13'
1266
03D2  501B              MOVF bootup_00000_1_frame+D'12', W
1267
03D4  6E2C              MOVWF drawsprite_00000_arg_sprite+D'12'
1268
03D6  501A              MOVF bootup_00000_1_frame+D'11', W
1269
03D8  6E2B              MOVWF drawsprite_00000_arg_sprite+D'11'
1270
03DA  5019              MOVF bootup_00000_1_frame+D'10', W
1271
03DC  6E2A              MOVWF drawsprite_00000_arg_sprite+D'10'
1272
03DE  5018              MOVF bootup_00000_1_frame+D'9', W
1273
03E0  6E29              MOVWF drawsprite_00000_arg_sprite+D'9'
1274
03E2  5017              MOVF bootup_00000_1_frame+D'8', W
1275
03E4  6E28              MOVWF drawsprite_00000_arg_sprite+D'8'
1276
03E6  5016              MOVF bootup_00000_1_frame+D'7', W
1277
03E8  6E27              MOVWF drawsprite_00000_arg_sprite+D'7'
1278
03EA  5015              MOVF bootup_00000_1_frame+D'6', W
1279
03EC  6E26              MOVWF drawsprite_00000_arg_sprite+D'6'
1280
03EE  5014              MOVF bootup_00000_1_frame+D'5', W
1281
03F0  6E25              MOVWF drawsprite_00000_arg_sprite+D'5'
1282
03F2  5013              MOVF bootup_00000_1_frame+D'4', W
1283
03F4  6E24              MOVWF drawsprite_00000_arg_sprite+D'4'
1284
03F6  5012              MOVF bootup_00000_1_frame+D'3', W
1285
03F8  6E23              MOVWF drawsprite_00000_arg_sprite+D'3'
1286
03FA  5011              MOVF bootup_00000_1_frame+D'2', W
1287
03FC  6E22              MOVWF drawsprite_00000_arg_sprite+D'2'
1288
03FE  5010              MOVF bootup_00000_1_frame+D'1', W
1289
0400  6E21              MOVWF drawsprite_00000_arg_sprite+D'1'
1290
0402  500F              MOVF bootup_00000_1_frame, W
1291
0404  6E20              MOVWF drawsprite_00000_arg_sprite
1292
0406  EC12F001          CALL drawsprite_00000
1293 27 zuofu
 
1294 31 zuofu
                //show 'right' frame
1295
                if (i > 18)
1296
040A  0E12              MOVLW 0x12
1297
040C  6405              CPFSGT bootup_00000_1_i
1298
040E  D005              BRA     label268437220
1299
041A            label268437220
1300 27 zuofu
 
1301 31 zuofu
                        delay_ms(100);
1302
0410  0E64              MOVLW 0x64
1303
0412  6E20              MOVWF delay_ms_00000_arg_del
1304
0414  EC02F000          CALL delay_ms_00000
1305 27 zuofu
 
1306 31 zuofu
                else
1307
0418  D004              BRA     label268437226
1308
0422            label268437226
1309 27 zuofu
 
1310 31 zuofu
                        delay_ms(60);
1311
041A  0E3C              MOVLW 0x3C
1312
041C  6E20              MOVWF delay_ms_00000_arg_del
1313
041E  EC02F000          CALL delay_ms_00000
1314 27 zuofu
 
1315 31 zuofu
                frame.image.address += 80;
1316
0422  0E50              MOVLW 0x50
1317
0424  260F              ADDWF bootup_00000_1_frame, F
1318
0426  0E00              MOVLW 0x00
1319
0428  2210              ADDWFC bootup_00000_1_frame+D'1', F
1320
042A  0E00              MOVLW 0x00
1321
042C  2211              ADDWFC bootup_00000_1_frame+D'2', F
1322
042E  0E00              MOVLW 0x00
1323
0430  2212              ADDWFC bootup_00000_1_frame+D'3', F
1324 27 zuofu
 
1325 31 zuofu
                drawsprite (frame);
1326
0432  501F              MOVF bootup_00000_1_frame+D'16', W
1327
0434  6E30              MOVWF drawsprite_00000_arg_sprite+D'16'
1328
0436  501E              MOVF bootup_00000_1_frame+D'15', W
1329
0438  6E2F              MOVWF drawsprite_00000_arg_sprite+D'15'
1330
043A  501D              MOVF bootup_00000_1_frame+D'14', W
1331
043C  6E2E              MOVWF drawsprite_00000_arg_sprite+D'14'
1332
043E  501C              MOVF bootup_00000_1_frame+D'13', W
1333
0440  6E2D              MOVWF drawsprite_00000_arg_sprite+D'13'
1334
0442  501B              MOVF bootup_00000_1_frame+D'12', W
1335
0444  6E2C              MOVWF drawsprite_00000_arg_sprite+D'12'
1336
0446  501A              MOVF bootup_00000_1_frame+D'11', W
1337
0448  6E2B              MOVWF drawsprite_00000_arg_sprite+D'11'
1338
044A  5019              MOVF bootup_00000_1_frame+D'10', W
1339
044C  6E2A              MOVWF drawsprite_00000_arg_sprite+D'10'
1340
044E  5018              MOVF bootup_00000_1_frame+D'9', W
1341
0450  6E29              MOVWF drawsprite_00000_arg_sprite+D'9'
1342
0452  5017              MOVF bootup_00000_1_frame+D'8', W
1343
0454  6E28              MOVWF drawsprite_00000_arg_sprite+D'8'
1344
0456  5016              MOVF bootup_00000_1_frame+D'7', W
1345
0458  6E27              MOVWF drawsprite_00000_arg_sprite+D'7'
1346
045A  5015              MOVF bootup_00000_1_frame+D'6', W
1347
045C  6E26              MOVWF drawsprite_00000_arg_sprite+D'6'
1348
045E  5014              MOVF bootup_00000_1_frame+D'5', W
1349
0460  6E25              MOVWF drawsprite_00000_arg_sprite+D'5'
1350
0462  5013              MOVF bootup_00000_1_frame+D'4', W
1351
0464  6E24              MOVWF drawsprite_00000_arg_sprite+D'4'
1352
0466  5012              MOVF bootup_00000_1_frame+D'3', W
1353
0468  6E23              MOVWF drawsprite_00000_arg_sprite+D'3'
1354
046A  5011              MOVF bootup_00000_1_frame+D'2', W
1355
046C  6E22              MOVWF drawsprite_00000_arg_sprite+D'2'
1356
046E  5010              MOVF bootup_00000_1_frame+D'1', W
1357
0470  6E21              MOVWF drawsprite_00000_arg_sprite+D'1'
1358
0472  500F              MOVF bootup_00000_1_frame, W
1359
0474  6E20              MOVWF drawsprite_00000_arg_sprite
1360
0476  EC12F001          CALL drawsprite_00000
1361 27 zuofu
 
1362 31 zuofu
                if (i > 18)
1363
047A  0E12              MOVLW 0x12
1364
047C  6405              CPFSGT bootup_00000_1_i
1365
047E  D005              BRA     label268437236
1366
048A            label268437236
1367 27 zuofu
 
1368 31 zuofu
                        delay_ms(100);
1369
0480  0E64              MOVLW 0x64
1370
0482  6E20              MOVWF delay_ms_00000_arg_del
1371
0484  EC02F000          CALL delay_ms_00000
1372 27 zuofu
 
1373 31 zuofu
                else
1374
0488  D004              BRA     label268437242
1375
0492            label268437242
1376 27 zuofu
 
1377 31 zuofu
                        delay_ms(60);
1378
048A  0E3C              MOVLW 0x3C
1379
048C  6E20              MOVWF delay_ms_00000_arg_del
1380
048E  EC02F000          CALL delay_ms_00000
1381 27 zuofu
 
1382 31 zuofu
                //skip down to next two frames
1383
                frame.image.address += 25520;
1384
0492  0EB0              MOVLW 0xB0
1385
0494  260F              ADDWF bootup_00000_1_frame, F
1386
0496  0E63              MOVLW 0x63
1387
0498  2210              ADDWFC bootup_00000_1_frame+D'1', F
1388
049A  0E00              MOVLW 0x00
1389
049C  2211              ADDWFC bootup_00000_1_frame+D'2', F
1390
049E  0E00              MOVLW 0x00
1391
04A0  2212              ADDWFC bootup_00000_1_frame+D'3', F
1392 27 zuofu
 
1393 31 zuofu
        }
1394
        return;
1395
}
1396
04A6  0012              RETURN
1397 27 zuofu
 
1398
 
1399 31 zuofu
void main( void )
1400 27 zuofu
 
1401 31 zuofu
{
1402
        //Configure port A
1403
        adcon1 = 0x07;                                                          //disable analog inputs
1404
04A8  0E07              MOVLW 0x07
1405
04AA  6EC1              MOVWF gbl_adcon1
1406 27 zuofu
 
1407 31 zuofu
        trisa = 00000000b;
1408
04AC  6A92              CLRF gbl_trisa
1409 27 zuofu
 
1410 31 zuofu
        //Configure port B
1411
        trisb = 0x00;
1412
04AE  6A93              CLRF gbl_trisb
1413 27 zuofu
 
1414 31 zuofu
        //Configure port C
1415
        trisc = 10000000b;
1416
04B0  0E80              MOVLW 0x80
1417
04B2  6E94              MOVWF gbl_trisc
1418 27 zuofu
 
1419 31 zuofu
        //Configure port D
1420
        trisd = 10000000b;
1421
04B4  6E95              MOVWF gbl_trisd
1422 27 zuofu
 
1423
 
1424 31 zuofu
        //Initialize port A
1425
        porta = 0x00;
1426
04B6  6A80              CLRF gbl_porta
1427 27 zuofu
 
1428 31 zuofu
        //Initialize port B
1429
        portb = 0x00;
1430
04B8  6A81              CLRF gbl_portb
1431 27 zuofu
 
1432 31 zuofu
        //Initialize port C
1433
        portc = 0x00;
1434
04BA  6A82              CLRF gbl_portc
1435 27 zuofu
 
1436 31 zuofu
        //Initialize port D
1437
        portc = 0x00;
1438
04BC  6A82              CLRF gbl_portc
1439 27 zuofu
 
1440
 
1441 31 zuofu
        //wait for GPU to get ready
1442
        //START OF REAL PROGRAM--------------------------------------------
1443 27 zuofu
 
1444
 
1445 31 zuofu
        //char input;
1446
        //setupinput();
1447
        bootup();                                               //draw bootup logo
1448
04BE  EC9AF001          CALL bootup_00000
1449 27 zuofu
 
1450
 
1451 31 zuofu
/*      //Endless loop
1452
        while( true )
1453
        {
1454
                scene1();
1455
                scene2();
1456
                scene4();
1457
                scene5();
1458
                //final halt
1459
                delay_s(5);
1460
        }
1461
*/
1462 27 zuofu
 
1463 31 zuofu
//ERIC input stuff
1464
        char temp;
1465
        setupinput();
1466
04C2  EC7FF001          CALL setupinput_00000
1467 27 zuofu
 
1468
 
1469 31 zuofu
        while( true )
1470
04C6            label268437264
1471
04DE  D7F3              BRA     label268437264
1472 27 zuofu
 
1473 31 zuofu
        {
1474
                temp = getinput();
1475
04C6  EC8AF001          CALL getinput_00000
1476
04CA  5000              MOVF CompTempVarRet0, W
1477
04CC  6E04              MOVWF main_1_temp
1478 27 zuofu
 
1479 31 zuofu
                if(temp & 11110111b)
1480
04CE  0EF7              MOVLW 0xF7
1481
04D0  1404              ANDWF main_1_temp, W
1482
04D2  A4D8              BTFSS STATUS,Z
1483 27 zuofu
 
1484
                {
1485 31 zuofu
                        set_bit(portd, 0);
1486
04D4  8083              BSF gbl_portd,0
1487 27 zuofu
 
1488 31 zuofu
                }
1489
                if(temp & 11111011b)
1490
04D6  0EFB              MOVLW 0xFB
1491
04D8  1404              ANDWF main_1_temp, W
1492
04DA  A4D8              BTFSS STATUS,Z
1493 27 zuofu
 
1494
                {
1495 31 zuofu
                        clear_bit(portd, 0);
1496
04DC  9083              BCF gbl_portd,0
1497 27 zuofu
 
1498 31 zuofu
                }
1499
 
1500
        }
1501
}
1502 27 zuofu
 
1503 31 zuofu
#include 
1504
#include "input.h"
1505 27 zuofu
 
1506
 
1507 31 zuofu
#pragma CLOCK_FREQ 50000000
1508 27 zuofu
 
1509 31 zuofu
char getinput()
1510 27 zuofu
 
1511 31 zuofu
{
1512
 
1513
        //C4 SDO
1514
        //C5 SDI
1515
        //C6 TX
1516
        //C7 RX
1517 27 zuofu
 
1518 31 zuofu
        //clear_bit(portd, 5);
1519
        //delay_ms(10);
1520
        set_bit(portd, 5);
1521
0314  8A83              BSF gbl_portd,5
1522 27 zuofu
 
1523 31 zuofu
        delay_us(12);
1524
0316  0E0C              MOVLW 0x0C
1525
0318  6E05              MOVWF delay_us_00000_arg_del
1526
031A  EC3EF000          CALL delay_us_00000
1527 27 zuofu
 
1528 31 zuofu
        clear_bit(portd, 5);
1529
031E  9A83              BCF gbl_portd,5
1530 27 zuofu
 
1531 31 zuofu
        delay_us(6);
1532
0320  0E06              MOVLW 0x06
1533
0322  6E05              MOVWF delay_us_00000_arg_del
1534
0324  EC3EF000          CALL delay_us_00000
1535 27 zuofu
 
1536 31 zuofu
 
1537
        set_bit(rcsta, SREN);           //Single reception
1538
0328  8AAB              BSF gbl_rcsta,5
1539 27 zuofu
 
1540 31 zuofu
 
1541
        if(pir1 & 0b00100000)
1542
032A  AA9E              BTFSS gbl_pir1,5
1543
032C  D002              BRA     label268437510
1544
0332            label268437510
1545 27 zuofu
 
1546 31 zuofu
        {
1547
                return rcreg;
1548
032E  50AE              MOVF gbl_rcreg, W
1549
0330  6E00              MOVWF CompTempVarRet0
1550 27 zuofu
 
1551 31 zuofu
        }
1552
 
1553 27 zuofu
 
1554 31 zuofu
}
1555
0332  0012              RETURN
1556 27 zuofu
 
1557
 
1558 31 zuofu
void setupinput(void)
1559 27 zuofu
 
1560 31 zuofu
{
1561
        clear_bit(trisc, 6);
1562
02FE  9C94              BCF gbl_trisc,6
1563 27 zuofu
 
1564 31 zuofu
        set_bit(trisc, 7);
1565
0300  8E94              BSF gbl_trisc,7
1566 27 zuofu
 
1567 31 zuofu
        set_bit(trisc, 5);
1568
0302  8A94              BSF gbl_trisc,5
1569 27 zuofu
 
1570 31 zuofu
 
1571
        spbrg = 255;
1572
0304  68AF              SETF gbl_spbrg
1573 27 zuofu
 
1574
 
1575 31 zuofu
        set_bit(txsta,SYNC);
1576
0306  88AC              BSF gbl_txsta,4
1577 27 zuofu
 
1578 31 zuofu
        set_bit(rcsta,SPEN);
1579
0308  8EAB              BSF gbl_rcsta,7
1580 27 zuofu
 
1581 31 zuofu
        set_bit(txsta,CSRC);
1582
030A  8EAC              BSF gbl_txsta,7
1583 27 zuofu
 
1584 31 zuofu
        clear_bit(rcsta, SREN);
1585
030C  9AAB              BCF gbl_rcsta,5
1586 27 zuofu
 
1587 31 zuofu
        clear_bit(rcsta, CREN);
1588
030E  98AB              BCF gbl_rcsta,4
1589 27 zuofu
 
1590 31 zuofu
 
1591
        //set_bit(pie1, RCIE);                  //enable interrupts
1592
                                                                //RCIF will be set when reception
1593
                                                                //is completed
1594
                                                                //interrupt is generated when
1595
                                                                //RCIE was set
1596
        //read RCREG to get data
1597
 
1598
        clear_bit(portd, 5);
1599
0310  9A83              BCF gbl_portd,5
1600 27 zuofu
 
1601 31 zuofu
}
1602
0312  0012              RETURN
1603 27 zuofu
 
1604
 
1605 31 zuofu
        // read all 8 bits, then decide which way to move the sprite
1606
        // table of values here
1607
        //*********************************************************
1608
        // should probably have separate signals for each button...
1609
        //*********************************************************
1610 27 zuofu
 
1611 31 zuofu
        //from high bit to low bit
1612
        // Left Right Down Up Start Select B A
1613
 
1614
        // 11111111     - no button pushed
1615
        // 11111110 - A
1616
        // 11111101 - B
1617
        // 11111011 - Select
1618
        // 11110111 - Start
1619
        // 11101111 - Up
1620
        // 11011111 - Down
1621
        // 10111111 - Right
1622
        // 01111111 - Left
1623
        //      Other possible functionality
1624
        // 01011111 - Diagonal Left/Down
1625
        // 10011111 - Diagonal Right/Down
1626
        // 01101111 - Diagonal Left/Up
1627
        // 10101111 - Diagonal Right/Up
1628 27 zuofu
 
1629
////////////////////////////////////////
1630
// Code with no source :-)
1631
////////////////////////////////////////
1632 31 zuofu
0000  EF70F002          GOTO    _startup
1633 27 zuofu
0004            delay_ms_00000
1634
; { delay_ms ; function begin
1635 31 zuofu
0004  5220              MOVF delay_ms_00000_arg_del, F
1636 27 zuofu
0006  A4D8              BTFSS STATUS,Z
1637
0008  EF07F000          GOTO    label4026531859
1638
000C  0012              RETURN
1639
000E            label4026531859
1640
000E  0EFF              MOVLW 0xFF
1641
0010            label4026531860
1642
0010  0000              NOP
1643
0012  0000              NOP
1644
0014  0000              NOP
1645
0016  0000              NOP
1646
0018  0000              NOP
1647
001A  0000              NOP
1648
001C  0000              NOP
1649
001E  0000              NOP
1650
0020  0000              NOP
1651
0022  0000              NOP
1652
0024  0000              NOP
1653
0026  0000              NOP
1654
0028  0000              NOP
1655
002A  0000              NOP
1656
002C  0000              NOP
1657
002E  0000              NOP
1658
0030  0000              NOP
1659
0032  0000              NOP
1660
0034  0000              NOP
1661
0036  0000              NOP
1662
0038  0000              NOP
1663
003A  0000              NOP
1664
003C  0000              NOP
1665
003E  0000              NOP
1666
0040  0000              NOP
1667
0042  0000              NOP
1668
0044  0000              NOP
1669
0046  0000              NOP
1670
0048  0000              NOP
1671
004A  0000              NOP
1672
004C  0000              NOP
1673
004E  0000              NOP
1674
0050  0000              NOP
1675
0052  0000              NOP
1676
0054  0000              NOP
1677
0056  0000              NOP
1678
0058  0000              NOP
1679
005A  0000              NOP
1680
005C  0000              NOP
1681
005E  0000              NOP
1682
0060  0000              NOP
1683
0062  0000              NOP
1684
0064  0000              NOP
1685
0066  0000              NOP
1686
0068  0000              NOP
1687
006A  0FFF              ADDLW 0xFF
1688
006C  A4D8              BTFSS STATUS,Z
1689
006E  EF08F000          GOTO    label4026531860
1690
0072  0000              NOP
1691 31 zuofu
0074  2E20              DECFSZ delay_ms_00000_arg_del, F
1692 27 zuofu
0076  EF07F000          GOTO    label4026531859
1693
007A  0012              RETURN
1694
; } delay_ms function end
1695
 
1696 31 zuofu
007C            delay_us_00000
1697
; { delay_us ; function begin
1698
007C  5205              MOVF delay_us_00000_arg_del, F
1699
007E  A4D8              BTFSS STATUS,Z
1700
0080  EF43F000          GOTO    label4026531844
1701
0084  0012              RETURN
1702
0086            label4026531844
1703
0086  0E02              MOVLW 0x02
1704
0088            label4026531845
1705
0088  0FFF              ADDLW 0xFF
1706
008A  A4D8              BTFSS STATUS,Z
1707
008C  EF44F000          GOTO    label4026531845
1708
0090  2E05              DECFSZ delay_us_00000_arg_del, F
1709
0092  EF43F000          GOTO    label4026531844
1710
0096  0012              RETURN
1711
; } delay_us function end
1712 27 zuofu
 
1713 31 zuofu
0098            __mul_32_3_00006
1714 27 zuofu
; { __mul_32_32 ; function begin
1715 31 zuofu
0098  6A00              CLRF CompTempVarRet0
1716
009A  6A01              CLRF CompTempVarRet0+D'1'
1717
009C  6A02              CLRF CompTempVarRet0+D'2'
1718
009E  6A03              CLRF CompTempVarRet0+D'3'
1719
00A0  6A02              CLRF CompTempVarRet0+D'2'
1720
00A2  6A03              CLRF CompTempVarRet0+D'3'
1721
00A4  5035              MOVF __mul_32_3_00006_arg_a, W
1722
00A6  0239              MULWF __mul_32_3_00006_arg_b
1723
00A8  50F3              MOVF gbl_prodl, W
1724
00AA  6E00              MOVWF CompTempVarRet0
1725
00AC  50F4              MOVF gbl_prodh, W
1726
00AE  6E01              MOVWF CompTempVarRet0+D'1'
1727
00B0  5036              MOVF __mul_32_3_00006_arg_a+D'1', W
1728
00B2  0239              MULWF __mul_32_3_00006_arg_b
1729
00B4  50F3              MOVF gbl_prodl, W
1730
00B6  2601              ADDWF CompTempVarRet0+D'1', F
1731
00B8  50F4              MOVF gbl_prodh, W
1732
00BA  2202              ADDWFC CompTempVarRet0+D'2', F
1733
00BC  B0D8              BTFSC gbl_status,0
1734
00BE  2A03              INCF CompTempVarRet0+D'3', F
1735
00C0  5037              MOVF __mul_32_3_00006_arg_a+D'2', W
1736
00C2  0239              MULWF __mul_32_3_00006_arg_b
1737
00C4  50F3              MOVF gbl_prodl, W
1738
00C6  2602              ADDWF CompTempVarRet0+D'2', F
1739
00C8  50F4              MOVF gbl_prodh, W
1740
00CA  2203              ADDWFC CompTempVarRet0+D'3', F
1741
00CC  5038              MOVF __mul_32_3_00006_arg_a+D'3', W
1742
00CE  0239              MULWF __mul_32_3_00006_arg_b
1743
00D0  50F3              MOVF gbl_prodl, W
1744
00D2  2603              ADDWF CompTempVarRet0+D'3', F
1745
00D4  5035              MOVF __mul_32_3_00006_arg_a, W
1746
00D6  023A              MULWF __mul_32_3_00006_arg_b+D'1'
1747
00D8  50F3              MOVF gbl_prodl, W
1748
00DA  2601              ADDWF CompTempVarRet0+D'1', F
1749
00DC  50F4              MOVF gbl_prodh, W
1750
00DE  2202              ADDWFC CompTempVarRet0+D'2', F
1751
00E0  B0D8              BTFSC gbl_status,0
1752
00E2  2A03              INCF CompTempVarRet0+D'3', F
1753
00E4  5036              MOVF __mul_32_3_00006_arg_a+D'1', W
1754
00E6  023A              MULWF __mul_32_3_00006_arg_b+D'1'
1755
00E8  50F3              MOVF gbl_prodl, W
1756
00EA  2602              ADDWF CompTempVarRet0+D'2', F
1757
00EC  50F4              MOVF gbl_prodh, W
1758
00EE  2203              ADDWFC CompTempVarRet0+D'3', F
1759
00F0  5037              MOVF __mul_32_3_00006_arg_a+D'2', W
1760
00F2  023A              MULWF __mul_32_3_00006_arg_b+D'1'
1761
00F4  50F3              MOVF gbl_prodl, W
1762
00F6  2603              ADDWF CompTempVarRet0+D'3', F
1763
00F8  5035              MOVF __mul_32_3_00006_arg_a, W
1764
00FA  023B              MULWF __mul_32_3_00006_arg_b+D'2'
1765
00FC  50F3              MOVF gbl_prodl, W
1766
00FE  2602              ADDWF CompTempVarRet0+D'2', F
1767
0100  50F4              MOVF gbl_prodh, W
1768
0102  2203              ADDWFC CompTempVarRet0+D'3', F
1769
0104  5036              MOVF __mul_32_3_00006_arg_a+D'1', W
1770
0106  023B              MULWF __mul_32_3_00006_arg_b+D'2'
1771
0108  50F3              MOVF gbl_prodl, W
1772
010A  2603              ADDWF CompTempVarRet0+D'3', F
1773
010C  5035              MOVF __mul_32_3_00006_arg_a, W
1774
010E  023C              MULWF __mul_32_3_00006_arg_b+D'3'
1775
0110  50F3              MOVF gbl_prodl, W
1776
0112  2603              ADDWF CompTempVarRet0+D'3', F
1777
0114  0012              RETURN
1778 27 zuofu
; } __mul_32_32 function end
1779
 
1780
 
1781 31 zuofu
04E0            _startup
1782
04E0  EF54F002          GOTO    main

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.