Move stuff around in order to make space for the code

This commit is contained in:
Lorenzooone 2019-09-04 20:07:04 +02:00
parent 248f054ebf
commit cb1218d7c0
7 changed files with 21 additions and 17 deletions

View File

@ -19,7 +19,7 @@ $input_c_files =
"src/c/status.c",
"src/c/psi.c"
$base_c_address = 0x8100000;
$base_c_address = 0x83755B8;
$scripttool_cmd = "bin/ScriptTool/ScriptTool.dll"
$gcc_cmd = "arm-none-eabi-gcc"
$ld_cmd = "arm-none-eabi-ld"

View File

@ -94,6 +94,7 @@ void psiTargetWindow_buffer(byte target)
PSIPrintInfo *printInfo = &(psi_print_info[target - 1]);
byte *string_group1 = (byte*)(0x8B204E4);
byte extract = (printInfo->PSIID);
byte *baseStrPointer = (byte*)(&psitext);
byte value = 0;
byte value2 = 0;
byte *str = 0;
@ -103,10 +104,10 @@ void psiTargetWindow_buffer(byte target)
value = (value * 0x64);
value2 = (*(string_group1 + (printInfo->PSIPrintInfoID * 12) + 1));
value2 = (value2 * 0x14);
str = (byte*)(0x8B74390 + value + value2); //It doesn't use the pointer to the description the struct has but it obtains it like this...
str = baseStrPointer + (0x11 * 0x14) + value + value2; //It doesn't use the pointer to the description the struct has but it obtains it like this...
}
else
str = (byte*)(0x8B74390);
str = baseStrPointer + (0x11 * 0x14);
printstr_hlight_buffer(window, str, 0, 0, 0);
str = m2_strlookup((int*)0x8B17EE4, (byte*)0x8B17424, 0x1B);
@ -123,12 +124,13 @@ void psiTargetWindow_buffer(byte target)
void psiPrint_buffer(byte value, WINDOW* window, bool printPSILine, PSIPrintInfo *printInfo)
{
byte *str = 0;
byte *baseStrPointer = (byte*)(&psitext);
byte (*possibleTargets)[3][4] = (byte(*)[3][4])cursorValues;
if(printPSILine)
{
byte PSIID = printInfo->PSIID;
str = (byte*)(0x8B74228 + (PSIID * 0x14));
str = baseStrPointer + ((PSIID - 1) * 0x14);
printstr_hlight_buffer(window, str, 0, printInfo->YPrinting << 1, 0);
if(PSIID == 1)
{

View File

@ -44,5 +44,6 @@ int PSITargetInput(WINDOW* window);
extern PSIPrintInfo m2_psi_print_table[];
extern int psitext;
#endif

View File

@ -1 +0,0 @@
Ñ*A+a+}++Ñ*Ñ*Ñ*Ñ*Á+Í+á+õ+%,9,M,a,E2u,Y2<08>,Ñ*Ñ*™,Ñ*Ñ*Ñ*­,Ñ*Ý1Ý7i/¥;m<±*™*

Binary file not shown.

View File

@ -1237,12 +1237,6 @@ nop
//.org 0x80BD9F6 :: mov r2,#0x16 //Jeff
//.org 0x80BDA02 :: mov r2,#0x1B //Poo
//==============================================================================
// Fix functions table
//==============================================================================
.org 0x80F2B30 :: dw m2_functions_table
//==============================================================================
// File select hacks
//==============================================================================
@ -1390,6 +1384,13 @@ nop
//Choose character table based on alphabet loaded in
.org 0x80C7578 :: bl c7578_load_letters
//==============================================================================
// Move stuff around in order to make space for the code
//==============================================================================
.org 0x82D92D4 :: dw moved_graphics_table :: dw moved_graphics_table + 0x1CD2C
.org 0x82D9BBC :: dw moved_graphics_table + 0x26618 :: dw moved_graphics_table + 0x3F818
//==============================================================================
// Data files
//==============================================================================
@ -1495,8 +1496,8 @@ flyovertextLater:
m2_coord_table_file:
.incbin "data/m2-coord-table-file-select.bin"
m2_functions_table:
.incbin "data/m2-functions-table.bin"
moved_graphics_table:
.incbin "data/moved-graphics-table.bin"
//==============================================================================

View File

@ -433,7 +433,7 @@ namespace ScriptTool
static void CompileM12()
{
int baseAddress = 0xB80000;
int baseAddress = 0xC10000;
int referenceAddress = baseAddress;
var buffer = new List<byte>();
@ -495,7 +495,7 @@ namespace ScriptTool
static void CompileM12Misc()
{
int referenceAddress = 0xB70000;
int referenceAddress = 0xC00000;
// Item names
CompileM12MiscStringCollection("m12-itemnames", ref referenceAddress);
@ -527,10 +527,11 @@ namespace ScriptTool
IncludeFile.WriteLine();
IncludeFile.WriteLine("// Fix pointers to \"PSI \"");
IncludeFile.WriteLine(".definelabel psitext, 0x{0:X8}", psiPointer | 0x8000000);
foreach (var address in updateAddresses)
{
IncludeFile.WriteLine(String.Format(".org 0x{0:X} :: dw 0x{1:X8}",
address | 0x8000000, psiPointer | 0x8000000));
IncludeFile.WriteLine(String.Format(".org 0x{0:X} :: dw psitext",
address | 0x8000000));
}
// PSI targets