diff options
| author | John "Lameguy" Wilbert Villamor <lameguy64@gmail.com> | 2022-09-26 16:49:56 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-26 16:49:56 +0800 |
| commit | c4a2533d21dfd05cde841ea48c67b05e0e6a853f (patch) | |
| tree | c7ef61653b157b69fb0956709366996ddbc4ecfa /libpsn00b/psxgpu/storeimage.s | |
| parent | a8b404b3400c3ebd8e0b923dcaefcc49ea563e36 (diff) | |
| parent | 86f0064afb8200e60dd80827535cac30d0eab028 (diff) | |
| download | psn00bsdk-c4a2533d21dfd05cde841ea48c67b05e0e6a853f.tar.gz | |
Merge pull request #55 from spicyjpeg/psxmdec
Full MDEC support, C library refactors, cleanups and bugfixes (v0.20)
Diffstat (limited to 'libpsn00b/psxgpu/storeimage.s')
| -rw-r--r-- | libpsn00b/psxgpu/storeimage.s | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/libpsn00b/psxgpu/storeimage.s b/libpsn00b/psxgpu/storeimage.s deleted file mode 100644 index 554e83c..0000000 --- a/libpsn00b/psxgpu/storeimage.s +++ /dev/null @@ -1,76 +0,0 @@ -.set noreorder - -.include "hwregs_a.h" - -.set RECT_x, 0 -.set RECT_y, 2 -.set RECT_w, 4 -.set RECT_h, 6 - -.section .text - - -.global StoreImage -.type StoreImage, @function -StoreImage: - addiu $sp, -8 - sw $ra, 0($sp) - sw $s0, 4($sp) - - lui $s0, IOBASE # Set I/O segment base address - -.Lgpu_wait: # Wait for GPU to be ready for commands and DMA - jal ReadGPUstat - nop - srl $v0, 0x1a - andi $v0, 0x5 - li $v1, 5 - bne $v0, $v1, .Lgpu_wait - nop - - lui $v0, 0x400 # Set DMA direction to off - sw $v0, GPU_GP1($s0) - - lui $v0, 0x0100 # Clear GPU cache - sw $v0, GPU_GP0($s0) - - lui $v1, 0xc000 # Store image from VRAM - sw $v1, GPU_GP0($s0) - lw $v0, RECT_x($a0) # Set XY and dimensions of image - lw $v1, RECT_w($a0) - sw $v0, GPU_GP0($s0) - sw $v1, GPU_GP0($s0) - - lui $v0, 0x400 # Set DMA direction to VRAMtoCPU - ori $v0, 0x3 - sw $v0, GPU_GP1($s0) - - lhu $v0, RECT_w($a0) # Get rectangle size - lhu $v1, RECT_h($a0) - nop - mult $v0, $v1 # Calculate BCR value - mflo $v1 - srl $v1, 0x4 - sll $v1, 0x10 - ori $v1, 0x8 - - sw $a1, DMA2_MADR($s0) # Set DMA base address and transfer length - sw $v1, DMA2_BCR($s0) - -.Lgpu_wait_2: # Wait for GPU to be ready for commands and DMA - jal ReadGPUstat - nop - srl $v0, 27 - andi $v0, 0x1 - beqz $v0, .Lgpu_wait_2 - nop - - lui $v0, 0x100 # Start DMA transfer - ori $v0, 0x200 - sw $v0, DMA2_CHCR($s0) - - lw $ra, 0($sp) - lw $s0, 4($sp) - jr $ra - addiu $sp, 8 - |
