
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; 
;;; Some txt Patches to JAPAN Version to print bi(u)g text smaller
;;; 

.open "1_IS/BIN/SLPS_021.00", 0x8000F800

;Text speed patch (0 - show all text(!!!) - 4 - Normal (Pressed Button - 1))
;.org 0x8001bfd4
;    li r5,0
    ;move a0,s0                     ;Original Code


; Main Bigfont size between letters for special codes
;.org 0x8001957c
;    addiu v0,v0,0x6

;calcNextX Routine (calc X in line after command)
;.org 0x8001af38
;    sll r2,r3,2h        ; Its Original - Custom in custom routine

;dialog start line tabulation
;.org 0x8007b195
;    .byte 0x4 ;pixels


;;;;;;;;;;;;;;;;;;;;;;;;Print Routines Calls Replacing

    ;main dialog calls from PrintProgramText Routine
;.org 0x8001c398
;    jal ExternalPrint               
;.org 0x8001c40c
 ;   jal ExternalPrint

    ;Selection Menu Calls
;.org 0x8001d058
;    jal ExternalPrint               
;.org 0x8001d0d8
 ;   jal ExternalPrint

    ;printPlaneTEXT (PlayerName, etc...)
;.org 0x8001c688
 ;   jal ExternalPrint



    ;custom CheckCharNumToLineEnd for proper Complex Lines Read (charcountread)
.org 0x8001aef4
    j ReturnCharsInString              ;custom routine
    clear v1
    ;j 0x8001af00                        ;original code

    ;calcnextX Custom
    
.org 0x8001af1c
   ; addiu sp,sp,-0x18                   ;Original Code
   ; sw ra,0x10(sp)
    j calcnextXCustom                     ;PATCHED
    nop

.close



; COnfiguration Menu Strings Calls
.open "1_IS/BIN/1096_J_MENU_Settings_Code.bin", 0x800A2000

.org 0x800a2658
li a1,0x5c
.org 0x800a2678
jal ExternalPrint                   ;CONFIGURATION MENU & X Coord
.org 0x800a2690
jal 0x8001afc0                   ;OOOOOPS :))))


.org 0x800a26ac
jal ExternalPrint
.org 0x800a26e8
jal ExternalPrint
.org 0x800a298c
jal ExternalPrint
.org 0x800a29b8
jal ExternalPrint
.org 0x800a29f4
jal ExternalPrint
.org 0x800a2a44
jal ExternalPrint
.org 0x800a2d20
jal ExternalPrint
.org 0x800a2d4c
jal ExternalPrint
.org 0x800a2d7c
jal ExternalPrint
.org 0x800a3090
jal ExternalPrint
.org 0x800a30cc
jal ExternalPrint
.org 0x800a35ac
jal ExternalPrint
.org 0x800a35e0
jal ExternalPrint
.org 0x800a3624
jal ExternalPrint
.org 0x800a3658
jal ExternalPrint
.org 0x800a369c
jal ExternalPrint
.org 0x800a36d0
jal ExternalPrint
.org 0x800a3704
jal ExternalPrint
.org 0x800a3734
jal ExternalPrint
.org 0x800a3ba8
jal ExternalPrint
.org 0x800a3bdc
jal ExternalPrint
.org 0x800a3c20
jal ExternalPrint
.org 0x800a3c4c
jal ExternalPrint
.org 0x800a3c90
jal ExternalPrint
.org 0x800a3cbc
jal ExternalPrint
.org 0x800a4310
jal ExternalPrint
.org 0x800a435c
jal ExternalPrint

.close


; CITY PATCHES!

.open "1_IS/BIN/1119_CITY_CODE_patched_2023.bin", 0x800AB000

;IN 1119 - 800AD320 (offs 8992) - need to 0,0,0,0 (its shift left 0x1) x3 instead x6 - Text and rect coord
;OVERALL X LEFT SHIFT!!!
;.org 0x800ad320C:\Downloads\PSX
;nop

     ;'800AD328 need  to 64 instead 128 (text pixels wide x2 instead x4) - rect X WIDE 
;.org 0x800ad328
;sll a1,0x1
 ;'800AD360 (offs 9056)- need 5 instead 6 - pixels for X-offset text from start of rect
;.org 0x800ad360
;addiu a1,a1,0x5


;check lenght for hiuse names for overallcoords calc
.org 0x800ad30c
jal RetunCharsToCity


;checklenghth for housename RECT
.org 0x800ad3ac
jal RetunCharsToCity


.org 0x800af1dc
;jal RetunCharsToCityDiv2 ;OR ReturnCharsInString
jal 0x8001af1c


.close

;.org 0x800ad380
;jal ExternalPrint
;.org 0x800ad400
;jal ExternalPrint
;.org 0x800b2008
;jal ExternalPrint
;.org 0x800b21b8
;jal ExternalPrint
;.org 0x800b2278
;jal ExternalPrint

;district select windows
;.org 0x800b1af0
;    .byte 0x12
;.org 0x800b1afc
;    .byte 0x08

;.org 0x800b1c3f
 ;   .byte 0x00

;.org 0x800b1c68
 ;   .byte 0x4a
;.org 0x800b1ca8
;    .byte 0x4a
;.org 0x800b1d4c
;    .byte 0x4a
;.org 0x800b1d94
;    .byte 0x4a
;.org 0x800b1dc0
;    .byte 0x4a

;.org 0x800b8d3c
    ;City Districts Table with pointers Here


;BATTLE CUSTOM NAME RENDERING REDIRECT
.open "1_IS/BIN/0001_BATTLE_CODE.bin", 0x800AB000


.org 0x800ca0f0

;ORIGINAL
    ; jal 0x8001aef4
    ; move  a0, s3          //a0 - адрес имени

    j customNameRender
    move  a0, s3

.close