diff --git a/gr-sim/Makefile b/gr-sim/Makefile index 8525cc97..95e7d8fa 100644 --- a/gr-sim/Makefile +++ b/gr-sim/Makefile @@ -11,10 +11,10 @@ all: fade fixed_point rainbow sparkle starfield kaleido \ #### -fade: fade.o gr-sim.o tfv_backgrounds.o tfv_utils.o - $(CC) $(LFLAGS) $(SDL_LIBS) -o fade fade.o gr-sim.o tfv_backgrounds.o tfv_utils.o +fade: fade.o gr-sim.o tfv_utils.o + $(CC) $(LFLAGS) $(SDL_LIBS) -o fade fade.o gr-sim.o tfv_utils.o -fade.o: fade.c +fade.o: fade.c demo_title.c $(CC) $(CFLAGS) -c fade.c #### diff --git a/gr-sim/fade.c b/gr-sim/fade.c index ad09a48e..fa6cca2c 100644 --- a/gr-sim/fade.c +++ b/gr-sim/fade.c @@ -6,12 +6,28 @@ #include "gr-sim.h" #include "tfv_utils.h" #include "tfv_zp.h" -#include "tfv_backgrounds.h" + +#include "demo_title.c" +#if 0 +static int fade_map[2][16]={ +// 0 1 2 3 4 5 6 7 8 9 a b c d e f + {0,1,2,2,4,5,2,5, 8,8,5,3,4,8,4,7}, + {0,0,0,5,0,0,5,5, 0,0,0,5,8,5,5,5}, + +}; +#endif + +static int fade_map[2][16]={ +// 0 1 2 3 4 5 6 7 8 9 a b c d e f + {0,0,0,2,0,0,2,5, 5,8,5,3,4,8,4,7}, + {0,0,0,0,0,0,5,0, 0,0,0,0,8,0,0,5}, + +}; int main(int argc, char **argv) { - int result; + int x,temph,templ,ch; grsim_init(); gr(); @@ -20,15 +36,102 @@ int main(int argc, char **argv) { clear_bottom(PAGE1); clear_bottom(PAGE2); - grsim_unrle(title_rle,0xc00); + grsim_unrle(demo_rle,0xc00); gr_copy_to_current(0xc00); page_flip(); gr_copy_to_current(0xc00); page_flip(); - repeat_until_keypressed(); + while(1) { + repeat_until_keypressed(); - return result; + /* Fade step 1 */ + for(x=0xc00;x<0x1000;x++) { + temph=ram[x]&0xf0; + templ=ram[x]&0x0f; + + templ=fade_map[0][templ]; + temph=fade_map[0][temph>>4]; + + ram[x-0x800]=(temph<<4)|templ; + } + grsim_update(); + + ch=repeat_until_keypressed(); + if (ch=='q') break; + + /* Fade step 2 */ + + for(x=0xc00;x<0x1000;x++) { + temph=ram[x]&0xf0; + templ=ram[x]&0x0f; + + templ=fade_map[1][templ]; + temph=fade_map[1][temph>>4]; + + ram[x-0x800]=(temph<<4)|templ; + } + grsim_update(); + + ch=repeat_until_keypressed(); + if (ch=='q') break; + + /* Fade to black */ + + for(x=0x400;x<0x800;x++) { + ram[x]=0x00; + } + grsim_update(); + + ch=repeat_until_keypressed(); + if (ch=='q') break; + + + /* Unfade step 2 */ + for(x=0xc00;x<0x1000;x++) { + temph=ram[x]&0xf0; + templ=ram[x]&0x0f; + + templ=fade_map[1][templ]; + temph=fade_map[1][temph>>4]; + + ram[x-0x800]=(temph<<4)|templ; + } + grsim_update(); + + ch=repeat_until_keypressed(); + if (ch=='q') break; + + /* Unfade step 1 */ + for(x=0xc00;x<0x1000;x++) { + temph=ram[x]&0xf0; + templ=ram[x]&0x0f; + + templ=fade_map[0][templ]; + temph=fade_map[0][temph>>4]; + + ram[x-0x800]=(temph<<4)|templ; + } + grsim_update(); + + ch=repeat_until_keypressed(); + if (ch=='q') break; + + /* Total unfade */ + for(x=0xc00;x<0x1000;x++) { + temph=ram[x]&0xf0; + templ=ram[x]&0x0f; + + ram[x-0x800]=(temph)|templ; + } + grsim_update(); + + ch=repeat_until_keypressed(); + if (ch=='q') break; + + } + + return 0; } diff --git a/tfv/sprites.png b/tfv/sprites.png index 809819e1..66f91284 100644 Binary files a/tfv/sprites.png and b/tfv/sprites.png differ