tfv: update text printing code some more

This commit is contained in:
Vince Weaver 2017-09-19 00:43:17 -04:00
parent df7b4fb5d7
commit eb861dec8f
5 changed files with 46 additions and 14 deletions

View File

@ -896,8 +896,10 @@ int gr_copy_to_current(short source) {
source_addr=gr_addr_lookup[i]+(source-0x400);
dest_addr=gr_addr_lookup[i]+(ram[DRAW_PAGE]<<8);
if (i<4) l=120;
else l=80;
// if (i<4) l=120; // only copy 40 lines
// else l=80;
l=120; // copy 48 lines
for(j=0;j<l;j++) {
ram[dest_addr+j]=ram[source_addr+j];

View File

@ -57,6 +57,7 @@ int do_battle(void) {
int i,ch;
int enemy_x=2;
int saved_drawpage;
//int enemy_hp=20;
int tfv_x=34;
@ -65,6 +66,11 @@ int do_battle(void) {
// gr();
clear_bottom(PAGE2);
saved_drawpage=ram[DRAW_PAGE];
ram[DRAW_PAGE]=PAGE2; // 0xc00
vtab(22);
htab(1);
move_cursor();
@ -120,16 +126,20 @@ int do_battle(void) {
}
//basic_normal();
color_equals(COLOR_MEDIUMBLUE);
for(i=0;i<10;i++) {
hlin_double(ram[DRAW_PAGE],0,39,i);
}
color_equals(COLOR_LIGHTGREEN);
for(i=10;i<40;i++) {
hlin_double(ram[DRAW_PAGE],0,39,i);
}
ram[DRAW_PAGE]=saved_drawpage;
while(1) {
color_equals(COLOR_MEDIUMBLUE);
for(i=0;i<10;i++) {
hlin_double(ram[DRAW_PAGE],0,39,i);
}
color_equals(COLOR_LIGHTGREEN);
for(i=10;i<40;i++) {
hlin_double(ram[DRAW_PAGE],0,39,i);
}
gr_copy_to_current(0xc00);
grsim_put_sprite(tfv_stand_left,tfv_x,20);
grsim_put_sprite(tfv_led_sword,tfv_x-5,20);

View File

@ -509,6 +509,9 @@ int flying(void) {
/************************************************/
gr();
clear_bottom(PAGE0);
clear_bottom(PAGE1);
shipy=20;
while(1) {
@ -613,7 +616,19 @@ int flying(void) {
printf("Color=%d\n",landing_color);
if (landing_color==12) return 0;
else {
printf("Need to land on grass!\n");
int draw_save;
draw_save=ram[DRAW_PAGE];
ram[DRAW_PAGE]=PAGE0;
htab(11);
vtab(22);
move_cursor();
print("NEED TO LAND ON GRASS!");
ram[DRAW_PAGE]=PAGE1;
htab(11);
vtab(22);
move_cursor();
print("NEED TO LAND ON GRASS!");
ram[DRAW_PAGE]=draw_save;
}
}

View File

@ -18,8 +18,9 @@ int title(void) {
int result;
clear_bottom(0);
clear_bottom(1);
clear_bottom(PAGE0);
clear_bottom(PAGE1);
clear_bottom(PAGE2);
grsim_unrle(title_rle,0xc00);

View File

@ -232,7 +232,10 @@ int world_map(void) {
}
if (ch=='h') print_help();
if (ch=='b') do_battle();
if (ch=='b') {
do_battle();
refresh=1;
}
if (ch=='i') print_info();
if (ch=='m') {
show_map();
@ -276,6 +279,7 @@ int world_map(void) {
}
if (refresh) {
clear_bottom(PAGE2);
load_map_bg();
refresh=0;
}