1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-23 04:30:10 +00:00

fixed joypad bits

This commit is contained in:
mrdudz 2015-07-16 20:15:05 +02:00
parent 3119be2a1e
commit e77060458a
4 changed files with 11 additions and 11 deletions

View File

@ -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 */

View File

@ -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.

View File

@ -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

View File

@ -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);