diff --git a/gr-sim/gr/Makefile b/gr-sim/gr/Makefile new file mode 100644 index 00000000..56cf2d88 --- /dev/null +++ b/gr-sim/gr/Makefile @@ -0,0 +1,23 @@ +CC = gcc +CFLAGS = -Wall -O2 -I.. -g +LFLAGS = -lm + +SDL_LIBS= `sdl-config --libs` +SDL_INCLUDE= `sdl-config --cflags` +GR_SIM = ../gr-sim.a + +all: gr_view + +### + +gr_view: gr_view.o $(GR_SIM) + $(CC) $(LFLAGS) $(SDL_LIBS) -o gr_view gr_view.o $(GR_SIM) + +gr_view.o: gr_view.c + $(CC) $(CFLAGS) -c gr_view.c + +#### + + +clean: + rm -f *~ *.o gr_view diff --git a/gr-sim/gr/gr_view.c b/gr-sim/gr/gr_view.c new file mode 100644 index 00000000..cfe0deed --- /dev/null +++ b/gr-sim/gr/gr_view.c @@ -0,0 +1,43 @@ +#include +#include +#include + +#include + +#include "gr-sim.h" + +int main(int argc, char **argv) { + + int ch,fd; + + if (argc<1) { + fprintf(stderr,"Usage: hgr_view FILENAME\n"); + fprintf(stderr," where FILENAME is an 1k AppleII LORES image\n\n"); + } + + grsim_init(); + + home(); + + gr(); + /* Show all 40x48, no bottom text */ + soft_switch(MIXCLR); + + fd=open(argv[1],O_RDONLY); + if (fd<0) { + printf("Error opening!\n"); + return -1; + } + read(fd,&ram[0x400],1024); + close(fd); + + grsim_update(); + + while(1) { + ch=grsim_input(); + if (ch) break; + usleep(100000); + } + + return 0; +} diff --git a/waterfall/put_sprite.s b/waterfall/gr_putsprite.s similarity index 99% rename from waterfall/put_sprite.s rename to waterfall/gr_putsprite.s index 90577607..a81ac0c6 100644 --- a/waterfall/put_sprite.s +++ b/waterfall/gr_putsprite.s @@ -1,3 +1,4 @@ + ;============================================= ; put_sprite ;============================================= @@ -23,7 +24,7 @@ ; so cost = 28 + Y*(34+18)+ (INNER-Y) -1 + 6 ; = 33 + Y*(52)+(INNER-Y) ; = 33 + Y*(52)+ [30A + 64B + 69C + 54D]-Y -.align $100 + put_sprite: ldy #0 ; byte 0 is xsize ; 2 @@ -134,4 +135,3 @@ put_sprite_done_draw: rts ; return ; 6 -