city coords calculation

This commit is contained in:
sShemet
2025-11-25 10:59:13 +05:00
parent 4d739ba8fb
commit 241d0a2f65
5 changed files with 118 additions and 1 deletions

BIN
2_EP/BIN/0721_CITYCODE.bin Normal file

Binary file not shown.

View File

@@ -0,0 +1,11 @@
00000000 0
8001A3A8 printbigdmatext
8001B110 initcopycharchain
8001B2A8 makeshadowsmallchar
8001C0B4 storecolor
800578FC setdrawtpage
800C4700 getnewchar
800C4704 startreading
800C4720 retuncharstocity
800C473C ismy1bytecity


View File

@@ -0,0 +1,42 @@
; 1 file included
; 68 lines
; 9 labels
; 0 equations
; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm
FFFFFFFF .psx ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 9
800578FC setdrawtpage: ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 12
8001C0B4 storecolor: ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 13
8001B110 initcopycharchain: ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 14
8001B2A8 makeshadowsmallchar: ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 15
8001A3A8 printbigdmatext: ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 16
FFFFFFFF .open ""C:\\Users\\Sergey\\Documents\\GitHub\\Persona2-PSX-asm-sources\\2_EP\\BIN\\0721_CITYCODE.bin"",0x800AB000; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 19
800AB000 .org 0x800C4700 ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 21
800C4700 getnewchar: ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 22
800C4700 addiu v1,v1,0x1 ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 23
800C4704 startreading: ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 24
800C4704 lhu v0,0x0(a0) ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 25
800C4708 nop ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 26
800C470C sltiu v0,v0,0x1000 ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 27
800C4710 bne v0,zero,0x800C4700 ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 28
800C4714 addiu a0,a0,0x2 ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 29
800C4718 jr ra ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 30
800C471C move v0,v1 ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 31
800C4720 retuncharstocity: ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 34
800C4720 lhu v0,0x0(a0) ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 35
800C4724 nop ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 36
800C4728 srl v0,v0,0xD ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 37
800C472C bne v0,zero,0x800C473C ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 38
800C4730 clear v1 ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 39
800C4734 j 0x800C4704 ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 41
800C4738 nop ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 42
800C473C ismy1bytecity: ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 43
800C473C lhu v0,0x0(a0) ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 44
800C4740 nop ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 45
800C4744 andi v0,v0,0xFF ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 46
800C4748 jr ra ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 47
800C474C move v1,v0 ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 48
800C4750 .org 0x800AD688 ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 58
800AD688 jal 0x800C4720 ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 59
800AD68C .close ; C:\Users\Sergey\Documents\GitHub\Persona2-PSX-asm-sources\2_EP\EP_city_calcs.asm line 66

60
2_EP/EP_city_calcs.asm Normal file
View File

@@ -0,0 +1,60 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Persona 2 Eternal Punishment (PSX) JAP / Custom Characters/Data Patch
// Author: Sergey Shemet 21/11/2025
//
// v 1.0 - Patch for city text coords calculations
//
.psx
.open "2_EP/BIN/0721_CITYCODE.bin", 0x800AB000
.org 0x800c4700
GetNewChar:
addiu v1,v1,1
StartReading:
lhu v0,0x0(a0) ;a0 - curTextAddr
nop
sltiu v0,v0,0x1000
bne v0,zero,GetNewChar ;if currentChar<1000 - goto next addr+2b
addiu a0,a0,2
jr ra
move v0,v1 ;return v0,v1 - charsNum
RetunCharsToCity:
lhu v0,0x0(a0)
nop
srl v0,v0,0xD ;;;;Check 13th bit (1byte system !!!)
bne v0,zero,IsMy1byteCity
clear v1 ;v1 = charCount
j StartReading
nop
IsMy1byteCity:
lhu v0,0x0(a0)
nop
andi v0,v0,0xff ;Clear from cmd flag
jr ra
move v1,v0 ;return v0,v1 - charsNum
;check lenght for hiuse names for overallcoords calc
;.org 0x800ad30c
;jal RetunCharsToCity
;checklenghth for housename RECT
.org 0x800ad688
jal RetunCharsToCity
;.org 0x800af1dc
;jal RetunCharsToCityDiv2 ;OR ReturnCharsInString
;jal 0x8001af1c
.close
// compile with ./armips -sym 2_EP/BUILD_LOGS/0721_CITY.map -temp 2_EP/BUILD_LOGS/0721_CITY.txt 2_EP/EP_city_calcs.asm

View File

@@ -128,7 +128,9 @@ Custom regs:
s8 - chunk block index (cpu2vram) s8 - chunk block index (cpu2vram)
- новая система вывода текста (отказ от посимвольного вывода)
IS 1.2
+ новая система вывода текста (отказ от посимвольного вывода)
- splash screen переводчика - splash screen переводчика
+ имя в боёвке + имя в боёвке
- описания статов персон/демонов (блок!) - описания статов персон/демонов (блок!)
@@ -146,6 +148,8 @@ Custom regs:
- аэшма суммон + название - аэшма суммон + название
- перебрать все локации в данжах - перебрать все локации в данжах
- распаковать файлы общения с демонами - распаковать файлы общения с демонами
- Стратегия -> Тактика
- Протестировать все тексты + общение
- ПЕРЕСОБРАТЬ ОБРАЗ xml2iso! - ПЕРЕСОБРАТЬ ОБРАЗ xml2iso!