tfv: break up tfv_info

This commit is contained in:
Vince Weaver 2018-06-25 15:39:19 -04:00
parent 5bae012e9a
commit 1073d326d7
6 changed files with 172 additions and 97 deletions

View File

@ -79,15 +79,21 @@ tfv_backgrounds.o: tfv_backgrounds.c tfv_backgrounds.h
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_game_over.o: tfv_game_over.c
$(CC) $(CFLAGS) -c tfv_game_over.c
tfv_help.o: tfv_help.c
$(CC) $(CFLAGS) -c tfv_help.c
tfv_info.o: tfv_info.c
$(CC) $(CFLAGS) -c tfv_info.c
tfv_map.o: tfv_map.c
$(CC) $(CFLAGS) -c tfv_map.c
tfv_opener.o: tfv_opener.c ../tfv_utils.h
$(CC) $(CFLAGS) -c tfv_opener.c
@ -115,12 +121,14 @@ 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_flying.o \
tfv_info.o tfv_opener.o tfv_sprites.o tfv_textentry.o \
tfv_game_over.o tfv_help.o tfv_info.o tfv_map.o \
tfv_opener.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_flying.o \
tfv_info.o tfv_opener.o tfv_sprites.o tfv_textentry.o \
tfv_game_over.o tfv_help.o tfv_info.o tfv_map.o \
tfv_opener.o tfv_sprites.o tfv_textentry.o \
tfv_title.o tfv_worldmap.o \
$(GR_SIM)

View File

@ -0,0 +1,30 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "gr-sim.h"
#include "tfv_utils.h"
#include "tfv_zp.h"
#include "tfv_defines.h"
#include "tfv_backgrounds.h"
void game_over(void) {
text();
home();
/* Make a box around it? */
vtab(12);
htab(15);
move_cursor();
print("GAME OVER");
/* play the GROAN sound? */
page_flip();
repeat_until_keypressed();
}

61
gr-sim/tfv/tfv_help.c Normal file
View File

@ -0,0 +1,61 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "gr-sim.h"
#include "tfv_utils.h"
#include "tfv_zp.h"
#include "tfv_defines.h"
#include "tfv_backgrounds.h"
void print_help(void) {
clear_top_a(0xa0);
soft_switch(TXTSET);
// htab(1);
// vtab(1);
// move_cursor();
/*
***************************************
* HELP *
* *
* ARROWS - MOVE *
* W/A/S/D - MOVE *
* Z/X - SPEED UP / SLOW DOWN *
* SPACE - STOP *
* RETURN - LAND / ENTER / ACTION *
* I - INVENTORY *
* M - MAP *
* ESC - QUIT *
* *
***************************************
*/
ram[CV]=1;
ram[CH]=18;
move_and_print("HELP");
ram[CV]=3;
ram[CH]=4; move_and_print("ARROWS - MOVE");
ram[CV]++; move_and_print("W/A/S/D - MOVE");
ram[CV]++; move_and_print("Z/X - SPEED UP / SLOW DOWN");
ram[CV]++; move_and_print("SPACE - STOP");
ram[CV]++; move_and_print("RETURN - LAND / ENTER / ACTION");
ram[CV]++; move_and_print("I - INVENTORY");
ram[CV]++; move_and_print("M - MAP");
ram[CV]++; move_and_print("ESC - QUIT");
page_flip();
repeat_until_keypressed();
soft_switch(TXTCLR);
}

View File

@ -10,98 +10,6 @@
#include "tfv_backgrounds.h"
void game_over(void) {
text();
home();
/* Make a box around it? */
vtab(12);
htab(15);
move_cursor();
print("GAME OVER");
/* play the GROAN sound? */
page_flip();
repeat_until_keypressed();
}
void print_help(void) {
clear_top_a(0xa0);
soft_switch(TXTSET);
// htab(1);
// vtab(1);
// move_cursor();
/*
***************************************
* HELP *
* *
* ARROWS - MOVE *
* W/A/S/D - MOVE *
* Z/X - SPEED UP / SLOW DOWN *
* SPACE - STOP *
* RETURN - LAND / ENTER / ACTION *
* I - INVENTORY *
* M - MAP *
* ESC - QUIT *
* *
***************************************
*/
ram[CV]=1;
ram[CH]=18;
move_and_print("HELP");
ram[CV]=3;
ram[CH]=4; move_and_print("ARROWS - MOVE");
ram[CV]++; move_and_print("W/A/S/D - MOVE");
ram[CV]++; move_and_print("Z/X - SPEED UP / SLOW DOWN");
ram[CV]++; move_and_print("SPACE - STOP");
ram[CV]++; move_and_print("RETURN - LAND / ENTER / ACTION");
ram[CV]++; move_and_print("I - INVENTORY");
ram[CV]++; move_and_print("M - MAP");
ram[CV]++; move_and_print("ESC - QUIT");
page_flip();
repeat_until_keypressed();
soft_switch(TXTCLR);
}
void show_map(void) {
gr();
grsim_unrle(map_rle,((int)ram[DRAW_PAGE]+0x4)<<8);
//gr_copy(0x800,0x400);
color_equals(COLOR_RED);
printf("plot(%d,%d)\n",
8+((map_location&0x3)*6)+(tfv_x/6),
8+(((map_location&0xc)>>2)*6)+(tfv_y/6));
basic_plot(8+((map_location&0x3)*6)+(tfv_x/6),8+(((map_location&0xc)>>2)*6)+(tfv_y/6));
// basic_plot(8+((map_location&0x3)*6)+(tfv_x/6),8+(((map_location&0xc)>>2)*6)+(tfv_y/6));
ram[CH]=20;
ram[CV]=20; move_and_print(map_info[map_location].name);
page_flip();
repeat_until_keypressed();
}
/*
1 2 3 4

26
gr-sim/tfv/tfv_items.h Normal file
View File

@ -0,0 +1,26 @@
#define ITEM1_CUPCAKE 0x01 // cafeteria lady
#define ITEM1_CARROT 0x02 // capabara
#define ITEM1_SMARTPASS 0x03 // metro worker
#define ITEM1_ELF_RUNES 0x04 // mree
#define ITEM1_LIZBETH_STAR 0x05 // Lizbeth
#define ITEM1_KARTE_SPIEL 0x06 // Frau
#define ITEM1_GLAMDRING 0x07 // Gus
#define ITEM1_VEGEMITE 0x08 // Nicole
// PARTS
#define ITEM_BLUE_LED 0x01 // bird
#define ITEM_RED_LED 0x02 //
#define ITEM_1K_RESISTOR 0x03 // brown black red, Elaine
#define ITEM_5K_RESISTOR 0x04 // yellow purple red, Tater
#define ITEM_9V_BATTERY 0x05 // Cindy
#define ITEM_AA_BATTERY 0x06 // Oscar
#define ITEM_LINUX_CD 0x07 // john
#define ITEM_ARMY_KNIFE 0x08 // Steve
// Other possibilities
#define ITEM_CHEX_MIX 0x01 // oscar
#define ITEM_CLASS_RING 0x02 //
extern char items[2][8][13];

42
gr-sim/tfv/tfv_map.c Normal file
View File

@ -0,0 +1,42 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "gr-sim.h"
#include "tfv_utils.h"
#include "tfv_zp.h"
#include "tfv_defines.h"
#include "tfv_backgrounds.h"
void show_map(void) {
gr();
grsim_unrle(map_rle,((int)ram[DRAW_PAGE]+0x4)<<8);
//gr_copy(0x800,0x400);
color_equals(COLOR_RED);
printf("plot(%d,%d)\n",
8+((map_location&0x3)*6)+(tfv_x/6),
8+(((map_location&0xc)>>2)*6)+(tfv_y/6));
basic_plot(8+((map_location&0x3)*6)+(tfv_x/6),8+(((map_location&0xc)>>2)*6)+(tfv_y/6));
// basic_plot(8+((map_location&0x3)*6)+(tfv_x/6),8+(((map_location&0xc)>>2)*6)+(tfv_y/6));
ram[CH]=20;
ram[CV]=20; move_and_print(map_info[map_location].name);
page_flip();
repeat_until_keypressed();
}