From d0aee8102278c8c18cbb7f17815d2a107b9c9cdb Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Sat, 8 Jul 2017 17:06:43 -0400 Subject: [PATCH] tfv: update graphics --- gr-sim/Makefile | 2 +- gr-sim/tfv.c | 171 ++++++++++++++++++---- gr-sim/{vince_sprites.h => tfv_sprites.h} | 24 ++- tfv/landing.png | Bin 0 -> 355 bytes tfv/sprites.png | Bin 359 -> 412 bytes 5 files changed, 168 insertions(+), 29 deletions(-) rename gr-sim/{vince_sprites.h => tfv_sprites.h} (67%) create mode 100644 tfv/landing.png diff --git a/gr-sim/Makefile b/gr-sim/Makefile index 63d4a36f..082e5bfc 100644 --- a/gr-sim/Makefile +++ b/gr-sim/Makefile @@ -31,7 +31,7 @@ text.o: text.c tfv: tfv.o gr-sim.o $(CC) $(LFLAGS) $(SDL_LIBS) -o tfv tfv.o gr-sim.o -tfv.o: tfv.c backgrounds.h vince_sprites.h +tfv.o: tfv.c backgrounds.h tfv_sprites.h $(CC) $(CFLAGS) -c tfv.c diff --git a/gr-sim/tfv.c b/gr-sim/tfv.c index 5a591e53..3165e7a5 100644 --- a/gr-sim/tfv.c +++ b/gr-sim/tfv.c @@ -4,7 +4,7 @@ #include "gr-sim.h" -#include "vince_sprites.h" +#include "tfv_sprites.h" #include "backgrounds.h" #define COLOR1 0x00 @@ -80,23 +80,7 @@ static void apple_memset(char *ptr, int value, int length) { } - -int main(int argc, char **argv) { - - int ch; - char tempst[BUFSIZ]; - char nameo[9]; - int i; - int xx,yy; - - int name_x=0; - int cursor_x=0,cursor_y=0; - int direction; - - grsim_init(); - - home(); - gr(); +static int opening(void) { /* VMW splash */ @@ -119,7 +103,11 @@ int main(int argc, char **argv) { repeat_until_keypressed(); - /* Title Screen */ + return 0; +} + +static int title(void) { + grsim_unrle(title_rle,0x800); gr_copy(0x800,0x400); @@ -127,9 +115,22 @@ int main(int argc, char **argv) { repeat_until_keypressed(); + return 0; +} + +static char nameo[9]; + + +static int name_screen(void) { + + unsigned char xx,yy,cursor_x,cursor_y,ch,name_x; + char tempst[BUFSIZ]; + text(); home(); + cursor_x=0; cursor_y=0; name_x=0; + /* Enter your name */ // 1 2 3 // 0123456789012345678901234567890123456789 @@ -285,7 +286,15 @@ int main(int argc, char **argv) { if (ch==27) break; } + return 0; +} +static int flying(void) { + + int i; + unsigned char ch; + int xx,yy; + int direction; /************************************************/ /* Flying */ @@ -333,6 +342,35 @@ int main(int argc, char **argv) { usleep(10000); } + return 0; +} + + +/* + Map + + 0 1 2 3 + +0 BEACH ARTIC AR/\TIC BELAIR + +1 BEACH LANDING GR/\ASS FORREST + +2 BEACH GRASS GR/\ASS FORREST + +3 BEACH BEACH COLLEGE BEACH + +*/ + + + + +static int world_map(void) { + + int ch; + int direction=1; + int xx,yy; + + xx=20; yy=20; /************************************************/ /* Landed */ @@ -351,6 +389,7 @@ int main(int argc, char **argv) { color_equals(0); direction=1; + int odd=0; grsim_unrle(worldmap_rle,0x800); gr_copy(0x800,0x400); @@ -359,18 +398,32 @@ int main(int argc, char **argv) { ch=grsim_input(); if ((ch=='q') || (ch==27)) break; - if ((ch=='i') || (ch==APPLE_UP)) if (yy>10) yy-=2; - if ((ch=='m') || (ch==APPLE_DOWN)) if (yy<39) yy+=2; + if ((ch=='i') || (ch==APPLE_UP)) { + if (yy>8) yy-=2; + odd=!odd; + } + if ((ch=='m') || (ch==APPLE_DOWN)) { + if (yy<27) yy+=2; + odd=!odd; + } if ((ch=='j') || (ch==APPLE_LEFT)) { - if (direction>0) direction=-1; + if (direction>0) { + direction=-1; + odd=0; + } else { + odd=!odd; xx--; if (xx<0) xx=0; } } if ((ch=='k') || (ch==APPLE_RIGHT)) { - if (direction<0) direction=1; + if (direction<0) { + direction=1; + odd=0; + } else { + odd=!odd; xx++; if (xx>35) xx=35; } @@ -378,9 +431,14 @@ int main(int argc, char **argv) { gr_copy(0x800,0x400); - if (direction==-1) grsim_put_sprite(vince_left,xx,yy); - if (direction==1) grsim_put_sprite(vince_right,xx,yy); - + if (direction==-1) { + if (odd) grsim_put_sprite(tfv_walk_left,xx,yy); + else grsim_put_sprite(tfv_stand_left,xx,yy); + } + if (direction==1) { + if (odd) grsim_put_sprite(tfv_walk_right,xx,yy); + else grsim_put_sprite(tfv_stand_right,xx,yy); + } grsim_update(); usleep(10000); @@ -389,3 +447,64 @@ int main(int argc, char **argv) { return 0; } +/* Do Battle */ + +/* Battle. +Forest? Grassland? Artic? Ocean? + + + + + | +---------------------------------------| + | HP LIMIT | -> FIGHT/LIMIT +GRUMPO | DEATER 128/255 128 | ZAP + | | REST + | | RUN AWAY + +Sound effects? + +List hits + +****** ** **** **** ** ** ****** **** ****** ****** ****** +** ** **** ** ** ** ** ** ** ** ** ** ** ** +** ** ** **** **** ****** **** ****** ** ****** ****** +** ** ** ** ** ** ** ** ** ** ** ** ** +****** ****** ****** **** ** **** ****** ** ****** ** + +*/ + +static int do_battle(void) { + + return 0; +} + + +int main(int argc, char **argv) { + + grsim_init(); + + home(); + gr(); + + /* Do Opening */ + opening(); + + /* Title Screen */ + title(); + + /* Get Name */ + name_screen(); + + /* Flying */ + flying(); + + /* World Map */ + world_map(); + + /* Do Battle */ + do_battle(); + + return 0; +} + diff --git a/gr-sim/vince_sprites.h b/gr-sim/tfv_sprites.h similarity index 67% rename from gr-sim/vince_sprites.h rename to gr-sim/tfv_sprites.h index 0b77b2d7..5cd2c4f7 100644 --- a/gr-sim/vince_sprites.h +++ b/gr-sim/tfv_sprites.h @@ -1,4 +1,4 @@ -static unsigned char vince_right[]={ +static unsigned char tfv_stand_right[]={ 0x4,0x6, 0x00,0xDD,0xBD,0x00, 0x00,0xDD,0xDB,0x0B, @@ -8,7 +8,17 @@ static unsigned char vince_right[]={ 0x00,0x82,0x80,0x00, }; -static unsigned char vince_left[]={ +static unsigned char tfv_walk_right[]={ + 0x4,0x6, + 0x00,0xDD,0xBD,0x00, + 0x00,0xDD,0xDB,0x0B, + 0x00,0x22,0x00,0x00, + 0x00,0x22,0x02,0xB0, + 0x22,0x02,0x20,0x00, + 0x82,0x00,0x82,0x00, +}; + +static unsigned char tfv_stand_left[]={ 0x4,0x6, 0x00,0xBD,0xDD,0x00, 0x0B,0xDB,0xDD,0x00, @@ -18,6 +28,16 @@ static unsigned char vince_left[]={ 0x00,0x80,0x82,0x00, }; +static unsigned char tfv_walk_left[]={ + 0x4,0x6, + 0x00,0xBD,0xDD,0x00, + 0x0B,0xDB,0xDD,0x00, + 0x00,0x00,0x22,0x00, + 0xB0,0x02,0x22,0x00, + 0x00,0x20,0x02,0x22, + 0x00,0x82,0x00,0x82, +}; + #if 0 static unsigned char test_sprite[]={ 0x8,0x4, diff --git a/tfv/landing.png b/tfv/landing.png new file mode 100644 index 0000000000000000000000000000000000000000..c72386fc5f1734921a7dde967243b5ac6b864547 GIT binary patch literal 355 zcmeAS@N?(olHy`uVBq!ia0vp^0YI$5!3-qh_VpSADdPa25LY1mSS}&KZ|{GXzYL2L z=FFKRa{ljy!~YYCnEz+l%$+;;|AGr5Uu`bj?JfF$;s5{tK=pI`+ZuorXMsm#F#`j) zFbFd;%$g$s6l5>)^mS!_$j%|cZLQz2)*2{u*we)^#N+te%cuET6nIzz+8AD*`~Uy; zLZv9V%S>i7dCQ%7DvAV694*y&@2zf*dcrH$Znfg_#0D!_?tsO~j9DdX4t$r@{!r`w z_*{kJw=Q8}$Cz&>Z_1 z5+^3R9*$E;lUgEP&GO{L?TkpwJZcJkZ^Za{ti(|Nj600G*G9fB*mh0d!JMQvg8b*k%9#00Cl4 zM??UK1szBL000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2Y=xQ2oov@8HmqI0002u zNkl>6Q&PPn<7-oI_nDQ zM_zl%I;(|5&VMZm^$n)v6KPJ!Oq9N#du<_qGVRQ8hugx@ku5@6xkK-@vdqMdrZ@5h z00000fSzKW+0avVCLH#ZUE$`Dw|dH&a=E9hD(5}r!40;1%2j-3c(4Dm*O_U)^q>}& r+1VltN1pYR4dJ+_pppOpz??5^Ef4R@BKJ`M0000>0WL{IK~#90?c1?!0x=W@V3fHisWU@r%1qz| zn1M+$!%dJ;kg1Ho(kVIH!8Z9m$>lxy{(D#ye!Cq20KmVue4oPo>b;-oq~PLt3Guvy z-uvmMw1d_H+*)t?PQC?k+=qDFhpo@$FTSCiBvKtQpuc1 zC37M_FelQ8IZ%;CMxPTY-N)07IwvyhpiO=Wy!LW=ZN2F_FMq*S0hZRwgPSJEr1zZ2 p%LLeKP9#4o&4~a200023TmeKxBb>ErphW-x002ovPDHLkV1h9;q$L0V