home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Transactor
/
Transactor_12_1986_Transactor_Publishing.d64
/
autoload.asm
< prev
next >
Wrap
Assembly Source File
|
2023-02-26
|
3KB
|
129 lines
;put"@:s/kauto"
.opt nosym
;*******************************
;* *
;* autoload kernal *
;* --------------- *
;* *
;* on powerup or reset, loads *
;* the 1st file from drive 0 *
;* and then runs the program. *
;* however, a delay period is *
;* provided allowing the user *
;* time to abort the load by *
;* pressing the cmdr logo key. *
;* *
;* - by tom hughes v240685 - *
;* *
;*******************************
.skip
;
;c64 equates
;
basic = $0801 ;basic starts here
basini = $e3bf ;initialize basic
basmsg = $e422 ;print powerup message
clall = $ffe7 ;close all files
close = $ffc3 ;close one file
clrchn = $ffcc ;i/o to defaults
dobas = $a474 ;basic warm start
keyd = $0277 ;keyboard buffer
load = $ffd5 ;load ram from disk
setlfs = $ffba ;set file parameters
setnam = $ffbd ;set file name
settim = $ffdb ;set jiffy clock
shflag = $028d ;shift pattern register
vec300 = $e453 ;set page 3 o.s. vectors
time = $a0 ;jiffy clock (3)
vartab = $2d ;basic variable start (2)
ndx = $c6 ;# of chars in kbd buff
.skip
;
;constants
;
eprom = 0 ;1=eprom/0=soft kernal
wait = 3 ;wait * 4 = delay in secs
.page 'diversions'
;------------------------------
;cassette routine patches
;------------------------------
.skip
;note: attempted use of a cassette routine
;will result in "illegal device #"
.skip
*=$f2ce
jmp $f271 ;fix cassette close
*=$f38b
jmp $f713 ;fix cassette open
*=$f539
jmp $f713 ;fix cassette load
*=$f65f
jmp $f713 ;fix cassette save
.skip 2
*=$fcef
;------------------------------
;divert system reset
;------------------------------
.skip
.ifn eprom <
stx $d016 ;reset vicii chip,
jsr $fda3 ;initialize i/o,
jsr $fd50 ;memory pointers,
jsr $fd15 ;soft i/o vectors,
jsr $ff5b ;screen & keyboard
>
cli
jmp autold ;go to autoload
.page 'autoload'
*=$f72c
;-------------------------------
;powerup autoload
;-------------------------------
.skip
autold jsr vec300 ;set $0300 vectors,
jsr basini ;initialize basic,
jsr basmsg ;print powerup message,
ldx #251 ;and reset stack
txs
lda #0 ;zero jiffy clock
jsr settim
auto10 lda shflag
cmp #2 ;if cmdr key pressed,
beq auto30 ;skip the load
lda time+1
cmp #wait ;else wait till delay is up
bne auto10
jsr clall ;then close all files
lda #2
ldx #8
ldy #0 ;ignore file header
jsr setlfs
lda #3
ldx #<filnam
ldy #>filnam
jsr setnam
lda #0 ;load "0:*",8
ldx #<basic
ldy #>basic
jsr load
stx vartab ;set end-of-basic ptrs
sty vartab+1
lda #2 ;close load channel
jsr close
jsr clrchn
.skip
;autorun routine
;
ldy #0
auto20 lda runit,y ;write "run" + cr
sta keyd,y ;to keyboard buffer
iny
cpy #4
bne auto20
sty ndx ;and set buffer size
auto30 jmp dobas ;then run the program
.skip
filnam .byt '0:*'
runit .byt 'run',13
.end