2017-03-07 22:12:52 +00:00
|
|
|
General notes
|
|
|
|
=============
|
|
|
|
|
|
|
|
Font palette:
|
|
|
|
- Standard text windows: 0x4 = background, 0xF = foreground
|
|
|
|
- File select/setup windows: 0x1 = background, 0x9 = foreground
|
|
|
|
|
|
|
|
Hard-coded characters:
|
|
|
|
- 0xFD: bullet (tile 0x1DD)
|
|
|
|
- 0xFE: equip (tile 0x1DE)
|
|
|
|
- Null (tile 0x1DF)
|
|
|
|
- Background (tile 0x1FF)
|
|
|
|
|
2017-03-13 17:52:11 +00:00
|
|
|
0x3000A00: Current PSI list when displaying a PSI window?
|
|
|
|
0x3001F6A: Ness PSI flags?
|
|
|
|
0x01: Teleport alpha
|
|
|
|
0x08: Teleport beta
|
2017-03-07 22:12:52 +00:00
|
|
|
0x30051EC: tile offset (usually 0x100)
|
|
|
|
0x3005228: current text palette, << 0xC
|
|
|
|
0x3005230: addresses of all 11 windows
|
2017-03-13 17:52:11 +00:00
|
|
|
[00]: A menu
|
|
|
|
[01]: Money
|
|
|
|
[02]: ?
|
|
|
|
[03]: Action subject ("Who?", etc.)
|
|
|
|
[04]: New equipment selection
|
|
|
|
[05]: Offense/Defense
|
|
|
|
[06]: Equip
|
|
|
|
[07]: PSI list
|
|
|
|
[08]: PSI classes
|
|
|
|
[09]: PSI target/PP cost
|
|
|
|
[0A]: PSI help
|
2017-03-11 04:43:04 +00:00
|
|
|
0x3005264: active window party member
|
2017-03-07 22:12:52 +00:00
|
|
|
0x3005270: address of tilemap start in WRAM, can use this to figure out X and Y
|
|
|
|
|
2017-03-09 05:36:24 +00:00
|
|
|
LDRB Rx,[Ry,#n]: n has range 0-31 (0x0-0x1F)
|
|
|
|
LDRH Rx,[Ry,#n]: n has range 0-62 (0x0-0x3E)
|
|
|
|
LDR Rx,[Ry,#n]: n has range 0-124 (0x0-0x7C) (0-1020 for SP- and PC-relative)
|
2017-03-07 22:12:52 +00:00
|
|
|
|
2017-03-09 06:04:02 +00:00
|
|
|
Custom WRAM: 2027FC0
|
|
|
|
|
2017-03-11 18:30:08 +00:00
|
|
|
Code sequences
|
|
|
|
--------------
|
2017-03-11 04:43:04 +00:00
|
|
|
|
2017-03-13 17:52:11 +00:00
|
|
|
80BAB64: draw and render PSI party target window
|
2017-03-11 18:30:08 +00:00
|
|
|
80C4C24: equip window renders four (None)s in a row
|
|
|
|
80C4F80: going left in equip window
|
|
|
|
80C4F84: going right in equip window
|
2017-03-07 22:12:52 +00:00
|
|
|
|
|
|
|
Subroutines
|
|
|
|
-----------
|
|
|
|
|
2017-03-13 17:52:11 +00:00
|
|
|
80B8AE0: draw PSI target/PP cost window with PSI index r0
|
|
|
|
80C1FBC: draw PSI window for character r0
|
|
|
|
80C438C: check for cursor movements in PSI window
|
2017-03-10 21:29:27 +00:00
|
|
|
80C87D0: draw blank window and border (r0: window pointer)
|
2017-03-11 04:41:45 +00:00
|
|
|
80C9634: render string (r1) to window (r0) at (x,y) (r2,r3)
|
2017-03-12 22:55:11 +00:00
|
|
|
80C96F0: render string (r1) to window (r0) at (x,2y) (r2,r3) using highlight [sp]
|
2017-03-12 21:33:47 +00:00
|
|
|
(does not modify any window values)
|
2017-03-09 05:36:24 +00:00
|
|
|
80C980C: print next character (r0: window pointer)
|
|
|
|
80CA4BC: scroll text upwards (r0: window pointer)
|
2017-03-13 17:52:11 +00:00
|
|
|
80D2E94: print party character name
|
2017-03-07 22:12:52 +00:00
|
|
|
|
|
|
|
Windows
|
|
|
|
-------
|
|
|
|
|
|
|
|
Window structure:
|
|
|
|
0x00 - 0x03: bitfield
|
|
|
|
0x00000001: enable
|
2017-03-11 04:41:45 +00:00
|
|
|
0x00000020: signals to redraw the window and borders (cleared by C87D0)
|
|
|
|
0x0000FFDE: ?
|
2017-03-09 06:04:02 +00:00
|
|
|
0xFFFF0000: we're stealing these for our hacks
|
|
|
|
0x0007: pixel X value
|
|
|
|
0xFFF8: unused
|
2017-03-07 22:12:52 +00:00
|
|
|
0x04 - 0x07: start address of text being displayed
|
|
|
|
0x08 - 0x0B: same as above?
|
|
|
|
0x0C - 0x13: unused?
|
2017-03-09 05:36:24 +00:00
|
|
|
0x14 - 0x17: text address offset
|
|
|
|
0x18 - 0x1B: ?
|
|
|
|
0x1C - 0x1F: ? (some kind of offset; used when printing nameable things?)
|
2017-03-07 22:12:52 +00:00
|
|
|
0x20 - 0x21: area (width*height)
|
2017-03-09 05:36:24 +00:00
|
|
|
0x22 - 0x23: window X (text area, not including border)
|
|
|
|
0x24 - 0x25: window Y
|
|
|
|
0x26 - 0x27: window width (tiles, not including border)
|
2017-03-07 22:12:52 +00:00
|
|
|
0x28 - 0x29: window height
|
|
|
|
0x2A - 0x2B: relative text X
|
|
|
|
0x2C - 0x2D: relative text Y
|
|
|
|
0x2E - 0x33: ?
|
|
|
|
0x34 - 0x35: cursor X
|
|
|
|
0x36 - 0x37: cursor Y
|
2017-03-09 05:36:24 +00:00
|
|
|
0x38 - 0x43: ?
|
2017-03-07 22:12:52 +00:00
|
|
|
0x44: ?
|
2017-03-09 05:36:24 +00:00
|
|
|
0x45 - 0x4F: ?
|