tfv: add tfv_put_sprite_page()

This commit is contained in:
Vince Weaver 2017-08-23 14:06:38 -04:00
parent 86167a1245
commit fe0ade564b
6 changed files with 44 additions and 35 deletions

View File

@ -815,7 +815,7 @@ int basic_vlin(int y1, int y2, int at) {
int grsim_put_sprite(int page,unsigned char *sprite_data, int xpos, int ypos) {
int grsim_put_sprite_page(int page, unsigned char *sprite_data, int xpos, int ypos) {
unsigned char i;
unsigned char *ptr;
@ -859,6 +859,14 @@ int grsim_put_sprite(int page,unsigned char *sprite_data, int xpos, int ypos) {
return 0;
}
int grsim_put_sprite(unsigned char *sprite_data, int xpos, int ypos) {
grsim_put_sprite_page(0,sprite_data,xpos,ypos);
return 0;
}
int gr_copy(short source, short dest) {
short dest_addr,source_addr;

View File

@ -13,7 +13,8 @@ int bload(char *filename, int address);
int scrn(unsigned char xcoord, unsigned char ycoord);
int grsim_unrle(unsigned char *rle_data, int address);
int home(void);
int grsim_put_sprite(int page,unsigned char *sprite_data, int xpos, int ypos);
int grsim_put_sprite_page(int page,unsigned char *sprite_data, int xpos, int ypos);
int grsim_put_sprite(unsigned char *sprite_data, int xpos, int ypos);
int gr_copy(short source, short dest);
int gr_copy_to_current(short source);
int text(void);

View File

@ -256,15 +256,15 @@ int flying(void) {
draw_background_mode7(our_angle, flyx, flyy);
grsim_put_sprite(0,ship_shadow,xx,30);
grsim_put_sprite_page(0,ship_shadow,xx,30);
if (turning==0) grsim_put_sprite(0,ship_forward,xx,yy);
if (turning==0) grsim_put_sprite_page(0,ship_forward,xx,yy);
if (turning<0) {
grsim_put_sprite(0,ship_left,xx,yy);
grsim_put_sprite_page(0,ship_left,xx,yy);
turning++;
}
if (turning>0) {
grsim_put_sprite(0,ship_right,xx,yy);
grsim_put_sprite_page(0,ship_right,xx,yy);
turning--;
}

View File

@ -117,10 +117,10 @@ int do_battle(void) {
basic_hlin(0,39,i);
}
grsim_put_sprite(0,tfv_stand_left,tfv_x,20);
grsim_put_sprite(0,tfv_led_sword,tfv_x-5,20);
grsim_put_sprite_page(0,tfv_stand_left,tfv_x,20);
grsim_put_sprite_page(0,tfv_led_sword,tfv_x-5,20);
grsim_put_sprite(0,killer_crab,enemy_x,20);
grsim_put_sprite_page(0,killer_crab,enemy_x,20);
grsim_update();

View File

@ -273,22 +273,22 @@ int flying(void) {
if (turning==0) {
if ((speed>0.0) && (over_water)&&(draw_splash)) {
grsim_put_sprite(0,splash_forward,
grsim_put_sprite_page(0,splash_forward,
xx+1,yy+9);
}
grsim_put_sprite(0,shadow_forward,xx+3,31+space_z);
grsim_put_sprite(0,ship_forward,xx,yy);
grsim_put_sprite_page(0,shadow_forward,xx+3,31+space_z);
grsim_put_sprite_page(0,ship_forward,xx,yy);
}
if (turning<0) {
if ((yy>25) && (speed>0.0)) draw_splash=1;
if (over_water&&draw_splash) {
grsim_put_sprite(0,splash_left,
grsim_put_sprite_page(0,splash_left,
xx+1,36);
}
grsim_put_sprite(0,shadow_left,xx+3,31+space_z);
grsim_put_sprite(0,ship_left,xx,yy);
grsim_put_sprite_page(0,shadow_left,xx+3,31+space_z);
grsim_put_sprite_page(0,ship_left,xx,yy);
turning++;
}
if (turning>0) {
@ -297,11 +297,11 @@ int flying(void) {
if ((yy>25) && (speed>0.0)) draw_splash=1;
if (over_water&&draw_splash) {
grsim_put_sprite(0,splash_right,
grsim_put_sprite_page(0,splash_right,
xx+1,36);
}
grsim_put_sprite(0,shadow_right,xx+3,31+space_z);
grsim_put_sprite(0,ship_right,xx,yy);
grsim_put_sprite_page(0,shadow_right,xx+3,31+space_z);
grsim_put_sprite_page(0,ship_right,xx,yy);
turning--;
}

View File

@ -153,13 +153,13 @@ static int load_map_bg(void) {
if ((map_x&3)==2) {
for(i=0;i<4;i++) {
grsim_put_sprite(1,mountain,10+(i%2)*5,(i*8)+2);
grsim_put_sprite_page(1,mountain,10+(i%2)*5,(i*8)+2);
}
}
// grsim_put_sprite(0,tfv_stand_left,tfv_x,20);
// grsim_put_sprite_page(0,tfv_stand_left,tfv_x,20);
return 0;
}
@ -246,11 +246,11 @@ int world_map(void) {
/* Ground Scatter */
if (map_x==1) if (tfv_y>=20) grsim_put_sprite(0,snowy_tree,10,20);
if (map_x==4) if (tfv_y>=15) grsim_put_sprite(0,pine_tree,25,15);
if (map_x==8) if (tfv_y>=22) grsim_put_sprite(0,palm_tree,10,20);
if (map_x==12) if (tfv_y>=22) grsim_put_sprite(0,palm_tree,20,20);
if (map_x==13) if (tfv_y>=15) grsim_put_sprite(0,cactus,25,15);
if (map_x==1) if (tfv_y>=20) grsim_put_sprite_page(0,snowy_tree,10,20);
if (map_x==4) if (tfv_y>=15) grsim_put_sprite_page(0,pine_tree,25,15);
if (map_x==8) if (tfv_y>=22) grsim_put_sprite_page(0,palm_tree,10,20);
if (map_x==12) if (tfv_y>=22) grsim_put_sprite_page(0,palm_tree,20,20);
if (map_x==13) if (tfv_y>=15) grsim_put_sprite_page(0,cactus,25,15);
if ((map_x==7) || (map_x==11)) {
@ -301,19 +301,19 @@ int world_map(void) {
if (direction==-1) {
if (odd) grsim_put_sprite(0,tfv_walk_left,tfv_x,tfv_y);
else grsim_put_sprite(0,tfv_stand_left,tfv_x,tfv_y);
if (odd) grsim_put_sprite_page(0,tfv_walk_left,tfv_x,tfv_y);
else grsim_put_sprite_page(0,tfv_stand_left,tfv_x,tfv_y);
}
if (direction==1) {
if (odd) grsim_put_sprite(0,tfv_walk_right,tfv_x,tfv_y);
else grsim_put_sprite(0,tfv_stand_right,tfv_x,tfv_y);
if (odd) grsim_put_sprite_page(0,tfv_walk_right,tfv_x,tfv_y);
else grsim_put_sprite_page(0,tfv_stand_right,tfv_x,tfv_y);
}
if (map_x==1) if (tfv_y<20) grsim_put_sprite(0,snowy_tree,10,20);
if (map_x==4) if (tfv_y<15) grsim_put_sprite(0,pine_tree,25,15);
if (map_x==8) if (tfv_y<22) grsim_put_sprite(0,palm_tree,10,20);
if (map_x==12) if (tfv_y<22) grsim_put_sprite(0,palm_tree,20,20);
if (map_x==13) if (tfv_y<15) grsim_put_sprite(0,cactus,25,15);
if (map_x==1) if (tfv_y<20) grsim_put_sprite_page(0,snowy_tree,10,20);
if (map_x==4) if (tfv_y<15) grsim_put_sprite_page(0,pine_tree,25,15);
if (map_x==8) if (tfv_y<22) grsim_put_sprite_page(0,palm_tree,10,20);
if (map_x==12) if (tfv_y<22) grsim_put_sprite_page(0,palm_tree,20,20);
if (map_x==13) if (tfv_y<15) grsim_put_sprite_page(0,cactus,25,15);
if ((map_x==7) || (map_x==11)) {
for(i=tfv_y+8;i<36;i+=2) {
@ -343,7 +343,7 @@ int world_map(void) {
if (map_x==3) {
if ((steps&0xf)==0) {
grsim_put_sprite(0,lightning,25,4);
grsim_put_sprite_page(0,lightning,25,4);
/* Hurt hit points if in range? */
if ((tfv_x>25) && (tfv_x<30) && (tfv_y<12)) {
printf("HIT! %d %d\n\n",steps,hp);