I'm trying to make my own h.bin for the MaTiaZ TIFF loader, but I can't get it to succeed writing some data to a file. I've done the code in assembler, so here's how I do it:
Code: Select all
# a0 = SCEPAF_MODULE
# pc = 0x08800000
# SCEPAF_MODULE ($s3)
addu $s3,$zero,$a0
# sceIoOpen()
lui $t0,0x15
ori $t0,$t0,0xee70
addu $t0,$t0,$s3
# file path
lui $a0,0x880
ori $a0,$a0,0x200
# flags write & create
addiu $a1,$zero,0x602
jalr $ra,$t0
# mode 0777
addiu $a2,$zero,0x1ff
# file descriptor ($s2)
or $s2,$zero,$v0
# sceIoWrite()
lui $s1,0x880
ori $s1,$s1,0x200
lui $t0,0x15
ori $t0,$t0,0xee40
addu $t0,$t0,$s3
# file descriptor
addu $a0,$zero,$s2
# size
addiu $a2,$zero,0x10
jalr $ra,$t0
# pointer to data
addu $a1,$zero,$s1
# sceIoClose()
lui $t0, 0x15
ori $t0,$t0,0xee60
jalr $ra,$t0
# file descriptor
addu $a0,$zero,$s2
nop
# Loop forever
lui $t0,0x880
ori $t0,$t0,0x60
jr $t0
nop
Doesn't work, well at least not the write procedure, or maybe the close, because it creates the file but it is just empty.
Anyone sees anything wrong in here? Thanks in advance!