tfv: get the opening screen working with page flipping

This commit is contained in:
Vince Weaver 2017-08-13 15:17:03 -04:00
parent 16a3e6d615
commit 10672133ad
5 changed files with 57 additions and 17 deletions

View File

@ -5,6 +5,7 @@
#include <SDL.h> #include <SDL.h>
#include "gr-sim.h" #include "gr-sim.h"
#include "tfv_zp.h"
#include "apple2_font.h" #include "apple2_font.h"
@ -548,7 +549,7 @@ static void vtabz(void) {
} }
static void vtab(void) { static void rom_vtab(void) {
/* fb5b */ /* fb5b */
a=ram[CV]; a=ram[CV];
vtabz(); vtabz();
@ -566,7 +567,7 @@ static void setwnd(void) {
a=0x17; a=0x17;
// TABV // TABV
ram[CV]=a; ram[CV]=a;
vtab(); rom_vtab();
} }
static void vline(void) { static void vline(void) {
@ -680,7 +681,7 @@ cleop1_begin:
a=s; a=s;
a++; a++;
if (a<=ram[WNDBTM]) goto cleop1_begin; if (a<=ram[WNDBTM]) goto cleop1_begin;
vtab(); rom_vtab();
return 0; return 0;
} }
@ -931,7 +932,7 @@ scrl1:
// SCRL3 // SCRL3
y=0; y=0;
cleolz(); cleolz();
vtab(); rom_vtab();
return; return;
} }
s=a; s=a;
@ -973,7 +974,7 @@ static void up(void) {
if (a>ram[CV]) return; if (a>ram[CV]) return;
ram[CV]=ram[CV]-1; ram[CV]=ram[CV]-1;
vtab(); rom_vtab();
} }
static void bs(void) { static void bs(void) {
@ -1137,7 +1138,7 @@ static void tabv(void) {
// TABV // TABV
// fb5b // fb5b
ram[CV]=a; ram[CV]=a;
vtab(); rom_vtab();
} }
void basic_vtab(int ypos) { void basic_vtab(int ypos) {
@ -1328,3 +1329,37 @@ void clear_bottom(int page) {
hlin_double(page,0,40,i); hlin_double(page,0,40,i);
} }
} }
void vtab(int ypos) {
ram[CV]=ypos-1;
}
void htab(int xpos) {
ram[CH]=xpos-1;
}
void move_cursor(void) {
int address;
address=gr_addr_lookup[ram[CV]];
address+=ram[CH];
hlin_addr+=(ram[DRAW_PAGE]*4)<<8;
ram[BASL]=address&0xff;
ram[BASH]=address>>8;
}
void print(char *string) {
for(y=0;y<strlen(string);y++) {
a=string[y];
a=a|0x80;
ram[y_indirect(BASL,y)]=a;
}
ram[BASL]+=strlen(string);
}

View File

@ -31,6 +31,10 @@ int vlin(int page, int y1, int y2, int at);
int collision(int xx, int yy, int ground_color); int collision(int xx, int yy, int ground_color);
void clear_top(int page); void clear_top(int page);
void clear_bottom(int page); void clear_bottom(int page);
void vtab(int ypos);
void htab(int xpos);
void move_cursor(void);
void print(char *string);
#define APPLE_UP 11 #define APPLE_UP 11

View File

@ -39,10 +39,6 @@ static void draw_logo(void) {
draw_segment(); draw_segment();
ram[COLOR2]=0; ram[COLOR2]=0;
draw_segment(); draw_segment();
page_flip();
grsim_update();
} }
int opening(void) { int opening(void) {
@ -51,20 +47,22 @@ int opening(void) {
ram[MATCH]=100; ram[MATCH]=100;
draw_logo(); draw_logo();
page_flip();
usleep(200000); usleep(200000);
for(ram[MATCH]=0;ram[MATCH]<30;ram[MATCH]++) { for(ram[MATCH]=0;ram[MATCH]<30;ram[MATCH]++) {
draw_logo(); draw_logo();
grsim_update(); page_flip();
usleep(20000); usleep(20000);
} }
basic_vtab(21); vtab(21);
basic_htab(9); htab(9);
basic_print("A VMW SOFTWARE PRODUCTION"); move_cursor();
grsim_update(); print("A VMW SOFTWARE PRODUCTION");
page_flip();
repeat_until_keypressed(); repeat_until_keypressed();

View File

@ -20,8 +20,8 @@ int title(void) {
home(); home();
grsim_unrle(title_rle,0x800); grsim_unrle(title_rle,0xc00);
gr_copy(0x800,0x400); gr_copy(0xc00,0x400);
grsim_update(); grsim_update();

View File

@ -100,5 +100,8 @@ void page_flip(void) {
ram[DISP_PAGE]=0; ram[DISP_PAGE]=0;
ram[DRAW_PAGE]=1; ram[DRAW_PAGE]=1;
} }
grsim_update();
} }