mode7: add text_demo

This commit is contained in:
Vince Weaver 2018-01-08 16:03:51 -05:00
parent d26ba2c90b
commit 5889cca76b
2 changed files with 51 additions and 2 deletions

View File

@ -6,7 +6,7 @@ SDL_LIBS= `sdl-config --libs`
SDL_INCLUDE= `sdl-config --cflags`
all: fade fixed_point rainbow sparkle starfield starfield_fixed kaleido \
tfv mode7_demo text tfv_multiply rasterbars
tfv mode7_demo text text_demo tfv_multiply rasterbars
#### Library
@ -53,6 +53,14 @@ text.o: text.c
####
text_demo: text_demo.o gr-sim.o
$(CC) $(LFLAGS) $(SDL_LIBS) -o text_demo text_demo.o gr-sim.o
text_demo.o: text_demo.c
$(CC) $(CFLAGS) -c text_demo.c
####
mode7_demo: mode7_demo.o gr-sim.o gr_fast_clear.o
$(CC) $(LFLAGS) $(SDL_LIBS) -o mode7_demo mode7_demo.o \
gr-sim.o gr_fast_clear.o
@ -196,6 +204,6 @@ gr-sim.o: gr-sim.c gr-sim.h apple2_font.h
clean:
rm -f *~ *.o gr-sim rainbow sparkle starfield starfield_fixed kaleido \
tfv text mode7_demo fade fixed_point tfv_multiply \
rasterbars lookup_tables
rasterbars lookup_tables text_demo

41
gr-sim/text_demo.c Normal file
View File

@ -0,0 +1,41 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "gr-sim.h"
int main(int argc, char **argv) {
int ch,i;
char string[]="HELLO WORLD!";
grsim_init();
home();
gr();
basic_htab(10);
basic_vtab(21);
while(1) {
ch=grsim_input();
if (ch!=0) break;
}
while(1) {
basic_htab(14);
basic_vtab(21);
basic_print(string);
grsim_update();
ch=grsim_input();
if (ch=='q') break;
usleep(100000);
}
return 0;
}