nolibgs_hello_worlds/hello_bs/README.md

92 lines
2.1 KiB
Markdown
Raw Permalink Normal View History

2021-07-21 14:57:00 +02:00
# Loading a BS still image
You need [mkpsxiso](https://github.com/Lameguy64/mkpsxiso) in your $PATH to generate a PSX disk image.
## Compile
```bash
make all
```
## Clean directory
```bash
make cleansub
```
## Converting a still image to BS
`MC32` can convert these formats to BS : TIM, RGB, YUV.
### Image > TIM with img2tim
Convert your image to a 24bpp TIM with [`img2tim`](https://github.com/Lameguy64/img2tim):
```bash
2021-07-21 16:30:19 +02:00
img2tim -bpp 24 -o output.tim input.png
2021-07-21 14:57:00 +02:00
```
Then use `MC32` as instructed below.
2021-07-21 16:28:30 +02:00
Result :
```bash
identify bace.tim
bace.tim TIM 320x240 320x240+0+0 8-bit sRGB 230420B 0.000u 0:00.000
```
2021-07-21 16:39:08 +02:00
### Image > RGB with imagemagick
2021-07-21 14:57:00 +02:00
2021-07-21 16:20:19 +02:00
You can convert your image to RGB with:
2021-07-21 14:57:00 +02:00
```bash
2021-07-21 16:20:19 +02:00
convert input.png RGB:output.rgb
2021-07-21 14:57:00 +02:00
```
2021-07-21 16:28:30 +02:00
Result :
```bash
identify -size 320x240 -depth 8 RGB:bace.rgb
RGB:bace.rgb=>bace.rgb RGB 320x240 320x240+0+0 8-bit sRGB 230400B 0.000u 0:00.003
```
2021-07-21 14:57:00 +02:00
2021-07-21 16:20:19 +02:00
### Image > YUV422 UYVY with imagemagick
You can convert your image to YUV with:
```bash
convert input.png UYVY:output.yuv
```
2021-07-21 16:28:30 +02:00
Result :
```bash
dentify -size 320x240 UYVY:bace.yuv
UYVY:bace.yuv=>bace.yuv UYVY 320x240 320x240+0+0 8-bit YCbCr 153600B 0.000u 0:00.005
```
2021-07-21 16:20:19 +02:00
### TIM/RGB/UYVY > BS conversion
2021-07-21 14:57:00 +02:00
Use the [`MC32` tool](http://psx.arthus.net/tools/pimp-psx.zip) conversion tool to import the image, specifying the right dimensions, and convert to `bs` with those settings :
**Note that a BS image must have a width and height that is a multiple of 16**
```
Input: RGB, Output: bs
MDEC version : 2
Custom: Size in sectors or (2048 * sector number) bytes, Variable frame size
```
![MC32 bs conversion](https://wiki.arthus.net/assets/mc32-bs-conv.png)
## Sources & Refs
img2tim : https://github.com/Lameguy64/img2tim
MC32 : http://psx.arthus.net/tools/pimp-psx.zip
mdecnote : http://psx.arthus.net/sdk/Psy-Q/DOCS/TECHNOTE/mdecnote.pdf
2021-07-21 16:20:19 +02:00
PSX RGB and YUV format : http://psx.arthus.net/sdk/Psy-Q/DOCS/Devrefs/Dataconv.pdf , p.68
2021-07-22 10:38:02 +02:00
YUV pixel format : https://www.fourcc.org/pixel-format/yuv-uyvy/
2021-07-22 13:25:06 +02:00
RGB pixelformat : https://www.fourcc.org/pixel-format/rgb-bi_rgb/
2021-07-22 10:38:02 +02:00
RGB<>YUV conversion formulas : https://www.fourcc.org/fccyvrgb.php