Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
*.s

# folders where object files and embedded stuff is dumped
src/
asm/

#other non desired files
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"osdhistory.h": "c",
"ps2_sio2man_driver.h": "c",
"fcntl.h": "c",
"siocookie.h": "c"
"siocookie.h": "c",
"xparam.h": "c"
}
}
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export HEADER
HAS_LOCAL_IRX = 1 # whether to embed or not non vital IRX (wich will be loaded from memcard files)
DEBUG ?= 0
PSX ?= 0 # PSX DESR support
XPARAM ?= 0 # whether to include or not support for managing the DECKARD compatiblity modes when running discs
PROHBIT_DVD_0100 ?= 0 # prohibit the DVD Players v1.00 and v1.01 from being booted.
XCDVD_READKEY ?= 0 # Enable the newer sceCdReadKey checks, which are only supported by a newer CDVDMAN module.
USE_ROM_PADMAN ?= 1
Expand Down Expand Up @@ -56,7 +57,7 @@ EE_OBJS = main.o \
util.o elf.o timer.o ps2.o ps1.o dvdplayer.o \
modelname.o libcdvd_add.o OSDHistory.o OSDInit.o OSDConfig.o \
$(EMBEDDED_STUFF) \
$(IOP_OBJS)
$(IOP_OBJS)

EMBEDDED_STUFF = icon_sys_A.o icon_sys_J.o icon_sys_C.o

Expand Down Expand Up @@ -118,6 +119,14 @@ ifneq ($(HAS_LOCAL_IRX), 1)
EE_CFLAGS += -DHAS_EMBEDDED_IRX
endif

ifeq ($(XPARAM), 1)
EE_OBJS += xparam.o
EE_CFLAGS += -DXPARAM
ifeq ($(HDD), 1)
$(warning --- XPARAM and HDD support enabled. consoles wich have HDD support cannot benefit from XPARAM and vice versa)
endif
endif

ifeq ($(DUMMY_TIMEZONE), 1)
EE_CFLAGS += -DDUMMY_TIMEZONE
endif
Expand Down
34 changes: 34 additions & 0 deletions include/xparam.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
#
# DECKARD Configs
#--------------------------
# Copyright 2023 krat0s.
#
*/

#include <tamtypes.h>
#define GM_IOP_TYPE (0x80000000)

#define PARAM_MDEC_DELAY_CYCLE (0x00)
#define PARAM_SPU_INT_DELAY_LIMIT (0x01)
#define PARAM_SPU_INT_DELAY_PPC_COEFF (0x02)
#define PARAM_SPU2_INT_DELAY_LIMIT (0x03)
#define PARAM_SPU2_INT_DELAY_PPC_COEFF (0x04)
#define PARAM_DMAC_CH10_INT_DELAY (0x05)
#define PARAM_CPU_DELAY (0x06)
#define PARAM_SPU_DMA_WAIT_LIMIT (0x07)
#define PARAM_GPU_DMA_WAIT_LIMIT (0x08)
#define PARAM_DMAC_CH10_INT_DELAY_DPC (0x09)
#define PARAM_CPU_DELAY_DPC (0x0A)
#define PARAM_USB_DELAYED_INT_ENABLE (0x0B)
#define PARAM_TIMER_LOAD_DELAY (0x0C)
#define PARAM_SIO0_DTR_SCK_DELAY (0x0D)
#define PARAM_SIO0_DSR_SCK_DELAY_C (0x0E)
#define PARAM_SIO0_DSR_SCK_DELAY_M (0x0F)
#define PARAM_MIPS_DCACHE_ON (0x10)
#define PARAM_CACHE_FLASH_CHANNELS (0x11)

#define GM_IF ((vu32 *)0x1F801450)

void ResetDeckardXParams();
void ApplyDeckardXParam(const char *title);
5 changes: 5 additions & 0 deletions src/OSDHistory.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ static u16 GetTimestamp(void)
static void AddHistoryRecord(const char *name)
{
DPRINTF("%s: start\n", __func__);
if (name == NULL)
{
DPRINTF("GAME ID IS NULL, ABORTING.\n");
return;
}
int i, value, LeastUsedRecord, LeastUsedRecordLaunchCount, LeastUsedRecordTimestamp, NewLaunchCount;
u8 BlankSlotList[MAX_HISTORY_ENTRIES];
int IsNewRecord;
Expand Down
8 changes: 7 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
#include "modelname.h"
#include "banner.h"

#ifdef XPARAM
#include "xparam.h"
#endif

#ifdef PSX
#include <iopcontrol_special.h>
#include "psx/plibcdvd_add.h"
Expand Down Expand Up @@ -214,7 +218,9 @@ int main(int argc, char *argv[])
break;
}
} while ((STAT & 0x80) || (result == 0));

#ifdef XPARAM
ResetDeckardXParams();
#endif
// Remember to set the video output option (RGB or Y Cb/Pb Cr/Pr) accordingly, before SetGsCrt() is called.
DPRINTF("Setting vmode\n");
SetGsVParam(OSDConfigGetVideoOutput() == VIDEO_OUTPUT_RGB ? VIDEO_OUTPUT_RGB : VIDEO_OUTPUT_COMPONENT);
Expand Down
9 changes: 8 additions & 1 deletion src/ps2.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
#include "ps2.h"
#include "OSDInit.h"
#include "OSDHistory.h"
#ifdef XPARAM
#include "xparam.h"
#endif
#include "debugprintf.h"

void CleanUp(void);
Expand Down Expand Up @@ -301,7 +304,11 @@ int PS2DiscBoot(int skip_PS2LOGO)
DPRINTF("%s updating play history\n", __func__);
DPRINTF("%s:\n\tline:[%s]\n\tps2discboot:[%s]\n", __func__, line, ps2disc_boot);
UpdatePlayHistory(ps2disc_boot);


#ifdef XPARAM
ApplyDeckardXParam(ps2disc_boot);
#endif

CleanUp();
SifExitCmd();
if (skip_PS2LOGO) {
Expand Down
Loading