From c18d2e10e0b980f3a7fc282a6f8384a164f08837 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Wed, 18 Jul 2018 00:11:55 -0400 Subject: [PATCH] tfv: add player select screen --- asoft_presenter/kansasfest_2018/TB1.GR | Bin 0 -> 1024 bytes gr-sim/tfv/Makefile | 9 ++++- gr-sim/tfv/tfv.c | 3 ++ gr-sim/tfv/tfv_definitions.h | 2 + gr-sim/tfv/tfv_player_select.c | 49 +++++++++++++++++++++++++ 5 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 asoft_presenter/kansasfest_2018/TB1.GR create mode 100644 gr-sim/tfv/tfv_player_select.c diff --git a/asoft_presenter/kansasfest_2018/TB1.GR b/asoft_presenter/kansasfest_2018/TB1.GR new file mode 100644 index 0000000000000000000000000000000000000000..be881bc3a5583d497444ade601ac41bb811b665e GIT binary patch literal 1024 zcmbu7L5_nk3`MP~%Wkro?t7J9VfG_c%AK-f%`K`HRcPpp1jEu-;0md~LukSv6{&^< zI|+H;POPT8`#qrYLIYlq^-*~6Ap=UpO6|4# ze7dqx8W4rKWN|*N(bfwd|3$v4(2S#oXZ{cZE9ZOW@qjfmElHe7K4|{3e&WLo83$bS zmFMq3k`2z?tM*biRo4~wb9?Tu_0LVb zroPm_y^eiXe^uKRU@L!VpM^1I + +#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; +}