home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar Extras 3
/
Ex3side1.d64
/
toolbox.s
< prev
next >
Wrap
Text File
|
2022-08-28
|
22KB
|
2,111 lines
open =$ffc0
readst =$ffb7
setlfs =$ffba
setnam =$ffbd
setmsg =$ff90
load =$ffd5
getin =$ffe4
input'buffer =512
clrchn =$ffcc
close =$ffc3 ;a
chrin =$ffcf
chkout =$ffc9 ;x
chkin =$ffc6 ;x
plot =$fff0
chrout =$ffd2
color'pointer =243
screen'line'pointer =209
print'number =$bdcd ;x,a
clear'line =59903
background =53281
border =53280
strout = $ab1e; .A low .Y high
unlisten =$ffae
clall =$ffe7
color1 =53282
color2 =53283
color3 =53284
white =5
crsr'down =17
rvs'on =18
home =19
del =20
red =28
crsr'right =29
green =30
blue =31
black =144
lowercase =14
uppercase =142
crsr'up =145
rvs'off =146
clr =147
insert =148
brown =149
light'red =150
dark'grey =151
medium'grey =152
light'green =153
light'blue =154
light'grey =155
purple =156
crsr'left =157
yellow =158
cyan =159
top'left =176
top'right =174
bottom'left =173
bottom'right =189
bottom'pointer =247
top'pointer =249
buffer =$200
loc1 =$14
loc2 =$22
source =251
end =253
destination =$14
temp =2
;****dir menu*****
;sys wildcard$,device,address,x,y,depth,color,highlight
.org $9000
.obj "@0:toolbox 9000"
;mem
;dis e
jmp dir'menu
jmp redisplay'entry ;+3
jmp just'load'it; ;+6
jmp index'name ;+9
jmp blocks'free ;+12
jmp box'entry ;
jmp screen'stash
jmp screen'restore
jmp print'at
jmp center
jmp bload
jmp d'keyboard
jmp scroll
jmp clear'row
jmp disk'command
jmp brancher ;+45
jmp menu'entry ;+48
jmp reader ;+51
jmp copymem ;+54
jmp copymem+7 ;swappymem ;+57
jmp copymem+14;ROM in copy;60
jmp inpanyii ;63
jmp get'word ;66
jmp linx ;69
jmp shade'area ;72
redisplay'entry jsr zero'restore
jmp redisplay
abort lda #4
sta 251
- jsr get'number
dec 251
bpl -
abort2 jsr clear'buffer
lda #0
sta wlength
jmp make'wstring
just'load'it lda #255
sta sub'low
bne +
dir'menu lda #0
sta sub'low
+ jsr get'string
jsr setnam
jsr get'number
sty device
lda #2
jsr close
lda #2
ldx device
ldy #0
jsr setlfs
jsr open
jsr get'number
sty 251
sta 252
sty address
sta address+1
lda #0
sta that's'it
lda #255
sta files
sta files+1
jsr clrchn
ldx #2
jsr chkin
jsr getin
jsr getin
loop inc files
bne +
inc files+1
+ jsr fill'buffer
jsr readst
and #64
bne +
lda that's'it
bne +
beq loop
+ lda #2
jsr close
jsr zero'stash
lda files
sta 201
lda files+1
sta 202
dec 201
lda 201
cmp #255
bne +
dec 202
+ jsr make'variable
jsr zero'restore
lda #0
tax
tay
jsr setnam
jsr open'duh'error
jsr read'open'error
lda #15
jsr close
jsr clrchn
lda error'string
cmp "0"
beq +
bit sub'low
bmi +
jmp abort
+ lda files+1
bne +
lda files
cmp #2
bcs +
bit sub'low
bmi +
jmp abort
+ bit sub'low
beq redisplay
jmp clear'buffer
redisplay jsr get'number
cpy #20
bcc +
ldy #20
+ sty menu'x
sty parms
tya
clc
adc #19
sta parms+1
jsr get'number
cpy #20
bcc +
ldy #19
+ sty menu'y
sty parms+2
jsr get'number
cpy #2
bcs +
ldy #2
/ sty menu'depth
iny
iny
iny
tya
clc
adc parms+2
cmp #25
bcc +
ldy menu'depth
dey
bpl -
+ sta parms+3
lda #160
sta parms+4
jsr get'number
sty menu'color
sty parms+5
jsr get'number
sty menu'highlight
jsr fill'box
ldy menu'x
iny
sty parms
tya
dey
clc
adc #17
sta parms+1
ldy menu'y
iny
sty parms+2
dey
tya
clc
adc menu'depth
sta parms+3
lda #32
sta parms+4
lda menu'color
sta parms+5
ldy #3
- lda parms,y
sta startingx,y ;set scroll parameters
dey
bpl -
jsr fill'box
ldx parms+3
inx
inx
ldy parms
clc
jsr plot
lda #1
sta 199
lda menu'color
sta 646
lda <prompt
ldy >prompt
jsr strout
inc menu'x
inc menu'y
menu'reenter ldx menu'y
ldy menu'x
clc
iny
jsr plot
lda #0
sta 199
lda menu'color
sta 646
fill'menu lda #0
sta item
sta menu'item
lda address
sta 253
lda address+1
sta 254
lda #32
sta char
sei
ldx #$74
stx 1
ldy #0
- lda (253),y
jsr adjust'pointer
cmp #0
bne -
lda 253
sta top
sta top'pointer
lda 254
sta top'pointer+1
sta top+1
- sei
ldy #0
lda #$74
sta 1
lda (253),y
jsr adjust'pointer
cmp #0
bne +
jmp next'name
+ ldx #$77
stx 1
stx 212
jsr chrout
bne -
next'name lda #$77
sta 1
lda 254
cmp 252
bne +
lda 253
cmp 251
beq bottom
+ ldx item
inx
cpx menu'depth
beq bottom
stx item
inc 214
ldx menu'x
inx
stx 211
jsr 58732
jmp -
bottom lda #0
sta item
sta 198
lda #$77
sta 1
cli
lda item
jsr item'on
get'key jsr getin
beq get'key
cmp #133
bne +
jsr pup
+ cmp #136
bne +
jsr pdown
+ cmp #3
bne +
jsr item'off
- bit 197
bvc -
jsr delay
jsr zero'stash
jmp abort2
+ cmp #19; home
bne +
jmp move'home
+ cmp #crsr'down
beq down'pressed
cmp #crsr'up
beq up'pressed
cmp #13
beq return'pressed
bne get'key
down'pressed lda files+1
bne +
ldy item
iny
iny
cpy files
beq get'key
+ ldy item
iny
cpy menu'depth
bcs down'we'go
jsr item'off
ldy item
iny
sty item
jsr item'on
jmp get'key
lda file+1
cmp files+1
bcc +
lda file
cmp files
bcs get'key
up'pressed ldy item
bne +
jmp up'we'go
+ jsr item'off
ldy item
dey
sty item
cpy menu'depth
bcs +
jsr item'on
+ jmp get'key
return'pressed jsr zero'stash
jsr get'file
jmp clear'buffer
down'we'go lda 254
cmp 252
bcc +
lda 253
cmp 251
bcs bottom'out
+ lda #0
sta direction
jsr zero'stash
jsr item'off
jsr scroll'up
jsr clear'ml'enter
jsr zero'restore
print'bottom lda #0
sta 212
lda #crsr'right
jsr chrout
sei
lda #$74
sta 1
ldy #0
- lda (top'pointer),y
jsr adjust'top
cmp #0
bne -
- sei
ldy #0
lda #$74
sta 1
lda (253),y
jsr adjust'pointer
cmp #0
bne +
jmp bottom'out
+ ldx #$77
stx 1
stx 212
jsr chrout
bne -
bottom'out lda #$77
sta 1
cli
jsr item'on
jmp get'key
up'we'go lda top'pointer+1
cmp top+1
bne +
lda top'pointer
cmp top
beq bottom'out
+ lda #1
sta direction
jsr zero'stash
jsr item'off
jsr scroll'down
jsr clear'ml'enter
jsr zero'restore
print'top lda #0
sta 212
lda #crsr'right
jsr chrout
sei
lda #$74
sta 1
ldy #0
jsr dec'pointer
jsr dec'pointer
- lda (253),y
jsr dec'pointer
cmp #0
bne -
jsr adjust'pointer
jsr adjust'pointer
jsr dec'top
jsr dec'top
ldy #0
- lda (top'pointer),y
jsr dec'top
cmp #0
bne -
jsr adjust'top
jsr adjust'top
- sei
ldy #0
lda #$74
sta 1
lda (top'pointer),y
jsr adjust'top
cmp #0
bne +
jmp top'out
+ ldx #$77
stx 1
stx 212
jsr chrout
bne -
top'out jsr dec'top
jsr dec'top
ldy #0
- lda (top'pointer),y
jsr dec'top
cmp #0
bne -
jsr adjust'top
jsr adjust'top
jmp bottom'out
move'home jsr item'off
lda item
beq +
lda #0
sta item
jsr item'on
jmp get'key
+ lda #0
sta 212
jsr fill'box
jmp menu'reenter
fill'buffer ldy #0
- jsr getin
sta buffer,y
iny
cpy #32
bne -
copy'name sei
lda #$74
sta 1
ldy #0
find'quote ldx #2
- lda buffer,x
cmp #34
beq +
inx
cpx #30
bcc -
lda #1
sta that's'it
jmp normal
+ inx
- lda buffer,x
cmp #34
beq +
sta (251),y
jsr bump
inx
bne -
+ lda #0
sta (251),y
jsr bump
normal lda #$77
sta 1
cli
rts
bump inc 251
bne +
inc 252
+ rts
box'entry lda #5
sta parm'count
lda #0
sta shade
box'ii lda #0
sta temp
- jsr get'number
tya
ldy temp
sta parms,y
inc temp
cpy parm'count
bne -
fill'box jsr linx
box'start ldx parms+2
ldy #0
clc
jsr $fff0
jsr old'rom'patch
dec parms
- ldy parms+1
- bit parms+5
bvc check'rev
lda (209),y
and #127
sta (209),y
lda #255
sta parms+4
jmp alter'screen
check'rev ldx parms+5
bpl alter'screen
lda (209),y
ora #128
sta (209),y
lda #255
sta parms+4
alter'screen lda parms+4
bit shade
bmi get'shade
cmp #255
beq +
sta (209),y
+ lda parms+5
store'color sta (243),y
dey
cpy parms
bne -
lda 214
cmp parms+3
beq +
inc 214
jsr 58732
jsr old'rom'patch
jmp --
+ inc parms
lda #home
jmp $ffd2
get'shade lda (243),y
and #15
tax
lda shade'table,x
jmp store'color
linx lda #0
sta 212
ldy #24
- lda 217,y
ora #128
sta 217,y
dey
bpl -
rts
get'number jsr $aefd
jsr $ad8a
jmp $b7f7
old'rom'patch lda 210
sec
sbc 648
clc
adc #$d8
sta 244
lda 209
sta 243
rts
d'keyboard lda #2
jsr close
jsr get'string
jsr setnam
jsr get'number
tya
tax
ldy #2
lda #2
jsr setlfs
lda #0
jsr load
lda 174
sta 45
lda 175
sta 46
jsr $a533
jsr clear'buffer
lda #138
sta buffer
lda "r"
sta 631
lda "U"
sta 632
lda ":"
sta 633
lda #13
sta 634
lda #4
sta 198
jmp $a474
;***** get string from BASIC ****
get'string jsr $aefd
jsr $ad9e
jsr $b6a3
ldx $22
ldy $23
rts
bload jsr get'string
jsr setnam
jsr get'number
sty device
tya
tax
lda #1
ldy #0
jsr setlfs
jsr get'number
ldx $14
ldy $15
lda #0
jsr load
lda 174
sta 201
lda 175
sta 202
jsr make'variable
jsr open'duh'