Page 1 of 1

24-bit color mode example

Posted: June 3rd, 2013, 6:26 pm
by LameGuy64

PlayStation 1 24-bit color mode example

Username: LameGuy64
Project Title: 24-bit color mode example
Time to Complete: 3 days
SDK: PSY-Q
Genre: Example
Latest Release: Version 1.0
In Development: No
Initial Release Date: 03-JUN-2013
Last Date Updated: 03-JUN-2013
Controller: Standard
Players: 1
Memory Card: N/A
Languages: English
Region: NTSC
Burn and Play: Yes
Executable Included: No
Source Included: Yes

This is a little program that demonstrates the use of the 640x480 24-bit color video mode on the PlayStation by loading 640x480 24-bit bitmap images. It also features a file buffer system I've made to make reading files from the CD a lot easier to do as you don't have to read the data in multiples of 2048 bytes.

I should note that the bitmap loader is very slow on a real PSX as it has to convert the color components in the bitmap file from BGR to RGB component order and has to load it row by row since bitmap files are saved with the image data upside down. Also, it only supports 640x480 24-bit bitmaps without color space information so its not very useful for almost anything other than this demo. If you want to load lossless 24-bit images quickly, you can use a 24-bit raw image dump which you load the file entirely into main memory and transfer its contents into the framebuffer but I'll cover that in a later date.

NOTE: The bitmap images I've included in this example are drawn by myself.

- LameGuy64

Image

CUE + BIN and Source Code:

Re: 24-bit color mode example

Posted: June 3rd, 2013, 6:36 pm
by t0rxe
Excellent! :clap

Just a small tip though. You don't need in your makefile:

Code: Select all

for_menu:
   ccpsx -O -Xo$80010000 main.c \psx\lib\none2.obj -oarot.cpe
You just need:

Code: Select all

# -----------------------------------------
#       PlayStation 1 Psy-Q Makefile
# Sony Computer Entertainment Europe (SCEE)
# -----------------------------------------

all:
	del mem.map
	del main.sym
	del main.exe
	del main.cpe
	cls

	ccpsx -O3 -Xo$80010000 main.c -omain.cpe,main.sym,mem.map
	#ccpsx -O3 -Xo$80010000 main.c psyq/lib/none2.obj

	cpe2x /CE main.cpe
Also, you should clear the VRAM before loading in another image: http://www.psxdev.net/forum/viewtopic.php?f=51&t=316

On another note, I was going to look into using the libpress library for .BR files made by converting tims in MC32.
It would make loading quick and offer storage benefits because it is under compression.
How to make the .BR file correctly is what I'm currently stuck on, so I'm reading the Sony documents.