; ; File generated by cc65 v 2.11.0 ; .fopt compiler,"cc65 v 2.11.0" .setcpu "6502" .smart on .autoimport on .case on .debuginfo on .importzp sp, sreg, regsave, regbank, tmp1, ptr1, ptr2 .macpack longbranch .dbg file, "joy_load.c", 3548, 1073250883 .dbg file, "../../include/unistd.h", 3912, 1061022172 .dbg file, "../../include/fcntl.h", 3407, 1101568713 .dbg file, "../../include/modload.h", 4987, 1039740094 .dbg file, "../../include/joystick.h", 5085, 1097771593 .dbg file, "../../include/joystick/joy-kernel.h", 3750, 1099746017 .import _read .import _open .import _close .import _mod_load .export _joy_load_driver .import _joy_install .import _joy_uninstall .import _joy_drv ; --------------------------------------------------------------- ; unsigned char __fastcall__ joy_load_driver (const unsigned char*) ; --------------------------------------------------------------- .segment "CODE" .proc _joy_load_driver .segment "DATA" L0006: .addr _read .res 8,$00 .segment "CODE" ; ; { ; .dbg line, "joy_load.c", 46 jsr pushax ; ; if (joy_drv != 0) { ; .dbg line, "joy_load.c", 53 jsr decsp1 lda _joy_drv ora _joy_drv+1 beq L0008 ; ; joy_uninstall (); ; .dbg line, "joy_load.c", 54 jsr _joy_uninstall ; ; ctrl.callerdata = open (name, O_RDONLY); ; .dbg line, "joy_load.c", 58 L0008: jsr decsp4 ldy #$06 jsr ldaxysp ldy #$02 sta (sp),y iny txa sta (sp),y lda #$01 ldy #$00 sta (sp),y iny lda #$00 sta (sp),y ldy #$04 jsr _open sta L0006+2 stx L0006+2+1 ; ; if (ctrl.callerdata >= 0) { ; .dbg line, "joy_load.c", 59 txa bmi L0017 ; ; Res = mod_load (&ctrl); ; .dbg line, "joy_load.c", 62 lda #<(L0006) ldx #>(L0006) jsr _mod_load ldy #$00 sta (sp),y ; ; close (ctrl.callerdata); ; .dbg line, "joy_load.c", 65 lda L0006+2 ldx L0006+2+1 jsr _close ; ; if (Res == MLOAD_OK) { ; .dbg line, "joy_load.c", 68 ldy #$00 lda (sp),y bne L0017 ; ; return joy_install (ctrl.module); ; .dbg line, "joy_load.c", 71 lda L0006+4 ldx L0006+4+1 jsr _joy_install jmp incsp3 ; ; return JOY_ERR_CANNOT_LOAD; ; .dbg line, "joy_load.c", 77 L0017: ldx #$00 lda #$02 ; ; } ; .dbg line, "joy_load.c", 78 jmp incsp3 .dbg line .endproc