home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 95
/
095.d81
/
c-meister.sda
/
CATMEISTER.S
< prev
next >
Wrap
Text File
|
2022-08-26
|
14KB
|
1,437 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
;****dir menu*****
;sys wildcard$,device,address,x,y,depth,color,highlight
.org $9500
.obj "c-meister 9500"
;mem
jmp dir'menu
jmp redisplay'entry
jmp just'load'it
jmp index'name
jmp blocks'free
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
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 wlength
jmp +
dir'menu lda #0
sta wlength
+ jsr get'string
jsr setnam
jsr get'number
sty device
lda #2
jsr close
lda #2
ldx device
ldy #0
jsr setlfs
jsr open
lda #0
sta that's'it
lda #255
sta files
sta files+1
jsr clrchn
ldx #2
jsr chkin
jsr getin
jsr getin
jsr get'number
sty 251
sta 252
sty address
sta address+1
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
lda #0
tax
tay
jsr setnam
lda #15
ldx device
ldy #15
jsr setlfs
jsr open
jsr read'open'error
lda #15
jsr close
jsr clrchn
lda error'string
cmp "0"
beq +
jmp abort
+ lda files+1
bne +
lda files
cmp #2
bcs +
jmp abort
+ lda wlength
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 #0
sta temp
- jsr get'number
tya
ldy temp
sta parms,y
inc temp
cpy #5
bne -
fill'box jsr linx
box'start ldx parms+2
ldy #0
clc
jsr $fff0
jsr old'rom'patch
dec parms
- ldy parms+1
- lda parms+4
cmp #255
beq +
sta (209),y
+ lda parms+5
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
linx 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 53280
sta 646
ldy #0
- lda dynamic'keyboard,y
jsr $ffd2
cmp #34
beq +
iny
bne -
+ sty 251
jsr get'string
sta temp
ldy #0
- lda ($22),y
jsr chrout
iny
cpy temp
bne -
lda #34
jsr chrout
lda ","
jsr chrout
jsr get'number
tya
tax
lda #0
jsr print'number
ldy 251
iny
- lda dynamic'keyboard,y
beq +
jsr chrout
iny
bne -
+ lda #13
sta 631
sta 632
lda #2
sta 198
rts
;***** 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
tya
tax
lda #1
ldy #0
jsr setlfs
jsr get'number
ldx $14
ldy $15
lda #0
jmp load
adjust'pointer inc 253
bne +
inc 254
+ ldx 253
stx bottom'pointer
ldx 254
stx bottom'pointer+1
rts
adjust'top ldy #0
inc top'pointer
bne +
inc top'pointer+1
+ rts
dec'pointer ldy #0
dec 253
ldx 253
cpx #255
bne +
dec 254
+ stx bottom'pointer
ldx 254
stx bottom'pointer+1
rts
dec'top ldy #0
dec top'pointer
ldx top'pointer
cpx #255
bne +
dec top'pointer+1
+ rts
;scroll sysaddr,x,to x,y, to y, direction
;dir 0=up 1= down
;clear line sysaddr+3,screen code,color
scroll jsr linx
jsr get'number
sty startingx
cpy #40
bcs quit
jsr get'number
sty endingx
cpy #40
bcs quit
jsr get'number
sty startingy
cpy #25
bcs quit
jsr get'number
sty endingy
cpy #25
bcs quit
jsr get'number
cpy #2
bcs quit
sty direction
jsr linx
lda direction
beq scroll'up
jmp scroll'down
quit rts
scroll'up ldy startingx
ldx startingy
stx line
clc
jsr plot
jsr old'rom'patch
scroll'up'math clc
lda 209
adc <40
sta 251
lda 210
adc >40
sta 252
clc
lda