tfv: add support for printing flashing characters

still doesn't flash though
This commit is contained in:
Vince Weaver 2018-06-30 15:53:21 -04:00
parent 783fbb573a
commit 774bac66c2
3 changed files with 15 additions and 10 deletions

View File

@ -1667,3 +1667,13 @@ void print_inverse(char *string) {
}
ram[BASL]+=strlen(string);
}
void print_flash(char *string) {
for(y=0;y<strlen(string);y++) {
a=string[y];
a=(a&0x3f)|0x40;
ram[y_indirect(BASL,y)]=a;
}
ram[BASL]+=strlen(string);
}

View File

@ -45,6 +45,7 @@ void move_and_print(char *string);
void print(char *string);
void print_both_pages(char *string);
void print_inverse(char *string);
void print_flash(char *string);
int plot(unsigned char xcoord, unsigned char ycoord);
#define APPLE_UP 11

View File

@ -346,18 +346,12 @@ static int draw_battle_bottom(int enemy_type) {
vtab(21);
htab(36);
move_cursor();
if (limit<5) {
if (limit<4) {
print("LIMIT");
}
else {
/* Make if flash? */
char limit_string[6]="LIMIT";
limit_string[0]|=0x40;
limit_string[1]|=0x40;
limit_string[2]|=0x40;
limit_string[3]|=0x40;
limit_string[4]|=0x40;
print(limit_string);
/* Make if flash? set bit 0x40 */
print_flash("LIMIT");
}
vtab(22);
@ -522,7 +516,7 @@ int do_battle(void) {
// attack and decrement HP
hp-=enemy_attack(enemy_x,enemy_type,ax);
// update limit count
if (limit<5) limit++;
if (limit<4) limit++;
// redraw bottom
draw_battle_bottom(enemy_type);
// reset enemy time. FIXME: variable?