mgh: fix for default HDD DMA mode, that wasn't correctly set
[open-ps2-loader.git] / ee_core / include / padhook.h
blobb728ea3292100b17945279c9951009bd40ed3696
1 /*
2 padhook.h Open PS2 Loader In Game Reset
4 Copyright 2009-2010, Ifcaro, jimmikaelkael & Polo
5 Copyright 2006-2008 Polo
6 Licenced under Academic Free License version 3.0
7 Review OpenUsbLd README & LICENSE files for further details.
9 SPU definitions taken from PS2SDK freesd.
10 Copyright (c) 2004 TyRaNiD <tiraniddo@hotmail.com>
11 Copyright (c) 2004,2007 Lukasz Bruun <mail@lukasz.dk>
14 #ifndef PADHOOK_H
15 #define PADHOOK_H
17 #include <tamtypes.h>
19 #define PADOPEN_HOOK 0
20 #define PADOPEN_CHECK 1
22 int Install_PadOpen_Hook(u32 mem_start, u32 mem_end, int mode);
25 // DEV9 Registers
26 #define DEV9_R_1460 ((volatile u16*)0xBF801460)
27 #define DEV9_R_1464 ((volatile u16*)0xBF801464)
28 #define DEV9_R_1466 ((volatile u16*)0xBF801466)
29 #define DEV9_R_146C ((volatile u16*)0xBF80146C)
30 #define DEV9_R_146E ((volatile u16*)0xBF80146E)
31 #define DEV9_R_1474 ((volatile u16*)0xBF801474)
34 // CDVD Registers
35 #define CDVD_R_NDIN ((volatile u8*)0xBF402005)
36 #define CDVD_R_POFF ((volatile u8*)0xBF402008)
37 #define CDVD_R_SCMD ((volatile u8*)0xBF402016)
38 #define CDVD_R_SDIN ((volatile u8*)0xBF402017)
41 typedef struct {
42 u32 option;
43 int port;
44 int slot;
45 int number;
46 u8 name[16];
47 } pad2socketparam_t;
49 typedef struct {
50 int libpad;
51 u8 *pad_buf;
52 int vb_count;
53 int pos_combo1;
54 int pos_combo2;
55 int pos_state;
56 int pos_frame;
57 u8 combo_type;
58 u8 prev_frame;
59 } paddata_t;
61 typedef struct {
62 int press;
63 int vb_count;
64 } powerbuttondata_t;
66 typedef struct {
67 u32 *pattern;
68 u32 *mask;
69 int size;
70 int version;
71 } pattern_t;
73 #define IGR_LIBPAD_V1 1
74 #define IGR_LIBPAD_V2 2
76 #define IGR_PAD_STABLE_V1 0x06
77 #define IGR_PAD_STABLE_V2 0x01
79 #define IGR_COMBO_R1_L1_R2_L2 0xF0
80 #define IGR_COMBO_START_SELECT 0xF6
81 #define IGR_COMBO_R3_L3 0xF9
83 #define NB_PADOPEN_PATTERN 7
85 #endif