gr-sim: add hgr scroll demo

This commit is contained in:
Vince Weaver 2018-12-16 21:55:35 -05:00
parent de102a4d18
commit dc8812a862
4 changed files with 65 additions and 2 deletions

BIN
gr-sim/hgr/BALLC.BIN Normal file

Binary file not shown.

BIN
gr-sim/hgr/MERRY.BIN Normal file

Binary file not shown.

View File

@ -6,7 +6,7 @@ SDL_LIBS= `sdl-config --libs`
SDL_INCLUDE= `sdl-config --cflags`
GR_SIM = ../gr-sim.a
all: fireworks fw_purple lines image_load hgr_view seven random16
all: fireworks fw_purple lines image_load hgr_view seven random16 scroll
###
@ -65,6 +65,14 @@ random16.o: random16.c
####
scroll: scroll.o $(GR_SIM)
$(CC) $(LFLAGS) $(SDL_LIBS) -o scroll scroll.o $(GR_SIM)
scroll.o: scroll.c
$(CC) $(CFLAGS) -c scroll.c
####
clean:
rm -f *~ *.o fireworks lines image_load hgr_view fw_purple seven random16
rm -f *~ *.o fireworks lines image_load hgr_view fw_purple seven random16 scroll

55
gr-sim/hgr/scroll.c Normal file
View File

@ -0,0 +1,55 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include "gr-sim.h"
int main(int argc, char **argv) {
int ch,fd;
grsim_init();
home();
hgr();
/* Show all 280x192, no bottom text */
soft_switch(MIXCLR);
fd=open("MERRY.BIN",O_RDONLY);
if (fd<0) {
printf("Error opening!\n");
return -1;
}
read(fd,&ram[0x2000],8192);
close(fd);
grsim_update();
while(1) {
ch=grsim_input();
if (ch) break;
usleep(100000);
}
fd=open("BALLC.BIN",O_RDONLY);
if (fd<0) {
printf("Error opening!\n");
return -1;
}
read(fd,&ram[0x2000],8192);
close(fd);
grsim_update();
while(1) {
ch=grsim_input();
if (ch) break;
usleep(100000);
}
return 0;
}