Psy-Q TIM EXAMPLE
- t0rxe
- C Programming Expert
- Posts: 139
- Joined: Dec 19, 2012
- Motto: /\OX[]
- PlayStation Model: SCPH-5502
- Location: Australia
Psy-Q TIM EXAMPLE
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:
You do not have the required permissions to view the files attached to this post.
"Nostalgia isn't a big enough word to describe the PlayStation from my eyes"
I tried to put my own image in here, but I get this error:
You do not have the required permissions to view the files attached to this post.
Jack and the Beanstalk:
http://www.atari2600land.com/jackandthebeanstalk
http://www.atari2600land.com/jackandthebeanstalk
- t0rxe
- C Programming Expert
- Posts: 139
- Joined: Dec 19, 2012
- Motto: /\OX[]
- PlayStation Model: SCPH-5502
- Location: Australia
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.
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.
"Nostalgia isn't a big enough word to describe the PlayStation from my eyes"
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?
You do not have the required permissions to view the files attached to this post.
Jack and the Beanstalk:
http://www.atari2600land.com/jackandthebeanstalk
http://www.atari2600land.com/jackandthebeanstalk
- t0rxe
- C Programming Expert
- Posts: 139
- Joined: Dec 19, 2012
- Motto: /\OX[]
- PlayStation Model: SCPH-5502
- Location: Australia
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
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
"Nostalgia isn't a big enough word to describe the PlayStation from my eyes"
Hurrah! It works! Thank you.
Jack and the Beanstalk:
http://www.atari2600land.com/jackandthebeanstalk
http://www.atari2600land.com/jackandthebeanstalk
-
Administrator Verified
- Admin / PSXDEV
- Posts: 2689
- Joined: Dec 31, 2012
- I am a: Shadow
- PlayStation Model: H2000/5502
Use a different binary conversion program. Preferably a command line based one.
http://psxdev.net/tools/bin2h.exe
http://psxdev.net/tools/bin2h.exe
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.
PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.
PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.
-
Administrator Verified
- Admin / PSXDEV
- Posts: 2689
- Joined: Dec 31, 2012
- I am a: Shadow
- PlayStation Model: H2000/5502
It's good because if others have the same issue, they might find it useful
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.
PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.
PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.
- MrQuetch
- Active PSXDEV User
- Posts: 42
- Joined: Apr 01, 2018
- I am a: Programmer and artist.
- Motto: You can accomplish anything.
- Location: United States
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.
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.
-
gwald Verified
- Net Yaroze Enthusiast
- Posts: 313
- Joined: Sep 18, 2013
- I am a: programmer/DBA
- PlayStation Model: Net Yaroze
- Contact:
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
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.
If you want to create TIM's in PS1 RAM dynamically, you can, the 16bit format was the easiest for me anyway
"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.
- MrQuetch
- Active PSXDEV User
- Posts: 42
- Joined: Apr 01, 2018
- I am a: Programmer and artist.
- Motto: You can accomplish anything.
- Location: United States
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.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
"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.
Who is online
Users browsing this forum: No registered users and 1 guest