Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
AKuHAK committed Jun 15, 2021
1 parent bf188db commit ba66e70
Show file tree
Hide file tree
Showing 146 changed files with 1,911 additions and 1,919 deletions.
20 changes: 10 additions & 10 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Copyright 2013, Ifcaro & jimmikaelkael
Licenced under Academic Free License version 3.0
Review OpenUsbLd README & LICENSE files for further details.

-----------------------------------------------------------------------------

=== Changelog ===
Expand Down Expand Up @@ -77,7 +77,7 @@ CORE:

* Merged OPL/OPLGSM codebase
* GSM Core 0.36.R - don't worry; 0.38 will be coming back better than ever!
* GSM Core no longer supports 576p, 1080p, Skip FMVs - this is temporary.
* GSM Core no longer supports 576p, 1080p, Skip FMVs - this is temporary.
* GSM Core is now IGR and CodeBreaker/PS2rd compatible!
* GSM no longer included in Childproof builds.
* Unified Makefile builds from single source tree via "GSM=0/1" argument (ala VMC/No VMC)
Expand All @@ -87,32 +87,32 @@ CORE:
* Added power-off processing code. Games should be able to power-off the console now.
* Optimzed CDVDMAN and CDVDFSV
* Support for PSX (DVR) units
* Built-in TLB reinitialization mechanism - no more EECORE hooking and patching.
* Built-in TLB reinitialization mechanism - no more EECORE hooking and patching.
* Added compatibility mode 7 - "IOP Threading Hack".
* Replaced SMAP driver.
* Modified SMSTCPIP.
* Ported a version of ETH Mode types from doctorxyz's OPLGSM.
* Retired the built-in kernel update for Protokernel consoles (SCPH-10000 and SCPH-15000).

GUI:
GUI:

* New "Show GSM on Main Menu" toggle in "Settings" (GSM Builds Only)
* New "GSM Settings" on Main Menu - easier navigation! (GSM Builds Only)
* Fixed issue with HDLSERV and GSM Settings not showing up immediately.
* Full Ethernet controls - can disable Auto-Negotiation and force a mode.
* Full Ethernet controls - can disable Auto-Negotiation and force a mode.
* Some things were are worded differently as less words carry more freight.
* Removed redundant UDMA modes - PS2 will never handle UDMA 5 and UDMA 6.
* Updated SMB support to give better error messages.
* Network error codes changed slightly - 300 for connection errors, 301 for logon errors, 302 for ECHO isalive
* Updated SMB support to give better error messages.
* Network error codes changed slightly - 300 for connection errors, 301 for logon errors, 302 for ECHO isalive
test failing, and 303 for share opening errors.

COMPATIBILITY:

COMPATIBILITY:

* Kingdom Hearts 2 Final Mix (Gummi Fix)
* Baldar's Gate Series (HDD)
* Champions of Norrath (HDD)
* New Mode 7 fixes stuttering with games such as DDR and Pop'N Music (HDD ONLY!)
* New Mode 7 fixes stuttering with games such as DDR and Pop'N Music (HDD ONLY!)

==== Version 0.9 ====

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ of such entity.
restricted or conditioned by this License or by law, and Licensor promises not
to interfere with or be responsible for such uses by You.

16) Modification of This License. This License is Copyright � 2005 Lawrence
16) Modification of This License. This License is Copyright � 2005 Lawrence
Rosen. Permission is granted to copy, distribute, or communicate this License
without modification. Nothing in this License permits You to modify this
License as applied to the Original Work or to Derivative Works. However, You
Expand Down
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Open PS2 Loader

Copyright 2013, Ifcaro & jimmikaelkael
Licenced under Academic Free License version 3.0
Review LICENSE file for further details.
Copyright 2013, Ifcaro & jimmikaelkael
Licenced under Academic Free License version 3.0
Review LICENSE file for further details.

[![CI](https://github.com/ifcaro/Open-PS2-Loader/workflows/CI/badge.svg)](https://github.com/ifcaro/Open-PS2-Loader/actions?query=workflow%3ACI)

Expand All @@ -12,27 +12,27 @@ Open PS2 Loader (OPL) is a 100% Open source game and application loader for
the PS2 and PS3 units. It supports three categories of devices : USB mass
storage devices, SMB shares and the PlayStation 2 HDD unit. USB devices and
SMB shares support USBExtreme and \*.ISO formats while PS2 HDD supports HDLoader
format. It's now the most compatible homebrew loader.
format. It's now the most compatible homebrew loader.

OPL is also developed continuously - anyone can contribute improvements to
the project due to its open source nature.
the project due to its open source nature.

You can visit the Open PS2 Loader forum at:
You can visit the Open PS2 Loader forum at:

https://www.psx-place.com/forums/open-ps2-loader-opl.77/

You can report compatibility game problems at:

https://www.psx-place.com/threads/open-ps2-loader-game-bug-reports.19401/

For updated compatibility list, you can visit OPL-CL site at:
For updated compatibility list, you can visit OPL-CL site at:

http://sx.sytes.net/oplcl/games.aspx
http://sx.sytes.net/oplcl/games.aspx

## Release types

Open PS2 Loader bundle included several types of the same OPL version. These
types come with more or less features included.
types come with more or less features included.

| Type (can be a combination) | Description |
| --------------------------- | ---------------------------------------------------------------------------------------------- |
Expand All @@ -45,7 +45,7 @@ types come with more or less features included.
## How to use

OPL uses the following directory tree structure across HDD, SMB, and
USB modes:
USB modes:

| Folder | Description | Modes |
| ------ | ----------- | ----- |
Expand All @@ -60,19 +60,19 @@ USB modes:

OPL will automatically create the above directory structure the first time
you launch it and enable your favourite device. For HDD users, a 128Mb +OPL
partition will be created (you can enlarge it using uLaunchELF if you need to).
partition will be created (you can enlarge it using uLaunchELF if you need to).

## USB

Game files on USB must be perfectly defragmented either file by file or
by whole drive, and Dual Layer DVD9 images must be split to avoid the 4GB
limitations of the FAT32 file system. We recommend Auslogics Disk Defrag
for best defragging results.
for best defragging results.

http://www.auslogics.com/en/software/disk-defrag/
http://www.auslogics.com/en/software/disk-defrag/

You also need a PC program to convert or split games into USB Advance/Extreme
format, such as USBUtil 2.0.
format, such as USBUtil 2.0.

## SMB

Expand All @@ -81,36 +81,36 @@ on the host machine or NAS device and make sure that it has full read and
write permissions. USB Advance/Extreme format is optional - \*.ISO images
are supported using the folder structure above with the added bonus that
DVD9 images don't have to be split if your SMB device uses the NTFS or
EXT3/4 file system.
EXT3/4 file system.

## HDD

For PS2, 48-bit LBA internal HDDs up to 2TB are supported. They have to be
formatted with either HDLoader or uLaunchELF (uLaunchELF is recommended).
formatted with either HDLoader or uLaunchELF (uLaunchELF is recommended).

To launch OPL, you can use any of the existing methods for loading an
executable elf.
executable elf.

## PS3

On PS3, you need an original SwapMagic 3.6+ or 3.8 disc (at the moment
there aren't any other options). The steps for loading OPL on a PS3 are:
there aren't any other options). The steps for loading OPL on a PS3 are:

1. Rename OPNPS2LD.ELF to SMBOOT0.ELF
2. Make a folder in root of USB device called SWAPMAGIC and copy SMBOOT0.ELF to it.
3. Launch SwapMagic in PS3 and press UP+L1 then Open PS2 Loader should start.

There are 4 forms for launching elfs in SwapMagic.
There are 4 forms for launching elfs in SwapMagic.

SMBOOT0.ELF = UP + L1
SMBOOT1.ELF = UP + L2
SMBOOT2.ELF = UP + R1
SMBOOT3.ELF = UP + R2
SMBOOT0.ELF = UP + L1
SMBOOT1.ELF = UP + L2
SMBOOT2.ELF = UP + R1
SMBOOT3.ELF = UP + R2

Note: on PS3, only USB and SMB modes are supported.
Note: on PS3, only USB and SMB modes are supported.

## Some notes for devs

Open PS2 Loader needs the latest PS2SDK:
Open PS2 Loader needs the latest PS2SDK:

https://github.com/ps2dev/ps2sdk
4 changes: 2 additions & 2 deletions ee_core/include/cheat_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
#ifndef _CHEATENGINE_H_
#define _CHEATENGINE_H_

#define MAX_HOOKS 5
#define MAX_CODES 250
#define MAX_HOOKS 5
#define MAX_CODES 250
#define MAX_CHEATLIST (MAX_HOOKS * 2 + MAX_CODES * 2)

extern void (*Old_SetupThread)(void *gp, void *stack, s32 stack_size, void *args, void *root_func);
Expand Down
2 changes: 1 addition & 1 deletion ee_core/include/ee_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#ifdef __EESIO_DEBUG
#include <sio.h>
#define DPRINTF(args...) sio_printf(args)
#define DINIT() sio_init(38400, 0, 0, 0, 0)
#define DINIT() sio_init(38400, 0, 0, 0, 0)
#else
#define DPRINTF(args...) \
do { \
Expand Down
66 changes: 33 additions & 33 deletions ee_core/include/igs_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,30 +33,30 @@
#include <stdio.h>

#define GS_BITBLTBUF 0x50
#define GS_TRXPOS 0x51
#define GS_TRXREG 0x52
#define GS_TRXDIR 0x53
#define GS_FINISH 0x61
#define GS_TRXPOS 0x51
#define GS_TRXREG 0x52
#define GS_TRXDIR 0x53
#define GS_FINISH 0x61

//Pixel storage format
#define GS_PSM_CT32 0x00 //32 bits = 4 bytes Example: SLUS_202.73 (Namco Museum 50th Anniversary)
#define GS_PSM_CT24 0x01 //24 bits = 3 bytes Example: SLPS_250.88 (Final Fantasy X International)
#define GS_PSM_CT16 0x02 //16 bits = 2 bytes Example: SLUS_215.56 (Konami Kids Playground: Dinosaurs Shapes & Colors)
#define GS_PSM_CT32 0x00 //32 bits = 4 bytes Example: SLUS_202.73 (Namco Museum 50th Anniversary)
#define GS_PSM_CT24 0x01 //24 bits = 3 bytes Example: SLPS_250.88 (Final Fantasy X International)
#define GS_PSM_CT16 0x02 //16 bits = 2 bytes Example: SLUS_215.56 (Konami Kids Playground: Dinosaurs Shapes & Colors)
#define GS_PSM_CT16S 0x0A //16 bits = 2 bytes Example: SLUS_215.41 (Ratatouille)

//Channel #1 (VIF1)
#define GS_VIF1_STAT ((volatile u32 *)(0x10003c00)) // VIF Status Register
#define GS_VIF1_STAT_FDR (1 << 23) // VIF1-FIFO transfer direction: VIF1 -> Main memory/SPRAM"
#define GS_VIF1_STAT ((volatile u32 *)(0x10003c00)) // VIF Status Register
#define GS_VIF1_STAT_FDR (1 << 23) // VIF1-FIFO transfer direction: VIF1 -> Main memory/SPRAM"
#define GS_VIF1_MSKPATH3(mask) ((u32)(mask) | ((u32)0x06 << 24))
#define GS_VIF1_NOP 0
#define GS_VIF1_FLUSHA (((u32)0x13 << 24))
#define GS_VIF1_DIRECT(count) ((u32)(count) | ((u32)(0x50) << 24))
#define GS_VIF1_FIFO ((volatile u128 *)(0x10005000))
#define GS_VIF1_NOP 0
#define GS_VIF1_FLUSHA (((u32)0x13 << 24))
#define GS_VIF1_DIRECT(count) ((u32)(count) | ((u32)(0x50) << 24))
#define GS_VIF1_FIFO ((volatile u128 *)(0x10005000))

//DMA CH1 REGISTERS (Linked to VIF1)
#define GS_D1_CHCR ((volatile u32 *)(0x10009000))
#define GS_D1_MADR ((volatile u32 *)(0x10009010))
#define GS_D1_QWC ((volatile u32 *)(0x10009020))
#define GS_D1_QWC ((volatile u32 *)(0x10009020))
#define GS_D1_TADR ((volatile u32 *)(0x10009030))
#define GS_D1_ASR0 ((volatile u32 *)(0x10009040))
#define GS_D1_ASR1 ((volatile u32 *)(0x10009050))
Expand Down Expand Up @@ -89,29 +89,29 @@
#define GS_GSTRXDIR_SET(xdr) ((u64)(xdr))

#define GS_GSBITBLTBUF 0x50
#define GS_GSFINISH 0x61
#define GS_GSTRXPOS 0x51
#define GS_GSTRXREG 0x52
#define GS_GSTRXDIR 0x53
#define GS_GSFINISH 0x61
#define GS_GSTRXPOS 0x51
#define GS_GSTRXREG 0x52
#define GS_GSTRXDIR 0x53

//GS Priviledge Registers
#define GS_CSR_FINISH (1 << 1)
#define GS_CSR (volatile u64 *)0x12001000 // GS CSR (GS System Status) Register
#define GS_IMR (volatile u64 *)0x12001010 // GS IMR (GS Interrupt Mask) Register
#define GS_BUSDIR (volatile u64 *)0x12001040 // GS BUSDIR (GS Bus Direction) Register

#define GET_PMODE_EN1(x) (u8)((x >> 0) & 0x1)
#define GET_PMODE_EN2(x) (u8)((x >> 1) & 0x1)
#define GET_SMODE2_INT(x) (u8)((x >> 0) & 0x1)
#define GET_SMODE2_FFMD(x) (u8)((x >> 1) & 0x1)
#define GET_SMODE2_DPMS(x) (u8)((x >> 2) & 0x3)
#define GS_CSR (volatile u64 *)0x12001000 // GS CSR (GS System Status) Register
#define GS_IMR (volatile u64 *)0x12001010 // GS IMR (GS Interrupt Mask) Register
#define GS_BUSDIR (volatile u64 *)0x12001040 // GS BUSDIR (GS Bus Direction) Register

#define GET_PMODE_EN1(x) (u8)((x >> 0) & 0x1)
#define GET_PMODE_EN2(x) (u8)((x >> 1) & 0x1)
#define GET_SMODE2_INT(x) (u8)((x >> 0) & 0x1)
#define GET_SMODE2_FFMD(x) (u8)((x >> 1) & 0x1)
#define GET_SMODE2_DPMS(x) (u8)((x >> 2) & 0x3)
#define GET_SMODE2_INTFFMD(x) (u8)((x >> 0) & 0x3)
#define GET_DISPFB_FBP(x) (u16)((x >> 0) & 0x1FF)
#define GET_DISPFB_FBW(x) (u8)((x >> 9) & 0x3F)
#define GET_DISPFB_PSM(x) (u8)((x >> 15) & 0x1F)
#define GET_DISPFB_DBX(x) (u16)((x >> 32) & 0x7FF)
#define GET_DISPFB_DBY(x) (u16)((x >> 43) & 0x7FF)
#define GET_DISPLAY_DH(x) (u16)((x >> 44) & 0x7FF)
#define GET_DISPFB_FBP(x) (u16)((x >> 0) & 0x1FF)
#define GET_DISPFB_FBW(x) (u8)((x >> 9) & 0x3F)
#define GET_DISPFB_PSM(x) (u8)((x >> 15) & 0x1F)
#define GET_DISPFB_DBX(x) (u16)((x >> 32) & 0x7FF)
#define GET_DISPFB_DBY(x) (u16)((x >> 43) & 0x7FF)
#define GET_DISPLAY_DH(x) (u16)((x >> 44) & 0x7FF)

#define GS_WRITEBACK_DCACHE 0

Expand Down
2 changes: 1 addition & 1 deletion ee_core/include/modmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define MODMGR_H

#define LF_PATH_MAX 252
#define LF_ARG_MAX 252
#define LF_ARG_MAX 252

enum _lf_functions {
LF_F_MOD_LOAD = 0,
Expand Down
4 changes: 2 additions & 2 deletions ee_core/include/modules.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ typedef struct
} irxtab_t;

//Macros for working with module information.
#define GET_OPL_MOD_ID(x) ((x) >> 24)
#define SET_OPL_MOD_ID(x) ((x) << 24)
#define GET_OPL_MOD_ID(x) ((x) >> 24)
#define SET_OPL_MOD_ID(x) ((x) << 24)
#define GET_OPL_MOD_SIZE(x) ((x)&0x00FFFFFF)
12 changes: 6 additions & 6 deletions ee_core/include/padhook.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include <tamtypes.h>

#define PADOPEN_HOOK 0
#define PADOPEN_HOOK 0
#define PADOPEN_CHECK 1

int Install_PadOpen_Hook(u32 mem_start, u32 mem_end, int mode);
Expand Down Expand Up @@ -80,16 +80,16 @@ typedef struct
} pattern_t;

#define IGR_LIBPAD_NONE 0 //libpad not found
#define IGR_LIBPAD 1
#define IGR_LIBPAD2 2
#define IGR_LIBPAD 1
#define IGR_LIBPAD2 2

#define IGR_PAD_STABLE_V1 0x06
#define IGR_PAD_STABLE_V2 0x01

#define IGR_COMBO_R1_L1_R2_L2 0xF0
#define IGR_COMBO_R1_L1_R2_L2 0xF0
#define IGR_COMBO_START_SELECT 0xF6
#define IGR_COMBO_R3_L3 0xF9
#define IGR_COMBO_UP 0xEF
#define IGR_COMBO_R3_L3 0xF9
#define IGR_COMBO_UP 0xEF

#define NB_PADOPEN_PATTERN 7

Expand Down
4 changes: 2 additions & 2 deletions ee_core/linkfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
Copyright 2006-2008 Polo
Licenced under Academic Free License version 3.0
Review OPNPS2LD README & LICENSE files for further details.

Copyright 2001-2004, ps2dev - http://www.ps2dev.org
Licenced under Academic Free License version 2.0
Review ps2sdk README & LICENSE files for further details.

Standard linkfile
*/

Expand Down
2 changes: 1 addition & 1 deletion ee_core/src/cheat_engine.S
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ HookSetupThread:
/* jump to original SetupThread() */
lw $t1, Old_SetupThread # $t1 -> original SetupThread function
j $t1
nop
nop
.end HookSetupThread

/*******************************************************************************
Expand Down
4 changes: 2 additions & 2 deletions ee_core/src/gsm_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
#include "dve_reg.h"

#define MAKE_J(func) (u32)((0x02 << 26) | (((u32)func) / 4)) // Jump (MIPS instruction)
#define NOP 0x00000000 // No Operation (MIPS instruction)
#define NOP 0x00000000 // No Operation (MIPS instruction)

extern void (*Old_SetGsCrt)(short int interlace, short int mode, short int ffmd);

// Taken from gsKit
// NTSC
#define GS_MODE_NTSC 0x02
// PAL
#define GS_MODE_PAL 0x03
#define GS_MODE_PAL 0x03

struct GSMDestSetGsCrt
{
Expand Down
Loading

0 comments on commit ba66e70

Please sign in to comment.