home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Transactor
/
Transactor_24_1988_Transactor_Publishing.d64
/
geosdemo_mads
< prev
next >
Wrap
Text File
|
2023-02-26
|
9KB
|
625 lines
;
;put"geosdemo/mads"
;
;f.g.kostella 12/10/87
;
* = $0304
;
;zpage pseudoregisters
;
r0 = $02
r0l = $02
r0h = $03
r1 = $04
r1l = $04
r1h = $05
r11 = $18
r11l = $18
r11h = $19
;
;geos routines
;
domenu = $c151
redomenu = $c193
dopreviousme = $c190 ;dopreviousmenu
gotofirstmen = $c1bd ;gotofirstmenu
drawline = $c130
setpattern = $c139
drawpoint = $c133
rectangle = $c124
i.rectangle = $c19f
framerectang = $c127 ;framerectangle
i.framerecta = $c1a2 ;i.framerectangle
bitmapup = $c124
i.bitmapup = $c1ab
doicons = $c15a
dodlgbox = $c256
rstrfrmdialo = $c2bf ;rstrfrmdialog
putstring = $c148
i.putstring = $c1ae
putdecimal = $c184
enterdesktop = $c22c
;
stringfaultv = $84ab ;stringfaultvector
sysdbdata = $851d
;
;------------------------------
;header block starts at $0304
;ram based assemblers may need
;to change start address.
;------------------------------
;-assemble the header block here-
; -note-
;1st 4 bytes commented out here
;they will be placed in the
;geos file header by "maketogeos"
;.byte 0,255 ; 1 sector
;.byte 3,21 ; 3x21 icon
;--------------------------------
;define icon to appear on desk top
.byte $bf ;$80 (straight bitmap) + 63 data bytes
.byte %11111111,%11111111,%11111000
.byte %10000000,%00000000,%00001000
.byte %10000000,%00000000,%00001000
.byte %10011101,%11011101,%11001111
.byte %10001001,%00010000,%10001111
.byte %10001001,%11001000,%10001111
.byte %10001001,%00000100,%10001111
.byte %10001001,%11011100,%10001111
.byte %10000000,%00000000,%00001111
.byte %10000000,%00000000,%00001111
.byte %10011101,%11010001,%11001111
.byte %10010000,%10010001,%00001111
.byte %10011100,%10010001,%11001111
.byte %10010000,%10010001,%00001111
.byte %10010001,%11011101,%11001111
.byte %10000000,%00000000,%00001111
.byte %10000000,%00000000,%00001111
.byte %11111111,%11111111,%11111111
.byte %00011111,%11111111,%11111111
.byte %00011111,%11111111,%11111111
.byte %00011111,%11111111,%11111111
;
.byte $83 ;c64 filetype usr
.byte 6 ;application
.byte 0 ;geos seq file
;
.word startaddress ;load start addr
.word endofcode ;load end addr
.word startjump ;start addr jump
;
.byte 'filename v1.1' ;perm name string
.byte 0,0,0,0 ;
.byte 'author name '
;
;the rest of the header block
;is not used in this file
;
; ------------------------------
;ram based assemblers change addr
* =$0400
; ------------------------------
;
startaddress =* ;save start
startjump =*
;
; clean screen
lda #0
jsr setpattern
jsr i.rectangle
.byte 0
.byte 199
.word 0
.word 319
lda #$ff
jsr framerectang
;
;1 icon required at all times, so
;
ldx #<dumbicondata ;dummy until
ldy #>dumbicondata ;we need one
stx r0l
sty r0h
jsr doicons
; menus
ldx #<ourmenu
ldy #>ourmenu
stx r0l
sty r0h
lda #1
jsr domenu
; that's all!, rts to main loop
rts
;==============================
dumbicondata =*
.byte 1 ;# of icons
.word 319 ;leave mouse x pos,
.byte 199 ;y pos
;
.word 0 ;icon bitmap addr
.byte 36,1 ;h pos.byte(/8),v pos. pixel
.byte 1,1 ;w+h
.word 0 ;dispatch rtn
;===============================
;... menu structure...
ourmenu =*
.byte 0 ;main top
.byte 13 ;main bottom
.word 0 ;main left
.word 80 ;main right
.byte 2 ;horz ($00) or'ed w/ # menu items
;
.word filemenutext
.byte $80 ;sub menu constant
.word filemenu ;rtn
;
.word operatetext
.byte $80
.word operatemenu
;
;text for main selections
filemenutext .byte 'file'
.byte 0
operatetext .byte 'operations'
.byte 0
;
;..submenus...
;
filemenu =*
.byte 13
.byte 27
.word 0
.word 33
.byte $81 ;vert ored w/ # items
;
.word filequittext
.byte 0 ;menu action
.word doexit ;rtn
;
filequittext .byte 'quit'
.byte 0
;
doexit =*
jmp enterdesktop
;
operatemenu =*
.byte 13,55 ;top,bot
.word 23,80 ;left,right
.byte $83 ;vertical or'd w/ #
;
.word op0text
.byte 0 ;menu action
.word op0rtn
;
.word op1text
.byte 0
.word mover
;
.word op2text
.byte 0
.word sizer
;
op0text .byte 'pattern'
.byte 0
op1text .byte 'mover'
.byte 0
op2text .byte 'sizer'
.byte 0
;-------------------------
ourpattern .word 0
;
op0rtn =*
jsr gotofirstmen
;
lda ourpattern
and #%00011111
sta ourpattern
jsr setpattern
jsr i.rectangle
.byte 13
.byte 199
.word 0
.word 319
lda #$ff
jsr framerectang
;
jsr i.putstring
.word 92
.byte 10
.byte 'pattern: '
.byte 0
;
ldx #132
ldy #0
stx r11l
sty r11h
ldy #10
sty r1+1
ldx ourpattern
ldy #0
stx r0
sty r0+1
lda #%11000000
jsr putdecimal
;
inc ourpattern
rts
;
;---------------------------
;values used to add to pos bytes
dbtop .byte 0
dbbottom .byte 0
dbleft .byte 0
dbright .byte 0
;=====
mover =*
jsr gotofirstmen
;
dodbagain =*
jsr clearadder
ldx #<ourdbtable
ldy #>ourdbtable
stx r0l
sty r0h
jsr dodlgbox
lda r0 ;returned by db
bmi doourrtns
; its 'ok'
rts
;
doourrtns =*
cmp #$82
bcs ourrtns1
lda #2
sta dbtop
sta dbbottom
jsr dbsubtract
jmp ourrtns4
;
ourrtns1 =*
cmp #$83
bcs ourrtns2
lda #2
sta dbleft
sta dbright
jsr dbsubtract
jmp ourrtns4
;
ourrtns2 =*
cmp #$84
bcs ourrtns3
lda #2
sta dbtop
sta dbbottom
jsr dbadd
jmp ourrtns4
;
ourrtns3 =*
lda #2
sta dbleft
sta dbright
jsr dbadd
;
ourrtns4 =*
jsr displayvals
jmp dodbagain
;
;-----------------------------
;use the same db, process
;the results differently
;
sizer =*
jsr gotofirstmen
;
dodbagainz =*
jsr clearadder
ldx #<ourdbtable
ldy #>ourdbtable
stx r0l
sty r0h
jsr dodlgbox
lda r0 ;returned by db
bmi doourrtnsz
rts
;
doourrtnsz =*
cmp #$82
bcs ourrtns1z
lda #2
sta dbtop
jsr dbsubtract
jsr clearadder
lda #2
sta dbbottom
jsr dbadd
jmp ourrtns4z
;
ourrtns1z =*
cmp #$83
bcs ourrtns2z
lda #2
sta dbleft
jsr dbsubtract
jsr clearadder
lda #2
sta dbright
jsr dbadd
jmp ourrtns4z
;
ourrtns2z =*
cmp #$84
bcs ourrtns3z
lda #2
sta dbtop
jsr dbadd
jsr clearadder
lda #2
sta dbbottom
jsr dbsubtract
jmp ourrtns4z
;
ourrtns3z =*
lda #2
sta dbleft
jsr dbadd
jsr clearadder
lda #2
sta dbright
jsr dbsubtract
;
ourrtns4z =*
jsr displayvals
jmp dodbagainz
;
;----------db subs--------------
;
clearadder =*
lda #0
sta dbtop
sta dbbottom
sta dbleft
sta dbright
rts
;
dbsubtract =*
sec
lda ourdbtable+1 ;top of db
sbc dbtop
sta ourdbtable+1
sec
lda ourdbtable+2 ;bot of db
sbc dbbottom
sta ourdbtable+2
sec
lda ourdbtable+3 ;left of db
sbc dbleft
sta ourdbtable+3
lda ourdbtable+4
sbc #0
sta ourdbtable+4
sec
lda ourdbtable+5 ;rightt of db
sbc dbright
sta ourdbtable+5
lda ourdbtable+6
sbc #0
sta ourdbtable+6
rts
;
dbadd =*
clc
lda ourdbtable+1 ;top of db
adc dbtop
sta ourdbtable+1
clc
lda ourdbtable+2 ;bot of db
adc dbbottom
sta ourdbtable+2
clc
lda ourdbtable+3 ;left of db
adc dbleft
sta ourdbtable+3
lda ourdbtable+4
adc #0
sta ourdbtable+4
clc
lda ourdbtable+5 ;rightt of db
adc dbright
sta ourdbtable+5
lda ourdbtable+6
adc #0
sta ourdbtable+6
rts
;
;
displayvals =*
;
lda #0
jsr setpattern
jsr i.rectangle
.byte 1
.byte 11
.word 239
.word 318
;
ldx #210
ldy #0
stx r11l
sty r11h
ldy #10
sty r1h
ldx ourdbtable+1
ldy #0
stx r0l
sty r0h
lda #%11000000
jsr putdecimal
;
ldx #235
ldy #0
stx r11l
sty r11h
ldx ourdbtable+2
ldy #0
stx r0
sty r0h
lda #%11000000
jsr putdecimal
;
ldx #4
ldy #1
stx r11l
sty r11h
ldx ourdbtable+3
ldy ourdbtable+4
stx r0
sty r0h
lda #%11000000
jsr putdecimal
;
ldx #29
ldy #1
stx r11l
sty r11h
ldx ourdbtable+5
ldy ourdbtable+6
stx r0
sty r0h
lda #%11000000
jsr putdecimal
rts
;------------------------------
ourdbtable =*
;
.byte $01 ;pos/shadow patrn
;
.byte 50 ;top
.byte 86 ;bott
.word 48 ;left
.word 120 ;right
;
.byte 1 ;ok
.byte 1 ;x byt
.byte 16 ;y pixel
;
.byte $12 ;user icon
.byte 1 ;x offset
.byte 4 ;y offset
.word dbicon1 ;addr of icon table
;
.byte $12
.byte 3,4
.word dbicon2
;
.byte $12
.byte 5,4
.word dbicon3
;
.byte $12
.byte 7,4
.word dbicon4
;
.byte 0 ;end
;--------------------------
;db user icon tables, graphics
;& service routines for mover
;
dbicon1 =*
.word dbi1bitmap ;addr of picture data
.byte 0,0 ;x,y-already set!
.byte 1 ;bytes wide
.byte 8 ;pixels hi
.word dbi1rtn ;addr of svc rtn
;
dbi1bitmap =*
;
.byte $88 ;format 2, use the next 8 bytes
.byte %11111111
.byte %11100111
.byte %11000011
.byte %10000001
.byte %11100111
.byte %11100111
.byte %11100111
.byte %11111111
;
dbi1rtn =*
;
lda #$81
sta sysdbdata
; and get out
jmp rstrfrmdialo
; -------------------------
dbicon2 =*
.word dbi2bitmap
.byte 0,0,1,8
.word dbi2rtn
;
dbi2bitmap =*
.byte $88
.byte %11111111
.byte %11101111
.byte %11001111
.byte %10000001
.byte %10000001
.byte %11001111
.byte %11101111
.byte %11111111
;
dbi2rtn =*
lda #$82
sta sysdbdata
jmp rstrfrmdialo
;
;
dbicon3 =*
.word dbi3bitmap
.byte 0,0,1,8
.word dbi3rtn
;
dbi3bitmap =*
.byte $88
.byte %11111111
.byte %11100111
.byte %11100111
.byte %11100111
.byte %10000001
.byte %11000011
.byte %11100111
.byte %11111111
;
dbi3rtn =*
;
lda #$83
sta sysdbdata
jmp rstrfrmdialo
; -------------------------
;
;
dbicon4 =*
.word dbi4bitmap
.byte 0,0,1,8
.word dbi4rtn
;
dbi4bitmap =*
;
.byte $88
.byte %11111111
.byte %11110111
.byte %11110011
.byte %10000001
.byte %10000001
.byte %11110011
.byte %11110111
.byte %11111111
;
dbi4rtn =*
lda #$84
sta sysdbdata
jmp rstrfrmdialo
;
endofcode =*
.end
;
thats all folks!!