Difference between revisions of "SYS ResetGraph"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m (Talcall moved page P37 DumpDrawEnv to SYS ResetGraph)
m
 
Line 6: Line 6:
 
  00024244: 30b10007 andi r17,r5,0x0007
 
  00024244: 30b10007 andi r17,r5,0x0007
 
  00024248: afbf0018 sw r31,0x0018(r29)
 
  00024248: afbf0018 sw r31,0x0018(r29)
  0002424c: 12200004 beq r17,r0,0x00024260          # branch if drawing area starts on a multiple of 0x10
+
  0002424c: 12200004 beq r17,r0,0x00024260          # branch if total reset of drawing engine
 
  00024250: afb00010 sw r16,0x0010(r29)
 
  00024250: afb00010 sw r16,0x0010(r29)
 
  00024254: 34020003 ori r2,r0,0x0003
 
  00024254: 34020003 ori r2,r0,0x0003
  00024258: 16220034 bne r17,r2,0x0002432c          # else, branch if drawing area ends in 0x3
+
  00024258: 16220034 bne r17,r2,0x0002432c          # else, branch if partial reset
 
  0002425c: 00000000 nop
 
  0002425c: 00000000 nop
 
  00024260: 3c048001 lui r4,0x8001
 
  00024260: 3c048001 lui r4,0x8001
Line 63: Line 63:
 
  00024328: 00000000 nop
 
  00024328: 00000000 nop
  
if drawing area address ends in 0x3
+
if partial reset of drawing engine (screen is not cleared)
 
  0002432c: 3c028003 lui r2,0x8003
 
  0002432c: 3c028003 lui r2,0x8003
 
  00024330: 90422896 lbu r2,0x2896(r2)
 
  00024330: 90422896 lbu r2,0x2896(r2)

Latest revision as of 12:55, 10 July 2023

00024238: 27bdffe0 addiu r29,r29,0xffe0
0002423c: 00802821 addu r5,r4,r0
00024240: afb10014 sw r17,0x0014(r29)
00024244: 30b10007 andi r17,r5,0x0007
00024248: afbf0018 sw r31,0x0018(r29)
0002424c: 12200004 beq r17,r0,0x00024260           # branch if total reset of drawing engine
00024250: afb00010 sw r16,0x0010(r29)
00024254: 34020003 ori r2,r0,0x0003
00024258: 16220034 bne r17,r2,0x0002432c           # else, branch if partial reset
0002425c: 00000000 nop
00024260: 3c048001 lui r4,0x8001
00024264: 248406f8 addiu r4,r4,0x06f8              # text to print (ResetGraph:jtb=%08x,env=%08x.<endstring>)
00024268: 3c058003 lui r5,0x8003
0002426c: 24a5284c addiu r5,r5,0x284c              # param 1 0x8003284c
00024270: 3c108003 lui r16,0x8003
00024274: 26102894 addiu r16,r16,0x2894
00024278: 0c0088cb jal 0x0002232c                  # printf
0002427c: 02003021 addu r6,r16,r0                  # param 2 0x80032894
00024280: 02002021 addu r4,r16,r0                  # 
00024284: 00002821 addu r5,r0,r0                   # 
00024288: 0c009bd6 jal 0x00026f58                  # rudementary memset clone (0x00 at param 2 0x80 times)
0002428c: 34060080 ori r6,r0,0x0080                # 
00024290: 0c007763 jal 0x0001dd8c                  # ?
00024294: 00000000 nop
00024298: 3c0200ff lui r2,0x00ff
0002429c: 3c048003 lui r4,0x8003
000242a0: 8c84288c lw r4,0x288c(r4)
000242a4: 3442ffff ori r2,r2,0xffff                
000242a8: 0c009be1 jal 0x00026f84                  # GPU_cw(gp0cmd) calls gpu_sync and writes the current gpu instruction being executed to memory?
000242ac: 00822024 and r4,r4,r2
000242b0: 0c009a96 jal 0x00026a58
000242b4: 0011202b sltu r4,r0,r17
000242b8: 26040010 addiu r4,r16,0x0010
000242bc: a2020000 sb r2,0x0000(r16)
000242c0: 92020000 lbu r2,0x0000(r16)
000242c4: 34030001 ori r3,r0,0x0001
000242c8: 3c018003 lui r1,0x8003
000242cc: a0232895 sb r3,0x2895(r1)
000242d0: 00021080 sll r2,r2,0x02
000242d4: 3c018003 lui r1,0x8003
000242d8: 00220821 addu r1,r1,r2
000242dc: 94232914 lhu r3,0x2914(r1)
000242e0: 92020000 lbu r2,0x0000(r16)
000242e4: 2405ffff addiu r5,r0,0xffff
000242e8: 00021080 sll r2,r2,0x02
000242ec: 3c018003 lui r1,0x8003
000242f0: a4232898 sh r3,0x2898(r1)
000242f4: 3c018003 lui r1,0x8003
000242f8: 00220821 addu r1,r1,r2
000242fc: 94222928 lhu r2,0x2928(r1)
00024300: 3c018003 lui r1,0x8003
00024304: a422289a sh r2,0x289a(r1)
00024308: 0c009bd6 jal 0x00026f58
0002430c: 3406005c ori r6,r0,0x005c
00024310: 2604006c addiu r4,r16,0x006c
00024314: 2405ffff addiu r5,r0,0xffff
00024318: 0c009bd6 jal 0x00026f58
0002431c: 34060014 ori r6,r0,0x0014
00024320: 92020000 lbu r2,0x0000(r16)
00024324: 080090de j 0x00024378
00024328: 00000000 nop

if partial reset of drawing engine (screen is not cleared)

0002432c: 3c028003 lui r2,0x8003
00024330: 90422896 lbu r2,0x2896(r2)
00024334: 00000000 nop
00024338: 2c420002 sltiu r2,r2,0x0002
0002433c: 14400007 bne r2,r0,0x0002435c
00024340: 00000000 nop
00024344: 3c028003 lui r2,0x8003
00024348: 8c422890 lw r2,0x2890(r2)
0002434c: 3c048001 lui r4,0x8001
00024350: 24840718 addiu r4,r4,0x0718
00024354: 0040f809 jalr r2,r31
00024358: 00000000 nop
0002435c: 3c028003 lui r2,0x8003
00024360: 8c42288c lw r2,0x288c(r2)
00024364: 00000000 nop
00024368: 8c420034 lw r2,0x0034(r2)
0002436c: 00000000 nop
00024370: 0040f809 jalr r2,r31
00024374: 34040001 ori r4,r0,0x0001
00024378: 8fbf0018 lw r31,0x0018(r29)
0002437c: 8fb10014 lw r17,0x0014(r29)
00024380: 8fb00010 lw r16,0x0010(r29)
00024384: 27bd0020 addiu r29,r29,0x0020
00024388: 03e00008 jr r31
0002438c: 00000000 nop