Fix printing ATM balance to main text window

This commit is contained in:
jeffman 2018-12-06 20:44:08 -05:00
parent e64b58d89e
commit bd7dff7d47
5 changed files with 34 additions and 3 deletions

View File

@ -470,3 +470,18 @@ void clear_number_menu(WINDOW* window)
(*tilemap_pointer)[window->window_x + i + ((window->window_y + 6) * 32)] = border_tile;
}
}
// Prints a character to a window, and updates the window's text position
byte print_character_to_window(byte chr, WINDOW* window)
{
int x = ((window->window_x + window->text_x) << 3) + window->pixel_x;
int y = (window->window_y + window->text_y) << 3;
byte width = print_character(chr, x, y);
x += width;
window->pixel_x = x & 7;
window->text_x = (x >> 3) - window->window_x;
return width;
}

View File

@ -36,6 +36,7 @@ int expand_bit_depth(byte row, int foreground);
byte reduce_bit_depth(int row, int foreground);
byte print_character(byte chr, int x, int y);
byte print_character_formatted(byte chr, int x, int y, int font, int foreground);
byte print_character_to_window(byte chr, WINDOW* window);
void print_special_character(int tile, int x, int y);
byte print_character_with_callback(byte chr, int x, int y, int font, int foreground,
int *dest, int (*getTileCallback)(int, int), int useTilemap);

View File

@ -467,6 +467,16 @@ b 0x80D3514
// Don't print [1E 20] after the name if there are multiple people
.org 0x80D3418 :: b 0x80D348C
//---------------------------------------------------------
// D3560 hacks (print money balance)
//---------------------------------------------------------
.org 0x80D35BA
bl decode_character
mov r1,r5
bl print_character_to_window
b 0x80D35EA
//---------------------------------------------------------
// D3934 hacks (print PSI name)
//---------------------------------------------------------

View File

@ -17,6 +17,7 @@ Hard-coded characters:
0x20251D8: item drop
0x3000A00: Current PSI list when displaying a PSI window?
0x3000AA2: number of party members
0x3001D54: Ness items (16 bits each)
0x3001D70: Ness EXP
0x3001D80: Ness level
@ -56,6 +57,7 @@ Hard-coded characters:
0x01: Teleport alpha
0x08: Teleport beta
0x3001FA4: Escargo Express items (36 of them)
0x30023D4: current money balance
0x3002500: buttons being pressed
0x30051EC: tile offset (usually 0x100)
0x3005224: menu depth
@ -139,11 +141,13 @@ Subroutines
(does not modify any window values)
80C980C: print next character (r0: window pointer)
80CA4BC: scroll text upwards (r0: window pointer)
80CA744: store the lowest r2 (e.g. 7) decimal digits of r0 as an array to r1; return position of highest non-zero digit
80CAB90: print window header string (r1) to RAM (r0) at tile ((r2 * 32) + r3)
80CABF8: print checkboard string (r1) to RAM (r0) at tile ((r2 * 32) + r3)
80D2E94: print party character name
80D30C4: related to printing numbers points in battle (r0 = window)
80D332C: related to printing names in battle (r0 = window)
80D3560: related to printing numbers outside of battle (r0 = window)
80D7154: count party members and store to 3000AA2
then do some other stuff to the windows -- possibly drawing the HP/PP boxes?
80EBFD4: copy string from r0, of max length r1, to battle user slot, and terminate with [00 FF]
@ -183,7 +187,8 @@ Window structure:
0x10 - 0x13: ?
0x14 - 0x17: text address offset
0x18 - 0x1B: ?
0x1C - 0x1F: ? (some kind of offset; used when printing nameable things?)
0x1C - 0x1F: when printing numbers: the current digit index to print
when printing names: ?
0x20 - 0x21: area (width*height)
0x22 - 0x23: window X (text area, not including border)
0x24 - 0x25: window Y

View File

@ -14,7 +14,7 @@
"OffsetLocation": 11639404,
"OldPointer": 11638980,
"Old": " ヒキダス アズケル[00 FF]",
"New": " Withdraw Deposit[00 FF]"
"New": "[5F FF 18]Withdraw[5F FF 60]Deposit[00 FF]"
},
{
"Index": 2,