[Tutorial PSP] - Adding Menu Options to PSP Quake 1.1

Post tutorials on how to do certain tasks within game or engine code here.
Post Reply
Team Xlink
Posts: 368
Joined: Thu Jun 25, 2009 4:45 am
Location: Michigan

[Tutorial PSP] - Adding Menu Options to PSP Quake 1.1

Post by Team Xlink »

Hello.

I am writeing this to answer LonePossum's question and for anyone else that might wonder how to do this.

This is a tutorial on how to add menu options to psp quake 1.1 I use Add Bot and Remove Bot for the options to answer LovePossum's question.


Step 1.

Open

Code: Select all

menu.c
Step 2.

If you have implemented Adhoc support follow go to Part A if not go to Part B.

**NOTICE**
This tutorial assumes impulse 101 adds a bot and impulse 103 removes a bot changes these impulses to whichever impulse you need, if they aren't already the ones you need

Part A.

Search for the Multiplayer Menu section

At the top of that section it says this:

Code: Select all

#ifdef PSP
#define	MULTIPLAYER_ITEMS	4
#else
#define	MULTIPLAYER_ITEMS	3
#endif
Change it to this:

Code: Select all

#ifdef PSP
#define	MULTIPLAYER_ITEMS	6
#else
#define	MULTIPLAYER_ITEMS	3
#endif
Step 3

Scroll down to this:

Code: Select all

ifdef PSP
	M_Print (72, 97, "Infrastructure ");
	M_DrawCheckbox (220, 97, tcpipAvailable );

#if 0
	// Sort out adhoc later
	M_Print (72, 117,  "Adhoc          ");
	M_DrawCheckbox (220, 117, adhocAvailable);
#endif 
The first number is the X value which measures the x axis

The second number is the Y value which measures the y axis.

They work just like cordinates do (X, Y) ex (4, 5)

As we can see the x value stays at 72 We will follow this pattern.

Lets subtract the y values.

117 - 97 = x

We get this

117 - 97 = 20

x = 20

So each options has a distance of 20 units between them on the y axis we will also follow this pattern.

Right after this:

Code: Select all

ifdef PSP
	M_Print (72, 97, "Infrastructure ");
	M_DrawCheckbox (220, 97, tcpipAvailable );

#if 0
	// Sort out adhoc later
	M_Print (72, 117,  "Adhoc          ");
	M_DrawCheckbox (220, 117, adhocAvailable);
#endif 
Add this:

Code: Select all

	M_Print (72, 137,  "Add Bot         ");
	M_Print (72, 157,  "Remove  Bot  ");
Scroll down to this:

Code: Select all

#ifdef PSP
		case 3:
			Datagram_Shutdown();
			
			tcpipAvailable = !tcpipAvailable;

			if(tcpipAvailable)
				Datagram_Init();

			break;

#if 0
		// Dont need adhoc at the moment
		case 4:
			Datagram_Shutdown();
			
			adhocAvailable = !adhocAvailable;
			tcpipAvailable = 0;

			if(adhocAvailable)
				Datagram_Init();

			break;
#endif
After that add this:

Code: Select all

case 5:
		Cbuf_AddText ("impulse 101\n");
                break;

case 6:
		Cbuf_AddText ("impulse 103\n");
                break;
Part B.
Scroll down to this:

Code: Select all

ifdef PSP
	M_Print (72, 97, "Infrastructure ");
	M_DrawCheckbox (220, 97, tcpipAvailable );

#if 0
	// Sort out adhoc later
	M_Print (72, 117,  "Adhoc          ");
	M_DrawCheckbox (220, 117, adhocAvailable);
#endif 
Add this:

Code: Select all

	M_Print (72, 117,  "Add Bot         ");
	M_Print (72, 137,  "Remove  Bot  ");
Scroll down to this:

Code: Select all

#ifdef PSP
		case 3:
			Datagram_Shutdown();
			
			tcpipAvailable = !tcpipAvailable;

			if(tcpipAvailable)
				Datagram_Init();

			break;

#if 0
		// Dont need adhoc at the moment
		case 4:
			Datagram_Shutdown();
			
			adhocAvailable = !adhocAvailable;
			tcpipAvailable = 0;

			if(adhocAvailable)
				Datagram_Init();

			break;
#endif
After that add this:

Code: Select all

case 4:
		Cbuf_AddText ("impulse 101\n");
                break;

case 5:
		Cbuf_AddText ("impulse 103\n");
                break;
Now you are done.

Congratulations.
Last edited by Team Xlink on Sun Jul 11, 2010 6:56 pm, edited 1 time in total.
LonePossum.
Posts: 38
Joined: Mon Nov 02, 2009 11:07 am

Post by LonePossum. »

Thanks a bunch, This Helps me with a lot of things im trying to do.
Worked Like a Charm But on PSP With the no comunitcations Avalible thing it gets split inbetween them / Does not really bother me also they go far to low and theres a gap where more menu options could go and due to the ammount of Multiplayer Options the menu would not go down to the Remove Bot Function so I just modified it to 7 and I could reach it.

Either you could fix your tut to 7 or fix it so there isint a gap / Hope you get me. I did the tut on PSP Quake 1.1. Hope I didnt do something wrong causing this issue.

Thanks Again.
Post Reply