More 3DS + PSP unification

This commit is contained in:
cypress 2024-09-06 18:07:39 -07:00
parent c321e599d9
commit b4b2f11100
13 changed files with 65 additions and 63 deletions

View File

@ -23,7 +23,7 @@ endif
COMMON_OBJS = \ COMMON_OBJS = \
source/psp/battery.o \ source/psp/battery.o \
source/thread.o \ source/psp/thread.o \
source/psp/VramExt.o \ source/psp/VramExt.o \
source/psp/input.o \ source/psp/input.o \
source/psp/main.o \ source/psp/main.o \

View File

@ -24,7 +24,7 @@ endif
COMMON_OBJS = \ COMMON_OBJS = \
source/psp/battery.o \ source/psp/battery.o \
source/thread.o \ source/psp/thread.o \
source/psp/VramExt.o \ source/psp/VramExt.o \
source/psp/input.o \ source/psp/input.o \
source/psp/main.o \ source/psp/main.o \

View File

@ -20,13 +20,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
int CDAudio_Init(void); int CDAudio_Init(void);
void CDAudio_Play(byte track, qboolean looping); void CDAudio_Play(byte track, qboolean looping);
#ifdef __PSP__
void CDAudio_PlayFromString(char* track_name, qboolean looping); void CDAudio_PlayFromString(char* track_name, qboolean looping);
#endif // __PSP__
void CDAudio_Stop(void); void CDAudio_Stop(void);
void CDAudio_Pause(void); void CDAudio_Pause(void);
void CDAudio_Resume(void); void CDAudio_Resume(void);
void CDAudio_Shutdown(void); void CDAudio_Shutdown(void);
void CDAudio_Update(void); void CDAudio_Update(void);
#ifdef __PSP__
void CDAudio_Next(void); void CDAudio_Next(void);
void CDAudio_Prev(void); void CDAudio_Prev(void);
void CDAudio_PrintMusicList(void); void CDAudio_PrintMusicList(void);
void CDAudio_Track(char* trackname); void CDAudio_Track(char* trackname);
#endif // __PSP__

View File

@ -703,7 +703,7 @@ void HUD_Rounds (void)
HUD_WorldText(value2); HUD_WorldText(value2);
if (has_chaptertitle == false) if (has_chaptertitle == false)
Draw_ColoredString(6, vid.height/2 + 50, "'Nazi Zombies'", 255, 255, 255, value2, 1); Draw_ColoredString(6, vid.height/2 + 10, "'Nazi Zombies'", 255, 255, 255, value2, 1);
value -= cl.time * 0.4; value -= cl.time * 0.4;
value2 += cl.time * 0.4; value2 += cl.time * 0.4;
@ -719,7 +719,7 @@ void HUD_Rounds (void)
HUD_WorldText(255); HUD_WorldText(255);
if (has_chaptertitle == false) if (has_chaptertitle == false)
Draw_ColoredString(4, vid.height/2 + 50, "'Nazi Zombies'", 255, 255, 255, 255, 1); Draw_ColoredString(4, vid.height/2 + 10, "'Nazi Zombies'", 255, 255, 255, 255, 1);
value2 += cl.time * 0.4; value2 += cl.time * 0.4;
@ -733,7 +733,7 @@ void HUD_Rounds (void)
HUD_WorldText(value2); HUD_WorldText(value2);
if (has_chaptertitle == false) if (has_chaptertitle == false)
Draw_ColoredString(4, vid.height/2 + 50, "'Nazi Zombies'", 255, 255, 255, value2, 1); Draw_ColoredString(4, vid.height/2 + 10, "'Nazi Zombies'", 255, 255, 255, value2, 1);
value2 -= cl.time * 0.4; value2 -= cl.time * 0.4;

View File

@ -136,7 +136,11 @@ void IN_LeftUp(void) {KeyUp(&in_left);}
void IN_RightDown(void) {KeyDown(&in_right);} void IN_RightDown(void) {KeyDown(&in_right);}
void IN_RightUp(void) {KeyUp(&in_right);} void IN_RightUp(void) {KeyUp(&in_right);}
void IN_ForwardDown(void) {KeyDown(&in_forward);} void IN_ForwardDown(void) {KeyDown(&in_forward);}
void IN_ForwardUp(void) {KeyUp(&in_forward);Cbuf_AddText("impulse 24\n");} void IN_ForwardUp(void) {KeyUp(&in_forward);
#ifdef __PSP__
Cbuf_AddText("impulse 24\n");
#endif // __PSP__
}
void IN_BackDown(void) {KeyDown(&in_back);} void IN_BackDown(void) {KeyDown(&in_back);}
void IN_BackUp(void) {KeyUp(&in_back);} void IN_BackUp(void) {KeyUp(&in_back);}
void IN_LookupDown(void) {KeyDown(&in_lookup);} void IN_LookupDown(void) {KeyDown(&in_lookup);}
@ -291,8 +295,13 @@ void CL_AdjustAngles (void)
if (!(in_strafe.state & 1)) if (!(in_strafe.state & 1))
{ {
#ifdef __PSP__
cl.viewangles[YAW] -= speed*cl_yawspeed.value*CL_KeyState (&in_right) * in_sensitivity.value; cl.viewangles[YAW] -= speed*cl_yawspeed.value*CL_KeyState (&in_right) * in_sensitivity.value;
cl.viewangles[YAW] += speed*cl_yawspeed.value*CL_KeyState (&in_left) * in_sensitivity.value; cl.viewangles[YAW] += speed*cl_yawspeed.value*CL_KeyState (&in_left) * in_sensitivity.value;
#else
cl.viewangles[YAW] -= speed*cl_yawspeed.value*CL_KeyState (&in_right) * sensitivity.value;
cl.viewangles[YAW] += speed*cl_yawspeed.value*CL_KeyState (&in_left) * sensitivity.value;
#endif // __PSP__
cl.viewangles[YAW] = anglemod(cl.viewangles[YAW]); cl.viewangles[YAW] = anglemod(cl.viewangles[YAW]);
} }
if (in_klook.state & 1) if (in_klook.state & 1)
@ -302,8 +311,13 @@ void CL_AdjustAngles (void)
cl.viewangles[PITCH] += speed*cl_pitchspeed.value * CL_KeyState (&in_back); cl.viewangles[PITCH] += speed*cl_pitchspeed.value * CL_KeyState (&in_back);
} }
#ifdef __PSP__
up = CL_KeyState (&in_lookup) * in_sensitivity.value; up = CL_KeyState (&in_lookup) * in_sensitivity.value;
down = CL_KeyState(&in_lookdown) * in_sensitivity.value; down = CL_KeyState(&in_lookdown) * in_sensitivity.value;
#else
up = CL_KeyState (&in_lookup) * sensitivity.value;
down = CL_KeyState(&in_lookdown) * sensitivity.value;
#endif // __PSP__
cl.viewangles[PITCH] -= speed*cl_pitchspeed.value * up; cl.viewangles[PITCH] -= speed*cl_pitchspeed.value * up;
cl.viewangles[PITCH] += speed*cl_pitchspeed.value * down; cl.viewangles[PITCH] += speed*cl_pitchspeed.value * down;

View File

@ -36,7 +36,11 @@ cvar_t cl_lightning_zadjust = {"cl_lightning_zadjust", "0", true};
cvar_t lookspring = {"lookspring","0", true}; cvar_t lookspring = {"lookspring","0", true};
cvar_t lookstrafe = {"lookstrafe","0", true}; cvar_t lookstrafe = {"lookstrafe","0", true};
#ifdef __PSP__
cvar_t in_sensitivity = {"sensitivity","3", true}; cvar_t in_sensitivity = {"sensitivity","3", true};
#else
cvar_t sensitivity = {"sensitivity","8", true};
#endif // __PSP__
cvar_t in_tolerance = {"tolerance","0.25", true}; cvar_t in_tolerance = {"tolerance","0.25", true};
cvar_t in_acceleration = {"acceleration","1.0", true}; cvar_t in_acceleration = {"acceleration","1.0", true};
@ -58,7 +62,9 @@ cvar_t in_y_axis_adjust = {"in_y_axis_adjust", "0", true};
modelindex_t cl_modelindex[NUM_MODELINDEX]; // modelindex_t cl_modelindex[NUM_MODELINDEX]; //
char *cl_modelnames[NUM_MODELINDEX];// char *cl_modelnames[NUM_MODELINDEX];//
// //
#ifdef __PSP__
tagentity_t q3player_body, q3player_head; // tagentity_t q3player_body, q3player_head; //
#endif // __PSP__
//=================================================// //=================================================//
client_static_t cls; client_static_t cls;
client_state_t cl; client_state_t cl;
@ -337,6 +343,7 @@ void SetPal (int i)
#endif #endif
} }
#ifdef __PSP__
void CL_CopyPlayerInfo (entity_t *ent, entity_t *player) void CL_CopyPlayerInfo (entity_t *ent, entity_t *player)
{ {
memcpy_vfpu(&ent->baseline, &player->baseline, sizeof(entity_state_t)); memcpy_vfpu(&ent->baseline, &player->baseline, sizeof(entity_state_t));
@ -371,6 +378,7 @@ void CL_CopyPlayerInfo (entity_t *ent, entity_t *player)
ent->renderamt = player->renderamt; ent->renderamt = player->renderamt;
//ent->rendercolor = player->rendercolor; //ent->rendercolor = player->rendercolor;
} }
#endif // __PSP__
/* /*
=============== ===============
@ -960,36 +968,6 @@ void CL_RelinkEntities (void)
if ( ent->effects & EF_NODRAW ) if ( ent->effects & EF_NODRAW )
continue; continue;
if (qmb_initialized)
{
/*if (ent->modelindex == cl_modelindex[mi_bubble])
{
QMB_StaticBubble (ent);
continue;
}
else if (r_part_lightning.value && ent->modelindex == cl_modelindex[mi_shambler] && ent->frame >= 65 && ent->frame <= 68)
{
vec3_t liteorg;
VectorCopy (ent->origin, liteorg);
liteorg[2] += 32;
QMB_ShamblerCharge (liteorg);
}
else */if (r_part_trails.value && ent->model->modhint == MOD_SPIKE)
{
if (!ent->traildrawn || !VectorL2Compare(ent->trail_origin, ent->origin, 140))
{
VectorCopy (ent->origin, oldorg); //not present last frame or too far away
ent->traildrawn = true;
}
else
{
VectorCopy (ent->trail_origin, oldorg);
}
QMB_RocketTrail (oldorg, ent->origin, BUBBLE_TRAIL);
}
}
if (cl_numvisedicts < MAX_VISEDICTS) if (cl_numvisedicts < MAX_VISEDICTS)
{ {
cl_visedicts[cl_numvisedicts] = ent; cl_visedicts[cl_numvisedicts] = ent;
@ -1129,7 +1107,11 @@ void CL_Init (void)
Cvar_RegisterVariable (&cl_gibfilter); Cvar_RegisterVariable (&cl_gibfilter);
Cvar_RegisterVariable (&cl_lightning_zadjust); Cvar_RegisterVariable (&cl_lightning_zadjust);
Cvar_RegisterVariable (&cl_truelightning); Cvar_RegisterVariable (&cl_truelightning);
#ifdef __PSP__
Cvar_RegisterVariable (&in_sensitivity); Cvar_RegisterVariable (&in_sensitivity);
#else
Cvar_RegisterVariable (&sensitivity);
#endif // __PSP__
Cvar_RegisterVariable (&in_mlook); //Heffo - mlook cvar Cvar_RegisterVariable (&in_mlook); //Heffo - mlook cvar
Cvar_RegisterVariable (&in_aimassist); Cvar_RegisterVariable (&in_aimassist);
Cvar_RegisterVariable (&in_tolerance); Cvar_RegisterVariable (&in_tolerance);

View File

@ -41,21 +41,9 @@ void CL_InitTEnts (void)
{ {
cl_sfx_r_exp3 = S_PrecacheSound ("sounds/weapons/r_exp3.wav"); cl_sfx_r_exp3 = S_PrecacheSound ("sounds/weapons/r_exp3.wav");
cl_sfx_step[0] = S_PrecacheSound ("sounds/player/footstep1.wav"); cl_sfx_step[0] = S_PrecacheSound ("sounds/player/footstep1.wav");
#ifdef SLIM
cl_sfx_step[1] = S_PrecacheSound ("sounds/player/footstep2.wav"); cl_sfx_step[1] = S_PrecacheSound ("sounds/player/footstep2.wav");
cl_sfx_step[2] = S_PrecacheSound ("sounds/player/footstep3.wav"); cl_sfx_step[2] = S_PrecacheSound ("sounds/player/footstep3.wav");
cl_sfx_step[3] = S_PrecacheSound ("sounds/player/footstep4.wav"); cl_sfx_step[3] = S_PrecacheSound ("sounds/player/footstep4.wav");
#else
cl_sfx_step[1] = S_PrecacheSound ("sounds/player/footstep1.wav");
cl_sfx_step[2] = S_PrecacheSound ("sounds/player/footstep1.wav");
cl_sfx_step[3] = S_PrecacheSound ("sounds/player/footstep1.wav");
#endif // SLIM
} }
/* /*
@ -421,6 +409,7 @@ void CL_UpdateTEnts (void)
if (!b->model || b->endtime < cl.time) if (!b->model || b->endtime < cl.time)
continue; continue;
#ifdef __PSP__
// if coming from the player, update the start position // if coming from the player, update the start position
if (b->entity == cl.viewentity) if (b->entity == cl.viewentity)
{ {
@ -470,14 +459,8 @@ void CL_UpdateTEnts (void)
VectorCopy(trace.endpos, b->end); VectorCopy(trace.endpos, b->end);
} }
} }
#endif // __PSP__
/*
// if coming from the player, update the start position
if (b->entity == cl.viewentity)
{
VectorCopy (cl_entities[cl.viewentity].origin, b->start);
}
*/
// calculate pitch and yaw // calculate pitch and yaw
VectorSubtract (b->end, b->start, dist); VectorSubtract (b->end, b->start, dist);

View File

@ -62,15 +62,18 @@ qboolean con_initialized;
int con_notifylines; // scan lines to clear for notify lines int con_notifylines; // scan lines to clear for notify lines
extern void M_Menu_Main_f (void);
#define MAXGAMEDIRLEN 1000 #define MAXGAMEDIRLEN 1000
char debuglogfile[MAXGAMEDIRLEN + 1]; char debuglogfile[MAXGAMEDIRLEN + 1];
extern void M_Menu_Main_f (void); #ifdef __PSP__
void M_OSK_Draw (void); void M_OSK_Draw (void);
void Con_OSK_f (char *input, char *output, int outlen); void Con_OSK_f (char *input, char *output, int outlen);
void Con_OSK_Key(int key); void Con_OSK_Key(int key);
void Con_DrawOSK(void); void Con_DrawOSK(void);
#endif // __PSP__
extern qboolean console_enabled; extern qboolean console_enabled;
/* /*
================ ================
@ -622,9 +625,12 @@ void Con_DrawConsole (int lines, qboolean drawinput)
if (drawinput) if (drawinput)
Con_DrawInput (); Con_DrawInput ();
#ifdef __PSP__
Con_DrawOSK(); Con_DrawOSK();
#endif // __PSP__
} }
#ifdef __PSP__
static qboolean scr_osk_active = false; static qboolean scr_osk_active = false;
@ -643,6 +649,7 @@ void Con_DrawOSK(void) {
M_OSK_Draw(); M_OSK_Draw();
} }
} }
#endif // __PSP__
/* /*
================== ==================

View File

@ -855,6 +855,10 @@ Host_Init
*/ */
#include "cl_slist.h" #include "cl_slist.h"
#ifdef _3DS
extern bool new3ds_flag;
#endif // _3DS
void M_Start_Menu_f (void); void M_Start_Menu_f (void);
void Host_Init (quakeparms_t *parms) void Host_Init (quakeparms_t *parms)
{ {
@ -893,7 +897,7 @@ void Host_Init (quakeparms_t *parms)
Con_Printf ("%4.1f megabyte PSP application heap \n",1.0f*PSP_HEAP_SIZE_MB); Con_Printf ("%4.1f megabyte PSP application heap \n",1.0f*PSP_HEAP_SIZE_MB);
Con_Printf ("PSP Model: %s\n", Sys_GetPSPModel()); Con_Printf ("PSP Model: %s\n", Sys_GetPSPModel());
Con_Printf ("VRAM Size: %i bytes\n", sceGeEdramGetSize()); Con_Printf ("VRAM Size: %i bytes\n", sceGeEdramGetSize());
#elif __3DS #elif _3DS
Con_Printf ("3DS NZP v%4.1f (3DSX: "__TIME__" "__DATE__")\n", (float)(VERSION)); Con_Printf ("3DS NZP v%4.1f (3DSX: "__TIME__" "__DATE__")\n", (float)(VERSION));
if (new3ds_flag) if (new3ds_flag)

View File

@ -32,3 +32,6 @@ void IN_Move (usercmd_t *cmd);
void IN_ClearStates (void); void IN_ClearStates (void);
// restores all button and position states to defaults // restores all button and position states to defaults
#ifdef _3DS
void IN_SwitchKeyboard (void);
#endif // _3DS

View File

@ -20,11 +20,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// view.c -- player eye positioning // view.c -- player eye positioning
#include "quakedef.h" #include "quakedef.h"
#include <pspgu.h> #include "r_local.h"
#ifdef PSP_VFPU #ifdef __PSP__
#include <pspgu.h>
#include <pspmath.h> #include <pspmath.h>
#endif #endif // __PSP__
sfx_t *cl_sfx_step[4]; sfx_t *cl_sfx_step[4];
@ -69,7 +70,7 @@ cvar_t v_ipitch_level = {"v_ipitch_level", "0.3", false};
cvar_t v_idlescale = {"v_idlescale", "0", false}; cvar_t v_idlescale = {"v_idlescale", "0", false};
cvar_t crosshair = {"crosshair", "0", true}; cvar_t crosshair = {"crosshair", "1", true};
float v_dmg_time, v_dmg_roll, v_dmg_pitch; float v_dmg_time, v_dmg_roll, v_dmg_pitch;
@ -579,7 +580,11 @@ void V_CalcBlend (void)
for (j=0 ; j<NUM_CSHIFTS ; j++) for (j=0 ; j<NUM_CSHIFTS ; j++)
{ {
#ifdef __PSP__
if (!r_polyblend.value) if (!r_polyblend.value)
#else
if (!gl_polyblend.value)
#endif // __PSP__
continue; continue;
a2 = cl.cshifts[j].percent / 255.0; a2 = cl.cshifts[j].percent / 255.0;