From 20c98f74165695cecb1c905845e838c8efae46d5 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Wed, 13 Sep 2017 14:32:08 -0400 Subject: [PATCH] tfv: fix worldmap drawing some of it was broken by changes made when developing tfv_flying --- gr-sim/gr-sim.c | 2 ++ gr-sim/tfv_worldmap.c | 69 ++++++++++++++++++++++++------------------- 2 files changed, 41 insertions(+), 30 deletions(-) diff --git a/gr-sim/gr-sim.c b/gr-sim/gr-sim.c index 3c3ff752..adcdce33 100644 --- a/gr-sim/gr-sim.c +++ b/gr-sim/gr-sim.c @@ -1329,6 +1329,8 @@ hlin_loop: y--; if (y!=255) goto hlin_loop; + ram[GBASL]+=width; + // } return 0; diff --git a/gr-sim/tfv_worldmap.c b/gr-sim/tfv_worldmap.c index 5cc2b982..0a6e439a 100644 --- a/gr-sim/tfv_worldmap.c +++ b/gr-sim/tfv_worldmap.c @@ -76,7 +76,7 @@ static int load_map_bg(void) { /* Sky */ color_equals(COLOR_MEDIUMBLUE); for(i=0;i<10;i+=2) { - hlin_double(PAGE2,0,40,i); + hlin_double(PAGE2,0,39,i); } if (map_x<4) ground_color=(COLOR_WHITE|(COLOR_WHITE<<4)); @@ -102,7 +102,7 @@ static int load_map_bg(void) { if ((map_x&3)==1) { for(i=10;i<40;i+=2) { color_equals(ground_color); - hlin_double(PAGE2,0,40,i); + hlin_double(PAGE2,0,39,i); } } @@ -110,7 +110,7 @@ static int load_map_bg(void) { if ((map_x&3)==2) { for(i=10;i<40;i+=2) { color_equals(ground_color); - hlin_double(PAGE2,0,40,i); + hlin_double(PAGE2,0,39,i); } } @@ -134,14 +134,14 @@ static int load_map_bg(void) { /* Draw north shore */ if (map_x<4) { color_equals(COLOR_DARKBLUE); - hlin_double(PAGE2,0,40,10); + hlin_double(PAGE2,0,39,10); } /* Draw south shore */ if (map_x>=12) { - start=0; end=40; + start=0; end=39; color_equals(COLOR_DARKBLUE); - hlin_double(PAGE2,0,40,38); + hlin_double(PAGE2,0,39,38); color_equals(COLOR_LIGHTBLUE); if (map_x==12) start=6; if (map_x==15) end=35; @@ -234,30 +234,6 @@ int world_map(void) { refresh=1; } - if (refresh) { - load_map_bg(); - refresh=0; - } - - gr_copy_to_current(0xc00); - - /* Ground Scatter */ - - if (map_x==1) if (tfv_y>=20) grsim_put_sprite(snowy_tree,10,20); - if (map_x==4) if (tfv_y>=15) grsim_put_sprite(pine_tree,25,15); - if (map_x==8) if (tfv_y>=22) grsim_put_sprite(palm_tree,10,20); - if (map_x==12) if (tfv_y>=22) grsim_put_sprite(palm_tree,20,20); - if (map_x==13) if (tfv_y>=15) grsim_put_sprite(cactus,25,15); - - - if ((map_x==7) || (map_x==11)) { - for(i=10;i=20) grsim_put_sprite(snowy_tree,10,20); + if (map_x==4) if (tfv_y>=15) grsim_put_sprite(pine_tree,25,15); + if (map_x==8) if (tfv_y>=22) grsim_put_sprite(palm_tree,10,20); + if (map_x==12) if (tfv_y>=22) grsim_put_sprite(palm_tree,20,20); + if (map_x==13) if (tfv_y>=15) grsim_put_sprite(cactus,25,15); + + + /* Draw Background Trees */ + if ((map_x==7) || (map_x==11)) { + for(i=10;i