home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-01-01 | 21.0 KB | 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'error
- jmp read'open'error
-
- 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 243
- adc <40
- sta 253
- lda 244
- adc >40
- sta 254
-
- ldy startingx
-
- - lda (251),y
- sta (209),y
- lda (253),y
- sta (243),y
- iny
- cpy endingx
- beq -
- bcc -
-
- inc line
- lda line
- cmp endingy
- bcs through'scrolling'up
-
- clc
- lda 209
- adc <40
- sta 209
- lda 210
- adc >40
- sta 210
-
- clc
- lda 243
- adc <40
- sta 243
- lda 244
- adc >40
- sta 244
- jmp scroll'up'math
-
- through'scrolling'up ldx endingy
- ldy startingx
- clc
- jsr plot
- jmp old'rom'patch
-
- scroll'down ldy startingx
- ldx endingy
- stx line
- clc
- jsr plot
- jsr old'rom'patch
-
- scroll'down'math sec
- lda 209
- sbc <40
- sta 251
- lda 210
- sbc >40
- sta 252
-
- sec
- lda 243
- sbc <40
- sta 253
- lda 244
- sbc >40
- sta 254
-
- ldy startingx
-
- - lda (251),y
- sta (209),y
- lda (253),y
- sta (243),y
- iny
- cpy endingx
- beq -
- bcc -
-
- dec line
- lda line
- cmp startingy
- beq through'scrolling'down
-
- sec
- lda 209
- sbc <40
- sta 209
- lda 210
- sbc >40
- sta 210
-
- sec
- lda 243
- sbc <40
- sta 243
- lda 244
- sbc >40
- sta 244
- jmp scroll'down'math
-
- through'scrolling'down ldx startingy
- ldy startingx
- clc
- jsr plot
- jmp old'rom'patch
-
- clear'row jsr get'number
- sty char
- jsr get'number
- sty color
-
- clear'ml'enter ldy startingx
- - lda char
- sta (209),y
- lda color
- sta (243),y
- iny
- cpy endingx
- beq -
- bcc -
-
- rts
-
- item'on lda item
- clc
- adc menu'y
- tax
- clc
- ldy #0
- jsr plot
- jsr old'rom'patch
- ldx #0
- ldy menu'x
- - lda (209),y
- ora #128
- sta (209),y
- lda menu'highlight
- sta (243),y
- iny
- inx
- cpx #18
- bne -
- rts
-
- item'off lda item
- clc
- adc menu'y
- tax
- clc
- ldy #0
- jsr plot
- jsr old'rom'patch
- ldx #0
- ldy menu'x
- - lda (209),y
- and #127
- sta (209),y
- lda menu'color
- sta (243),y
- iny
- inx
- cpx #18
- bne -
- rts
-
- zero'stash sty tempy
- ldy #7
- - lda 247,y
- sta zbuffer,y
- dey
- bpl -
- ldy tempy
- rts
-
- zero'restore sty tempy
- ldy #7
- - lda zbuffer,y
- sta 247,y
- dey
- bpl -
- ldy tempy
- rts
-
- read'open'error jsr clear'buffer
- jsr clrchn
- ldx #15
- jsr chkin
- ldy #0
-
- - jsr getin
- sta error'string,y
- iny
- cmp #13
- bne -
- iny
- sty elength
- jsr clrchn
-
- dec elength
- dec elength
- ldx <error'name
- ldy >error'name
- jsr locvar
- lda <elength
- ldy >elength
- jmp set'string
-
-
- locvar lda $7a
- pha
- lda $7b
- pha
- stx $7a
- sty $7b
- jsr $b08b
- sta $49
- sty $4a
- pla
- sta $7b
- pla
- sta $7a
- rts
-
- set'string sta $64
- sty $65
- jmp $aa52
-
- make'wstring ldx <string'name
- ldy >string'name
- jsr locvar
- lda <wlength
- ldy >wlength
- jsr set'string
-
- clear'buffer ldy #79
- lda #0
- sta 212
- - sta buffer,y
- dey
- bpl -
- rts
-
- get'file lda #0
- sta 212
- sei
- lda #$74
- sta 1
- ldy #0
- ldx #0
- lda item
- beq copy'to'w'string
-
- - lda (top'pointer),y
- jsr adjust'top
- cmp #0
- bne -
- inx
- cpx item
- bne -
-
- copy'to'w'string ldy #0
- - lda (top'pointer),y
- beq +
- sta buffer,y
- iny
- cpy #80
- bne -
-
- + sty wlength
-
- lda #$77
- sta 1
- cli
- jmp make'wstring
-
-
- index'name jsr get'number
- cmp files+1
- bcc +
- cpy files
- bcc +
- jmp index'quit
- + sta parms+1
- sty parms
-
- jsr zero'restore
- lda address
- sta top'pointer
- lda address+1
- sta top'pointer+1
-
- sei
- lda #$74
- sta 1
-
- lda #255
- sta file
- sta file+1
-
- ldy #0
-
- - lda (top'pointer),y
- jsr adjust'top
- cmp #0
- beq +
- bne -
-
- + inc file
- bne +
- inc file+1
-
- + lda file+1
- cmp files+1
- bcc +
- lda file
- cmp files
- bcc +
- beq +
-
- jmp index'quit
-
- + lda file+1
- cmp parms+1
- bcc -
- lda file
- cmp parms
- bcc -
-
- jsr copy'to'w'string
- jmp clear'buffer
-
- index'quit lda #$77
- sta 1
- cli
- lda #0
- sta wlength
- jsr make'wstring
- jmp clear'buffer
-
- screen'stash jsr linx
- jsr get'number
- sty 252
- cpy >1024
- bcs +
- rts
-
- + tya
- clc
- adc #4
- sta 254
- lda #0
- sta 253
- sta 251
-
- lda #home
- jsr chrout
- jsr old'rom'patch
- sei
- lda #0
- sta 1
-
- ldx #3
- ldy #0
- - lda (209),y
- sta (251),y
- dec 1
- lda (243),y
- inc 1
- sta (253),y
- iny
- bne -
- inc 210
- inc 252
- inc 244
- inc 254
- dex
- bpl -
- lda #$77
- sta 1
- cli
- lda #home
- jmp chrout
-
- screen'restore jsr linx
- jsr get'number
- sty 252
- tya
- clc
- adc #4
- sta 254
- lda #0
- sta 253
- sta 251
-
- lda #home
- jsr chrout
- jsr old'rom'patch
- sei
- lda #0
- sta 1
-
- ldx #3
- ldy #0
-
- - lda (251),y
- sta (209),y
- lda (253),y
- dec 1
- sta (243),y
- inc 1
- iny
- bne -
- inc 210
- inc 252
- inc 244
- inc 254
- dex
- bpl -
- lda #$77
- sta 1
- cli
- lda #home
- jmp chrout
-
- print'at jsr linx
- jsr get'number
- sty 211
- jsr get'number
- sty 214
- jsr 58732
- jsr get'string
- sta temp
-
- print'string lda temp
- bne +
- rts
- + ldy #0
- - lda ($22),y
- jsr chrout
- iny
- cpy temp
- bne -
- rts
-
- center jsr linx
- jsr get'number
- tya
- tax
- ldy #0
- clc
- jsr plot
-
- jsr get'string
- sta temp
-
- lsr
- sta parms
- lda #20
- sec
- sbc parms
- sta 211
- jsr 58732
- jmp print'string
-
- blocks'free jsr get'number
- sty device
- lda #7
- ldx <dummy'name
- ldy >dummy'name
- jsr setnam
- lda #2
- jsr close
- lda #2
- ldx device
- ldy #0
- jsr setlfs
- jsr open
- lda #0
- tay
- tax
- jsr setnam
- jsr open'duh'error
- jsr read'open'error
-
- lda buffer
- cmp "0"
- bne bferror
-
- jsr clrchn
- ldx #2
- jsr chkin
- ldy #0
- - jsr getin
- sta buffer,y
- iny
- cpy #34
- bne -
-
- jsr getin
- sta parms
- jsr getin
- sta parms+1
-
- ldy #0
- - lda buffer+7,y
- sta buffer,y
- iny
- cpy #25
- bne -
-
- lda #24
- sta wlength
-
- jsr make'wstring
- lda parms
- sta 201
- lda parms+1
- sta 202
- jsr make'variable
- bferror jsr clear'buffer
- lda #2
- jsr close
- lda #15
- jsr close
- jmp clrchn
-
- delay ldx #0
- ldy #0
-
- - inx
- bne -
- iny
- bne -
- rts
-
- pup lda menu'depth
- cmp #10
- bcc +
- lda #10
- + sta temp
- lda #crsr'up
- jmp keyboard
-
- pdown lda menu'depth
- cmp #10
- bcc +
- lda #10
- + sta temp
- lda #crsr'down
-
- keyboard ldy #0
- - sta 631,y
- iny
- cpy temp
- bne -
- lda temp
- sta 198
- rts
-
- disk'command lda #15
- jsr close
- jsr get'string
- jsr setnam
- jsr get'number
- sty device
- lda #15
- ldx device
- ldy #15
- jsr setlfs
- jsr open
-
- jsr read'open'error
- jmp clear'buffer
-
- make'variable lda "f"
- sta 251
- lda "%"
- sta 252
- lda #0
- sta 253
- lda $7a
- pha
- lda $7b
- pha
-
- lda <251
- sta $7a
- lda >251
- sta $7b
- jsr $b08b
- ldy #0
- lda 202 ;high byte
- sta ($47),y
- iny
- lda 201;low byte
- sta ($47),y
- pla
- sta $7b
- pla
- sta $7a
- rts
-
- brancher lda #0
- sta 251
- jsr get'string
- sta 252
- - jsr getin
- beq -
-
- ldy #0
- - cmp ($22),y
- bne +
- iny
- sty 201
- ldy #0
- sty 202
- jmp make'variable
- + iny
- cpy 252
- bne -
- beq --
-
- menu'entry lda #0
- sta temp
- sta flag
- - jsr get'number
- tya
- ldy temp
- sta parms,y
- inc temp
- cpy #6
- bne -
-
- menu jsr linx
- ldx parms
- ldy #0
- sty 251
- clc
- jsr plot
- jsr old'rom'patch
-
- lda parms+5
- sta tempy
- jsr paint'line
-
- menu'wait jsr getin
- beq menu'wait
-
- ldx 251
- stx temp
-
- cmp #crsr'down
- beq menu'down
-
- cmp #crsr'up
- beq menu'up
-
- cmp #13
- beq menu'select
-
- cmp parms+6
- bne menu'wait'loop
- dec flag
- bmi menu'select
-
- menu'wait'loop jmp menu'wait
-
- menu'down inc 251
- lda 251
- cmp parms+3
- bne highlight
- lda #0
- sta 251
- beq highlight
-
- menu'up dec 251
- lda 251
- cmp #255
- beq +
- bne highlight
-
- + ldy parms+3
- dey
- sty 251
- jmp highlight
-
- menu'select lda 251
- clc
- adc parms
- tax
- ldy #0
- jsr plot
- jsr old'rom'patch
-
- lda parms+4
- sta tempy
- jsr paint'line
-
- bit flag
- beq +
- lda #255
- sta 251
- + ldy 251
- iny
- sty 201
- lda #0
- sta 202
- jmp make'variable
-
-
- highlight lda parms
- clc
- adc 251
- tax
- ldy #0
- clc
- jsr plot
- jsr old'rom'patch
- lda parms+5
- sta tempy
- jsr paint'line
-
- lda parms
- clc
- adc temp
- tax
- ldy #0
- clc
- jsr plot
- jsr old'rom'patch
- lda parms+4
- sta tempy
- jsr paint'line
-
- jmp menu'wait
-
- paint'line ldy parms+1
- - lda tempy
- sta (243),y
- bmi +
- lda (209),y
- eor #128
- sta (209),y
- + iny
- cpy parms+2
- beq -
- bcc -
- rts
-
- reader lda #147
- jsr chrout
-
- jsr get'string
- jsr setnam
- jsr get'number
- tya
- tax
- lda #2
- ldy #2
- jsr setlfs
- jsr open
- ldx #2
- jsr chkin
-
- - jsr getin
- jsr chrout
- sta 251
- jsr readst
- and #64
- bne eof
- lda 251
- cmp #13
- bne -
- lda 214
- cmp #22
- bcc -
-
- jsr linx
- ldx #24
- ldy #11
- clc
- jsr plot
- inc 199
-
- ldy >reader'text
- lda <reader'text
- jsr strout
-
- jsr clrchn
-
- - jsr getin
- beq -
-
- cmp " "
- bne +
- lda #147
- jsr chrout
- ldx #2
- jsr chkin
- jmp --
-
- + cmp "q"
- bne -
- - lda #2
- jsr close
- jmp clrchn
-
- eof jsr clrchn
- - jsr getin
- beq -
- jmp --
-
-
- ;sys source,end+1,dest
- ;copy =addr
- ;swap =addr+7
- ;ROM in copy =addr+14
-
- copymem lda #0 ;regular copy
- sta 212 ;just using this as a flag
- sec
- bcs get'numbers
- side'door lda #64 ;swap mode
- sta 212
- sec
- bcs get'numbers
-
- trap'door lda #128 ;original rom on
- sta 212
-
- get'numbers jsr get'number
- sty source
- sta source+1
-
- jsr get'number
-
- sty end
- sta end+1
-
- jsr get'number
-
- lda end+1
- cmp source+1 ;is end lower than source?
- beq next'test
- bcs okay
- bcc quit'copy ;if so, bail out
-
- next'test lda end
- cmp source
- bcc quit'copy
- beq quit'copy
-
- okay bit 212 ;leave ROM alone?
- bmi +
-
- sei ;don't interrupt this groove
- lda 1
- pha ;stash I/O status
- lda #$74 ;knock 'em all out
- sta 1
-
- + ldy #0
- - lda (source),y
- bit 212 ;Swap?
- bvc + ;if clear then nope
- pha
- lda (destination),y
- sta (source),y
- pla
- + sta (destination),y
-
- inc source ;increment source and dest
- bne +
- inc source+1
- + inc destination
- bne +
- inc destination+1
-
- + lda source+1 ;finis?
- cmp end+1
- bcc - ;not finished by page
-
- lda source
- cmp end
- bcc - ;just plain not finished
-
- bit 212 ;was I/O reg stashed?
- bmi quit'copy ;if not then don't restore
-
- pla ;get back original I/O reg
- sta 1 ;back to normal
- cli ;interrupts back on
- quit'copy lda #0
- sta 212 ;make sure quote mode is off
- rts
-
- inpanyii jsr get'string
- pha
- tya
- pha
- txa
- pha
- jsr get'number
- sty device
- jsr get'number
- sty sub'low
- sta sub'high
- jsr open'duh'error
- pla
- tax
- pla
- tay
- pla
- jsr setnam
- lda #2
- jsr close
- lda #2
- ldx device
- ldy #2
- jsr setlfs
- jsr open
- jsr clrchn
- jsr read'open'error
- jsr clrchn
- ldx #2
- jsr chkin
- lda buffer
- cmp "0"
- beq get'line
- jsr clear'buffer
- lda #15
- jsr close
- lda #2
- jsr close
- jmp clrchn
-
- get'line ldy #0
- sty ilength
-
- - jsr getin
- cmp #13
- bne +
- - jsr make'warray
- jsr readst
- and #64
- beq get'line
- jmp iquit
-
- + sta buffer,y
- iny
- inc ilength
- cpy #87
- bcc +
- bcs -
-
- + jsr readst
- and #64
- beq --
- bne -
-
- iquit lda sub'low
- ldx sub'high
- stx 202
- sta 201
- jsr make'variable
- lda #2
- jsr close
- jsr clrchn
- jsr read'open'error
- jsr clrchn
- lda #15
- jmp close
-
- make'warray ldy #3
- lda " "
- - sta istring'name+3,y
- dey
- bpl -
-
- lda sub'high
- ldx sub'low
- sta $62
- stx $63
- ldx #$90
- sec
- jsr $bc49
- jsr $bddf
-
- sta 251
- sty 252
-
- ldy #0
-
- - lda (251),y
- beq +
- sta istring'name+3,y
- iny
- cpy #4
- bcc -
-
- + ldx <istring'name
- ldy >istring'name
- jsr locvar
- lda <ilength
- ldy >ilength
- jsr set'string
- inc sub'low
- bne +
- inc sub'high
-
- + jmp clear'buffer
-
- get'word jsr get'number
- sty text
- jsr get'number
- sty menu'highlight
- jsr get'number
- tya
- and #63
- sta limit
-
- lda #0
- sta 56328 ;rem start timer if not on
- sta counter
- sta length
- jsr print'cursor
-
- gget'key jsr getin
- bne key'pressed
- lda 56328
- cmp old'time
- beq gget'key
-
- increment sta old'time
- inc counter
- lda counter
- cmp #3
- bne gget'key
- lda #0
- sta counter
- lda 251
- beq +
- jsr un'print'cursor
- jmp gget'key
- + jsr print'cursor
- jmp gget'key
-
-
- key'pressed sta temp
- ldx length
- beq check'valid
- cpx limit
- bcc check'valid
-
- cmp #13
- beq return
-
- cmp #20
- beq delete
-
- bne gget'key
-
- check'valid ldy #0
-
- - lda validation'string,y
- cmp temp
- beq found'it
- iny
- cpy #vallength
- bne -
- beq gget'key
-
- found'it lda temp
- cmp #13
- beq return
- cmp #20
- beq delete
-
- inc length
- lda temp
- jsr chrout
- jsr print'cursor
- ldy length
- lda temp
- sta buffer,y
- jmp gget'key
-
- return lda length
- sta 252
- sta glength
- ldx <gstring'name
- ldy >gstring'name
- jsr locvar
- lda <glength
- ldy >glength
- jsr set'string
-
- jmp un'print'cursor
-
- delete lda length
- bne +
- jmp gget'key
- + dec length
- lda #157
- jsr chrout
- lda " "
- jsr chrout
- jsr chrout
- lda #157
- jsr chrout
- jsr chrout
- jsr print'cursor
- jmp gget'key
-
-
- print'cursor lda #1
- sta 251
- sta 199
- lda menu'highlight
- sta 646
- lda #32
- jsr chrout
- lda #0
- sta 199
- lda text
- sta 646
- lda #157
- jmp chrout
-
- un'print'cursor lda #0
- sta 251
- sta 199
- lda #32
- jsr chrout
- lda #0
- sta 199
- lda text
- sta 646
- lda #157
- jmp chrout
-
- open'duh'error lda #15
- jsr close
- open'duh'channel lda #15
- ldx device
- ldy #15
- jsr setlfs
- lda #0
- tax
- tay
- jsr setnam
- jmp open
-
- shade'area lda #3
- sta parm'count
- lda #255
- sta shade
- jsr box'ii
- lda #0
- sta shade
- rts
-
- limit =1019
- length =1018
-
- validation'string .asc "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
- .asc " _1234567890+-!#$%&'()<>[]^*.,/:=@\?;"
- .byt 13,20
- vallend =*
- counter =1017
- found =1016
- xpos =1015
- ypos =1014
- old'time =1013
- gstring'name .asc "w$":.byt 0
- glength .byt 0
- .word buffer+1
-
- vallength =vallend-validation'string
-
-
- istring'name .asc "w$(0000)":.byt 0
- ilength .byt 0
- .word buffer
-
- initialize'name =validation'string+8
-
- sub'low =1011
- sub'high =1012
-
- error'flag =1000
- startingx =1001
- endingx =1002
- startingy =1003
- endingy =1004
- direction =1005
- char =1006
- color =1007
- line =1008
- top .word 0
- device =983
- address .buf 2
- that's'it .byt 0
- files .word 0
- file .word 0
- menu'x =990
- menu'y =991
- menu'color =992
- menu'highlight =993
- menu'depth =994
- item =995
- menu'item =996
- tempy =997
-
- parms .buf 8
- string'name .asc "f$":.byt 0
- wlength .byt 0
- .word buffer
- error'name .asc "e$":.byt 0
- elength .byt 0
- .word error'string
- string'length .byt 0
- error'string =buffer
- prompt .asc " crsr/return/stop":.byt 0
- dummy'name .asc "$:j0FfRe^"
- zbuffer .buf 8
- diff =989
- orig =988
- tempx =987
- flag =986
- reader'text .asc " SPACE page/Q quit ":.byt 19,13,0
- text .byt 0
- shade'table .byt 1,15,9,14,2,6,0,5,9,11,2,0,11,5,6,12
- shade =985
- parm'count =984
- .end
-