diff --git a/gr-sim/6502_test.c b/gr-sim/6502_test/6502_test.c similarity index 100% rename from gr-sim/6502_test.c rename to gr-sim/6502_test/6502_test.c diff --git a/gr-sim/6502_test/Makefile b/gr-sim/6502_test/Makefile new file mode 100644 index 00000000..04e1045d --- /dev/null +++ b/gr-sim/6502_test/Makefile @@ -0,0 +1,21 @@ +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: 6502_test + +### + +6502_test: 6502_test.o $(GR_SIM) + $(CC) $(LFLAGS) -o 6502_test 6502_test.o $(GR_SIM) + +6502_test.o: 6502_test.c ../6502_emulate.h + $(CC) $(CFLAGS) -c 6502_test.c + + +clean: + rm -f *~ *.o 6502_test diff --git a/gr-sim/Makefile b/gr-sim/Makefile index f4bf527a..789b7550 100644 --- a/gr-sim/Makefile +++ b/gr-sim/Makefile @@ -1,244 +1,53 @@ CC = gcc CFLAGS = -Wall -O2 -g LFLAGS = -lm +AR = ar SDL_LIBS= `sdl-config --libs` SDL_INCLUDE= `sdl-config --cflags` -all: fade fixed_point rainbow sparkle starfield starfield_fixed kaleido \ - tfv mode7_demo text text_demo tfv_multiply rasterbars rasterbars_fixed \ - lz4d_verbose 6502_test krw_decode - +all: gr-sim.a + make -C 6502_test + make -C fade + make -C kaleido_sparkle + make -C lz4 + make -C mode7_demo + make -C rasterbars + make -C starfield + make -C text + make -C tfv #### Library gr_fast_clear.o: gr_fast_clear.c gr-sim.h $(CC) $(CFLAGS) -c gr_fast_clear.c - -#### -demo_title.c: ../gr-utils/png2rle ../tfv/demo.png - ../gr-utils/png2rle c ../tfv/demo.png demo_rle > demo_title.c - #### -fade: fade.o 6502_emulate.o gr-sim.o tfv_utils.o gr_fast_clear.o - $(CC) $(LFLAGS) $(SDL_LIBS) -o fade fade.o 6502_emulate.o gr-sim.o gr_fast_clear.o tfv_utils.o - -fade.o: fade.c demo_title.c - $(CC) $(CFLAGS) -c fade.c - -#### - -lz4d_verbose: lz4d_verbose.o 6502_emulate.o - $(CC) $(LFLAGS) $(SDL_LIBS) -o lz4d_verbose lz4d_verbose.o 6502_emulate.o - -lz4d_verbose.o: lz4d_verbose.c demo_title.c - $(CC) $(CFLAGS) -c lz4d_verbose.c - -#### - -krw_decode: krw_decode.o 6502_emulate.o - $(CC) $(LFLAGS) $(SDL_LIBS) -o krw_decode krw_decode.o 6502_emulate.o - -krw_decode.o: krw_decode.c demo_title.c - $(CC) $(CFLAGS) -c krw_decode.c - -#### - -fixed_point: fixed_point.o - $(CC) $(LFLAGS) -o fixed_point fixed_point.o - -fixed_point.o: fixed_point.c - $(CC) $(CFLAGS) -c fixed_point.c - -#### - -rainbow: rainbow.o 6502_emulate.o gr-sim.o - $(CC) $(LFLAGS) $(SDL_LIBS) -o rainbow rainbow.o 6502_emulate.o gr-sim.o - -rainbow.o: rainbow.c - $(CC) $(CFLAGS) -c rainbow.c - -#### - -text: text.o 6502_emulate.o gr-sim.o - $(CC) $(LFLAGS) $(SDL_LIBS) -o text text.o 6502_emulate.o gr-sim.o - -text.o: text.c - $(CC) $(CFLAGS) -c text.c - -#### - -text_demo: text_demo.o 6502_emulate.o gr-sim.o - $(CC) $(LFLAGS) $(SDL_LIBS) -o text_demo text_demo.o 6502_emulate.o gr-sim.o - -text_demo.o: text_demo.c - $(CC) $(CFLAGS) -c text_demo.c - -#### - -mode7_demo: mode7_demo.o 6502_emulate.o gr-sim.o gr_fast_clear.o - $(CC) $(LFLAGS) $(SDL_LIBS) -o mode7_demo mode7_demo.o \ - 6502_emulate.o gr-sim.o gr_fast_clear.o - -mode7_demo.o: mode7_demo.c - $(CC) $(CFLAGS) -c mode7_demo.c +gr-sim.a: 6502_emulate.o tfv_utils.o gr-sim.o gr_fast_clear.o + $(AR) crs gr-sim.a 6502_emulate.o tfv_utils.o gr-sim.o gr_fast_clear.o ### -../gr-utils/png2rle: - cd .. && cd gr-utils && make - -#### - -tfv_backgrounds.c: ../gr-utils/png2rle \ - ../tfv/title.png \ - ../tfv/map.png \ - ../tfv/landing.png \ - ../tfv/harfco.png \ - ../tfv/belair.png \ - ../tfv/math_office.png \ - ../tfv/video_hr.png \ - ../tfv/collegep.png \ - ../tfv/umcp.png \ - ../tfv/dining.png \ - ../tfv/metro.png \ - ../tfv/talbot.png - ../gr-utils/png2rle c ../tfv/title.png title_rle > tfv_backgrounds.c - ../gr-utils/png2rle c ../tfv/map.png map_rle >> tfv_backgrounds.c - ../gr-utils/png2rle c ../tfv/landing.png landing_rle >> tfv_backgrounds.c - ../gr-utils/png2rle c ../tfv/harfco.png harfco_rle >> tfv_backgrounds.c - ../gr-utils/png2rle c ../tfv/belair.png belair_rle >> tfv_backgrounds.c - ../gr-utils/png2rle c ../tfv/math_office.png math_office_rle >> tfv_backgrounds.c - ../gr-utils/png2rle c ../tfv/video_hr.png video_hr_rle >> tfv_backgrounds.c - ../gr-utils/png2rle c ../tfv/collegep.png collegep_rle >> tfv_backgrounds.c - ../gr-utils/png2rle c ../tfv/umcp.png umcp_rle >> tfv_backgrounds.c - ../gr-utils/png2rle c ../tfv/dining.png dining_rle >> tfv_backgrounds.c - ../gr-utils/png2rle c ../tfv/metro.png metro_rle >> tfv_backgrounds.c - ../gr-utils/png2rle c ../tfv/talbot.png talbot_rle >> tfv_backgrounds.c - - - - - -#### - -tfv_backgrounds.o: tfv_backgrounds.c tfv_backgrounds.h - $(CC) $(CFLAGS) -c tfv_backgrounds.c - -tfv_battle.o: tfv_battle.c - $(CC) $(CFLAGS) -c tfv_battle.c - -tfv_citymap.o: tfv_citymap.c - $(CC) $(CFLAGS) -c tfv_citymap.c - -tfv_flying.o: tfv_flying.c tfv_flying_fixed.c tfv_flying_float.c tfv_flying_6502.c - $(CC) $(CFLAGS) -c tfv_flying.c - -tfv_info.o: tfv_info.c - $(CC) $(CFLAGS) -c tfv_info.c - -tfv_opener.o: tfv_opener.c tfv_utils.h - $(CC) $(CFLAGS) -c tfv_opener.c - -tfv_sprites.o: tfv_sprites.c tfv_sprites.c - $(CC) $(CFLAGS) -c tfv_sprites.c - -tfv_textentry.o: tfv_textentry.c - $(CC) $(CFLAGS) -c tfv_textentry.c - -tfv_title.o: tfv_title.c tfv_utils.h tfv_backgrounds.h - $(CC) $(CFLAGS) -c tfv_title.c - -tfv_utils.o: tfv_utils.c tfv_utils.h - $(CC) $(CFLAGS) -c tfv_utils.c - -tfv_worldmap.o: tfv_worldmap.c - $(CC) $(CFLAGS) -c tfv_worldmap.c - - -tfv_multiply.o: tfv_multiply.c - $(CC) $(CFLAGS) -c tfv_multiply.c - -tfv_multiply: tfv_multiply.o - $(CC) $(LFLAGS) -o tfv_multiply tfv_multiply.o - - -tfv.o: tfv.c gr-sim.h tfv_backgrounds.h tfv_sprites.h - $(CC) $(CFLAGS) -c tfv.c - -tfv: tfv.o tfv_backgrounds.o tfv_battle.o tfv_citymap.o tfv_flying.o \ - tfv_info.o tfv_opener.o tfv_sprites.o tfv_textentry.o \ - tfv_title.o tfv_utils.o tfv_worldmap.o \ - 6502_emulate.o gr-sim.o gr_fast_clear.o - $(CC) $(LFLAGS) $(SDL_LIBS) -o tfv tfv.o \ - tfv_backgrounds.o tfv_battle.o tfv_citymap.o tfv_flying.o \ - tfv_info.o tfv_opener.o tfv_sprites.o tfv_textentry.o \ - tfv_title.o tfv_utils.o tfv_worldmap.o \ - 6502_emulate.o gr-sim.o gr_fast_clear.o - -### - -kaleido: kaleido.o 6502_emulate.o gr-sim.o - $(CC) $(LFLAGS) $(SDL_LIBS) -o kaleido kaleido.o 6502_emulate.o gr-sim.o - -kaleido.o: kaleido.c - $(CC) $(CFLAGS) -c kaleido.c - - -rasterbars: rasterbars.o 6502_emulate.o gr-sim.o gr_fast_clear.o - $(CC) $(LFLAGS) $(SDL_LIBS) -o rasterbars rasterbars.o \ - 6502_emulate.o gr-sim.o gr_fast_clear.o - -rasterbars.o: rasterbars.c - $(CC) $(CFLAGS) -c rasterbars.c - -rasterbars_fixed: rasterbars_fixed.o 6502_emulate.o gr-sim.o gr_fast_clear.o - $(CC) $(LFLAGS) $(SDL_LIBS) -o rasterbars_fixed rasterbars_fixed.o \ - 6502_emulate.o gr-sim.o gr_fast_clear.o - -rasterbars_fixed.o: rasterbars_fixed.c - $(CC) $(CFLAGS) -c rasterbars_fixed.c - -sparkle: sparkle.o 6502_emulate.o gr-sim.o - $(CC) $(LFLAGS) $(SDL_LIBS) -o sparkle sparkle.o 6502_emulate.o gr-sim.o - -sparkle.o: sparkle.c - $(CC) $(CFLAGS) -c sparkle.c - - -starfield: starfield.o 6502_emulate.o gr-sim.o - $(CC) $(LFLAGS) $(SDL_LIBS) -o starfield starfield.o 6502_emulate.o gr-sim.o - -starfield.o: starfield.c - $(CC) $(CFLAGS) -c starfield.c - -starfield_fixed: starfield_fixed.o 6502_emulate.o gr-sim.o - $(CC) $(LFLAGS) $(SDL_LIBS) -o starfield_fixed starfield_fixed.o 6502_emulate.o gr-sim.o - -starfield_fixed.o: starfield_fixed.c - $(CC) $(CFLAGS) -c starfield_fixed.c - - gr-sim.o: gr-sim.c gr-sim.h apple2_font.h $(CC) $(CFLAGS) $(SDL_INCLUDE) -c gr-sim.c 6502_emulate.o: 6502_emulate.c 6502_emulate.h - $(CC) $(CFLAGS) $(SDL_INCLUDE) -c 6502_emulate.c + $(CC) $(CFLAGS) -c 6502_emulate.c -6502_test: 6502_test.o 6502_emulate.o - $(CC) $(LFLAGS) -o 6502_test 6502_test.o 6502_emulate.o - -6502_test.o: 6502_test.c 6502_emulate.h - $(CC) $(CFLAGS) -c 6502_test.c +tfv_utils.o: tfv_utils.c tfv_utils.h + $(CC) $(CFLAGS) -c tfv_utils.c clean: - rm -f *~ *.o gr-sim rainbow sparkle starfield starfield_fixed kaleido \ - tfv text mode7_demo fade fixed_point tfv_multiply \ - rasterbars rasterbars_fixed lookup_tables text_demo \ - lz4d_verbose 6502_test krw_decode - - + rm -f *~ *.o *.a + make -C 6502_test clean + make -C fade clean + make -C kaleido_sparkle clean + make -C lz4 clean + make -C mode7_demo clean + make -C rasterbars clean + make -C starfield clean + make -C text clean + make -C tfv clean diff --git a/gr-sim/fade/Makefile b/gr-sim/fade/Makefile new file mode 100644 index 00000000..536272f2 --- /dev/null +++ b/gr-sim/fade/Makefile @@ -0,0 +1,28 @@ +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: fade + + +#### +#demo_title.c: ../gr-utils/png2rle ../tfv/demo.png +# ../gr-utils/png2rle c ../tfv/demo.png demo_rle > demo_title.c + + +#### + +fade: fade.o $(GR_SIM) + $(CC) $(LFLAGS) $(SDL_LIBS) -o fade fade.o $(GR_SIM) + +fade.o: fade.c demo_title.c + $(CC) $(CFLAGS) -c fade.c + +#### + +clean: + rm -f *~ *.o fade diff --git a/gr-sim/fade/demo_title.c b/gr-sim/fade/demo_title.c new file mode 100644 index 00000000..491e09bd --- /dev/null +++ b/gr-sim/fade/demo_title.c @@ -0,0 +1,53 @@ +unsigned char demo_rle[]={ + 0x28, /* ysize=40 */ + 0xAF,0x00,0xA7,0xCC,0x40,0xA0,0x21,0x00,0xA4,0x04,0xCC,0xCC,0x44, + 0xA0,0x11,0x00,0xFF,0x6F,0xA3,0xFF,0x6F,0xFF,0x2F, + 0xFF,0x6F,0x6F,0xFF,0x2F,0x2F,0xFF,0x50,0xA3,0x00, + 0xC0,0xCC,0x4C,0x44,0x00,0xFF,0x6F,0x6F, + 0xFF,0x2F,0x2F,0x6F,0xA3,0xFF,0x6F,0xFF,0x2F, + 0xFF,0xFF,0x50,0xFF,0x66,0xF6,0x6F,0xF6, + 0x66,0x22,0xFF,0x22,0x66,0xFF,0x66, + 0x22,0x2F,0xFF,0x55,0x00,0x00,0xC0,0xCC, + 0x4C,0x44,0x00,0x00,0xFF,0x66,0xFF,0x66, + 0x22,0x2F,0x66,0xF6,0x6F,0xF6,0x66, + 0x22,0xFF,0x22,0xFF,0x55,0xFF,0x66, + 0xA3,0xFF,0x66,0x22,0xFF,0x22,0x66,0xFF, + 0x66,0x22,0xFF,0xFF,0x55,0x00,0xC0,0xCC, + 0x4C,0x44,0xA3,0x00,0xFF,0x66,0xFF,0x66, + 0x22,0xF2,0x66,0xA3,0xFF,0x66,0x22,0xFF, + 0x22,0xFF,0x55,0xFF,0xF6,0xA3,0xFF,0xF6, + 0xFF,0xF2,0xFF,0xF6,0xF6,0xFF,0xF2,0xF2,0xFF, + 0x55,0x00,0xCC,0xCC,0x44,0xA4,0x00,0xFF,0xF6,0xF6, + 0xFF,0xF2,0xF2,0xF6,0xA3,0xFF,0xF6,0xFF,0xF2, + 0xFF,0xFF,0x55,0x00,0xAF,0x05,0x00,0xCC,0xCC,0x44, + 0xA5,0x00,0xAF,0x05,0xA3,0x00,0xA8,0x80,0xA6,0x00,0xCC,0xCC,0x44, + 0xA0,0x17,0x00,0x88,0x88,0xA4,0x28,0xB8,0x28,0xA3,0x20,0xA4,0x00, + 0x04,0x04,0xA0,0x18,0x00,0x88,0x22,0xFB,0x0B,0x22, + 0xB2,0x22,0xFB,0x0B,0x22,0x00,0x00,0x60, + 0x76,0xA0,0x14,0x00,0x10,0xA5,0x00,0x88,0xA4,0xB2,0x3B, + 0x32,0xB2,0x02,0x02,0x00,0x60,0x76,0x07, + 0xA0,0x11,0x00,0x10,0x00,0x10,0x11,0x01,0xA4,0x00, + 0x88,0x55,0xA5,0xBB,0xA3,0x00,0x60,0x76,0x07, + 0xA6,0x00,0xD0,0x0D,0x00,0xD0,0x0D,0x00, + 0xD0,0xA5,0x00,0x11,0xA8,0x00,0x88,0x85,0xA3,0xBB, + 0xB1,0x0B,0x00,0x0D,0xD0,0x76,0x07, + 0xA5,0x00,0xD0,0xDD,0xD0,0xD0,0xDD,0xD0,0xD0,0xDD, + 0xD0,0xA3,0x00,0x01,0x01,0x11,0x01,0x01,0xA5,0x00,0x80, + 0x88,0x98,0xB8,0xB3,0xB3,0xB0,0x30,0x33, + 0xF3,0xFF,0xFD,0xA3,0xF0,0xA3,0x00,0xDD,0xA7,0xBB, + 0xDD,0xA4,0x00,0x10,0x11,0x10,0xA6,0x00,0x88, + 0xA3,0x99,0x9B,0xBB,0xBB,0x9B,0x93,0x00,0xFF,0xFF, + 0xF7,0xF0,0xFF,0xFF,0x70,0x00,0xDD,0xBB, + 0xBF,0xB0,0xBB,0xBF,0xB0,0xBB,0xDD, + 0xA3,0x00,0x10,0xA3,0x11,0x10,0xA5,0x00,0x08,0x99, + 0xB9,0xA6,0x99,0x80,0xA3,0x8F,0xFF,0xFF,0x0F,0x07, + 0x00,0xDD,0xDB,0xBB,0x3B,0x33,0xBB,0xBB, + 0xDB,0xDD,0xA3,0x00,0x01,0x01,0x11,0x01,0x01,0xA6,0x00, + 0x99,0xBB,0xA4,0x99,0x09,0x80,0xA4,0xFF,0xF7, + 0x0F,0xA3,0x00,0xDD,0xDD,0xA5,0xBB,0xDD,0xDD,0xA5,0x00,0x11, + 0xA8,0x00,0x99,0xBB,0xA3,0xB9,0x99,0x88,0xA5,0xFF, + 0xA5,0x00,0x0D,0x00,0xBB,0xA3,0xB1,0xBB,0x00, + 0x0D,0xA4,0x00,0xBB,0xBB,0xA7,0x00,0x99,0x99,0xA4,0x9B,0xFB, + 0xA6,0xFF,0xA8,0x00,0xBB,0xBB,0xA6,0x00,0x20,0x22,0x2B, + 0x0B,0xA6,0x00,0x90,0xA5,0x99,0xF9,0xA7,0xFF,0xA5,0x00, + 0x20,0xA6,0x22,0xA3,0x20,0x22,0x22,0x02,0xA6,0x00,0xA1, }; diff --git a/gr-sim/fade.c b/gr-sim/fade/fade.c similarity index 100% rename from gr-sim/fade.c rename to gr-sim/fade/fade.c diff --git a/gr-sim/kaleido_sparkle/Makefile b/gr-sim/kaleido_sparkle/Makefile new file mode 100644 index 00000000..31b26253 --- /dev/null +++ b/gr-sim/kaleido_sparkle/Makefile @@ -0,0 +1,40 @@ +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: sparkle kaleido rainbow + + +### + +kaleido: kaleido.o $(GR_SIM) + $(CC) $(LFLAGS) $(SDL_LIBS) -o kaleido kaleido.o $(GR_SIM) + +kaleido.o: kaleido.c + $(CC) $(CFLAGS) -c kaleido.c + +### + +sparkle: sparkle.o $(GR_SIM) + $(CC) $(LFLAGS) $(SDL_LIBS) -o sparkle sparkle.o $(GR_SIM) + +sparkle.o: sparkle.c + $(CC) $(CFLAGS) -c sparkle.c + +### + +rainbow: rainbow.o $(GR_SIM) + $(CC) $(LFLAGS) $(SDL_LIBS) -o rainbow rainbow.o $(GR_SIM) + +rainbow.o: rainbow.c + $(CC) $(CFLAGS) -c rainbow.c + +#### + + +clean: + rm -f *~ *.o kaleido sparkle rainbow diff --git a/gr-sim/kaleido.c b/gr-sim/kaleido_sparkle/kaleido.c similarity index 100% rename from gr-sim/kaleido.c rename to gr-sim/kaleido_sparkle/kaleido.c diff --git a/gr-sim/rainbow.c b/gr-sim/kaleido_sparkle/rainbow.c similarity index 100% rename from gr-sim/rainbow.c rename to gr-sim/kaleido_sparkle/rainbow.c diff --git a/gr-sim/sparkle.c b/gr-sim/kaleido_sparkle/sparkle.c similarity index 100% rename from gr-sim/sparkle.c rename to gr-sim/kaleido_sparkle/sparkle.c diff --git a/gr-sim/lz4/Makefile b/gr-sim/lz4/Makefile new file mode 100644 index 00000000..168b895b --- /dev/null +++ b/gr-sim/lz4/Makefile @@ -0,0 +1,28 @@ +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: lz4d_verbose krw_decode + +### + +lz4d_verbose: lz4d_verbose.o $(GR_SIM) + $(CC) $(LFLAGS) $(SDL_LIBS) -o lz4d_verbose lz4d_verbose.o $(GR_SIM) + +lz4d_verbose.o: lz4d_verbose.c demo_title.c + $(CC) $(CFLAGS) -c lz4d_verbose.c + +#### + +krw_decode: krw_decode.o $(GR_SIM) + $(CC) $(LFLAGS) $(SDL_LIBS) -o krw_decode krw_decode.o $(GR_SIM) + +krw_decode.o: krw_decode.c demo_title.c + $(CC) $(CFLAGS) -c krw_decode.c + +clean: + rm -f *~ *.o gr-sim lz4d_verbose krw_decode diff --git a/gr-sim/lz4/demo_title.c b/gr-sim/lz4/demo_title.c new file mode 100644 index 00000000..491e09bd --- /dev/null +++ b/gr-sim/lz4/demo_title.c @@ -0,0 +1,53 @@ +unsigned char demo_rle[]={ + 0x28, /* ysize=40 */ + 0xAF,0x00,0xA7,0xCC,0x40,0xA0,0x21,0x00,0xA4,0x04,0xCC,0xCC,0x44, + 0xA0,0x11,0x00,0xFF,0x6F,0xA3,0xFF,0x6F,0xFF,0x2F, + 0xFF,0x6F,0x6F,0xFF,0x2F,0x2F,0xFF,0x50,0xA3,0x00, + 0xC0,0xCC,0x4C,0x44,0x00,0xFF,0x6F,0x6F, + 0xFF,0x2F,0x2F,0x6F,0xA3,0xFF,0x6F,0xFF,0x2F, + 0xFF,0xFF,0x50,0xFF,0x66,0xF6,0x6F,0xF6, + 0x66,0x22,0xFF,0x22,0x66,0xFF,0x66, + 0x22,0x2F,0xFF,0x55,0x00,0x00,0xC0,0xCC, + 0x4C,0x44,0x00,0x00,0xFF,0x66,0xFF,0x66, + 0x22,0x2F,0x66,0xF6,0x6F,0xF6,0x66, + 0x22,0xFF,0x22,0xFF,0x55,0xFF,0x66, + 0xA3,0xFF,0x66,0x22,0xFF,0x22,0x66,0xFF, + 0x66,0x22,0xFF,0xFF,0x55,0x00,0xC0,0xCC, + 0x4C,0x44,0xA3,0x00,0xFF,0x66,0xFF,0x66, + 0x22,0xF2,0x66,0xA3,0xFF,0x66,0x22,0xFF, + 0x22,0xFF,0x55,0xFF,0xF6,0xA3,0xFF,0xF6, + 0xFF,0xF2,0xFF,0xF6,0xF6,0xFF,0xF2,0xF2,0xFF, + 0x55,0x00,0xCC,0xCC,0x44,0xA4,0x00,0xFF,0xF6,0xF6, + 0xFF,0xF2,0xF2,0xF6,0xA3,0xFF,0xF6,0xFF,0xF2, + 0xFF,0xFF,0x55,0x00,0xAF,0x05,0x00,0xCC,0xCC,0x44, + 0xA5,0x00,0xAF,0x05,0xA3,0x00,0xA8,0x80,0xA6,0x00,0xCC,0xCC,0x44, + 0xA0,0x17,0x00,0x88,0x88,0xA4,0x28,0xB8,0x28,0xA3,0x20,0xA4,0x00, + 0x04,0x04,0xA0,0x18,0x00,0x88,0x22,0xFB,0x0B,0x22, + 0xB2,0x22,0xFB,0x0B,0x22,0x00,0x00,0x60, + 0x76,0xA0,0x14,0x00,0x10,0xA5,0x00,0x88,0xA4,0xB2,0x3B, + 0x32,0xB2,0x02,0x02,0x00,0x60,0x76,0x07, + 0xA0,0x11,0x00,0x10,0x00,0x10,0x11,0x01,0xA4,0x00, + 0x88,0x55,0xA5,0xBB,0xA3,0x00,0x60,0x76,0x07, + 0xA6,0x00,0xD0,0x0D,0x00,0xD0,0x0D,0x00, + 0xD0,0xA5,0x00,0x11,0xA8,0x00,0x88,0x85,0xA3,0xBB, + 0xB1,0x0B,0x00,0x0D,0xD0,0x76,0x07, + 0xA5,0x00,0xD0,0xDD,0xD0,0xD0,0xDD,0xD0,0xD0,0xDD, + 0xD0,0xA3,0x00,0x01,0x01,0x11,0x01,0x01,0xA5,0x00,0x80, + 0x88,0x98,0xB8,0xB3,0xB3,0xB0,0x30,0x33, + 0xF3,0xFF,0xFD,0xA3,0xF0,0xA3,0x00,0xDD,0xA7,0xBB, + 0xDD,0xA4,0x00,0x10,0x11,0x10,0xA6,0x00,0x88, + 0xA3,0x99,0x9B,0xBB,0xBB,0x9B,0x93,0x00,0xFF,0xFF, + 0xF7,0xF0,0xFF,0xFF,0x70,0x00,0xDD,0xBB, + 0xBF,0xB0,0xBB,0xBF,0xB0,0xBB,0xDD, + 0xA3,0x00,0x10,0xA3,0x11,0x10,0xA5,0x00,0x08,0x99, + 0xB9,0xA6,0x99,0x80,0xA3,0x8F,0xFF,0xFF,0x0F,0x07, + 0x00,0xDD,0xDB,0xBB,0x3B,0x33,0xBB,0xBB, + 0xDB,0xDD,0xA3,0x00,0x01,0x01,0x11,0x01,0x01,0xA6,0x00, + 0x99,0xBB,0xA4,0x99,0x09,0x80,0xA4,0xFF,0xF7, + 0x0F,0xA3,0x00,0xDD,0xDD,0xA5,0xBB,0xDD,0xDD,0xA5,0x00,0x11, + 0xA8,0x00,0x99,0xBB,0xA3,0xB9,0x99,0x88,0xA5,0xFF, + 0xA5,0x00,0x0D,0x00,0xBB,0xA3,0xB1,0xBB,0x00, + 0x0D,0xA4,0x00,0xBB,0xBB,0xA7,0x00,0x99,0x99,0xA4,0x9B,0xFB, + 0xA6,0xFF,0xA8,0x00,0xBB,0xBB,0xA6,0x00,0x20,0x22,0x2B, + 0x0B,0xA6,0x00,0x90,0xA5,0x99,0xF9,0xA7,0xFF,0xA5,0x00, + 0x20,0xA6,0x22,0xA3,0x20,0x22,0x22,0x02,0xA6,0x00,0xA1, }; diff --git a/gr-sim/krw_decode.c b/gr-sim/lz4/krw_decode.c similarity index 100% rename from gr-sim/krw_decode.c rename to gr-sim/lz4/krw_decode.c diff --git a/gr-sim/lz4d_verbose.c b/gr-sim/lz4/lz4d_verbose.c similarity index 100% rename from gr-sim/lz4d_verbose.c rename to gr-sim/lz4/lz4d_verbose.c diff --git a/gr-sim/mode7_demo/Makefile b/gr-sim/mode7_demo/Makefile new file mode 100644 index 00000000..828f1067 --- /dev/null +++ b/gr-sim/mode7_demo/Makefile @@ -0,0 +1,51 @@ +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: bounce fixed_point lookup_tables mode7_demo text_demo + + +#### + +fixed_point: fixed_point.o + $(CC) $(LFLAGS) -o fixed_point fixed_point.o + +fixed_point.o: fixed_point.c + $(CC) $(CFLAGS) -c fixed_point.c + +#### + +lookup_tables: lookup_tables.o + $(CC) $(LFLAGS) -o lookup_tables lookup_tables.o + +lookup_tables.o: lookup_tables.c + $(CC) $(CFLAGS) -c lookup_tables.c + +### + +mode7_demo: mode7_demo.o $(GR_SIM) + $(CC) $(LFLAGS) $(SDL_LIBS) -o mode7_demo mode7_demo.o \ + $(GR_SIM) + +mode7_demo.o: mode7_demo.c + $(CC) $(CFLAGS) -c mode7_demo.c + + +### + +text_demo: text_demo.o $(GR_SIM) + $(CC) $(LFLAGS) $(SDL_LIBS) -o text_demo text_demo.o $(GR_SIM) + +text_demo.o: text_demo.c + $(CC) $(CFLAGS) -c text_demo.c + +#### + +clean: + rm -f *~ *.o bounce fixed_point lookup_tables mode7_demo text_demo + diff --git a/gr-sim/bounce.c b/gr-sim/mode7_demo/bounce.c similarity index 95% rename from gr-sim/bounce.c rename to gr-sim/mode7_demo/bounce.c index 64639a5f..dc281a58 100644 --- a/gr-sim/bounce.c +++ b/gr-sim/mode7_demo/bounce.c @@ -24,5 +24,7 @@ int main(int argc, char **argv) { } + (void)d; + return 0; } diff --git a/gr-sim/fixed_point.c b/gr-sim/mode7_demo/fixed_point.c similarity index 100% rename from gr-sim/fixed_point.c rename to gr-sim/mode7_demo/fixed_point.c diff --git a/gr-sim/lookup_tables.c b/gr-sim/mode7_demo/lookup_tables.c similarity index 100% rename from gr-sim/lookup_tables.c rename to gr-sim/mode7_demo/lookup_tables.c diff --git a/gr-sim/mode7_demo.c b/gr-sim/mode7_demo/mode7_demo.c similarity index 99% rename from gr-sim/mode7_demo.c rename to gr-sim/mode7_demo/mode7_demo.c index 495e9773..d25c496f 100644 --- a/gr-sim/mode7_demo.c +++ b/gr-sim/mode7_demo/mode7_demo.c @@ -9,7 +9,7 @@ #include "tfv_utils.h" #include "tfv_zp.h" -#include "tfv_sprites.h" +#include "../tfv/tfv_sprites.h" diff --git a/gr-sim/text_demo.c b/gr-sim/mode7_demo/text_demo.c similarity index 100% rename from gr-sim/text_demo.c rename to gr-sim/mode7_demo/text_demo.c diff --git a/gr-sim/rasterbars/Makefile b/gr-sim/rasterbars/Makefile new file mode 100644 index 00000000..a58f405c --- /dev/null +++ b/gr-sim/rasterbars/Makefile @@ -0,0 +1,28 @@ +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: rasterbars rasterbars_fixed + + +rasterbars: rasterbars.o $(GR_SIM) + $(CC) $(LFLAGS) $(SDL_LIBS) -o rasterbars rasterbars.o \ + $(GR_SIM) + +rasterbars.o: rasterbars.c + $(CC) $(CFLAGS) -c rasterbars.c + +rasterbars_fixed: rasterbars_fixed.o $(GR_SIM) + $(CC) $(LFLAGS) $(SDL_LIBS) -o rasterbars_fixed rasterbars_fixed.o \ + $(GR_SIM) + +rasterbars_fixed.o: rasterbars_fixed.c + $(CC) $(CFLAGS) -c rasterbars_fixed.c + + +clean: + rm -f *~ *.o rasterbars rasterbars_fixed diff --git a/gr-sim/rasterbars.c b/gr-sim/rasterbars/rasterbars.c similarity index 100% rename from gr-sim/rasterbars.c rename to gr-sim/rasterbars/rasterbars.c diff --git a/gr-sim/rasterbars_fixed.c b/gr-sim/rasterbars/rasterbars_fixed.c similarity index 100% rename from gr-sim/rasterbars_fixed.c rename to gr-sim/rasterbars/rasterbars_fixed.c diff --git a/gr-sim/starfield/Makefile b/gr-sim/starfield/Makefile new file mode 100644 index 00000000..da5191c5 --- /dev/null +++ b/gr-sim/starfield/Makefile @@ -0,0 +1,29 @@ +CC = gcc +CFLAGS = -Wall -O2 -I.. -g +LFLAGS = -lm +AR = ar + +SDL_LIBS= `sdl-config --libs` +SDL_INCLUDE= `sdl-config --cflags` +GR_SIM = ../gr-sim.a + +all: starfield starfield_fixed + + + + +starfield: starfield.o $(GR_SIM) + $(CC) $(LFLAGS) $(SDL_LIBS) -o starfield starfield.o $(GR_SIM) + +starfield.o: starfield.c + $(CC) $(CFLAGS) -c starfield.c + +starfield_fixed: starfield_fixed.o $(GR_SIM) + $(CC) $(LFLAGS) $(SDL_LIBS) -o starfield_fixed starfield_fixed.o $(GR_SIM) + +starfield_fixed.o: starfield_fixed.c + $(CC) $(CFLAGS) -c starfield_fixed.c + + +clean: + rm -f *~ *.o starfield starfield_fixed diff --git a/gr-sim/starfield.c b/gr-sim/starfield/starfield.c similarity index 100% rename from gr-sim/starfield.c rename to gr-sim/starfield/starfield.c diff --git a/gr-sim/starfield_fixed.c b/gr-sim/starfield/starfield_fixed.c similarity index 100% rename from gr-sim/starfield_fixed.c rename to gr-sim/starfield/starfield_fixed.c diff --git a/gr-sim/text.c b/gr-sim/text/text.c similarity index 100% rename from gr-sim/text.c rename to gr-sim/text/text.c diff --git a/gr-sim/tfv/Makefile b/gr-sim/tfv/Makefile new file mode 100644 index 00000000..72674d1d --- /dev/null +++ b/gr-sim/tfv/Makefile @@ -0,0 +1,108 @@ +CC = gcc +CFLAGS = -Wall -O2 -g -I.. +LFLAGS = -lm + +SDL_LIBS= `sdl-config --libs` +SDL_INCLUDE= `sdl-config --cflags` +GR_SIM = ../gr-sim.a + +PNG2RLE = ../../gr-utils/png2rle +TFVDIR = ../../tfv + +all: tfv + +### + +$(PNG2RLE): + cd ../.. && cd gr-utils && make + +#### + +tfv_backgrounds.c: $(PNG2RLE) \ + $(TFVDIR)/title.png \ + $(TFVDIR)/map.png \ + $(TFVDIR)/landing.png \ + $(TFVDIR)/harfco.png \ + $(TFVDIR)/belair.png \ + $(TFVDIR)/math_office.png \ + $(TFVDIR)/video_hr.png \ + $(TFVDIR)/collegep.png \ + $(TFVDIR)/umcp.png \ + $(TFVDIR)/dining.png \ + $(TFVDIR)/metro.png \ + $(TFVDIR)/talbot.png + $(PNG2RLE) c $(TFVDIR)/title.png title_rle > tfv_backgrounds.c + $(PNG2RLE) c $(TFVDIR)/map.png map_rle >> tfv_backgrounds.c + $(PNG2RLE) c $(TFVDIR)/landing.png landing_rle >> tfv_backgrounds.c + $(PNG2RLE) c $(TFVDIR)/harfco.png harfco_rle >> tfv_backgrounds.c + $(PNG2RLE) c $(TFVDIR)/belair.png belair_rle >> tfv_backgrounds.c + $(PNG2RLE) c $(TFVDIR)/math_office.png math_office_rle >> tfv_backgrounds.c + $(PNG2RLE) c $(TFVDIR)/video_hr.png video_hr_rle >> tfv_backgrounds.c + $(PNG2RLE) c $(TFVDIR)/collegep.png collegep_rle >> tfv_backgrounds.c + $(PNG2RLE) c $(TFVDIR)/umcp.png umcp_rle >> tfv_backgrounds.c + $(PNG2RLE) c $(TFVDIR)/dining.png dining_rle >> tfv_backgrounds.c + $(PNG2RLE) c $(TFVDIR)/metro.png metro_rle >> tfv_backgrounds.c + $(PNG2RLE) c $(TFVDIR)/talbot.png talbot_rle >> tfv_backgrounds.c + + + + + +#### + +tfv_backgrounds.o: tfv_backgrounds.c tfv_backgrounds.h + $(CC) $(CFLAGS) -c tfv_backgrounds.c + +tfv_battle.o: tfv_battle.c + $(CC) $(CFLAGS) -c tfv_battle.c + +tfv_citymap.o: tfv_citymap.c + $(CC) $(CFLAGS) -c tfv_citymap.c + +tfv_flying.o: tfv_flying.c tfv_flying_fixed.c tfv_flying_float.c tfv_flying_6502.c + $(CC) $(CFLAGS) -c tfv_flying.c + +tfv_info.o: tfv_info.c + $(CC) $(CFLAGS) -c tfv_info.c + +tfv_opener.o: tfv_opener.c ../tfv_utils.h + $(CC) $(CFLAGS) -c tfv_opener.c + +tfv_sprites.o: tfv_sprites.c tfv_sprites.c + $(CC) $(CFLAGS) -c tfv_sprites.c + +tfv_textentry.o: tfv_textentry.c + $(CC) $(CFLAGS) -c tfv_textentry.c + +tfv_title.o: tfv_title.c ../tfv_utils.h tfv_backgrounds.h + $(CC) $(CFLAGS) -c tfv_title.c + +tfv_worldmap.o: tfv_worldmap.c + $(CC) $(CFLAGS) -c tfv_worldmap.c + + +tfv_multiply.o: tfv_multiply.c + $(CC) $(CFLAGS) -c tfv_multiply.c + +tfv_multiply: tfv_multiply.o + $(CC) $(LFLAGS) -o tfv_multiply tfv_multiply.o + + +tfv.o: tfv.c ../gr-sim.h tfv_backgrounds.h tfv_sprites.h + $(CC) $(CFLAGS) -c tfv.c + +tfv: tfv.o tfv_backgrounds.o tfv_battle.o tfv_citymap.o tfv_flying.o \ + tfv_info.o tfv_opener.o tfv_sprites.o tfv_textentry.o \ + tfv_title.o tfv_worldmap.o \ + $(GR_SIM) + $(CC) $(LFLAGS) $(SDL_LIBS) -o tfv tfv.o \ + tfv_backgrounds.o tfv_battle.o tfv_citymap.o tfv_flying.o \ + tfv_info.o tfv_opener.o tfv_sprites.o tfv_textentry.o \ + tfv_title.o tfv_worldmap.o \ + $(GR_SIM) + +clean: + rm -f *~ *.o tfv + + + diff --git a/gr-sim/tfv.c b/gr-sim/tfv/tfv.c similarity index 100% rename from gr-sim/tfv.c rename to gr-sim/tfv/tfv.c diff --git a/gr-sim/tfv_backgrounds.c b/gr-sim/tfv/tfv_backgrounds.c similarity index 100% rename from gr-sim/tfv_backgrounds.c rename to gr-sim/tfv/tfv_backgrounds.c diff --git a/gr-sim/tfv_backgrounds.h b/gr-sim/tfv/tfv_backgrounds.h similarity index 100% rename from gr-sim/tfv_backgrounds.h rename to gr-sim/tfv/tfv_backgrounds.h diff --git a/gr-sim/tfv_battle.c b/gr-sim/tfv/tfv_battle.c similarity index 100% rename from gr-sim/tfv_battle.c rename to gr-sim/tfv/tfv_battle.c diff --git a/gr-sim/tfv_citymap.c b/gr-sim/tfv/tfv_citymap.c similarity index 100% rename from gr-sim/tfv_citymap.c rename to gr-sim/tfv/tfv_citymap.c diff --git a/gr-sim/tfv_flying.c b/gr-sim/tfv/tfv_flying.c similarity index 100% rename from gr-sim/tfv_flying.c rename to gr-sim/tfv/tfv_flying.c diff --git a/gr-sim/tfv_flying_6502.c b/gr-sim/tfv/tfv_flying_6502.c similarity index 100% rename from gr-sim/tfv_flying_6502.c rename to gr-sim/tfv/tfv_flying_6502.c diff --git a/gr-sim/tfv_flying_fixed.c b/gr-sim/tfv/tfv_flying_fixed.c similarity index 100% rename from gr-sim/tfv_flying_fixed.c rename to gr-sim/tfv/tfv_flying_fixed.c diff --git a/gr-sim/tfv_flying_float.c b/gr-sim/tfv/tfv_flying_float.c similarity index 100% rename from gr-sim/tfv_flying_float.c rename to gr-sim/tfv/tfv_flying_float.c diff --git a/gr-sim/tfv_info.c b/gr-sim/tfv/tfv_info.c similarity index 100% rename from gr-sim/tfv_info.c rename to gr-sim/tfv/tfv_info.c diff --git a/gr-sim/tfv_multiply.c b/gr-sim/tfv/tfv_multiply.c similarity index 100% rename from gr-sim/tfv_multiply.c rename to gr-sim/tfv/tfv_multiply.c diff --git a/gr-sim/tfv_opener.c b/gr-sim/tfv/tfv_opener.c similarity index 100% rename from gr-sim/tfv_opener.c rename to gr-sim/tfv/tfv_opener.c diff --git a/gr-sim/tfv_sprites.c b/gr-sim/tfv/tfv_sprites.c similarity index 100% rename from gr-sim/tfv_sprites.c rename to gr-sim/tfv/tfv_sprites.c diff --git a/gr-sim/tfv_sprites.h b/gr-sim/tfv/tfv_sprites.h similarity index 100% rename from gr-sim/tfv_sprites.h rename to gr-sim/tfv/tfv_sprites.h diff --git a/gr-sim/tfv_textentry.c b/gr-sim/tfv/tfv_textentry.c similarity index 100% rename from gr-sim/tfv_textentry.c rename to gr-sim/tfv/tfv_textentry.c diff --git a/gr-sim/tfv_title.c b/gr-sim/tfv/tfv_title.c similarity index 100% rename from gr-sim/tfv_title.c rename to gr-sim/tfv/tfv_title.c diff --git a/gr-sim/tfv_worldmap.c b/gr-sim/tfv/tfv_worldmap.c similarity index 100% rename from gr-sim/tfv_worldmap.c rename to gr-sim/tfv/tfv_worldmap.c