P33 SetDrawTPage
Jump to navigation
Jump to search
00023ebc: 27bdffd8 addiu r29,r29,0xffd8 00023ec0: afb3001c sw r19,0x001c(r29) 00023ec4: 00809821 addu r19,r4,r0 # pointer to primative 00023ec8: afb20018 sw r18,0x0018(r29) 00023ecc: 00a09021 addu r18,r5,r0 # drawing to display area 00023ed0: afb00010 sw r16,0x0010(r29) 00023ed4: 00c08021 addu r16,r6,r0 # dither processing flag 00023ed8: afb10014 sw r17,0x0014(r29) 00023edc: 00e08821 addu r17,r7,r0 # tpage to draw 00023ee0: 34020001 ori r2,r0,0x0001 00023ee4: afbf0020 sw r31,0x0020(r29) 00023ee8: 0c00916f jal 0x000245bc # ? Accessor (0x245bc) <- configuration of VRAM? 1,2 = 2mb, 3 = < 1mb? 00023eec: a2620003 sb r2,0x0003(r19) 00023ef0: 34030001 ori r3,r0,0x0001 00023ef4: 10430006 beq r2,r3,0x00023f10 # branch never (fft value = 3) 00023ef8: 00000000 nop 00023efc: 0c00916f jal 0x000245bc 00023f00: 00000000 nop 00023f04: 34030002 ori r3,r0,0x0002 00023f08: 14430009 bne r2,r3,0x00023f30 # branch always (fft value = 3) 00023f0c: 00000000 nop 00023f10: 12000002 beq r16,r0,0x00023f1c 00023f14: 3c03e100 lui r3,0xe100 00023f18: 34630800 ori r3,r3,0x0800 # only set if VRAM = 2MB [[1]], texture page y in base 2 00023f1c: 12400002 beq r18,r0,0x00023f28 00023f20: 322227ff andi r2,r17,0x27ff 00023f24: 34421000 ori r2,r2,0x1000 00023f28: 08008fd3 j 0x00023f4c 00023f2c: 00621025 or r2,r3,r2
the part that matters: 00023f30: 12000002 beq r16,r0,0x00023f3c 00023f34: 3c07e100 lui r7,0xe100 # drawmode instruction 00023f38: 34e70200 ori r7,r7,0x0200 # dither 24bit -> 15bit 00023f3c: 12400002 beq r18,r0,0x00023f48 # branch if not drawing to display area 00023f40: 322209ff andi r2,r17,0x09ff # retain most Tpage flags 00023f44: 34420400 ori r2,r2,0x0400 # else, set draw to display area 00023f48: 00e21025 or r2,r7,r2 # bit-combine 00023f4c: ae620004 sw r2,0x0004(r19) # store drawmode = texturepage 00023f50: 8fbf0020 lw r31,0x0020(r29) 00023f54: 8fb3001c lw r19,0x001c(r29) 00023f58: 8fb20018 lw r18,0x0018(r29) 00023f5c: 8fb10014 lw r17,0x0014(r29) 00023f60: 8fb00010 lw r16,0x0010(r29) 00023f64: 27bd0028 addiu r29,r29,0x0028 00023f68: 03e00008 jr r31 00023f6c: 00000000 nop