mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
Match func_8006A1C4 as handle_save_data_and_read_controller (#375)
* WIP * WIP * WIP func_80078190 * Do some minor documenting and cleanup in sched.c * Restart func_80078190 and check in the WIP * Get func_80078190 back to something looking presentable * WIP render_texture_rectangle_scaled * Just about matched render_texture_rectangle_scaled * Match render_texture_rectangle_scaled * Minor documenting and cleanup * Minor cleanup * Cleanup * Some documenting * Match func_8006ECFC * Move some function definitions * Match func_8006EFDC * Minor documentation updates * NAme some functions, and do some documneting on fade transitons * Do a lot of documenting and WIP * document more, and near match WIP * Fixed documentation * Fix the write eeprom index macro * Match func_8006A1C4 * Name and document handle_save_data_and_read_controller * Typo fix * Split the second half of camera.c to controller.c. This is a fully matched and documented file! * Remove old includes that came from camera.c * Remove comment --------- Co-authored-by: Ryan Myers <foldor@gmail.com>
This commit is contained in:
@@ -1,173 +0,0 @@
|
||||
glabel func_8006A1C4
|
||||
/* 06ADC4 8006A1C4 27BDFFA8 */ addiu $sp, $sp, -0x58
|
||||
/* 06ADC8 8006A1C8 AFB20020 */ sw $s2, 0x20($sp)
|
||||
/* 06ADCC 8006A1CC 00809025 */ move $s2, $a0
|
||||
/* 06ADD0 8006A1D0 AFBF0024 */ sw $ra, 0x24($sp)
|
||||
/* 06ADD4 8006A1D4 AFA5005C */ sw $a1, 0x5c($sp)
|
||||
/* 06ADD8 8006A1D8 3C048012 */ lui $a0, %hi(sSIMesgQueue) # $a0, 0x8012
|
||||
/* 06ADDC 8006A1DC AFB1001C */ sw $s1, 0x1c($sp)
|
||||
/* 06ADE0 8006A1E0 AFB00018 */ sw $s0, 0x18($sp)
|
||||
/* 06ADE4 8006A1E4 248410E0 */ addiu $a0, %lo(sSIMesgQueue) # addiu $a0, $a0, 0x10e0
|
||||
/* 06ADE8 8006A1E8 27A50050 */ addiu $a1, $sp, 0x50
|
||||
/* 06ADEC 8006A1EC 0C0322EC */ jal osRecvMesg
|
||||
/* 06ADF0 8006A1F0 00003025 */ move $a2, $zero
|
||||
/* 06ADF4 8006A1F4 1440005D */ bnez $v0, .L8006A36C
|
||||
/* 06ADF8 8006A1F8 3C068012 */ lui $a2, %hi(sControllerData+24) # $a2, 0x8012
|
||||
/* 06ADFC 8006A1FC 3C028012 */ lui $v0, %hi(sControllerData) # $v0, 0x8012
|
||||
/* 06AE00 8006A200 3C038012 */ lui $v1, %hi(sControllerData+24) # $v1, 0x8012
|
||||
/* 06AE04 8006A204 24631128 */ addiu $v1, %lo(sControllerData+24) # addiu $v1, $v1, 0x1128
|
||||
/* 06AE08 8006A208 24421110 */ addiu $v0, %lo(sControllerData) # addiu $v0, $v0, 0x1110
|
||||
/* 06AE0C 8006A20C 24C61128 */ addiu $a2, %lo(sControllerData+24) # addiu $a2, $a2, 0x1128
|
||||
.L8006A210:
|
||||
/* 06AE10 8006A210 88410000 */ lwl $at, ($v0)
|
||||
/* 06AE14 8006A214 98410003 */ lwr $at, 3($v0)
|
||||
/* 06AE18 8006A218 24420006 */ addiu $v0, $v0, 6
|
||||
/* 06AE1C 8006A21C A8C10000 */ swl $at, ($a2)
|
||||
/* 06AE20 8006A220 B8C10003 */ swr $at, 3($a2)
|
||||
/* 06AE24 8006A224 9441FFFE */ lhu $at, -2($v0)
|
||||
/* 06AE28 8006A228 24C60006 */ addiu $a2, $a2, 6
|
||||
/* 06AE2C 8006A22C A4C1FFFE */ sh $at, -2($a2)
|
||||
/* 06AE30 8006A230 0043082B */ sltu $at, $v0, $v1
|
||||
/* 06AE34 8006A234 1420FFF6 */ bnez $at, .L8006A210
|
||||
/* 06AE38 8006A238 00000000 */ nop
|
||||
/* 06AE3C 8006A23C 3C048012 */ lui $a0, %hi(sControllerData) # $a0, 0x8012
|
||||
/* 06AE40 8006A240 0C033429 */ jal osContGetReadData
|
||||
/* 06AE44 8006A244 24841110 */ addiu $a0, %lo(sControllerData) # addiu $a0, $a0, 0x1110
|
||||
/* 06AE48 8006A248 12400043 */ beqz $s2, .L8006A358
|
||||
/* 06AE4C 8006A24C 8FA4005C */ lw $a0, 0x5c($sp)
|
||||
/* 06AE50 8006A250 0C01BAA4 */ jal get_settings
|
||||
/* 06AE54 8006A254 00000000 */ nop
|
||||
/* 06AE58 8006A258 32430003 */ andi $v1, $s2, 3
|
||||
/* 06AE5C 8006A25C 10600004 */ beqz $v1, .L8006A270
|
||||
/* 06AE60 8006A260 AFA2004C */ sw $v0, 0x4c($sp)
|
||||
/* 06AE64 8006A264 00402025 */ move $a0, $v0
|
||||
/* 06AE68 8006A268 0C01D174 */ jal read_eeprom_data
|
||||
/* 06AE6C 8006A26C 306500FF */ andi $a1, $v1, 0xff
|
||||
.L8006A270:
|
||||
/* 06AE70 8006A270 32580008 */ andi $t8, $s2, 8
|
||||
/* 06AE74 8006A274 1300000D */ beqz $t8, .L8006A2AC
|
||||
/* 06AE78 8006A278 32590004 */ andi $t9, $s2, 4
|
||||
/* 06AE7C 8006A27C 0C027124 */ jal func_8009C490
|
||||
/* 06AE80 8006A280 00000000 */ nop
|
||||
/* 06AE84 8006A284 00008025 */ move $s0, $zero
|
||||
/* 06AE88 8006A288 00408825 */ move $s1, $v0
|
||||
.L8006A28C:
|
||||
/* 06AE8C 8006A28C 8E250000 */ lw $a1, ($s1)
|
||||
/* 06AE90 8006A290 0C01D081 */ jal func_80074204
|
||||
/* 06AE94 8006A294 02002025 */ move $a0, $s0
|
||||
/* 06AE98 8006A298 26100001 */ addiu $s0, $s0, 1
|
||||
/* 06AE9C 8006A29C 24010003 */ li $at, 3
|
||||
/* 06AEA0 8006A2A0 1601FFFA */ bne $s0, $at, .L8006A28C
|
||||
/* 06AEA4 8006A2A4 26310004 */ addiu $s1, $s1, 4
|
||||
/* 06AEA8 8006A2A8 32590004 */ andi $t9, $s2, 4
|
||||
.L8006A2AC:
|
||||
/* 06AEAC 8006A2AC 13200005 */ beqz $t9, .L8006A2C4
|
||||
/* 06AEB0 8006A2B0 00122203 */ sra $a0, $s2, 8
|
||||
/* 06AEB4 8006A2B4 308C0003 */ andi $t4, $a0, 3
|
||||
/* 06AEB8 8006A2B8 8FA5004C */ lw $a1, 0x4c($sp)
|
||||
/* 06AEBC 8006A2BC 0C01D081 */ jal func_80074204
|
||||
/* 06AEC0 8006A2C0 01802025 */ move $a0, $t4
|
||||
.L8006A2C4:
|
||||
/* 06AEC4 8006A2C4 32420030 */ andi $v0, $s2, 0x30
|
||||
/* 06AEC8 8006A2C8 00026903 */ sra $t5, $v0, 4
|
||||
/* 06AECC 8006A2CC 11A00005 */ beqz $t5, .L8006A2E4
|
||||
/* 06AED0 8006A2D0 324E0040 */ andi $t6, $s2, 0x40
|
||||
/* 06AED4 8006A2D4 8FA4004C */ lw $a0, 0x4c($sp)
|
||||
/* 06AED8 8006A2D8 0C01D1BC */ jal write_eeprom_data
|
||||
/* 06AEDC 8006A2DC 31A500FF */ andi $a1, $t5, 0xff
|
||||
/* 06AEE0 8006A2E0 324E0040 */ andi $t6, $s2, 0x40
|
||||
.L8006A2E4:
|
||||
/* 06AEE4 8006A2E4 11C00005 */ beqz $t6, .L8006A2FC
|
||||
/* 06AEE8 8006A2E8 00122283 */ sra $a0, $s2, 0xa
|
||||
/* 06AEEC 8006A2EC 308F0003 */ andi $t7, $a0, 3
|
||||
/* 06AEF0 8006A2F0 8FA5004C */ lw $a1, 0x4c($sp)
|
||||
/* 06AEF4 8006A2F4 0C01D137 */ jal write_save_data
|
||||
/* 06AEF8 8006A2F8 01E02025 */ move $a0, $t7
|
||||
.L8006A2FC:
|
||||
/* 06AEFC 8006A2FC 32580080 */ andi $t8, $s2, 0x80
|
||||
/* 06AF00 8006A300 13000005 */ beqz $t8, .L8006A318
|
||||
/* 06AF04 8006A304 00122283 */ sra $a0, $s2, 0xa
|
||||
/* 06AF08 8006A308 30990003 */ andi $t9, $a0, 3
|
||||
/* 06AF0C 8006A30C 8FA5004C */ lw $a1, 0x4c($sp)
|
||||
/* 06AF10 8006A310 0C01D0C7 */ jal erase_save_file
|
||||
/* 06AF14 8006A314 03202025 */ move $a0, $t9
|
||||
.L8006A318:
|
||||
/* 06AF18 8006A318 324C0100 */ andi $t4, $s2, 0x100
|
||||
/* 06AF1C 8006A31C 11800006 */ beqz $t4, .L8006A338
|
||||
/* 06AF20 8006A320 324D0200 */ andi $t5, $s2, 0x200
|
||||
/* 06AF24 8006A324 0C027A9B */ jal get_eeprom_settings_pointer
|
||||
/* 06AF28 8006A328 00000000 */ nop
|
||||
/* 06AF2C 8006A32C 0C01D21D */ jal read_eeprom_settings
|
||||
/* 06AF30 8006A330 00402025 */ move $a0, $v0
|
||||
/* 06AF34 8006A334 324D0200 */ andi $t5, $s2, 0x200
|
||||
.L8006A338:
|
||||
/* 06AF38 8006A338 11A00006 */ beqz $t5, .L8006A354
|
||||
/* 06AF3C 8006A33C 00009025 */ move $s2, $zero
|
||||
/* 06AF40 8006A340 0C027A9B */ jal get_eeprom_settings_pointer
|
||||
/* 06AF44 8006A344 00000000 */ nop
|
||||
/* 06AF48 8006A348 0C01D25F */ jal write_eeprom_settings
|
||||
/* 06AF4C 8006A34C 00402025 */ move $a0, $v0
|
||||
/* 06AF50 8006A350 00009025 */ move $s2, $zero
|
||||
.L8006A354:
|
||||
/* 06AF54 8006A354 8FA4005C */ lw $a0, 0x5c($sp)
|
||||
.L8006A358:
|
||||
/* 06AF58 8006A358 0C01C9C6 */ jal rumble_controllers
|
||||
/* 06AF5C 8006A35C 00000000 */ nop
|
||||
/* 06AF60 8006A360 3C048012 */ lui $a0, %hi(sSIMesgQueue) # $a0, 0x8012
|
||||
/* 06AF64 8006A364 0C0333F8 */ jal osContStartReadData
|
||||
/* 06AF68 8006A368 248410E0 */ addiu $a0, %lo(sSIMesgQueue) # addiu $a0, $a0, 0x10e0
|
||||
.L8006A36C:
|
||||
/* 06AF6C 8006A36C 3C0A800E */ lui $t2, %hi(sNoControllerPluggedIn) # $t2, 0x800e
|
||||
/* 06AF70 8006A370 3C09800E */ lui $t1, %hi(gButtonMask) # $t1, 0x800e
|
||||
/* 06AF74 8006A374 3C068012 */ lui $a2, %hi(sControllerData+24) # $a2, 0x8012
|
||||
/* 06AF78 8006A378 3C028012 */ lui $v0, %hi(sControllerData) # $v0, 0x8012
|
||||
/* 06AF7C 8006A37C 3C088012 */ lui $t0, %hi(gControllerButtonsPressed) # $t0, 0x8012
|
||||
/* 06AF80 8006A380 3C078012 */ lui $a3, %hi(gControllerButtonsReleased) # $a3, 0x8012
|
||||
/* 06AF84 8006A384 3C0B8012 */ lui $t3, %hi(sPlayerID) # $t3, 0x8012
|
||||
/* 06AF88 8006A388 9529D304 */ lhu $t1, %lo(gButtonMask)($t1)
|
||||
/* 06AF8C 8006A38C 8D4AD300 */ lw $t2, %lo(sNoControllerPluggedIn)($t2)
|
||||
/* 06AF90 8006A390 256B1150 */ addiu $t3, %lo(sPlayerID) # addiu $t3, $t3, 0x1150
|
||||
/* 06AF94 8006A394 24E71148 */ addiu $a3, %lo(gControllerButtonsReleased) # addiu $a3, $a3, 0x1148
|
||||
/* 06AF98 8006A398 25081140 */ addiu $t0, %lo(gControllerButtonsPressed) # addiu $t0, $t0, 0x1140
|
||||
/* 06AF9C 8006A39C 24421110 */ addiu $v0, %lo(sControllerData) # addiu $v0, $v0, 0x1110
|
||||
/* 06AFA0 8006A3A0 24C61128 */ addiu $a2, %lo(sControllerData+24) # addiu $a2, $a2, 0x1128
|
||||
.L8006A3A4:
|
||||
/* 06AFA4 8006A3A4 11400002 */ beqz $t2, .L8006A3B0
|
||||
/* 06AFA8 8006A3A8 00000000 */ nop
|
||||
/* 06AFAC 8006A3AC A4400000 */ sh $zero, ($v0)
|
||||
.L8006A3B0:
|
||||
/* 06AFB0 8006A3B0 94430000 */ lhu $v1, ($v0)
|
||||
/* 06AFB4 8006A3B4 94C40000 */ lhu $a0, ($a2)
|
||||
/* 06AFB8 8006A3B8 00000000 */ nop
|
||||
/* 06AFBC 8006A3BC 00642826 */ xor $a1, $v1, $a0
|
||||
/* 06AFC0 8006A3C0 00657024 */ and $t6, $v1, $a1
|
||||
/* 06AFC4 8006A3C4 0085C024 */ and $t8, $a0, $a1
|
||||
/* 06AFC8 8006A3C8 01C97824 */ and $t7, $t6, $t1
|
||||
/* 06AFCC 8006A3CC 0309C824 */ and $t9, $t8, $t1
|
||||
/* 06AFD0 8006A3D0 A50F0000 */ sh $t7, ($t0)
|
||||
/* 06AFD4 8006A3D4 11400002 */ beqz $t2, .L8006A3E0
|
||||
/* 06AFD8 8006A3D8 A4F90000 */ sh $t9, ($a3)
|
||||
/* 06AFDC 8006A3DC A4400006 */ sh $zero, 6($v0)
|
||||
.L8006A3E0:
|
||||
/* 06AFE0 8006A3E0 94430006 */ lhu $v1, 6($v0)
|
||||
/* 06AFE4 8006A3E4 94C40006 */ lhu $a0, 6($a2)
|
||||
/* 06AFE8 8006A3E8 24E70004 */ addiu $a3, $a3, 4
|
||||
/* 06AFEC 8006A3EC 00642826 */ xor $a1, $v1, $a0
|
||||
/* 06AFF0 8006A3F0 00656024 */ and $t4, $v1, $a1
|
||||
/* 06AFF4 8006A3F4 00857024 */ and $t6, $a0, $a1
|
||||
/* 06AFF8 8006A3F8 01C97824 */ and $t7, $t6, $t1
|
||||
/* 06AFFC 8006A3FC 01896824 */ and $t5, $t4, $t1
|
||||
/* 06B000 8006A400 A50D0002 */ sh $t5, 2($t0)
|
||||
/* 06B004 8006A404 A4EFFFFE */ sh $t7, -2($a3)
|
||||
/* 06B008 8006A408 24C6000C */ addiu $a2, $a2, 0xc
|
||||
/* 06B00C 8006A40C 2442000C */ addiu $v0, $v0, 0xc
|
||||
/* 06B010 8006A410 14EBFFE4 */ bne $a3, $t3, .L8006A3A4
|
||||
/* 06B014 8006A414 25080004 */ addiu $t0, $t0, 4
|
||||
/* 06B018 8006A418 8FBF0024 */ lw $ra, 0x24($sp)
|
||||
/* 06B01C 8006A41C 02401025 */ move $v0, $s2
|
||||
/* 06B020 8006A420 8FB20020 */ lw $s2, 0x20($sp)
|
||||
/* 06B024 8006A424 8FB00018 */ lw $s0, 0x18($sp)
|
||||
/* 06B028 8006A428 8FB1001C */ lw $s1, 0x1c($sp)
|
||||
/* 06B02C 8006A42C 03E00008 */ jr $ra
|
||||
/* 06B030 8006A430 27BD0058 */ addiu $sp, $sp, 0x58
|
||||
|
||||
@@ -105,7 +105,7 @@ glabel func_8006DCF8
|
||||
/* 06EA74 8006DE74 00000000 */ nop
|
||||
/* 06EA78 8006DE78 0C027068 */ jal get_save_file_index
|
||||
/* 06EA7C 8006DE7C 00000000 */ nop
|
||||
/* 06EA80 8006DE80 0C01BB12 */ jal func_8006EC48
|
||||
/* 06EA80 8006DE80 0C01BB12 */ jal safe_mark_write_save_file
|
||||
/* 06EA84 8006DE84 00402025 */ move $a0, $v0
|
||||
/* 06EA88 8006DE88 10000114 */ b .L8006E2DC
|
||||
/* 06EA8C 8006DE8C 8FBF0024 */ lw $ra, 0x24($sp)
|
||||
@@ -164,7 +164,7 @@ glabel L8006DF00
|
||||
/* 06EB54 8006DF54 00000000 */ nop
|
||||
/* 06EB58 8006DF58 0C027068 */ jal get_save_file_index
|
||||
/* 06EB5C 8006DF5C 00000000 */ nop
|
||||
/* 06EB60 8006DF60 0C01BB12 */ jal func_8006EC48
|
||||
/* 06EB60 8006DF60 0C01BB12 */ jal safe_mark_write_save_file
|
||||
/* 06EB64 8006DF64 00402025 */ move $a0, $v0
|
||||
/* 06EB68 8006DF68 100000DC */ b .L8006E2DC
|
||||
/* 06EB6C 8006DF6C 8FBF0024 */ lw $ra, 0x24($sp)
|
||||
@@ -206,7 +206,7 @@ glabel L8006DF70
|
||||
/* 06EBF0 8006DFF0 00000000 */ nop
|
||||
/* 06EBF4 8006DFF4 0C027068 */ jal get_save_file_index
|
||||
/* 06EBF8 8006DFF8 00000000 */ nop
|
||||
/* 06EBFC 8006DFFC 0C01BB12 */ jal func_8006EC48
|
||||
/* 06EBFC 8006DFFC 0C01BB12 */ jal safe_mark_write_save_file
|
||||
/* 06EC00 8006E000 00402025 */ move $a0, $v0
|
||||
/* 06EC04 8006E004 100000B5 */ b .L8006E2DC
|
||||
/* 06EC08 8006E008 8FBF0024 */ lw $ra, 0x24($sp)
|
||||
|
||||
@@ -47,7 +47,7 @@ glabel L80086B54
|
||||
/* 087798 80086B98 8FBF0014 */ lw $ra, 0x14($sp)
|
||||
.L80086B9C:
|
||||
/* 08779C 80086B9C 90640006 */ lbu $a0, 6($v1)
|
||||
/* 0877A0 80086BA0 0C01BB06 */ jal func_8006EC18
|
||||
/* 0877A0 80086BA0 0C01BB06 */ jal force_mark_write_save_file
|
||||
/* 0877A4 80086BA4 AFA60028 */ sw $a2, 0x28($sp)
|
||||
/* 0877A8 80086BA8 3C098012 */ lui $t1, %hi(D_80126BE4) # $t1, 0x8012
|
||||
/* 0877AC 80086BAC 25296BE4 */ addiu $t1, %lo(D_80126BE4) # addiu $t1, $t1, 0x6be4
|
||||
@@ -111,7 +111,7 @@ glabel L80086B54
|
||||
/* 087890 80086C90 AFA20038 */ sw $v0, 0x38($sp)
|
||||
.L80086C94:
|
||||
/* 087894 80086C94 90E40006 */ lbu $a0, 6($a3)
|
||||
/* 087898 80086C98 0C01BB2B */ jal func_8006ECAC
|
||||
/* 087898 80086C98 0C01BB2B */ jal mark_save_file_to_erase
|
||||
/* 08789C 80086C9C 00000000 */ nop
|
||||
/* 0878A0 80086CA0 3C198012 */ lui $t9, %hi(D_80126BD4) # $t9, 0x8012
|
||||
/* 0878A4 80086CA4 8F396BD4 */ lw $t9, %lo(D_80126BD4)($t9)
|
||||
@@ -152,7 +152,7 @@ glabel L80086CDC
|
||||
.L80086D2C:
|
||||
/* 08792C 80086D2C 0C01B9DC */ jal func_8006E770
|
||||
/* 087930 80086D30 24050003 */ li $a1, 3
|
||||
/* 087934 80086D34 0C01BAFF */ jal func_8006EBFC
|
||||
/* 087934 80086D34 0C01BAFF */ jal mark_to_write_flap_and_course_times
|
||||
/* 087938 80086D38 00000000 */ nop
|
||||
/* 08793C 80086D3C 3C0500FF */ lui $a1, (0x00FFFFF0 >> 16) # lui $a1, 0xff
|
||||
/* 087940 80086D40 34A5FFF0 */ ori $a1, (0x00FFFFF0 & 0xFFFF) # ori $a1, $a1, 0xfff0
|
||||
@@ -213,7 +213,7 @@ glabel L80086D54
|
||||
/* 087A10 80086E10 000A7900 */ sll $t7, $t2, 4
|
||||
/* 087A14 80086E14 016F6821 */ addu $t5, $t3, $t7
|
||||
/* 087A18 80086E18 91A40006 */ lbu $a0, 6($t5)
|
||||
/* 087A1C 80086E1C 0C01BB06 */ jal func_8006EC18
|
||||
/* 087A1C 80086E1C 0C01BB06 */ jal force_mark_write_save_file
|
||||
/* 087A20 80086E20 AFA60028 */ sw $a2, 0x28($sp)
|
||||
/* 087A24 80086E24 3C098012 */ lui $t1, %hi(D_80126BE4) # $t1, 0x8012
|
||||
/* 087A28 80086E28 25296BE4 */ addiu $t1, %lo(D_80126BE4) # addiu $t1, $t1, 0x6be4
|
||||
@@ -367,7 +367,7 @@ glabel L80086F74
|
||||
/* 087C54 80087054 00C02825 */ move $a1, $a2
|
||||
/* 087C58 80087058 AFA20038 */ sw $v0, 0x38($sp)
|
||||
.L8008705C:
|
||||
/* 087C5C 8008705C 0C01BAD7 */ jal func_8006EB5C
|
||||
/* 087C5C 8008705C 0C01BAD7 */ jal mark_to_read_flap_and_course_times
|
||||
/* 087C60 80087060 00000000 */ nop
|
||||
/* 087C64 80087064 10000059 */ b .L800871CC
|
||||
/* 087C68 80087068 8FBF0014 */ lw $ra, 0x14($sp)
|
||||
|
||||
@@ -34,7 +34,7 @@ glabel func_8008B4C8
|
||||
/* 08C140 8008B540 00008025 */ move $s0, $zero
|
||||
/* 08C144 8008B544 24120001 */ li $s2, 1
|
||||
/* 08C148 8008B548 3C01800E */ lui $at, %hi(gMenuDelay) # $at, 0x800e
|
||||
/* 08C14C 8008B54C 0C01BAEA */ jal func_8006EBA8
|
||||
/* 08C14C 8008B54C 0C01BAEA */ jal mark_read_all_save_files
|
||||
/* 08C150 8008B550 AC32F47C */ sw $s2, %lo(gMenuDelay)($at)
|
||||
/* 08C154 8008B554 3C04800E */ lui $a0, %hi(sMenuTransitionFadeIn) # $a0, 0x800e
|
||||
/* 08C158 8008B558 0C030076 */ jal transition_begin
|
||||
|
||||
@@ -980,7 +980,7 @@ glabel L800964DC
|
||||
/* 097120 80096520 304F007F */ andi $t7, $v0, 0x7f
|
||||
/* 097124 80096524 11E00008 */ beqz $t7, .L80096548
|
||||
/* 097128 80096528 304D0080 */ andi $t5, $v0, 0x80
|
||||
/* 09712C 8009652C 0C01BAF1 */ jal func_8006EBC4
|
||||
/* 09712C 8009652C 0C01BAF1 */ jal mark_to_write_flap_times
|
||||
/* 097130 80096530 00000000 */ nop
|
||||
/* 097134 80096534 8FB8002C */ lw $t8, 0x2c($sp)
|
||||
/* 097138 80096538 00000000 */ nop
|
||||
@@ -990,7 +990,7 @@ glabel L800964DC
|
||||
.L80096548:
|
||||
/* 097148 80096548 11A00004 */ beqz $t5, .L8009655C
|
||||
/* 09714C 8009654C 00002025 */ move $a0, $zero
|
||||
/* 097150 80096550 0C01BAF8 */ jal func_8006EBE0
|
||||
/* 097150 80096550 0C01BAF8 */ jal mark_to_write_course_times
|
||||
/* 097154 80096554 00000000 */ nop
|
||||
/* 097158 80096558 00002025 */ move $a0, $zero
|
||||
.L8009655C:
|
||||
|
||||
@@ -384,7 +384,7 @@ glabel menu_trophy_race_rankings_loop
|
||||
/* 09A168 80099568 A56E000E */ sh $t6, 0xe($t3)
|
||||
/* 09A16C 8009956C 0C027068 */ jal get_save_file_index
|
||||
/* 09A170 80099570 AFAC0034 */ sw $t4, 0x34($sp)
|
||||
/* 09A174 80099574 0C01BB12 */ jal func_8006EC48
|
||||
/* 09A174 80099574 0C01BB12 */ jal safe_mark_write_save_file
|
||||
/* 09A178 80099578 00402025 */ move $a0, $v0
|
||||
/* 09A17C 8009957C 8FAC0034 */ lw $t4, 0x34($sp)
|
||||
/* 09A180 80099580 00000000 */ nop
|
||||
|
||||
@@ -274,10 +274,10 @@ glabel render_file_select_menu
|
||||
/* 08DD74 8008D174 3C088012 */ lui $t0, %hi(D_80126488) # $t0, 0x8012
|
||||
/* 08DD78 8008D178 3C028012 */ lui $v0, %hi(D_80126494) # $v0, 0x8012
|
||||
/* 08DD7C 8008D17C 8C426494 */ lw $v0, %lo(D_80126494)($v0)
|
||||
/* 08DD80 8008D180 3C188012 */ lui $t8, %hi(D_8012648C) # $t8, 0x8012
|
||||
/* 08DD80 8008D180 3C188012 */ lui $t8, %hi(gSaveFileIndex3) # $t8, 0x8012
|
||||
/* 08DD84 8008D184 14400007 */ bnez $v0, .L8008D1A4
|
||||
/* 08DD88 8008D188 00000000 */ nop
|
||||
/* 08DD8C 8008D18C 8F18648C */ lw $t8, %lo(D_8012648C)($t8)
|
||||
/* 08DD8C 8008D18C 8F18648C */ lw $t8, %lo(gSaveFileIndex3)($t8)
|
||||
/* 08DD90 8008D190 00000000 */ nop
|
||||
/* 08DD94 8008D194 16780003 */ bne $s3, $t8, .L8008D1A4
|
||||
/* 08DD98 8008D198 00000000 */ nop
|
||||
@@ -285,8 +285,8 @@ glabel render_file_select_menu
|
||||
/* 08DDA0 8008D1A0 24120001 */ li $s2, 1
|
||||
.L8008D1A4:
|
||||
/* 08DDA4 8008D1A4 1840001A */ blez $v0, .L8008D210
|
||||
/* 08DDA8 8008D1A8 3C198012 */ lui $t9, %hi(D_80126490) # $t9, 0x8012
|
||||
/* 08DDAC 8008D1AC 8F396490 */ lw $t9, %lo(D_80126490)($t9)
|
||||
/* 08DDA8 8008D1A8 3C198012 */ lui $t9, %hi(gSaveFileIndex2) # $t9, 0x8012
|
||||
/* 08DDAC 8008D1AC 8F396490 */ lw $t9, %lo(gSaveFileIndex2)($t9)
|
||||
/* 08DDB0 8008D1B0 00000000 */ nop
|
||||
/* 08DDB4 8008D1B4 16790016 */ bne $s3, $t9, .L8008D210
|
||||
/* 08DDB8 8008D1B8 00000000 */ nop
|
||||
@@ -294,10 +294,10 @@ glabel render_file_select_menu
|
||||
/* 08DDC0 8008D1C0 24120001 */ li $s2, 1
|
||||
.L8008D1C4:
|
||||
/* 08DDC4 8008D1C4 8D086488 */ lw $t0, %lo(D_80126488)($t0)
|
||||
/* 08DDC8 8008D1C8 3C098012 */ lui $t1, %hi(D_8012648C) # $t1, 0x8012
|
||||
/* 08DDC8 8008D1C8 3C098012 */ lui $t1, %hi(gSaveFileIndex3) # $t1, 0x8012
|
||||
/* 08DDCC 8008D1CC 11000007 */ beqz $t0, .L8008D1EC
|
||||
/* 08DDD0 8008D1D0 3C0A8012 */ lui $t2, %hi(D_801263E0) # $t2, 0x8012
|
||||
/* 08DDD4 8008D1D4 8D29648C */ lw $t1, %lo(D_8012648C)($t1)
|
||||
/* 08DDD4 8008D1D4 8D29648C */ lw $t1, %lo(gSaveFileIndex3)($t1)
|
||||
/* 08DDD8 8008D1D8 00000000 */ nop
|
||||
/* 08DDDC 8008D1DC 1669000C */ bne $s3, $t1, .L8008D210
|
||||
/* 08DDE0 8008D1E0 00000000 */ nop
|
||||
|
||||
@@ -1390,7 +1390,7 @@ glabel L8000D98C
|
||||
/* 00EC00 8000E000 02402025 */ move $a0, $s2
|
||||
/* 00EC04 8000E004 0C027068 */ jal get_save_file_index
|
||||
/* 00EC08 8000E008 00000000 */ nop
|
||||
/* 00EC0C 8000E00C 0C01BB12 */ jal func_8006EC48
|
||||
/* 00EC0C 8000E00C 0C01BB12 */ jal safe_mark_write_save_file
|
||||
/* 00EC10 8000E010 00402025 */ move $a0, $v0
|
||||
.L8000E014:
|
||||
/* 00EC14 8000E014 8FAE0130 */ lw $t6, 0x130($sp)
|
||||
|
||||
@@ -132,7 +132,7 @@ glabel func_80022E18
|
||||
/* 023C08 80023008 01054825 */ or $t1, $t0, $a1
|
||||
/* 023C0C 8002300C 0C027068 */ jal get_save_file_index
|
||||
/* 023C10 80023010 A4C90014 */ sh $t1, 0x14($a2)
|
||||
/* 023C14 80023014 0C01BB12 */ jal func_8006EC48
|
||||
/* 023C14 80023014 0C01BB12 */ jal safe_mark_write_save_file
|
||||
/* 023C18 80023018 00402025 */ move $a0, $v0
|
||||
/* 023C1C 8002301C 10000004 */ b .L80023030
|
||||
/* 023C20 80023020 8FAB001C */ lw $t3, 0x1c($sp)
|
||||
|
||||
@@ -325,7 +325,7 @@ glabel func_8005CB68
|
||||
/* 05DC14 8005D014 25CF0001 */ addiu $t7, $t6, 1
|
||||
/* 05DC18 8005D018 0C027068 */ jal get_save_file_index
|
||||
/* 05DC1C 8005D01C A3AF0043 */ sb $t7, 0x43($sp)
|
||||
/* 05DC20 8005D020 0C01BB12 */ jal func_8006EC48
|
||||
/* 05DC20 8005D020 0C01BB12 */ jal safe_mark_write_save_file
|
||||
/* 05DC24 8005D024 00402025 */ move $a0, $v0
|
||||
.L8005D028:
|
||||
/* 05DC28 8005D028 83AD0043 */ lb $t5, 0x43($sp)
|
||||
|
||||
+1
-1
@@ -184,7 +184,7 @@ void dmacopy(u32 romOffset, u32 ramAddress, s32 numBytes) {
|
||||
numBytesToDMA = numBytes;
|
||||
}
|
||||
osPiStartDma(&gAssetsDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, romOffset, (u32 *) ramAddress, numBytesToDMA, &gDmaMesgQueue);
|
||||
osRecvMesg(&gDmaMesgQueue, &dmaMesg, 1);
|
||||
osRecvMesg(&gDmaMesgQueue, &dmaMesg, OS_MESG_BLOCK);
|
||||
numBytes -= numBytesToDMA;
|
||||
romOffset += numBytesToDMA;
|
||||
ramAddress += numBytesToDMA;
|
||||
|
||||
+1
-1
@@ -241,7 +241,7 @@ static void __amMain(UNUSED void *arg) {
|
||||
osScAddClient(gAudioSched, (OSScClient *) &audioStack, &__am.audioFrameMsgQ, OS_MESG_BLOCK);
|
||||
|
||||
while (!done) {
|
||||
(void) osRecvMesg(&__am.audioFrameMsgQ, (OSMesg *) &msg, 1);
|
||||
(void) osRecvMesg(&__am.audioFrameMsgQ, (OSMesg *) &msg, OS_MESG_BLOCK);
|
||||
switch (msg->gen.type) {
|
||||
case OS_SC_RETRACE_MSG:
|
||||
//TODO: Check type of ACMDList?
|
||||
|
||||
-164
@@ -95,10 +95,6 @@ u8 D_800DD2F8[8] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
s32 sNoControllerPluggedIn = FALSE; // Looks to be a boolean for whether a controller is plugged in. FALSE if plugged in, and TRUE if not.
|
||||
|
||||
s16 gButtonMask = 0xFFFF;
|
||||
|
||||
/*******************************/
|
||||
|
||||
/************ .bss ************/
|
||||
@@ -133,15 +129,6 @@ MatrixS gPerspectiveMatrixS;
|
||||
MatrixS D_80121020;
|
||||
Matrix D_80121060;
|
||||
Matrix D_801210A0;
|
||||
OSMesgQueue sSIMesgQueue;
|
||||
OSMesg sSIMesgBuf;
|
||||
OSMesg gSIMesg;
|
||||
OSContStatus status;
|
||||
UNUSED s32 D_80121108[2]; //Padding?
|
||||
OSContPad sControllerData[8];
|
||||
u16 gControllerButtonsPressed[4];
|
||||
u16 gControllerButtonsReleased[4];
|
||||
u8 sPlayerID[16];
|
||||
|
||||
/******************************/
|
||||
|
||||
@@ -1375,154 +1362,3 @@ UNUSED void debug_print_float_matrix_values(f32 *mtx) {
|
||||
}
|
||||
rmonPrintf("\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the serial interface message queue.
|
||||
*/
|
||||
OSMesgQueue *get_si_mesg_queue(void) {
|
||||
return &sSIMesgQueue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialise the player controllers, and return the status when finished.
|
||||
*/
|
||||
s32 init_controllers(void) {
|
||||
UNUSED s32 *temp1;
|
||||
u8 bitpattern;
|
||||
UNUSED s32 *temp2;
|
||||
|
||||
osCreateMesgQueue(&sSIMesgQueue, &sSIMesgBuf, 1);
|
||||
osSetEventMesg(OS_EVENT_SI, &sSIMesgQueue, gSIMesg);
|
||||
osContInit(&sSIMesgQueue, &bitpattern, &status);
|
||||
osContStartReadData(&sSIMesgQueue);
|
||||
initialise_player_ids();
|
||||
|
||||
sNoControllerPluggedIn = FALSE;
|
||||
|
||||
if ((bitpattern & CONT_ABSOLUTE) && (!(status.errno & CONT_NO_RESPONSE_ERROR))) {
|
||||
return CONTROLLER_EXISTS;
|
||||
}
|
||||
|
||||
if (!bitpattern) {} // Fakematch
|
||||
|
||||
sNoControllerPluggedIn = TRUE;
|
||||
|
||||
return CONTROLLER_MISSING;
|
||||
}
|
||||
|
||||
GLOBAL_ASM("asm/non_matchings/camera/func_8006A1C4.s")
|
||||
|
||||
/**
|
||||
* Set the first 4 player ID's to the controller numbers, so players can input in the menus after boot.
|
||||
* Official name: joyResetMap
|
||||
*/
|
||||
void initialise_player_ids(void) {
|
||||
s32 i;
|
||||
for (i = 0; i < MAXCONTROLLERS; i++) {
|
||||
sPlayerID[i] = i;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign the first four player ID's to the index of the connected players.
|
||||
* Assign the next four player ID's to the index of the players who are not connected.
|
||||
* Official name: joyCreateMap
|
||||
*/
|
||||
void assign_player_ids(s8 *activePlayers) {
|
||||
s32 i;
|
||||
s32 temp = 0;
|
||||
for (i = 0; i < MAXCONTROLLERS; i++) {
|
||||
if (activePlayers[i]) {
|
||||
sPlayerID[temp++] = i;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < MAXCONTROLLERS; i++) {
|
||||
if (!activePlayers[i]) {
|
||||
sPlayerID[temp++] = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the id of the selected index.
|
||||
* Official name: joyGetController
|
||||
*/
|
||||
u8 get_player_id(s32 player) {
|
||||
return sPlayerID[player];
|
||||
}
|
||||
|
||||
/**
|
||||
* Swaps the ID's of the first two indexes.
|
||||
* This applies in 2 player adventure, so that player 2 can control the car in the overworld.
|
||||
*/
|
||||
void swap_player_1_and_2_ids(void) {
|
||||
u8 tempID = sPlayerID[0];
|
||||
sPlayerID[0] = sPlayerID[1];
|
||||
sPlayerID[1] = tempID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the buttons that are currently pressed down on the controller.
|
||||
* Official name: joyGetButtons
|
||||
*/
|
||||
u16 get_buttons_held_from_player(s32 player) {
|
||||
return sControllerData[sPlayerID[player]].button;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the buttons that are newly pressed during that frame.
|
||||
* NOTE: This was a u16, but we only got a match in menu_ghost_data_loop when it was a u32 for some reason
|
||||
*/
|
||||
u32 get_buttons_pressed_from_player(s32 player) {
|
||||
return gControllerButtonsPressed[sPlayerID[player]];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the buttons that are no longer pressed in that frame.
|
||||
*/
|
||||
u16 get_buttons_released_from_player(s32 player) {
|
||||
return gControllerButtonsReleased[sPlayerID[player]];
|
||||
}
|
||||
|
||||
/**
|
||||
* Clamps the X joystick axis of the selected player to 70 and returns it.
|
||||
*/
|
||||
s8 clamp_joystick_x_axis(s32 player) {
|
||||
return clamp_joystick(sControllerData[sPlayerID[player]].stick_x);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clamps the Y joystick axis of the selected player to 70 and returns it.
|
||||
*/
|
||||
s8 clamp_joystick_y_axis(s32 player) {
|
||||
return clamp_joystick(sControllerData[sPlayerID[player]].stick_y);
|
||||
}
|
||||
|
||||
/**
|
||||
* Keeps the joysticks axis reads no higher than 70 (of a possible 127 or -128)
|
||||
* Will also pull the reading towards the centre.
|
||||
*/
|
||||
s8 clamp_joystick(s8 stickMag) {
|
||||
if (stickMag < JOYSTICK_DEADZONE && stickMag > -JOYSTICK_DEADZONE) {
|
||||
return 0;
|
||||
}
|
||||
if (stickMag > 0) {
|
||||
stickMag -= 8;
|
||||
if (stickMag > JOYSTICK_MAX_RANGE) {
|
||||
stickMag = JOYSTICK_MAX_RANGE;
|
||||
}
|
||||
} else {
|
||||
stickMag += 8;
|
||||
if (stickMag < -JOYSTICK_MAX_RANGE) {
|
||||
stickMag = -JOYSTICK_MAX_RANGE;
|
||||
}
|
||||
}
|
||||
return stickMag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used when anti-cheat/anti-tamper has failed in func_8006A6B0()
|
||||
*/
|
||||
void disable_button_mask(void) {
|
||||
gButtonMask = 0;
|
||||
}
|
||||
|
||||
@@ -120,19 +120,6 @@ Matrix *func_80069DBC(void);
|
||||
f32 func_80069DC8(f32 x, f32 y, f32 z);
|
||||
void set_camera_shake_by_distance(f32 x, f32 y, f32 z, f32 dist, f32 magnitude);
|
||||
void set_camera_shake(f32 magnitude);
|
||||
OSMesgQueue *get_si_mesg_queue(void);
|
||||
void initialise_player_ids(void);
|
||||
void assign_player_ids(s8 *activePlayers);
|
||||
u8 get_player_id(s32 player);
|
||||
void swap_player_1_and_2_ids(void);
|
||||
u16 get_buttons_held_from_player(s32 player);
|
||||
u32 get_buttons_pressed_from_player(s32 player);
|
||||
u16 get_buttons_released_from_player(s32 player);
|
||||
s8 clamp_joystick_x_axis(s32 player);
|
||||
s8 clamp_joystick_y_axis(s32 player);
|
||||
s8 clamp_joystick(s8 stickMag);
|
||||
void disable_button_mask(void);
|
||||
s32 init_controllers(void);
|
||||
void func_80067D3C(Gfx **dlist, MatrixS **mats);
|
||||
void render_ortho_triangle_image(Gfx **dList, MatrixS **mtx, Vertex **vtx, ObjectSegment *segment, Sprite *sprite, s32 flags);
|
||||
s32 render_sprite_billboard(Gfx **dlist, MatrixS **mtx, Vertex **vertexList, Object *obj, unk80068514_arg4 *arg4, s32 flags);
|
||||
@@ -143,7 +130,6 @@ void copy_viewports_to_stack(void);
|
||||
|
||||
// Non Matching
|
||||
void func_80065EA0(void);
|
||||
s32 func_8006A1C4(s32 arg0, s32 logicUpdateRate);
|
||||
void func_80066CDC(Gfx **dlist, MatrixS **mats);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,232 @@
|
||||
/* The comment below is needed for this file to be picked up by generate_ld */
|
||||
/* RAM_POS: 0x8006A100 */
|
||||
|
||||
#include "controller.h"
|
||||
#include "game.h"
|
||||
|
||||
s32 sNoControllerPluggedIn = FALSE; // Looks to be a boolean for whether a controller is plugged in. FALSE if plugged in, and TRUE if not.
|
||||
u16 gButtonMask = 0xFFFF; //Used when anti-cheat/anti-tamper has failed in func_8006A6B0()
|
||||
|
||||
OSMesgQueue sSIMesgQueue;
|
||||
OSMesg sSIMesgBuf;
|
||||
OSMesg gSIMesg;
|
||||
OSContStatus status;
|
||||
UNUSED s32 D_80121108[2];
|
||||
OSContPad sControllerCurrData[MAXCONTROLLERS];
|
||||
OSContPad sControllerPrevData[MAXCONTROLLERS];
|
||||
u16 gControllerButtonsPressed[MAXCONTROLLERS];
|
||||
u16 gControllerButtonsReleased[MAXCONTROLLERS];
|
||||
u8 sPlayerID[16];
|
||||
|
||||
/**
|
||||
* Return the serial interface message queue.
|
||||
*/
|
||||
OSMesgQueue *get_si_mesg_queue(void) {
|
||||
return &sSIMesgQueue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialise the player controllers, and return the status when finished.
|
||||
*/
|
||||
s32 init_controllers(void) {
|
||||
UNUSED s32 *temp1;
|
||||
u8 bitpattern;
|
||||
UNUSED s32 *temp2;
|
||||
|
||||
osCreateMesgQueue(&sSIMesgQueue, &sSIMesgBuf, 1);
|
||||
osSetEventMesg(OS_EVENT_SI, &sSIMesgQueue, gSIMesg);
|
||||
osContInit(&sSIMesgQueue, &bitpattern, &status);
|
||||
osContStartReadData(&sSIMesgQueue);
|
||||
initialise_player_ids();
|
||||
|
||||
sNoControllerPluggedIn = FALSE;
|
||||
|
||||
if ((bitpattern & CONT_ABSOLUTE) && (!(status.errno & CONT_NO_RESPONSE_ERROR))) {
|
||||
return CONTROLLER_EXISTS;
|
||||
}
|
||||
|
||||
if (!bitpattern) {} // Fakematch
|
||||
|
||||
sNoControllerPluggedIn = TRUE;
|
||||
|
||||
return CONTROLLER_MISSING;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads arg0 for a set of flags on whether to read, write, or erase any save data.
|
||||
* Also reads the latest inputs from the controllers, and sets their values.
|
||||
*/
|
||||
s32 handle_save_data_and_read_controller(s32 saveDataFlags, s32 updateRate) {
|
||||
Settings **allSaves;
|
||||
OSMesg unusedMsg;
|
||||
Settings *settings;
|
||||
s32 i;
|
||||
|
||||
if (osRecvMesg(&sSIMesgQueue, &unusedMsg, OS_MESG_NOBLOCK) == 0) {
|
||||
//Back up old controller data
|
||||
for (i = 0; i < MAXCONTROLLERS; i++) {
|
||||
sControllerPrevData[i] = sControllerCurrData[i];
|
||||
}
|
||||
osContGetReadData(sControllerCurrData);
|
||||
if (saveDataFlags != 0) {
|
||||
settings = get_settings();
|
||||
if (SAVE_DATA_FLAG_READ_EEPROM_INDEX(saveDataFlags)) {
|
||||
read_eeprom_data(settings, SAVE_DATA_FLAG_READ_EEPROM_INDEX(saveDataFlags));
|
||||
}
|
||||
if (saveDataFlags & SAVE_DATA_FLAG_READ_ALL_SAVE_DATA) {
|
||||
allSaves = get_all_save_files_ptr();
|
||||
for (i = 0; i < NUMBER_OF_SAVE_FILES; i++) {
|
||||
read_save_file(i, allSaves[i]);
|
||||
}
|
||||
}
|
||||
if (saveDataFlags & SAVE_DATA_FLAG_READ_SAVE_DATA) {
|
||||
read_save_file(SAVE_DATA_FLAG_READ_SAVE_FILE_NUMBER(saveDataFlags), settings);
|
||||
}
|
||||
if (SAVE_DATA_FLAG_WRITE_EEPROM_INDEX(saveDataFlags)) {
|
||||
write_eeprom_data(settings, SAVE_DATA_FLAG_WRITE_EEPROM_INDEX(saveDataFlags));
|
||||
}
|
||||
if (saveDataFlags & SAVE_DATA_FLAG_WRITE_SAVE_DATA) {
|
||||
write_save_data(SAVE_DATA_FLAG_WRITE_SAVE_FILE_NUMBER(saveDataFlags), settings);
|
||||
}
|
||||
if (saveDataFlags & SAVE_DATA_FLAG_ERASE_SAVE_DATA) {
|
||||
erase_save_file(SAVE_DATA_FLAG_WRITE_SAVE_FILE_NUMBER(saveDataFlags), settings);
|
||||
}
|
||||
// @bug These next two if statements check the same bits
|
||||
// as the ones used to set the save file number to read from.
|
||||
if (saveDataFlags & SAVE_DATA_FLAG_READ_EEPROM_SETTINGS) {
|
||||
read_eeprom_settings(get_eeprom_settings_pointer());
|
||||
}
|
||||
if (saveDataFlags & SAVE_DATA_FLAG_WRITE_EEPROM_SETTINGS) {
|
||||
write_eeprom_settings(get_eeprom_settings_pointer());
|
||||
}
|
||||
//Reset all flags
|
||||
saveDataFlags = 0;
|
||||
}
|
||||
rumble_controllers(updateRate);
|
||||
osContStartReadData(&sSIMesgQueue);
|
||||
}
|
||||
for (i = 0; i < MAXCONTROLLERS; i++) {
|
||||
if (sNoControllerPluggedIn) {
|
||||
sControllerCurrData[i].button = 0;
|
||||
}
|
||||
//XOR the diff between the last read of the controller data with the current read to see what buttons have been pushed and released.
|
||||
gControllerButtonsPressed[i] = ((sControllerCurrData[i].button ^ sControllerPrevData[i].button) & sControllerCurrData[i].button) & gButtonMask;
|
||||
gControllerButtonsReleased[i] = ((sControllerCurrData[i].button ^ sControllerPrevData[i].button) & sControllerPrevData[i].button) & gButtonMask;
|
||||
}
|
||||
return saveDataFlags;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the first 4 player ID's to the controller numbers, so players can input in the menus after boot.
|
||||
* Official name: joyResetMap
|
||||
*/
|
||||
void initialise_player_ids(void) {
|
||||
s32 i;
|
||||
for (i = 0; i < MAXCONTROLLERS; i++) {
|
||||
sPlayerID[i] = i;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign the first four player ID's to the index of the connected players.
|
||||
* Assign the next four player ID's to the index of the players who are not connected.
|
||||
* Official name: joyCreateMap
|
||||
*/
|
||||
void assign_player_ids(s8 *activePlayers) {
|
||||
s32 i;
|
||||
s32 temp = 0;
|
||||
for (i = 0; i < MAXCONTROLLERS; i++) {
|
||||
if (activePlayers[i]) {
|
||||
sPlayerID[temp++] = i;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < MAXCONTROLLERS; i++) {
|
||||
if (!activePlayers[i]) {
|
||||
sPlayerID[temp++] = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the id of the selected index.
|
||||
* Official name: joyGetController
|
||||
*/
|
||||
u8 get_player_id(s32 player) {
|
||||
return sPlayerID[player];
|
||||
}
|
||||
|
||||
/**
|
||||
* Swaps the ID's of the first two indexes.
|
||||
* This applies in 2 player adventure, so that player 2 can control the car in the overworld.
|
||||
*/
|
||||
void swap_player_1_and_2_ids(void) {
|
||||
u8 tempID = sPlayerID[0];
|
||||
sPlayerID[0] = sPlayerID[1];
|
||||
sPlayerID[1] = tempID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the buttons that are currently pressed down on the controller.
|
||||
* Official name: joyGetButtons
|
||||
*/
|
||||
u16 get_buttons_held_from_player(s32 player) {
|
||||
return sControllerCurrData[sPlayerID[player]].button;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the buttons that are newly pressed during that frame.
|
||||
* NOTE: This was a u16, but we only got a match in menu_ghost_data_loop when it was a u32 for some reason
|
||||
*/
|
||||
u32 get_buttons_pressed_from_player(s32 player) {
|
||||
return gControllerButtonsPressed[sPlayerID[player]];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the buttons that are no longer pressed in that frame.
|
||||
*/
|
||||
u16 get_buttons_released_from_player(s32 player) {
|
||||
return gControllerButtonsReleased[sPlayerID[player]];
|
||||
}
|
||||
|
||||
/**
|
||||
* Clamps the X joystick axis of the selected player to 70 and returns it.
|
||||
*/
|
||||
s8 clamp_joystick_x_axis(s32 player) {
|
||||
return clamp_joystick(sControllerCurrData[sPlayerID[player]].stick_x);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clamps the Y joystick axis of the selected player to 70 and returns it.
|
||||
*/
|
||||
s8 clamp_joystick_y_axis(s32 player) {
|
||||
return clamp_joystick(sControllerCurrData[sPlayerID[player]].stick_y);
|
||||
}
|
||||
|
||||
/**
|
||||
* Keeps the joysticks axis reads no higher than 70 (of a possible 127 or -128)
|
||||
* Will also pull the reading towards the centre.
|
||||
*/
|
||||
s8 clamp_joystick(s8 stickMag) {
|
||||
if (stickMag < JOYSTICK_DEADZONE && stickMag > -JOYSTICK_DEADZONE) {
|
||||
return 0;
|
||||
}
|
||||
if (stickMag > 0) {
|
||||
stickMag -= 8;
|
||||
if (stickMag > JOYSTICK_MAX_RANGE) {
|
||||
stickMag = JOYSTICK_MAX_RANGE;
|
||||
}
|
||||
} else {
|
||||
stickMag += 8;
|
||||
if (stickMag < -JOYSTICK_MAX_RANGE) {
|
||||
stickMag = -JOYSTICK_MAX_RANGE;
|
||||
}
|
||||
}
|
||||
return stickMag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used when anti-cheat/anti-tamper has failed in func_8006A6B0()
|
||||
*/
|
||||
void disable_button_mask(void) {
|
||||
gButtonMask = 0;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
#ifndef _CONTROLLER_H_
|
||||
#define _CONTROLLER_H_
|
||||
|
||||
#include "types.h"
|
||||
#include "macros.h"
|
||||
#include "structs.h"
|
||||
#include "libultra_internal.h"
|
||||
|
||||
#define CONTROLLER_MISSING -1
|
||||
#define CONTROLLER_EXISTS 0
|
||||
|
||||
#define JOYSTICK_DEADZONE 8
|
||||
#define JOYSTICK_MAX_RANGE 70
|
||||
|
||||
OSMesgQueue *get_si_mesg_queue(void);
|
||||
s32 init_controllers(void);
|
||||
s32 handle_save_data_and_read_controller(s32 saveDataFlags, s32 updateRate);
|
||||
void initialise_player_ids(void);
|
||||
void assign_player_ids(s8 *activePlayers);
|
||||
u8 get_player_id(s32 player);
|
||||
void swap_player_1_and_2_ids(void);
|
||||
u16 get_buttons_held_from_player(s32 player);
|
||||
u32 get_buttons_pressed_from_player(s32 player);
|
||||
u16 get_buttons_released_from_player(s32 player);
|
||||
s8 clamp_joystick_x_axis(s32 player);
|
||||
s8 clamp_joystick_y_axis(s32 player);
|
||||
s8 clamp_joystick(s8 stickMag);
|
||||
void disable_button_mask(void);
|
||||
|
||||
#endif
|
||||
+92
-44
@@ -43,6 +43,7 @@
|
||||
#include "racer.h"
|
||||
#include "particles.h"
|
||||
#include "math_util.h"
|
||||
#include "controller.h"
|
||||
|
||||
/************ .rodata ************/
|
||||
|
||||
@@ -88,7 +89,7 @@ UNUSED char gBuildString[40] = "Version 7.7 29/09/97 15.00 L.Schuneman";
|
||||
|
||||
s8 sAntiPiracyTriggered = 0;
|
||||
UNUSED s32 D_800DD378 = 1;
|
||||
s32 D_800DD37C = 0;
|
||||
s32 gSaveDataFlags = 0;
|
||||
s32 gScreenStatus = OSMESG_SWAP_BUFFER;
|
||||
s32 sControllerStatus = 0;
|
||||
UNUSED s32 D_800DD388 = 0;
|
||||
@@ -868,10 +869,9 @@ s32 func_8006C300(void) {
|
||||
/**
|
||||
* Main looping function for the main thread.
|
||||
*/
|
||||
|
||||
void thread3_main(UNUSED void *unused) {
|
||||
init_game();
|
||||
D_800DD37C = func_8006A1C4(D_800DD37C, 0);
|
||||
gSaveDataFlags = handle_save_data_and_read_controller(gSaveDataFlags, 0);
|
||||
sBootDelayTimer = 0;
|
||||
sRenderContext = DRAW_INTRO;
|
||||
while (1) {
|
||||
@@ -991,7 +991,7 @@ void main_game_loop(void) {
|
||||
init_rsp(&gCurrDisplayList);
|
||||
init_rdp_and_framebuffer(&gCurrDisplayList);
|
||||
render_background(&gCurrDisplayList, (Matrix *) &gGameCurrMatrix, TRUE);
|
||||
D_800DD37C = func_8006A1C4(D_800DD37C, sLogicUpdateRate);
|
||||
gSaveDataFlags = handle_save_data_and_read_controller(gSaveDataFlags, sLogicUpdateRate);
|
||||
if (get_lockup_status()) {
|
||||
render_epc_lock_up_display();
|
||||
sRenderContext = DRAW_CRASH_SCREEN;
|
||||
@@ -1381,7 +1381,7 @@ void ingame_logic_loop(s32 updateRate) {
|
||||
gLevelLoadTimer = 0;
|
||||
gPostRaceViewPort = NULL;
|
||||
func_8006CC14();
|
||||
func_8006EC48(get_save_file_index());
|
||||
safe_mark_write_save_file(get_save_file_index());
|
||||
if (sp40 != 0) {
|
||||
gIsLoading = FALSE;
|
||||
switch (sp40) {
|
||||
@@ -1442,7 +1442,7 @@ void ingame_logic_loop(s32 updateRate) {
|
||||
}
|
||||
load_level_2(gPlayableMapId, D_80123500, D_80123504, gLevelDefaultVehicleID);
|
||||
} else {
|
||||
func_8006EC48(get_save_file_index());
|
||||
safe_mark_write_save_file(get_save_file_index());
|
||||
load_menu_with_level_background(MENU_TITLE, -1, 0);
|
||||
}
|
||||
D_801234FC = 0;
|
||||
@@ -1451,7 +1451,7 @@ void ingame_logic_loop(s32 updateRate) {
|
||||
gPostRaceViewPort = NULL;
|
||||
func_8006CC14();
|
||||
load_level_2(gPlayableMapId, D_80123500, D_80123504, gLevelDefaultVehicleID);
|
||||
func_8006EC48(get_save_file_index());
|
||||
safe_mark_write_save_file(get_save_file_index());
|
||||
D_801234F8 = 0;
|
||||
}
|
||||
}
|
||||
@@ -1625,7 +1625,7 @@ void func_8006DCF8(s32 updateRate) {
|
||||
gIsPaused = FALSE;
|
||||
gPostRaceViewPort = NULL;
|
||||
load_level_2(gPlayableMapId, D_80123500, D_80123504, gLevelDefaultVehicleID);
|
||||
func_8006EC48(get_save_file_index());
|
||||
safe_mark_write_save_file(get_save_file_index());
|
||||
return;
|
||||
}
|
||||
if ((menuLoopResult != -1) && (menuLoopResult & 0x100)) {
|
||||
@@ -1642,7 +1642,7 @@ void func_8006DCF8(s32 updateRate) {
|
||||
D_80123508 = 0x64;
|
||||
sRenderContext = DRAW_GAME;
|
||||
load_level_2(gPlayableMapId, D_80123500, D_80123504, gLevelDefaultVehicleID);
|
||||
func_8006EC48(get_save_file_index());
|
||||
safe_mark_write_save_file(get_save_file_index());
|
||||
break;
|
||||
case 1:
|
||||
D_80123504 = 0;
|
||||
@@ -1659,7 +1659,7 @@ void func_8006DCF8(s32 updateRate) {
|
||||
D_80123508 = temp2;
|
||||
}
|
||||
load_level_2(gPlayableMapId, D_80123500, D_80123504, gLevelDefaultVehicleID);
|
||||
func_8006EC48(get_save_file_index());
|
||||
safe_mark_write_save_file(get_save_file_index());
|
||||
break;
|
||||
case 2:
|
||||
sRenderContext = DRAW_GAME;
|
||||
@@ -1777,7 +1777,11 @@ void calc_and_alloc_heap_for_settings(void) {
|
||||
gSettingsPtr->courseTimesPtr[1] = (u16 *)((u8 *)gSettingsPtr + sizes[12]);
|
||||
gSettingsPtr->courseTimesPtr[2] = (u16 *)((u8 *)gSettingsPtr + sizes[13]);
|
||||
gSettingsPtr->unk4C = (Settings4C *) &D_80121250;
|
||||
D_800DD37C = 263;
|
||||
gSaveDataFlags = // Set bits 0/1/2/8 and wipe out all others
|
||||
SAVE_DATA_FLAG_READ_FLAP_TIMES |
|
||||
SAVE_DATA_FLAG_READ_COURSE_TIMES |
|
||||
SAVE_DATA_FLAG_READ_SAVE_DATA |
|
||||
SAVE_DATA_FLAG_READ_EEPROM_SETTINGS;
|
||||
}
|
||||
|
||||
void func_8006E5BC(void) {
|
||||
@@ -1818,7 +1822,7 @@ void func_8006E770(Settings *settings, s32 arg1) {
|
||||
|
||||
get_number_of_levels_and_worlds(&numLevels, &numWorlds);
|
||||
temp_v0 = (u16 *)get_misc_asset(MISC_ASSET_UNK17);
|
||||
for (i = 0; i < 3; i++) { // 3 = number of save files?
|
||||
for (i = 0; i < NUMBER_OF_SAVE_FILES; i++) {
|
||||
for (j = 0; j < numLevels; j++) {
|
||||
index = (j * 12) + (i * 4);
|
||||
if (arg1 & 1) {
|
||||
@@ -1896,64 +1900,108 @@ s32 func_8006EB14(void) {
|
||||
return gPlayableMapId;
|
||||
}
|
||||
|
||||
/* Unused? */
|
||||
void func_8006EB24(void) {
|
||||
D_800DD37C |= 0x01;
|
||||
/**
|
||||
* Marks a flag to read flap times from the eeprom
|
||||
*/
|
||||
UNUSED void mark_to_read_flap_times(void) {
|
||||
gSaveDataFlags |= SAVE_DATA_FLAG_READ_FLAP_TIMES;
|
||||
}
|
||||
|
||||
/* Unused? */
|
||||
void func_8006EB40(void) {
|
||||
D_800DD37C |= 0x02;
|
||||
/**
|
||||
* Marks a flag to read course times from the eeprom
|
||||
*/
|
||||
UNUSED void mark_to_read_course_times(void) {
|
||||
gSaveDataFlags |= SAVE_DATA_FLAG_READ_COURSE_TIMES;
|
||||
}
|
||||
|
||||
void func_8006EB5C(void) {
|
||||
D_800DD37C |= 0x03;
|
||||
/**
|
||||
* Marks a flag to read both flap times and course times from the eeprom
|
||||
*/
|
||||
void mark_to_read_flap_and_course_times(void) {
|
||||
gSaveDataFlags |= (SAVE_DATA_FLAG_READ_FLAP_TIMES | SAVE_DATA_FLAG_READ_COURSE_TIMES);
|
||||
}
|
||||
|
||||
void func_8006EB78(s32 saveFileIndex) {
|
||||
D_800DD37C &= -0x301;
|
||||
D_800DD37C |= (0x04 | ((saveFileIndex & 3) << 8));
|
||||
/**
|
||||
* Marks a flag to read the save file from the passed index from flash.
|
||||
*/
|
||||
void mark_read_save_file(s32 saveFileIndex) {
|
||||
//Wipe out bits 8 and 9
|
||||
gSaveDataFlags &= ~(SAVE_DATA_FLAG_READ_EEPROM_SETTINGS | SAVE_DATA_FLAG_WRITE_EEPROM_SETTINGS);
|
||||
//Place saveFileIndex at bits 8 and 9 and set bit 2
|
||||
gSaveDataFlags |= (SAVE_DATA_FLAG_READ_SAVE_DATA | ((saveFileIndex & SAVE_DATA_FLAG_INDEX_VALUE) << 8));
|
||||
}
|
||||
|
||||
void func_8006EBA8(void) {
|
||||
D_800DD37C |= 0x08;
|
||||
/**
|
||||
* Marks a flag to read all save file data from flash.
|
||||
*/
|
||||
void mark_read_all_save_files(void) {
|
||||
gSaveDataFlags |= SAVE_DATA_FLAG_READ_ALL_SAVE_DATA; //Set bit 3
|
||||
}
|
||||
|
||||
void func_8006EBC4(void) {
|
||||
D_800DD37C |= 0x10;
|
||||
/**
|
||||
* Marks a flag to write flap times to the eeprom
|
||||
*/
|
||||
void mark_to_write_flap_times(void) {
|
||||
gSaveDataFlags |= SAVE_DATA_FLAG_WRITE_FLAP_TIMES;
|
||||
}
|
||||
|
||||
void func_8006EBE0(void) {
|
||||
D_800DD37C |= 0x20;
|
||||
/**
|
||||
* Marks a flag to write course times to the eeprom
|
||||
*/
|
||||
void mark_to_write_course_times(void) {
|
||||
gSaveDataFlags |= SAVE_DATA_FLAG_WRITE_COURSE_TIMES;
|
||||
}
|
||||
|
||||
void func_8006EBFC(void) {
|
||||
D_800DD37C |= 0x30;
|
||||
/**
|
||||
* Marks a flag to write both flap times and course times to the eeprom
|
||||
*/
|
||||
void mark_to_write_flap_and_course_times(void) {
|
||||
gSaveDataFlags |= (SAVE_DATA_FLAG_WRITE_FLAP_TIMES | SAVE_DATA_FLAG_WRITE_COURSE_TIMES);
|
||||
}
|
||||
|
||||
void func_8006EC18(s32 arg0) {
|
||||
D_800DD37C &= -0xC01;
|
||||
D_800DD37C |= (0x40 | ((arg0 & 3) << 0xA));
|
||||
/**
|
||||
* Forcefully marks a flag to write a save file to flash.
|
||||
*/
|
||||
void force_mark_write_save_file(s32 saveFileIndex) {
|
||||
gSaveDataFlags &= ~SAVE_DATA_FLAG_WRITE_SAVE_FILE_NUMBER_BITS; //Wipe out bits 10 and 11
|
||||
gSaveDataFlags |= (SAVE_DATA_FLAG_WRITE_SAVE_DATA | ((saveFileIndex & 3) << 10)); //Set bit 6 and place saveFileIndex into bits 10 and 11
|
||||
}
|
||||
|
||||
void func_8006EC48(s32 saveFileIndex) {
|
||||
/**
|
||||
* Marks a flag to write a save file to flash as long as we're not in tracks mode, and we're in the draw game render context.
|
||||
* This should prevent save data from being overwritten outside of Adventure Mode.
|
||||
*/
|
||||
void safe_mark_write_save_file(s32 saveFileIndex) {
|
||||
if (sRenderContext == DRAW_GAME && !is_in_tracks_mode()) {
|
||||
D_800DD37C &= -0xC01;
|
||||
D_800DD37C |= (0x40 | ((saveFileIndex & 3) << 0xA));
|
||||
gSaveDataFlags &= ~SAVE_DATA_FLAG_WRITE_SAVE_FILE_NUMBER_BITS; //Wipe out bits 10 and 11
|
||||
gSaveDataFlags |= (SAVE_DATA_FLAG_WRITE_SAVE_DATA | ((saveFileIndex & 3) << 10));; //Set bit 6 and place saveFileIndex into bits 10 and 11
|
||||
}
|
||||
}
|
||||
|
||||
void func_8006ECAC(s32 arg0) {
|
||||
D_800DD37C = ((arg0 & 0x03) << 10) | 0x80;
|
||||
/**
|
||||
* Marks a flag to erase a save file from flash later
|
||||
*/
|
||||
void mark_save_file_to_erase(s32 saveFileIndex) {
|
||||
//Set bit 7 and and place saveFileIndex into bits 10 and 11 while wiping everything else
|
||||
gSaveDataFlags = SAVE_DATA_FLAG_ERASE_SAVE_DATA | ((saveFileIndex & 3) << 10);
|
||||
}
|
||||
|
||||
UNUSED void func_8006ECC4(void) {
|
||||
D_800DD37C |= 0x100;
|
||||
/**
|
||||
* Marks a flag to read eeprom settings from flash later
|
||||
* @bug: Because this is the same bit used for reading save files,
|
||||
* it will change the save file number to read from
|
||||
*/
|
||||
UNUSED void mark_read_eeprom_settings(void) {
|
||||
gSaveDataFlags |= SAVE_DATA_FLAG_READ_EEPROM_SETTINGS; // Set bit 8
|
||||
}
|
||||
|
||||
//Always called after updating a value in sEepromSettings
|
||||
void func_8006ECE0(void) {
|
||||
D_800DD37C |= 0x200;
|
||||
/**
|
||||
* Marks a flag to write eeprom settings to flash later
|
||||
* @bug: Because this is the same bit used for reading save files,
|
||||
* it will change the save file number to read from
|
||||
*/
|
||||
void mark_write_eeprom_settings(void) {
|
||||
gSaveDataFlags |= SAVE_DATA_FLAG_WRITE_EEPROM_SETTINGS; // Set bit 9
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+48
-13
@@ -35,6 +35,41 @@ enum NumberOfPlayers {
|
||||
FOUR_PLAYERS = 3
|
||||
};
|
||||
|
||||
/**
|
||||
* Bit 00: Read Eeprom Data flap times
|
||||
* Bit 01: Read Eeprom Data course times
|
||||
* Bit 02: Read Save File from bits 8 and 9
|
||||
* Bit 03: Read All Save Files
|
||||
* Bit 04: Write Eeprom Data flap times
|
||||
* Bit 05: Write Eeprom Data course times
|
||||
* Bit 06: Write Save Data from bits 10 and 11
|
||||
* Bit 07: Erase Save File from bits 10 and 11
|
||||
* Bit 08: Read Save File Number Part 1 @bug Also Read Eeprom settings
|
||||
* Bit 09: Read Save File Number Part 2 @bug Also Write Eeprom Settings
|
||||
* Bit 10: Write Save File Number Part 1
|
||||
* Bit 11: Write Save File Number Part 2
|
||||
*/
|
||||
extern s32 gSaveDataFlags;
|
||||
#define SAVE_DATA_FLAG_INDEX_VALUE (1 << 0 | 1 << 1) //2 bits for 4 different values
|
||||
|
||||
#define SAVE_DATA_FLAG_READ_FLAP_TIMES (1 << 0)
|
||||
#define SAVE_DATA_FLAG_READ_COURSE_TIMES (1 << 1)
|
||||
#define SAVE_DATA_FLAG_READ_SAVE_DATA (1 << 2)
|
||||
#define SAVE_DATA_FLAG_READ_ALL_SAVE_DATA (1 << 3)
|
||||
#define SAVE_DATA_FLAG_WRITE_FLAP_TIMES (1 << 4)
|
||||
#define SAVE_DATA_FLAG_WRITE_COURSE_TIMES (1 << 5)
|
||||
#define SAVE_DATA_FLAG_WRITE_SAVE_DATA (1 << 6)
|
||||
#define SAVE_DATA_FLAG_ERASE_SAVE_DATA (1 << 7)
|
||||
#define SAVE_DATA_FLAG_READ_EEPROM_SETTINGS (1 << 8) //@bug Bits 8 and 9 are reused for checking the read save file number
|
||||
#define SAVE_DATA_FLAG_WRITE_EEPROM_SETTINGS (1 << 9) // ^^
|
||||
#define SAVE_DATA_FLAG_READ_SAVE_FILE_NUMBER_BITS (1 << 8 | 1 << 9) //These are reused as above
|
||||
#define SAVE_DATA_FLAG_WRITE_SAVE_FILE_NUMBER_BITS (1 << 10 | 1 << 11)
|
||||
|
||||
#define SAVE_DATA_FLAG_READ_EEPROM_INDEX(flags) (flags & (SAVE_DATA_FLAG_READ_FLAP_TIMES | SAVE_DATA_FLAG_READ_COURSE_TIMES))
|
||||
#define SAVE_DATA_FLAG_WRITE_EEPROM_INDEX(flags) ((flags & (SAVE_DATA_FLAG_WRITE_FLAP_TIMES | SAVE_DATA_FLAG_WRITE_COURSE_TIMES)) >> 4)
|
||||
#define SAVE_DATA_FLAG_READ_SAVE_FILE_NUMBER(flags) ((flags >> 8) & SAVE_DATA_FLAG_INDEX_VALUE)
|
||||
#define SAVE_DATA_FLAG_WRITE_SAVE_FILE_NUMBER(flags) ((flags >> 10) & SAVE_DATA_FLAG_INDEX_VALUE)
|
||||
|
||||
Vehicle get_map_default_vehicle(s32 mapId);
|
||||
s32 get_map_available_vehicles(s32 mapId);
|
||||
s8 func_8006B14C(s32 mapId);
|
||||
@@ -88,19 +123,19 @@ s8 is_game_paused(void);
|
||||
s8 is_postrace_viewport_active(void);
|
||||
s32 is_reset_pressed(void);
|
||||
s32 func_8006EB14(void);
|
||||
void func_8006EB24(void);
|
||||
void func_8006EB40(void);
|
||||
void func_8006EB5C(void);
|
||||
void func_8006EB78(s32 saveFileIndex);
|
||||
void func_8006EBA8(void);
|
||||
void func_8006EBC4(void);
|
||||
void func_8006EBE0(void);
|
||||
void func_8006EBFC(void);
|
||||
void func_8006EC18(s32 arg0);
|
||||
void func_8006EC48(s32 saveFileIndex);
|
||||
void func_8006ECAC(s32 arg0);
|
||||
void func_8006ECC4(void);
|
||||
void func_8006ECE0(void);
|
||||
void mark_to_read_flap_times(void);
|
||||
void mark_to_read_course_times(void);
|
||||
void mark_to_read_flap_and_course_times(void);
|
||||
void mark_read_save_file(s32 saveFileIndex);
|
||||
void mark_read_all_save_files(void);
|
||||
void mark_to_write_flap_times(void);
|
||||
void mark_to_write_course_times(void);
|
||||
void mark_to_write_flap_and_course_times(void);
|
||||
void force_mark_write_save_file(s32 saveFileIndex);
|
||||
void safe_mark_write_save_file(s32 saveFileIndex);
|
||||
void mark_save_file_to_erase(s32 saveFileIndex);
|
||||
void mark_read_eeprom_settings(void);
|
||||
void mark_write_eeprom_settings(void);
|
||||
s32 check_dmem_validity(void);
|
||||
void func_8006F140(s32 arg0);
|
||||
void func_8006F20C(void);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "objects.h"
|
||||
#include "racer.h"
|
||||
#include "game.h"
|
||||
#include "controller.h"
|
||||
|
||||
/************ .data ************/
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "audiosfx.h"
|
||||
#include "printf.h"
|
||||
#include "unknown_008C40.h"
|
||||
#include "controller.h"
|
||||
|
||||
extern u32 osTvType;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user