Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add xparam module #651

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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: 1 addition & 0 deletions iop/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ SUBDIRS = \
arcade \
cdvd \
debug \
deckard \
dev9 \
dvrp \
fs \
Expand Down
13 changes: 13 additions & 0 deletions iop/deckard/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# _____ ___ ____ ___ ____
# ____| | ____| | | |____|
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
#-----------------------------------------------------------------------
# Copyright 2001-2024, ps2dev - http://www.ps2dev.org
# Licenced under Academic Free License version 2.0
# Review ps2sdk README & LICENSE files for further details.

SUBDIRS = \
xparam

include $(PS2SDKSRC)/Defs.make
include $(PS2SDKSRC)/Rules.make
27 changes: 27 additions & 0 deletions iop/deckard/xparam/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# _____ ___ ____ ___ ____
# ____| | ____| | | |____|
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
#-----------------------------------------------------------------------
# Copyright 2001-2024, ps2dev - http://www.ps2dev.org
# Licenced under Academic Free License version 2.0
# Review ps2sdk README & LICENSE files for further details.

IOP_BIN = xparam.irx
DATABASE ?= 0#0: Homebrew, 1: ROM 2.20, 2: ROM 2.50

IOP_OBJS = xparam.o imports.o

ifeq ($(DATABASE),0)
IOP_OBJS += database_merged.o
else ifeq ($(DATABASE),1)
IOP_OBJS += database_0220_20050620.o
else ifeq ($(DATABASE),2)
IOP_OBJS += database_0250_20100415.o
else
$(error Unknown DB value)
endif

include $(PS2SDKSRC)/Defs.make
include $(PS2SDKSRC)/iop/Rules.bin.make
include $(PS2SDKSRC)/iop/Rules.make
include $(PS2SDKSRC)/iop/Rules.release
38 changes: 38 additions & 0 deletions iop/deckard/xparam/include/xparam.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#ifndef XPARAM_H
#define XPARAM_H

#include <stdint.h>

typedef enum xparam_types {
PARAM_MDEC_DELAY_CYCLE = (0x00),
PARAM_SPU_INT_DELAY_LIMIT = (0x01),
PARAM_SPU_INT_DELAY_PPC_COEFF = (0x02),
PARAM_SPU2_INT_DELAY_LIMIT = (0x03),
PARAM_SPU2_INT_DELAY_PPC_COEFF = (0x04),
PARAM_DMAC_CH10_INT_DELAY = (0x05),
PARAM_CPU_DELAY = (0x06),
PARAM_SPU_DMA_WAIT_LIMIT = (0x07),
PARAM_GPU_DMA_WAIT_LIMIT = (0x08),
PARAM_DMAC_CH10_INT_DELAY_DPC = (0x09),
PARAM_CPU_DELAY_DPC = (0x0A),
PARAM_USB_DELAYED_INT_ENABLE = (0x0B),
PARAM_TIMER_LOAD_DELAY = (0x0C),
PARAM_SIO0_DTR_SCK_DELAY = (0x0D),
PARAM_SIO0_DSR_SCK_DELAY_C = (0x0E),
PARAM_SIO0_DSR_SCK_DELAY_M = (0x0F),
PARAM_MIPS_DCACHE_ON = (0x10),
PARAM_CACHE_FLASH_CHANNELS = (0x11)
} xparam_types_t;
#define XPARAM_PARAMS_AMMOUNT (PARAM_CACHE_FLASH_CHANNELS+1)

typedef struct xparam {
char name[12];
uint32_t param;
uint32_t value;
} xparam_t;

extern const xparam_t XPARAMS[];

#define GET_XPARAM_DB_SIZE() (sizeof(*XPARAMS) / sizeof(XPARAMS[0]))

#endif
Loading