ASMGuy
Junior Member
Registered: Dec 2002
Location: Chicago, IL
Posts: 17 |
when I try to DMA the picture to DMEM, I think for some reason
it's messing up the code in IMEM, I'd bet I'm fairly silly for thinking
that a whole picture will fit in DMEM. (I think DMEM's real purpose
is to store vertex data that'll be pointed to by microcode in the
RDP... ?)
I know that I probably should make sure that the DMA is done
before doing the next thing, but as you said before, the emulator
shouldn't mind .
Anyway, my code (a little messy):
org $80000400
jal OSCrashProtect
nop
jal VIInitialize
nop
jal CopyRCPCode
nop
always:
nop
j always
CopyRCPCode:
la t0,0xA4040000 ; SP_MEM_ADDR_REG
li t1,0x1000
sw t1,0(t0) ; SP memory address
la t0,0xA4040004 ; SP_DRAM_ADDR_REG
la t1,RCPCode
sw t1,0(t0)
la t0,0xA4040008 ; SP_RD_LEN_REG
li t1,160
sw t1,0(t0)
nop
nop ; time for the emulator,
; DMA the picture to DMEM
la t0,0xA4040000
li t1,0x0 ; DMEM this time
sw t1,0(t0)
la t1,MKImage
sw t1,4(t0)
li t1,320*240*2-2/2
sw t1,8(t0)
nop
nop
la t0,0xA4080000
la t1,0x00000000
sw t1,0(t0)
la t0,0xA4040010
li t1,%100101101 ; make the code run
sw t1,0(t0)
jr ra
nop
include MK.s
include OS.h
include VI.h
RCPCode:
obj 0x0
nop
la t0,0xA4040000
li t1,0x0
sw t1,0(t0)
li t1,0xA0200000
sw t1,4(t0)
la t0,0xA404000c
li t1,320*240*2-2
sw t1,0(t0)
infin:
nop
j infin
ENDRCPCode:
nop
objend
Report this post to a moderator | IP: Logged
|