Skip to content

Commit

Permalink
cdrom/getloc: Program to test behavior of stat bits and getloc com… (#4)
Browse files Browse the repository at this point in the history
Co-authored-by: Jakub Czekański <[email protected]>
  • Loading branch information
stenzek and JaCzekanski authored Mar 29, 2020
1 parent 8b10fec commit 747833e
Show file tree
Hide file tree
Showing 5 changed files with 440 additions and 129 deletions.
67 changes: 34 additions & 33 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
TOPTARGETS = build clean

IMAGES = common \
cdrom/disc-swap \
cpu/access-time \
cpu/code-in-scratchpad \
dma/otc-test \
gpu/bandwidth \
gpu/benchmark \
gpu/clipping \
gpu/gp0-e1 \
gpu/lines \
gpu/mask-bit \
gpu/quad \
gpu/rectangles \
gpu/texture-overflow \
gpu/transparency \
gpu/triangle \
gpu/vram-to-vram-overlap \
gte-fuzz \
mdec \
spu/memory-transfer \
spu/ram-sandbox \
spu/stereo \
spu/test \
spu/toolbox \
timers

$(TOPTARGETS): $(IMAGES)
$(IMAGES):
@$(MAKE) --no-print-directory -C $@ $(MAKECMDGOALS)

.PHONY: $(TOPTAGETS) $(IMAGES)
TOPTARGETS = build clean

IMAGES = common \
cdrom/disc-swap \
cdrom/getloc \
cpu/access-time \
cpu/code-in-scratchpad \
dma/otc-test \
gpu/bandwidth \
gpu/benchmark \
gpu/clipping \
gpu/gp0-e1 \
gpu/lines \
gpu/mask-bit \
gpu/quad \
gpu/rectangles \
gpu/texture-overflow \
gpu/transparency \
gpu/triangle \
gpu/vram-to-vram-overlap \
gte-fuzz \
mdec \
spu/memory-transfer \
spu/ram-sandbox \
spu/stereo \
spu/test \
spu/toolbox \
timers

$(TOPTARGETS): $(IMAGES)
$(IMAGES):
@$(MAKE) --no-print-directory -C $@ $(MAKECMDGOALS)

.PHONY: $(TOPTAGETS) $(IMAGES)
193 changes: 97 additions & 96 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,96 +1,97 @@
# ps1-tests

Collection of PlayStation 1 tests for emulator development and hardware verification

## Tests

### CD-ROM

Name | Description
-------------------------|------------
disc-swap | Program to observe behavior of CD-ROM controller when opening/closing the drive cover.

### CPU

Name | Description
-------------------------|------------
access-time | Test CPU access time to different parts of memory map
code-in-scratchpad | **(Not finished)** Check whether code execution from Scratchpad is possible

### DMA

Name | Description
-------------------------|------------
otc-test | DMA Channel 6 (OTC aka Ordering Table clear) unit tests

### GPU

Name | Description
-------------------------|------------
bandwidth | Measure GPU/VRAM bandwidth
benchmark | GPU test to benchmark rasterizer for various commands
clipping | Test Draw Area/Clipping GP0(0xE3), GP0(0xE4) using rectangle and quad
gp0-e1 | Check if GP0_E1, GPUSTAT and polygon render uses the same register internally
lines | Draws lines using different modes - for verifying Bresenham implementation, color blending, polyline handling
mask-bit | Check Mask bit behavior during VRAM copy operations
quad | Semi-transparent polygon commands - for testing fill rules and transparency handling
rectangles | Draws all combinations of Rectangle commands
texture-overflow | Draws textured rectangle with UV overflowing VRAM width
transparency | Draws rectangles with 4 semi-transparent blending modes
triangle | Draws Gouroud shaded equilateral triangle
vram-to-vram-overlap | Test GP0(80) VRAM-VRAM copy behaviour in overlapping rects

### GTE

Name | Description
-------------------------|------------
gte-fuzz | Executes GTE opcodes with random parameters, can be used to verify against real console

### MDEC

Name | Description
-------------------------|------------
mdec | Framework for testing MDEC decoder, default values uses DMA for all transfers, but it can be reconfigured for PIO as well (needs manual recompilation)

### SPU

Name | Description
-------------------------|------------
memory-transfer | Test DMA and regular IO transfers to SPU RAM
ram-sandbox | SPU memory access sandbox (used for memory-transfer test development)
stereo | Play samples on first two voices
test | Check SPU behavior (data is lost randomly on 32bit access, ok on 16bit)
toolbox | SPU register preview and simple voice playback tool

### Timer

Name | Description
-------------------------|------------
timers | Run Timer0,1,2 using various clock sources and sync modes and time them using busy loops and vblank interrupt

Note: Make sure your PS-EXE loaded does set default value for Stack Pointer - these .exes has SP set to 0.

## Tools

Name | Description
-------------------------|------------
diffvram | Diff two images and write diff png if image contents aren't exactly the same

## Download

[Latest release](https://github.com/JaCzekanski/ps1-tests/releases/latest)

## Examples

<img src="gpu/benchmark/screenshot.png" height="480">
<img src="gpu/lines/vram.png" height="256">
<img src="gpu/transparency/vram.png" height="256">
<img src="gpu/rectangles/vram.png" height="256">
<img src="gpu/texture-overflow/vram.png" height="256">
<img src="gpu/vram-to-vram-overlap/vram.png" height="256">

## Build

```
docker run -it -v $(pwd):/build jaczekanski/psn00bsdk:latest make
```
# ps1-tests

Collection of PlayStation 1 tests for emulator development and hardware verification

## Tests

### CD-ROM

Name | Description
-------------------------|------------
disc-swap | Program to observe behavior of CD-ROM controller when opening/closing the drive cover.
getloc | Program to test the seeking/reading stat bits of the controller and Getloc commands

### CPU

Name | Description
-------------------------|------------
access-time | Test CPU access time to different parts of memory map
code-in-scratchpad | **(Not finished)** Check whether code execution from Scratchpad is possible

### DMA

Name | Description
-------------------------|------------
otc-test | DMA Channel 6 (OTC aka Ordering Table clear) unit tests

### GPU

Name | Description
-------------------------|------------
bandwidth | Measure GPU/VRAM bandwidth
benchmark | GPU test to benchmark rasterizer for various commands
clipping | Test Draw Area/Clipping GP0(0xE3), GP0(0xE4) using rectangle and quad
gp0-e1 | Check if GP0_E1, GPUSTAT and polygon render uses the same register internally
lines | Draws lines using different modes - for verifying Bresenham implementation, color blending, polyline handling
mask-bit | Check Mask bit behavior during VRAM copy operations
quad | Semi-transparent polygon commands - for testing fill rules and transparency handling
rectangles | Draws all combinations of Rectangle commands
texture-overflow | Draws textured rectangle with UV overflowing VRAM width
transparency | Draws rectangles with 4 semi-transparent blending modes
triangle | Draws Gouroud shaded equilateral triangle
vram-to-vram-overlap | Test GP0(80) VRAM-VRAM copy behaviour in overlapping rects

### GTE

Name | Description
-------------------------|------------
gte-fuzz | Executes GTE opcodes with random parameters, can be used to verify against real console

### MDEC

Name | Description
-------------------------|------------
mdec | Framework for testing MDEC decoder, default values uses DMA for all transfers, but it can be reconfigured for PIO as well (needs manual recompilation)

### SPU

Name | Description
-------------------------|------------
memory-transfer | Test DMA and regular IO transfers to SPU RAM
ram-sandbox | SPU memory access sandbox (used for memory-transfer test development)
stereo | Play samples on first two voices
test | Check SPU behavior (data is lost randomly on 32bit access, ok on 16bit)
toolbox | SPU register preview and simple voice playback tool

### Timer

Name | Description
-------------------------|------------
timers | Run Timer0,1,2 using various clock sources and sync modes and time them using busy loops and vblank interrupt

Note: Make sure your PS-EXE loaded does set default value for Stack Pointer - these .exes has SP set to 0.

## Tools

Name | Description
-------------------------|------------
diffvram | Diff two images and write diff png if image contents aren't exactly the same

## Download

[Latest release](https://github.com/JaCzekanski/ps1-tests/releases/latest)

## Examples

<img src="gpu/benchmark/screenshot.png" height="480">
<img src="gpu/lines/vram.png" height="256">
<img src="gpu/transparency/vram.png" height="256">
<img src="gpu/rectangles/vram.png" height="256">
<img src="gpu/texture-overflow/vram.png" height="256">
<img src="gpu/vram-to-vram-overlap/vram.png" height="256">

## Build

```
docker run -it -v $(pwd):/build jaczekanski/psn00bsdk:latest make
```
4 changes: 4 additions & 0 deletions cdrom/getloc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
TARGET = getloc.elf
LIBS += -lpsxspu -lpsxcd

include ../../common-test.mk
Loading

0 comments on commit 747833e

Please sign in to comment.