Equip notes, itoa fix
This commit is contained in:
parent
e1d10d43fc
commit
5b8f56b531
|
@ -76,7 +76,14 @@ English names:
|
|||
0x3002504: shadow of 0x3002500? delayed by one frame maybe?
|
||||
0x30051EC: tile offset (usually 0x100)
|
||||
0x30051F0: flag? gets set to 1 when you change rooms, goes back to 0 the first time you open a text window
|
||||
0x3005224: menu depth
|
||||
0x3005224: menu sub-state
|
||||
- Equip:
|
||||
- 01: character select
|
||||
- 02: slot select
|
||||
- 03: Weapon select
|
||||
- 04: Body select
|
||||
- 05: Arms select
|
||||
- 06: Other select
|
||||
0x3005228: current text palette, << 0xC
|
||||
0x3005230: addresses of all 11 windows
|
||||
[00]: A menu
|
||||
|
@ -168,6 +175,11 @@ Subroutines
|
|||
(does not modify any window values)
|
||||
80C980C: print next character (r0: window pointer)
|
||||
80CA4BC: scroll text upwards (r0: window pointer)
|
||||
80CA65C: format a number as a string (does not write [00 FF])
|
||||
r0: number
|
||||
r1: output string buffer
|
||||
r2: limit to r2 decimal digits (will clip to 10^r2 - 1)
|
||||
returns: -1 if clipped, 0 otherwise
|
||||
80CA744: store the lowest r2 (e.g. 7) decimal digits of r0 as an array to r1; return position of highest non-zero digit
|
||||
80CAB90: print window header string (r1) to RAM (r0) at tile ((r2 * 32) + r3)
|
||||
80CABF8: print checkboard string (r1) to RAM (r0) at tile ((r2 * 32) + r3)
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
// Equip window state machine (runs every frame)
|
||||
// No parameters
|
||||
// Returns -1 if B/select pressed, 0 otherwise
|
||||
|
||||
080BAEF8 (T) push r4-r7,r14 ;9 319
|
||||
080BAEFA (T) mov r7,r10 ;2 321
|
||||
080BAEFC (T) mov r6,r9 ;2 323
|
||||
|
@ -13,20 +17,26 @@
|
|||
080BAF10 (T) ldr r0,[r2] ;9 371
|
||||
080BAF12 (T) add r0,r0,r1 ;2 373
|
||||
080BAF14 (T) mov r7,r0 ;2 375
|
||||
080BAF16 (T) add r7,10h ;2 377
|
||||
080BAF18 (T) ldr r0,=3005224h ;9 386
|
||||
080BAF16 (T) add r7,10h ;2 377 r7 points to a buffer
|
||||
; r7+0x12 is a 6-byte buffer for formatted offense/defense strings
|
||||
080BAF18 (T) ldr r0,=3005224h ;9 386 menu sub-state
|
||||
080BAF1A (T) ldrh r0,[r0] ;4 390
|
||||
080BAF1C (T) sub r0,1h ;2 392
|
||||
080BAF1E (T) lsl r0,r0,10h ;2 394
|
||||
080BAF20 (T) asr r0,r0,10h ;2 396
|
||||
080BAF22 (T) cmp r0,5h ;2 398
|
||||
080BAF24 (T) bls 80BAF2Ah ;8 406
|
||||
|
||||
// If substate-1 > 5, return 0
|
||||
080BAF26 (T) bl 80BBEC6h ;10 416
|
||||
|
||||
// Jump table
|
||||
080BAF2A (T) lsl r0,r0,2h ;2 418
|
||||
080BAF2C (T) ldr r1,=80BAF44h ;9 427
|
||||
080BAF2E (T) add r0,r0,r1 ;2 429
|
||||
080BAF30 (T) ldr r0,[r0] ;4 433
|
||||
080BAF32 (T) mov r15,r0 ;2 435
|
||||
|
||||
080BAF34 (T) cmp r2,30h ;2 437
|
||||
080BAF36 (T) lsl r0,r0,0Ch ;2 439
|
||||
080BAF38 (T) mov r5,70h ;2 441
|
||||
|
@ -47,6 +57,12 @@
|
|||
080BAF56 (T) lsr r3,r1,20h ;2 484
|
||||
080BAF58 (T) ???? ;0 484
|
||||
080BAF5A (T) lsr r3,r1,20h ;2 486
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// Substate 1 (character select)
|
||||
080BAF5C (T) ldr r6,=3005230h ;9 495
|
||||
080BAF5E (T) ldr r0,[r6,18h] ;4 499
|
||||
080BAF60 (T) bl 80C4EB0h ;10 509
|
||||
|
@ -135,6 +151,12 @@
|
|||
080BB01E (T) lsr r1,r6,2h ;2 870
|
||||
080BB020 (T) strh r4,[r4,r1] ;5 875
|
||||
080BB022 (T) lsl r0,r0,0Ch ;2 877
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// Substate 2 (slot select)
|
||||
080BB024 (T) ldr r2,=3005230h ;9 886
|
||||
080BB026 (T) mov r9,r2 ;2 888
|
||||
080BB028 (T) ldr r0,[r2,18h] ;9 897
|
||||
|
@ -398,6 +420,12 @@
|
|||
080BB262 (T) lsr r1,r6,2h ;2 2040
|
||||
080BB264 (T) strb r4,[r4,10h] ;5 2045
|
||||
080BB266 (T) lsr r1,r6,2h ;2 2047
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// Substate 3 (Weapon select)
|
||||
080BB268 (T) ldr r2,=3005230h ;9 2056
|
||||
080BB26A (T) mov r9,r2 ;2 2058
|
||||
080BB26C (T) ldr r0,[r2,10h] ;9 2067
|
||||
|
@ -949,6 +977,12 @@
|
|||
080BB726 (T) lsl r0,r0,0Ch ;2 4460
|
||||
080BB728 (T) strh r0,[r6,r0] ;5 4465
|
||||
080BB72A (T) lsl r0,r0,0Ch ;2 4467
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// Substate 4 (Body select)
|
||||
080BB72C (T) ldr r2,=3005230h ;9 4476
|
||||
080BB72E (T) ldr r0,[r2,10h] ;9 4485
|
||||
080BB730 (T) bl 80C5500h ;10 4495
|
||||
|
@ -1091,6 +1125,12 @@
|
|||
080BB856 (T) lsl r0,r0,0Ch ;2 5066
|
||||
080BB858 (T) strh r0,[r6,r0] ;5 5071
|
||||
080BB85A (T) lsl r0,r0,0Ch ;2 5073
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// Substate 5 (Arms select)
|
||||
080BB85C (T) ldr r2,=3005230h ;9 5082
|
||||
080BB85E (T) ldr r0,[r2,10h] ;9 5091
|
||||
080BB860 (T) bl 80C5500h ;10 5101
|
||||
|
@ -1233,6 +1273,12 @@
|
|||
080BB986 (T) lsl r0,r0,0Ch ;2 5672
|
||||
080BB988 (T) strh r0,[r6,r0] ;5 5677
|
||||
080BB98A (T) lsl r0,r0,0Ch ;2 5679
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
// Substate 6 (Other select)
|
||||
080BB98C (T) ldr r2,=3005230h ;9 5688
|
||||
080BB98E (T) ldr r0,[r2,10h] ;9 5697
|
||||
080BB990 (T) bl 80C5500h ;10 5707
|
||||
|
|
|
@ -301,6 +301,7 @@ b 0x80C9144
|
|||
// Integer-to-char changes
|
||||
.org 0x80CA67C :: mov r3,0x50 // space
|
||||
.org 0x80CA69C :: mov r2,0x60 // zero
|
||||
.org 0x80CA6DC :: mov r2,0x69 // nine
|
||||
.org 0x80CA78A :: mov r0,0x60 // zero
|
||||
.org 0x80CA7AC :: mov r2,0x69 // nine
|
||||
.org 0x80CA7EC :: sub r1,0xA0
|
||||
|
@ -862,6 +863,7 @@ m2_enemy_attributes:
|
|||
.definelabel m2_printstr_hlight ,0x80C96F0
|
||||
.definelabel m2_printnextch ,0x80C980C
|
||||
.definelabel m2_scrolltext ,0x80CA4BC
|
||||
.definelabel m2_formatnumber ,0x80CA65C
|
||||
.definelabel m2_clearwindowtiles ,0x80CA834
|
||||
.definelabel m2_menuwindow ,0x80C1C98
|
||||
.definelabel m2_resetwindow ,0x80BE490
|
||||
|
|
Loading…
Reference in New Issue