Merge from master
This commit is contained in:
commit
25ca944355
|
@ -85,6 +85,11 @@ English names:
|
|||
- 04: Body select
|
||||
- 05: Arms select
|
||||
- 06: Other select
|
||||
- PSI:
|
||||
- 01: character select
|
||||
- 02: PSI select
|
||||
- 03: target select
|
||||
- 04: text box
|
||||
0x3005228: current text palette, << 0xC
|
||||
0x3005230: addresses of all 11 windows
|
||||
[00]: A menu
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -64,7 +64,7 @@
|
|||
// ----------------------------------------------------------------------------
|
||||
// Substate 1 (character select)
|
||||
080BAF5C (T) ldr r6,=3005230h ;9 495
|
||||
080BAF5E (T) ldr r0,[r6,18h] ;4 499
|
||||
080BAF5E (T) ldr r0,[r6,18h] ;4 499 slot window pointer
|
||||
080BAF60 (T) bl 80C4EB0h ;10 509
|
||||
080BAF64 (T) lsl r0,r0,10h ;2 511
|
||||
080BAF66 (T) asr r5,r0,10h ;2 513
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
|
||||
// Process the outer Goods window (i.e. character selection)
|
||||
// Called every frame. Replaces $80BF858 fully.
|
||||
// Returns 1 if the user steps into the inner window,
|
||||
// Returns 1 if the user steps into the inner window, or the chosen party member's number if it's the give window,
|
||||
// -1 if the user steps back out to the previous window,
|
||||
// and 0 for no action.
|
||||
// y_offset is added to account for the Tracy goods window, which
|
||||
// the game offsets by one tile downwards
|
||||
int goods_outer_process(WINDOW* window, int y_offset)
|
||||
int goods_outer_process(WINDOW* window, int y_offset, bool give)
|
||||
{
|
||||
// Get the weird signed parity value
|
||||
short unknown = window->unknown6;
|
||||
|
@ -129,7 +129,7 @@ int goods_outer_process(WINDOW* window, int y_offset)
|
|||
{
|
||||
if (current_pc != original_pc)
|
||||
{
|
||||
if (*window_flags & 0x800)
|
||||
if ((!give) && (*window_flags & 0x800))
|
||||
m2_soundeffect(0x131);
|
||||
else
|
||||
m2_soundeffect(0x12E);
|
||||
|
@ -156,15 +156,17 @@ int goods_outer_process(WINDOW* window, int y_offset)
|
|||
{
|
||||
m2_soundeffect(0x12D);
|
||||
window->counter = 0;
|
||||
|
||||
unsigned short first_item = current_items[0];
|
||||
if (first_item > 0)
|
||||
if(!give)
|
||||
{
|
||||
// If the first item isn't null, erase the arrow border tiles
|
||||
clear_window_arrows(window);
|
||||
unsigned short first_item = current_items[0];
|
||||
if (first_item > 0)
|
||||
{
|
||||
// If the first item isn't null, erase the arrow border tiles
|
||||
clear_window_arrows(window);
|
||||
}
|
||||
return signed_parity + 1;
|
||||
}
|
||||
|
||||
return signed_parity + 1;
|
||||
return current_pc + 1;
|
||||
}
|
||||
|
||||
window->counter++;
|
||||
|
@ -476,3 +478,48 @@ void goods_print_items(WINDOW *window, unsigned short *items, int y_offset)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
//This works. Gets price given the item (Could not get a proper thumb routine to work, it would automatically go to arm)
|
||||
//What this routine does is: it receives the item value, multiplies it by 20 and then sums it with the address of m2_items to get the item price that is at that address.
|
||||
//Original code is at 0x80C7D58
|
||||
unsigned short getPrice(int item)
|
||||
{
|
||||
unsigned short *value = (unsigned short *)(&m2_items + (item * 5));
|
||||
return value[0];
|
||||
}
|
||||
|
||||
// Prints all itemsnum items to a shop window.
|
||||
// Erases the slot before printing. Prints blanks for null items.
|
||||
void shop_print_items(WINDOW *window, unsigned char *items, int y_offset, int itemsnum)
|
||||
{
|
||||
int item_x = (window->window_x << 3) + 8;
|
||||
int item_y = (window->window_y + y_offset) << 3;
|
||||
|
||||
for (int i = 0; i < itemsnum; i++)
|
||||
{
|
||||
int item = items[i];
|
||||
int x = item_x;
|
||||
int y = item_y + (i * 16);
|
||||
|
||||
print_blankstr(x >> 3, y >> 3, 16);
|
||||
|
||||
if (item > 0)
|
||||
{
|
||||
int x_offset = 0;
|
||||
byte *item_str = m2_strlookup(m2_items_offsets, m2_items_strings, item);
|
||||
print_string(item_str, x + x_offset, y);
|
||||
int digit_count;
|
||||
int bcd = bin_to_bcd(getPrice(item), &digit_count); //Get the price in bcd, so it can be printed
|
||||
int base = 120;
|
||||
print_character(decode_character(0x56), x + base, y); //00, it will be at the end, always at the same position
|
||||
print_character(decode_character(0x54), x + base - 6 - (digit_count * 6), y); //dollar, it must be before all digits
|
||||
// Write the digits
|
||||
for (int j = 0; j < digit_count; j++)
|
||||
{
|
||||
byte digit = ((bcd >> ((digit_count - 1 - j) * 4)) & 0xF) + ZERO;
|
||||
print_character(decode_character(digit), x + base - 6 - ((digit_count - j - 1) * 6), y); //write a single digit
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,9 +18,10 @@ typedef enum GOODS_ACTION
|
|||
ACTION_STEPOUT = -1
|
||||
} GOODS_ACTION;
|
||||
|
||||
int goods_outer_process(WINDOW* window, int y_offset);
|
||||
int goods_outer_process(WINDOW* window, int y_offset, bool give);
|
||||
int goods_inner_process(WINDOW *window, unsigned short *items);
|
||||
void goods_print_items(WINDOW *window, unsigned short *items, int y_offset);
|
||||
void shop_print_items(WINDOW *window, unsigned char *items, int y_offset, int itemsnum);
|
||||
|
||||
extern bool m2_isequipped(int item_index);
|
||||
extern void m2_soundeffect(int index);
|
||||
|
@ -28,5 +29,7 @@ extern int m2_div(int dividend, int divisor);
|
|||
extern int m2_sub_a334c(int value);
|
||||
extern int m2_sub_a3384(int value);
|
||||
extern void m2_clearwindowtiles(WINDOW* window);
|
||||
extern int bin_to_bcd(int value, int* digit_count);
|
||||
extern int m2_items;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -347,10 +347,10 @@ int print_window_header_string(int *dest, byte *str, int x, int y)
|
|||
return pixelX - (x & 7);
|
||||
}
|
||||
|
||||
void clear_window_header(int *dest)
|
||||
void clear_window_header(int *dest, int length, int x, int y)
|
||||
{
|
||||
dest += (WINDOW_HEADER_X + (WINDOW_HEADER_Y * 32)) * 8;
|
||||
clear_rect_ram(dest, 16, WINDOW_HEADER_BG);
|
||||
dest += (x + (y * 32)) * 8;
|
||||
clear_rect_ram(dest, length, WINDOW_HEADER_BG);
|
||||
}
|
||||
|
||||
unsigned short* print_equip_header(int type, unsigned short *tilemap, unsigned int *dest, WINDOW *window)
|
||||
|
|
|
@ -40,7 +40,7 @@ byte print_character_with_callback(byte chr, int x, int y, int font, int foregro
|
|||
int *dest, int (*getTileCallback)(int, int), unsigned short *tilemapPtr, int tilemapWidth);
|
||||
byte print_character_to_ram(byte chr, int *dest, int xOffset, int font, int foreground);
|
||||
int print_window_header_string(int *dest, byte *str, int x, int y);
|
||||
void clear_window_header(int *dest);
|
||||
void clear_window_header(int *dest, int length, int x, int y);
|
||||
unsigned short* print_equip_header(int type, unsigned short *tilemap, unsigned int *dest,
|
||||
WINDOW *window);
|
||||
unsigned short format_tile(unsigned short tile, bool flip_x, bool flip_y);
|
||||
|
|
|
@ -116,6 +116,9 @@ b 0x80BADD8
|
|||
.org 0x80C55F8
|
||||
mov r4,r0
|
||||
mov r0,r9
|
||||
mov r1,#0x10 //Tiles to clear
|
||||
mov r2,#0x10 //x
|
||||
mov r3,#0x11 //y
|
||||
bl clear_window_header
|
||||
mov r0,r4
|
||||
mov r1,r6 // tilemap
|
||||
|
@ -646,6 +649,7 @@ pop {pc}
|
|||
.org 0x80BF858
|
||||
push {lr}
|
||||
mov r1,0
|
||||
mov r2,0
|
||||
bl goods_outer_process
|
||||
pop {pc}
|
||||
|
||||
|
@ -656,9 +660,42 @@ pop {pc}
|
|||
.org 0x80C0420
|
||||
push {lr}
|
||||
mov r1,1
|
||||
mov r2,0
|
||||
bl goods_outer_process
|
||||
pop {pc}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// C7CA4 hacks (Shop)
|
||||
//---------------------------------------------------------
|
||||
.org 0x80C7CA4
|
||||
mov r0,r8 //Window
|
||||
ldr r1,[sp,#0xC] //Items in shop
|
||||
mov r2,#0 //y_offset | r3 already has the item total for this window
|
||||
bl shop_print_items //Print the items
|
||||
b 0x80C7E12 //Avoid the game's printing by jumping it
|
||||
|
||||
//---------------------------------------------------------
|
||||
// BFE74 hacks (Goods outer menu for Give)
|
||||
//---------------------------------------------------------
|
||||
.org 0x80BFE74
|
||||
push {lr}
|
||||
mov r1,#1
|
||||
mov r2,#1
|
||||
bl goods_outer_process
|
||||
pop {pc}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// BA61C hacks (Fixes inventory when out of Give via B button)
|
||||
//---------------------------------------------------------
|
||||
.org 0x80BA61C
|
||||
bl ba61c_get_print_inventory_window
|
||||
|
||||
//---------------------------------------------------------
|
||||
// BA48E hacks (Fixes inventory when out of Give via text)
|
||||
//---------------------------------------------------------
|
||||
.org 0x80BA48E
|
||||
bl ba48e_get_print_inventory_window
|
||||
|
||||
//---------------------------------------------------------
|
||||
// C1C98 hacks (menu selection)
|
||||
//---------------------------------------------------------
|
||||
|
@ -794,6 +831,43 @@ nop
|
|||
//---------------------------------------------------------
|
||||
.org 0x802A75F :: db 0x30 //Add 8 extra frames before the game can start reading again.
|
||||
|
||||
//---------------------------------------------------------
|
||||
// Teleport header fix
|
||||
//---------------------------------------------------------
|
||||
.org 0x80C5DE0 :: bl c65da_clean_print //To:
|
||||
.org 0x80C5E30 :: bl c6190_clean_print //Number on first entering the menu
|
||||
.org 0x80C6190 :: bl c6190_clean_print //Number on page change
|
||||
.org 0x80C5E04 :: nop :: strh r0,[r4,#0] :: add r4,#2 :: nop ::nop //Remove extra tile
|
||||
|
||||
//---------------------------------------------------------
|
||||
// Stored Goods header fix
|
||||
//---------------------------------------------------------
|
||||
.org 0x80C656C :: mov r2,#0x10 :: mov r3,#0x11 :: bl c6570_clean_print_change_pos :: b 0x80C65C0 //Changes position and cleans tiles for Stored Goods
|
||||
.org 0x80C65DA :: bl c65da_clean_print //Number on first entering the menu
|
||||
.org 0x80C6996 :: bl c65da_clean_print //Number on page change
|
||||
|
||||
//---------------------------------------------------------
|
||||
// Call header fix
|
||||
//---------------------------------------------------------
|
||||
.org 0x80BD26A :: bl c6190_clean_print //Call:
|
||||
|
||||
//---------------------------------------------------------
|
||||
// Fix windows printing too many tiles due to not going off of pixels, but off of characters
|
||||
//---------------------------------------------------------
|
||||
.org 0x80C0B28 :: bl c0b28_fix_char_tiles //Status window
|
||||
.org 0x80C009E :: bl c009e_fix_char_tiles //Give window
|
||||
.org 0x80C4BD6 :: bl c4bd6_fix_char_tiles //Equip window
|
||||
.org 0x80C42E0 :: bl c42e0_fix_char_tiles //Outer PSI window
|
||||
.org 0x80C3FD8 :: bl c42e0_fix_char_tiles //Inner PSI window
|
||||
.org 0x80C4448 :: bl c4448_fix_char_tiles //Inner PSI window - part 2
|
||||
.org 0x80DBF36 :: bl c009e_fix_char_tiles //Battle menu window
|
||||
|
||||
//---------------------------------------------------------
|
||||
// Proper dollar and 00 symbols for [9C FF]
|
||||
//---------------------------------------------------------
|
||||
.org 0x80B8AA0 :: mov r0,#0x54 //Dollar
|
||||
.org 0x80B8AA6 :: mov r0,#0x56 //00
|
||||
|
||||
//---------------------------------------------------------
|
||||
// Names hacks
|
||||
//---------------------------------------------------------
|
||||
|
@ -846,6 +920,8 @@ nop
|
|||
.org 0x80D6B44 :: lsl r1,r4,#3 :: sub r1,r1,r4 :: nop
|
||||
.org 0x80D6E3A :: lsl r1,r4,#3 :: sub r1,r1,r4 :: nop
|
||||
.org 0x80D6ED0 :: lsl r1,r4,#3 :: sub r1,r1,r4 :: nop
|
||||
.org 0x80C3FC6 :: lsl r1,r0,#3 :: sub r1,r1,r0 :: nop
|
||||
.org 0x80C4436 :: lsl r1,r0,#3 :: sub r1,r1,r0 :: nop
|
||||
|
||||
//Change the way the characters' names are called. Instead of number * 6, it's now number * 7. These ones already received an lsl of 1 beforehand.
|
||||
.org 0x80C0AC8 :: lsl r1,r1,#2 :: sub r1,r1,r5
|
||||
|
@ -927,7 +1003,13 @@ nop
|
|||
|
||||
.org 0x80121DC :: cmp r2,#4
|
||||
.org 0x8013672 :: cmp r5,#4
|
||||
.org 0x80C0B0A :: cmp r2,#4
|
||||
.org 0x80C0B0A :: cmp r2,#4 //Status window header
|
||||
.org 0x80C4BBC :: cmp r2,#4 //Equip window header
|
||||
.org 0x80C42C6 :: cmp r2,#4 //Outer PSI window header
|
||||
.org 0x80C3FBE :: cmp r2,#4 //Inner PSI window header
|
||||
.org 0x80C442E :: cmp r2,#4 //Inner PSI window - part 2 header
|
||||
.org 0x80C0082 :: cmp r5,#4 //Give window header
|
||||
.org 0x80DBF28 :: cmp r0,#4 //Battle menu window header
|
||||
.org 0x80C97E2 :: cmp r1,#6
|
||||
.org 0x80DAF3A :: cmp r0,#6
|
||||
.org 0x80D33BC :: cmp r2,#6
|
||||
|
@ -1107,6 +1189,7 @@ m2_enemy_attributes:
|
|||
.definelabel m2_enable_script ,0x80A1F6C
|
||||
.definelabel m2_sub_a334c ,0x80A334C
|
||||
.definelabel m2_sub_a3384 ,0x80A3384
|
||||
.definelabel m2_get_selected_item ,0x80A469C
|
||||
.definelabel m2_psitargetwindow ,0x80B8AE0
|
||||
.definelabel m2_isequipped ,0x80BC670
|
||||
.definelabel m2_swapwindowbuf ,0x80BD7AC
|
||||
|
@ -1127,6 +1210,7 @@ m2_enemy_attributes:
|
|||
.definelabel m2_curhpwindow_down ,0x80D41D8
|
||||
.definelabel m2_div ,0x80F49D8
|
||||
.definelabel m2_remainder ,0x80F4A70
|
||||
.definelabel m2_items ,0x8B1D62C
|
||||
.definelabel m2_default_names ,0x82B9330
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
@ -1276,107 +1276,308 @@ pop {pc}
|
|||
//==============================================================================
|
||||
//Hacks that load specific numbers for the new names
|
||||
_2352_load_1d7:
|
||||
mov r0,#0xEB
|
||||
lsl r0,r0,#1
|
||||
add r0,r0,#1
|
||||
bx lr
|
||||
mov r0,#0xEB
|
||||
lsl r0,r0,#1
|
||||
add r0,r0,#1
|
||||
bx lr
|
||||
|
||||
_2372_load_1e5:
|
||||
mov r0,#0xF2
|
||||
lsl r0,r0,#1
|
||||
add r0,r0,#1
|
||||
bx lr
|
||||
mov r0,#0xF2
|
||||
lsl r0,r0,#1
|
||||
add r0,r0,#1
|
||||
bx lr
|
||||
|
||||
c98c4_load_1d7:
|
||||
mov r4,#0xEB
|
||||
lsl r4,r4,#1
|
||||
add r4,r4,#1
|
||||
bx lr
|
||||
mov r4,#0xEB
|
||||
lsl r4,r4,#1
|
||||
add r4,r4,#1
|
||||
bx lr
|
||||
|
||||
c98d4_load_1e5:
|
||||
mov r4,#0xF2
|
||||
lsl r4,r4,#1
|
||||
add r4,r4,#1
|
||||
bx lr
|
||||
mov r4,#0xF2
|
||||
lsl r4,r4,#1
|
||||
add r4,r4,#1
|
||||
bx lr
|
||||
|
||||
//==============================================================================
|
||||
//Fast routine that uses the defaults and stores them. Original one is a nightmare. Rewriting it from scratch. r1 has the target address. r5 has 0.
|
||||
cb2f2_hardcoded_defaults:
|
||||
push {lr}
|
||||
mov r0,#0x7E //Ness' name
|
||||
strb r0,[r1,#0]
|
||||
mov r2,#0x95
|
||||
strb r2,[r1,#1]
|
||||
strb r2,[r1,#0xF]
|
||||
mov r0,#0xA3
|
||||
strb r0,[r1,#2]
|
||||
strb r0,[r1,#3]
|
||||
mov r4,#0xFF
|
||||
lsl r5,r4,#8
|
||||
strh r5,[r1,#4]
|
||||
add r1,#7
|
||||
mov r0,#0x80 //Paula's name
|
||||
strb r0,[r1,#0]
|
||||
strb r0,[r1,#0xE]
|
||||
mov r3,#0x91
|
||||
strb r3,[r1,#1]
|
||||
strb r3,[r1,#4]
|
||||
mov r0,#0xA5
|
||||
strb r0,[r1,#2]
|
||||
mov r0,#0x9C
|
||||
strb r0,[r1,#3]
|
||||
strb r5,[r1,#5]
|
||||
strb r4,[r1,#6]
|
||||
add r1,#7
|
||||
mov r0,#0x7A //Jeff's name
|
||||
strb r0,[r1,#0]
|
||||
mov r0,#0x95
|
||||
strb r0,[r1,#1]
|
||||
mov r0,#0x96
|
||||
strb r0,[r1,#2]
|
||||
strb r0,[r1,#3]
|
||||
strh r5,[r1,#4]
|
||||
add r1,#7
|
||||
strb r4,[r1,#4]
|
||||
mov r4,#0x9F //Poo's name
|
||||
strb r4,[r1,#1]
|
||||
strb r4,[r1,#2]
|
||||
strb r5,[r1,#3]
|
||||
add r1,#7
|
||||
mov r0,#0x7B //King's name
|
||||
strb r0,[r1,#0]
|
||||
mov r0,#0x99
|
||||
strb r0,[r1,#1]
|
||||
mov r0,#0x9E
|
||||
strb r0,[r1,#2]
|
||||
mov r0,#0x97
|
||||
strb r0,[r1,#3]
|
||||
strh r5,[r1,#4]
|
||||
add r1,#8
|
||||
mov r0,#0x83 //Steak's name
|
||||
strb r0,[r1,#0]
|
||||
mov r0,#0xA4
|
||||
strb r0,[r1,#1]
|
||||
strb r2,[r1,#2]
|
||||
strb r3,[r1,#3]
|
||||
mov r3,#0x9B
|
||||
strb r3,[r1,#4]
|
||||
mov r2,#0xFF
|
||||
strb r5,[r1,#5]
|
||||
strb r2,[r1,#6]
|
||||
add r1,#8
|
||||
mov r0,#0x82 //Rockin's name
|
||||
strb r0,[r1,#0]
|
||||
strb r4,[r1,#1]
|
||||
mov r0,#0x93
|
||||
strb r0,[r1,#2]
|
||||
strb r3,[r1,#3]
|
||||
mov r0,#0x99
|
||||
strb r0,[r1,#4]
|
||||
mov r0,#0x9E
|
||||
strb r0,[r1,#5]
|
||||
strh r5,[r1,#6]
|
||||
mov r2,#1
|
||||
mov r5,#0
|
||||
push {lr}
|
||||
mov r0,#0x7E //Ness' name
|
||||
strb r0,[r1,#0]
|
||||
mov r2,#0x95
|
||||
strb r2,[r1,#1]
|
||||
strb r2,[r1,#0xF]
|
||||
mov r0,#0xA3
|
||||
strb r0,[r1,#2]
|
||||
strb r0,[r1,#3]
|
||||
mov r4,#0xFF
|
||||
lsl r5,r4,#8
|
||||
strh r5,[r1,#4]
|
||||
add r1,#7
|
||||
mov r0,#0x80 //Paula's name
|
||||
strb r0,[r1,#0]
|
||||
strb r0,[r1,#0xE]
|
||||
mov r3,#0x91
|
||||
strb r3,[r1,#1]
|
||||
strb r3,[r1,#4]
|
||||
mov r0,#0xA5
|
||||
strb r0,[r1,#2]
|
||||
mov r0,#0x9C
|
||||
strb r0,[r1,#3]
|
||||
strb r5,[r1,#5]
|
||||
strb r4,[r1,#6]
|
||||
add r1,#7
|
||||
mov r0,#0x7A //Jeff's name
|
||||
strb r0,[r1,#0]
|
||||
mov r0,#0x95
|
||||
strb r0,[r1,#1]
|
||||
mov r0,#0x96
|
||||
strb r0,[r1,#2]
|
||||
strb r0,[r1,#3]
|
||||
strh r5,[r1,#4]
|
||||
add r1,#7
|
||||
strb r4,[r1,#4]
|
||||
mov r4,#0x9F //Poo's name
|
||||
strb r4,[r1,#1]
|
||||
strb r4,[r1,#2]
|
||||
strb r5,[r1,#3]
|
||||
add r1,#7
|
||||
mov r0,#0x7B //King's name
|
||||
strb r0,[r1,#0]
|
||||
mov r0,#0x99
|
||||
strb r0,[r1,#1]
|
||||
mov r0,#0x9E
|
||||
strb r0,[r1,#2]
|
||||
mov r0,#0x97
|
||||
strb r0,[r1,#3]
|
||||
strh r5,[r1,#4]
|
||||
add r1,#8
|
||||
mov r0,#0x83 //Steak's name
|
||||
strb r0,[r1,#0]
|
||||
mov r0,#0xA4
|
||||
strb r0,[r1,#1]
|
||||
strb r2,[r1,#2]
|
||||
strb r3,[r1,#3]
|
||||
mov r3,#0x9B
|
||||
strb r3,[r1,#4]
|
||||
mov r2,#0xFF
|
||||
strb r5,[r1,#5]
|
||||
strb r2,[r1,#6]
|
||||
add r1,#8
|
||||
mov r0,#0x82 //Rockin's name
|
||||
strb r0,[r1,#0]
|
||||
strb r4,[r1,#1]
|
||||
mov r0,#0x93
|
||||
strb r0,[r1,#2]
|
||||
strb r3,[r1,#3]
|
||||
mov r0,#0x99
|
||||
strb r0,[r1,#4]
|
||||
mov r0,#0x9E
|
||||
strb r0,[r1,#5]
|
||||
strh r5,[r1,#6]
|
||||
mov r2,#1
|
||||
mov r5,#0
|
||||
|
||||
pop {pc}
|
||||
pop {pc}
|
||||
|
||||
//==============================================================================
|
||||
//Routine for window headers that fixes the issue character - tiles
|
||||
fix_char_tiles:
|
||||
push {lr}
|
||||
lsl r0,r2,#1
|
||||
lsl r1,r2,#2
|
||||
add r1,r1,r0 //Multiply r2 (character count) by 6
|
||||
lsr r0,r1,#3 //Divide by 8
|
||||
lsl r0,r0,#3 //Re-multiply by 8
|
||||
cmp r0,r1 //Can it stay in r0 pixels? (Was this a division by 8 without remainder?)
|
||||
beq @@next
|
||||
add r0,#8 //If it cannot stay in x tiles, add 1 to the amount of tiles needed
|
||||
|
||||
@@next:
|
||||
lsr r0,r0,#3 //Get the amount of tiles needed
|
||||
cmp r0,r2 //If it's not the same amout as the characters...
|
||||
beq @@end
|
||||
sub r0,r2,r0
|
||||
lsl r0,r0,#1
|
||||
sub r6,r6,r0 //Remove the amount of extra tiles
|
||||
|
||||
@@end:
|
||||
pop {pc}
|
||||
|
||||
//==============================================================================
|
||||
//Specific fix_char_tiles routine - Status window
|
||||
c0b28_fix_char_tiles:
|
||||
push {lr}
|
||||
bl fix_char_tiles
|
||||
ldr r0,[r4,#0] //Clobbered code
|
||||
add r0,#0xB3
|
||||
pop {pc}
|
||||
|
||||
//==============================================================================
|
||||
//Specific fix_char_tiles routine - Give window
|
||||
c009e_fix_char_tiles:
|
||||
push {lr}
|
||||
mov r2,r5
|
||||
bl fix_char_tiles
|
||||
ldr r2,=#0x30051EC //Clobbered code
|
||||
ldrh r0,[r2]
|
||||
pop {pc}
|
||||
|
||||
//==============================================================================
|
||||
//Specific fix_char_tiles routine - Equip window
|
||||
c4bd6_fix_char_tiles:
|
||||
push {lr}
|
||||
mov r6,r7
|
||||
bl fix_char_tiles
|
||||
mov r7,r6
|
||||
ldr r2,=#0x30051EC //Clobbered code
|
||||
ldrh r0,[r2]
|
||||
pop {pc}
|
||||
|
||||
.pool
|
||||
//==============================================================================
|
||||
//Specific fix_char_tiles routine - Outer PSI window
|
||||
c42e0_fix_char_tiles:
|
||||
push {lr}
|
||||
bl fix_char_tiles
|
||||
mov r2,r9 //Clobbered code
|
||||
ldrh r0,[r2,#0]
|
||||
pop {pc}
|
||||
|
||||
//==============================================================================
|
||||
//Specific fix_char_tiles routine - Inner PSI window - part 2
|
||||
c4448_fix_char_tiles:
|
||||
push {lr}
|
||||
bl fix_char_tiles
|
||||
mov r2,r8 //Clobbered code
|
||||
ldrh r0,[r2,#0]
|
||||
pop {pc}
|
||||
|
||||
//==============================================================================
|
||||
//Routine which clears the header and THEN makes it so the string is printed
|
||||
c6190_clean_print:
|
||||
push {lr}
|
||||
push {r0-r3}
|
||||
mov r1,#6 //Number of tiles to clean
|
||||
bl clear_window_header
|
||||
pop {r0-r3}
|
||||
bl 0x80CAB90
|
||||
pop {pc}
|
||||
|
||||
//==============================================================================
|
||||
//Routine which clears the header and THEN makes it so the string is printed
|
||||
c65da_clean_print:
|
||||
push {lr}
|
||||
push {r0-r3}
|
||||
mov r1,#3 //Number of tiles to clean
|
||||
bl clear_window_header
|
||||
pop {r0-r3}
|
||||
bl 0x80CAB90
|
||||
pop {pc}
|
||||
|
||||
//==============================================================================
|
||||
//Routine which clears the header and THEN makes it so the string is printed
|
||||
_0x10_clean_print:
|
||||
push {lr}
|
||||
push {r0-r3}
|
||||
mov r1,#0x10 //Number of tiles to clean
|
||||
bl clear_window_header
|
||||
pop {r0-r3}
|
||||
bl 0x80CAB90
|
||||
pop {pc}
|
||||
|
||||
//==============================================================================
|
||||
//Routine which calls the header clearer and changes the position of Stored Goods in the arrangement
|
||||
c6570_clean_print_change_pos:
|
||||
push {lr}
|
||||
bl _0x10_clean_print
|
||||
ldr r2,=#0x230 //Change starting position
|
||||
mov r0,r2 //Clobbered code
|
||||
ldrh r3,[r4,#0]
|
||||
add r0,r0,r3
|
||||
mov r2,r8
|
||||
ldrh r1,[r2,#0]
|
||||
orr r0,r1
|
||||
mov r2,#0
|
||||
|
||||
@@cycle: //Print 9 tiles in the arrangement
|
||||
lsl r0,r0,#0x10
|
||||
lsr r0,r0,#0x10
|
||||
mov r1,r0
|
||||
add r0,r1,#1
|
||||
strh r1,[r5,#0]
|
||||
add r5,#2
|
||||
add r2,#1
|
||||
cmp r2,#9
|
||||
bne @@cycle
|
||||
|
||||
pop {pc}
|
||||
|
||||
.pool
|
||||
|
||||
//==============================================================================
|
||||
//Routine which gives the address to the party member's inventory
|
||||
get_inventory_selected:
|
||||
push {r3,lr}
|
||||
ldr r0,[r5,#0x1C] //Load source pc
|
||||
lsl r0,r0,#0x10
|
||||
asr r0,r0,#0x10
|
||||
ldr r3,=#0x3001D40 //Get inventory
|
||||
mov r2,#0x6C
|
||||
mul r0,r2
|
||||
add r3,#0x14
|
||||
add r0,r0,r3
|
||||
pop {r3,pc}
|
||||
|
||||
//==============================================================================
|
||||
//Routine which gets the address to the selected party member's inventory and then prints it
|
||||
get_print_inventory_window:
|
||||
push {r0-r4,lr}
|
||||
bl get_inventory_selected
|
||||
mov r1,r0 //Inventory
|
||||
ldr r0,[r4,#0x10] //Window
|
||||
|
||||
ldr r3,=m2_active_window_pc //Change the pc of the window so m2_isequipped can work properly
|
||||
ldr r2,[r3,#0]
|
||||
lsl r2,r2,#0x10
|
||||
asr r2,r2,#0x10
|
||||
push {r2}
|
||||
ldr r2,[r5,#0x1C] //Load source pc
|
||||
lsl r2,r2,#0x10
|
||||
asr r2,r2,#0x10
|
||||
str r2,[r3,#0] //Store it
|
||||
|
||||
mov r2,#0 //No y offset
|
||||
bl goods_print_items //Print the inventory
|
||||
|
||||
pop {r2}
|
||||
ldr r3,=m2_active_window_pc //Restore pc of the window
|
||||
lsl r2,r2,#0x10
|
||||
asr r2,r2,#0x10
|
||||
str r2,[r3,#0]
|
||||
|
||||
pop {r0-r4,pc}
|
||||
|
||||
//==============================================================================
|
||||
//Specific Routine which calls get_print_inventory_window
|
||||
ba48e_get_print_inventory_window:
|
||||
push {lr}
|
||||
push {r4}
|
||||
ldr r4,=#0x3005230
|
||||
bl get_print_inventory_window //Prints old inventory
|
||||
pop {r4}
|
||||
bl 0x80BD7F8 //Copies old arrangements, this includes the highlight
|
||||
pop {pc}
|
||||
|
||||
|
||||
//==============================================================================
|
||||
//Specific Routine which calls get_print_inventory_window
|
||||
ba61c_get_print_inventory_window:
|
||||
push {r5,lr}
|
||||
mov r5,r7
|
||||
bl get_print_inventory_window //Prints old inventory
|
||||
bl 0x80BD7F8 //Copies old arrangements, this includes the highlight
|
||||
pop {r5,pc}
|
||||
|
||||
.pool
|
|
@ -126,7 +126,7 @@
|
|||
810724
|
||||
],
|
||||
"Old": "ばしょ[00 FF]",
|
||||
"New": "To[00 FF]"
|
||||
"New": "To:[00 FF]"
|
||||
},
|
||||
{
|
||||
"OldPointer": 11647572,
|
||||
|
@ -134,7 +134,7 @@
|
|||
813508
|
||||
],
|
||||
"Old": "➨あずかりもの(1)へ[00 FF]",
|
||||
"New": "➨Stored goods(1)[00 FF]"
|
||||
"New": "➨Stored Goods(1)[00 FF]"
|
||||
},
|
||||
{
|
||||
"OldPointer": 11647585,
|
||||
|
@ -143,13 +143,13 @@
|
|||
813768
|
||||
],
|
||||
"Old": "➨あずかりもの(2)へ[00 FF]",
|
||||
"New": "➨Stored goods(2)[00 FF]"
|
||||
"New": "➨Stored Goods(2)[00 FF]"
|
||||
},
|
||||
{
|
||||
"OldPointer": 11647598,
|
||||
"PointerLocations": [],
|
||||
"Old": "➨あずかりもの(3)へ[00 FF]",
|
||||
"New": "➨Stored goods(3)[00 FF]"
|
||||
"New": "➨Stored Goods(3)[00 FF]"
|
||||
},
|
||||
{
|
||||
"OldPointer": 11647611,
|
||||
|
@ -157,6 +157,6 @@
|
|||
812788
|
||||
],
|
||||
"Old": "あずかりもの[00 FF]",
|
||||
"New": "Stored goods[00 FF]"
|
||||
"New": "Stored Goods[00 FF]"
|
||||
}
|
||||
]
|
Loading…
Reference in New Issue