; ; 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, "tgi_load.c", 4161, 1055441303 .dbg file, "../../include/string.h", 4676, 1116364269 .dbg file, "../../include/stddef.h", 2974, 1061022172 .dbg file, "../../include/unistd.h", 3912, 1061022172 .dbg file, "../../include/fcntl.h", 3407, 1101568713 .dbg file, "../../include/modload.h", 4987, 1039740094 .dbg file, "../../include/tgi.h", 8266, 1097778292 .dbg file, "../../include/tgi/tgi-mode.h", 3241, 1068651902 .dbg file, "../../include/tgi/tgi-error.h", 3315, 1026037827 .dbg file, "../../include/tgi/tgi-kernel.h", 3989, 1099827169 .import _read .import _open .import _close .import _mod_load .export _tgi_load .export _tgi_load_driver .import _tgi_unload .import _tgi_install .import _tgi_drv .import _tgi_error .import _tgi_map_mode ; --------------------------------------------------------------- ; void __fastcall__ tgi_load (unsigned char) ; --------------------------------------------------------------- .segment "CODE" .proc _tgi_load .segment "CODE" ; ; { ; .dbg line, "tgi_load.c", 49 jsr pusha ; ; const char* name = tgi_map_mode (mode); ; .dbg line, "tgi_load.c", 50 ldy #$00 lda (sp),y jsr _tgi_map_mode jsr pushax ; ; if (name == 0) { ; .dbg line, "tgi_load.c", 51 ldy #$00 lda (sp),y iny ora (sp),y bne L0005 ; ; tgi_error = TGI_ERR_NO_DRIVER; ; .dbg line, "tgi_load.c", 53 tya sta _tgi_error ; ; } else { ; .dbg line, "tgi_load.c", 54 jmp incsp3 ; ; tgi_load_driver (name); ; .dbg line, "tgi_load.c", 56 L0005: jsr ldaxysp jsr _tgi_load_driver ; ; } ; .dbg line, "tgi_load.c", 58 jmp incsp3 .dbg line .endproc ; --------------------------------------------------------------- ; void __fastcall__ tgi_load_driver (const unsigned char*) ; --------------------------------------------------------------- .segment "CODE" .proc _tgi_load_driver .segment "DATA" L000E: .addr _read .res 8,$00 .segment "CODE" ; ; { ; .dbg line, "tgi_load.c", 67 jsr pushax ; ; if (tgi_drv != 0) { ; .dbg line, "tgi_load.c", 74 jsr decsp2 lda _tgi_drv ora _tgi_drv+1 beq L0010 ; ; tgi_unload (); ; .dbg line, "tgi_load.c", 75 jsr _tgi_unload ; ; ctrl.callerdata = open (name, O_RDONLY); ; .dbg line, "tgi_load.c", 79 L0010: jsr decsp4 ldy #$07 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 L000E+2 stx L000E+2+1 ; ; if (ctrl.callerdata >= 0) { ; .dbg line, "tgi_load.c", 80 txa bmi L001F ; ; Res = mod_load (&ctrl); ; .dbg line, "tgi_load.c", 83 lda #<(L000E) ldx #>(L000E) jsr _mod_load ldy #$00 jsr staxysp ; ; close (ctrl.callerdata); ; .dbg line, "tgi_load.c", 86 lda L000E+2 ldx L000E+2+1 jsr _close ; ; if (Res == MLOAD_OK) { ; .dbg line, "tgi_load.c", 89 ldy #$00 lda (sp),y iny ora (sp),y bne L001F ; ; tgi_install (ctrl.module); ; .dbg line, "tgi_load.c", 92 lda L000E+4 ldx L000E+4+1 jsr _tgi_install ; ; return; ; .dbg line, "tgi_load.c", 93 jmp incsp4 ; ; tgi_error = TGI_ERR_CANNOT_LOAD; ; .dbg line, "tgi_load.c", 99 L001F: lda #$02 sta _tgi_error ; ; } ; .dbg line, "tgi_load.c", 100 jmp incsp4 .dbg line .endproc