diff --git a/asoft_presenter/kansasfest_2018/TB1.GR b/asoft_presenter/kansasfest_2018/TB1.GR new file mode 100644 index 00000000..be881bc3 Binary files /dev/null and b/asoft_presenter/kansasfest_2018/TB1.GR differ diff --git a/gr-sim/tfv/Makefile b/gr-sim/tfv/Makefile index e910d9e4..f29ab177 100644 --- a/gr-sim/tfv/Makefile +++ b/gr-sim/tfv/Makefile @@ -108,6 +108,9 @@ tfv_map.o: tfv_map.c tfv_opener.o: tfv_opener.c ../tfv_utils.h $(CC) $(CFLAGS) -c tfv_opener.c +tfv_player_select.o: tfv_player_select.c + $(CC) $(CFLAGS) -c tfv_player_select.c + tfv_random.o: tfv_random.c $(CC) $(CFLAGS) -c tfv_random.c @@ -137,14 +140,16 @@ tfv.o: tfv.c ../gr-sim.h tfv_backgrounds.h tfv_sprites.h tfv: tfv.o tfv_backgrounds.o tfv_battle.o tfv_credits.o tfv_dialog.o \ tfv_ending.o tfv_flying.o \ tfv_game_over.o tfv_help.o tfv_info.o tfv_map.o \ - tfv_opener.o tfv_random.o tfv_sprites.o tfv_textentry.o \ + tfv_opener.o tfv_player_select.o \ + tfv_random.o tfv_sprites.o tfv_textentry.o \ tfv_title.o tfv_worldmap.o tfv_mapinfo.h \ $(GR_SIM) $(CC) $(LFLAGS) $(SDL_LIBS) -o tfv tfv.o \ tfv_backgrounds.o tfv_battle.o tfv_credits.o tfv_dialog.o \ tfv_ending.o tfv_flying.o \ tfv_game_over.o tfv_help.o tfv_info.o tfv_map.o \ - tfv_opener.o tfv_random.o tfv_sprites.o tfv_textentry.o \ + tfv_opener.o tfv_player_select.o \ + tfv_random.o tfv_sprites.o tfv_textentry.o \ tfv_title.o tfv_worldmap.o \ $(GR_SIM) diff --git a/gr-sim/tfv/tfv.c b/gr-sim/tfv/tfv.c index ab617189..dad1e2f2 100644 --- a/gr-sim/tfv/tfv.c +++ b/gr-sim/tfv/tfv.c @@ -68,6 +68,9 @@ title_loop: play_game: nameo[0]=0; + /* Get player */ + player_select(); + /* Get Name */ name_screen(); if (nameo[0]==0) { diff --git a/gr-sim/tfv/tfv_definitions.h b/gr-sim/tfv/tfv_definitions.h index 445d0115..248e2c46 100644 --- a/gr-sim/tfv/tfv_definitions.h +++ b/gr-sim/tfv/tfv_definitions.h @@ -37,3 +37,5 @@ int city_map(void); int credits(void); int random_8(void); + +int player_select(void); diff --git a/gr-sim/tfv/tfv_player_select.c b/gr-sim/tfv/tfv_player_select.c new file mode 100644 index 00000000..b2fbfe42 --- /dev/null +++ b/gr-sim/tfv/tfv_player_select.c @@ -0,0 +1,49 @@ +#include + +#include "gr-sim.h" +#include "tfv_utils.h" +#include "tfv_zp.h" +#include "tfv_sprites.h" + +int player_select(void) { + + int which_player=0; + int ch,saved; + + saved=ram[DRAW_PAGE]; + ram[DRAW_PAGE]=8; + clear_top_a(0); + ram[DRAW_PAGE]=saved; + + while(1) { + + gr_copy_to_current(0xc00); + + color_equals(COLOR_AQUA); + vlin(6+(which_player*16),22+(which_player*16),15); + vlin(6+(which_player*16),22+(which_player*16),22); + + grsim_put_sprite(tfv_walk_right,17,8); + + grsim_put_sprite(tfg_walk_right,17,24); + + ram[CH]=13; + ram[CV]=21; + move_and_print("SELECT PLAYER"); + + page_flip(); + + ch=grsim_input(); + if (ch==13) break; + + if ((ch==APPLE_UP) || (ch==APPLE_DOWN) || + (ch==APPLE_RIGHT) || (ch==APPLE_LEFT)) { + which_player=!which_player; + } + + usleep(100000); + + } + + return which_player; +}