Difference between revisions of "Get TIM"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m
Line 3: Line 3:
 
  000447bc: 27bdffd8 addiu r29,r29,0xffd8
 
  000447bc: 27bdffd8 addiu r29,r29,0xffd8
 
  000447c0: afb3001c sw r19,0x001c(r29)
 
  000447c0: afb3001c sw r19,0x001c(r29)
  000447c4: 00809821 addu r19,r4,r0
+
  000447c4: 00809821 addu r19,r4,r0                   # LBA sector of data
 
  000447c8: afb00010 sw r16,0x0010(r29)
 
  000447c8: afb00010 sw r16,0x0010(r29)
  000447cc: 00a08021 addu r16,r5,r0
+
  000447cc: 00a08021 addu r16,r5,r0                   # file size in bytes
  000447d0: 02002021 addu r4,r16,r0
+
  000447d0: 02002021 addu r4,r16,r0                   # request this many bytes of RAM
 
  000447d4: afbf0020 sw r31,0x0020(r29)
 
  000447d4: afbf0020 sw r31,0x0020(r29)
 
  000447d8: afb20018 sw r18,0x0018(r29)
 
  000447d8: afb20018 sw r18,0x0018(r29)
  000447dc: 0c011105 jal 0x00044414
+
  000447dc: 0c011105 jal 0x00044414                   # [[C51 Malloc]]
 
  000447e0: afb10014 sw r17,0x0014(r29)
 
  000447e0: afb10014 sw r17,0x0014(r29)
 
  000447e4: 00409021 addu r18,r2,r0
 
  000447e4: 00409021 addu r18,r2,r0
  000447e8: 16400003 bne r18,r0,0x000447f8
+
  000447e8: 16400003 bne r18,r0,0x000447f8             # skip error code if memory allocated
 
  000447ec: 00000000 nop
 
  000447ec: 00000000 nop
  000447f0: 0c011282 jal 0x00044a08
+
  000447f0: 0c011282 jal 0x00044a08                   # [[00044a08 - 00044a30]] error code 1
 
  000447f4: 34040001 ori r4,r0,0x0001
 
  000447f4: 34040001 ori r4,r0,0x0001
 
  000447f8: 3c118005 lui r17,0x8005
 
  000447f8: 3c118005 lui r17,0x8005
  000447fc: 2631eaf4 addiu r17,r17,0xeaf4
+
  000447fc: 2631eaf4 addiu r17,r17,0xeaf4             # file descriptor
  00044800: 02202021 addu r4,r17,r0
+
  00044800: 02202021 addu r4,r17,r0                   # file descriptor
  00044804: 02602821 addu r5,r19,r0
+
  00044804: 02602821 addu r5,r19,r0                   # LBA address
  00044808: 001032c2 srl r6,r16,0x0b
+
  00044808: 001032c2 srl r6,r16,0x0b                   # num sectors
  0004480c: 0c0046f4 jal 0x00011bd0
+
  0004480c: 0c0046f4 jal 0x00011bd0                   # [[Load Data From Disc (0x11bd0)]]
  00044810: 02403821 addu r7,r18,r0
+
  00044810: 02403821 addu r7,r18,r0                   # address to open file in RAM
  00044814: 10400009 beq r2,r0,0x0004483c
+
  00044814: 10400009 beq r2,r0,0x0004483c             # branch if successful
 
  00044818: 00000000 nop
 
  00044818: 00000000 nop
  0004481c: 0c0076ea jal 0x0001dba8
+
  0004481c: 0c0076ea jal 0x0001dba8                   # [[Vsync call]]
 
  00044820: 00002021 addu r4,r0,r0
 
  00044820: 00002021 addu r4,r0,r0
  00044824: 0c01127b jal 0x000449ec
+
  00044824: 0c01127b jal 0x000449ec                   # jr r31
 
  00044828: 00000000 nop
 
  00044828: 00000000 nop
  0004482c: 0c00478e jal 0x00011e38
+
  0004482c: 0c00478e jal 0x00011e38                   # [[00011e38 - 0001201c]]
  00044830: 02202021 addu r4,r17,r0
+
  00044830: 02202021 addu r4,r17,r0                   # file descriptor
  00044834: 08011201 j 0x00044804
+
  00044834: 08011201 j 0x00044804                     # loop, indefinitely?
 
  00044838: 02202021 addu r4,r17,r0
 
  00044838: 02202021 addu r4,r17,r0
 +
 
  0004483c: 3c028005 lui r2,0x8005
 
  0004483c: 3c028005 lui r2,0x8005
 
  00044840: 8c42eaf8 lw r2,-0x1508(r2)
 
  00044840: 8c42eaf8 lw r2,-0x1508(r2)
 
  00044844: 00000000 nop
 
  00044844: 00000000 nop
  00044848: 1040000d beq r2,r0,0x00044880
+
  00044848: 1040000d beq r2,r0,0x00044880             # branch if no file currently being opened
 
  0004484c: 02401021 addu r2,r18,r0
 
  0004484c: 02401021 addu r2,r18,r0
 
  00044850: 02208021 addu r16,r17,r0
 
  00044850: 02208021 addu r16,r17,r0
  00044854: 0c0076ea jal 0x0001dba8
+
  00044854: 0c0076ea jal 0x0001dba8                   # [[VSync call]]
 
  00044858: 00002021 addu r4,r0,r0
 
  00044858: 00002021 addu r4,r0,r0
  0004485c: 0c01127b jal 0x000449ec
+
  0004485c: 0c01127b jal 0x000449ec                   # [[000449ec - 000449f4]] jr r31
 
  00044860: 00000000 nop
 
  00044860: 00000000 nop
  00044864: 0c00478e jal 0x00011e38
+
  00044864: 0c00478e jal 0x00011e38                   # [[00011e38 - 0001201c]]
  00044868: 02002021 addu r4,r16,r0
+
  00044868: 02002021 addu r4,r16,r0                   # file descriptor
 
  0004486c: 3c028005 lui r2,0x8005
 
  0004486c: 3c028005 lui r2,0x8005
  00044870: 8c42eaf8 lw r2,-0x1508(r2)                # return which section of cdrom-ram buffer a file is being loaded to?
+
  00044870: 8c42eaf8 lw r2,-0x1508(r2)                # file still being opened check
 
  00044874: 00000000 nop
 
  00044874: 00000000 nop
  00044878: 1440fff6 bne r2,r0,0x00044854
+
  00044878: 1440fff6 bne r2,r0,0x00044854             # branch if so
  0004487c: 02401021 addu r2,r18,r0
+
  0004487c: 02401021 addu r2,r18,r0                   # return location of opened and read file
 
  00044880: 8fbf0020 lw r31,0x0020(r29)
 
  00044880: 8fbf0020 lw r31,0x0020(r29)
 
  00044884: 8fb3001c lw r19,0x001c(r29)
 
  00044884: 8fb3001c lw r19,0x001c(r29)

Revision as of 00:21, 11 June 2024

000447bc: 27bdffd8 addiu r29,r29,0xffd8
000447c0: afb3001c sw r19,0x001c(r29)
000447c4: 00809821 addu r19,r4,r0                    # LBA sector of data
000447c8: afb00010 sw r16,0x0010(r29)
000447cc: 00a08021 addu r16,r5,r0                    # file size in bytes
000447d0: 02002021 addu r4,r16,r0                    # request this many bytes of RAM
000447d4: afbf0020 sw r31,0x0020(r29)
000447d8: afb20018 sw r18,0x0018(r29)
000447dc: 0c011105 jal 0x00044414                    # C51 Malloc
000447e0: afb10014 sw r17,0x0014(r29)
000447e4: 00409021 addu r18,r2,r0
000447e8: 16400003 bne r18,r0,0x000447f8             # skip error code if memory allocated
000447ec: 00000000 nop
000447f0: 0c011282 jal 0x00044a08                    # 00044a08 - 00044a30 error code 1
000447f4: 34040001 ori r4,r0,0x0001
000447f8: 3c118005 lui r17,0x8005
000447fc: 2631eaf4 addiu r17,r17,0xeaf4              # file descriptor
00044800: 02202021 addu r4,r17,r0                    # file descriptor
00044804: 02602821 addu r5,r19,r0                    # LBA address
00044808: 001032c2 srl r6,r16,0x0b                   # num sectors
0004480c: 0c0046f4 jal 0x00011bd0                    # Load Data From Disc (0x11bd0)
00044810: 02403821 addu r7,r18,r0                    # address to open file in RAM
00044814: 10400009 beq r2,r0,0x0004483c              # branch if successful
00044818: 00000000 nop
0004481c: 0c0076ea jal 0x0001dba8                    # Vsync call
00044820: 00002021 addu r4,r0,r0
00044824: 0c01127b jal 0x000449ec                    # jr r31
00044828: 00000000 nop
0004482c: 0c00478e jal 0x00011e38                    # 00011e38 - 0001201c
00044830: 02202021 addu r4,r17,r0                    # file descriptor
00044834: 08011201 j 0x00044804                      # loop, indefinitely?
00044838: 02202021 addu r4,r17,r0
0004483c: 3c028005 lui r2,0x8005
00044840: 8c42eaf8 lw r2,-0x1508(r2)
00044844: 00000000 nop
00044848: 1040000d beq r2,r0,0x00044880              # branch if no file currently being opened
0004484c: 02401021 addu r2,r18,r0
00044850: 02208021 addu r16,r17,r0
00044854: 0c0076ea jal 0x0001dba8                    # VSync call
00044858: 00002021 addu r4,r0,r0
0004485c: 0c01127b jal 0x000449ec                    # 000449ec - 000449f4 jr r31
00044860: 00000000 nop
00044864: 0c00478e jal 0x00011e38                    # 00011e38 - 0001201c
00044868: 02002021 addu r4,r16,r0                    # file descriptor
0004486c: 3c028005 lui r2,0x8005
00044870: 8c42eaf8 lw r2,-0x1508(r2)                 # file still being opened check
00044874: 00000000 nop
00044878: 1440fff6 bne r2,r0,0x00044854              # branch if so
0004487c: 02401021 addu r2,r18,r0                    # return location of opened and read file
00044880: 8fbf0020 lw r31,0x0020(r29)
00044884: 8fb3001c lw r19,0x001c(r29)
00044888: 8fb20018 lw r18,0x0018(r29)
0004488c: 8fb10014 lw r17,0x0014(r29)
00044890: 8fb00010 lw r16,0x0010(r29)
00044894: 27bd0028 addiu r29,r29,0x0028
00044898: 03e00008 jr r31
0004489c: 00000000 nop