Merge pull request #121 from Lorenzooone/ImproveThe
Improve translatability of the "The " solution
This commit is contained in:
commit
06da3b3237
|
@ -34,6 +34,44 @@ void clear_rect_file(int x, int y, int width, int height, int pixels, unsigned s
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void set_background_loaded_names()
|
||||||
|
{
|
||||||
|
set_names_to_default_background(THING_NAME_LENGTH,
|
||||||
|
set_names_to_default_background(FOOD_NAME_LENGTH,
|
||||||
|
set_names_to_default_background(DOG_NAME_LENGTH,
|
||||||
|
set_names_to_default_background(POO_NAME_LENGTH,
|
||||||
|
set_names_to_default_background(JEFF_NAME_LENGTH,
|
||||||
|
set_names_to_default_background(PAULA_NAME_LENGTH,
|
||||||
|
set_names_to_default_background(NESS_NAME_LENGTH, pc_names)))))));
|
||||||
|
}
|
||||||
|
|
||||||
|
byte* set_names_to_default_background(int maxLetters, byte *source)
|
||||||
|
{
|
||||||
|
//Reads a name and sets the bytes after it to a fixed value
|
||||||
|
int i = 0;
|
||||||
|
while(i < maxLetters + 2 && (*source) != 0xFF)
|
||||||
|
{
|
||||||
|
source++;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
source++;
|
||||||
|
i++;
|
||||||
|
for(; i < maxLetters + 2; i++)
|
||||||
|
*(source++) = 0;
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
|
||||||
|
void copy_name_perm_mem(int maxLetters, byte *source, byte *destination)
|
||||||
|
{
|
||||||
|
//Copies the names to perm memory, but also makes the background of them a fixed value
|
||||||
|
for(int i = 0; i < maxLetters + 2; i++)
|
||||||
|
destination[i] = 0;
|
||||||
|
byte *finalSource = source + maxLetters;
|
||||||
|
while(source < finalSource && (*source) != 0xFF)
|
||||||
|
(*destination++) = (*source++);
|
||||||
|
*(destination + 1) = 0xFF;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned short* getTilesetDest(int window_selector, int *width)
|
unsigned short* getTilesetDest(int window_selector, int *width)
|
||||||
{
|
{
|
||||||
int *tilesetBasePtr = (int *)(0x82B79B4 + (window_selector * 20));
|
int *tilesetBasePtr = (int *)(0x82B79B4 + (window_selector * 20));
|
||||||
|
|
|
@ -4,6 +4,14 @@
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "vwf.h"
|
#include "vwf.h"
|
||||||
|
|
||||||
|
#define NESS_NAME_LENGTH 5
|
||||||
|
#define PAULA_NAME_LENGTH 5
|
||||||
|
#define JEFF_NAME_LENGTH 5
|
||||||
|
#define POO_NAME_LENGTH 5
|
||||||
|
#define DOG_NAME_LENGTH 6
|
||||||
|
#define FOOD_NAME_LENGTH 6
|
||||||
|
#define THING_NAME_LENGTH 6
|
||||||
|
|
||||||
typedef struct FILE_SELECT {
|
typedef struct FILE_SELECT {
|
||||||
short status; // 0 = used, -1 = empty
|
short status; // 0 = used, -1 = empty
|
||||||
short slot; // 0-2
|
short slot; // 0-2
|
||||||
|
@ -31,6 +39,9 @@ typedef struct FILE_SELECT {
|
||||||
int get_tile_number_file_select(int x, int y);
|
int get_tile_number_file_select(int x, int y);
|
||||||
void clear_tile_file(int x, int y, int pixels);
|
void clear_tile_file(int x, int y, int pixels);
|
||||||
void clear_rect_file(int x, int y, int width, int height, int pixels, unsigned short *tilesetDestPtr);
|
void clear_rect_file(int x, int y, int width, int height, int pixels, unsigned short *tilesetDestPtr);
|
||||||
|
void set_background_loaded_names();
|
||||||
|
byte* set_names_to_default_background(int maxLetters, byte *source);
|
||||||
|
void copy_name_perm_mem(int maxLetters, byte *source, byte *destination);
|
||||||
unsigned short* getTilesetDest(int window_selector, int *width);
|
unsigned short* getTilesetDest(int window_selector, int *width);
|
||||||
unsigned short getPaletteFromFileWindow(int x, int y, int window_selector);
|
unsigned short getPaletteFromFileWindow(int x, int y, int window_selector);
|
||||||
void setPaletteToFileWindow(int x, int y, int window_selector, unsigned short palette);
|
void setPaletteToFileWindow(int x, int y, int window_selector, unsigned short palette);
|
||||||
|
|
|
@ -994,6 +994,18 @@ pop {r4,pc}
|
||||||
// Update musical note value (for Ness' Nightmare)
|
// Update musical note value (for Ness' Nightmare)
|
||||||
.org 0x80DAF12 :: cmp r0,0xAC
|
.org 0x80DAF12 :: cmp r0,0xAC
|
||||||
|
|
||||||
|
//---------------------------------------------------------
|
||||||
|
// Name setup hacks (improves the "The" fix and makes it portable)
|
||||||
|
//---------------------------------------------------------
|
||||||
|
.org 0x80020AE :: bl copy_name_perm_mem
|
||||||
|
.org 0x80020BE :: bl copy_name_perm_mem
|
||||||
|
.org 0x80020CE :: bl copy_name_perm_mem
|
||||||
|
.org 0x80020DE :: bl copy_name_perm_mem
|
||||||
|
.org 0x80020EE :: bl copy_name_perm_mem
|
||||||
|
.org 0x80020FE :: bl copy_name_perm_mem
|
||||||
|
.org 0x800210E :: bl copy_name_perm_mem
|
||||||
|
.org 0x800215A :: bl _215a_load_names
|
||||||
|
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
// BEB6C hacks (Goods inner menu)
|
// BEB6C hacks (Goods inner menu)
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
|
|
|
@ -971,6 +971,14 @@ add r0,r0,r7
|
||||||
bx lr
|
bx lr
|
||||||
.pool
|
.pool
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
//Sets the names' background to a default
|
||||||
|
_215a_load_names:
|
||||||
|
push {lr}
|
||||||
|
bl 0x8012460
|
||||||
|
bl set_background_loaded_names
|
||||||
|
pop {pc}
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
// Add a space between enemy name and letter in multi-enemy fights for the selection window. Called only by enemies.
|
// Add a space between enemy name and letter in multi-enemy fights for the selection window. Called only by enemies.
|
||||||
dcd00_enemy_letter:
|
dcd00_enemy_letter:
|
||||||
|
@ -1183,29 +1191,36 @@ add r2,#1
|
||||||
ldrb r0,[r1,r2]
|
ldrb r0,[r1,r2]
|
||||||
cmp r0,#1 //Does this string have the the flag? If it does not, then proceed to the end
|
cmp r0,#1 //Does this string have the the flag? If it does not, then proceed to the end
|
||||||
bne @@end
|
bne @@end
|
||||||
ldr r2,=0x50959884 //Does this string have "The "? If it does, check if it ends instantly.
|
ldr r2,=0x50959884 //"The "
|
||||||
ldr r0,[r1,#0]
|
ldr r0,[r1,#0]
|
||||||
cmp r0,r2
|
sub r2,r0,r2
|
||||||
beq @@next_found_the
|
cmp r2,#0
|
||||||
sub r0,r0,r2 //Does this string have "the "? If it does not, then it's a character. Proceed to the end.
|
beq @@next_found_the //Does this string have "The "? If it does, proceed accordingly
|
||||||
cmp r0,#0x20
|
cmp r2,#0x20
|
||||||
bne @@end
|
beq @@next_found_the //Does this string have "the "? If it does, proceed accordingly
|
||||||
|
|
||||||
|
//For the other languages: add the other things to compare to here...? Maybe you can do it in a smarter way though...
|
||||||
|
|
||||||
|
//No articles found. Go to the end
|
||||||
|
b @@end
|
||||||
|
|
||||||
@@next_found_the: //A starting "The " or "the " has been found
|
@@next_found_the: //A starting "The " or "the " has been found
|
||||||
mov r2,#0xFF
|
//Assumes the uppercase and lowercase characters are 0x20 apart
|
||||||
lsl r2,r2,#8 //r2 has 0xFF00
|
|
||||||
ldrh r0,[r1,#4] //Load the next two bytes after "The " or "the "
|
|
||||||
cmp r0,r2 //If they're the same as r2, then it's a character. End this here.
|
|
||||||
beq @@end
|
|
||||||
ldr r0,=m2_cstm_last_printed
|
ldr r0,=m2_cstm_last_printed
|
||||||
ldrb r0,[r0,#0]
|
ldrb r0,[r0,#0]
|
||||||
cmp r0,#0x70 //Is the previous character an @?
|
cmp r0,#0x70 //Is the previous character an @?
|
||||||
beq @@Maius
|
beq @@Upper
|
||||||
mov r0,#0xA4 //Change The to the
|
|
||||||
|
mov r0,#0x20
|
||||||
|
sub r2,r0,r2 //Is this "t"? If it is, this will be 0. Otherwise, it will be 0x20
|
||||||
|
ldr r0,[r1,#0]
|
||||||
|
add r0,r0,r2 //Ensure it is the
|
||||||
strb r0,[r1,#0]
|
strb r0,[r1,#0]
|
||||||
b @@end
|
b @@end
|
||||||
@@Maius:
|
|
||||||
mov r0,#0x84 //Ensure it is The
|
@@Upper:
|
||||||
|
ldr r0,[r1,#0]
|
||||||
|
sub r0,r0,r2 //Ensure it is The
|
||||||
strb r0,[r1,#0]
|
strb r0,[r1,#0]
|
||||||
|
|
||||||
@@end:
|
@@end:
|
||||||
|
|
Loading…
Reference in New Issue