QJ.NET | Videos | Forums | iPhone | MMORPG | Nintendo DS | Wii | PlayStation 3 | PSP | Xbox 360 | PC | Downloads | Contact Us
Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact

QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides

Go Back   QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides > Developers Corner > PSP Development, Hacks, and Homebrew > PSP Development Forum
The above video goes away if you are a member and logged in, so log in now!

TIFF Programming Lessons

This is a discussion on TIFF Programming Lessons within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Lessons 1 - 3 + BLANK TIFF SDK Template as an All In One Check my sig. The lessons are ...

Reply
 
LinkBack Thread Tools
Old 10-31-2006, 05:24 PM   #1

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Thumbs up TIFF Programming Lessons v3: Lesson 1 - 3 + Updated BLANK Template & GFX

Lessons 1 - 3 + BLANK TIFF SDK Template as an All In One
Check my sig.
The lessons are now in side the main.c in the comments so...
Enjoy

Changelog for v3 of my lessons:
* Fixed up small bugs in GFX
* Added custom colour value (RGB)
* Added Lesson 3: Background Changer introducing SFX and bg color changing
* Added some more functions to tiffsdk.c


So, try this new version. Much more clean and organized and more functionality.

Report any bugs/suggestions/requests/problems/etc.

LESSONS:
Lesson 1: Hello World
Requires very small C programming skill. Basic app showing fade effect + text printing (ASCII games anyone? )
Lesson 2: Counter
Requires some C programming knowledge (switch statements). Basic app showing transitions with fade effect, printing a value to the screen (integer), and most importantly: controls/button input.
Lesson 3: Background Changer
Requires more C programming knowledge than last lesson, but not a whole lot. Basic app showing how to do menus efficiently, take input for each option menu, as well as change background color. Best of all, SFX is introduced! Yes, shows usage of sounds. A nice touch is the usage of RANDOM colour'd text.

__________________

Last edited by SG57; 11-02-2006 at 08:03 PM..
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-31-2006, 05:45 PM   #2

I'm Baaaack!
 
Access_Denied's Avatar
 
Join Date: May 2006
Location: Waukegan,Illinois
Posts: 2,185
Trader Feedback: 0
Default

Good Job. Too bad it's only a Hello World.
-= Double Post =-
Just two things that need fixing.

1. You said that on a normal graph, (0,0) is in the bottom right hand corner. It's actually in the bottom left. I know that, but other people might not.

2. Your forgot the ";" after fadeOut.
__________________

Last edited by Propel; 10-31-2006 at 05:45 PM.. Reason: Automerged Doublepost
Access_Denied is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-31-2006, 05:46 PM   #3
 
davidthefat's Avatar
 
Join Date: Mar 2006
Posts: 146
Trader Feedback: 0
Default

good job but i think noobs wont be able to use the psp-programs tutorials cuz the 1.5 has way more functions so that is a real good idea... but psp programming is pretty self xplanitory after u see some source codes (or is it just me??)
davidthefat is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-31-2006, 05:46 PM   #4
 
Join Date: Sep 2006
Location: Crack City
Posts: 2,032
Trader Feedback: 0
Default

Quote:
Originally Posted by Propel
Good Job. Too bad it's only a Hello World.
this is off topic, but could you please change your font color? i cant read your posts. i have to highlight your posts just to see what they say.
--DylanDangles-- is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-31-2006, 05:46 PM   #5

lol
 
Anti-QuickJay's Avatar
 
Join Date: Aug 2006
Real First Name: Robert
Location: Whittier, CA
Just Played: Madden 10
Posts: 5,791
Trader Feedback: 0
Default

This is nice! Hopefully i can learn, Then i can make some TIFF games!
Anti-QuickJay is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-31-2006, 05:49 PM   #6

I'm Baaaack!
 
Access_Denied's Avatar
 
Join Date: May 2006
Location: Waukegan,Illinois
Posts: 2,185
Trader Feedback: 0
Default

SG57, you forgot the loadbin.tif. And, no, I won't change my font color. But, I'll change to a thicker font.
__________________
Access_Denied is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-31-2006, 05:51 PM   #7
 
davidthefat's Avatar
 
Join Date: Mar 2006
Posts: 146
Trader Feedback: 0
Default

Quote:
Originally Posted by Propel
SG57, you forgot the loadbin.tif. And, no, I won't change my font color. But, I'll change to a thicker font.
u realy dont need to change it unless u actually get into it
davidthefat is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-31-2006, 07:03 PM   #8
 
shaminpsp's Avatar
 
Join Date: Jul 2006
Location: Singapore
Posts: 445
Trader Feedback: 0
Default

SG57 is god of TIFF
shaminpsp is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-31-2006, 07:42 PM   #9

lol
 
Anti-QuickJay's Avatar
 
Join Date: Aug 2006
Real First Name: Robert
Location: Whittier, CA
Just Played: Madden 10
Posts: 5,791
Trader Feedback: 0
Default

Quote:
Originally Posted by Propel
SG57, you forgot the loadbin.tif. And, no, I won't change my font color. But, I'll change to a thicker font.
Its hard to read what you say so for now on i wont read what you say...
Anti-QuickJay is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-31-2006, 08:40 PM   #10
 
pspcoder05's Avatar
 
Join Date: Sep 2006
Posts: 167
Trader Feedback: 0
Default

Thanks. This is superb.
pspcoder05 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-31-2006, 09:08 PM   #11
 
Join Date: May 2006
Posts: 46
Trader Feedback: 0
Default

Omggg I Been Waitin For This Nice S*** Sg I Was The One Who Told U Once To Make A Tutorial For Us ..thankssss Alot For Real ..
-= Double Post =-
I Love The Fire Application U Did ..how About U Make Somtin So When We Press A Button It Changes Colors Like A Blue Fire Or Maybe Green Fire... Thanks

Last edited by IMMIGRANT; 10-31-2006 at 09:08 PM.. Reason: Automerged Doublepost
IMMIGRANT is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-31-2006, 09:11 PM   #12

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

Ok, back from friends... First Im going to finish the tutorials, but its soooo hard to explain this stuff to people without ANY C knowledge, so from now on, im going to commnet it as if you know it, and if you dont, ill be linking every function/operator/routine used to a site to explain it. As for loadbin.tif - I explained what to do thinking every 2.8 user knows what a hex editor is as almost all of them like editing the text in some apps...

As for the other apps (flamez) im going to release the source to everything ive released so i dont have to be the only one on them... This way - people can update, learn and improve what ive started - only thing is theres a bug in Crucenic's collision i want to fix.
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-31-2006, 09:32 PM   #13

lol
 
Anti-QuickJay's Avatar
 
Join Date: Aug 2006
Real First Name: Robert
Location: Whittier, CA
Just Played: Madden 10
Posts: 5,791
Trader Feedback: 0
Default

Your my TIFF Homebrew GOD!
Anti-QuickJay is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-01-2006, 02:28 AM   #14

Developer
 
Join Date: Mar 2006
Posts: 1,026
Trader Feedback: 0
Default

This is going to sound a bit harsh - but I mean no disrespect to SG57.

I don't understand why your tutorials basically just use functions from the tetris code or your own fancy functions to print centred colored text?

Why didn't you just do simple, easy to follow examples without the gfx.c/.h stuff from tetris?

Lots of simple typo's too mate, crack down on those
__________________

Check out my homebrew & C tutorials at http://insomniac.0x89.org/
Coder formerly known as Insomniac197

Quote:
tshirtz: what is irshell ??
Atarian_: it's where people who work for the IRS go when they die
Insert_Witty_Name is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-01-2006, 04:02 PM   #15

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

I know. I was in a hurry. And hell, im not teacher and nor will i pretend to be one. But, I will finish what i started and get to lesson 4. As for typos, i think any prior experienced C coder should be able to read a debug output
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-01-2006, 06:40 PM   #16
 
Join Date: May 2006
Posts: 46
Trader Feedback: 0
Default

SG57 I JST SEEN UR SIG SO I JST MADE THIS SIG..HOPE U LIKE

IMMIGRANT is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-01-2006, 07:01 PM   #17
 
Bob Hoil's Avatar
 
Join Date: May 2006
Posts: 347
Trader Feedback: 0
Default

Lol.I might try these out.
Bob Hoil is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-01-2006, 07:31 PM   #18

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

That sig is hot... Anyway you still can remove the PSP? I like the current one, but the PSP kinda ruined it for me. So, if you could just remove the PSP thatd be really awesome (no TIFF God thing though, atleast not yet i suppose). As for lessons, ive completed another one. ITs more for people with some prior expereince with C programming so... If you dont k now C well enough to understand the lesson 2, google

But, im now trying my tutorials to see if theyactually work, and right now, lesson 2 is crashingafter fading for some reason. Ill take another look.
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-01-2006, 07:36 PM   #19
 
Join Date: May 2006
Posts: 46
Trader Feedback: 0
Default

sorry i was jst tryin to make it cooler lol




another thing am havin this error doin the HELLOWORLD can u pls check it out and tell me what can b the problem

http://i57.photobucket.com/albums/g2...igrant/yup.jpg
IMMIGRANT is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-01-2006, 07:52 PM   #20
 
davidthefat's Avatar
 
Join Date: Mar 2006
Posts: 146
Trader Feedback: 0
Default

y wont u stop with the template stuff??? u r going all their dirty work and they wont know wat to put wen they start from scratch on their own... y wont u make ur tutorials make them start from scratch and use the file they used the last time to use... ya. so they know wat the other codes actually do...
davidthefat is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-01-2006, 07:56 PM   #21
I think I ripped my pants
 
whitehawk's Avatar
 
Join Date: Jul 2005
Real First Name: Matt
Location: Toronto
Just Played: Trials HD
Posts: 6,485
Trader Feedback: 0
Default

Nice tutorial. I'm sure this will help a quite a few people, although for some beginners, this still may be a little tricky

None the less, another great tut to help the scene Well done! :claps:
whitehawk is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-01-2006, 08:06 PM   #22
 

 
Join Date: Aug 2006
Real First Name: josh
Location: darkness
Just Played: rockband 2
Posts: 616
Trader Feedback: 0
Default

i made this from the tut and heres the error iget and the scorce is at the bottom
can anyone tell me what to fix.
Code:
psp-gcc -D PSP -I /usr/local/pspdev/psp/sdk/include -W -Wall -O2 -G0 -fno-pic -mno-abicalls -w -fomi
t-frame-pointer -S main.c -o main.s
psp-as main.s -o main.o
psp-gcc -D PSP -I /usr/local/pspdev/psp/sdk/include -W -Wall -O2 -G0 -fno-pic -mno-abicalls -w -fomi
t-frame-pointer -O2 -S tiffsdk.c -o tiffsdk.s
tiffsdk.c:215: error: conflicting types for 'sceKernelDelayThread'
/usr/local/pspdev/psp/sdk/include/pspthreadman.h:323: error: previous declaration of 'sceKernelDelay
Thread' was here
make: *** [tiffsdk.o] Error 1
this is my main.c
Code:
#include <pspdisplay.h>
#include <pspctrl.h> 

#include "gfx.h"

extern unsigned long failedNID;

SceCtrlData gpaddata;

#define BLACK      12
#define WHITE      1
#define PINK       2
#define RED        3
#define BLUE       4
#define GREEN      5
#define YELLOW     6
#define CYAN       7
#define GRAY       9
#define DARKBLUE   10
#define DARKRED    11
#define DARKGREEN  0
#define RANDOM     rand()%12

#define true 1
#define false !true
#define bool int

unsigned long colours[13];

void InitGlobals()        // use this to declare a variables value
{
     colours[12]= 0x00000000L;
 	colours[1] = 0x00FFFFFFL;
 	colours[2] = 0x00FF00FFL;
 	colours[3] = 0x000000FFL;
 	colours[4] = 0x00FF0000L;
 	colours[5] = 0x0000FF00L;
 	colours[6] = 0x0000FFFFL;
 	colours[7] = 0x00FFFF00L;
 	colours[8] = 0x00FFFF88L;
 	colours[9] = 0x00888888L;
 	colours[0] = 0x00008800L;
     colours[10]= 0x00880000L;
     colours[11]= 0x00000088L;
}

extern _start; unsigned long gsp;
void ProcessKeys(unsigned long xikeys)
{

  if (xikeys & PSP_CTRL_HOME) // if home is pressed
  {
		   vshKernelExitVSHVSH(NULL);                             // exit
  }
}

void main(unsigned long sp)
{  
  gsp = sp;

  InitGlobals();
  initSound();
  initScreenAndCtrl();

  // End Blank Template
  for ( ;; ) {
	  fadeIn ();
      fadeOut  ();
PrintUltraCentered ( 131 , colours [ PINK ] , "deathanircist says doom to the World!" );changeBuffer();
}
__________________
heroes? i have none .....Love only yourself and fight only for your self
Sylar is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-01-2006, 08:08 PM   #23
 
davidthefat's Avatar
 
Join Date: Mar 2006
Posts: 146
Trader Feedback: 0
Default

Quote:
Originally Posted by deathanarchist
i made this from the tut and heres the error iget and the scorce is at the bottom
can anyone tell me what to fix.
Code:
psp-gcc -D PSP -I /usr/local/pspdev/psp/sdk/include -W -Wall -O2 -G0 -fno-pic -mno-abicalls -w -fomi
t-frame-pointer -S main.c -o main.s
psp-as main.s -o main.o
psp-gcc -D PSP -I /usr/local/pspdev/psp/sdk/include -W -Wall -O2 -G0 -fno-pic -mno-abicalls -w -fomi
t-frame-pointer -O2 -S tiffsdk.c -o tiffsdk.s
tiffsdk.c:215: error: conflicting types for 'sceKernelDelayThread'
/usr/local/pspdev/psp/sdk/include/pspthreadman.h:323: error: previous declaration of 'sceKernelDelay
Thread' was here
make: *** [tiffsdk.o] Error 1
this is my main.c
Code:
#include <pspdisplay.h>
#include <pspctrl.h> 

#include "gfx.h"

extern unsigned long failedNID;

SceCtrlData gpaddata;

#define BLACK      12
#define WHITE      1
#define PINK       2
#define RED        3
#define BLUE       4
#define GREEN      5
#define YELLOW     6
#define CYAN       7
#define GRAY       9
#define DARKBLUE   10
#define DARKRED    11
#define DARKGREEN  0
#define RANDOM     rand()%12

#define true 1
#define false !true
#define bool int

unsigned long colours[13];

void InitGlobals()        // use this to declare a variables value
{
     colours[12]= 0x00000000L;
 	colours[1] = 0x00FFFFFFL;
 	colours[2] = 0x00FF00FFL;
 	colours[3] = 0x000000FFL;
 	colours[4] = 0x00FF0000L;
 	colours[5] = 0x0000FF00L;
 	colours[6] = 0x0000FFFFL;
 	colours[7] = 0x00FFFF00L;
 	colours[8] = 0x00FFFF88L;
 	colours[9] = 0x00888888L;
 	colours[0] = 0x00008800L;
     colours[10]= 0x00880000L;
     colours[11]= 0x00000088L;
}

extern _start; unsigned long gsp;
void ProcessKeys(unsigned long xikeys)
{

  if (xikeys & PSP_CTRL_HOME) // if home is pressed
  {
		   vshKernelExitVSHVSH(NULL);                             // exit
  }
}

void main(unsigned long sp)
{  
  gsp = sp;

  InitGlobals();
  initSound();
  initScreenAndCtrl();

  // End Blank Template
  for ( ;; ) {
	  fadeIn ();
      fadeOut  ();
PrintUltraCentered ( 131 , colours [ PINK ] , "deathanircist says doom to the World!" );changeBuffer();
u never really closed it put } at the end
davidthefat is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-01-2006, 08:09 PM   #24
 

 
Join Date: Aug 2006
Real First Name: josh
Location: darkness
Just Played: rockband 2
Posts: 616
Trader Feedback: 0
Default

oh i did but forgot to cut/paste it
__________________
heroes? i have none .....Love only yourself and fight only for your self
Sylar is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-02-2006, 12:04 AM   #25

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

Hey guyz, lesson 2 is up, lesson 1 revised, better nad upto date GFX and blank tiff sdk, etc...

too many new and better things to list, just check my site and first post!

P.S. Mod, can you change hte title of this in the forum to the one actually in here? thx alot.

P.P.S. Id like to post in the Developers Dungeon, buti cant... *crys*
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-02-2006, 12:36 AM   #26

Developer in Making...
 
BlackShark's Avatar
 
Join Date: Oct 2006
Location: Pimp'en in the US F#cking A!!!
Posts: 1,254
Trader Feedback: 0
Default

he nice, i might take a look at these once i get the hang of C...or C++...still deciding
__________________
The Wentire Worls in two Sectors....
When did I get dev statz?
Spoiler for my PSP homebrewReleases:
Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
(PvP Pong DL'ed well over 2403 times combined! get yours now!)
Spoiler for Great Quotes:

"No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.
BlackShark is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-02-2006, 03:00 PM   #27
 
Join Date: Oct 2006
Location: Houston,TX
Posts: 68
Trader Feedback: 0
Default

great its about time someone started tutorials on the tiff sdk, it sure been out long enough. thanks SG57.
FLIK is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-02-2006, 03:06 PM   #28
 
Kazart's Avatar
 
Join Date: Sep 2006
Location: Western Pennsylvania
Posts: 295
Trader Feedback: 0
Default

I've been waitin' for this. What else would you expect from the greatest 2.8 programmer now and forever?

still waiting for the toolchain to install though...
Kazart is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-02-2006, 08:52 PM   #29

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

UPDATED!

Check first post for more dtails but... Better GFX library, Better BLANK Template, Added new lesson, that lesson has SFX and a menu so someone should be able to make a small game now... Even if its just 21
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-03-2006, 07:49 AM   #30
 
Join Date: Oct 2006
Posts: 98
Trader Feedback: 0
Default

I would like a tutorial with how to display images and play real sound(.mp3/wav)
Also, thanks for the tutorials, this will help out much people
Sander122 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
lessons , programming , tiff

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -8. The time now is 05:57 AM.



Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © 2009, QJ.NET. All Rights Reserved.
Contact Us