mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-12-27 02:31:00 +00:00
gr-sim: add hgr scroll demo
This commit is contained in:
parent
de102a4d18
commit
dc8812a862
BIN
gr-sim/hgr/BALLC.BIN
Normal file
BIN
gr-sim/hgr/BALLC.BIN
Normal file
Binary file not shown.
BIN
gr-sim/hgr/MERRY.BIN
Normal file
BIN
gr-sim/hgr/MERRY.BIN
Normal file
Binary file not shown.
@ -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
55
gr-sim/hgr/scroll.c
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user