Merge branch 'thewip' into window-text-buffering

This commit is contained in:
Lorenzooone 2019-09-12 01:18:38 +02:00
commit d5a7ce8d98
8 changed files with 317 additions and 1 deletions

233
notes/m2-sub111D0.txt Normal file
View File

@ -0,0 +1,233 @@
// Load intro screen
// 82D6AA8: structs of size 0x38
// Offset Length Description
// ------------------------------------
// 0 4 BG0 graphics pointer (compressed)
// 4 4 Sprite graphics pointer (compressed)
// 8 4 BG palette pointer (compressed)
// C 4 Sprite palette pointer (compressed)
// 10 4 BG0 tilemap pointer (compressed)
// 14 2 BG0 attributes
// 16 2 Unused?
// 18 4 BG1 tilemap pointer (compressed)
// 1C 2 BG1 attributes
// 1E 2 Unused?
// 20 2 DISPCNT
// 22 2 Some kind of index into a jump table (negative values are special)
// 24 4 Unused?
// 28 16 Four-entry jump table
// [0]: called at the start of the animation
// [1,2]: called for each frame
// [3]: called at the end of the animation
// r0: screen key
// 0 = Nintendo
// 1 = APE
// 2 = HALKEN
// 3 = Title screen (full)
// 5 = Title screen (quick)
080111D0 (T) push r4-r7,r14
080111D2 (T) mov r7,r9
080111D4 (T) mov r6,r8
080111D6 (T) push r6,r7
080111D8 (T) add sp,-4h
080111DA (T) mov r5,r0
080111DC (T) ldr r4,=3000370h
080111DE (T) mov r0,18h
080111E0 (T) bl 8005B9Ch // malloc 0x18 bytes for some struct
080111E4 (T) str r0,[r4]
080111E6 (T) str r5,[r0]
080111E8 (T) mov r7,0h
080111EA (T) str r7,[r0,14h]
080111EC (T) str r7,[r0,4h]
080111EE (T) str r7,[r0,10h] // zero out the struct
080111F0 (T) ldr r6,=82D6AA8h
080111F2 (T) lsl r0,r5,3h
080111F4 (T) sub r0,r0,r5
080111F6 (T) lsl r4,r0,3h // r4 = r5 * 0x38
080111F8 (T) add r0,r4,r6
080111FA (T) ldr r0,[r0]
080111FC (T) cmp r0,0h
080111FE (T) beq 801120Ch
08011200 (T) mov r1,80h
08011202 (T) lsl r1,r1,12h
08011204 (T) mov r2,40h
08011206 (T) lsl r2,r2,8h
08011208 (T) bl 8005D34h
0801120C (T) add r0,r6,4
0801120E (T) add r0,r4,r0
08011210 (T) ldr r0,[r0]
08011212 (T) cmp r0,0h
08011214 (T) beq 8011220h
08011216 (T) ldr r1,=2008000h
08011218 (T) mov r2,80h
0801121A (T) lsl r2,r2,8h
0801121C (T) bl 8005D34h
08011220 (T) mov r0,r6
08011222 (T) add r0,8h
08011224 (T) add r0,r4,r0
08011226 (T) ldr r3,[r0]
08011228 (T) cmp r3,0h
0801122A (T) beq 801126Ch
0801122C (T) mov r0,1h
0801122E (T) neg r0,r0
08011230 (T) cmp r3,r0
08011232 (T) bne 8011260h
08011234 (T) str r7,[sp]
08011236 (T) ldr r1,=40000D4h
08011238 (T) mov r0,r13
0801123A (T) str r0,[r1]
0801123C (T) ldr r0,=2010000h
0801123E (T) str r0,[r1,4h]
08011240 (T) ldr r0,=85000080h
08011242 (T) str r0,[r1,8h]
08011244 (T) ldr r0,[r1,8h]
08011246 (T) b 801126Ch
08011248 (T) lsl r0,r6,0Dh
0801124A (T) lsl r0,r0,0Ch
0801124C (T) ldr r0,[r5,28h]
0801124E (T) lsr r5,r5,20h
08011250 (T) strh r0,[r0]
08011252 (T) lsl r0,r0,8h
08011254 (T) lsl r4,r2,3h
08011256 (T) lsl r0,r0,10h
08011258 (T) lsl r0,r0,0h
0801125A (T) lsl r1,r0,8h
0801125C (T) lsl r0,r0,2h
0801125E (T) strh r0,[r0,28h]
08011260 (T) ldr r1,=2010000h
08011262 (T) mov r2,80h
08011264 (T) lsl r2,r2,2h
08011266 (T) mov r0,r3
08011268 (T) bl 8005D34h
0801126C (T) ldr r1,=82D6AA8h
0801126E (T) mov r9,r1
08011270 (T) lsl r0,r5,3h
08011272 (T) sub r0,r0,r5
08011274 (T) lsl r7,r0,3h
08011276 (T) mov r0,r9
08011278 (T) add r0,0Ch
0801127A (T) add r0,r7,r0
0801127C (T) ldr r0,[r0]
0801127E (T) cmp r0,0h
08011280 (T) beq 801128Ch
08011282 (T) ldr r1,=2010200h
08011284 (T) mov r2,80h
08011286 (T) lsl r2,r2,2h
08011288 (T) bl 8005D34h
0801128C (T) mov r0,r9
0801128E (T) add r0,10h
08011290 (T) add r0,r7,r0
08011292 (T) ldr r0,[r0]
08011294 (T) cmp r0,0h
08011296 (T) beq 80112A2h
08011298 (T) ldr r1,=2010400h
0801129A (T) mov r2,80h
0801129C (T) lsl r2,r2,4h
0801129E (T) bl 8005D34h
080112A2 (T) mov r0,r9
080112A4 (T) add r0,18h
080112A6 (T) add r0,r7,r0
080112A8 (T) ldr r0,[r0]
080112AA (T) cmp r0,0h
080112AC (T) beq 80112B8h
080112AE (T) ldr r1,=2010C00h
080112B0 (T) mov r2,80h
080112B2 (T) lsl r2,r2,4h
080112B4 (T) bl 8005D34h
080112B8 (T) ldr r0,=2010000h
080112BA (T) mov r8,r0
080112BC (T) mov r0,0h
080112BE (T) mov r1,r8
080112C0 (T) strh r0,[r1]
080112C2 (T) bl 80F47E4h
080112C6 (T) bl 800E5E4h
080112CA (T) ldr r4,=40000D4h
080112CC (T) mov r0,80h
080112CE (T) lsl r0,r0,12h
080112D0 (T) str r0,[r4]
080112D2 (T) ldr r0,=6008000h
080112D4 (T) str r0,[r4,4h]
080112D6 (T) ldr r5,=84001000h
080112D8 (T) str r5,[r4,8h]
080112DA (T) ldr r0,[r4,8h]
080112DC (T) ldr r6,=4000006h
080112DE (T) ldrh r0,[r6]
080112E0 (T) bl 80F47E4h
080112E4 (T) bl 800E5E4h
080112E8 (T) ldr r0,=2004000h
080112EA (T) str r0,[r4]
080112EC (T) ldr r0,=600C000h
080112EE (T) str r0,[r4,4h]
080112F0 (T) str r5,[r4,8h]
080112F2 (T) ldr r0,[r4,8h]
080112F4 (T) ldrh r0,[r6]
080112F6 (T) bl 80F47E4h
080112FA (T) bl 800E5E4h
080112FE (T) ldr r1,=4000008h
08011300 (T) mov r0,r9
08011302 (T) add r5,r7,r0
08011304 (T) ldrh r0,[r5,14h]
08011306 (T) strh r0,[r1]
08011308 (T) add r1,2h
0801130A (T) ldrh r0,[r5,1Ch]
0801130C (T) strh r0,[r1]
0801130E (T) mov r1,r8
08011310 (T) str r1,[r4]
08011312 (T) mov r0,0A0h
08011314 (T) lsl r0,r0,13h
08011316 (T) str r0,[r4,4h]
08011318 (T) ldr r0,=84000080h
0801131A (T) mov r9,r0
0801131C (T) str r0,[r4,8h]
0801131E (T) ldr r0,[r4,8h]
08011320 (T) ldr r0,=2010400h
08011322 (T) str r0,[r4]
08011324 (T) mov r0,0C0h
08011326 (T) lsl r0,r0,13h
08011328 (T) str r0,[r4,4h]
0801132A (T) ldr r1,=84000200h
0801132C (T) mov r8,r1
0801132E (T) str r1,[r4,8h]
08011330 (T) ldr r0,[r4,8h]
08011332 (T) ldrh r0,[r6]
08011334 (T) bl 80F47E4h
08011338 (T) bl 800E5E4h
0801133C (T) ldr r0,=2008000h
0801133E (T) str r0,[r4]
08011340 (T) ldr r0,=6010000h
08011342 (T) str r0,[r4,4h]
08011344 (T) ldr r0,=84002000h
08011346 (T) str r0,[r4,8h]
08011348 (T) ldr r0,[r4,8h]
0801134A (T) ldrh r0,[r6]
0801134C (T) bl 80F47E4h
08011350 (T) bl 800E5E4h
08011354 (T) mov r1,80h
08011356 (T) lsl r1,r1,13h
08011358 (T) ldrh r0,[r5,20h]
0801135A (T) strh r0,[r1]
0801135C (T) ldr r0,=2010200h
0801135E (T) str r0,[r4]
08011360 (T) ldr r0,=5000200h
08011362 (T) str r0,[r4,4h]
08011364 (T) mov r0,r9
08011366 (T) str r0,[r4,8h]
08011368 (T) ldr r0,[r4,8h]
0801136A (T) ldr r0,=2010C00h
0801136C (T) str r0,[r4]
0801136E (T) ldr r0,=6000800h
08011370 (T) str r0,[r4,4h]
08011372 (T) mov r1,r8
08011374 (T) str r1,[r4,8h]
08011376 (T) ldr r0,[r4,8h]
08011378 (T) ldrh r0,[r6]
0801137A (T) add sp,4h
0801137C (T) pop r3,r4
0801137E (T) mov r8,r3
08011380 (T) mov r9,r4
08011382 (T) pop r4-r7
08011384 (T) pop r0
08011386 (T) bx r0


Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,18 @@
E E ‡ E ‡ É$E ‡ É$
%E ‡ É$
%L)E ‡ É$
%L)Ž-E ‡ É$
%L)Ž-Ð-E ‡ É$
%L)Ž-Ð-22E ‡ É$
%L)Ž-Ð-22t2E ‡ É$
%L)Ž-Ð-22t2¶6E ‡ É$
%L)Ž-Ð-22t2¶6ø:E ‡ É$
%L)Ž-Ð-22t2¶6ø:9;E ‡ É$
%L)Ž-Ð-22t2¶6ø:9;{?E ‡ É$
%L)Ž-Ð-22t2¶6ø:9;{?½?E ‡ É$
%L)Ž-Ð-22t2¶6ø:9;{?½?ÿCE ‡ É$
%L)Ž-Ð-22t2¶6ø:9;{?½?E ‡ É$
%L)Ž-Ð-22t2¶6ø:9;{?E ‡ É$
%L)Ž-Ð-22t2¶6ø:9;E ‡ É$
%L)Ž-Ð-22t2¶6ø:9;E ‡ É$
%L)Ž-Ð-22t2¶6ø:9;

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1499,6 +1499,60 @@ nop
//Choose character table based on alphabet loaded in
.org 0x80C7578 :: bl c7578_load_letters
//==============================================================================
// Title screen hacks
//==============================================================================
// m2_title_background_pal_copyright: File has two palettes separates by six palettes
// worth of nullspace. First palette is the copyright palette,
// last palette is a placeholder for the glow palette
// m2_title_background_pal_glow: 20 frames, glow effect
// m2_title_text_pal_animated: 14 frames, white horizontal line scrolling top to bottom
// m2_title_text_pal_static: 1 frame, white text on black background
// BG0 will be used for the B, the glow, and copyright info
// OAM will be used for the other letters
// Background palette RAM layout:
// [0]: copyright
// [1-6]: (blank)
// [7]: glow
// [8]: B
// [9-15]: (blank)
// Frame states (BG0), from EarthBound:
// Start Duration State
// --------------------------
// 0 g Black
// g 1 1/32 grey B
// g+1 2 2/32 grey B
// g+3 2 3/32 grey B
// g+5 2 4/32 grey B
// g+7 2 5/32 grey B
// g+9 2 6/32 grey B
// g+11 2 7/32 grey B
// g+13 2 8/32 grey B
// g+15 2 9/32 grey B
// g+17 2 10/32 grey B
// g+19 2 11/32 grey B
// g+21 2 12/32 grey B
// g+23 2 13/32 grey B
// g+25 2 14/32 grey B
// g+27 2 15/32 grey B
// g+29 1 16/32 grey B
// g+30 2 17/32 grey B
// Animation 3 (full title screen)
.org 0x82D6B64 :: dh 0x008A // Enable 8-bit BG0
.org 0x80119C6 :: mov r0,0x88 // Disable BG1
// Animation 5 (quick title screen)
.org 0x82D6BD4 :: dh 0x008A // Enable 8-bit BG0
.org 0x82D6BE0 :: dh 0x1100 // Disable BG1
.org 0x870F580 :: .incbin "data/m2-title-background.bin"
.org 0x87128EC :: .incbin "data/m2-title-background-map.bin"
//==============================================================================
// Move stuff around in order to make space for the code
//==============================================================================
@ -1615,6 +1669,17 @@ flyovertextLater:
m2_coord_table_file:
.incbin "data/m2-coord-table-file-select.bin"
m2_title_background_pal_copyright:
.incbin "data/m2-title-background-pal-copyright.bin"
m2_title_background_pal_glow:
.incbin "data/m2-title-background-pal-glow.bin"
m2_title_text_pal_animated:
.incbin "data/m2-title-text-pal-animated.bin"
m2_title_text_pal_static:
.incbin "data/m2-title-text-pal-static.bin"
//==============================================================================
// Existing subroutines/data
@ -1678,7 +1743,7 @@ m2_coord_table_file:
.definelabel m2_curhpwindow_down ,0x80D41D8
.definelabel m2_sub_d6844 ,0x80D6844
.definelabel m2_setupbattlename ,0x80DCD00
.definelabel m2_stat_symb_checker ,0x8B0EDA4
.definelabel m2_stat_symb_checker ,0x8B0EDA4
.definelabel m2_div ,0x80F49D8
.definelabel m2_remainder ,0x80F4A70
.definelabel m2_items ,0x8B1D62C