WORKSHOP CODING INTROS & DEMOS

General Programming help in C, C++ or ASM, Compiling / Debugging, and R3000A Central Processing Unit (CPU) information
User avatar
inc^lightforce
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 145
Joined: March 7th, 2013, 7:34 am
I am a: Programmer, Artist, Gamer
PlayStation Model: Black
Skype: a5recordings
Location: Germany
Contact:

WORKSHOP CODING INTROS & DEMOS

Post by inc^lightforce » April 21st, 2013, 8:42 am

=====================================================================================================
Welcome...
=====================================================================================================
... to my workshop in Demo and Cracktro Coding for PS1 with PSY-Q SDK. From time2time i will post some useful Tutorials for some Functions, Effects, Music, PS1 Video, 3D Objects, Sprite usage and many more.
Most of the code was written in the past days (1998 - 2002) when i was an active Member in PARADOX, LIGHTFORCE, MUPS and UNDERCOVER-AGENTS.
In these Days the Groups released fresh new PS1 Games as a complete "PSX Game ISO" and distributed em through the Internet on Scene Boards/FTP's like ISOHUNT ect. To mentioned where the ISO came from, Groups always made some Cracktros, Trainers and Pal to NTSC or NTSC to PAL Selectors. Sometimes we removed also Copy protection known as: LC1 and LC2 nested in V-Rally 2 or Soulreaver Legacy of Kain.

Why only 1 exe file? it was important and inevitable to pack the original "Game-exe" to get free space for own Code of Cracktros/ Selectors or Trainers.
The new modified "PS1 Game EXE", taken from the original Game-ISO, MUST always have exactly! the same size after including a "Cracktro Code" into the "Original PS1 Game-EXE". Than the modified "PS1 Game EXE", injected back into the "GAME-ISO", all in all must have the same file and sector size to work properly. Otherwise the Game failed to boot up from Disc in the PS1 Console.
Injecting a Cracktro into a Game was only possible, if we included own Code into the "Original PS1 Game Exe"! No other solution will work

When i packed a "PS1 Game EXE" of eg. 400 KB, i had with luck, a result of 150 KB. OLé yeah --> now i had 250 KB free Space for own "Code, the Cracktro" to include in front of the "Original PS1 GAME". Later the file was compiled with "Hook points" and ASM Addresses to load up from the correct EXE MEM-ADDRESS and Disc-Sector. You can see it in the source code called as: ASM .... and *ficken (ficken = german and means "fuck" so we fucked SONY :) ). When pressed on the Gamepad "X" or "O", the game does now boot/load for the desired "TV Video Norm". Show a nice Cracktro, play a funny sound and remove copy protection or offer a "Trainer menu". Creating a PPF File was always done with our magic tools (one of them: "magic sector key"). MSK.exe scan the whole PS1 ISO and print the exact position of the Exe File and other important information.
Here comes a screen shot:

Image

A PPF File is a well known File that include all the Code and changes by a group for a Game. It can easily be distributed through the Internet, when Gamers wanna play US, EUR or JAP Games around the Globe in the desired "TV Norm" ... need to play with a Trainer or removing the Copy protection.

A PPF file mostly have a file size from 30 kb - 2 mb and contain all code to modify a original PS1 Game ISO. With a simple tool, like ppfOmat, you can choose the original ISO and the PPF-File which is to inject.
Here comes another screen shot:

Image

Feel free to check back for updates.

===========================================================================================
If you want start coding, i want suggest this TUTORIAL, from the very Beginning.
The Tutorial explain Hardware and Source Code.

The Tutorial is only in GERMAN and based on the very close and familiar PSY-Q, called PSX GNU
see all Information here:
PSXGNU TUTORIAL for DEMO CODING. sorry, only in German
===========================================================================================
PLEASE KEEP THIS WORKSHOP CLEAN. Do not post your Demos here. You can ask or say "Thank you", or give some other related Feedback or Notes and improvements.
===========================================================================================

HERE: CODING RECTANGLE & LINES with Code...

Grab all Files incl. a Demo for PS1 EMU here

Image

Code: Select all

//***************************************************************
//    THIS WAS OUR LOADER FOR Medal of Honor 2 - Underground PAL
//    ===========================================================
//    Many Lines i removed !!!
//    Original Source:   27/10/2000
//
//***************************************************************
//--------------------------------------------------------------------------
// I N C L U D E S
//--------------------------------------------------------------------------
#include <sys/types.h>
#include <stdlib.h>
#include <libetc.h>
#include <libgte.h>
#include <libgpu.h>
#include <libgs.h>
#include <libsnd.h>
#include <libmath.h>
#include <libspu.h>
#include "hitmod.h" // For Sound
#include "pad.h" // PAD
#include "sinuss.h" // Sinus made with Sinuslab by Hitmen
#include "Sinstuff.h" // Sinus made with Sinuslab by Hitmen

#define	MAXCHAR	42
#define DEVELOPEMENT
#define ORDERING_TABLE_LENGTH (5)
#define MAX_NO_PACKETS  (3000)
#define	rnd(max)	((rand()*(max))/(32768)+1)
//--------------------------------------------------------------------------
// G L O B A L S
//--------------------------------------------------------------------------
GsOT		othWorld[2];
GsOT_TAG	otWorld[2][1<<ORDERING_TABLE_LENGTH];
PACKET		out_packet[2][(MAX_NO_PACKETS * 24)];
int		currentBuffer;	
u_long		PADstatus=0;	// Save PAD STATUS
int             v_countGFX=0, v_countCODE=0; // HSync Counter
u_char          HZMode=MODE_NTSC;

int Xangle,Yangle,depth;
int Xangle2,Yangle2;
int iScrollOffset=0;
extern char shades[]; // sound file

//-------------------------
// Font-Sprites & Textures
//-------------------------
GsBOXF		mybox[6]; // 2D RECTANGLE
GsLINE      line[360];
GsGLINE		line2[4];
int Video_MODE=0;

//--------------------------------------------------------------------------
// P R O T O T Y P E S
//--------------------------------------------------------------------------

void InitialiseGraphics(int,int,int); // Width, Height, MODE
void UpdateWorld();
void RenderWorld(char cClear);
void LoadTIMData (u_long *tMemAddress); // RAM -> VRam
void SetSpriteInfo(GsSPRITE *tSprite, u_long tMemAddress, long tX, long tY, int tCut);
void init_line(void);
void do_line(void);  // INIT LINE
void do_bar(void);   // INIT RECTANGLE
void init_bar(void); // INIT RECTANGLE
void init_Kloetze(void); // 2D RECTANGLE

int sin1=0;
int sin2=0;

int main()
  {
  u_long lTmp1;
  int i,j,k;
  int temp,temp1;
  int iTmp1,iTmp2,iTmp3,iTmp4;
	iTmp1=-60;
	iTmp2=-280;
	iTmp3=320;
	iTmp4=500;
	Xangle=Yangle=1;	//init x angle and y angle

	PadInit(0);     // Joypad Init

// CHECKS AUTO REGION , INPUT VALUES FOR PAL or NTSC PATCH HERE	
 if (*(char *)0xbfc7ff52=='E')	// E(urope) --> PAL; A(merica) and J(apan) both use NTSC
	{
		HZMode=MODE_PAL;
	}
	else
	{
		HZMode=MODE_NTSC;
	}

 
 InitialiseGraphics(320,240,HZMode); // GFX Init, inkl. Init akt. Buffer...

	MOD_Init(); // Sound Check
  	MOD_Load((u_char *) shades); // load Sound
  	MOD_Start(); // play Sound

	init_line(); // INIT LINE
	init_bar();  // 2D RECTANGLE
	init_Kloetze(); // 2D RECTANGLE

for (i=0;i<140;i++)
// ------------------------------------
// --------   M A I N    --------
// ------------------------------------
while(1)
 {
PADstatus=PadRead(4);
	if(PADstatus&Pad1x){Video_MODE=1; break;	} 
	if(PADstatus&Pad1crc){Video_MODE=2; break;	}

	do_line(); // GO FOR LINE
	do_bar(); // GO FOR RECTANGLE

	// Define RECTANGLE MOVEMENT
	iTmp1+=1;
	iTmp2+=1;
	iTmp3-=1;
	iTmp4-=1;
		if(iTmp1>320) iTmp1=-50;
		if(iTmp2>320) iTmp2=iTmp1-200;
		if(iTmp3<-150) iTmp3=320;
		if(iTmp4<-150) iTmp4=iTmp3+190;

mybox[0].x=iTmp1;
mybox[1].x=iTmp2;
mybox[2].x=iTmp2+40;
mybox[3].x=iTmp3;
mybox[4].x=iTmp4;
mybox[5].x=iTmp4;

GsSortBoxFill(&mybox[0],&othWorld[currentBuffer],2);
GsSortBoxFill(&mybox[1],&othWorld[currentBuffer],2);
GsSortBoxFill(&mybox[2],&othWorld[currentBuffer],2);
GsSortBoxFill(&mybox[3],&othWorld[currentBuffer],2);
GsSortBoxFill(&mybox[4],&othWorld[currentBuffer],2);
GsSortBoxFill(&mybox[5],&othWorld[currentBuffer],2);
	
RenderWorld(60);

    }
// ======================================================
// NOT IMPORTANT. THIS IS THE REST, A SNIPPET OF OUR CRACKS
// ======================================================
	SpuInit();
	SpuQuit();
 	MOD_Stop();
	MOD_Free();
	//VSync(3);
	PadStop();
  	ResetGraph(0);
  	StopCallback();
// ======================================================
// ===============================================	
}
void InitialiseGraphics(int SCRWidth,int SCRHeight,int HZMode)
  {
  SetVideoMode(HZMode);

  if ((HZMode == MODE_NTSC) && (SCRHeight==256)) SCRHeight=240;
    
  GsInitGraph(SCRWidth, SCRHeight, GsNONINTER|GsOFSGPU, 0, 0);

  GsDefDispBuff(0, 0, 0, SCRHeight);
// Correct Error in Library
  if (SCRHeight == 256) GsDISPENV.screen.h=256;

  othWorld[0].length = ORDERING_TABLE_LENGTH;
  othWorld[1].length = ORDERING_TABLE_LENGTH;
  othWorld[0].org = otWorld[0];
  othWorld[1].org = otWorld[1];
  GsClearOt(0,0,&othWorld[0]);
  GsClearOt(0,0,&othWorld[1]);

// Get the current Buffer
  currentBuffer=GsGetActiveBuff();

// set Address for Packet
  GsSetWorkBase((PACKET*)out_packet[currentBuffer]);
  }

void RenderWorld(char cClear)
  {
// ------------------------------------ " AN OLD LIST"

  v_countCODE=VSync(1);
  DrawSync(0);
  v_countGFX = VSync(1);
  VSync(0);	// wait until GPU are finished OLD LIST

    // swap both Buffers (Display / Drawing)
  GsSwapDispBuff();

// ------------------------------------ "ACTUAL LIST"

// "Register" a "ClearScreen"- Command in OT
//  R, G, B
  if (cClear==1)  GsSortClear(0, 0, 0,&othWorld[currentBuffer]);  // here can be changed the screen background Color
  if (cClear==60) GsSortClear(78, 0, 92,&othWorld[currentBuffer]); // here can be changed the screen background Color
  if (cClear==255)  GsSortClear(255, 255, 255,&othWorld[currentBuffer]); // here can be changed the screen background Color


// start drawing  ( GPU is now drawing the OT in Background)
  GsDrawOt(&othWorld[currentBuffer]);
  FntFlush(-1);

// ------------------------------------ "NEW LIST"

// init next OT !!!
// get the actual Buffer
  currentBuffer=GsGetActiveBuff();

// set Address for Packets
  GsSetWorkBase((PACKET*)out_packet[currentBuffer]);

// erase Content of OT
  GsClearOt(0, 0, &othWorld[currentBuffer]);

// OT is now ready for new OT Commands
  }

void LoadTIMData(u_long *tMemAddress)
  {
  RECT tRect;
  GsIMAGE tTim;

  DrawSync(0);
  tMemAddress++;
  GsGetTimInfo(tMemAddress, &tTim);   // SAVE TIM-Information to tTim
  tRect.x = tTim.px;
  tRect.y = tTim.py;
  tRect.w = tTim.pw;
  tRect.h = tTim.ph;
  LoadImage(&tRect, tTim.pixel);		// Load TIM-Data in VideoRam
  DrawSync(0);

  if ((tTim.pmode >> 3) & 0x01)
    {
    tRect.x = tTim.cx;
    tRect.y = tTim.cy;
    tRect.w = tTim.cw;
    tRect.h = tTim.ch;
    LoadImage(&tRect, tTim.clut);		// load CLUT in VideoRam
    };

  DrawSync(0);					// wait until GPU is ready
  }

void SetSpriteInfo(GsSPRITE *tSprite, u_long tMemAddress, long tX, long tY, int tCut)
  {
  GsIMAGE tTim;					// TIM image Information

  tMemAddress += 4;				// Pointer to Data
  GsGetTimInfo((u_long *) tMemAddress, &tTim);	// get TIM Information in tTim

  tSprite->x = tX;				// set Cordinates
  tSprite->y = tY;				// set Cordinates

  switch (tTim.pmode & 3)			// X-Value depends on BitDepht
    {
    case 0: tSprite->w = tTim.pw << 2;
            tSprite->u = (tTim.px & 0x3f) * 4;
            break;
    case 1: tSprite->w = tTim.pw << 1;
            tSprite->u = (tTim.px & 0x3f) * 2;
            break;
    default: tSprite->w = tTim.pw;
             tSprite->u = tTim.px & 0x3f; 
    };

  tSprite->h = tTim.ph;
  tSprite->v = tTim.py & 0xff;

  tSprite->tpage = GetTPage((tTim.pmode & 3),0,tTim.px,tTim.py);

  tSprite->attribute = (tTim.pmode & 3) << 24;

  tSprite->cx = tTim.cx;			// set CLUT of Sprite
  tSprite->cy = tTim.cy;

  tSprite->r = tSprite->g = tSprite->b = 128;	// Colour intensity
// set to Standart
  tSprite->mx = tSprite->w/2;			// Ref-POINT to the CENTER of a Sprite
  tSprite->my = tSprite->h/2;			

  tSprite->scalex = tSprite->scaley = ONE;	// Scale to 1 (real Size)
  tSprite->rotate = 0;				// rotation angle to 0 ZERO

  if (tCut)					// Cut Sprite if a Sprite have an illegal size
    tSprite->w -= tCut;				
  };
//===============================================
// REGISTER ALL LINES (position + rgb)
//===============================================
void init_line()
{
	line2[0].x0=0;
	line2[0].y0=65;
	line2[0].x1=160;
	line2[0].y1=65;
   
	line2[2].x0=160;
	line2[2].y0=65;
	line2[2].x1=320;
	line2[2].y1=65;
	
	line2[1].x0=0;
	line2[1].y0=179;
	line2[1].x1=160;
	line2[1].y1=179;

	line2[3].x0=160;
	line2[3].y0=179;
	line2[3].x1=320;
	line2[3].y1=179;
	
}

//======================================================
// DRAW THE LINES
//======================================================
void do_line()
{	
	GsSortGLine(&line2[0],&othWorld[currentBuffer],3);
    line2[0].r0=78;
	line2[0].g0=0;
	line2[0].b0=92;
	line2[0].r1=255;
	line2[0].g1=255;
	line2[0].b1=255;
	
	GsSortGLine(&line2[2],&othWorld[currentBuffer],3);
	
	line2[2].r0=255;
	line2[2].g0=255;
	line2[2].b0=255;
	line2[2].r1=78;
	line2[2].g1=0;
	line2[2].b1=92;
	
	GsSortGLine(&line2[1],&othWorld[currentBuffer],3);

	line2[1].r0=78;
	line2[1].g0=0;
	line2[1].b0=92;
	line2[1].r1=255;
	line2[1].g1=255;
	line2[1].b1=255;
	
	GsSortGLine(&line2[3],&othWorld[currentBuffer],3);

	line2[3].r0=255;
	line2[3].g0=255;
	line2[3].b0=255;
	line2[3].r1=78;
	line2[3].g1=0;
	line2[3].b1=92;
}

void do_bar()
{
int i,j;
if(sin1>=359)	sin1=0;	
sin2=sin1=sin1+1;

for(i=0;i<359;i++)
	{
	j=i+1;
	line[i].attribute=(1<<28)+(1<<27)+(2<<24)+(0<<28)+(1<<30);
	line[i].r=32;
	line[i].g=0;
	line[i].b=41;
	line[i].x0=150;
	line[i].x1=165+(scalesin[j]+scalesin2[sin2]/2);
	line[i].y0=120;
	line[i].y1=120+(scalesin2[j]/2);

	GsSortLine(&line[i],&othWorld[currentBuffer],3);
	sin2+=2;
	if(sin2>=360)	sin2-=360;
	}
}

void init_bar()
{
int k;
for(k=0;k<360;k++)
	{
	line[k]=line[0];
	line[k].y0=60;
	line[k].y1=100;
	line[k].r=line[k].b=line[k].g=128;
	}

}

void init_Kloetze() // 2D RECTANGLE
{int iTmp1,iTmp2,iTmp3,iTmp4;
	iTmp1=-60;
	iTmp2=-280;
	iTmp3=320;
	iTmp4=500;
		mybox[0].w=31;
		mybox[0].h=24;
		mybox[0].y=10;
		mybox[0].r=104;mybox[0].g=0;mybox[0].b=122;
		mybox[1].w=76;
		mybox[1].h=20;
		mybox[1].y=45;
		mybox[1].r=104;mybox[1].g=0;mybox[1].b=122;
		mybox[2].w=20;
		mybox[2].h=55;
		mybox[2].y=5;
		mybox[2].r=104;mybox[2].g=0;mybox[2].b=122;
		mybox[3].w=56;
		mybox[3].h=51;
		mybox[3].y=180;
		mybox[3].r=104;mybox[3].g=0;mybox[3].b=122;
		mybox[4].w=20;
		mybox[4].h=58;
		mybox[4].y=180;
		mybox[4].r=104;mybox[4].g=0;mybox[4].b=122;
		mybox[5].w=135;
		mybox[5].h=20;
		mybox[5].y=206;
		mybox[5].r=104;mybox[5].g=0;mybox[5].b=122;
}
have Fun while Coding. Questions? ASK .

inc.
Last edited by inc^lightforce on January 28th, 2016, 1:27 pm, edited 26 times in total.
my coding page/ forum at:
http://aftermath-creations.net/

User avatar
inc^lightforce
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 145
Joined: March 7th, 2013, 7:34 am
I am a: Programmer, Artist, Gamer
PlayStation Model: Black
Skype: a5recordings
Location: Germany
Contact:

Re: WORKSHOP CODING INTROS & DEMOS

Post by inc^lightforce » April 21st, 2013, 8:44 am

HERE: CODING STARS, TYPER, WOBBLE & LINES

Grab the FILES incl. a PS1 DEMO HERE: STARS DEMO GSLINE

Image

Code: Select all

//--------------------------------------------------------------------------
// I N C L U D E S
//--------------------------------------------------------------------------
#include <sys/types.h>
#include <stdlib.h>
#include <libetc.h>
#include <libgte.h>
#include <libgpu.h>
#include <libgs.h>
#include <libsnd.h>
#include <libmath.h>
#include <libspu.h>
#include "hitmod.h"
#include "pad.h"
#include "colorsin.h" // gives the Font a nice GREEN Effect

//-------------------- ASM ADRESS DEFINITION --------------------------
//---------------------------------------------------------------------

//---------------------------------------------------------------------
#define ORDERING_TABLE_LENGTH (12)
#define MAX_NO_PACKETS  (4000)
//---------------------------------------------------------------------
//-------------DEFINITION STARS IN BACKGROUND      --------------------
//---------------------------------------------------------------------
#define STARSC         50 // COUNT OF STARS
#define SPEED            1 // Max Scroll SPEED
#define PLANE            4 // MAXIMUM LAYERS for STARS
//--------------------------------------------------------------------------
// G L O B A L S
//--------------------------------------------------------------------------
GsOT		othWorld[2];
GsOT_TAG	otWorld[2][1<<ORDERING_TABLE_LENGTH];
PACKET		out_packet[2][(MAX_NO_PACKETS * 24)];
int		currentBuffer;	// Actual Buffer for Double Buffering
u_long		PADstatus=0;	// SAVE PADSTATUS
int             v_countGFX=0, v_countCODE=0; // HSync COUNTER
u_char          HZMode=MODE_NTSC; // Not needed in here. it's for our Patches
//---------------------------------------------------------------------
//---------- READ INFO FROM EXTERNAL OBJECTS          -----------------
//---------------------------------------------------------------------
extern char intro[];
extern char logl[];
extern char logr[];
extern char lef[];
extern char rig[];

typedef struct
  {
  int x;              // X-Coordinate STARS
  int y;              // Y-Coordinate STARS
  int z;              // PLANE-ID
  } STAR;

STAR Stars[STARSC];
//---------------------------------------------------------------------
//---------- Font-Sprites & Textures for TYPER            -------------
//---------------------------------------------------------------------
extern char font1[];
#define	PAGEW	(30)
#define	PAGEH	(8)

#define	ZEICHEN	(32)// <--- How much Letters in a line of used Font
#define	ZEILEN	(3)// <--- Wieviele Rows in used font
#define	MAX_CHAR (PAGEH*PAGEW)

GsSPRITE fontspr[ZEICHEN * ZEILEN];
GsSPRITE page[MAX_CHAR];
//-----------------------------------------------------------------------------
//--------------------SPRITES & DEFENITION          ---------------------------
//-----------------------------------------------------------------------------
GsSPRITE	sprLetter;
GsSPRITE	sprLogl;
GsSPRITE	sprLogr;
GsSPRITE	sprLef;
GsSPRITE	sprRig;

GsLINE		line; // horizontally line
GsGLINE		line2;// again
GsGLINE		line3;// again :)
GsGLINE		line4;
GsGLINE		line5;
GsGLINE		line6;
GsGLINE		line7;

GsGLINE		Wobble[320]; //Wobble Lines 

int iScrollOffset=0;

//--------------------------------------------------------------------------
// P R O T O T Y P E S
//--------------------------------------------------------------------------
void InitialiseGraphics(int,int,int); // Width, Height, MODE
void UpdateWorld();
void RenderWorld(char cClear);

void LoadTIMData (u_long *tMemAddress); // RAM -> VRam
void SetSpriteInfo(GsSPRITE *tSprite, u_long tMemAddress, long tX, long tY, int tCut);

void init_LogoSprites(void);

void	init_Typer(void);
void	do_Typer(void);
void	init_Page(int);
void InitStars(void);
void MoveStars(void);
void init_Wobble(void);
void do_Wobble(void);

int logosinoff=0;
int savedlogosin=0;
int logosinoff2=0; //Wobble Sin
int savedlogosin2=0; //Wobble Sin
//-------------- ABC-Table & Scroller for Typer ------------------
#define	FONT_W	(8)
#define	FONT_H	(10)
int anzfontabc=0;
static int isinit=0;
char fontabc[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789,.-+*#!\"%&/()=?;:ÖÄÜöäüß ";
//-----------------------
// Count of Pages
//-----------------------
#define PAGES	7  // <------------ How many Signs

//-------------------------------
// The Page starts here
//-------------------------------
char texte[PAGEH*PAGES][PAGEW]=

{
//    1   5    10   15   20   25   30  SIGNS      max. SIGNS
//    |   |    |    |    |    |    |     
    {"                              "},// 1
    {"                              "},// 2
    {"                              "},// 3
    {"                              "},// 4
    {"                              "},// 5
    {"         P A R A D O X        "},// 6
    {"                              "},// 7
    {"                              "},// 8

    {"                              "},// 1
    {"                              "},// 2
    {"                              "},// 3
    {"                              "},// 4
    {"                              "},// 5
    {"             A N D            "},// 6
    {"                              "},// 7
    {"                              "},// 8

    {"                              "},// 1
    {"                              "},// 2
    {"                              "},// 3
    {"                              "},// 4
    {"                              "},// 5
    {"      UNDERCOVER - AGENTS     "},// 6
    {"                              "},// 7
    {"                              "},// 8

    {"                              "},// 1
    {"                              "},// 2
    {"                              "},// 3
    {"                              "},// 4
    {"                              "},// 5
    {"         PRESENT YOU          "},// 6
    {"                              "},// 7
    {"                              "},// 8

    {"                              "},// 1
    {"                              "},// 2
    {"                              "},// 3
    {"                              "},// 4
    {"                              "},// 5
    {"      ALIEN RESURRECTION      "},// 6
    {"US by Fox Interactive (c) 2000"},// 7
    {"                              "},// 8

    {"         P A R A D O X        "},// 1
    {"                              "},// 2
    {"                              "},// 3
    {"  Say hello to new talented   "},// 4
    {"   Members for codings each   "},// 5
    {"       and every Time:        "},// 6
    {"      Gandhi and  Inc.        "},// 7
    {"    the Dudeds by U.C.A.      "},// 8


    {"         P A R A D O X        "},// 1
    {"                              "},// 2
    {"                              "},// 3
    {"                              "},// 4
    {"Coding................... INC."},// 5
    {"Sound.................... INC."},// 6
    {"Graphix.................. INC."},// 7
    {"                              "},// 8


};
//--------------------------------------------------------------------------
// Function:	main() MAIN PROG
// Description:	--
// Parameters:	--
// Returns:	int
// Notes:	N/A
//--------------------------------------------------------------------------
int main()
  {

  u_long lTmp1;
//-------------------- INIT SLIDING LOGO -----------------------------------
    int iLogoPos=0,iLogoSpd=1,iTmp1;
    int iPdxPos=640,iPdxSpd=2;	
    int iPdxPos1=800,iPdxSpd1=2;

  int i,j;
  int temp,temp1;
  int Move=0;
//-------------------------------------------------------------------------  
PadInit(0);     // Joypad Init
 
init_Typer();


  InitialiseGraphics(320,240,MODE_NTSC); // GFX Init, inkl. Init current Buffer...

//  FntLoad(960,256);     // not needed here . it's code for our Patches
//  FntOpen(0, 85, 320, 220, 0, 512); // not needed here . it's code for our Patches
//  FntPrint("       X --> PAL       O --> NTSC\n"); // not needed here . it's code for our Patches
RenderWorld(1);RenderWorld(1); // 2x da DoubleBuffering...

// Chose FREQUENZY // not needed here . it's code for our Patches
//  while (1)      // not needed here . it's code for our Patches
//    {            // not needed here . it's code for our Patches

//    PADstatus=PadRead(4); // not needed here . it's code for our Patches

//    if (PADstatus & Pad1crc) // not needed here . it's code for our Patches
//      break; // HZMode Initvalue == MODE_NTSC // not needed here . it's code for our Patches

//    if (PADstatus & Pad1x) // not needed here . it's code for our Patches
//      {HZMode=MODE_PAL;break; // not needed here . it's code for our Patches
//	} // not needed here . it's code for our Patches
//} // not needed here . it's code for our Patches

 InitialiseGraphics(320,240,HZMode); // GFX Init, incl. Init current Buffer...

//--------------------------------------------------------------------------
//-------------------------LOAD MUSIC AND PLAY      ------------------------
//--------------------------------------------------------------------------
MOD_Init();
MOD_Load((u_char *) intro); // intro is the name of the sound file
MOD_Start();
//--------------------------------------------------------------------------  
//------------------ READ EXTERNAL INFO FROM GFX     -----------------------
//--------------------------------------------------------------------------  
LoadTIMData((u_long*)logl);
LoadTIMData((u_long*)logr);
LoadTIMData((u_long*)font1);
LoadTIMData((u_long*)lef);
LoadTIMData((u_long*)rig);

  for (iTmp1=0;iTmp1<1456;iTmp1+=1)
   {
do_Typer();
    if (iTmp1==28) VSync(80); // WAIT any SECONDS
    RenderWorld(1); // DRAW
    }
// --------------------------- INIT LOGO -----------------------------------
SetSpriteInfo(&sprLogl,(u_long)logl,80,30,1);
SetSpriteInfo(&sprLogr,(u_long)logr,240,30,1);
SetSpriteInfo(&sprRig,(u_long)rig,235,121,3);//x,y
SetSpriteInfo(&sprLef,(u_long)lef,80,119,3);//x,y
//--------------------------------------------------------------------------  
//--------------------- INIT LETTERS      ----------------------------------  
//--------------------------------------------------------------------------  
   sprLetter.w=sprLetter.h=16;// height of 1 Letter
   sprLetter.mx=sprLetter.my=0;
   sprLetter.v=sprLetter.u=0;
{
 GsSortSprite(&sprLetter,&othWorld[currentBuffer],2);
 RenderWorld(1);
}
//--------------------------------------------------------------------------  
init_Wobble(); // Init Wobble as GsGLINE´s
InitStars();

// ------------------------------------
// --------   MAIN PROGRAMM    --------
// ------------------------------------
   
while(1)
 {
int iTmp1,iTmp2,iTmp3,iTmp4,iTmp5;

   PADstatus=PadRead(4);
   if ((PADstatus&Pad1Start)) break;

do_Typer();
do_Wobble();
//-----------------LOGO S L I D I N G S----------------
    if (iLogoPos<-40) iLogoSpd=1;
    if (iLogoPos>40) iLogoSpd=-1;
    iLogoPos+=iLogoSpd;

  if (iPdxPos<-100) iPdxSpd=2;
  if (iPdxPos>260) iPdxSpd=-2;
  iPdxPos+=iPdxSpd;
  if (iPdxPos1<60) iPdxSpd1=2;
  if (iPdxPos1>420) iPdxSpd1=-2;
  iPdxPos1+=iPdxSpd1;
//--------------------------------------------------
//--------- GIVE SLIDINGS FREE              --------
//--------------------------------------------------
sprLogl.x=iPdxPos;
sprLogr.x=iPdxPos1;
//---------- LAYER DEFENITION OF SPRITES  -----------
GsSortSprite(&sprLogl,&othWorld[currentBuffer],1);
GsSortSprite(&sprLogr,&othWorld[currentBuffer],1);
GsSortSprite(&sprLef,&othWorld[currentBuffer],3);
GsSortSprite(&sprRig,&othWorld[currentBuffer],3);
//----------------------------------------------------
MoveStars();
//----------------DRAW 3 LINES       ------------------
        line2.r0=150;line2.g0=100;line2.b0=40;
        line2.x1=10;line2.x0=160;
        line2.y0=line2.y1=80;

        line7.r0=150;line7.g0=100;line7.b0=40;
        line7.x0=160;line7.x1=309;
        line7.y0=line7.y1=80;

        line5.r0=150;line5.g0=100;line5.b0=40;
        line5.x1=10;line5.x0=160;
        line5.y0=line5.y1=157;
        
        line6.r0=150;line6.g0=100;line6.b0=40;
        line6.x0=160;line6.x1=309;
        line6.y0=line6.y1=157;

	line3.r0=1;line3.g0=120;line3.b0=0;
	line3.x0=line3.x1=320;
      	line3.y0=0;line3.y1=240;
	
	line4.r0=1;line4.g0=120;line4.b0=0;
	line4.x0=0;line4.x1=320;
      	line4.y0=line4.y1=120;
	
	GsSortGLine(&line2,&othWorld[currentBuffer],1);
	GsSortGLine(&line5,&othWorld[currentBuffer],1);
	GsSortGLine(&line6,&othWorld[currentBuffer],1);
	GsSortGLine(&line7,&othWorld[currentBuffer],1);

//-------------------------------------------------------------
RenderWorld(1);
  }
//  MOD_Stop();MOD_Free();VSync(3); 
//  PadStop();
//  ResetGraph(0);
//  StopCallback();
//-------------------------------------------------------------
//------------------PATCH FUNKTION- Spiel entpacken------------
//-------------------------------------------------------------
//EnterCriticalSection();
//depack1();
//start1();
//ExitCriticalSection();
//-------------------------------------------------------------
//************************* starts game ***********************
//-------------------------------------------------------------
//asm("nop");
//asm("j 0x8008656c"); // ExecAddress --> Load Game after PAD BREAK
//asm("nop");

//  return 0;
  }

void InitStars(void)
  {
  int l,zi;
  srand(1);
  for(l=0;l<STARSC;l++)                
    {
    zi=rand()%320;
    Stars[l].x=zi;
    zi=rand()%160;
    Stars[l].y=zi;
    zi=rand()%PLANE;
    Stars[l].z=zi+1;
    }
  }

void MoveStars(void)
  {
  int i;

  for(i=0; i<STARSC; i++)
    {        
    Stars[i].x+=SPEED*Stars[i].z;
    if(Stars[i].x>320)
      Stars[i].x=0;
    line.x0 = line.x1 = Stars[i].x;
    line.y0 = line.y1 = Stars[i].y;
    line.r = 1;
    line.g = line.b =Stars[i].z*50;
    GsSortLine(&line,&othWorld[currentBuffer],2);
    }
  }
//------------------------------------------------------------------------------
// F U N C T I O N    D E F I N I T I O N E N
//------------------------------------------------------------------------------
void InitialiseGraphics(int SCRWidth,int SCRHeight,int HZMode)
  {
  SetVideoMode(HZMode);

  if ((HZMode == MODE_NTSC) && (SCRHeight==256)) SCRHeight=240;
  GsInitGraph(SCRWidth, SCRHeight, GsNONINTER|GsOFSGPU, 0, 0);
  GsDefDispBuff(0, 0, 0, SCRHeight);
  if (SCRHeight == 256) GsDISPENV.screen.h=256;
  othWorld[0].length = ORDERING_TABLE_LENGTH;
  othWorld[1].length = ORDERING_TABLE_LENGTH;
  othWorld[0].org = otWorld[0];
  othWorld[1].org = otWorld[1];
  GsClearOt(0,0,&othWorld[0]);
  GsClearOt(0,0,&othWorld[1]);
  currentBuffer=GsGetActiveBuff();
  GsSetWorkBase((PACKET*)out_packet[currentBuffer]);
  }
//------------------------------------------------------------------------------
void RenderWorld(char cClear)
  {
  v_countCODE=VSync(1);
  DrawSync(0);
  v_countGFX = VSync(1);
  VSync(0);	
  GsSwapDispBuff();
// "check "ClearScreen"-Kommando in OT  R, G, B
if (cClear==1)  GsSortClear( 0, 0, 0,&othWorld[currentBuffer]); //background Color
if (cClear==155)  GsSortClear( 0,  0,  0,&othWorld[currentBuffer]);
    // start Draw (GPU is drawing OT in Background)
  GsDrawOt(&othWorld[currentBuffer]);
  FntFlush(-1);
// ------------------------------------ "NEW LIST
  currentBuffer=GsGetActiveBuff();
  GsSetWorkBase((PACKET*)out_packet[currentBuffer]);
  GsClearOt(0, 0, &othWorld[currentBuffer]);
  }
//------------------------------------------------------------------------------
void LoadTIMData(u_long *tMemAddress)
  {
  RECT tRect;
  GsIMAGE tTim;

  DrawSync(0);
  tMemAddress++;
  GsGetTimInfo(tMemAddress, &tTim);   // SAVE TIM-Info in TIM
  tRect.x = tTim.px;
  tRect.y = tTim.py;
  tRect.w = tTim.pw;
  tRect.h = tTim.ph;
  LoadImage(&tRect, tTim.pixel);		// Load TIM-DATA into VideoRam
  DrawSync(0);

  if ((tTim.pmode >> 3) & 0x01)
    {
    tRect.x = tTim.cx;
    tRect.y = tTim.cy;
    tRect.w = tTim.cw;
    tRect.h = tTim.ch;
    LoadImage(&tRect, tTim.clut);		// load CLUT into VideoRam
    };

  DrawSync(0);					// wait until GPU is ready
  }
//------------------------------------------------------------------------------
// Function:	SetSpriteInfo(...)
//------------------------------------------------------------------------------

void SetSpriteInfo(GsSPRITE *tSprite, u_long tMemAddress, long tX, long tY, int tCut)
  {
  GsIMAGE tTim;					// TIM image Information

  tMemAddress += 4;				// Pointer to DATA
  GsGetTimInfo((u_long *) tMemAddress, &tTim);	// get TIM Info in tTim

  tSprite->x = tX;				// CORDINATES
  tSprite->y = tY;				// CORDINATES

  switch (tTim.pmode & 3)			// X-Value depends of Depth Bit!
    {
    case 0: tSprite->w = tTim.pw << 2;
            tSprite->u = (tTim.px & 0x3f) * 4;
            break;
    case 1: tSprite->w = tTim.pw << 1;
            tSprite->u = (tTim.px & 0x3f) * 2;
            break;
    default: tSprite->w = tTim.pw;
             tSprite->u = tTim.px & 0x3f; 
    };

  tSprite->h = tTim.ph;
  tSprite->v = tTim.py & 0xff;

  tSprite->tpage = GetTPage((tTim.pmode & 3),0,tTim.px,tTim.py);
  tSprite->attribute = (tTim.pmode & 3) << 24;
  tSprite->cx = tTim.cx;			// give CLUT by Sprite
  tSprite->cy = tTim.cy;
  tSprite->r = tSprite->g = tSprite->b = 128;	// normally Intensity (of Colours)
  tSprite->mx = tSprite->w/2;			// Ref Point to Sprite Center
  tSprite->my = tSprite->h/2;			
  tSprite->scalex = tSprite->scaley = ONE;	// Skale to 1 (normal Size)
  tSprite->rotate = 0;				// Rotation to 0
  if (tCut)					// Cut Sprite if Tim
    tSprite->w -= tCut;				// have an ivailid Size
  };
//-----------------------------------------------------------------
// INIT WOBBLE GsGLINE´s
//-----------------------------------------------------------------
void init_Wobble()
{
int i=0;
for(i=0;i<320;i++)
  {
	Wobble[i]=Wobble[0];
	Wobble[i].x0=Wobble[i].x1=i;
	Wobble[i].y0=60;
	Wobble[i].y1=100;
	Wobble[i].r0=Wobble[i].b0=Wobble[i].g0=0;
	Wobble[i].r1=Wobble[i].b1=Wobble[i].g1=0;
  }
}

void do_Wobble()
{
int j;
int i;
logosinoff2=savedlogosin2;


for(i=0;i<320;i++)
{
j=i+1;
Wobble[i].attribute=(2<<24)+(0<<29)+(1<<30);
Wobble[i].r0=Wobble[i].b0=0;
Wobble[i].g0=30;//colorsin;
Wobble[i].r1=Wobble[i].b1=Wobble[i].g1=0;
Wobble[i].y0=155+logosin[logosinoff2]/2+logosin4[i]/2;
Wobble[i].y1=190+logosin[logosinoff2]/2+logosin3[i]/2;
GsSortGLine(&Wobble[i],&othWorld[currentBuffer], 3);

logosinoff2++;
if(logosinoff2==520)logosinoff2=0;
}
savedlogosin2++;
if(savedlogosin2==520) savedlogosin2=0;
}

//===========================
// Typer Font INIT
//===========================
void init_Typer()
{
	GsIMAGE	fontimg;
	
	int	i=0,j=0,k=0;
	unsigned char	fontxy[ZEICHEN*ZEILEN*2];
	anzfontabc=strlen(fontabc);
//--------------------------------------------
// X+Y Offset Calculating in between of Textur
//--------------------------------------------
for(i=0;i<ZEILEN;i++)
{
	for(j=0;j<ZEICHEN;j++)
	{
	fontxy[k++]=(j*FONT_W);	// X Offset
	fontxy[k++]=(i*FONT_H);	// Y Offset
	}
}
//---------------------------------------
// Textur & all Sprites init
//----------------------------------------
SetSpriteInfo(&fontspr[0],(u_long)font1,0,0,1);
j=0;
fontspr[0].w=FONT_W;
fontspr[0].h=FONT_H;
fontspr[0].u=fontxy[j++];
fontspr[0].v=fontxy[j++];
for(i=1;i<anzfontabc;i++)
{
	fontspr[i]=fontspr[0];
	fontspr[i].u=fontxy[j++];
	fontspr[i].v=fontxy[j++];
 }
}
//================
// DO Typer
//================
void do_Typer()
{
  static int	act_x=0,act_y=0,act_p=0;
  static int	charcnt=0,delaycnt=10*10,
  clrcount=55;
  int	i=0,subit=-2;
logosinoff=savedlogosin;

//charcnt=MAX_CHAR;
//-----------------------------
// ERASE PAGE ?
//-----------------------------
if(clrcount==55)
{
//---------------------------------------------------------------------
// if actual Page not set. do it now
//---------------------------------------------------------------------
if(isinit==0)
	{
		init_Page(act_p);
		isinit++;
	}
//-----------------------------------
// Do Pager, letter by letter
//-----------------------------------
for(i=0;i<charcnt;i++)
	{
	page[i].r=0; page[i].g=0-(colorsin[logosinoff]); page[i].b=0;
	GsSortFastSprite(&page[i],&othWorld[currentBuffer],3);
        logosinoff--;
if (logosinoff==10) logosinoff=520;

        }
        savedlogosin++;
	if (savedlogosin==1040) savedlogosin=5;	
//-------------------------------------------------------
// if one Sign is missed. do one more
//-------------------------------------------------------
if(charcnt<MAX_CHAR)
{
	charcnt++;
}
//----------------------------------------------------
// ok, now all shown... now wait and erase
//----------------------------------------------------
else
	{
		if(--delaycnt==0)
		{
		delaycnt=10*10;
		clrcount--;
		}
	}
}
//----------------------
// ok, get new page
//----------------------
else
	{
	if(++act_p==PAGES)	act_p=0;
	charcnt=0;
	isinit=0;
	clrcount=55;
	}
}
//=================================
// fill here Sprite-Array for Typer
//=================================
void init_Page(int pagenum)
{
int	h,i,j,k=0;

//--------------------------------------------------
// calculate Sprites
//--------------------------------------------------
for(h=0;h<PAGEH;h++)
{
	for(i=0;i<PAGEW;i++)
	{
		for(j=0;j<anzfontabc;j++)
		{
//-------------------------------------------------
// if "SPACE" ? don't show a letter or Sign
//-------------------------------------------------
	if(texte[h+(PAGEH*pagenum)][i]==' ')
	{
		page[k++].w=0;
		break;
	}
//------------------------------------------------
// give Letter the correct Sprite
//------------------------------------------------
      if(texte[h+(PAGEH*pagenum)][i]==fontabc[j])
{
     page[k  ]=fontspr[j];
     page[k  ].x=42+(i*FONT_W);	// on which X Cord it should Print?
     page[k++].y=65+(h*FONT_H);	// on which Y Cord it should Print?
     break;
    }
   }
  }
 }
}
Compile and test it with ePSXe EMU

QUESTIONS? ASK
have Phun
Last edited by inc^lightforce on May 5th, 2013, 2:50 am, edited 1 time in total.
my coding page/ forum at:
http://aftermath-creations.net/

User avatar
inc^lightforce
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 145
Joined: March 7th, 2013, 7:34 am
I am a: Programmer, Artist, Gamer
PlayStation Model: Black
Skype: a5recordings
Location: Germany
Contact:

Re: WORKSHOP CODING INTROS & DEMOS

Post by inc^lightforce » April 21st, 2013, 9:00 am

A PREVIEW: 216 3D CUBES - PC DEMO
OS: WINDOWS

This Test, i programmed for a Windows Based Operating System. Not yet for PS1. i'll export the Code for PSYQ in the next Days and publish the Source (main.c) here.

have Fun. Please ignore False Antivir Report.
The EXE is UPX Packed

Image

Download here:
PS1 Qubes PC DEMO // inc. 2013
my coding page/ forum at:
http://aftermath-creations.net/

User avatar
CosmoGuy
Serious PSXDEV User
Serious PSXDEV User
Posts: 90
Joined: May 30th, 2012, 1:22 am
I am a: Student, Programmmer, graphic 3d+2d
PlayStation Model: SCPH-7502
Skype: kamilm1222
Steam: amiga3000

Re: WORKSHOP CODING INTROS & DEMOS

Post by CosmoGuy » May 4th, 2013, 11:46 pm

inc^lightforce: you're awesome
Image

User avatar
inc^lightforce
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 145
Joined: March 7th, 2013, 7:34 am
I am a: Programmer, Artist, Gamer
PlayStation Model: Black
Skype: a5recordings
Location: Germany
Contact:

Re: WORKSHOP CODING INTROS & DEMOS

Post by inc^lightforce » May 5th, 2013, 2:47 am

@ CosmoGuy: THANK YOU :D

HERE: CODING a SIMPLE PLAIN SCROLLER & a LINE FADE IN

FONT: provided by Shadow

Grab the FILES incl. a PS1 DEMO BELOW: PLAIN TEXT SCROLLER

Image

Code: Select all

/*-----------------------------------------------------------
    Easy Plain Scroller & Line Fading Example by INC. 2013

	tested and compiled by inc. in 2013/04/23
	used Emu: ePSXe v 1.8.0
	
	For more Effects and Help: icq 42453807
	Mail: mailgate_a5r@gmx.de
-----------------------------------------------------------*/

//  Includes
#include <sys/types.h>
#include <stdlib.h>
#include <libetc.h>
#include <libgte.h>
#include <libgpu.h>
#include <libgs.h>
#include <libsnd.h>
#include <libmath.h>
#include <libspu.h>
#include "pad.h"		//For Game-Pad Usage
//#include "hitmod.h"	// Commands for Sound usage. When using add HITMOD.OBJ into your Batch
#define DEVELOPEMENT
#define ORDERING_TABLE_LENGTH 	(12)
#define MAX_NO_PACKETS  	(3000)
#define	rnd(max)		((rand()*(max))/(32768)+1)
#define OBJECTMAX 100			/* Max Objects defines maximum number of logical objects a 3D model can be divided into*/
#define SCRSPEED          1 	// Scrollspeed FONT
#define YPOS              120 	// Y-Position FONT Scroller
/*-----------------------------------------------------------*/
extern char font[];	// read external Information of GFX or Sound or what ever
/*-------------------------------------------------------------
	Definition for the Plane Scroll TXT
	
	Remember. some Chars can not read directly from a FONT.BMP,
	they have not! a correct Definition.
	See Description for some SIGNS here:
    THE CHAR/ SIGN "=" refers to a correct "." <---- DOT
	THE CHAR/ SIGN "<" refers to a correct "-" <---- hyphen-minus
    THE CHAR/ SIGN ">" refers to a correct "whitespace"

-------------------------------------------------------------*/

char scrtxt[] = ">>>>>>>>>>>>>>>>>>>>>>>>>HELLO>WORLD===>ABCDEFGHIJKLMNOPQRSTUVWXYZ:/=<>DONT>KNOW>WHAT>TO>SAY>HERE"
				"======BLAH>BLAH>BLAH======THANKS>GOES>OUT>TO>SONY><>HITMEN><>PARADOX><>INC=><>LIGHTFORCE>========="
                "SHOUTS>GOES>OUT>TO>EVERYONE>ON>PSXDEV=NET=====BLAH>BLAH>BLAH>AGAIN==============AND>NOW>WE>RELOAD!";

/*-------------------------------------------------------------
   			     FONT & Sprite Textures
-------------------------------------------------------------*/

GsSPRITE	sprLetter; 	// defined a single Letter
GsBOXF		myBox[4]; 	// defined the FADE IN @ the Beginning of the Demo

char *pBaseText = scrtxt;	// Value for the Letter
int Video_MODE=0;			// Init Video Mode
int iScrollOffset=0;		// Init Scroll
int delay=0;				// Innit DELAY-Speed for FADE IN
/*-------------------------------------------------------------
   			     END FONT & Sprite Textures
-------------------------------------------------------------*/
GsOT		othWorld[2];
GsOT_TAG	otWorld[2][1<<ORDERING_TABLE_LENGTH];
PACKET		out_packet[2][(MAX_NO_PACKETS * 24)];
int currentBuffer; // current Buffer for "double buffering"
u_long PADstatus=0;	// Value for saving PAD-Status
int v_countGFX=0, v_countCODE=0; // HSync Counter
u_char HZMode=MODE_NTSC;
/*---------------------====================--------------------

 						END G L O B A L S

-----------------------====================--------------------
						P R O T O T Y P E S
-----------------------====================--------------------*/
void InitialiseGraphics(int,int,int); // Width, Height, MODE
void UpdateWorld();
void RenderWorld(char cClear);
void LoadTIMData (u_long *tMemAddress); // RAM -> VRam
void SetSpriteInfo(GsSPRITE *tSprite, u_long tMemAddress, long tX, long tY, int tCut);
void DrawScroller(void); // you know what it means
void do_Fadein(void); // Fade IN @ DEMO START
/*---------------------====================--------------------

						 END PROTOTYPES

-----------------------====================--------------------
		
		Function:		M A I N()
		Description:	Based on Torx's script. NEW Written by inc.
		Notes:	N/A		Have Fun
				
-----------------------====================--------------------*/
int main()
  {
  	PadInit(0);     // Joypad Init
/*------------------------------------------------------------------------
       SELECT SCREEN MODE AND SHOW ME SOMETHING on my TV or TFT
------------------------------------------------------------------------*/
InitialiseGraphics(320,240,HZMode); // GFX Init, incl. Init act. Buffer...
/*----------------------------------------------------------------------*/
//	MOD_Init();	// you have to call it when needed Sound in your DEMO
// 	MOD_Load((u_char *) NameOfyourSound); // Init Music by reading from Soundfile's Name 
//  MOD_Start(); // Start playing music
/*------------------------------------------------------------------------
							Loading TIM/ GFX Files 
------------------------------------------------------------------------*/
	LoadTIMData((u_long*)font); // calls FONT.O for compiling into the PSX.EXE 

//------------================== INIT SPRITES ===============----------------

//SCROLLER
SetSpriteInfo(&sprLetter,(u_long)font,0,0,3); // prepare font for Scrolling
sprLetter.w=sprLetter.h=16; // Height of a single Char/ Letter used in your Font.BMP --> 16*16 Pix
sprLetter.mx=sprLetter.my=0; 
sprLetter.v=sprLetter.u=0;
/*---------------------====================--------------------
		
		M A I N    LOOP
		
-----------------------====================--------------------*/
while(1)
 {
/*---------------------====================--------------------
               Have Some Fun with Your Scrolling-TXT
-----------------------====================--------------------*/
// sprLetter.scaley+=5; // resize or bend or shrink the Scroller
//---------------------------------------------------------------
sprLetter.r=111;	// change the Color of your Font --> 0 is black & 255 is white
sprLetter.g=143;	// change the Color of your Font --> 0 is black & 255 is white
sprLetter.b=37;		// change the Color of your Font --> 0 is black & 255 is white
/*--------------------------------------------------------------*/
do_Fadein(); // at the Beginnning of your Demo
	
delay++;//printf("DELAY %D\n",delay); 
if(delay>70)  
{	delay=70;
	DrawScroller();	// scroller is waiting until Fade In is Done --> and starts
}
			
RenderWorld(60);
       }
/*---------------------====================--------------------
      This Commands you can use for next included Demoparts.
	  I always used the Commands to Unload the Demo and Start
	  the original Playstation Game.
-----------------------====================--------------------*/
	   
// 	SpuInit(); // Quit SPU
//	SpuQuit(); // Quit SPU
// 	MOD_Stop(); // read description in hitmod.h
//	MOD_Free(); // read description in hitmod.h
//	PadStop();  // RESET PAD IDLE
//  ResetGraph(0);  // Clear Screen
//  StopCallback(); // Clear MEM
}
/*---------------------====================--------------------
		
					E N D - M A I N    LOOP
		
-----------------------====================--------------------
 D E F I N I T I O N of F U N K T I O N S

 Function:		Init Graphics()
 Description:	init the Graphic System
 Parameters:	MODE_USED	-> PAL, NTSC
 Returns:	void
---------------------================================-----------*/

void InitialiseGraphics(int SCRWidth,int SCRHeight,int HZMode)
{
  SetVideoMode(HZMode);

  if ((HZMode == MODE_NTSC) && (SCRHeight==256)) SCRHeight=240;
    // 		Init VRAM (Resolution X, Resolution Y,
    //		Interlace  0/1 off/on | Offset 0/1 GTE/GPU,
    //		Ditherflag 0/1 off/on
    //		VRAM Mode 0/1  16/24 Bit)
  GsInitGraph(SCRWidth, SCRHeight, GsNONINTER|GsOFSGPU, 0, 0);
    // 		Definition for the two "Double Buffers" for Drawing
    //		X-coordinate , Y-coordinate   -> Buffer 0 (0,0)
    //		X-coordinate , Y-coordinate   -> Buffer 1 (0,YRes)
  GsDefDispBuff(0, 0, 0, SCRHeight);
    // 		fix an Error in Library
    if (SCRHeight == 256) GsDISPENV.screen.h=256;
	othWorld[0].length = ORDERING_TABLE_LENGTH;
	othWorld[1].length = ORDERING_TABLE_LENGTH;
	othWorld[0].org = otWorld[0];
	othWorld[1].org = otWorld[1];
	GsClearOt(0,0,&othWorld[0]);
	GsClearOt(0,0,&othWorld[1]);
    //		GET the current Buffer
	currentBuffer=GsGetActiveBuff();
    //		set packed Address for "Packet"-Building
	GsSetWorkBase((PACKET*)out_packet[currentBuffer]);
}
/*---------------------===============================--------------------
 Function:		RenderWorld(char cClear)
 Description:	responsible for DoubleBuffer...
				(ordering tables etc)
 Parameters:	char cClear: bei True wird ein "CLS" der OT hinzugefügt
 Returns:		void
---------------------===============================--------------------*/
void RenderWorld(char cClear)
  {
// ----------------------- "OLD LIST" ------------------------------------
  v_countCODE=VSync(1);
  DrawSync(0);
  v_countGFX = VSync(1);
  VSync(0);	// wait until GPU is ready with the "old List"
			// swap both Buffers (Display / Drawing)
  GsSwapDispBuff();
// --------------------- "current List" ----------------------------------
// "register" a "ClearScreen"- Command in OT
//  R, G, B
  if (cClear==1)  GsSortClear(0,0,0,&othWorld[currentBuffer]);	// here you can change the background (screen) color
  if (cClear==60) GsSortClear(36,3,3,&othWorld[currentBuffer]); // here you can change the background (screen) color
  if (cClear==255)  GsSortClear(0,0,0,&othWorld[currentBuffer]);// here you can change the background (screen) color
// start Drawing (GPU is drawing OT in the Background)
  GsDrawOt(&othWorld[currentBuffer]);
  FntFlush(-1);
// ---------------------- "NEW List" -------------------------------------
// init next OT !!!
// grab the current Buffer
  currentBuffer=GsGetActiveBuff();
// set Address for "Packet"-Building
  GsSetWorkBase((PACKET*)out_packet[currentBuffer]);
// erase Content of OT -->(Ordering Table)
  GsClearOt(0, 0, &othWorld[currentBuffer]);
// OT is now ready for GsSort... Commands...
  }
/*---------------------===============================--------------------
 Function:		LoadTIMData (u_long tMemAddress)
 Description:	transfer a .TIM File ffrom the Main Memory into the VideoRam
 Parameters:	u_long tMemAddress - Address of TIM's in Main Memory
 Returns:		void
//---------------------===============================------------------*/
void LoadTIMData(u_long *tMemAddress)
{
  RECT tRect;
  GsIMAGE tTim;
  DrawSync(0);
  tMemAddress++;
  GsGetTimInfo(tMemAddress, &tTim);	// save TIM-Information in tTim
  tRect.x = tTim.px;
  tRect.y = tTim.py;
  tRect.w = tTim.pw;
  tRect.h = tTim.ph;
  LoadImage(&tRect, tTim.pixel);	// Load TIM-Data in VideoRam
  DrawSync(0);

  if ((tTim.pmode >> 3) & 0x01)
    {
    tRect.x = tTim.cx;
    tRect.y = tTim.cy;
    tRect.w = tTim.cw;
    tRect.h = tTim.ch;
    LoadImage(&tRect, tTim.clut);	// load CLUT in VideoRam
    };
  DrawSync(0);	// waite until GPU is ready
  }
/*------------------------================================-----------------------
 Function:		SetSpriteInfo(...)
 Description:	Initialized a bunch of Data for Sprites
 Parameters:	- Pointer for Structure of Sprites
				- Address (RAM) for linked TIMs
				- Position of Sprites X and Y
				- CutParameters: defines, how many pixels a sprite be narrower
				  to as the TIM (as it may from time to give ugly "margins")
 Returns:		void
 Notes:			The "reference point" of the sprite is set CENTERED!
 NOTE:			it does not affect GsSortFastSprite !!!!
//------------------------================================---------------------*/
void SetSpriteInfo(GsSPRITE *tSprite, u_long tMemAddress, long tX, long tY, int tCut)
  {
  GsIMAGE tTim;					// TIM image Information
  tMemAddress += 4;				// Point to Data
  GsGetTimInfo((u_long *) tMemAddress, &tTim); // get TIM Info. by tTim
  tSprite->x = tX;				// set Coordinates according 
  tSprite->y = tY;				// to the information at call
  switch (tTim.pmode & 3)		// X-Value depends of Bit Depth!
    {
    case 0: tSprite->w = tTim.pw << 2;
            tSprite->u = (tTim.px & 0x3f) * 4;
            break;
    case 1: tSprite->w = tTim.pw << 1;
            tSprite->u = (tTim.px & 0x3f) * 2;
            break;
    default: tSprite->w = tTim.pw;
             tSprite->u = tTim.px & 0x3f; 
    };
  tSprite->h = tTim.ph;
  tSprite->v = tTim.py & 0xff;
  tSprite->tpage = GetTPage((tTim.pmode & 3),0,tTim.px,tTim.py);
  tSprite->attribute = (tTim.pmode & 3) << 24;
  tSprite->cx = tTim.cx;		// Set CLUT of a Sprite
  tSprite->cy = tTim.cy;
  tSprite->r = tSprite->g = tSprite->b = 128; // normal intensity (of colors) set to standard
  tSprite->mx = tSprite->w/2; // reference point of the sprite 
  tSprite->my = tSprite->h/2; // to the middle set (not required)
  tSprite->scalex = tSprite->scaley = ONE;	// set Size to 1 (normal size)
  tSprite->rotate = 0; // Rotation angle to 0
  if (tCut)				// Sprite "prune" when Tim a 
    tSprite->w -= tCut;	// "illegal" width ...
  };
/*----------------------------------------------------------------

	 now, here goes the rest for the Scroller
	
------------------------------------------------------------------*/	
void DrawScroller(void)
{
  int iTmp1,iTmp2,iTmp3;
  char *pText;
  if (iScrollOffset<=-16) {pBaseText++;iScrollOffset+=16;}
  iScrollOffset-=SCRSPEED;
  if (*pBaseText==NULL) // End of TxT-Scroll
  pBaseText=scrtxt;
  pText=pBaseText;    // temporarily TXT Display
  for (iTmp1=0;iTmp1<44;iTmp1++) // show max. 11 Char
	{
	iTmp2=*pText;
    if (iTmp2) // if Char or Sign >0
		{
      if (iTmp2>'Z') iTmp2=' ';
      iTmp2-=' ';
// Target Coordinates
	sprLetter.x=iScrollOffset+16*iTmp1;
	sprLetter.y=YPOS;  // Source Coordinates --> Y position of the Scroll Text was set at: 120 	// Y-Position FONT Scroller
	sprLetter.u=(iTmp2%8)*16; // Size of your Letter/ Char 16 pix
	sprLetter.v=(iTmp2/8)*16; // Size of your Letter/ Char 16 pix
	GsSortSprite(&sprLetter,&othWorld[currentBuffer],2); // "2" <-- Text Scroll Layer (1 is Foreground)
	pText++;
		}
	}
 }
/*----------------------------------------------------------------

	 now, here goes the FADE IN at the DEMO START
	
------------------------------------------------------------------*/
void do_Fadein()
{
static char fade;
myBox[0].w=myBox[1].w=320; // Screen Wide
myBox[0].h=myBox[1].h=120; // Starts in the middle of the Screen 
myBox[0].x=myBox[1].x=0;
myBox[0].y=0-fade;
myBox[1].y=120+fade;
GsSortBoxFill(&myBox[0],&othWorld[currentBuffer],0);
GsSortBoxFill(&myBox[1],&othWorld[currentBuffer],0);
if(fade<128) // play around with it
fade++;
}
/*----------------------------------------------------------------

	 tested and compiled by inc. in 2013/04/23
	 used Emu: ePSXe v 1.8.0
	
------------------------------------------------------------------*/
Have Fun. Question? Ask .
You do not have the required permissions to view the files attached to this post.
Last edited by inc^lightforce on November 21st, 2015, 4:43 am, edited 2 times in total.
my coding page/ forum at:
http://aftermath-creations.net/

User avatar
inc^lightforce
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 145
Joined: March 7th, 2013, 7:34 am
I am a: Programmer, Artist, Gamer
PlayStation Model: Black
Skype: a5recordings
Location: Germany
Contact:

Re: WORKSHOP CODING INTROS & DEMOS

Post by inc^lightforce » June 23rd, 2013, 1:47 pm

CODING a SIMPLE "3D LIKE STARFIELD" with many PLANES and only "GsLINE"...

Grab all Files incl. a Demo for PS1 EMU HERE

Image

Code: Select all

/*
WORKSHOP

~ DRAW A SIMPLE STARFILD with GsLine

Code: inc. 2013
TESTED: with PSX EMULATOR ePSXe v 1.8
Contact: www.psxdev.net

*/


//--------------------------------------------------------------------------
// I N C L U D E S
//--------------------------------------------------------------------------
#include <sys/types.h>
#include <stdlib.h>
#include <libetc.h>
#include <libgte.h>
#include <libgpu.h>
#include <libgs.h>
#include <libsnd.h>
#include <libmath.h>
#include <libspu.h>
#define ORDERING_TABLE_LENGTH (5)
#define MAX_NO_PACKETS  (3000)
//---------------------------------------------------------------------------------------
//           DEFINE STARS
//---------------------------------------------------------------------------------------
#define STARSC         300 								// SET AMOUNT OF STARS
#define SPEED            1 								// Scroll Speed
#define PLANE            4 								// Number of PLANEs
//---------------------------------------------------------------------------------------
// G L O B A L S
//---------------------------------------------------------------------------------------
GsOT		othWorld[2];
GsOT_TAG	otWorld[2][1<<ORDERING_TABLE_LENGTH];
PACKET		out_packet[2][(MAX_NO_PACKETS * 24)];
int			currentBuffer;		// current Buffer for "double buffering"
int         v_countGFX=0, v_countCODE=0; // HSync Counter
u_char      HZMode=MODE_NTSC;
//---------------------------------------------------------------------------------------
//           DEFINE STARS
//---------------------------------------------------------------------------------------
typedef struct
  {
  int x;              // X-Coordinate Star
  int y;              // Y-Coordinate Star
  int z;              // PLANE-ID
  } STAR;
//---------------------------------------------------------------------------------------
//           DEFINE STARS WITH GsLINE :)
//---------------------------------------------------------------------------------------
STAR	Stars[STARSC];
GsLINE	line;
//--------------------------------------------------------------------------
// P R O T O T Y P E S
//--------------------------------------------------------------------------
void InitialiseGraphics(int,int,int); // Width, Height, MODE
void UpdateWorld();
void RenderWorld(char cClear);
void InitStars(void);				// STARS DEFINITION    
void MoveStars(void);				// STARS DEFINITION
//--------------------------------------------------------------------------
// Function:	main()
// Description:	--
// Parameters:	--
// Returns:	int
// Notes:	N/A
//--------------------------------------------------------------------------
int main()
  {
  u_long lTmp1;
  InitialiseGraphics(320,240,MODE_NTSC); // GFX Init, incl. Init act. Buffer...
  RenderWorld(1);RenderWorld(1);		 // 2x DoubleBuffering...
  InitStars();							 // STARS DEFINITION
// -----------------------------------------------------------------------
// M A I N    L O O P    
// -----------------------------------------------------------------------
while(1)
    {
    MoveStars();
    RenderWorld(1);
    }
  }
void InitStars(void)
  {
  int l,zi;
  srand(1);
  for(l=0;l<STARSC;l++)                
    {
    zi=rand()%320;  		// SCREEN WIDTH    Scroll Star from ---> to ON "X" AXIS
    Stars[l].x=zi;
    zi=rand()%240; 			// SCREEN HEIGHT   Scroll Star from ---> to ON "Y" AXIS
    Stars[l].y=zi;
    zi=rand()%PLANE;
    Stars[l].z=zi+1;
    }
  }
void MoveStars(void)
  {
  int i;
  for(i=0; i<STARSC; i++)
    {        
    Stars[i].x+=SPEED*Stars[i].z;
    if(Stars[i].x>320)
      Stars[i].x=0;
    line.x0 = line.x1 = Stars[i].x;   // Play with it :)
    line.y0 = line.y1 = Stars[i].y;   // Play with it :)
    line.r = 5; 					  // SET COLOUR OF YOUR STARS		
    line.g = line.b =Stars[i].z*50;
    GsSortLine(&line,&othWorld[currentBuffer],5);  // LAYER 5 in the BACKGROUND
    }
  }
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// F U N K T I O N S   D E F I N I T I O N E N
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Function:	InitialiseGraphics()
// Description:	initialisiert das Grafik-System
// Parameters:	MODE_USED	-> PAL, NTSC
// Returns:		void
//------------------------------------------------------------------------------
void InitialiseGraphics(int SCRWidth,int SCRHeight,int HZMode)
  {
  SetVideoMode(HZMode);

  if ((HZMode == MODE_NTSC) && (SCRHeight==256)) SCRHeight=240;
    // 		Init VRAM (Resolution X, Resolution Y,
    //		Interlace  0/1 off/on | Offset 0/1 GTE/GPU,
    //		Ditherflag 0/1 off/on,
    //		VRAM Modus 0/1  16/24 Bit)
  GsInitGraph(SCRWidth, SCRHeight, GsNONINTER|GsOFSGPU, 0, 0);
    // Definition 2 "Double Buffer" for drawing
    //		(X-Coordinate , Y-Coordinate   -> Buffer 0 (0,0)
    //		 X-Coordinate , Y-Coordinate   -> Buffer 1 (0,YRes) )
  GsDefDispBuff(0, 0, 0, SCRHeight);
    // Correct Errors from Libs
  if (SCRHeight == 256) GsDISPENV.screen.h=256;
  othWorld[0].length = ORDERING_TABLE_LENGTH;
  othWorld[1].length = ORDERING_TABLE_LENGTH;
  othWorld[0].org = otWorld[0];
  othWorld[1].org = otWorld[1];
  GsClearOt(0,0,&othWorld[0]);
  GsClearOt(0,0,&othWorld[1]);
// get current buffer
  currentBuffer=GsGetActiveBuff();

// set Adress for "Packet"-Building
  GsSetWorkBase((PACKET*)out_packet[currentBuffer]);
  }
//------------------------------------------------------------------------------
// Function:	RenderWorld(char cClear)
// Description:	DoubleBuffer...
//				(ordering tables etc)
// Parameters:	char cClear: on True you'll get "CLS" to OT 
// Returns:	void
// Notes:	--
//------------------------------------------------------------------------------
void RenderWorld(char cClear)
  {
// ------------------------------------ "an old List"
  v_countCODE=VSync(1);
  DrawSync(0);
  v_countGFX = VSync(1);
  VSync(0);	// waite until GPU is ready with "old List" 
			// swap both Buffers (Display / Drawing)
  GsSwapDispBuff();
// ------------------------------------ "current List"
// "register" an "ClearScreen"- in OT
//  R, G, B
  if (cClear==1)  GsSortClear(0, 0, 0,&othWorld[currentBuffer]);
  if (cClear==255)  GsSortClear(255, 255, 255,&othWorld[currentBuffer]);
// start Drawing (GPU is drawing in the background of OT)
  GsDrawOt(&othWorld[currentBuffer]);
  FntFlush(-1);
// ------------------------------------ "NEW List"
// init next OT !!!
// grab current buffer
  currentBuffer=GsGetActiveBuff();
// set Address for "Packet"-Building
  GsSetWorkBase((PACKET*)out_packet[currentBuffer]);
// erase Content of OT
  GsClearOt(0, 0, &othWorld[currentBuffer]);
// OT is now ready for GsSort... Get Commands now...
}
3D STARS from Back to Front , Z-PLANE wanted? feel free to ask

Have Fun. Question? Ask .
Last edited by inc^lightforce on December 13th, 2013, 9:19 am, edited 1 time in total.
my coding page/ forum at:
http://aftermath-creations.net/

Type 79
Active PSXDEV User
Active PSXDEV User
Posts: 61
Joined: September 18th, 2012, 2:30 am
Location: Finland

Re: WORKSHOP CODING INTROS & DEMOS

Post by Type 79 » June 26th, 2013, 3:48 am

Thanks :clap

User avatar
ddoodm
Curious PSXDEV User
Curious PSXDEV User
Posts: 15
Joined: November 18th, 2012, 6:47 pm
Location: Sydney, Australia
Contact:

Re: WORKSHOP CODING INTROS & DEMOS

Post by ddoodm » June 26th, 2013, 12:45 pm

Agreed! These are some great, relevant tutes. You're amazing, Lightforce!
^____________^

zeroZshadow
What is PSXDEV?
What is PSXDEV?
Posts: 3
Joined: June 29th, 2013, 3:58 am

Re: WORKSHOP CODING INTROS & DEMOS

Post by zeroZshadow » June 29th, 2013, 4:08 am

Using the demos in the post as examples im trying to make a demo for an upcoming demoparty, but im running into some issues with the hitmod player.
Almost every mod file i convert to hit and then play in a small testing application on the ePSXe emulator, sounds off.
Usually the pitch is all wrong and effects or while channels are missing.
How did you get the music on yours running so well?

I've also looked in the XMPlay2 that is in psyq/bin/xmplay2 (why is that there?)
But this lacks any and all documentation of how it splits the original xm file into vb vh and xm.

any help will be welcome!
(ill offcourse post my demo here when its done)

User avatar
inc^lightforce
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 145
Joined: March 7th, 2013, 7:34 am
I am a: Programmer, Artist, Gamer
PlayStation Model: Black
Skype: a5recordings
Location: Germany
Contact:

Re: WORKSHOP CODING INTROS & DEMOS

Post by inc^lightforce » June 29th, 2013, 8:49 am

send me your MOD file so i can test it. if a MOD are not compatible, it can occur the sounds will pitched down many octaves.The Hitman player only play MOD files. you must convert the modfile with:

1~ modconv.exe to yoursound.hit
2~ yoursound.hit to "C"
3~ yoursound.c to yoursound.o
now load it into your demo.

have you ever tried another mod file?

Please do not post your demo in this topic. the topic should be clean for WORKSHOP only.
if you need help in some kind of trouble please contact me via PM ;) send me the whole source and sound + gfx or what ever.

addendum:
setting *.mod file playback for Cracktros in correct speed: when converting with "modconv" easy use the option modconv.exe -m 4096 yoursound.mod.
Thanks to ZerozShadow.


cheers
inc.
Last edited by inc^lightforce on July 6th, 2013, 9:26 pm, edited 3 times in total.
my coding page/ forum at:
http://aftermath-creations.net/

User avatar
bizarro2011
Serious PSXDEV User
Serious PSXDEV User
Posts: 118
Joined: March 27th, 2012, 9:09 pm
Skype: abernardo2011
Location: Brazil

Re: WORKSHOP CODING INTROS & DEMOS

Post by bizarro2011 » June 30th, 2013, 6:42 am

inc^lightforce, I will do a test tomorrow and post.
you know copying bytes of RAM for VRAM. and VRAM to RAM.
has an instruction memcpy...

User avatar
inc^lightforce
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 145
Joined: March 7th, 2013, 7:34 am
I am a: Programmer, Artist, Gamer
PlayStation Model: Black
Skype: a5recordings
Location: Germany
Contact:

Re: WORKSHOP CODING INTROS & DEMOS

Post by inc^lightforce » July 5th, 2013, 11:51 am

i wanna share my workflow in creating Logos for PS1 Demos. i also use this way to make sum nice Logos for PC Demos and Cracktros.
Something is in German but is very easy to understand

have fun.


LOGO & GFX TUTORIAL 1 with 3Ds MAX:

SCENE LOGO TUTORIAL FOR 3Ds MAX+PHOTOPAINT or PHOTOSHOP
download the PDF TUTORIAL here

this is only a small preview of mine of examples from the past:
Image Image Image Image Image


LOGO & GFX TUTORIAL 2 without 3D Program:

http://rapidshare.com/files/1360287152/hallo_tut.rar

Image Image
~ Paintprogram
~ letters
~ Eyecandy EXTRUDE
~ the rest with GFX Tablet & Digi pencil .. you can also use your mouse for drawing

this is only a small preview of mine of examples from the past:
Image Image Image Image Image

-------------------------------------------------------------------------------------------------------------------------
i suggest this plugins:

-Filterforge (very hot!!!) ---> Fiber Image (Effect)
-eyecandy 5 (extrude)

last Words to a fast Logo creation:
1. picked font
2. started corel photopaint
3. 2 plugin used
4. now you have a nice logo with only a few clicks: Image

thats it.
some Questions? feel free to ask

cheers and happy painting

inc.
Last edited by inc^lightforce on December 13th, 2013, 9:22 am, edited 2 times in total.
my coding page/ forum at:
http://aftermath-creations.net/

User avatar
sicklebrick
C Programming Expert
C Programming Expert
Posts: 166
Joined: July 17th, 2013, 9:32 pm
I am a: Chocolate-fueled pug fetish robot.
Location: Scotland

Re: WORKSHOP CODING INTROS & DEMOS

Post by sicklebrick » July 25th, 2013, 7:14 pm

Thanks for the tutes man -I appreciate the effort :)
I was wondering where to get ahold of Modconv though? Is it a PSX specific tool?
(Also, if you'd prefer this thread clear, gimme a shout and I'll wipe this message, cheers)

Type 79
Active PSXDEV User
Active PSXDEV User
Posts: 61
Joined: September 18th, 2012, 2:30 am
Location: Finland

Re: WORKSHOP CODING INTROS & DEMOS

Post by Type 79 » July 25th, 2013, 8:50 pm


User avatar
sicklebrick
C Programming Expert
C Programming Expert
Posts: 166
Joined: July 17th, 2013, 9:32 pm
I am a: Chocolate-fueled pug fetish robot.
Location: Scotland

Re: WORKSHOP CODING INTROS & DEMOS

Post by sicklebrick » July 25th, 2013, 8:59 pm

Awesomesauce, thanks :)

User avatar
inc^lightforce
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 145
Joined: March 7th, 2013, 7:34 am
I am a: Programmer, Artist, Gamer
PlayStation Model: Black
Skype: a5recordings
Location: Germany
Contact:

Re: WORKSHOP CODING INTROS & DEMOS

Post by inc^lightforce » July 25th, 2013, 10:25 pm

Workflow to my GFX Tutorial ---> AVI TUTORIAL

Many people ask me, how i've always done my PC Demo Logos. In this Video i'll show you my Workflow.

Used Plugin:

~ EyeCandy's EXTRUDE
~ FILTERFORGE 3

Used Program:

~ CorelDraws PhotoPaint
~ FlamePainter


i hope this Tutorial give you the right
Direction and let you start now.
I'm happy to see your GFX.
You can contact me each and every Time.

inc. 2013

more Info at:
viewtopic.php?f=51&t=364

Image

try out and have fun
my coding page/ forum at:
http://aftermath-creations.net/

User avatar
inc^lightforce
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 145
Joined: March 7th, 2013, 7:34 am
I am a: Programmer, Artist, Gamer
PlayStation Model: Black
Skype: a5recordings
Location: Germany
Contact:

Re: WORKSHOP CODING INTROS & DEMOS

Post by inc^lightforce » July 25th, 2013, 10:32 pm

Mod Sound Usage:
----------------------------------------
#include "hitmod.h"

extern char your_sound[]; // file name taken by your mod file
MOD_Init(); // Sound Check
MOD_Load((u_char *) your_sound); // load Sound
MOD_Start(); // play Sound


DON'T FORGET TO INCLUDE "HITMOD.OBJ" into your BATCH like this:
ccpsx -O3 -Xo$80100000 main.c your_sound.o hitmod.obj font.o -omain.cpe


thats it. for detailed Info check the TUTORIAL Source.
my coding page/ forum at:
http://aftermath-creations.net/

araya
Interested PSXDEV User
Interested PSXDEV User
Posts: 5
Joined: March 9th, 2014, 8:31 pm

Re: WORKSHOP CODING INTROS & DEMOS

Post by araya » May 30th, 2015, 8:17 pm

Links are down,anyone got these files stored and would like to re-up?

Dedok179
Active PSXDEV User
Active PSXDEV User
Posts: 55
Joined: June 11th, 2015, 7:23 pm
I am a: Programmer, Developer.
PlayStation Model: SCPH-5502
Location: Tula,RU

Re: WORKSHOP CODING INTROS & DEMOS

Post by Dedok179 » August 12th, 2015, 5:23 pm

inc^lightforce wrote:Mod Sound Usage:
----------------------------------------
#include "hitmod.h"

extern char your_sound[]; // file name taken by your mod file
MOD_Init(); // Sound Check
MOD_Load((u_char *) your_sound); // load Sound
MOD_Start(); // play Sound


DON'T FORGET TO INCLUDE "HITMOD.OBJ" into your BATCH like this:
ccpsx -O3 -Xo$80100000 main.c your_sound.o hitmod.obj font.o -omain.cpe


thats it. for detailed Info check the TUTORIAL Source.
Links are dead.Do you still have these files?

User avatar
Shadow
Admin / PSXDEV
Admin / PSXDEV
Posts: 2258
Joined: December 31st, 2012, 5:37 pm
PlayStation Model: H2000/5502

Re: WORKSHOP CODING INTROS & DEMOS

Post by Shadow » August 12th, 2015, 7:41 pm

HITMOD can be found on the HITMENS site here.
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

Development Computer: Windows 98, Pentium 3 [400MHz], 128MB SDRAM, DTL-H2000, DTL-H201A, 21" Sony Trinitron CRT, CD-ROM burner, 3.25" and 5.25" Floppy Diskette Drives and a ZIP 100 Diskette Drive.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest