Skip to content

Commit 3fc873a

Browse files
authored
Decompile and name a few main_psp functions (#3126)
1 parent dc1bf22 commit 3fc873a

13 files changed

Lines changed: 315 additions & 176 deletions

File tree

config/splat.pspeu.main.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ segments:
330330
- [0x30F3C, asm, func_psp_0892F848]
331331
- [0x3104C, asm, func_psp_0892F958]
332332
- [0x31178, c, main_psp/31178]
333+
- [0x35670, c, main_psp/35670]
333334
- [0x359F8, c, main_psp/vector4]
334335
- [0x36174, c, main_psp/36174]
335336
- [0x38EF0, asm, func_psp_089377FC]
@@ -376,7 +377,6 @@ segments:
376377
- [0x3E3D0, .data, main_psp/10944]
377378
- [0x3E3F0, .data, main_psp/11320]
378379
- [0x3E414, .data, main_psp/138B0]
379-
- [0x3E438, data]
380380
- [0x3E4D4, .data, main_psp/mpeg/display]
381381
- [0x3E540, .data, main_psp/mpeg/fileread]
382382
- [0x3E554, .data, main_psp/mpeg/sound]
@@ -397,22 +397,22 @@ segments:
397397
- [0xAEBAC, data]
398398
- {start: 0xAEF24, type: bss, vram: 0x089AD830, name: bss0}
399399
- {start: 0xAEF24, type: .bss, vram: 0x089B6540, name: main_psp/11320}
400-
- {start: 0xAEF24, type: bss, vram: 0x08B1FB50, name: bss1}
400+
- {start: 0xAEF24, type: .bss, vram: 0x08B1FB50, name: main_psp/138B0}
401401
- {start: 0xAEF24, type: .bss, vram: 0x08B1FB90, name: main_psp/mpeg/avsync}
402402
- {start: 0xAEF24, type: .bss, vram: 0x08B1FB94, name: main_psp/mpeg/display}
403403
- {start: 0xAEF24, type: .bss, vram: 0x08B1FBBC, name: main_psp/mpeg/fileread}
404404
- {start: 0xAEF24, type: .bss, vram: 0x08B1FBDC, name: main_psp/mpeg/sound}
405-
- {start: 0xAEF24, type: bss, vram: 0x08B1FBFC, name: bss2}
405+
- {start: 0xAEF24, type: bss, vram: 0x08B1FBFC, name: bss1}
406406
- {start: 0xAEF24, type: .bss, vram: 0x08B21DE8, name: main_psp/1A794}
407-
- {start: 0xAEF24, type: bss, vram: 0x08B41F30, name: bss3}
407+
- {start: 0xAEF24, type: bss, vram: 0x08B41F30, name: bss2}
408408
- {start: 0xAEF24, type: .bss, vram: 0x08B41F40, name: main_psp/1B0F0}
409409
- {start: 0xAEF24, type: .bss, vram: 0x08B41FB4, name: main_psp/1B61C}
410-
- {start: 0xAEF24, type: bss, vram: 0x08B41FC0, name: bss4}
410+
- {start: 0xAEF24, type: bss, vram: 0x08B41FC0, name: bss3}
411411
- {start: 0xAEF24, type: .bss, vram: 0x08B42068, name: main_psp/1BCFC}
412-
- {start: 0xAEF24, type: bss, vram: 0x08C63124, name: bss5}
412+
- {start: 0xAEF24, type: bss, vram: 0x08C63124, name: bss4}
413413
- {start: 0xAEF24, type: .bss, vram: 0x08C63C28, name: main_psp/28A90}
414-
- {start: 0xAEF24, type: bss, vram: 0x08C6BC30, name: bss6}
414+
- {start: 0xAEF24, type: bss, vram: 0x08C6BC30, name: bss5}
415415
- {start: 0xAEF24, type: .bss, vram: 0x08DAF2C8, name: main_psp/31178}
416-
- {start: 0xAEF24, type: bss, vram: 0x08E2E5F8, name: bss7}
416+
- {start: 0xAEF24, type: bss, vram: 0x08E2E5F8, name: bss6}
417417
- [0xAEF24, bin, elf_footer]
418418
- [0xB3E1C]

config/symbols.pspeu.main.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,10 @@ func_psp_0890EF88 = 0x0890EF88; // ignore:true
281281
_write_r = 0x0890F0C8;
282282
__swsetup_r = 0x0890F130;
283283
func_psp_089123B8 = 0x089123B8; // ignore:false
284+
startCheck = 0x08913314;
284285
playMovie = 0x089133D4;
286+
pad_read = 0x08913B48;
287+
avsync_startAudioVideo = 0x08913CA0;
285288
avsync_video_setPts = 0x08913D20;
286289
avsync_video_getPts = 0x08913DD4;
287290
dispbuf_getDrawbuf = 0x0891499C;
@@ -672,8 +675,13 @@ top_pad = 0x089B61F0;
672675
max_sbrked_mem = 0x089B61F4;
673676
max_total_mem = 0x089B61F8;
674677
current_mallinfo = 0x089B61FC;
678+
audioOn = 0x08B1FB7C;
675679
sce_newlib_heap_delayed_alloc = 0x08B41F30;
676680
g_frameBufIdx = 0x08B41FC0;
681+
dispThread = 0x08B42010;
682+
readThread = 0x08B42020;
683+
soundThread = 0x08B42030;
684+
power_cb = 0x08B42040;
677685
D_psp_08C63B28 = 0x08C63B28; // size:0x8
678686
D_psp_08C63B30 = 0x08C63B30; // size:0x8
679687
D_psp_08C63B38 = 0x08C63B38; // size:0x8

include/pspsdk/pspthreadman.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,14 +506,14 @@ typedef struct SceKernelSemaInfo {
506506
* @par Example:
507507
* @code
508508
* int semaid;
509-
* semaid = sceKernelCreateSema("MyMutex", 0, 1, 1, 0);
509+
* semaid = sceKernelCreateSema("MyMutex", 0, 1, 1, NULL);
510510
* @endcode
511511
*
512512
* @param name - Specifies the name of the sema
513513
* @param attr - Sema attribute flags (normally set to 0)
514514
* @param initVal - Sema initial value
515515
* @param maxVal - Sema maximum value
516-
* @param option - Sema options (normally set to 0)
516+
* @param option - Sema options (normally set to NULL)
517517
* @return A semaphore id
518518
*/
519519
SceUID sceKernelCreateSema(const char *name, SceUInt attr, int initVal, int maxVal, SceKernelSemaOptParam *option);

src/dra_psp/23138.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@
55
extern s32 g_CurrentStream;
66

77
void func_psp_090FFAB8(void) {
8-
s32 var_a1 = 0;
8+
s32 skipButton = PAD_NONE;
99
switch (g_CurrentStream) {
1010
case 0:
11-
var_a1 = 8;
11+
skipButton = PAD_START;
1212
break;
1313
case 1:
14-
var_a1 = 8;
14+
skipButton = PAD_START;
1515
break;
1616
case 2:
17-
var_a1 = 0x6008;
17+
skipButton = PAD_CROSS | PAD_CIRCLE | PAD_START;
1818
break;
1919
case 3:
20-
var_a1 = 0x6008;
20+
skipButton = PAD_CROSS | PAD_CIRCLE | PAD_START;
2121
break;
2222
}
23-
func_psp_08912820(g_CurrentStream, var_a1);
23+
func_psp_08912820(g_CurrentStream, skipButton);
2424
D_8003C728 = 0;
2525
g_IsUsingCd = 0;
2626
}

0 commit comments

Comments
 (0)