Page 1 of 1
Psy-Q TIM EXAMPLE
Posted: June 3rd, 2013, 4:30 pm
by t0rxe
PlayStation 1 Psy-Q TIM EXAMPLE
Username: PSXDEV.net
Project Title: TIM EXAMPLE
Time to Complete: 30 minutes
SDK: PSY-Q
Genre: Example
Latest Release: Version 1.2
In Development: No
Initial Release Date: 26-JANUARY-2013
Last Date Updated: 02-JUNE-2013
Controller: N/A
Players: N/A
Memory Card: N/A
Languages: Eng
Region: Auto
Burn and Play: No
Executable Included: Yes
Source Included: Yes
A simple TIM demo for Psy-Q. Draws in 320x256 at 16-bits PAL and 320x240 NTSC.
Read the comments carefully in the main.c file for information.
PS-EXE and Source Code:
timexample.zip
Re: Psy-Q TIM EXAMPLE
Posted: July 3rd, 2013, 5:37 pm
by Chris
I tried to put my own image in here, but I get this error:
Re: Psy-Q TIM EXAMPLE
Posted: July 3rd, 2013, 5:56 pm
by t0rxe
That is because the file 'image.h' contains the character to parse through into the linker.
In this case, I named it 'image' IE: unsigned char image[] = { 0x00 ... }
If you make a new header/binary, make sure you rename the u_char to the one that matches the extern u_char (unsigned char).
You make a TIM using TIMTOOL. Import your image (BMP, PNG, etc) and make it 16-BIT while placing it at 320x0, as those are the coordinates I programmed it to use.
Then you convert your TIM to a binary by using BIN2H (included) naming the u_char 'image'.
I didn't have to make the example like this. I could have just loaded the TIM directly, but for simplistic example reasons this way works fine.
Re: Psy-Q TIM EXAMPLE
Posted: July 3rd, 2013, 7:55 pm
by Chris
OK, I drew a 320x240 picture, and I put it in the tim making tool, and this is what I got when I ran it on a PSX emulator. What's going on?
Re: Psy-Q TIM EXAMPLE
Posted: July 3rd, 2013, 8:08 pm
by t0rxe
Ah! Sorry, there is a small mistake in my code
Change it to this:
image1[1].tpage=GetTPage(1, 2, 576, 0);
Before it was at 320 which is why it was messing up. My apologies.
I have updated the code to Version 1.2 above
Re: Psy-Q TIM EXAMPLE
Posted: July 3rd, 2013, 8:33 pm
by Chris
Hurrah! It works! Thank you.
Re: Psy-Q TIM EXAMPLE
Posted: April 16th, 2016, 12:50 pm
by atm959
I am having trouble. When I use bin2h, it crashes. I followed the steps leading up to it. I am running Windows 7 32 bit.
Re: Psy-Q TIM EXAMPLE
Posted: April 16th, 2016, 1:09 pm
by atm959
Re: Psy-Q TIM EXAMPLE
Posted: April 16th, 2016, 1:49 pm
by Administrator
Use a different binary conversion program. Preferably a command line based one.
http://psxdev.net/tools/bin2h.exe
Re: Psy-Q TIM EXAMPLE
Posted: April 16th, 2016, 2:33 pm
by atm959
Thanks for the reply! I found out what was wrong.
Re: Psy-Q TIM EXAMPLE
Posted: August 1st, 2018, 7:13 pm
by atm959
I wish that I could delete these old comments lol. I didn't know what I was doing back then, but I've learned since then.
Re: Psy-Q TIM EXAMPLE
Posted: August 1st, 2018, 7:25 pm
by Administrator
atm959 wrote: ↑August 1st, 2018, 7:13 pm
I wish that I could delete these old comments lol. I didn't know what I was doing back then, but I've learned since then.
It's good because if others have the same issue, they might find it useful
Re: Psy-Q TIM EXAMPLE
Posted: December 20th, 2018, 4:51 pm
by MrQuetch
Forgive me if this question is absurd... I'm sure I've asked this somewhere before... But, it's been awhile...
Is it possible to manually manipulate the pixels in those texture sheets?
I'm not referring to the actual texture sheets themselves, but rather the program that edits them.
Is there another method to get textures working besides the TIM editor?
I was thinking I could just have an array of colors in my project, and somehow tell a textured primitive to take that data and use it. Is this possible?
Thank you.
Re: Psy-Q TIM EXAMPLE
Posted: December 21st, 2018, 8:18 am
by gwald
Not sure what you mean by 'TIM editor'.
If you want to create TIM's in PS1 RAM dynamically, you can, the 16bit format was the easiest for me anyway
MrQuetch wrote: ↑December 20th, 2018, 4:51 pm
I was thinking I could just have an array of colors in my project, and somehow tell a textured primitive to take that data and use it. Is this possible?
"textured primitive" I'm assuming you're talking about 3D polygons.
If you want a solid or gradient colours then just use the RGB polygon values and don't bother with UV's coords?
If want a small text sample, you can too, you just set the UV's and if you want to colour the textures with RGB that's also possible, to give you that N64 look
Maybe saying what you want to achieve would help? ie easiest way to make a 3D textured object flash in a solid colour.
Re: Psy-Q TIM EXAMPLE
Posted: February 11th, 2020, 9:18 am
by MrQuetch
gwald wrote: ↑December 21st, 2018, 8:18 am
Not sure what you mean by 'TIM editor'.
If you want to create TIM's in PS1 RAM dynamically, you can, the 16bit format was the easiest for me anyway
MrQuetch wrote: ↑December 20th, 2018, 4:51 pm
I was thinking I could just have an array of colors in my project, and somehow tell a textured primitive to take that data and use it. Is this possible?
"textured primitive" I'm assuming you're talking about 3D polygons.
If you want a solid or gradient colours then just use the RGB polygon values and don't bother with UV's coords?
If want a small text sample, you can too, you just set the UV's and if you want to colour the textures with RGB that's also possible, to give you that N64 look
Maybe saying what you want to achieve would help? ie easiest way to make a 3D textured object flash in a solid colour.
This is an awfully late reply... But, I ended up using the 'ClearImage' function to draw squares and pixels in the PS1 texture buffer. So far, it's working perfectly for polygons that use textures. I've also studied the *.TIM file format for a 16-bit image and will be making my own program to convert 24-color bitmaps to that exact file format in a C++ program. Unfortunately, your post didn't help that much as I asked about making arrays of colors and sending them to the buffer - you didn't provide any way of how I could do that. But, I appreciate the attempt.