Skip to content

Commit d2e81fa

Browse files
authored
Allow disc stop at startup (#40)
I want to eventually revisit my file layout on release package, in the meantime, this feature is not exposed to public builds but can be locally compiled by adding `DISC_STOP_AT_BOOT=1` into the make command
1 parent 22db55d commit d2e81fa

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.github/workflows/CI.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ jobs:
7171
- name: Compile PSX MMCE build
7272
run: |
7373
make release COMMIT_HASH=${GITHUB_SHA::7} BINDIR=PSX_MMCE/ PSX=1 MMCE=1 ${{ env.DEBUG }} PRINTF=${{ github.event.inputs.name }}
74-
7574
- name: list
7675
run: |
7776
git ls-files -i --exclude-standard -c

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ XCDVD_READKEY ?= 0 # Enable the newer sceCdReadKey checks, which are only suppor
2222
UDPTTY ?= 0 # printf over UDP
2323
PPCTTY ?= 0 # printf over PowerPC UART
2424
PRINTF ?= NONE
25+
DISC_STOP_AT_BOOT ?= 0
2526

2627
HOMEBREW_IRX ?= 0 # if we need homebrew SIO2MAN, MCMAN, MCSERV & PADMAN embedded, else, builtin console drivers are used
2728
FILEXIO_NEED ?= 0 # if we need filexio and imanx loaded for other features (HDD, mx4sio, etc)
@@ -77,6 +78,10 @@ ifneq ($(VERBOSE), 1)
7778
.SILENT:
7879
endif
7980

81+
ifeq ($(DISC_STOP_AT_BOOT), 1)
82+
EE_CFLAGS += -DDISC_STOP_AT_BOOT
83+
endif
84+
8085
ifeq ($(MX4SIO), 1)
8186
HOMEBREW_IRX = 1
8287
FILEXIO_NEED = 1

src/main.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,12 @@ int main(int argc, char *argv[])
4444
DPRINTF("disabling MODLOAD device blacklist/whitelist\n");
4545
sbv_patch_disable_prefix_check(); /* disable the MODLOAD module black/white list, allowing executables to be freely loaded from any device. */
4646

47+
#ifdef DISC_STOP_AT_BOOT
48+
sceCdStop();
49+
sceCdSync(0);
50+
#endif
4751
#ifdef PPCTTY
48-
//no error handling bc nothing to do in this case
49-
SifExecModuleBuffer(ppctty_irx, size_ppctty_irx, 0, NULL, NULL);
52+
SifExecModuleBuffer(ppctty_irx, size_ppctty_irx, 0, NULL, NULL);//no error handling bc nothing to do in this case
5053
#endif
5154
#ifdef UDPTTY
5255
if (loadDEV9())

0 commit comments

Comments
 (0)