81 lines
1.2 KiB
C
Raw Normal View History

2017-05-03 10:53:27 -04:00
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
2017-05-03 10:53:27 -04:00
#include "gr-sim.h"
2017-08-12 20:15:34 -04:00
#include "tfv_utils.h"
#include "tfv_zp.h"
2017-05-03 10:53:27 -04:00
2017-07-08 17:06:43 -04:00
#include "tfv_sprites.h"
2017-08-12 20:52:18 -04:00
#include "tfv_backgrounds.h"
2017-05-04 14:32:41 -04:00
/* stats */
2017-08-12 20:15:34 -04:00
unsigned char level=0;
unsigned char hp=50,max_hp=100;
unsigned char limit=2;
unsigned char money=0,experience=0;
unsigned char time_hours=0,time_minutes=0;
unsigned char items1=0xff,items2=0xff;
unsigned char steps=0;
2017-07-22 16:45:53 -04:00
/* location */
2017-08-12 20:15:34 -04:00
unsigned char map_x=5;
char tfv_x=15,tfv_y=19;
unsigned char ground_color;
2017-07-08 17:06:43 -04:00
2017-08-13 15:38:49 -04:00
char nameo[9];
2017-07-08 17:06:43 -04:00
int main(int argc, char **argv) {
2017-07-20 13:16:37 -04:00
int result;
2017-07-08 17:06:43 -04:00
grsim_init();
home();
gr();
2017-08-12 20:35:36 -04:00
/* Clear bottom of zero page */
apple_memset(&ram[0],0,16);
/* clear top page0 */
/* clear top page1 */
clear_top(PAGE0);
clear_top(PAGE1);
2017-08-12 20:35:36 -04:00
/* clear bottom page0 */
/* clear bottom page1 */
clear_bottom(PAGE0);
clear_bottom(PAGE1);
2017-08-12 20:35:36 -04:00
2017-07-08 17:06:43 -04:00
/* Do Opening */
opening();
/* Title Screen */
2017-07-20 13:16:37 -04:00
title_loop:
result=title();
if (result!=0) goto title_loop;
2017-07-08 17:06:43 -04:00
nameo[0]=0;
2017-07-08 17:06:43 -04:00
/* Get Name */
name_screen();
if (nameo[0]==0) {
strcpy(nameo,"DEATER");
}
2017-07-08 17:06:43 -04:00
/* Flying */
2017-07-20 14:06:13 -04:00
home();
2017-07-08 17:06:43 -04:00
flying();
/* World Map */
world_map();
2017-07-10 00:39:38 -04:00
/* Game Over, Man */
game_over();
2017-07-08 17:06:43 -04:00
return 0;
}