mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-12-25 20:30:31 +00:00
tfv: more file split up
This commit is contained in:
parent
10672133ad
commit
207e081b84
@ -31,9 +31,21 @@ text.o: text.c
|
||||
tfv_backgrounds.o: tfv_backgrounds.c tfv_backgrounds.h
|
||||
$(CC) $(CFLAGS) -c tfv_backgrounds.c
|
||||
|
||||
tfv_battle.o: tfv_battle.c
|
||||
$(CC) $(CFLAGS) -c tfv_battle.c
|
||||
|
||||
tfv_flying.o: tfv_flying.c
|
||||
$(CC) $(CFLAGS) -c tfv_flying.c
|
||||
|
||||
tfv_info.o: tfv_info.c
|
||||
$(CC) $(CFLAGS) -c tfv_info.c
|
||||
|
||||
tfv_opener.o: tfv_opener.c tfv_utils.h
|
||||
$(CC) $(CFLAGS) -c tfv_opener.c
|
||||
|
||||
tfv_sprites.o: tfv_sprites.c tfv_sprites.c
|
||||
$(CC) $(CFLAGS) -c tfv_sprites.c
|
||||
|
||||
tfv_title.o: tfv_title.c tfv_utils.h tfv_backgrounds.h
|
||||
$(CC) $(CFLAGS) -c tfv_title.c
|
||||
|
||||
@ -43,8 +55,8 @@ tfv_utils.o: tfv_utils.c tfv_utils.h
|
||||
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_opener.o tfv_title.o tfv_utils.o gr-sim.o
|
||||
$(CC) $(LFLAGS) $(SDL_LIBS) -o tfv tfv.o tfv_backgrounds.o tfv_opener.o tfv_title.o tfv_utils.o gr-sim.o
|
||||
tfv: tfv.o tfv_backgrounds.o tfv_battle.o tfv_flying.o tfv_info.o tfv_opener.o tfv_sprites.o tfv_title.o tfv_utils.o gr-sim.o
|
||||
$(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_title.o tfv_utils.o gr-sim.o
|
||||
|
||||
###
|
||||
|
||||
|
371
gr-sim/tfv.c
371
gr-sim/tfv.c
@ -24,7 +24,7 @@ unsigned char map_x=5;
|
||||
char tfv_x=15,tfv_y=19;
|
||||
unsigned char ground_color;
|
||||
|
||||
static char nameo[9];
|
||||
char nameo[9];
|
||||
|
||||
|
||||
static int name_screen(void) {
|
||||
@ -195,375 +195,6 @@ static int name_screen(void) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int flying(void) {
|
||||
|
||||
int i;
|
||||
unsigned char ch;
|
||||
int xx,yy;
|
||||
int direction;
|
||||
|
||||
/************************************************/
|
||||
/* Flying */
|
||||
/************************************************/
|
||||
|
||||
gr();
|
||||
xx=17; yy=30;
|
||||
color_equals(COLOR_BLACK);
|
||||
|
||||
direction=0;
|
||||
|
||||
color_equals(COLOR_MEDIUMBLUE);
|
||||
|
||||
for(i=0;i<20;i++) {
|
||||
hlin(1, 0, 40, i);
|
||||
}
|
||||
|
||||
color_equals(COLOR_DARKBLUE);
|
||||
for(i=20;i<48;i++) {
|
||||
hlin(1, 0, 40, i);
|
||||
}
|
||||
|
||||
while(1) {
|
||||
ch=grsim_input();
|
||||
|
||||
if ((ch=='q') || (ch==27)) break;
|
||||
if ((ch=='i') || (ch==APPLE_UP)) if (yy>20) yy-=2;
|
||||
if ((ch=='m') || (ch==APPLE_DOWN)) if (yy<39) yy+=2;
|
||||
if ((ch=='j') || (ch==APPLE_LEFT)) {
|
||||
direction--;
|
||||
if (direction<-1) direction=-1;
|
||||
}
|
||||
if ((ch=='k') || (ch==APPLE_RIGHT)) {
|
||||
direction++;
|
||||
if (direction>1) direction=1;
|
||||
}
|
||||
|
||||
gr_copy(0x800,0x400);
|
||||
|
||||
if (direction==0) grsim_put_sprite(0,ship_forward,xx,yy);
|
||||
if (direction==-1) grsim_put_sprite(0,ship_left,xx,yy);
|
||||
if (direction==1) grsim_put_sprite(0,ship_right,xx,yy);
|
||||
|
||||
grsim_update();
|
||||
|
||||
usleep(10000);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void game_over(void) {
|
||||
|
||||
text();
|
||||
home();
|
||||
|
||||
/* Make a box around it? */
|
||||
|
||||
basic_htab(15);
|
||||
basic_vtab(12);
|
||||
basic_print("GAME OVER");
|
||||
|
||||
/* play the GROAN sound? */
|
||||
|
||||
grsim_update();
|
||||
|
||||
repeat_until_keypressed();
|
||||
}
|
||||
|
||||
static void print_help(void) {
|
||||
text();
|
||||
home();
|
||||
|
||||
basic_htab(1);
|
||||
basic_vtab(1);
|
||||
|
||||
basic_print("ARROW KEYS AND WASD MOVE\n");
|
||||
basic_print("SPACE BAR ACTION\n");
|
||||
basic_print("I INVENTORY\n");
|
||||
basic_print("M MAP\n");
|
||||
basic_print("Q QUITS\n");
|
||||
grsim_update();
|
||||
|
||||
repeat_until_keypressed();
|
||||
|
||||
gr();
|
||||
}
|
||||
|
||||
static void show_map(void) {
|
||||
gr();
|
||||
home();
|
||||
|
||||
grsim_unrle(worldmap_rle,0x800);
|
||||
gr_copy(0x800,0x400);
|
||||
|
||||
color_equals(COLOR_RED);
|
||||
basic_plot(8+((map_x&0x3)*6)+(tfv_x/6),8+(((map_x&0xc)>>2)*6)+(tfv_y/6));
|
||||
|
||||
grsim_update();
|
||||
repeat_until_keypressed();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
1 2 3 4
|
||||
01234567890123456789012345678901234567890
|
||||
**************************************** 1
|
||||
* DEATER * LEVEL 1 * 2
|
||||
**************************************** 3
|
||||
* INVENTORY * STATS * 4
|
||||
**************************************** 5
|
||||
* * HP: 50/100 * 6
|
||||
* * MP: 0/0 * 7
|
||||
* * * 8
|
||||
* * EXPERIENCE: 0 * 9
|
||||
* * NEXT LEVEL: 16 * 10
|
||||
* * * 11
|
||||
* * MONEY: $1 * 12 0-256
|
||||
* * TIME: 00:00 * 13
|
||||
* * * 14
|
||||
* * * 15
|
||||
* * * 16
|
||||
* * * 17
|
||||
* * * 18
|
||||
* * * 19
|
||||
* * * 20
|
||||
* * * 21
|
||||
* * * 22
|
||||
* * * 23
|
||||
**************************************** 24
|
||||
|
||||
EXPERIENCE = 0...255
|
||||
LEVEL = EXPERIENCE / = 0...63
|
||||
NEXT LEVEL =
|
||||
MONEY = 0...255
|
||||
MAX_HP = 32+EXPERIENCE (maxing at 255)
|
||||
*/
|
||||
|
||||
|
||||
static char item_names1[8][15]={
|
||||
"CUPCAKE", // cafeteria lady
|
||||
"CARROT", // capabara
|
||||
"SMARTPASS", // metro worker
|
||||
"ELF RUNES", // mree
|
||||
"LIZBETH STAR", // Lizbeth
|
||||
"KARTE SPIEL", // Frau
|
||||
"GLAMDRING", // Gus
|
||||
"VEGEMITE", // Nicole
|
||||
};
|
||||
|
||||
static char item_names2[8][15]={
|
||||
"BLUE LED", // bird
|
||||
"RED LED", //
|
||||
"1K RESISTOR", // brown black red, Elaine
|
||||
"4.7K RESISTOR", // yellow purple red, Tater
|
||||
"9V BATTERY", // Cindy
|
||||
"1.5V BATTERY", // Oscar
|
||||
"LINUX CD", // john
|
||||
"ARMY KNIFE", // Steve
|
||||
};
|
||||
|
||||
static void print_info(void) {
|
||||
int i;
|
||||
|
||||
text();
|
||||
home();
|
||||
|
||||
/* Inverse Space */
|
||||
/* 0x30=COLOR */
|
||||
ram[0x30]=0x20;
|
||||
|
||||
/* Draw boxes */
|
||||
hlin_double(0,0,40,0);
|
||||
hlin_double(0,0,40,4);
|
||||
hlin_double(0,0,40,8);
|
||||
hlin_double(0,0,40,46);
|
||||
|
||||
basic_vlin(0,48,0);
|
||||
basic_vlin(0,48,20);
|
||||
basic_vlin(0,48,39);
|
||||
|
||||
basic_htab(3);
|
||||
basic_vtab(2);
|
||||
basic_print(nameo);
|
||||
|
||||
basic_htab(23);
|
||||
basic_print("LEVEL ");
|
||||
print_u8(level);
|
||||
|
||||
basic_htab(3);
|
||||
basic_vtab(4);
|
||||
basic_print("INVENTORY");
|
||||
basic_htab(23);
|
||||
basic_print("STATS");
|
||||
|
||||
|
||||
for(i=0;i<8;i++) {
|
||||
basic_htab(4);
|
||||
basic_vtab(6+i);
|
||||
if (items1&(1<<i)) basic_print(item_names1[i]);
|
||||
|
||||
basic_htab(4);
|
||||
basic_vtab(14+i);
|
||||
if (items2&(1<<i)) basic_print(item_names2[i]);
|
||||
}
|
||||
|
||||
basic_htab(23);
|
||||
basic_vtab(6);
|
||||
basic_print("HP: ");
|
||||
print_u8(hp);
|
||||
basic_print("/");
|
||||
print_u8(max_hp);
|
||||
|
||||
basic_htab(23);
|
||||
basic_vtab(7);
|
||||
basic_print("MP: 0/0");
|
||||
|
||||
basic_htab(23);
|
||||
basic_vtab(9);
|
||||
basic_print("EXPERIENCE: ");
|
||||
print_u8(experience);
|
||||
|
||||
basic_htab(23);
|
||||
basic_vtab(10);
|
||||
basic_print("NEXT LEVEL: ");
|
||||
|
||||
basic_htab(23);
|
||||
basic_vtab(12);
|
||||
basic_print("MONEY: $");
|
||||
print_u8(money);
|
||||
|
||||
basic_htab(23);
|
||||
basic_vtab(13);
|
||||
basic_print("TIME: ");
|
||||
if (time_hours<10) basic_print("0");
|
||||
print_u8(time_hours);
|
||||
basic_print(":");
|
||||
if (time_minutes<10) basic_print("0");
|
||||
print_u8(time_minutes);
|
||||
|
||||
grsim_update();
|
||||
|
||||
repeat_until_keypressed();
|
||||
home();
|
||||
gr();
|
||||
}
|
||||
|
||||
/* Do Battle */
|
||||
|
||||
/* Battle.
|
||||
Forest? Grassland? Artic? Ocean?
|
||||
|
||||
|
||||
|
||||
1 2 3
|
||||
0123456789012345678901234567890123456789|
|
||||
----------------------------------------|
|
||||
| HP LIMIT | -> FIGHT/LIMIT 21
|
||||
KILLER CRAB | DEATER 128/255 128 | ZAP 22
|
||||
| | REST 23
|
||||
| | RUN AWAY 24
|
||||
|
||||
Sound effects?
|
||||
|
||||
List hits
|
||||
|
||||
****** ** **** **** ** ** ****** **** ****** ****** ******
|
||||
** ** **** ** ** ** ** ** ** ** ** ** ** **
|
||||
** ** ** **** **** ****** **** ****** ** ****** ******
|
||||
** ** ** ** ** ** ** ** ** ** ** ** **
|
||||
****** ****** ****** **** ** **** ****** ** ****** **
|
||||
|
||||
*/
|
||||
|
||||
/* Enemies: */
|
||||
/* Killer Crab, Tree, Big Fish, Procrastinon */
|
||||
|
||||
/* Background depend on map location? */
|
||||
/* Room for guinea pig in party? */
|
||||
|
||||
/* Attacks -> HIT, ZAP, HEAL, RUNAWAY */
|
||||
|
||||
|
||||
static int do_battle(void) {
|
||||
|
||||
int i,ch;
|
||||
|
||||
int enemy_x=2;
|
||||
//int enemy_hp=20;
|
||||
|
||||
int tfv_x=34;
|
||||
|
||||
home();
|
||||
gr();
|
||||
|
||||
basic_htab(1);
|
||||
basic_vtab(22);
|
||||
basic_normal();
|
||||
basic_print("KILLER CRAB");
|
||||
|
||||
basic_htab(27);
|
||||
basic_vtab(21);
|
||||
basic_print("HP");
|
||||
|
||||
basic_htab(34);
|
||||
basic_vtab(21);
|
||||
basic_print("LIMIT");
|
||||
|
||||
basic_htab(15);
|
||||
basic_vtab(22);
|
||||
basic_print("DEATER");
|
||||
|
||||
basic_htab(24);
|
||||
basic_vtab(22);
|
||||
print_byte(hp);
|
||||
basic_print("/");
|
||||
print_byte(max_hp);
|
||||
|
||||
basic_htab(34);
|
||||
basic_vtab(22);
|
||||
basic_inverse();
|
||||
for(i=0;i<limit;i++) {
|
||||
basic_print(" ");
|
||||
}
|
||||
basic_normal();
|
||||
for(i=limit;i<5;i++) {
|
||||
basic_print(" ");
|
||||
}
|
||||
|
||||
basic_inverse();
|
||||
for(i=21;i<25;i++) {
|
||||
basic_vtab(i);
|
||||
basic_htab(13);
|
||||
basic_print(" ");
|
||||
}
|
||||
basic_normal();
|
||||
|
||||
|
||||
while(1) {
|
||||
color_equals(COLOR_MEDIUMBLUE);
|
||||
for(i=0;i<10;i++) {
|
||||
basic_hlin(0,39,i);
|
||||
}
|
||||
color_equals(COLOR_LIGHTGREEN);
|
||||
for(i=10;i<40;i++) {
|
||||
basic_hlin(0,39,i);
|
||||
}
|
||||
|
||||
grsim_put_sprite(0,tfv_stand_left,tfv_x,20);
|
||||
grsim_put_sprite(0,tfv_led_sword,tfv_x-5,20);
|
||||
|
||||
grsim_put_sprite(0,killer_crab,enemy_x,20);
|
||||
|
||||
grsim_update();
|
||||
|
||||
ch=grsim_input();
|
||||
if (ch=='q') break;
|
||||
|
||||
usleep(100000);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* In Town */
|
||||
|
||||
|
131
gr-sim/tfv_battle.c
Normal file
131
gr-sim/tfv_battle.c
Normal file
@ -0,0 +1,131 @@
|
||||
#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_sprites.h"
|
||||
#include "tfv_backgrounds.h"
|
||||
|
||||
|
||||
/* Do Battle */
|
||||
|
||||
/* Battle.
|
||||
Forest? Grassland? Artic? Ocean?
|
||||
|
||||
|
||||
|
||||
1 2 3
|
||||
0123456789012345678901234567890123456789|
|
||||
----------------------------------------|
|
||||
| HP LIMIT | -> FIGHT/LIMIT 21
|
||||
KILLER CRAB | DEATER 128/255 128 | ZAP 22
|
||||
| | REST 23
|
||||
| | RUN AWAY 24
|
||||
|
||||
Sound effects?
|
||||
|
||||
List hits
|
||||
|
||||
****** ** **** **** ** ** ****** **** ****** ****** ******
|
||||
** ** **** ** ** ** ** ** ** ** ** ** ** **
|
||||
** ** ** **** **** ****** **** ****** ** ****** ******
|
||||
** ** ** ** ** ** ** ** ** ** ** ** **
|
||||
****** ****** ****** **** ** **** ****** ** ****** **
|
||||
|
||||
*/
|
||||
|
||||
/* Enemies: */
|
||||
/* Killer Crab, Tree, Big Fish, Procrastinon */
|
||||
|
||||
/* Background depend on map location? */
|
||||
/* Room for guinea pig in party? */
|
||||
|
||||
/* Attacks -> HIT, ZAP, HEAL, RUNAWAY */
|
||||
|
||||
|
||||
int do_battle(void) {
|
||||
|
||||
int i,ch;
|
||||
|
||||
int enemy_x=2;
|
||||
//int enemy_hp=20;
|
||||
|
||||
int tfv_x=34;
|
||||
|
||||
home();
|
||||
gr();
|
||||
|
||||
basic_htab(1);
|
||||
basic_vtab(22);
|
||||
basic_normal();
|
||||
basic_print("KILLER CRAB");
|
||||
|
||||
basic_htab(27);
|
||||
basic_vtab(21);
|
||||
basic_print("HP");
|
||||
|
||||
basic_htab(34);
|
||||
basic_vtab(21);
|
||||
basic_print("LIMIT");
|
||||
|
||||
basic_htab(15);
|
||||
basic_vtab(22);
|
||||
basic_print("DEATER");
|
||||
|
||||
basic_htab(24);
|
||||
basic_vtab(22);
|
||||
print_byte(hp);
|
||||
basic_print("/");
|
||||
print_byte(max_hp);
|
||||
|
||||
basic_htab(34);
|
||||
basic_vtab(22);
|
||||
basic_inverse();
|
||||
for(i=0;i<limit;i++) {
|
||||
basic_print(" ");
|
||||
}
|
||||
basic_normal();
|
||||
for(i=limit;i<5;i++) {
|
||||
basic_print(" ");
|
||||
}
|
||||
|
||||
basic_inverse();
|
||||
for(i=21;i<25;i++) {
|
||||
basic_vtab(i);
|
||||
basic_htab(13);
|
||||
basic_print(" ");
|
||||
}
|
||||
basic_normal();
|
||||
|
||||
|
||||
while(1) {
|
||||
color_equals(COLOR_MEDIUMBLUE);
|
||||
for(i=0;i<10;i++) {
|
||||
basic_hlin(0,39,i);
|
||||
}
|
||||
color_equals(COLOR_LIGHTGREEN);
|
||||
for(i=10;i<40;i++) {
|
||||
basic_hlin(0,39,i);
|
||||
}
|
||||
|
||||
grsim_put_sprite(0,tfv_stand_left,tfv_x,20);
|
||||
grsim_put_sprite(0,tfv_led_sword,tfv_x-5,20);
|
||||
|
||||
grsim_put_sprite(0,killer_crab,enemy_x,20);
|
||||
|
||||
grsim_update();
|
||||
|
||||
ch=grsim_input();
|
||||
if (ch=='q') break;
|
||||
|
||||
usleep(100000);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
67
gr-sim/tfv_flying.c
Normal file
67
gr-sim/tfv_flying.c
Normal file
@ -0,0 +1,67 @@
|
||||
#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_sprites.h"
|
||||
|
||||
int flying(void) {
|
||||
|
||||
int i;
|
||||
unsigned char ch;
|
||||
int xx,yy;
|
||||
int direction;
|
||||
|
||||
/************************************************/
|
||||
/* Flying */
|
||||
/************************************************/
|
||||
|
||||
gr();
|
||||
xx=17; yy=30;
|
||||
color_equals(COLOR_BLACK);
|
||||
|
||||
direction=0;
|
||||
|
||||
color_equals(COLOR_MEDIUMBLUE);
|
||||
|
||||
for(i=0;i<20;i++) {
|
||||
hlin(1, 0, 40, i);
|
||||
}
|
||||
|
||||
color_equals(COLOR_DARKBLUE);
|
||||
for(i=20;i<48;i++) {
|
||||
hlin(1, 0, 40, i);
|
||||
}
|
||||
|
||||
while(1) {
|
||||
ch=grsim_input();
|
||||
|
||||
if ((ch=='q') || (ch==27)) break;
|
||||
if ((ch=='i') || (ch==APPLE_UP)) if (yy>20) yy-=2;
|
||||
if ((ch=='m') || (ch==APPLE_DOWN)) if (yy<39) yy+=2;
|
||||
if ((ch=='j') || (ch==APPLE_LEFT)) {
|
||||
direction--;
|
||||
if (direction<-1) direction=-1;
|
||||
}
|
||||
if ((ch=='k') || (ch==APPLE_RIGHT)) {
|
||||
direction++;
|
||||
if (direction>1) direction=1;
|
||||
}
|
||||
|
||||
gr_copy(0x800,0x400);
|
||||
|
||||
if (direction==0) grsim_put_sprite(0,ship_forward,xx,yy);
|
||||
if (direction==-1) grsim_put_sprite(0,ship_left,xx,yy);
|
||||
if (direction==1) grsim_put_sprite(0,ship_right,xx,yy);
|
||||
|
||||
grsim_update();
|
||||
|
||||
usleep(10000);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
208
gr-sim/tfv_info.c
Normal file
208
gr-sim/tfv_info.c
Normal file
@ -0,0 +1,208 @@
|
||||
#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_backgrounds.h"
|
||||
|
||||
void game_over(void) {
|
||||
|
||||
text();
|
||||
home();
|
||||
|
||||
/* Make a box around it? */
|
||||
|
||||
basic_htab(15);
|
||||
basic_vtab(12);
|
||||
basic_print("GAME OVER");
|
||||
|
||||
/* play the GROAN sound? */
|
||||
|
||||
grsim_update();
|
||||
|
||||
repeat_until_keypressed();
|
||||
}
|
||||
|
||||
void print_help(void) {
|
||||
text();
|
||||
home();
|
||||
|
||||
basic_htab(1);
|
||||
basic_vtab(1);
|
||||
|
||||
basic_print("ARROW KEYS AND WASD MOVE\n");
|
||||
basic_print("SPACE BAR ACTION\n");
|
||||
basic_print("I INVENTORY\n");
|
||||
basic_print("M MAP\n");
|
||||
basic_print("Q QUITS\n");
|
||||
grsim_update();
|
||||
|
||||
repeat_until_keypressed();
|
||||
|
||||
gr();
|
||||
}
|
||||
|
||||
void show_map(void) {
|
||||
|
||||
gr();
|
||||
home();
|
||||
|
||||
grsim_unrle(worldmap_rle,0x800);
|
||||
gr_copy(0x800,0x400);
|
||||
|
||||
color_equals(COLOR_RED);
|
||||
basic_plot(8+((map_x&0x3)*6)+(tfv_x/6),8+(((map_x&0xc)>>2)*6)+(tfv_y/6));
|
||||
|
||||
grsim_update();
|
||||
repeat_until_keypressed();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
1 2 3 4
|
||||
01234567890123456789012345678901234567890
|
||||
**************************************** 1
|
||||
* DEATER * LEVEL 1 * 2
|
||||
**************************************** 3
|
||||
* INVENTORY * STATS * 4
|
||||
**************************************** 5
|
||||
* * HP: 50/100 * 6
|
||||
* * MP: 0/0 * 7
|
||||
* * * 8
|
||||
* * EXPERIENCE: 0 * 9
|
||||
* * NEXT LEVEL: 16 * 10
|
||||
* * * 11
|
||||
* * MONEY: $1 * 12 0-256
|
||||
* * TIME: 00:00 * 13
|
||||
* * * 14
|
||||
* * * 15
|
||||
* * * 16
|
||||
* * * 17
|
||||
* * * 18
|
||||
* * * 19
|
||||
* * * 20
|
||||
* * * 21
|
||||
* * * 22
|
||||
* * * 23
|
||||
**************************************** 24
|
||||
|
||||
EXPERIENCE = 0...255
|
||||
LEVEL = EXPERIENCE / = 0...63
|
||||
NEXT LEVEL =
|
||||
MONEY = 0...255
|
||||
MAX_HP = 32+EXPERIENCE (maxing at 255)
|
||||
*/
|
||||
|
||||
|
||||
static char item_names1[8][15]={
|
||||
"CUPCAKE", // cafeteria lady
|
||||
"CARROT", // capabara
|
||||
"SMARTPASS", // metro worker
|
||||
"ELF RUNES", // mree
|
||||
"LIZBETH STAR", // Lizbeth
|
||||
"KARTE SPIEL", // Frau
|
||||
"GLAMDRING", // Gus
|
||||
"VEGEMITE", // Nicole
|
||||
};
|
||||
|
||||
static char item_names2[8][15]={
|
||||
"BLUE LED", // bird
|
||||
"RED LED", //
|
||||
"1K RESISTOR", // brown black red, Elaine
|
||||
"4.7K RESISTOR", // yellow purple red, Tater
|
||||
"9V BATTERY", // Cindy
|
||||
"1.5V BATTERY", // Oscar
|
||||
"LINUX CD", // john
|
||||
"ARMY KNIFE", // Steve
|
||||
};
|
||||
|
||||
void print_info(void) {
|
||||
int i;
|
||||
|
||||
text();
|
||||
home();
|
||||
|
||||
/* Inverse Space */
|
||||
/* 0x30=COLOR */
|
||||
ram[0x30]=0x20;
|
||||
|
||||
/* Draw boxes */
|
||||
hlin_double(0,0,40,0);
|
||||
hlin_double(0,0,40,4);
|
||||
hlin_double(0,0,40,8);
|
||||
hlin_double(0,0,40,46);
|
||||
|
||||
basic_vlin(0,48,0);
|
||||
basic_vlin(0,48,20);
|
||||
basic_vlin(0,48,39);
|
||||
|
||||
basic_htab(3);
|
||||
basic_vtab(2);
|
||||
basic_print(nameo);
|
||||
|
||||
basic_htab(23);
|
||||
basic_print("LEVEL ");
|
||||
print_u8(level);
|
||||
|
||||
basic_htab(3);
|
||||
basic_vtab(4);
|
||||
basic_print("INVENTORY");
|
||||
basic_htab(23);
|
||||
basic_print("STATS");
|
||||
|
||||
|
||||
for(i=0;i<8;i++) {
|
||||
basic_htab(4);
|
||||
basic_vtab(6+i);
|
||||
if (items1&(1<<i)) basic_print(item_names1[i]);
|
||||
|
||||
basic_htab(4);
|
||||
basic_vtab(14+i);
|
||||
if (items2&(1<<i)) basic_print(item_names2[i]);
|
||||
}
|
||||
|
||||
basic_htab(23);
|
||||
basic_vtab(6);
|
||||
basic_print("HP: ");
|
||||
print_u8(hp);
|
||||
basic_print("/");
|
||||
print_u8(max_hp);
|
||||
|
||||
basic_htab(23);
|
||||
basic_vtab(7);
|
||||
basic_print("MP: 0/0");
|
||||
|
||||
basic_htab(23);
|
||||
basic_vtab(9);
|
||||
basic_print("EXPERIENCE: ");
|
||||
print_u8(experience);
|
||||
|
||||
basic_htab(23);
|
||||
basic_vtab(10);
|
||||
basic_print("NEXT LEVEL: ");
|
||||
|
||||
basic_htab(23);
|
||||
basic_vtab(12);
|
||||
basic_print("MONEY: $");
|
||||
print_u8(money);
|
||||
|
||||
basic_htab(23);
|
||||
basic_vtab(13);
|
||||
basic_print("TIME: ");
|
||||
if (time_hours<10) basic_print("0");
|
||||
print_u8(time_hours);
|
||||
basic_print(":");
|
||||
if (time_minutes<10) basic_print("0");
|
||||
print_u8(time_minutes);
|
||||
|
||||
grsim_update();
|
||||
|
||||
repeat_until_keypressed();
|
||||
home();
|
||||
gr();
|
||||
}
|
||||
|
176
gr-sim/tfv_sprites.c
Normal file
176
gr-sim/tfv_sprites.c
Normal file
@ -0,0 +1,176 @@
|
||||
/* TFV Sprites */
|
||||
unsigned char tfv_stand_right[]={
|
||||
0x4,0x6,
|
||||
0x00,0xDD,0xBD,0x00,
|
||||
0x00,0xDD,0xDB,0x0B,
|
||||
0x00,0x22,0x00,0x00,
|
||||
0x00,0x22,0x02,0x0B,
|
||||
0x00,0x22,0x00,0x00,
|
||||
0x00,0x82,0x80,0x00,
|
||||
};
|
||||
|
||||
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,
|
||||
};
|
||||
|
||||
unsigned char tfv_stand_left[]={
|
||||
0x4,0x6,
|
||||
0x00,0xBD,0xDD,0x00,
|
||||
0x0B,0xDB,0xDD,0x00,
|
||||
0x00,0x00,0x22,0x00,
|
||||
0x0B,0x02,0x22,0x00,
|
||||
0x00,0x00,0x22,0x00,
|
||||
0x00,0x80,0x82,0x00,
|
||||
};
|
||||
|
||||
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,
|
||||
};
|
||||
|
||||
unsigned char tfv_led_sword[]={
|
||||
0x5,0x3,
|
||||
0x10,0x00,0x10,0x00,0x00,
|
||||
0x10,0x01,0x10,0x10,0x10,
|
||||
0x00,0x00,0x11,0x01,0x10,
|
||||
};
|
||||
|
||||
|
||||
/* Bird Sprites */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Ship Sprites */
|
||||
|
||||
|
||||
#if 0
|
||||
unsigned char test_sprite[]={
|
||||
0x8,0x4,
|
||||
0x55,0x50,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x55,0x55,0x55,0x00,0x00,0x00,0x00,0x00,
|
||||
0xff,0x1f,0x4f,0x2f,0xff,0x22,0x20,0x00,
|
||||
0x5f,0x5f,0x5f,0x5f,0xff,0xf2,0xf2,0xf2,
|
||||
};
|
||||
#endif
|
||||
|
||||
unsigned char ship_forward[]={
|
||||
0x5,0x3,
|
||||
0x00,0x00,0x77,0x00,0x00,
|
||||
0x50,0x55,0x77,0x55,0x50,
|
||||
0x01,0x00,0x07,0x00,0x01,
|
||||
};
|
||||
|
||||
unsigned char ship_right[]={
|
||||
0x5,0x3,
|
||||
0x50,0x00,0x70,0x77,0x00,
|
||||
0x01,0x55,0x77,0x55,0x50,
|
||||
0x00,0x77,0x07,0x00,0x15,
|
||||
};
|
||||
|
||||
unsigned char ship_left[]={
|
||||
0x5,0x3,
|
||||
0x00,0x77,0x70,0x00,0x50,
|
||||
0x50,0x55,0x77,0x55,0x01,
|
||||
0x15,0x00,0x07,0x77,0x00,
|
||||
};
|
||||
|
||||
|
||||
/* Enemies */
|
||||
unsigned char killer_crab[]={
|
||||
0x9,0x6,
|
||||
0x99,0x00,0x99,0x00,0x00,0x00,0x99,0x00,0x99,
|
||||
0x06,0x60,0x06,0x00,0x00,0x00,0x06,0x60,0x06,
|
||||
0x00,0x06,0x40,0x49,0x44,0x49,0x40,0x06,0x00,
|
||||
0x06,0x04,0x44,0x44,0x44,0x44,0x44,0x04,0x06,
|
||||
0x00,0x60,0x04,0x64,0x04,0x64,0x04,0x60,0x00,
|
||||
0x44,0x00,0x40,0x04,0x00,0x04,0x40,0x00,0x44,
|
||||
};
|
||||
|
||||
/* Procrastinon */
|
||||
|
||||
/***********************/
|
||||
/* Background Features */
|
||||
/***********************/
|
||||
|
||||
|
||||
/* Palm Tree */
|
||||
unsigned char palm_tree[]={
|
||||
0x08,0x07,
|
||||
0x00,0x00,0x00,0x00,0x00,0x40,0x04,0x40,
|
||||
0x00,0x40,0x04,0x44,0x84,0x40,0x00,0x00,
|
||||
0x04,0x00,0x40,0x05,0x88,0x00,0x04,0x40,
|
||||
0x00,0x44,0x00,0x00,0x08,0x80,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x88,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x80,0x08,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x88,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
/* Pine Tree */
|
||||
unsigned char pine_tree[]={
|
||||
0x07,0x06,
|
||||
0x00,0x00,0x00,0x44,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x44,0x00,0x00,0x00,
|
||||
0x00,0x00,0x44,0x44,0x44,0x00,0x00,
|
||||
0x00,0x04,0x44,0x44,0x44,0x04,0x00,
|
||||
0x04,0x04,0x04,0x84,0x04,0x04,0x04,
|
||||
0x00,0x00,0x00,0x88,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
/* Snowy Tree */
|
||||
unsigned char snowy_tree[]={
|
||||
0x07,0x06,
|
||||
0x00,0x00,0x00,0x77,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x77,0x00,0x00,0x00,
|
||||
0x00,0x00,0x77,0x44,0x44,0x00,0x00,
|
||||
0x00,0x07,0x44,0x44,0x44,0x04,0x00,
|
||||
0x07,0x04,0x04,0x84,0x04,0x04,0x04,
|
||||
0x00,0x00,0x00,0x88,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
/* Cactus */
|
||||
unsigned char cactus[]={
|
||||
0x05,0x06,
|
||||
0x00,0x00,0x44,0x00,0x00,
|
||||
0x44,0x00,0x44,0x00,0x40,
|
||||
0x44,0x00,0x44,0x00,0x44,
|
||||
0x04,0x04,0x44,0x04,0x04,
|
||||
0x00,0x00,0x44,0x00,0x00,
|
||||
0x00,0x00,0x44,0x00,0x00,
|
||||
};
|
||||
|
||||
|
||||
/* Mountain */
|
||||
unsigned char mountain[]={
|
||||
0x0d,0x07,
|
||||
0x00,0x00,0x00,0x00,0x00,0x70,0xf7,0x70,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x77,0xff,0xff,0x77,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x90,0x8D,0x88,0x48,0x58,0x85,0x50,0x00,0x00,0x00,
|
||||
0x00,0x00,0xD0,0x9D,0x88,0x88,0x88,0x48,0x88,0x55,0x50,0x00,0x00,
|
||||
0x00,0xD0,0x89,0x88,0x88,0x89,0x88,0x88,0x88,0x88,0x85,0x75,0x00,
|
||||
0xD0,0x89,0x98,0x88,0x98,0x88,0x84,0x88,0x88,0x88,0x85,0x88,0x55,
|
||||
0x00,0x00,0x08,0x08,0x08,0x08,0x08,0x88,0x88,0x88,0x08,0x00,0x00,
|
||||
};
|
||||
|
||||
/* Lightning, @25,4 */
|
||||
unsigned char lightning[]={
|
||||
0x06,0x05,
|
||||
0x00,0x00,0xdd,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0xdd,0x00,0x00,
|
||||
0x00,0x00,0xdd,0x00,0xdd,0x00,
|
||||
0x00,0xdd,0x00,0x00,0xdd,0x00,
|
||||
0xdd,0x00,0x00,0x0d,0x00,0xdd,
|
||||
};
|
||||
|
@ -1,176 +1,15 @@
|
||||
/* TFV Sprites */
|
||||
static unsigned char tfv_stand_right[]={
|
||||
0x4,0x6,
|
||||
0x00,0xDD,0xBD,0x00,
|
||||
0x00,0xDD,0xDB,0x0B,
|
||||
0x00,0x22,0x00,0x00,
|
||||
0x00,0x22,0x02,0x0B,
|
||||
0x00,0x22,0x00,0x00,
|
||||
0x00,0x82,0x80,0x00,
|
||||
};
|
||||
|
||||
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,
|
||||
0x00,0x00,0x22,0x00,
|
||||
0x0B,0x02,0x22,0x00,
|
||||
0x00,0x00,0x22,0x00,
|
||||
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,
|
||||
};
|
||||
|
||||
static unsigned char tfv_led_sword[]={
|
||||
0x5,0x3,
|
||||
0x10,0x00,0x10,0x00,0x00,
|
||||
0x10,0x01,0x10,0x10,0x10,
|
||||
0x00,0x00,0x11,0x01,0x10,
|
||||
};
|
||||
|
||||
|
||||
/* Bird Sprites */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Ship Sprites */
|
||||
|
||||
|
||||
#if 0
|
||||
static unsigned char test_sprite[]={
|
||||
0x8,0x4,
|
||||
0x55,0x50,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x55,0x55,0x55,0x00,0x00,0x00,0x00,0x00,
|
||||
0xff,0x1f,0x4f,0x2f,0xff,0x22,0x20,0x00,
|
||||
0x5f,0x5f,0x5f,0x5f,0xff,0xf2,0xf2,0xf2,
|
||||
};
|
||||
#endif
|
||||
|
||||
static unsigned char ship_forward[]={
|
||||
0x5,0x3,
|
||||
0x00,0x00,0x77,0x00,0x00,
|
||||
0x50,0x55,0x77,0x55,0x50,
|
||||
0x01,0x00,0x07,0x00,0x01,
|
||||
};
|
||||
|
||||
static unsigned char ship_right[]={
|
||||
0x5,0x3,
|
||||
0x50,0x00,0x70,0x77,0x00,
|
||||
0x01,0x55,0x77,0x55,0x50,
|
||||
0x00,0x77,0x07,0x00,0x15,
|
||||
};
|
||||
|
||||
static unsigned char ship_left[]={
|
||||
0x5,0x3,
|
||||
0x00,0x77,0x70,0x00,0x50,
|
||||
0x50,0x55,0x77,0x55,0x01,
|
||||
0x15,0x00,0x07,0x77,0x00,
|
||||
};
|
||||
|
||||
|
||||
/* Enemies */
|
||||
static unsigned char killer_crab[]={
|
||||
0x9,0x6,
|
||||
0x99,0x00,0x99,0x00,0x00,0x00,0x99,0x00,0x99,
|
||||
0x06,0x60,0x06,0x00,0x00,0x00,0x06,0x60,0x06,
|
||||
0x00,0x06,0x40,0x49,0x44,0x49,0x40,0x06,0x00,
|
||||
0x06,0x04,0x44,0x44,0x44,0x44,0x44,0x04,0x06,
|
||||
0x00,0x60,0x04,0x64,0x04,0x64,0x04,0x60,0x00,
|
||||
0x44,0x00,0x40,0x04,0x00,0x04,0x40,0x00,0x44,
|
||||
};
|
||||
|
||||
/* Procrastinon */
|
||||
|
||||
/***********************/
|
||||
/* Background Features */
|
||||
/***********************/
|
||||
|
||||
|
||||
/* Palm Tree */
|
||||
static unsigned char palm_tree[]={
|
||||
0x08,0x07,
|
||||
0x00,0x00,0x00,0x00,0x00,0x40,0x04,0x40,
|
||||
0x00,0x40,0x04,0x44,0x84,0x40,0x00,0x00,
|
||||
0x04,0x00,0x40,0x05,0x88,0x00,0x04,0x40,
|
||||
0x00,0x44,0x00,0x00,0x08,0x80,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x88,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x80,0x08,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x88,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
/* Pine Tree */
|
||||
static unsigned char pine_tree[]={
|
||||
0x07,0x06,
|
||||
0x00,0x00,0x00,0x44,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x44,0x00,0x00,0x00,
|
||||
0x00,0x00,0x44,0x44,0x44,0x00,0x00,
|
||||
0x00,0x04,0x44,0x44,0x44,0x04,0x00,
|
||||
0x04,0x04,0x04,0x84,0x04,0x04,0x04,
|
||||
0x00,0x00,0x00,0x88,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
/* Snowy Tree */
|
||||
static unsigned char snowy_tree[]={
|
||||
0x07,0x06,
|
||||
0x00,0x00,0x00,0x77,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x77,0x00,0x00,0x00,
|
||||
0x00,0x00,0x77,0x44,0x44,0x00,0x00,
|
||||
0x00,0x07,0x44,0x44,0x44,0x04,0x00,
|
||||
0x07,0x04,0x04,0x84,0x04,0x04,0x04,
|
||||
0x00,0x00,0x00,0x88,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
/* Cactus */
|
||||
static unsigned char cactus[]={
|
||||
0x05,0x06,
|
||||
0x00,0x00,0x44,0x00,0x00,
|
||||
0x44,0x00,0x44,0x00,0x40,
|
||||
0x44,0x00,0x44,0x00,0x44,
|
||||
0x04,0x04,0x44,0x04,0x04,
|
||||
0x00,0x00,0x44,0x00,0x00,
|
||||
0x00,0x00,0x44,0x00,0x00,
|
||||
};
|
||||
|
||||
|
||||
/* Mountain */
|
||||
static unsigned char mountain[]={
|
||||
0x0d,0x07,
|
||||
0x00,0x00,0x00,0x00,0x00,0x70,0xf7,0x70,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x77,0xff,0xff,0x77,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x90,0x8D,0x88,0x48,0x58,0x85,0x50,0x00,0x00,0x00,
|
||||
0x00,0x00,0xD0,0x9D,0x88,0x88,0x88,0x48,0x88,0x55,0x50,0x00,0x00,
|
||||
0x00,0xD0,0x89,0x88,0x88,0x89,0x88,0x88,0x88,0x88,0x85,0x75,0x00,
|
||||
0xD0,0x89,0x98,0x88,0x98,0x88,0x84,0x88,0x88,0x88,0x85,0x88,0x55,
|
||||
0x00,0x00,0x08,0x08,0x08,0x08,0x08,0x88,0x88,0x88,0x08,0x00,0x00,
|
||||
};
|
||||
|
||||
/* Lightning, @25,4 */
|
||||
static unsigned char lightning[]={
|
||||
0x06,0x05,
|
||||
0x00,0x00,0xdd,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0xdd,0x00,0x00,
|
||||
0x00,0x00,0xdd,0x00,0xdd,0x00,
|
||||
0x00,0xdd,0x00,0x00,0xdd,0x00,
|
||||
0xdd,0x00,0x00,0x0d,0x00,0xdd,
|
||||
};
|
||||
|
||||
extern unsigned char tfv_stand_right[];
|
||||
extern unsigned char tfv_walk_right[];
|
||||
extern unsigned char tfv_stand_left[];
|
||||
extern unsigned char tfv_walk_left[];
|
||||
extern unsigned char tfv_led_sword[];
|
||||
extern unsigned char ship_forward[];
|
||||
extern unsigned char ship_right[];
|
||||
extern unsigned char ship_left[];
|
||||
extern unsigned char killer_crab[];
|
||||
extern unsigned char palm_tree[];
|
||||
extern unsigned char pine_tree[];
|
||||
extern unsigned char snowy_tree[];
|
||||
extern unsigned char cactus[];
|
||||
extern unsigned char mountain[];
|
||||
extern unsigned char lightning[];
|
||||
|
@ -26,5 +26,16 @@ extern unsigned char map_x;
|
||||
extern char tfv_x,tfv_y;
|
||||
extern unsigned char ground_color;
|
||||
|
||||
extern char nameo[9];
|
||||
|
||||
|
||||
int opening(void);
|
||||
int title(void);
|
||||
int flying(void);
|
||||
|
||||
void game_over(void);
|
||||
void show_map(void);
|
||||
void print_info(void);
|
||||
void print_help(void);
|
||||
|
||||
int do_battle(void);
|
||||
|
Loading…
Reference in New Issue
Block a user