X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libsrc%2Fjoystick%2Fjoy-kernel.s;h=c2d50c8d8b529f7e74b6973f1d9a8f7716851d6b;hb=4304f115495a927756b0b33c73bc3ecd5d0f5559;hp=2b1dcf884158f8d34870bacd7737e14137359096;hpb=a8d3b83c43e79702a41b0049d65ea51e62dacf09;p=cc65 diff --git a/libsrc/joystick/joy-kernel.s b/libsrc/joystick/joy-kernel.s index 2b1dcf884..c2d50c8d8 100644 --- a/libsrc/joystick/joy-kernel.s +++ b/libsrc/joystick/joy-kernel.s @@ -6,7 +6,6 @@ .import joy_libref .importzp ptr1 - .interruptor joy_irq ; Export as IRQ handler .include "joy-kernel.inc" .include "joy-error.inc" @@ -19,8 +18,6 @@ .bss _joy_drv: .res 2 ; Pointer to driver -_joy_masks: .res .sizeof(JOY_HDR::MASKS) - ; Jump table for the driver functions. .data joy_vectors: @@ -28,7 +25,6 @@ joy_install: jmp $0000 joy_uninstall: jmp $0000 joy_count: jmp $0000 joy_read: jmp $0000 -joy_irq: .byte $60, $00, $00 ; RTS plus two dummy bytes ; Driver header signature .rodata @@ -65,38 +61,17 @@ _joy_install: lda #>joy_libref sta (ptr1),y -; Copy the mask array - - ldy #JOY_HDR::MASKS + .sizeof(JOY_HDR::MASKS) - 1 - ldx #.sizeof(JOY_HDR::MASKS)-1 -@L1: lda (ptr1),y - sta _joy_masks,x - dey - dex - bpl @L1 - ; Copy the jump vectors ldy #JOY_HDR::JUMPTAB ldx #0 -@L2: inx ; Skip the JMP opcode +@L1: inx ; Skip the JMP opcode jsr copy ; Copy one byte jsr copy ; Copy one byte cpy #(JOY_HDR::JUMPTAB + .sizeof(JOY_HDR::JUMPTAB)) - bne @L2 + bne @L1 - jsr joy_install ; Call driver install routine - tay ; Test error code - bne @L3 ; Bail out if install had errors - -; Install the IRQ vector if the driver needs it. A/X contains the error code -; from joy_install, so don't use it. - - ldy joy_irq+2 ; Check high byte of IRQ vector - beq @L3 ; Jump if vector invalid - ldy #$4C ; JMP opcode - sty joy_irq ; Activate IRQ routine -@L3: rts + jmp joy_install ; Call driver install routine ; Driver signature invalid @@ -120,9 +95,6 @@ copy: lda (ptr1),y ; */ _joy_uninstall: - lda #$60 ; RTS opcode - sta joy_irq ; Disable IRQ entry point - jsr joy_uninstall ; Call the driver routine _joy_clear_ptr: ; External entry point