Initialise memory card events

From Final Fantasy Hacktics Wiki
(Redirected from 00045720 - 000458b4)
Jump to navigation Jump to search

00045720: 3c028005 lui r2,0x8005
00045724: 90427c6b lbu r2,0x7c6b(r2)
00045728: 27bdffe0 addiu r29,r29,0xffe0
0004572c: afbf0018 sw r31,0x0018(r29)
00045730: afb10014 sw r17,0x0014(r29)
00045734: 1440005a bne r2,r0,0x000458a0            branch if memcard events have already been initialised
00045738: afb00010 sw r16,0x0010(r29)
0004573c: 0c00880d jal 0x00022034                  Enter Critical Section
00045740: 00008821 addu r17,r0,r0
00045744: 3c04f400 lui r4,0xf400                   
00045748: 34840001 ori r4,r4,0x0001                cause == memory card BIOS
0004574c: 34050004 ori r5,r0,0x0004                card not err
00045750: 34062000 ori r6,r0,0x2000                no function
00045754: 0c0087dd jal 0x00021f74                  OpenEvent
00045758: 00003821 addu r7,r0,r0                   no handler
0004575c: 3c04f400 lui r4,0xf400
00045760: 34840001 ori r4,r4,0x0001                cause == memory card BIOS
00045764: 34058000 ori r5,r0,0x8000                card err write
00045768: 34062000 ori r6,r0,0x2000                no function
0004576c: 00003821 addu r7,r0,r0                   no handler
00045770: 3c108006 lui r16,0x8006
00045774: 261096c0 addiu r16,r16,0x96c0            event descriptor pointer
00045778: 0c0087dd jal 0x00021f74                  OpenEvent
0004577c: ae020000 sw r2,0x0000(r16)               store event descriptor at 0x800596c0 (card done okay BIOS)
00045780: 3c04f400 lui r4,0xf400
00045784: 34840001 ori r4,r4,0x0001                cause == memory card BIOS
00045788: 34050100 ori r5,r0,0x0100                card err busy
0004578c: 34062000 ori r6,r0,0x2000                no function
00045790: 3c018006 lui r1,0x8006
00045794: ac2296c4 sw r2,-0x693c(r1)               store event descriptor at 0x800596c4 (card err write BIOS)
00045798: 0c0087dd jal 0x00021f74                  OpenEvent
0004579c: 00003821 addu r7,r0,r0                   no handler
000457a0: 3c04f400 lui r4,0xf400
000457a4: 34840001 ori r4,r4,0x0001                cause == memory card BIOS
000457a8: 34052000 ori r5,r0,0x2000                card err eject
000457ac: 34062000 ori r6,r0,0x2000                no function
000457b0: 3c018006 lui r1,0x8006
000457b4: ac2296c8 sw r2,-0x6938(r1)               store event descriptor at 0x800596c8 (card err busy BIOS)
000457b8: 0c0087dd jal 0x00021f74                  OpenEvent
000457bc: 00003821 addu r7,r0,r0                   no handler
000457c0: 3c04f000 lui r4,0xf000
000457c4: 34840011 ori r4,r4,0x0011                cause == memory card hardware
000457c8: 34050004 ori r5,r0,0x0004                finished okay
000457cc: 34062000 ori r6,r0,0x2000                no function
000457d0: 3c018006 lui r1,0x8006
000457d4: ac2296cc sw r2,-0x6934(r1)               store event descriptor at 0x800596c8 (card err eject BIOS)
000457d8: 0c0087dd jal 0x00021f74                  OpenEvent
000457dc: 00003821 addu r7,r0,r0                   no handler
000457e0: 3c04f000 lui r4,0xf000
000457e4: 34840011 ori r4,r4,0x0011                cause == memory card hardware
000457e8: 34058000 ori r5,r0,0x8000                err
000457ec: 34062000 ori r6,r0,0x2000                no function
000457f0: 3c018006 lui r1,0x8006
000457f4: ac2296d0 sw r2,-0x6930(r1)               store event descriptor at 0x800596d0 (card okay hardware)
000457f8: 0c0087dd jal 0x00021f74                  OpenEvent
000457fc: 00003821 addu r7,r0,r0                   no handler
00045800: 3c04f000 lui r4,0xf000
00045804: 34840011 ori r4,r4,0x0011                cause == memory card hardware
00045808: 34050100 ori r5,r0,0x0100                err busy
0004580c: 34062000 ori r6,r0,0x2000                no function
00045810: 3c018006 lui r1,0x8006
00045814: ac2296d4 sw r2,-0x692c(r1)               store event descriptor at 0x800596d4 (card err hardware)
00045818: 0c0087dd jal 0x00021f74                  OpenEvent
0004581c: 00003821 addu r7,r0,r0                   no handler
00045820: 3c04f000 lui r4,0xf000
00045824: 34840011 ori r4,r4,0x0011                cause == memory card hardware
00045828: 34052000 ori r5,r0,0x2000                err 2
0004582c: 34062000 ori r6,r0,0x2000                no function
00045830: 3c018006 lui r1,0x8006
00045834: ac2296d8 sw r2,-0x6928(r1)               store event descriptor at 0x800596d8 (card err busy hardware)
00045838: 0c0087dd jal 0x00021f74                  OpenEvent
0004583c: 00003821 addu r7,r0,r0                   no handler
00045840: 3c018006 lui r1,0x8006
00045844: ac2296dc sw r2,-0x6924(r1)               store event descriptor at 0x800596dc (card err 2 hardware)
00045848: 0c00a1f6 jal 0x000287d8                  000287b8 - 00028828
0004584c: 34040001 ori r4,r0,0x0001                init card (pad_enable_flag == 1)
00045850: 0c00a20b jal 0x0002882c                  0002882c - 00028860 start card change clear pad
00045854: 00000000 nop
00045858: 0c00883d jal 0x000220f4                  Change Clear Pad
0004585c: 00002021 addu r4,r0,r0
00045860: 0c0087cd jal 0x00021f34                  _bu_init init mem card port
00045864: 00000000 nop
00045868: 0c00a1d8 jal 0x00028760                  card auto
0004586c: 00002021 addu r4,r0,r0                   bu init already sets this to 0. nevertheless,
00045870: 8e040000 lw r4,0x0000(r16)
00045874: 26100004 addiu r16,r16,0x0004
00045878: 0c0087ed jal 0x00021fb4                  EnableEvent enable all memcard events
0004587c: 26310001 addiu r17,r17,0x0001
00045880: 2a220008 slti r2,r17,0x0008
00045884: 1440fffa bne r2,r0,0x00045870            loop for all 8 card events
00045888: 00000000 nop
0004588c: 0c008811 jal 0x00022044                  Exit Critical Section
00045890: 00000000 nop
00045894: 34020001 ori r2,r0,0x0001
00045898: 3c018005 lui r1,0x8005
0004589c: a0227c6b sb r2,0x7c6b(r1)                set flag memcard events initialised
000458a0: 8fbf0018 lw r31,0x0018(r29)
000458a4: 8fb10014 lw r17,0x0014(r29)
000458a8: 8fb00010 lw r16,0x0010(r29)
000458ac: 27bd0020 addiu r29,r29,0x0020
000458b0: 03e00008 jr r31
000458b4: 00000000 nop