tfv: clean up item handling

This commit is contained in:
Vince Weaver 2018-06-25 15:45:26 -04:00
parent 1073d326d7
commit a8fe38121b
4 changed files with 10 additions and 27 deletions

View File

@ -1,14 +1,9 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "gr-sim.h" #include "gr-sim.h"
#include "tfv_utils.h" #include "tfv_utils.h"
#include "tfv_zp.h" #include "tfv_zp.h"
#include "tfv_defines.h"
#include "tfv_backgrounds.h"
void print_help(void) { void print_help(void) {
@ -57,5 +52,3 @@ void print_help(void) {
soft_switch(TXTCLR); soft_switch(TXTCLR);
} }

View File

@ -1,14 +1,12 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "gr-sim.h" #include "gr-sim.h"
#include "tfv_utils.h" #include "tfv_utils.h"
#include "tfv_zp.h" #include "tfv_zp.h"
#include "tfv_defines.h" #include "tfv_defines.h"
#include "tfv_backgrounds.h" #include "tfv_items.h"
/* /*
@ -41,13 +39,13 @@
EXPERIENCE = 0...255 EXPERIENCE = 0...255
LEVEL = EXPERIENCE / = 0...63 LEVEL = EXPERIENCE / = 0...63
NEXT LEVEL = NEXT LEVEL =
MONEY = 0...255 MONEY = 0...255
MAX_HP = 32+EXPERIENCE (maxing at 255) MAX_HP = 32+EXPERIENCE (maxing at 255)
*/ */
char item_names[2][8][15]={
static char item_names1[8][15]={ {
"CUPCAKE", // cafeteria lady "CUPCAKE", // cafeteria lady
"CARROT", // capabara "CARROT", // capabara
"SMARTPASS", // metro worker "SMARTPASS", // metro worker
@ -56,9 +54,8 @@ static char item_names1[8][15]={
"KARTE SPIEL", // Frau "KARTE SPIEL", // Frau
"GLAMDRING", // Gus "GLAMDRING", // Gus
"VEGEMITE", // Nicole "VEGEMITE", // Nicole
}; },
{
static char item_names2[8][15]={
"BLUE LED", // bird "BLUE LED", // bird
"RED LED", // "RED LED", //
"1K RESISTOR", // brown black red, Elaine "1K RESISTOR", // brown black red, Elaine
@ -67,6 +64,7 @@ static char item_names2[8][15]={
"1.5V BATTERY", // Oscar "1.5V BATTERY", // Oscar
"LINUX CD", // john "LINUX CD", // john
"ARMY KNIFE", // Steve "ARMY KNIFE", // Steve
}
}; };
void print_info(void) { void print_info(void) {
@ -107,11 +105,11 @@ void print_info(void) {
for(i=0;i<8;i++) { for(i=0;i<8;i++) {
basic_htab(4); basic_htab(4);
basic_vtab(6+i); basic_vtab(6+i);
if (items1&(1<<i)) basic_print(item_names1[i]); if (items1&(1<<i)) basic_print(item_names[0][i]);
basic_htab(4); basic_htab(4);
basic_vtab(14+i); basic_vtab(14+i);
if (items2&(1<<i)) basic_print(item_names2[i]); if (items2&(1<<i)) basic_print(item_names[1][i]);
} }
basic_htab(23); basic_htab(23);

View File

@ -21,6 +21,6 @@
#define ITEM_CHEX_MIX 0x01 // oscar #define ITEM_CHEX_MIX 0x01 // oscar
#define ITEM_CLASS_RING 0x02 // #define ITEM_CLASS_RING 0x02 //
extern char items[2][8][13]; extern char item_names[2][8][15];

View File

@ -1,7 +1,5 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "gr-sim.h" #include "gr-sim.h"
#include "tfv_utils.h" #include "tfv_utils.h"
@ -25,8 +23,6 @@ void show_map(void) {
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));
// 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[CH]=20;
@ -36,7 +32,3 @@ void show_map(void) {
repeat_until_keypressed(); repeat_until_keypressed();
} }