c64.a65

     1:          .setcpu "6502"
     2:  
     3:          .include "../asm6502.inc"
     4:          .include "../petscii.inc"
     5:  
     6:          .include "../macros.inc"
     7:  
     8:          .include "defines.inc"
     9:          .include "memory.inc"
    10:  
    11:          .include "../basic/basic2.inc"
    12:  
    13:          .include "../kernal/kernal-memory.inc"
    14:  
    15:          .include "../kernal/fileio_data.inc"
    16:          .include "../kernal/iec_data.inc"
    17:  
    18:          .segment "INIT"
    19:          .byte   VERSION_E4AC
    20:  
    21:  .if CompileComputer >= C64_02
    22:  
    23:  LE4AD:  pha
    24:          jsr     kCHKOUT
    25:          tax
    26:          pla
    27:          bcc     LE4B6
    28:          txa
    29:  LE4B6:  rts
    30:  
    31:  .endif
    32:  
    33:  .if CompileComputer = C64_4064
    34:  ;       FillUntil KERNAL_START + $04C8
    35:          .segment "KERNALPATCH_4064"
    36:  
    37:  LE4C8:  bit     lCOLOR
    38:          bmi     LE4D7
    39:          lda     #COL_BLACK
    40:          ldx     #(VICII_O_Spr7Col - VICII_O_BorderCol)
    41:  LE4D1:  sta     VIC + VICII_O_BorderCol,x
    42:          dex
    43:          bpl     LE4D1
    44:  LE4D7:  jmp     iSCNKEY
    45:  
    46:  .elseif CompileComputer >= C64_03
    47:  
    48:    .ifdef JIFFY
    49:  JDLE4B7:
    50:          jsr     LE453
    51:          lda     #<$F672
    52:          sta     zCMPO
    53:          lda     #>$F672
    54:          sta     zCMPO + 1
    55:  
    56:  JDLE4C2:
    57:          inx
    58:          stx     zPRTY
    59:          rts
    60:  
    61:  JDLE4C6:
    62:          lda     #$6F
    63:          jsr     $F0E4
    64:          jsr     kCHRIN
    65:          cmp     #$35
    66:          rts
    67:    .endif
    68:  
    69:  ;       FillUntil KERNAL_START + $04D3,BASIC_FILLER
    70:          .segment "KERNALPATCH_03"
    71:  
    72:  LE4D3:  sta     zRINONE
    73:          lda     #$01
    74:          sta     zRIPRTY
    75:          rts
    76:  .endif
    77:  
    78:  .if CompileComputer >= C64_02
    79:  
    80:  ;       FillUntil KERNAL_START + $04DA
    81:          .segment "KERNALPATCH_02"
    82:  
    83:  Patch_StoreColor:
    84:    .if CompileComputer >= C64_03 .AND CompileComputer <> C64_4064
    85:          ; TODO: Generic define
    86:          lda     lCOLOR
    87:    .else
    88:          lda     VIC + VICII_O_BackgCol0
    89:    .endif
    90:          sta     (zUSER),y
    91:          rts
    92:  
    93:  ; Introduce a delay when the TAPE outputs a "FOUND <filename>" message
    94:  ; We either wait for a timeout to happen,
    95:  ; or for the user to press a key
    96:  ;
    97:  ; Input: A = zTIME + 1 (timer middle byte)
    98:  ;
    99:  ; Bugs:
   100:  ; - In the case when the timer wraps around (after 24h), the middle byte
   101:  ;   can be $18 or $19, and the end of timeout is calculated as $1A or $1B.
   102:  ;   But: $1A or $1B is not reached before the wrap-around and the middle byte
   103:  ;   going to $1A or $1B again.
   104:  ;   This will result in a timeout of almost 2 minutes.
   105:  ;
   106:  TapeKeyOrTimeout:
   107:          adc     #2                      ; add 2 to the middle byte, resulting in a timeout of
   108:                                          ; not more than $0200 * 1/60th seconds
   109:                                          ; ("not more" because we do not care about the lower byte)
   110:  @Loop:
   111:          ldy     zSTKEY                  ; get the status of the keyboard column at the time the keyboard was checked the last time
   112:  
   113:          iny                             ; key pressed?
   114:          bne     @Ret                    ; yes -> branch, end this loop
   115:  
   116:          cmp     zTIME + 1               ; compare the timer middle byte with the calculated end of the timeout
   117:          bne     @Loop                   ; timeout not yet reached -> spin more
   118:  @Ret:
   119:          rts
   120:          ; ------------------------
   121:  
   122:  LE4EC:
   123:          .word   $2619
   124:          .word   $1944
   125:          .word   $111A
   126:          .word   $0DE8
   127:          .word   $0C70
   128:          .word   $0606
   129:          .word   $02D1
   130:          .word   $0137
   131:          .word   $00AE
   132:          .word   $0069
   133:  .endif
   134:  
   135:  ;       FillUntil KERNAL_START + $0500
   136:          .segment "KERNAL"
   137:  
   138:          .include "../kernal/editor.a65"
   139:          .include "../kernal/iec.a65"
   140:          .include "../kernal/rs232.a65"
   141:          .include "../kernal/message.a65"
   142:          .include "../kernal/fileio.a65"
   143:  .ifdef JIFFY
   144:          .include "../kernal/jiffydos.a65"
   145:  .else
   146:          .include "../kernal/tape.a65"
   147:  .endif
   148:          .include "../kernal/init.a65"
Valid XHTML 1.0 Strict
c64.a65.html; generated on Fri Sep 18 21:44:53 2015 by ca65html
uz@cc65.org