Skip to content

Commit f388f51

Browse files
authored
Merge pull request #749 from israpps/daemon
add implementation of arcade `DAEMON.IRX`
2 parents f4f80c0 + d12ea8a commit f388f51

5 files changed

Lines changed: 90 additions & 0 deletions

File tree

iop/security/daemon/Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# _____ ___ ____ ___ ____
2+
# ____| | ____| | | |____|
3+
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
4+
#-----------------------------------------------------------------------
5+
# Copyright 2001-2004, ps2dev - http://www.ps2dev.org
6+
# Licenced under Academic Free License version 2.0
7+
# Review ps2sdk README & LICENSE files for further details.
8+
9+
10+
IOP_INCS += \
11+
-I$(PS2SDKSRC)/iop/system/thbase/include \
12+
-I$(PS2SDKSRC)/iop/memorycard/mcman/include \
13+
-I$(PS2SDKSRC)/iop/system/stdio/include \
14+
-I$(PS2SDKSRC)/iop/system/intrman/include
15+
16+
IOP_OBJS = daemon.o imports.o
17+
18+
include $(PS2SDKSRC)/Defs.make
19+
include $(PS2SDKSRC)/iop/Rules.bin.make
20+
include $(PS2SDKSRC)/iop/Rules.make
21+
include $(PS2SDKSRC)/iop/Rules.release

iop/security/daemon/README.MD

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Daemon (aka: sec_checker)
2+
3+
This module, found on the bootrom of the Arcade PS2s (COH-H models and derivative units) is in charge of checking the security dongle status.
4+
5+
Arcade SYSCON has a 3 to 5 minutes countdown (time may depend on the model) to reset the console.
6+
7+
Arcade Mechacon resets this countdown when the secrAuthDongle routine is successfully completed.
8+
9+
This module setups an IOP thread that calls mcdetectcard2 (DONGLEMAN EXPORT:21) once every minute. effectively keeping the watchdog at bay, but also making access to `mc0:/` rather unstable.
10+
11+
This module is placed here just for hystorical purposes and preservation. there is (as of today) no reason to use a homebrew implementation in favor of `rom0:DAEMON`

iop/security/daemon/src/daemon.c

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#include "irx_imports.h"
2+
3+
IRX_ID("Sec_Checker", 0x1, 0x1)
4+
5+
void sec_checker(void) {
6+
int x;
7+
printf("check card routine start\n");
8+
do {
9+
McDetectCard2(0,0);
10+
x = 0x3c;
11+
while (0 < x) {
12+
DelayThread(1000000);
13+
x--;
14+
}
15+
} while ( 1 );
16+
17+
}
18+
19+
//Original debug symbol: `start`
20+
int _start() {
21+
iop_thread_t sec_thread;
22+
int thid, bVar1;
23+
CpuEnableIntr();
24+
sec_thread.attr = TH_C;
25+
sec_thread.thread = sec_checker;
26+
sec_thread.priority = LOWEST_PRIORITY;
27+
sec_thread.stacksize = 0x800;
28+
sec_thread.option = 0;
29+
thid = CreateThread(&sec_thread);
30+
bVar1 = thid < 1;
31+
if (!bVar1)
32+
StartThread(thid,0);
33+
return bVar1;
34+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
xmcman_IMPORTS_start
2+
//Debug Symbol: mciConfInsert
3+
I_McDetectCard2
4+
xmcman_IMPORTS_end
5+
6+
intrman_IMPORTS_start
7+
I_CpuEnableIntr
8+
intrman_IMPORTS_end
9+
10+
stdio_IMPORTS_start
11+
I_printf
12+
stdio_IMPORTS_end
13+
14+
thbase_IMPORTS_start
15+
I_CreateThread
16+
I_StartThread
17+
I_DelayThread
18+
thbase_IMPORTS_end
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include <irx.h>
2+
3+
#include <mcman.h>
4+
#include <intrman.h>
5+
#include <stdio.h>
6+
#include <thbase.h>

0 commit comments

Comments
 (0)