URL
https://opencores.org/ocsvn/395_vgs/395_vgs/trunk
Subversion Repositories 395_vgs
[/] [395_vgs/] [trunk/] [src/] [PIC18/] [intro.casm] - Rev 32
Compare with Previous | Blame | View Log
;/////////////////////////////////////////////////////////////////////////////////
;// Code Generator: BoostC Compiler and Linker - http://www.picant.com/c2c/c.html
;// License Type : Full License
;// Limitations : PIC18 max code size:Unlimited, max RAM banks:Unlimited, Non commercial use only
;/////////////////////////////////////////////////////////////////////////////////
#include <system.h>
#include "gpu_pic.h"
//Loads the source address (registers 0, 1, and 2) into the GPU
void load_s_addr(unsigned long address)
{
portc = 0x02; //Load least significant byte
0122 0E02 MOVLW 0x02
0124 6E82 MOVWF gbl_portc
portb = (char) (0x000000FF & address);
0126 503D MOVF load_s_add_0000C_arg_address, W
0128 0BFF ANDLW 0xFF
012A 6E81 MOVWF gbl_portb
porta = 0x01; //enable load
012C 0E01 MOVLW 0x01
012E 6E80 MOVWF gbl_porta
porta = 0x00; //load complete
0130 6A80 CLRF gbl_porta
address >>= 8;
0132 503E MOVF load_s_add_0000C_arg_address+D'1', W
0134 6E3D MOVWF load_s_add_0000C_arg_address
0136 503F MOVF load_s_add_0000C_arg_address+D'2', W
0138 6E3E MOVWF load_s_add_0000C_arg_address+D'1'
013A 5040 MOVF load_s_add_0000C_arg_address+D'3', W
013C 6E3F MOVWF load_s_add_0000C_arg_address+D'2'
013E 6A40 CLRF load_s_add_0000C_arg_address+D'3'
portc = 0x01; //Load middle byte
0140 0E01 MOVLW 0x01
0142 6E82 MOVWF gbl_portc
portb = (char) (0x000000FF & address);
0144 503D MOVF load_s_add_0000C_arg_address, W
0146 0BFF ANDLW 0xFF
0148 6E81 MOVWF gbl_portb
porta = 0x01; //enable load
014A 0E01 MOVLW 0x01
014C 6E80 MOVWF gbl_porta
porta = 0x00; //load complete
014E 6A80 CLRF gbl_porta
address >>= 8;
0150 503E MOVF load_s_add_0000C_arg_address+D'1', W
0152 6E3D MOVWF load_s_add_0000C_arg_address
0154 503F MOVF load_s_add_0000C_arg_address+D'2', W
0156 6E3E MOVWF load_s_add_0000C_arg_address+D'1'
0158 5040 MOVF load_s_add_0000C_arg_address+D'3', W
015A 6E3F MOVWF load_s_add_0000C_arg_address+D'2'
015C 6A40 CLRF load_s_add_0000C_arg_address+D'3'
portc = 0x00; //Load most significant byte
015E 6A82 CLRF gbl_portc
portb = (char) (0x000000FF & address);
0160 503D MOVF load_s_add_0000C_arg_address, W
0162 0BFF ANDLW 0xFF
0164 6E81 MOVWF gbl_portb
porta = 0x01; //enable load
0166 0E01 MOVLW 0x01
0168 6E80 MOVWF gbl_porta
porta = 0x00; //load complete
016A 6A80 CLRF gbl_porta
return;
}
016C 0012 RETURN
void load_t_addr(unsigned long address)
{
portc = 0x05;
016E 0E05 MOVLW 0x05
0170 6E82 MOVWF gbl_portc
portb = (char) (0x000000FF & address);
0172 503D MOVF load_t_add_0000B_arg_address, W
0174 0BFF ANDLW 0xFF
0176 6E81 MOVWF gbl_portb
porta = 0x01;
0178 0E01 MOVLW 0x01
017A 6E80 MOVWF gbl_porta
porta = 0x00;
017C 6A80 CLRF gbl_porta
address >>= 8;
017E 503E MOVF load_t_add_0000B_arg_address+D'1', W
0180 6E3D MOVWF load_t_add_0000B_arg_address
0182 503F MOVF load_t_add_0000B_arg_address+D'2', W
0184 6E3E MOVWF load_t_add_0000B_arg_address+D'1'
0186 5040 MOVF load_t_add_0000B_arg_address+D'3', W
0188 6E3F MOVWF load_t_add_0000B_arg_address+D'2'
018A 6A40 CLRF load_t_add_0000B_arg_address+D'3'
portc = 0x04;
018C 0E04 MOVLW 0x04
018E 6E82 MOVWF gbl_portc
portb = (char) (0x000000FF & address);
0190 503D MOVF load_t_add_0000B_arg_address, W
0192 0BFF ANDLW 0xFF
0194 6E81 MOVWF gbl_portb
porta = 0x01;
0196 0E01 MOVLW 0x01
0198 6E80 MOVWF gbl_porta
porta = 0x00;
019A 6A80 CLRF gbl_porta
address >>= 8;
019C 503E MOVF load_t_add_0000B_arg_address+D'1', W
019E 6E3D MOVWF load_t_add_0000B_arg_address
01A0 503F MOVF load_t_add_0000B_arg_address+D'2', W
01A2 6E3E MOVWF load_t_add_0000B_arg_address+D'1'
01A4 5040 MOVF load_t_add_0000B_arg_address+D'3', W
01A6 6E3F MOVWF load_t_add_0000B_arg_address+D'2'
01A8 6A40 CLRF load_t_add_0000B_arg_address+D'3'
portc = 0x03;
01AA 0E03 MOVLW 0x03
01AC 6E82 MOVWF gbl_portc
portb = (char) (0x000000FF & address);
01AE 503D MOVF load_t_add_0000B_arg_address, W
01B0 0BFF ANDLW 0xFF
01B2 6E81 MOVWF gbl_portb
porta = 0x01;
01B4 0E01 MOVLW 0x01
01B6 6E80 MOVWF gbl_porta
porta = 0x00;
01B8 6A80 CLRF gbl_porta
return;
}
01BA 0012 RETURN
void load_s_lines(unsigned lines)
{
portc = 0x07;
01BC 0E07 MOVLW 0x07
01BE 6E82 MOVWF gbl_portc
portb = (char) (0x00FF & lines);
01C0 503D MOVF load_s_lin_0000A_arg_lines, W
01C2 0BFF ANDLW 0xFF
01C4 6E81 MOVWF gbl_portb
porta = 0x01;
01C6 0E01 MOVLW 0x01
01C8 6E80 MOVWF gbl_porta
porta = 0x00;
01CA 6A80 CLRF gbl_porta
lines >>= 8;
01CC 503E MOVF load_s_lin_0000A_arg_lines+D'1', W
01CE 6E3D MOVWF load_s_lin_0000A_arg_lines
01D0 6A3E CLRF load_s_lin_0000A_arg_lines+D'1'
portc = 0x06;
01D2 0E06 MOVLW 0x06
01D4 6E82 MOVWF gbl_portc
portb = (char) (0x00FF & lines);
01D6 503D MOVF load_s_lin_0000A_arg_lines, W
01D8 0BFF ANDLW 0xFF
01DA 6E81 MOVWF gbl_portb
porta = 0x01;
01DC 0E01 MOVLW 0x01
01DE 6E80 MOVWF gbl_porta
porta = 0x00;
01E0 6A80 CLRF gbl_porta
return;
}
01E2 0012 RETURN
void load_l_size(unsigned size)
{
portc = 0x09;
01E4 0E09 MOVLW 0x09
01E6 6E82 MOVWF gbl_portc
portb = (char) (0x00FF & size);
01E8 503D MOVF load_l_siz_00009_arg_size, W
01EA 0BFF ANDLW 0xFF
01EC 6E81 MOVWF gbl_portb
porta = 0x01;
01EE 0E01 MOVLW 0x01
01F0 6E80 MOVWF gbl_porta
porta = 0x00;
01F2 6A80 CLRF gbl_porta
size >>= 8;
01F4 503E MOVF load_l_siz_00009_arg_size+D'1', W
01F6 6E3D MOVWF load_l_siz_00009_arg_size
01F8 6A3E CLRF load_l_siz_00009_arg_size+D'1'
portc = 0x08;
01FA 0E08 MOVLW 0x08
01FC 6E82 MOVWF gbl_portc
portb = (char) (0x000F & size);
01FE 503D MOVF load_l_siz_00009_arg_size, W
0200 0B0F ANDLW 0x0F
0202 6E81 MOVWF gbl_portb
porta = 0x01;
0204 0E01 MOVLW 0x01
0206 6E80 MOVWF gbl_porta
porta = 0x00;
0208 6A80 CLRF gbl_porta
return;
}
020A 0012 RETURN
void load_alphaOp( bool alphaOp)
{
portc = 0x0A;
020C 0E0A MOVLW 0x0A
020E 6E82 MOVWF gbl_portc
if (alphaOp)
0210 A03D BTFSS load_alpha_00008_arg_alphaOp,0
0212 D003 BRA label268435770
021A label268435770
portb = 0x01;
0214 0E01 MOVLW 0x01
0216 6E81 MOVWF gbl_portb
else
0218 D001 BRA label268435773
021C label268435773
portb = 0x00;
021A 6A81 CLRF gbl_portb
porta = 0x01;
021C 0E01 MOVLW 0x01
021E 6E80 MOVWF gbl_porta
porta = 0x00;
0220 6A80 CLRF gbl_porta
return;
}
0222 0012 RETURN
void draw()
{
porta = 00000010b; //initialize draw
0116 0E02 MOVLW 0x02
0118 6E80 MOVWF gbl_porta
porta = 00000000b; //draw command recieved, so turn off draw bit
011A 6A80 CLRF gbl_porta
while ( !(portd & 10000000b) ) //hang here till we recieve idle from GPU
011C label268435830
011C AE83 BTFSS gbl_portd,7
011E D7FE BRA label268435830
{
}
}
0120 0012 RETURN
//draw a fullscreen background
void drawtobackground ( Bitmap source )
{
load_t_addr(0x00000000);
02BA 6A3D CLRF load_t_add_0000B_arg_address
02BC 6A3E CLRF load_t_add_0000B_arg_address+D'1'
02BE 6A3F CLRF load_t_add_0000B_arg_address+D'2'
02C0 6A40 CLRF load_t_add_0000B_arg_address+D'3'
02C2 ECB7F000 CALL load_t_add_0000B
load_s_addr(source.address);
02C6 5020 MOVF drawtoback_00007_arg_source, W
02C8 6E3D MOVWF load_s_add_0000C_arg_address
02CA 5021 MOVF drawtoback_00007_arg_source+D'1', W
02CC 6E3E MOVWF load_s_add_0000C_arg_address+D'1'
02CE 5022 MOVF drawtoback_00007_arg_source+D'2', W
02D0 6E3F MOVWF load_s_add_0000C_arg_address+D'2'
02D2 5023 MOVF drawtoback_00007_arg_source+D'3', W
02D4 6E40 MOVWF load_s_add_0000C_arg_address+D'3'
02D6 EC91F000 CALL load_s_add_0000C
load_s_lines(source.lines);
02DA 5026 MOVF drawtoback_00007_arg_source+D'6', W
02DC 6E3D MOVWF load_s_lin_0000A_arg_lines
02DE 5027 MOVF drawtoback_00007_arg_source+D'7', W
02E0 6E3E MOVWF load_s_lin_0000A_arg_lines+D'1'
02E2 ECDEF000 CALL load_s_lin_0000A
load_l_size(source.width);
02E6 5024 MOVF drawtoback_00007_arg_source+D'4', W
02E8 6E3D MOVWF load_l_siz_00009_arg_size
02EA 5025 MOVF drawtoback_00007_arg_source+D'5', W
02EC 6E3E MOVWF load_l_siz_00009_arg_size+D'1'
02EE ECF2F000 CALL load_l_siz_00009
load_alphaOp(false);
02F2 903D BCF load_alpha_00008_arg_alphaOp,0
02F4 EC06F001 CALL load_alpha_00008
draw();
02F8 EC8BF000 CALL draw_00000
}
02FC 0012 RETURN
void drawsprite (Sprite sprite)
{
unsigned long destination_address = sprite.position.y * 160;
0224 502C MOVF drawsprite_00000_arg_sprite+D'12', W
0226 6E35 MOVWF __mul_32_3_00006_arg_a
0228 502D MOVF drawsprite_00000_arg_sprite+D'13', W
022A 6E36 MOVWF __mul_32_3_00006_arg_a+D'1'
022C 502E MOVF drawsprite_00000_arg_sprite+D'14', W
022E 6E37 MOVWF __mul_32_3_00006_arg_a+D'2'
0230 502F MOVF drawsprite_00000_arg_sprite+D'15', W
0232 6E38 MOVWF __mul_32_3_00006_arg_a+D'3'
0234 0EA0 MOVLW 0xA0
0236 6E39 MOVWF __mul_32_3_00006_arg_b
0238 6A3A CLRF __mul_32_3_00006_arg_b+D'1'
023A 6A3B CLRF __mul_32_3_00006_arg_b+D'2'
023C 6A3C CLRF __mul_32_3_00006_arg_b+D'3'
023E EC4CF000 CALL __mul_32_3_00006
0242 5000 MOVF CompTempVarRet0, W
0244 6E31 MOVWF drawsprite_00000_1_destina_0000D
0246 5001 MOVF CompTempVarRet0+D'1', W
0248 6E32 MOVWF drawsprite_00000_1_destina_0000D+D'1'
024A 5002 MOVF CompTempVarRet0+D'2', W
024C 6E33 MOVWF drawsprite_00000_1_destina_0000D+D'2'
024E 5003 MOVF CompTempVarRet0+D'3', W
0250 6E34 MOVWF drawsprite_00000_1_destina_0000D+D'3'
destination_address += sprite.position.x;
0252 5028 MOVF drawsprite_00000_arg_sprite+D'8', W
0254 2631 ADDWF drawsprite_00000_1_destina_0000D, F
0256 5029 MOVF drawsprite_00000_arg_sprite+D'9', W
0258 2232 ADDWFC drawsprite_00000_1_destina_0000D+D'1', F
025A 502A MOVF drawsprite_00000_arg_sprite+D'10', W
025C 2233 ADDWFC drawsprite_00000_1_destina_0000D+D'2', F
025E 502B MOVF drawsprite_00000_arg_sprite+D'11', W
0260 2234 ADDWFC drawsprite_00000_1_destina_0000D+D'3', F
load_t_addr(destination_address);
0262 5031 MOVF drawsprite_00000_1_destina_0000D, W
0264 6E3D MOVWF load_t_add_0000B_arg_address
0266 5032 MOVF drawsprite_00000_1_destina_0000D+D'1', W
0268 6E3E MOVWF load_t_add_0000B_arg_address+D'1'
026A 5033 MOVF drawsprite_00000_1_destina_0000D+D'2', W
026C 6E3F MOVWF load_t_add_0000B_arg_address+D'2'
026E 5034 MOVF drawsprite_00000_1_destina_0000D+D'3', W
0270 6E40 MOVWF load_t_add_0000B_arg_address+D'3'
0272 ECB7F000 CALL load_t_add_0000B
load_s_addr(sprite.image.address);
0276 5020 MOVF drawsprite_00000_arg_sprite, W
0278 6E3D MOVWF load_s_add_0000C_arg_address
027A 5021 MOVF drawsprite_00000_arg_sprite+D'1', W
027C 6E3E MOVWF load_s_add_0000C_arg_address+D'1'
027E 5022 MOVF drawsprite_00000_arg_sprite+D'2', W
0280 6E3F MOVWF load_s_add_0000C_arg_address+D'2'
0282 5023 MOVF drawsprite_00000_arg_sprite+D'3', W
0284 6E40 MOVWF load_s_add_0000C_arg_address+D'3'
0286 EC91F000 CALL load_s_add_0000C
load_s_lines(sprite.image.lines);
028A 5026 MOVF drawsprite_00000_arg_sprite+D'6', W
028C 6E3D MOVWF load_s_lin_0000A_arg_lines
028E 5027 MOVF drawsprite_00000_arg_sprite+D'7', W
0290 6E3E MOVWF load_s_lin_0000A_arg_lines+D'1'
0292 ECDEF000 CALL load_s_lin_0000A
load_l_size(sprite.image.width);
0296 5024 MOVF drawsprite_00000_arg_sprite+D'4', W
0298 6E3D MOVWF load_l_siz_00009_arg_size
029A 5025 MOVF drawsprite_00000_arg_sprite+D'5', W
029C 6E3E MOVWF load_l_siz_00009_arg_size+D'1'
029E ECF2F000 CALL load_l_siz_00009
if (sprite.alpha)
02A2 5230 MOVF drawsprite_00000_arg_sprite+D'16', F
02A4 E004 BZ label268435755
02AE label268435755
load_alphaOp(true);
02A6 803D BSF load_alpha_00008_arg_alphaOp,0
02A8 EC06F001 CALL load_alpha_00008
else
02AC D003 BRA label268435761
02B4 label268435761
load_alphaOp(false);
02AE 903D BCF load_alpha_00008_arg_alphaOp,0
02B0 EC06F001 CALL load_alpha_00008
draw();
02B4 EC8BF000 CALL draw_00000
}
02B8 0012 RETURN
#include <system.h>
#include "gpu_pic.h"
#include "input.h"
#pragma CLOCK_FREQ 50000000 //required for accurate delay functionality
//#pragma DATA 0x2007, 0x3F3A //Configuration bits to prevent having to configure in programmer
void scene1(void)
{
char i = 0;
char j = 0;
//initalize graphics to original settings
Bitmap black;
black.address = 0x0001C200;
black.lines = 0x00F0;
black.width = 0x00A0;
Sprite near_future;
near_future.image.address = 0x00025800;
near_future.image.lines = 0x000B;
near_future.image.width = 0x00A0;
near_future.position.x = 0;
near_future.position.y = 63;
near_future.alpha = 0;
Sprite eye_anim;
eye_anim.image.address = 0x00026CA0;
eye_anim.image.lines = 0x001B;
eye_anim.image.width = 0x001F;
eye_anim.position.x = 14;
eye_anim.position.y = 135;
eye_anim.alpha = 0;
Sprite eye_mask;
eye_mask.image.address = 0x0001C200;
eye_mask.image.lines = 0x001B;
eye_mask.image.width = 0x001F;
eye_mask.position.x = 14;
eye_mask.position.y = 135;
eye_mask.alpha = 0;
Sprite compass;
compass.image.address = 0x00029A40;
compass.image.lines = 0x0006;
compass.image.width = 0x002D;
compass.position.x = 51;
compass.position.y = 134;
compass.alpha = 0;
Sprite lines;
lines.image.address = 0x00029E00;
lines.image.lines = 0x001A;
lines.image.width = 0x004F;
lines.position.x = 73;
lines.position.y = 76;
lines.alpha = 0;
Sprite bars;
bars.image.address = 0x0002AE94;
bars.image.lines = 15;
bars.image.width = 0x002F;
bars.position.x = 10;
bars.position.y = 81;
bars.alpha = 0;
Sprite outline;
outline.image.address = 0x00027D80;
outline.image.lines = 46;
outline.image.width = 43;
outline.position.x = 27;
outline.position.y = 130;
outline.alpha = 1;
//right limit is about 94,
//left limit is about 51
/*
Sprite north;
north.image.address = 0x00029ACA;
north.image.lines = 6;
north.image.width = 2;
north.position.x = 92;
north.position.y = 128;
north.alpha = 1;
Sprite east;
east.image.address = 0x00029ACE;
east.image.lines = 6;
east.image.width = 2;
east.position.x = 51;
east.position.y = 128;
east.alpha = 1;
Sprite south;
south.image.address = 0x00029AD2;
south.image.lines = 6;
south.image.width = 2;
south.position.x = 65;
south.position.y = 128;
south.alpha = 1;
Sprite west;
west.image.address = 0x00029AD6;
west.image.lines = 6;
west.image.width = 2;
west.position.x = 80;
west.position.y = 128;
west.alpha = 1;
*/
//fade in introduction text
drawtobackground(black);
delay_s(2);
drawsprite(near_future);
delay_ms(255);
near_future.image.address = 0X00025EE0;
drawtobackground(black);
drawsprite(near_future);
delay_ms(255);
near_future.image.address = 0X000265C0;
drawtobackground(black);
drawsprite(near_future);
delay_s(2);
//black screen - dramatic pause
drawtobackground(black);
delay_s(2);
//draw eye open animation
for (i = 0; i < 5; i++)
{
drawsprite(eye_mask);
drawsprite(eye_anim);
eye_anim.image.address += 0x00000020;
delay_ms(100);
}
//draw and animate compass
j = 30;
for ( i = 0; i < 5; i++)//slow down
{
drawsprite(compass);//1
compass.image.address += 0x0000002E;
delay_ms(j);
drawsprite(compass);//2
compass.image.address += 0x0000002E;
delay_ms(j);
drawsprite(compass);//3
compass.image.address -= 0x0000005C;
delay_ms(j);
j+= 15;
}
j=20;
for ( i = 0; i < 5; i++)//reverse
{
compass.image.address += 0x0000005C;
drawsprite(compass);//3
compass.image.address -= 0x0000002E;
delay_ms(j);
drawsprite(compass);//2
compass.image.address -= 0x0000002E;
delay_ms(j);
drawsprite(compass);//1
delay_ms(j);
j+= 15;
}
j=150;
for ( i = 0; i < 3; i++)//speed up
{
drawsprite(compass);//1
compass.image.address += 0x0000002E;
delay_ms(j);
drawsprite(compass);//2
compass.image.address += 0x0000002E;
delay_ms(j);
drawsprite(compass);//3
compass.image.address -= 0x0000005C;
delay_ms(j);
j-= 60;
}
drawsprite (lines);
drawsprite (bars);
j=10;
for ( i = 0; i < 2; i++)//slow down
{
drawsprite(compass);
compass.image.address += 0x0000002E;
delay_ms(j);
drawsprite(compass);//2
compass.image.address += 0x0000002E;
delay_ms(j);
drawsprite(compass);//3
compass.image.address -= 0x0000005C;
delay_ms(j);
j+= 40;
}
lines.image.address = 0x00029E50;
lines.image.width = 0x004B;
bars.image.address += 0x00000960;
bars.image.width = 0x0035;
drawsprite (lines);
drawsprite (bars);
drawsprite(compass);
compass.image.address += 0x0000002E;
delay_ms(j);
drawsprite(compass);//2
compass.image.address += 0x0000002E;
delay_ms(j);
drawsprite(compass);//3
compass.image.address -= 0x0000005C;
delay_ms(j);
j+= 40;
lines.image.address = 0x0002AE40;
lines.image.width = 0x0053;
bars.image.address += 0x0000960;
drawsprite (lines);
drawsprite (bars);
//last compass animation
//drawsprite (north);
//drawsprite (south);
//drawsprite (east);
//drawsprite (west);
drawsprite(compass);
compass.image.address += 0x0000002E;
delay_ms(j);
drawsprite(compass);//2
compass.image.address += 0x0000002E;
delay_ms(j);
drawsprite(compass);//3
compass.image.address -= 0x0000005C;
delay_ms(j);
drawsprite(compass);//1
lines.image.address = 0x0002BE80;
bars.image.address += 0x00000961;
bars.image.width = 0x0036;
drawsprite (lines);
drawsprite (bars);
delay_ms(200);
lines.image.address = 0x0002CEC0;
lines.image.lines = 32;
lines.image.width = 84;
lines.position.x = 72;
lines.position.y = 75;
bars.image.address += 0x00000960;
drawsprite (bars);
drawsprite (lines);
delay_ms(50);
bars.image.address = 0x000713E0;
bars.image.lines = 21;
bars.image.width = 62;
bars.position.x = 4;
bars.position.y = 80;
drawsprite (bars);
drawsprite (lines);
//glitch stuff up
for (i = 0; i < 50; i++)
{
bars.image.address = 0x000713E0;
lines.image.address = 0x000821E0;
drawsprite(bars);
drawsprite (lines);
delay_ms(5);
bars.image.address = 0x000706C0;
lines.image.address = 0x0002CEC0;
drawsprite(bars);
drawsprite (lines);
delay_ms(5);
}
//draw overlay
drawsprite (outline);
for (i = 0; i < 30; i++)
{
bars.image.address = 0x000713E0;
lines.image.address = 0x000821E0;
drawsprite(bars);
drawsprite (lines);
delay_ms(5);
bars.image.address = 0x000706C0;
lines.image.address = 0x0002CEC0;
drawsprite(bars);
drawsprite (lines);
delay_ms(5);
}
//draw eye close animation with overlay
eye_anim.image.address = 0x00026D20;
for (i = 0; i < 5; i++)
{
drawsprite(eye_mask);
drawsprite(eye_anim);
drawsprite(outline);
eye_anim.image.address -= 0x00000020;
delay_ms(50);
}
//draw eye open with overlay
eye_anim.image.address = 0x00026CA0;
for (i = 0; i < 5; i++)
{
drawsprite(eye_mask);
drawsprite(eye_anim);
drawsprite(outline);
eye_anim.image.address += 0x00000020;
delay_ms(50);
}
delay_ms(255);
//draw rest of overlay
drawsprite(eye_mask);
outline.position.x = 24;
outline.image.address = 0x00027DAB;
outline.image.width = 46;
drawsprite(outline);
drawsprite(compass);
delay_ms(200);
outline.image.address = 0x00027DD9;
outline.image.width = 60;
drawsprite(outline);
drawsprite(compass);
delay_s(2);
return;
}
void scene2(void)
{
char i = 0;
char j = 0;
//initalize graphics to original settings
Bitmap black;
black.address = 0x0001C200;
black.lines = 0x00F0;
black.width = 0x00A0;
Sprite pilot;
pilot.image.address = 0x000AB180;//0x000A4740;
pilot.image.lines = 170;
pilot.image.width = 77;
pilot.position.x = 20;
pilot.position.y = 39;
pilot.alpha = 1;
Sprite screen0;
screen0.image.address = 0x000A86AD;
screen0.image.lines = 69;
screen0.image.width = 40;
screen0.position.x = 72;
screen0.position.y = 71;
screen0.alpha = 1;
Sprite screen1;
screen1.image.address = 0x000A4F0D;
screen1.image.lines = 89;
screen1.image.width = 59;
screen1.position.x = 72;
screen1.position.y = 59;
screen1.alpha = 1;
Sprite screen2;
screen2.image.address = 0x0009E5C0;
screen2.image.lines = 156;
screen2.image.width = 57;
screen2.position.x = 49;
screen2.position.y = 25;
screen2.alpha = 1;
Sprite screen3;
screen3.image.address = 0x0009E5F9;
screen3.image.lines = 156;
screen3.image.width = 38;
screen3.position.x = 106;
screen3.position.y = 25;
screen3.alpha = 1;
Sprite screen4;
screen4.image.address = 0x0009A060;
screen4.image.lines = 111;
screen4.image.width = 40;
screen4.position.x = 13;
screen4.position.y = 3;
screen4.alpha = 1;
Sprite screen5;
screen5.image.address = 0x0009A095;
screen5.image.lines = 111;
screen5.image.width = 21;
screen5.position.x = 67;
screen5.position.y = 3;
screen5.alpha = 1;
Sprite screen6;
screen6.image.address = 0x00099EEB;
screen6.image.lines = 17;
screen6.image.width = 17;
screen6.position.x = 120;
screen6.position.y = 2;
screen6.alpha = 1;
Sprite screen7;
screen7.image.address = 0x000AA575;
screen7.image.lines = 20;
screen7.image.width = 16;
screen7.position.x = 143;
screen7.position.y = 188;
screen7.alpha = 1;
Sprite boot0;
boot0.image.address = 0x000A478D;
boot0.image.lines = 12;
boot0.image.width = 59;
boot0.position.x = 6;
boot0.position.y = 15;
boot0.alpha = 1;
Sprite boot1;
boot1.image.address = 0x000A0EBF;
boot1.image.lines = 9;
boot1.image.width = 65;
boot1.position.x = 6;
boot1.position.y = 29;
boot1.alpha = 1;
Sprite boot2;
boot2.image.address = 0x000A145F;
boot2.image.lines = 9;
boot2.image.width = 65;
boot2.position.x = 6;
boot2.position.y = 44;
boot2.alpha = 1;
Sprite boot3;
boot3.image.address = 0x000A19FF;
boot3.image.lines = 9;
boot3.image.width = 26;
boot3.position.x = 6;
boot3.position.y = 58;
boot3.alpha = 1;
Sprite boot4;
boot4.image.address = 0x00099AC0;
boot4.image.lines = 9;
boot4.image.width = 60;
boot4.position.x = 6;
boot4.position.y = 73;
boot4.alpha = 1;
Sprite boot5;
boot5.image.address = 0x00099AFC;
boot5.image.lines = 9;
boot5.image.width = 60;
boot5.position.x = 66;
boot5.position.y = 73;
boot5.alpha = 1;
drawtobackground (black);
delay_s(1);
drawsprite(pilot);
delay_ms(200);
drawsprite(screen0);
//flash newest screen
for (i = 0; i < 10; i++)
{
drawtobackground(black);
drawsprite(pilot);
delay_ms(25);
drawsprite(screen0);
delay_ms(25);
}
drawsprite(screen1);
for (i = 0; i < 10; i++)
{
drawtobackground(black);
drawsprite(pilot);
drawsprite(screen0);
delay_ms(25);
drawsprite(screen1);
delay_ms(25);
}
drawsprite(screen2);
drawsprite(screen3);
for (i = 0; i < 10; i++)
{
drawtobackground(black);
drawsprite(pilot);
drawsprite(screen0);
drawsprite(screen1);
delay_ms(25);
drawsprite(screen2);
drawsprite(screen3);
delay_ms(25);
if (i == 3)
pilot.image.address = 0x000AB1CD;
}
delay_ms(255);
drawsprite(screen4);
drawsprite(screen5);
drawsprite(screen6);
drawsprite(screen7);
for (i = 0; i < 10; i++)
{
drawtobackground(black);
drawsprite(pilot);
drawsprite(screen0);
drawsprite(screen1);
drawsprite(screen2);
drawsprite(screen3);
delay_ms(25);
drawsprite(screen4);
drawsprite(screen5);
drawsprite(screen6);
drawsprite(screen7);
delay_ms(25);
if (i == 7)
pilot.image.address = 0x000A4740;
}
delay_s (1);
drawsprite(boot0);
delay_ms(255);
delay_ms(255);
drawsprite(boot1);
delay_ms(255);
delay_ms(255);
delay_ms(255);
drawsprite(boot2);
delay_s(2);
drawsprite(boot3);
delay_ms(255);
drawsprite(boot4);
drawsprite(boot5);
delay_s(1);
return;
}
void scene4(void)
{
char i = 0;
char j = 0;
Bitmap black;
black.address = 0x0001C200;
black.lines = 0x00F0;
black.width = 0x00A0;
Sprite skyline;
skyline.image.address = 0x00090510;
skyline.image.lines = 320;
skyline.image.width = 0;
skyline.position.x = 80;
skyline.position.y = 0;
skyline.alpha = 0;
Sprite plane_1;
plane_1.image.address = 0x0008B7E0;
plane_1.image.lines = 123;
plane_1.image.width = 40;
plane_1.position.x = 0;
plane_1.position.y = 200;
plane_1.alpha = 1;
Sprite plane_2;
plane_2.image.address = 0x0008B808;
plane_2.image.lines = 123;
plane_2.image.width = 40;
plane_2.position.x = 40;
plane_2.position.y = 200;
plane_2.alpha = 1;
Sprite plane_3;
plane_3.image.address = 0x0008B830;
plane_3.image.lines = 123;
plane_3.image.width = 40;
plane_3.position.x = 80;
plane_3.position.y = 200;
plane_3.alpha = 1;
Sprite plane_4;
plane_4.image.address = 0x0008B858;
plane_4.image.lines = 123;
plane_4.image.width = 40;
plane_4.position.x = 120;
plane_4.position.y = 200;
plane_4.alpha = 1;
drawtobackground(black);
for (i = 0; i <80 ; i++)
{
drawsprite (skyline);
drawsprite (plane_1);
drawsprite (plane_2);
drawsprite (plane_3);
drawsprite (plane_4);
//do some slide fx here
skyline.image.width +=2;
skyline.image.address --;
skyline.position.x --;
plane_1.position.y -= 1;
plane_2.position.y -= 1;
plane_3.position.y -= 1;
plane_4.position.y -= 1;
delay_ms(20 + i/2);
}
delay_s(3);
}
void scene5(void)
{
char i = 0;
char j = 0;
unsigned long takeoff_addr[8] =
{
0x0002E720,
0x000332C0,
0x00037E60,
0x0003CA00,
0x00040BA0,
0x00044D40,
0x00049840,
0x0004E3E0
};
char takeoff_lines[8] =
{
121,
121,
121,
105,
105,
120,
120,
121
};
Bitmap black;
black.address = 0x0001C200;
black.lines = 0x00F0;
black.width = 0x00A0;
Sprite takeoff;
takeoff.image.address = takeoff_addr[0];
takeoff.image.lines = takeoff_lines[0];
takeoff.image.width = 160;
takeoff.position.x = 0;
takeoff.position.y = 49;
takeoff.alpha = 0;
drawtobackground(black);
//accelerate plane
for (i = 0; i < 15 ; i++)
{
for ( j = 0; j < 8; j++)
{
drawsprite (takeoff);
takeoff.image.address = takeoff_addr[j];
takeoff.image.lines = takeoff_lines[j];
delay_ms (100 - (i * 4));
}
}
//max speed
for (i = 0; i < 10 ; i++)
{
for ( j = 0; j < 8; j++)
{
drawsprite (takeoff);
takeoff.image.address = takeoff_addr[j];
takeoff.image.lines = takeoff_lines[j];
delay_ms(40);
}
}
}
void bootup(void)
{
char i = 0;
0334 6A05 CLRF bootup_00000_1_i
char j = 0;
0336 6A06 CLRF bootup_00000_1_j
Bitmap black;
black.address = 0x0001C200;
0338 6A07 CLRF bootup_00000_1_black
033A 0EC2 MOVLW 0xC2
033C 6E08 MOVWF bootup_00000_1_black+D'1'
033E 0E01 MOVLW 0x01
0340 6E09 MOVWF bootup_00000_1_black+D'2'
0342 6A0A CLRF bootup_00000_1_black+D'3'
black.lines = 0x00F0;
0344 0EF0 MOVLW 0xF0
0346 6E0D MOVWF bootup_00000_1_black+D'6'
0348 6A0E CLRF bootup_00000_1_black+D'7'
black.width = 0x00A0;
034A 0EA0 MOVLW 0xA0
034C 6E0B MOVWF bootup_00000_1_black+D'4'
034E 6A0C CLRF bootup_00000_1_black+D'5'
Sprite frame;
frame.image.address = 0x00376800;
0350 6A0F CLRF bootup_00000_1_frame
0352 0E68 MOVLW 0x68
0354 6E10 MOVWF bootup_00000_1_frame+D'1'
0356 0E37 MOVLW 0x37
0358 6E11 MOVWF bootup_00000_1_frame+D'2'
035A 6A12 CLRF bootup_00000_1_frame+D'3'
frame.image.lines = 160;
035C 0EA0 MOVLW 0xA0
035E 6E15 MOVWF bootup_00000_1_frame+D'6'
0360 6A16 CLRF bootup_00000_1_frame+D'7'
frame.image.width = 79;
0362 0E4F MOVLW 0x4F
0364 6E13 MOVWF bootup_00000_1_frame+D'4'
0366 6A14 CLRF bootup_00000_1_frame+D'5'
frame.position.x = 0;
0368 6A17 CLRF bootup_00000_1_frame+D'8'
036A 6A18 CLRF bootup_00000_1_frame+D'9'
036C 6A19 CLRF bootup_00000_1_frame+D'10'
036E 6A1A CLRF bootup_00000_1_frame+D'11'
frame.position.y = 0;
0370 6A1B CLRF bootup_00000_1_frame+D'12'
0372 6A1C CLRF bootup_00000_1_frame+D'13'
0374 6A1D CLRF bootup_00000_1_frame+D'14'
0376 6A1E CLRF bootup_00000_1_frame+D'15'
frame.alpha = 0;
0378 6A1F CLRF bootup_00000_1_frame+D'16'
//reset frame to center
frame.position.x = 40;
037A 0E28 MOVLW 0x28
037C 6E17 MOVWF bootup_00000_1_frame+D'8'
037E 6A18 CLRF bootup_00000_1_frame+D'9'
0380 6A19 CLRF bootup_00000_1_frame+D'10'
0382 6A1A CLRF bootup_00000_1_frame+D'11'
frame.position.y = 40;
0384 0E28 MOVLW 0x28
0386 6E1B MOVWF bootup_00000_1_frame+D'12'
0388 6A1C CLRF bootup_00000_1_frame+D'13'
038A 6A1D CLRF bootup_00000_1_frame+D'14'
038C 6A1E CLRF bootup_00000_1_frame+D'15'
drawtobackground(black);
038E 500E MOVF bootup_00000_1_black+D'7', W
0390 6E27 MOVWF drawtoback_00007_arg_source+D'7'
0392 500D MOVF bootup_00000_1_black+D'6', W
0394 6E26 MOVWF drawtoback_00007_arg_source+D'6'
0396 500C MOVF bootup_00000_1_black+D'5', W
0398 6E25 MOVWF drawtoback_00007_arg_source+D'5'
039A 500B MOVF bootup_00000_1_black+D'4', W
039C 6E24 MOVWF drawtoback_00007_arg_source+D'4'
039E 500A MOVF bootup_00000_1_black+D'3', W
03A0 6E23 MOVWF drawtoback_00007_arg_source+D'3'
03A2 5009 MOVF bootup_00000_1_black+D'2', W
03A4 6E22 MOVWF drawtoback_00007_arg_source+D'2'
03A6 5008 MOVF bootup_00000_1_black+D'1', W
03A8 6E21 MOVWF drawtoback_00007_arg_source+D'1'
03AA 5007 MOVF bootup_00000_1_black, W
03AC 6E20 MOVWF drawtoback_00007_arg_source
03AE EC5DF001 CALL drawtoback_00007
delay_ms(200);
03B2 0EC8 MOVLW 0xC8
03B4 6E20 MOVWF delay_ms_00000_arg_del
03B6 EC02F000 CALL delay_ms_00000
//play boot movie
for (i = 0; i < 21; i++)
03BA 6A05 CLRF bootup_00000_1_i
03BC label268437212
03BC 0E15 MOVLW 0x15
03BE 6005 CPFSLT bootup_00000_1_i
03C0 D072 BRA label268437213
04A2 2A05 INCF bootup_00000_1_i, F
04A4 D78B BRA label268437212
04A6 label268437213
{
//show 'left' frame
drawsprite (frame);
03C2 501F MOVF bootup_00000_1_frame+D'16', W
03C4 6E30 MOVWF drawsprite_00000_arg_sprite+D'16'
03C6 501E MOVF bootup_00000_1_frame+D'15', W
03C8 6E2F MOVWF drawsprite_00000_arg_sprite+D'15'
03CA 501D MOVF bootup_00000_1_frame+D'14', W
03CC 6E2E MOVWF drawsprite_00000_arg_sprite+D'14'
03CE 501C MOVF bootup_00000_1_frame+D'13', W
03D0 6E2D MOVWF drawsprite_00000_arg_sprite+D'13'
03D2 501B MOVF bootup_00000_1_frame+D'12', W
03D4 6E2C MOVWF drawsprite_00000_arg_sprite+D'12'
03D6 501A MOVF bootup_00000_1_frame+D'11', W
03D8 6E2B MOVWF drawsprite_00000_arg_sprite+D'11'
03DA 5019 MOVF bootup_00000_1_frame+D'10', W
03DC 6E2A MOVWF drawsprite_00000_arg_sprite+D'10'
03DE 5018 MOVF bootup_00000_1_frame+D'9', W
03E0 6E29 MOVWF drawsprite_00000_arg_sprite+D'9'
03E2 5017 MOVF bootup_00000_1_frame+D'8', W
03E4 6E28 MOVWF drawsprite_00000_arg_sprite+D'8'
03E6 5016 MOVF bootup_00000_1_frame+D'7', W
03E8 6E27 MOVWF drawsprite_00000_arg_sprite+D'7'
03EA 5015 MOVF bootup_00000_1_frame+D'6', W
03EC 6E26 MOVWF drawsprite_00000_arg_sprite+D'6'
03EE 5014 MOVF bootup_00000_1_frame+D'5', W
03F0 6E25 MOVWF drawsprite_00000_arg_sprite+D'5'
03F2 5013 MOVF bootup_00000_1_frame+D'4', W
03F4 6E24 MOVWF drawsprite_00000_arg_sprite+D'4'
03F6 5012 MOVF bootup_00000_1_frame+D'3', W
03F8 6E23 MOVWF drawsprite_00000_arg_sprite+D'3'
03FA 5011 MOVF bootup_00000_1_frame+D'2', W
03FC 6E22 MOVWF drawsprite_00000_arg_sprite+D'2'
03FE 5010 MOVF bootup_00000_1_frame+D'1', W
0400 6E21 MOVWF drawsprite_00000_arg_sprite+D'1'
0402 500F MOVF bootup_00000_1_frame, W
0404 6E20 MOVWF drawsprite_00000_arg_sprite
0406 EC12F001 CALL drawsprite_00000
//show 'right' frame
if (i > 18)
040A 0E12 MOVLW 0x12
040C 6405 CPFSGT bootup_00000_1_i
040E D005 BRA label268437220
041A label268437220
delay_ms(100);
0410 0E64 MOVLW 0x64
0412 6E20 MOVWF delay_ms_00000_arg_del
0414 EC02F000 CALL delay_ms_00000
else
0418 D004 BRA label268437226
0422 label268437226
delay_ms(60);
041A 0E3C MOVLW 0x3C
041C 6E20 MOVWF delay_ms_00000_arg_del
041E EC02F000 CALL delay_ms_00000
frame.image.address += 80;
0422 0E50 MOVLW 0x50
0424 260F ADDWF bootup_00000_1_frame, F
0426 0E00 MOVLW 0x00
0428 2210 ADDWFC bootup_00000_1_frame+D'1', F
042A 0E00 MOVLW 0x00
042C 2211 ADDWFC bootup_00000_1_frame+D'2', F
042E 0E00 MOVLW 0x00
0430 2212 ADDWFC bootup_00000_1_frame+D'3', F
drawsprite (frame);
0432 501F MOVF bootup_00000_1_frame+D'16', W
0434 6E30 MOVWF drawsprite_00000_arg_sprite+D'16'
0436 501E MOVF bootup_00000_1_frame+D'15', W
0438 6E2F MOVWF drawsprite_00000_arg_sprite+D'15'
043A 501D MOVF bootup_00000_1_frame+D'14', W
043C 6E2E MOVWF drawsprite_00000_arg_sprite+D'14'
043E 501C MOVF bootup_00000_1_frame+D'13', W
0440 6E2D MOVWF drawsprite_00000_arg_sprite+D'13'
0442 501B MOVF bootup_00000_1_frame+D'12', W
0444 6E2C MOVWF drawsprite_00000_arg_sprite+D'12'
0446 501A MOVF bootup_00000_1_frame+D'11', W
0448 6E2B MOVWF drawsprite_00000_arg_sprite+D'11'
044A 5019 MOVF bootup_00000_1_frame+D'10', W
044C 6E2A MOVWF drawsprite_00000_arg_sprite+D'10'
044E 5018 MOVF bootup_00000_1_frame+D'9', W
0450 6E29 MOVWF drawsprite_00000_arg_sprite+D'9'
0452 5017 MOVF bootup_00000_1_frame+D'8', W
0454 6E28 MOVWF drawsprite_00000_arg_sprite+D'8'
0456 5016 MOVF bootup_00000_1_frame+D'7', W
0458 6E27 MOVWF drawsprite_00000_arg_sprite+D'7'
045A 5015 MOVF bootup_00000_1_frame+D'6', W
045C 6E26 MOVWF drawsprite_00000_arg_sprite+D'6'
045E 5014 MOVF bootup_00000_1_frame+D'5', W
0460 6E25 MOVWF drawsprite_00000_arg_sprite+D'5'
0462 5013 MOVF bootup_00000_1_frame+D'4', W
0464 6E24 MOVWF drawsprite_00000_arg_sprite+D'4'
0466 5012 MOVF bootup_00000_1_frame+D'3', W
0468 6E23 MOVWF drawsprite_00000_arg_sprite+D'3'
046A 5011 MOVF bootup_00000_1_frame+D'2', W
046C 6E22 MOVWF drawsprite_00000_arg_sprite+D'2'
046E 5010 MOVF bootup_00000_1_frame+D'1', W
0470 6E21 MOVWF drawsprite_00000_arg_sprite+D'1'
0472 500F MOVF bootup_00000_1_frame, W
0474 6E20 MOVWF drawsprite_00000_arg_sprite
0476 EC12F001 CALL drawsprite_00000
if (i > 18)
047A 0E12 MOVLW 0x12
047C 6405 CPFSGT bootup_00000_1_i
047E D005 BRA label268437236
048A label268437236
delay_ms(100);
0480 0E64 MOVLW 0x64
0482 6E20 MOVWF delay_ms_00000_arg_del
0484 EC02F000 CALL delay_ms_00000
else
0488 D004 BRA label268437242
0492 label268437242
delay_ms(60);
048A 0E3C MOVLW 0x3C
048C 6E20 MOVWF delay_ms_00000_arg_del
048E EC02F000 CALL delay_ms_00000
//skip down to next two frames
frame.image.address += 25520;
0492 0EB0 MOVLW 0xB0
0494 260F ADDWF bootup_00000_1_frame, F
0496 0E63 MOVLW 0x63
0498 2210 ADDWFC bootup_00000_1_frame+D'1', F
049A 0E00 MOVLW 0x00
049C 2211 ADDWFC bootup_00000_1_frame+D'2', F
049E 0E00 MOVLW 0x00
04A0 2212 ADDWFC bootup_00000_1_frame+D'3', F
}
return;
}
04A6 0012 RETURN
void main( void )
{
//Configure port A
adcon1 = 0x07; //disable analog inputs
04A8 0E07 MOVLW 0x07
04AA 6EC1 MOVWF gbl_adcon1
trisa = 00000000b;
04AC 6A92 CLRF gbl_trisa
//Configure port B
trisb = 0x00;
04AE 6A93 CLRF gbl_trisb
//Configure port C
trisc = 10000000b;
04B0 0E80 MOVLW 0x80
04B2 6E94 MOVWF gbl_trisc
//Configure port D
trisd = 10000000b;
04B4 6E95 MOVWF gbl_trisd
//Initialize port A
porta = 0x00;
04B6 6A80 CLRF gbl_porta
//Initialize port B
portb = 0x00;
04B8 6A81 CLRF gbl_portb
//Initialize port C
portc = 0x00;
04BA 6A82 CLRF gbl_portc
//Initialize port D
portc = 0x00;
04BC 6A82 CLRF gbl_portc
//wait for GPU to get ready
//START OF REAL PROGRAM--------------------------------------------
//char input;
//setupinput();
bootup(); //draw bootup logo
04BE EC9AF001 CALL bootup_00000
/* //Endless loop
while( true )
{
scene1();
scene2();
scene4();
scene5();
//final halt
delay_s(5);
}
*/
//ERIC input stuff
char temp;
setupinput();
04C2 EC7FF001 CALL setupinput_00000
while( true )
04C6 label268437264
04DE D7F3 BRA label268437264
{
temp = getinput();
04C6 EC8AF001 CALL getinput_00000
04CA 5000 MOVF CompTempVarRet0, W
04CC 6E04 MOVWF main_1_temp
if(temp & 11110111b)
04CE 0EF7 MOVLW 0xF7
04D0 1404 ANDWF main_1_temp, W
04D2 A4D8 BTFSS STATUS,Z
{
set_bit(portd, 0);
04D4 8083 BSF gbl_portd,0
}
if(temp & 11111011b)
04D6 0EFB MOVLW 0xFB
04D8 1404 ANDWF main_1_temp, W
04DA A4D8 BTFSS STATUS,Z
{
clear_bit(portd, 0);
04DC 9083 BCF gbl_portd,0
}
}
}
#include <system.h>
#include "input.h"
#pragma CLOCK_FREQ 50000000
char getinput()
{
//C4 SDO
//C5 SDI
//C6 TX
//C7 RX
//clear_bit(portd, 5);
//delay_ms(10);
set_bit(portd, 5);
0314 8A83 BSF gbl_portd,5
delay_us(12);
0316 0E0C MOVLW 0x0C
0318 6E05 MOVWF delay_us_00000_arg_del
031A EC3EF000 CALL delay_us_00000
clear_bit(portd, 5);
031E 9A83 BCF gbl_portd,5
delay_us(6);
0320 0E06 MOVLW 0x06
0322 6E05 MOVWF delay_us_00000_arg_del
0324 EC3EF000 CALL delay_us_00000
set_bit(rcsta, SREN); //Single reception
0328 8AAB BSF gbl_rcsta,5
if(pir1 & 0b00100000)
032A AA9E BTFSS gbl_pir1,5
032C D002 BRA label268437510
0332 label268437510
{
return rcreg;
032E 50AE MOVF gbl_rcreg, W
0330 6E00 MOVWF CompTempVarRet0
}
}
0332 0012 RETURN
void setupinput(void)
{
clear_bit(trisc, 6);
02FE 9C94 BCF gbl_trisc,6
set_bit(trisc, 7);
0300 8E94 BSF gbl_trisc,7
set_bit(trisc, 5);
0302 8A94 BSF gbl_trisc,5
spbrg = 255;
0304 68AF SETF gbl_spbrg
set_bit(txsta,SYNC);
0306 88AC BSF gbl_txsta,4
set_bit(rcsta,SPEN);
0308 8EAB BSF gbl_rcsta,7
set_bit(txsta,CSRC);
030A 8EAC BSF gbl_txsta,7
clear_bit(rcsta, SREN);
030C 9AAB BCF gbl_rcsta,5
clear_bit(rcsta, CREN);
030E 98AB BCF gbl_rcsta,4
//set_bit(pie1, RCIE); //enable interrupts
//RCIF will be set when reception
//is completed
//interrupt is generated when
//RCIE was set
//read RCREG to get data
clear_bit(portd, 5);
0310 9A83 BCF gbl_portd,5
}
0312 0012 RETURN
// read all 8 bits, then decide which way to move the sprite
// table of values here
//*********************************************************
// should probably have separate signals for each button...
//*********************************************************
//from high bit to low bit
// Left Right Down Up Start Select B A
// 11111111 - no button pushed
// 11111110 - A
// 11111101 - B
// 11111011 - Select
// 11110111 - Start
// 11101111 - Up
// 11011111 - Down
// 10111111 - Right
// 01111111 - Left
// Other possible functionality
// 01011111 - Diagonal Left/Down
// 10011111 - Diagonal Right/Down
// 01101111 - Diagonal Left/Up
// 10101111 - Diagonal Right/Up
////////////////////////////////////////
// Code with no source :-)
////////////////////////////////////////
0000 EF70F002 GOTO _startup
0004 delay_ms_00000
; { delay_ms ; function begin
0004 5220 MOVF delay_ms_00000_arg_del, F
0006 A4D8 BTFSS STATUS,Z
0008 EF07F000 GOTO label4026531859
000C 0012 RETURN
000E label4026531859
000E 0EFF MOVLW 0xFF
0010 label4026531860
0010 0000 NOP
0012 0000 NOP
0014 0000 NOP
0016 0000 NOP
0018 0000 NOP
001A 0000 NOP
001C 0000 NOP
001E 0000 NOP
0020 0000 NOP
0022 0000 NOP
0024 0000 NOP
0026 0000 NOP
0028 0000 NOP
002A 0000 NOP
002C 0000 NOP
002E 0000 NOP
0030 0000 NOP
0032 0000 NOP
0034 0000 NOP
0036 0000 NOP
0038 0000 NOP
003A 0000 NOP
003C 0000 NOP
003E 0000 NOP
0040 0000 NOP
0042 0000 NOP
0044 0000 NOP
0046 0000 NOP
0048 0000 NOP
004A 0000 NOP
004C 0000 NOP
004E 0000 NOP
0050 0000 NOP
0052 0000 NOP
0054 0000 NOP
0056 0000 NOP
0058 0000 NOP
005A 0000 NOP
005C 0000 NOP
005E 0000 NOP
0060 0000 NOP
0062 0000 NOP
0064 0000 NOP
0066 0000 NOP
0068 0000 NOP
006A 0FFF ADDLW 0xFF
006C A4D8 BTFSS STATUS,Z
006E EF08F000 GOTO label4026531860
0072 0000 NOP
0074 2E20 DECFSZ delay_ms_00000_arg_del, F
0076 EF07F000 GOTO label4026531859
007A 0012 RETURN
; } delay_ms function end
007C delay_us_00000
; { delay_us ; function begin
007C 5205 MOVF delay_us_00000_arg_del, F
007E A4D8 BTFSS STATUS,Z
0080 EF43F000 GOTO label4026531844
0084 0012 RETURN
0086 label4026531844
0086 0E02 MOVLW 0x02
0088 label4026531845
0088 0FFF ADDLW 0xFF
008A A4D8 BTFSS STATUS,Z
008C EF44F000 GOTO label4026531845
0090 2E05 DECFSZ delay_us_00000_arg_del, F
0092 EF43F000 GOTO label4026531844
0096 0012 RETURN
; } delay_us function end
0098 __mul_32_3_00006
; { __mul_32_32 ; function begin
0098 6A00 CLRF CompTempVarRet0
009A 6A01 CLRF CompTempVarRet0+D'1'
009C 6A02 CLRF CompTempVarRet0+D'2'
009E 6A03 CLRF CompTempVarRet0+D'3'
00A0 6A02 CLRF CompTempVarRet0+D'2'
00A2 6A03 CLRF CompTempVarRet0+D'3'
00A4 5035 MOVF __mul_32_3_00006_arg_a, W
00A6 0239 MULWF __mul_32_3_00006_arg_b
00A8 50F3 MOVF gbl_prodl, W
00AA 6E00 MOVWF CompTempVarRet0
00AC 50F4 MOVF gbl_prodh, W
00AE 6E01 MOVWF CompTempVarRet0+D'1'
00B0 5036 MOVF __mul_32_3_00006_arg_a+D'1', W
00B2 0239 MULWF __mul_32_3_00006_arg_b
00B4 50F3 MOVF gbl_prodl, W
00B6 2601 ADDWF CompTempVarRet0+D'1', F
00B8 50F4 MOVF gbl_prodh, W
00BA 2202 ADDWFC CompTempVarRet0+D'2', F
00BC B0D8 BTFSC gbl_status,0
00BE 2A03 INCF CompTempVarRet0+D'3', F
00C0 5037 MOVF __mul_32_3_00006_arg_a+D'2', W
00C2 0239 MULWF __mul_32_3_00006_arg_b
00C4 50F3 MOVF gbl_prodl, W
00C6 2602 ADDWF CompTempVarRet0+D'2', F
00C8 50F4 MOVF gbl_prodh, W
00CA 2203 ADDWFC CompTempVarRet0+D'3', F
00CC 5038 MOVF __mul_32_3_00006_arg_a+D'3', W
00CE 0239 MULWF __mul_32_3_00006_arg_b
00D0 50F3 MOVF gbl_prodl, W
00D2 2603 ADDWF CompTempVarRet0+D'3', F
00D4 5035 MOVF __mul_32_3_00006_arg_a, W
00D6 023A MULWF __mul_32_3_00006_arg_b+D'1'
00D8 50F3 MOVF gbl_prodl, W
00DA 2601 ADDWF CompTempVarRet0+D'1', F
00DC 50F4 MOVF gbl_prodh, W
00DE 2202 ADDWFC CompTempVarRet0+D'2', F
00E0 B0D8 BTFSC gbl_status,0
00E2 2A03 INCF CompTempVarRet0+D'3', F
00E4 5036 MOVF __mul_32_3_00006_arg_a+D'1', W
00E6 023A MULWF __mul_32_3_00006_arg_b+D'1'
00E8 50F3 MOVF gbl_prodl, W
00EA 2602 ADDWF CompTempVarRet0+D'2', F
00EC 50F4 MOVF gbl_prodh, W
00EE 2203 ADDWFC CompTempVarRet0+D'3', F
00F0 5037 MOVF __mul_32_3_00006_arg_a+D'2', W
00F2 023A MULWF __mul_32_3_00006_arg_b+D'1'
00F4 50F3 MOVF gbl_prodl, W
00F6 2603 ADDWF CompTempVarRet0+D'3', F
00F8 5035 MOVF __mul_32_3_00006_arg_a, W
00FA 023B MULWF __mul_32_3_00006_arg_b+D'2'
00FC 50F3 MOVF gbl_prodl, W
00FE 2602 ADDWF CompTempVarRet0+D'2', F
0100 50F4 MOVF gbl_prodh, W
0102 2203 ADDWFC CompTempVarRet0+D'3', F
0104 5036 MOVF __mul_32_3_00006_arg_a+D'1', W
0106 023B MULWF __mul_32_3_00006_arg_b+D'2'
0108 50F3 MOVF gbl_prodl, W
010A 2603 ADDWF CompTempVarRet0+D'3', F
010C 5035 MOVF __mul_32_3_00006_arg_a, W
010E 023C MULWF __mul_32_3_00006_arg_b+D'3'
0110 50F3 MOVF gbl_prodl, W
0112 2603 ADDWF CompTempVarRet0+D'3', F
0114 0012 RETURN
; } __mul_32_32 function end
04E0 _startup
04E0 EF54F002 GOTO main