From 92d9a7cb404b448c448d10a725c7dff90a58cf1c Mon Sep 17 00:00:00 2001 From: cuz Date: Thu, 26 Dec 2002 15:59:49 +0000 Subject: [PATCH] readjoy() is no longer available git-svn-id: svn://svn.cc65.org/cc65/trunk@1849 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/c128/mouse.s | 12 +++++++++--- libsrc/c64/mouse.s | 17 +++++++++++++---- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/libsrc/c128/mouse.s b/libsrc/c128/mouse.s index 05628a54d..a1871e462 100644 --- a/libsrc/c128/mouse.s +++ b/libsrc/c128/mouse.s @@ -12,7 +12,6 @@ .export _mouse_buttons, _mouse_info .condes MouseIRQ, 2 - .import _readjoy .import popax, addysp1 .importzp ptr1, sp @@ -309,8 +308,15 @@ mddone: rts .proc _mouse_buttons - lda #$00 ; Use port #0 - jmp _readjoy ; Same as joystick + lda #$7F + sei + sta CIA1_PRA + lda CIA1_PRB ; Read joystick #0 + cli + ldx #0 + and #$1F + eor #$1F + rts .endproc diff --git a/libsrc/c64/mouse.s b/libsrc/c64/mouse.s index 23c228a7b..b5ecb18ae 100644 --- a/libsrc/c64/mouse.s +++ b/libsrc/c64/mouse.s @@ -11,7 +11,6 @@ .export _mouse_move, _mouse_pos .export _mouse_buttons, _mouse_info - .import _readjoy .import popax, addysp1 .importzp ptr1, sp @@ -288,9 +287,19 @@ _mouse_move: ; unsigned char mouse_buttons (void); ; -_mouse_buttons: - lda #$00 ; Use port #0 - jmp _readjoy ; Same as joystick +.proc _mouse_buttons + + lda #$7F + sei + sta CIA1_PRA + lda CIA1_PRB ; Read joystick #0 + cli + ldx #0 + and #$1F + eor #$1F + rts + +.endproc ; -------------------------------------------------------------------------- ; -- 2.39.5