2017-03-29 05:19:51 +01:00
|
|
|
.gba
|
|
|
|
.open "m12.gba",0x8000000
|
2015-03-13 23:09:31 +00:00
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
// Relocation hacks
|
|
|
|
//==============================================================================
|
|
|
|
|
2015-04-01 16:26:54 +01:00
|
|
|
// Move the weird box font from 0xFCE6C
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80B3274 :: dw m2_font_relocate
|
2015-03-13 23:09:31 +00:00
|
|
|
|
2017-03-07 22:12:52 +00:00
|
|
|
|
2015-03-13 23:09:31 +00:00
|
|
|
//==============================================================================
|
|
|
|
// Font hacks
|
|
|
|
//==============================================================================
|
|
|
|
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x8AFED84 :: .incbin "m2-mainfont1-empty.bin"
|
|
|
|
.org 0x8B0F424 :: .incbin "m2-mainfont2-empty.bin"
|
|
|
|
.org 0x8B13424 :: .incbin "m2-mainfont3-empty.bin"
|
|
|
|
.org 0x8B088A4 :: .incbin "m2-shifted-cursor.bin"
|
2015-03-13 23:09:31 +00:00
|
|
|
|
|
|
|
// Greek letters
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x8B1B907 :: db 0x8B // alpha
|
|
|
|
.org 0x8B1B90A :: db 0x8C // beta
|
|
|
|
.org 0x8B1B90D :: db 0x8D // gamma
|
|
|
|
.org 0x8B1B910 :: db 0x8E // sigma
|
|
|
|
.org 0x8B1B913 :: db 0x8F // omega
|
2015-03-13 23:09:31 +00:00
|
|
|
|
2017-03-09 06:04:02 +00:00
|
|
|
|
2017-03-07 22:12:52 +00:00
|
|
|
//==============================================================================
|
|
|
|
// VWF hacks
|
|
|
|
//==============================================================================
|
2017-02-25 00:29:19 +00:00
|
|
|
|
2017-03-09 18:16:37 +00:00
|
|
|
// 32- to 16-bit access change for window flags
|
2017-04-03 03:12:18 +01:00
|
|
|
.org 0x80BE16A :: strh r2,[r4]
|
|
|
|
.org 0x80BE1FA :: strh r2,[r6]
|
|
|
|
.org 0x80BE222 :: strh r6,[r1]
|
2017-03-09 06:04:02 +00:00
|
|
|
|
2017-03-17 15:50:45 +00:00
|
|
|
// PSI class window size
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80B7820
|
|
|
|
mov r1,4
|
|
|
|
mov r2,1
|
|
|
|
mov r3,6
|
2017-03-17 15:50:45 +00:00
|
|
|
|
2017-03-14 04:06:36 +00:00
|
|
|
//---------------------------------------------------------
|
2017-03-17 00:32:11 +00:00
|
|
|
// C0A5C hacks (status window)
|
2017-03-14 04:06:36 +00:00
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2017-03-29 05:19:51 +01:00
|
|
|
.include "m2-status-initial.asm"
|
|
|
|
.include "m2-status-switch.asm"
|
2017-03-14 04:06:36 +00:00
|
|
|
|
2017-03-17 00:32:11 +00:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// BAC18 hacks (status window switching)
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80BACFC :: bl bac18_redraw_status
|
|
|
|
.org 0x80BADE6 :: bl bac18_redraw_status
|
|
|
|
.org 0x80BACEE :: bl bac18_clear_psi
|
|
|
|
.org 0x80BADC8
|
|
|
|
bl bac18_check_button
|
|
|
|
b 0x80BADD8
|
2017-03-17 00:32:11 +00:00
|
|
|
|
2017-03-18 01:22:35 +00:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// BAEF8 hacks (equip window)
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
// Erase offense change
|
2017-03-29 05:19:51 +01:00
|
|
|
erase_offense equ mov r0,0xC :: mov r1,0xB :: mov r2,4 :: bl print_blankstr
|
|
|
|
.org 0x80BB216 :: erase_offense
|
|
|
|
.org 0x80BB38C :: erase_offense
|
|
|
|
.org 0x80BB4C6 :: erase_offense
|
|
|
|
.org 0x80BB5FC :: erase_offense
|
|
|
|
.org 0x80BBAAE :: erase_offense
|
|
|
|
.org 0x80BBBF6 :: erase_offense
|
|
|
|
.org 0x80BBD54 :: erase_offense
|
2017-03-18 01:22:35 +00:00
|
|
|
|
|
|
|
// Erase defense change
|
2017-03-29 05:19:51 +01:00
|
|
|
erase_defense equ mov r0,0xC :: mov r1,0xD :: mov r2,4 :: bl print_blankstr
|
|
|
|
.org 0x80BB226 :: erase_defense
|
|
|
|
.org 0x80BBABE :: erase_defense
|
|
|
|
.org 0x80BBC06 :: erase_defense
|
|
|
|
.org 0x80BBD64 :: erase_defense
|
2017-03-18 01:22:35 +00:00
|
|
|
|
|
|
|
// Erase offense/defense after changing equipment
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80BB3E2 :: bl baef8_reequip_erase
|
|
|
|
.org 0x80BB518 :: bl baef8_reequip_erase
|
|
|
|
.org 0x80BBB12 :: bl baef8_reequip_erase
|
|
|
|
.org 0x80BBC70 :: bl baef8_reequip_erase
|
2017-03-18 01:22:35 +00:00
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// C5500 hacks (equip window switching)
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
// Clear offense/defense changes when moving cursor
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80C5AA2 :: bl c5500_clear_up
|
|
|
|
.org 0x80C5B12 :: bl c5500_clear_down
|
2017-03-18 01:22:35 +00:00
|
|
|
|
|
|
|
// Don't draw equip icon
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80C5A1A :: nop
|
|
|
|
.org 0x80C5A28 :: nop
|
2017-03-18 01:22:35 +00:00
|
|
|
|
2017-03-12 22:55:21 +00:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// C1FBC hacks (PSI window)
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80C203E :: mov r1,0x14 // new PSI name entry length
|
|
|
|
.org 0x80C21B4 :: mov r1,0x14
|
|
|
|
.org 0x80C224A :: mov r1,0x14
|
|
|
|
.org 0x80C229E :: mov r1,0x14
|
2017-03-12 22:55:21 +00:00
|
|
|
|
2017-03-17 00:42:25 +00:00
|
|
|
// Draw PSI Rockin
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80C2192
|
2017-03-17 00:42:25 +00:00
|
|
|
mov r2,r8
|
2017-04-03 03:12:18 +01:00
|
|
|
str r2,[sp]
|
2017-03-29 05:19:51 +01:00
|
|
|
mov r2,0xFD
|
|
|
|
lsl r2,r2,1
|
2017-03-17 00:42:25 +00:00
|
|
|
add r0,r6,r2
|
2017-03-29 05:19:51 +01:00
|
|
|
mov r1,0x71
|
|
|
|
mov r2,8
|
|
|
|
bl print_string
|
2017-03-17 00:42:25 +00:00
|
|
|
|
2017-03-25 22:54:09 +00:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// C239C hacks (print PSI name)
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80C23AA :: lsr r2,r2,0xD // tiles-to-pixels
|
|
|
|
.org 0x80C23AE :: lsr r6,r3,0xD // tiles-to-pixels
|
|
|
|
.org 0x80C23CE :: bl c239c_print_psi :: nop :: nop :: nop
|
|
|
|
.org 0x80C23DA :: add r4,17 // pixel width of "PSI "
|
|
|
|
.org 0x80C23F0 :: bl print_string_hlight_pixels // print rockin'
|
|
|
|
.org 0x80C2402 :: mov r0,3 :: lsl r0,r0,0x10 // pixel width of space
|
|
|
|
.org 0x80C242E :: mov r0,0x14 // new PSI name entry length
|
|
|
|
.org 0x80C2448
|
|
|
|
bl print_string_hlight_pixels // print PSI name
|
|
|
|
mov r2,r1 // record X width
|
|
|
|
add r2,3 // add a space
|
|
|
|
.org 0x80C2468 :: bl print_string_hlight_pixels
|
2017-03-25 22:54:09 +00:00
|
|
|
|
2017-03-13 17:53:12 +00:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// C438C hacks (PSI window cursor movement)
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80C4580 :: bl c438c_moveup
|
|
|
|
.org 0x80C4642 :: bl c438c_movedown
|
|
|
|
.org 0x80C4768 :: bl c438c_moveright
|
|
|
|
.org 0x80C48B2 :: bl c438c_moveleft
|
2017-03-13 17:53:12 +00:00
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// PSI target window hacks
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
// PSI target length hack
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80B8B12 :: mov r0,0x14
|
|
|
|
.org 0x80C24EE :: mov r1,0x14
|
2017-03-13 17:53:12 +00:00
|
|
|
|
|
|
|
// Fix PSI target offset calculation
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80B8B08
|
|
|
|
mov r1,100
|
2017-03-13 17:53:12 +00:00
|
|
|
mul r1,r2
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
|
|
|
|
// Make PP cost use correct number values
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80CA732
|
|
|
|
add r1,0x60
|
2017-03-13 17:53:12 +00:00
|
|
|
|
|
|
|
// Make PP cost use the correct space value if there's only one digit
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80CA712
|
|
|
|
mov r0,0x50
|
2017-03-13 17:53:12 +00:00
|
|
|
|
2017-03-18 16:47:40 +00:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// B8BBC hacks (PSI window)
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
// Redraw main menu when exiting PSI target window
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80B8E3A :: bl b8bbc_redraw_menu_2to1
|
2017-03-18 17:38:32 +00:00
|
|
|
|
|
|
|
// Redraw main menu when entering PSI target window
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80B8CF8 :: bl b8bbc_redraw_menu_13to2 // 1 to 2
|
|
|
|
.org 0x80B920C :: bl b8bbc_redraw_menu_13to2 // 3 to 2
|
2017-03-18 16:47:40 +00:00
|
|
|
|
2017-03-11 04:43:04 +00:00
|
|
|
//---------------------------------------------------------
|
2017-03-11 18:30:08 +00:00
|
|
|
// C4B2C hacks (Equip window render)
|
2017-03-11 04:43:04 +00:00
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
// Start equipment at the 6th tile instead of 5th
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80C4C96 :: mov r2,6 // Weapon
|
|
|
|
.org 0x80C4D1C :: mov r2,6 // Body
|
|
|
|
.org 0x80C4DA4 :: mov r2,6 // Arms
|
|
|
|
.org 0x80C4E2C :: mov r2,6 // Other
|
2017-03-11 04:43:04 +00:00
|
|
|
|
|
|
|
// Only render (None) if necessary
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80C4C0C
|
|
|
|
bl c4b2c_skip_nones
|
|
|
|
b 0x80C4C58
|
2017-03-11 04:43:04 +00:00
|
|
|
|
2017-03-11 04:52:22 +00:00
|
|
|
// Don't render equip symbols
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80C4CD0 :: nop
|
|
|
|
.org 0x80C4CDE :: nop
|
|
|
|
.org 0x80C4D58 :: nop
|
|
|
|
.org 0x80C4D66 :: nop
|
|
|
|
.org 0x80C4DE0 :: nop
|
|
|
|
.org 0x80C4DEE :: nop
|
|
|
|
.org 0x80C4E68 :: nop
|
|
|
|
.org 0x80C4E76 :: nop
|
2017-03-11 04:52:22 +00:00
|
|
|
|
2017-03-17 21:48:17 +00:00
|
|
|
// Widen the who/where/etc window
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80B77B4 :: mov r3,5
|
|
|
|
.org 0x80BA9E2 :: mov r3,5
|
2017-03-17 21:48:17 +00:00
|
|
|
|
2017-03-11 18:30:08 +00:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// C4B2C hacks (Equip window loop)
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80C4F80 :: bl c4b2c_clear_left
|
|
|
|
.org 0x80C4F84 :: bl c4b2c_clear_right
|
2017-03-11 18:30:08 +00:00
|
|
|
|
2017-03-09 18:16:37 +00:00
|
|
|
//---------------------------------------------------------
|
2017-03-17 04:55:47 +00:00
|
|
|
// C980C hacks (main character printing)
|
2017-03-09 18:16:37 +00:00
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2017-03-18 21:10:45 +00:00
|
|
|
// Reset pixel X during scroll
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80C9858 :: bl c980c_resetx_newline
|
|
|
|
.org 0x80C9BF0 :: bl c980c_resetx_scroll
|
|
|
|
.org 0x80C9D18 :: bl c980c_resetx_newline
|
|
|
|
.org 0x80CA336 :: bl c980c_resetx_newline
|
2017-03-18 21:10:45 +00:00
|
|
|
|
2017-03-13 17:53:55 +00:00
|
|
|
// Reset pixel X during a newline
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80C9CC4
|
|
|
|
bl c980c_resetx_newline
|
2017-03-13 17:53:55 +00:00
|
|
|
|
2017-03-18 21:10:45 +00:00
|
|
|
// Other reset X
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80C9D62 :: bl c980c_resetx_other
|
|
|
|
.org 0x80C9D76 :: bl c980c_resetx_other2
|
|
|
|
.org 0x80C9EEC :: bl c980c_resetx_other3
|
|
|
|
.org 0x80C9F34 :: bl c980c_resetx_other3
|
|
|
|
.org 0x80CA204 :: bl c980c_resetx_other4
|
|
|
|
.org 0x80CA274 :: bl c980c_resetx_other4
|
|
|
|
.org 0x80CA30E :: bl c980c_resetx_newline
|
2017-03-18 21:10:45 +00:00
|
|
|
|
2017-03-09 18:16:37 +00:00
|
|
|
// Custom codes check
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80CA2BC
|
|
|
|
bl c980c_custom_codes
|
2017-03-09 18:16:37 +00:00
|
|
|
|
2017-03-13 17:53:55 +00:00
|
|
|
// Reset pixel X when redrawing the window
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80CA2E6
|
|
|
|
bl c980c_resetx
|
2017-03-09 18:16:37 +00:00
|
|
|
|
|
|
|
// Welding entry
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80CA448
|
|
|
|
bl c980c_weld_entry
|
|
|
|
b 0x80CA46C
|
2017-03-09 18:16:37 +00:00
|
|
|
|
|
|
|
// Disable X coordinate incrementing
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80CA48E
|
2017-03-09 18:16:37 +00:00
|
|
|
nop
|
|
|
|
|
2017-03-14 04:05:02 +00:00
|
|
|
//---------------------------------------------------------
|
2017-03-17 04:55:47 +00:00
|
|
|
// C8FFC hacks (main string printing)
|
2017-03-14 04:05:02 +00:00
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
// Custom codes check
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80C90A2
|
|
|
|
bl c8ffc_custom_codes
|
2017-03-14 04:05:02 +00:00
|
|
|
|
|
|
|
// Welding entry
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80C9114
|
|
|
|
bl c8ffc_weld_entry
|
|
|
|
b 0x80C9144
|
2017-03-14 04:05:02 +00:00
|
|
|
|
|
|
|
// Integer-to-char changes
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80CA67C :: mov r3,0x50 // space
|
|
|
|
.org 0x80CA69C :: mov r2,0x60 // zero
|
|
|
|
.org 0x80CA78A :: mov r0,0x60 // zero
|
|
|
|
.org 0x80CA7AC :: mov r2,0x69 // nine
|
|
|
|
.org 0x80CA7EC :: sub r1,0xA0
|
2017-03-14 04:05:02 +00:00
|
|
|
|
2017-03-10 23:40:47 +00:00
|
|
|
//---------------------------------------------------------
|
2017-03-17 04:55:47 +00:00
|
|
|
// C87D0 hacks (draw blank window)
|
2017-03-10 23:40:47 +00:00
|
|
|
//---------------------------------------------------------
|
2017-03-12 21:45:21 +00:00
|
|
|
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80C87DC
|
|
|
|
bl c87d0_clear_entry
|
2017-03-10 23:40:47 +00:00
|
|
|
|
2017-03-11 04:41:45 +00:00
|
|
|
//---------------------------------------------------------
|
2017-03-17 04:55:47 +00:00
|
|
|
// C9634 hacks (string printing)
|
2017-03-11 04:41:45 +00:00
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80C967E
|
|
|
|
bl c9634_resetx
|
2017-03-11 04:41:45 +00:00
|
|
|
|
2017-03-12 21:45:21 +00:00
|
|
|
//---------------------------------------------------------
|
2017-03-17 04:55:47 +00:00
|
|
|
// C96F0 hacks (string printing with highlight)
|
2017-03-12 21:45:21 +00:00
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80C9714
|
|
|
|
lsl r3,r3,1 // change from row coords to tile coords
|
|
|
|
ldrh r1,[r0,0x22]
|
2017-03-12 21:45:21 +00:00
|
|
|
add r1,r1,r2
|
2017-03-29 05:19:51 +01:00
|
|
|
lsl r1,r1,3 // r1 = tile_x * 8
|
|
|
|
ldrh r2,[r0,0x24]
|
2017-03-12 21:45:21 +00:00
|
|
|
add r2,r2,r3
|
2017-03-29 05:19:51 +01:00
|
|
|
lsl r2,r2,3 // r2 = tile_y * 8
|
2017-03-12 21:45:21 +00:00
|
|
|
mov r0,r6
|
2017-03-29 05:19:51 +01:00
|
|
|
bl print_string
|
2017-03-12 21:45:21 +00:00
|
|
|
mov r7,r0
|
2017-03-29 05:19:51 +01:00
|
|
|
b 0x80C9788
|
2017-02-25 00:29:19 +00:00
|
|
|
|
2017-03-18 21:11:19 +00:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// CA4BC hacks (scroll text)
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80CA55E :: bl ca4bc_erase_tile_short
|
|
|
|
.org 0x80CA60E :: bl ca4bc_copy_tile_up
|
|
|
|
.org 0x80CA626 :: bl ca4bc_erase_tile
|
2017-03-18 21:11:19 +00:00
|
|
|
|
2017-03-13 17:54:08 +00:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// D2E94 hacks (print party character name)
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80D2F24
|
2017-03-13 17:54:08 +00:00
|
|
|
mov r1,r6
|
|
|
|
mov r2,r7
|
|
|
|
mov r0,r4
|
2017-03-29 05:19:51 +01:00
|
|
|
bl weld_entry
|
|
|
|
b 0x80D2F52
|
2017-03-13 17:54:08 +00:00
|
|
|
|
|
|
|
// Disable X increment
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80D2F5A :: nop
|
2017-03-13 17:54:08 +00:00
|
|
|
|
2017-03-27 06:26:15 +01:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// D2FA0 hacks (print item)
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80D3044
|
2017-03-27 06:26:15 +01:00
|
|
|
mov r0,r4
|
|
|
|
mov r1,r6
|
2017-03-29 05:19:51 +01:00
|
|
|
bl weld_entry
|
|
|
|
b 0x80D3072
|
2017-03-27 06:26:15 +01:00
|
|
|
|
|
|
|
// Disable X increment
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80D307A :: nop
|
2017-03-27 06:26:15 +01:00
|
|
|
|
2017-03-22 20:47:34 +00:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// D30C4 hacks (print number)
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80D314A
|
2017-03-22 20:47:34 +00:00
|
|
|
mov r0,r5
|
|
|
|
mov r1,r7
|
2017-03-29 05:19:51 +01:00
|
|
|
bl weld_entry
|
|
|
|
b 0x80D3178
|
2017-03-22 20:47:34 +00:00
|
|
|
|
|
|
|
// Disable X increment
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80D3180 :: nop
|
2017-03-22 20:47:34 +00:00
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// D332C hacks (print name)
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80D34E8
|
2017-03-22 20:47:34 +00:00
|
|
|
mov r0,r5
|
|
|
|
mov r1,r4
|
2017-03-29 05:19:51 +01:00
|
|
|
bl weld_entry
|
|
|
|
b 0x80D3514
|
2017-03-22 20:47:34 +00:00
|
|
|
|
|
|
|
// Disable X increment
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80D351A :: nop
|
2017-03-22 20:47:34 +00:00
|
|
|
|
2017-04-03 03:13:06 +01:00
|
|
|
// Don't print [1E 20] after the name if there are multiple people
|
|
|
|
.org 0x80D3418 :: b 0x80D348C
|
|
|
|
|
2017-03-18 18:43:57 +00:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// D3934 hacks (print PSI name)
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80D39BA :: mov r0,0x14 // PSI name length
|
2017-03-18 18:43:57 +00:00
|
|
|
|
|
|
|
// Weld entry
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80D39E2
|
2017-03-18 18:43:57 +00:00
|
|
|
mov r0,r4
|
|
|
|
mov r1,r5
|
2017-03-29 05:19:51 +01:00
|
|
|
bl weld_entry
|
|
|
|
b 0x80D3A14
|
2017-03-18 18:43:57 +00:00
|
|
|
|
|
|
|
// Print a space before the Greek letter
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80D39D4 :: bl d3934_print_space
|
2017-03-13 17:54:08 +00:00
|
|
|
|
2017-03-25 21:08:00 +00:00
|
|
|
// Battle command hacks
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x8B1F4C8 :: db 0x11 // Extend command window width two tiles (Normal)
|
|
|
|
.org 0x8B1F4CC :: db 0x16 // Extend command window width two tiles (Paula paralyzed leader)
|
|
|
|
.org 0x80D7A56 :: mov r1,4 // Move PSI class window left one tile
|
|
|
|
.org 0x80D7A5A :: mov r3,6 // Extend PSI class window width one tile
|
|
|
|
.org 0x80DC038 :: add r5,0x30 // String address calculation
|
|
|
|
.org 0x80DC0A8 :: add r1,0x60 // String address calculation
|
2017-03-25 21:05:59 +00:00
|
|
|
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80DC27C :: lsl r1,r2,4 :: nop // String address calculation
|
|
|
|
.org 0x80DC2AC :: lsl r1,r2,4 :: nop // String address calculation
|
2017-03-23 04:59:32 +00:00
|
|
|
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80DCC36 :: mov r2,2 // "to X" position
|
|
|
|
.org 0x80DCCE0 :: mov r2,2 // "to the Front Row" position
|
2017-03-26 00:31:29 +00:00
|
|
|
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80E079E :: bl e06ec_clear_window
|
|
|
|
.org 0x80E0888 :: bl e06ec_redraw_psi
|
|
|
|
.org 0x80E0A16 :: bl e06ec_redraw_bash_psi
|
2017-03-25 21:08:00 +00:00
|
|
|
|
2017-03-26 19:13:51 +01:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// BD918 hacks (battle setup)
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
// Longest enemy name is 24 letters + 2 for the end code, for 26 total
|
|
|
|
// We might have "The " later on, so make that 30
|
|
|
|
// " and its cohorts" makes that 46
|
|
|
|
// Let's round it to a nice 64: we need to allocate that many bytes for user
|
|
|
|
// and target strings on the heap. The game only allocates 16 each.
|
2017-03-26 20:16:09 +01:00
|
|
|
// Goal: allocate an extra 128 bytes and fix all the offsets to the user/target
|
|
|
|
// strings. We'll store the user string at +0x4C0 and the target string at +0x500.
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80BD97A :: mov r0,0xA8 // malloc an extra 128 bytes for longer user/target strings
|
2017-03-26 20:16:09 +01:00
|
|
|
|
|
|
|
// Fix user/target pointers
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80C9942 :: bl c980c_user_pointer
|
|
|
|
.org 0x80C9954 :: bl c980c_target_pointer
|
|
|
|
.org 0x80EBFDC :: bl ebfd4_user_pointer :: b 0x80EBFFA
|
|
|
|
.org 0x80EC004 :: push {lr} :: bl ec004_user_pointer
|
|
|
|
.org 0x80EC018 :: bl ec010_target_pointer :: b 0x80EC038
|
|
|
|
.org 0x80EC046 :: push {lr} :: bl ec046_target_pointer
|
2017-03-26 20:16:09 +01:00
|
|
|
|
|
|
|
// Length fixes
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80DAE02 :: add sp,-0x40
|
|
|
|
.org 0x80DAE08 :: mov r2,0x3E
|
|
|
|
.org 0x80DAE38 :: mov r2,0x3A
|
|
|
|
.org 0x80DAEA2 :: mov r1,0x3E
|
|
|
|
.org 0x80DAEDE :: add sp,0x40
|
|
|
|
|
|
|
|
.org 0x80DB04E :: add sp,-0x40
|
|
|
|
.org 0x80DB058 :: mov r2,0x3E
|
|
|
|
.org 0x80DB08C :: mov r2,0x3A
|
|
|
|
.org 0x80DB116 :: mov r1,0x3E
|
|
|
|
.org 0x80DB15A :: add sp,0x40
|
|
|
|
|
|
|
|
.org 0x80DCD02 :: add sp,-0x40
|
|
|
|
.org 0x80DCD0C :: mov r2,0x3C
|
|
|
|
.org 0x80DCD64 :: mov r2,0x3A
|
|
|
|
.org 0x80DCDA2 :: mov r1,0x3E
|
|
|
|
.org 0x80DCDA8 :: add sp,0x40
|
2017-03-26 20:16:09 +01:00
|
|
|
|
2017-03-26 20:16:19 +01:00
|
|
|
// Add a space between enemy name and letter
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80DCD94 :: bl dcd00_enemy_letter
|
|
|
|
.org 0x80DCD9A :: strb r0,[r5,2]
|
|
|
|
.org 0x80DCD9E :: strb r0,[r5,3]
|
2017-03-26 20:16:19 +01:00
|
|
|
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80DAE7E :: bl dae00_enemy_letter
|
|
|
|
.org 0x80DAE84 :: strb r0,[r4,2]
|
|
|
|
.org 0x80DAE88 :: strb r0,[r4,3]
|
2017-03-27 05:48:23 +01:00
|
|
|
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80DB0CE :: bl dae00_enemy_letter
|
|
|
|
.org 0x80DB0D2 :: strb r5,[r4,2]
|
|
|
|
.org 0x80DB0D6 :: strb r0,[r4,3]
|
2017-03-27 06:26:29 +01:00
|
|
|
|
2017-03-27 05:19:17 +01:00
|
|
|
// "The" flag checks
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80DB084 :: bl db04c_theflag :: nop :: nop
|
2017-03-27 05:19:17 +01:00
|
|
|
|
2017-03-26 23:30:02 +01:00
|
|
|
// Ignore the hard-coded Japanese "and cohorts"
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80DB0E6 :: b 0x80DB0FE
|
2017-03-26 23:30:02 +01:00
|
|
|
|
2017-03-26 19:13:51 +01:00
|
|
|
|
2015-03-13 23:09:31 +00:00
|
|
|
//==============================================================================
|
|
|
|
// Data files
|
|
|
|
//==============================================================================
|
|
|
|
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x8B2C000
|
2015-03-13 23:09:31 +00:00
|
|
|
|
|
|
|
// Box font relocation
|
|
|
|
m2_font_relocate:
|
2017-03-29 05:19:51 +01:00
|
|
|
.incbin "m2-font-relocate.bin"
|
2015-03-13 23:09:31 +00:00
|
|
|
|
|
|
|
// Co-ordinate table
|
|
|
|
m2_coord_table:
|
2017-03-29 05:19:51 +01:00
|
|
|
.incbin "m2-coord-table.bin"
|
2015-03-13 23:09:31 +00:00
|
|
|
|
|
|
|
// EB fonts
|
|
|
|
m2_font_table:
|
2017-03-29 05:19:51 +01:00
|
|
|
dw m2_font_main
|
|
|
|
dw m2_font_saturn
|
2015-03-13 23:09:31 +00:00
|
|
|
|
|
|
|
m2_font_main:
|
2017-03-29 05:19:51 +01:00
|
|
|
.incbin "m2-font-main.bin"
|
2015-03-13 23:09:31 +00:00
|
|
|
|
|
|
|
m2_font_saturn:
|
2017-03-29 05:19:51 +01:00
|
|
|
.incbin "m2-font-saturn.bin"
|
2015-03-13 23:09:31 +00:00
|
|
|
|
2017-03-09 18:16:25 +00:00
|
|
|
// EB font heights
|
|
|
|
m2_height_table:
|
2017-03-29 05:19:51 +01:00
|
|
|
db 0x02, 0x02, 0x01, 0x00 // last byte for alignment
|
2017-03-09 18:16:25 +00:00
|
|
|
|
2015-03-13 23:09:31 +00:00
|
|
|
// EB font widths
|
|
|
|
m2_widths_table:
|
2017-03-29 05:19:51 +01:00
|
|
|
dw m2_widths_main
|
|
|
|
dw m2_widths_saturn
|
2015-03-13 23:09:31 +00:00
|
|
|
|
|
|
|
m2_widths_main:
|
2017-03-29 05:19:51 +01:00
|
|
|
.incbin "m2-widths-main.bin"
|
2015-03-13 23:09:31 +00:00
|
|
|
|
|
|
|
m2_widths_saturn:
|
2017-03-07 22:12:52 +00:00
|
|
|
// tbd
|
|
|
|
|
2017-03-09 18:15:42 +00:00
|
|
|
m2_bits_to_nybbles:
|
2017-03-29 05:19:51 +01:00
|
|
|
.incbin "m2-bits-to-nybbles.bin"
|
2015-03-13 23:09:31 +00:00
|
|
|
|
2017-03-10 05:44:39 +00:00
|
|
|
m2_nybbles_to_bits:
|
2017-03-29 05:19:51 +01:00
|
|
|
.incbin "m2-nybbles-to-bits.bin"
|
2017-03-10 05:44:39 +00:00
|
|
|
|
2017-03-27 03:05:18 +01:00
|
|
|
m2_enemy_attributes:
|
2017-03-29 05:19:51 +01:00
|
|
|
.incbin "m2-enemy-attributes.bin"
|
2015-03-13 23:09:31 +00:00
|
|
|
|
2017-03-07 22:12:52 +00:00
|
|
|
|
2015-03-13 23:09:31 +00:00
|
|
|
//==============================================================================
|
|
|
|
// Code files
|
|
|
|
//==============================================================================
|
|
|
|
|
2017-03-29 05:19:51 +01:00
|
|
|
.org 0x80FCE6C
|
|
|
|
.include "m2-vwf.asm"
|
|
|
|
.include "m2-vwf-entries.asm"
|
|
|
|
.include "m2-formatting.asm"
|
|
|
|
.include "m2-customcodes.asm"
|
|
|
|
|
|
|
|
.close
|