|
|
| version 1.1.1.1, 2003/10/16 17:58:46 | version 1.4, 2004/02/13 20:31:55 |
|---|---|
| Line 2 | Line 2 |
| #include "np2.h" | #include "np2.h" |
| #include "joymng.h" | #include "joymng.h" |
| #include "menu.h" | #include "menu.h" |
| #include "pccore.h" | |
| static int joyactive = 0; | enum { |
| static BYTE joyflag = 0xff; | JOY_LEFT_BIT = 0x04, |
| JOY_RIGHT_BIT = 0x08, | |
| JOY_UP_BIT = 0x01, | |
| JOY_DOWN_BIT = 0x02, | |
| JOY_BTN1_BIT = 0x10, | |
| JOY_BTN2_BIT = 0x20 | |
| }; | |
| #define JOY_LEFT_BIT 0x04 | static REG8 joyflag = 0xff; |
| #define JOY_RIGHT_BIT 0x08 | static BYTE joypad1btn[4]; |
| #define JOY_UP_BIT 0x01 | |
| #define JOY_DOWN_BIT 0x02 | |
| #define JOY_BTN1_BIT 0x10 | |
| #define JOY_BTN2_BIT 0x20 | |
| static BYTE joypad1btn[4]; // ver0.28 | |
| void joy_init(void) { | void joymng_initialize(void) { |
| JOYINFO ji; | JOYINFO ji; |
| int i; | int i; |
| if ((!joyGetNumDevs()) || | if ((!joyGetNumDevs()) || |
| (joyGetPos(JOYSTICKID1, &ji) == JOYERR_UNPLUGGED)) { | (joyGetPos(JOYSTICKID1, &ji) == JOYERR_UNPLUGGED)) { |
| // xmenu_setjoystick(np2cfg.JOYSTICK | 2); // ver0.28 | |
| np2oscfg.JOYPAD1 |= 2; | np2oscfg.JOYPAD1 |= 2; |
| } | } |
| for (i=0; i<4; i++) { // ver0.28 | for (i=0; i<4; i++) { |
| joypad1btn[i] = 0xff ^ | joypad1btn[i] = 0xff ^ |
| ((np2oscfg.JOY1BTN[i] & 3) << ((np2oscfg.JOY1BTN[i] & 4)?4:6)); | ((np2oscfg.JOY1BTN[i] & 3) << ((np2oscfg.JOY1BTN[i] & 4)?4:6)); |
| } | } |
| } | } |
| void joy_flash(void) { | void joymng_sync(void) { |
| np2oscfg.JOYPAD1 &= 0x7f; | np2oscfg.JOYPAD1 &= 0x7f; |
| joyflag = 0xff; | joyflag = 0xff; |
| } | } |
| BYTE joymng_getstat(void) { | REG8 joymng_getstat(void) { |
| JOYINFO ji; | JOYINFO ji; |