From b72d12eea82f89ad203658b1942477523ef3e31e Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Sun, 26 Nov 2017 17:59:27 -0500 Subject: [PATCH] tfv: make help properly redraw sky when done --- gr-sim/gr-sim.c | 10 ++++++++++ gr-sim/gr-sim.h | 1 + gr-sim/tfv_flying_6502.c | 1 + gr-sim/tfv_info.c | 8 +++++--- tfv/tfv_flying.s | 3 +++ 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/gr-sim/gr-sim.c b/gr-sim/gr-sim.c index 61a81fdc..5247fc3b 100644 --- a/gr-sim/gr-sim.c +++ b/gr-sim/gr-sim.c @@ -1419,6 +1419,16 @@ int collision(int xx, int yy, int ground_color) { return collide; } +void clear_top_a(void) { + + int i; + + ram[COLOR]=a; + for(i=0;i<40;i+=2) { + hlin_double(ram[DRAW_PAGE],0,40,i); + } +} + void clear_top(int page) { int i; diff --git a/gr-sim/gr-sim.h b/gr-sim/gr-sim.h index 60ba5678..780f5b16 100644 --- a/gr-sim/gr-sim.h +++ b/gr-sim/gr-sim.h @@ -32,6 +32,7 @@ void soft_switch(unsigned short address); int soft_switch_read(unsigned short address); int vlin(int y1, int y2, int at); int collision(int xx, int yy, int ground_color); +void clear_top_a(void); void clear_top(int page); void clear_bottom(int page); void vtab(int ypos); diff --git a/gr-sim/tfv_flying_6502.c b/gr-sim/tfv_flying_6502.c index 72828ac6..b48e2ff2 100644 --- a/gr-sim/tfv_flying_6502.c +++ b/gr-sim/tfv_flying_6502.c @@ -972,6 +972,7 @@ int flying(void) { cycles.flying+=5; if (ch=='h') { print_help(); + ram[DRAW_SKY]=2; } cycles.flying+=5; /* Ending */ diff --git a/gr-sim/tfv_info.c b/gr-sim/tfv_info.c index 45350d07..ccde9d22 100644 --- a/gr-sim/tfv_info.c +++ b/gr-sim/tfv_info.c @@ -29,8 +29,10 @@ void game_over(void) { } void print_help(void) { - text(); - home(); + a=0xa0; + clear_top_a(); + + soft_switch(TXTSET); // htab(1); // vtab(1); @@ -69,7 +71,7 @@ void print_help(void) { repeat_until_keypressed(); - gr(); + soft_switch(TXTCLR); } void show_map(void) { diff --git a/tfv/tfv_flying.s b/tfv/tfv_flying.s index ab2b3d19..b6ac33be 100644 --- a/tfv/tfv_flying.s +++ b/tfv/tfv_flying.s @@ -268,6 +268,9 @@ check_help: jsr print_help + lda #2 + sta DRAW_SKY + check_done: ;================