From e77060458a3517baba44d0ce2efa0b3a6756c07c Mon Sep 17 00:00:00 2001 From: mrdudz Date: Thu, 16 Jul 2015 20:15:05 +0200 Subject: [PATCH] fixed joypad bits --- include/pce.h | 4 ++-- libsrc/pce/joy/pce-stdjoy.s | 8 ++++---- libsrc/pce/readme.txt | 4 +--- testcode/lib/pce/conio.c | 6 ++++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/pce.h b/include/pce.h index 27f70de0f..6f18ba501 100644 --- a/include/pce.h +++ b/include/pce.h @@ -80,8 +80,8 @@ extern void pce_stdjoy_joy[]; /* Referred to by joy_static_stddrv[] */ #define JOY_FIRE_B 5 -#define JOY_START 6 -#define JOY_SELECT 7 +#define JOY_SELECT 6 +#define JOY_RUN 7 void waitvblank (void); /* Wait for the vertical blanking */ diff --git a/libsrc/pce/joy/pce-stdjoy.s b/libsrc/pce/joy/pce-stdjoy.s index 1aa98e16d..592793250 100644 --- a/libsrc/pce/joy/pce-stdjoy.s +++ b/libsrc/pce/joy/pce-stdjoy.s @@ -29,10 +29,10 @@ .byte $40 ; JOY_DOWN .byte $80 ; JOY_LEFT .byte $20 ; JOY_RIGHT - .byte $02 ; JOY_FIRE A ; FIXME: is this correct? - .byte $01 ; JOY_FIRE B ; FIXME: is this correct? - .byte $04 ; JOY_START ; FIXME: is this correct? - .byte $08 ; JOY_SELECT ; FIXME: is this correct? + .byte $01 ; JOY_FIRE_A + .byte $02 ; JOY_FIRE_B + .byte $04 ; JOY_SELECT + .byte $08 ; JOY_RUN ; Jump table. diff --git a/libsrc/pce/readme.txt b/libsrc/pce/readme.txt index 243a07417..a822205d4 100644 --- a/libsrc/pce/readme.txt +++ b/libsrc/pce/readme.txt @@ -2,9 +2,7 @@ PC-Engine (PCE) target support for cc65. this is still work in progress and a couple of things need to be fixed: -------------------------------------------------------------------------------- -joystick support should get verified on real hw - - the masks for buttons may be wrong. - - 6 button gamepads are different and need slightly different code +- 6 button gamepads are different and need slightly different code interruptor support in crt0 (and cfg) is missing - clock() should be hooked to a VBL interrupt diff --git a/testcode/lib/pce/conio.c b/testcode/lib/pce/conio.c index b94c91877..f5231dba6 100644 --- a/testcode/lib/pce/conio.c +++ b/testcode/lib/pce/conio.c @@ -95,14 +95,16 @@ void main(void) { gotoxy(0, 12 + i); j = joy_read (i); - cprintf ("pad %d: %02x %-6s%-6s%-6s%-6s%-6s%-6s", + cprintf ("pad %d: %02x %-6s%-6s%-6s%-6s%-6s%-6s%-6s%-6s", i, j, (j & joy_masks[JOY_UP])? " up " : " ---- ", (j & joy_masks[JOY_DOWN])? " down " : " ---- ", (j & joy_masks[JOY_LEFT])? " left " : " ---- ", (j & joy_masks[JOY_RIGHT])? "right " : " ---- ", (j & joy_masks[JOY_FIRE])? " fire " : " ---- ", - (j & joy_masks[JOY_FIRE2])? "fire2 " : " ---- "); + (j & joy_masks[JOY_FIRE2])? "fire2 " : " ---- ", + (j & joy_masks[JOY_SELECT])? "select" : " ---- ", + (j & joy_masks[JOY_RUN])? " run " : " ---- "); } gotoxy(xsize - 10, 3); -- 2.39.5