## (c) Jim 'bob' 1997 ## www.playstation.co.uk/~Sig1LL ## sigill@geocities.com ## ## shitty screen wibbler/lava lamp sorta thing. ## This is really a test prog to see what sort ## of work loads the r3000 can handle before ## it starts maxing out. ## It really proves that the gpu/gte combo ## are the real workhorses on the psx. ## I guess I could speed it up a bit by ## taking LoadImage apart to step up the ## DMA transfer to vram. ## If I get some time soon I may move it ## to 100% asm to cut out the annoying ## frame loop. Then I should be able to ## avoid doing the stack frame. ## I wonder if I could cut down the trigtab ## and jam it in the dCache? I could also ## structure the delay slots a little ## (read lot) better too. ## ## Let me know what you do with this. ## All the best - Jim .text .align 2 .globl DrawFrame .ent DrawFrame DrawFrame: .frame $fp,40,$31 subu $sp,$sp,40 sw $fp,32($sp) sw $31,36($sp) la $5, 0x1f800010 addu $10,$0,1 lw $4, 0($5) la $11,0x80120000 addu $4,$4,4 addu $9,$0,0 and $4,$4,0x3ff sw $4, 0($5) $outer: la $14, 0x80092000 #costab sll $24, $9, 2 # y * 4 addu $24,$24,$14 # cost[y] lw $24, 0($24) # sty_b la $14, 0x80090000 #sintab sll $25, $9, 2 # y * 4 addu $25,$25,$14 # sint[y] lw $25, 0($25) # sty_a addu $8,$0,0 $iner: la $14, 0x80090000 # calc XX add $5, $4, $8 # theta = theta +x and $5, $5, 0x3ff sll $5, $5, 2 # thetax * 4 add $14, $14, $5 # sintab[thetax] lw $14, 0($14) sll $6, $4, 1 # theta << 1 srl $12, $8, 1 # x >> 1 add $6, $6, $12 # (theta <<1) + (x >> 1) add $6, $24, $6 # (theta<<1)+(x>>1)+cos[y] subu $13,$6,$14 srl $13, $13, 4 # >> 4 and $13, $13, 16 # & 16 srl $13, $13, 2 # >> 3 # calc yy la $6, 0x80092000 add $6, $6, $5 # costab[thetax] lw $6, 0($6) add $14, $12, $25 # x >> 1+ sty_a add $14, $14, $6 srl $14, $14, 4 and $14, $14, 16 srl $14, $14, 1 la $12, 0x1f800000 or $13,$13,$14 add $12, $12, $13 lh $13, 0($12) sh $13, 0($11) add $11,$11,2 addu $8,$8,1 ble $8,255,$iner nop addu $9,$9,1 ble $9,200, $outer jal DrawSync la $4, 0 jal VSync jal GsSwapDispBuff la $4, Page lw $8,0($4) not $5,$8 sw $5,0($4) la $4,0x1f800014 and $8,$8,1 sll $8,$8,8 addu $8,$8,20 sh $8,2($4) la $5,0x80120000 jal LoadImage lw $31,36($sp) lw $fp,32($sp) addu $sp,$sp,40 j $31 nop .end DrawFrame