home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Transactor
/
Transactor_24_1988_Transactor_Publishing.d64
/
geosdemo_pal
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
11KB
|
625 lines
1000 ;
1005 ;rem save"geosdemo/pal",8
1010 ;
1015 ;rem f.g.kostella 12/10/87
1020 ;
1025 * = $0304
1030 ;
1035 ;zpage pseudoregisters
1040 ;
1045 r0 = $02
1050 r0l = $02
1055 r0h = $03
1060 r1 = $04
1065 r1l = $04
1070 r1h = $05
1075 r11 = $18
1080 r11l = $18
1085 r11h = $19
1090 ;
1095 ;geos routines
1100 ;
1105 domenu = $c151
1110 redomenu = $c193
1115 dopreviousme = $c190 ;dopreviousmenu
1120 gotofirstmen = $c1bd ;gotofirstmenu
1125 drawline = $c130
1130 setpattern = $c139
1135 drawpoint = $c133
1140 rectangle = $c124
1145 i.rectangle = $c19f
1150 framerectang = $c127 ;framerectangle
1155 i.framerecta = $c1a2 ;i.framerectangle
1160 bitmapup = $c124
1165 i.bitmapup = $c1ab
1170 doicons = $c15a
1175 dodlgbox = $c256
1180 rstrfrmdialo = $c2bf ;rstrfrmdialog
1185 putstring = $c148
1190 i.putstring = $c1ae
1195 putdecimal = $c184
1200 enterdesktop = $c22c
1205 ;
1210 stringfaultv = $84ab ;stringfaultvector
1215 sysdbdata = $851d
1220 ;
1225 ;------------------------------
1230 ;header block starts at $0304
1235 ;ram based assemblers may need
1240 ;to change start address.
1245 ;------------------------------
1250 ;-assemble the header block here-
1255 ; -note-
1260 ;1st 4 bytes commented out here
1265 ;they will be placed in the
1270 ;geos file header by "maketogeos"
1275 ;.byte 0,255 ; 1 sector
1280 ;.byte 3,21 ; 3x21 icon
1285 ;--------------------------------
1290 ;define icon to appear on desk top
1295 .byte $bf ;$80 (straight bitmap) + 63 data bytes
1300 .byte %11111111,%11111111,%11111000
1305 .byte %10000000,%00000000,%00001000
1310 .byte %10000000,%00000000,%00001000
1315 .byte %10011101,%11011101,%11001111
1320 .byte %10001001,%00010000,%10001111
1325 .byte %10001001,%11001000,%10001111
1330 .byte %10001001,%00000100,%10001111
1335 .byte %10001001,%11011100,%10001111
1340 .byte %10000000,%00000000,%00001111
1345 .byte %10000000,%00000000,%00001111
1350 .byte %10011101,%11010001,%11001111
1355 .byte %10010000,%10010001,%00001111
1360 .byte %10011100,%10010001,%11001111
1365 .byte %10010000,%10010001,%00001111
1370 .byte %10010001,%11011101,%11001111
1375 .byte %10000000,%00000000,%00001111
1380 .byte %10000000,%00000000,%00001111
1385 .byte %11111111,%11111111,%11111111
1390 .byte %00011111,%11111111,%11111111
1395 .byte %00011111,%11111111,%11111111
1400 .byte %00011111,%11111111,%11111111
1405 ;
1410 .byte $83 ;c64 filetype usr
1415 .byte 6 ;application
1420 .byte 0 ;geos seq file
1425 ;
1430 .word startaddress ;load start addr
1435 .word endofcode ;load end addr
1440 .word startjump ;start addr jump
1445 ;
1450 .byte 'filename v1.1' ;perm name string
1455 .byte 0,0,0,0 ;
1460 .byte 'author name '
1465 ;
1470 ;the rest of the header block
1475 ;is not used in this file
1480 ;
1485 ; ------------------------------
1490 ;ram based assemblers change addr
1495 * =$0400
1500 ; ------------------------------
1505 ;
1510 startaddress =* ;save start
1515 startjump =*
1520 ;
1525 ; clean screen
1530 lda #0
1535 jsr setpattern
1540 jsr i.rectangle
1545 .byte 0
1550 .byte 199
1555 .word 0
1560 .word 319
1565 lda #$ff
1570 jsr framerectang
1575 ;
1580 ;1 icon required at all times, so
1585 ;
1590 ldx #<dumbicondata ;dummy until
1595 ldy #>dumbicondata ;we need one
1600 stx r0l
1605 sty r0h
1610 jsr doicons
1615 ; menus
1620 ldx #<ourmenu
1625 ldy #>ourmenu
1630 stx r0l
1635 sty r0h
1640 lda #1
1645 jsr domenu
1650 ; that's all!, rts to main loop
1655 rts
1660 ;==============================
1665 dumbicondata =*
1670 .byte 1 ;# of icons
1675 .word 319 ;leave mouse x pos,
1680 .byte 199 ;y pos
1685 ;
1690 .word 0 ;icon bitmap addr
1695 .byte 36,1 ;h pos.byte(/8),v pos. pixel
1700 .byte 1,1 ;w+h
1705 .word 0 ;dispatch rtn
1710 ;===============================
1715 ;... menu structure...
1720 ourmenu =*
1725 .byte 0 ;main top
1730 .byte 13 ;main bottom
1735 .word 0 ;main left
1740 .word 80 ;main right
1745 .byte 2 ;horz ($00) or'ed w/ # menu items
1750 ;
1755 .word filemenutext
1760 .byte $80 ;sub menu constant
1765 .word filemenu ;rtn
1770 ;
1775 .word operatetext
1780 .byte $80
1785 .word operatemenu
1790 ;
1795 ;text for main selections
1800 filemenutext .byte 'file'
1805 .byte 0
1810 operatetext .byte 'operations'
1815 .byte 0
1820 ;
1825 ;..submenus...
1830 ;
1835 filemenu =*
1840 .byte 13
1845 .byte 27
1850 .word 0
1855 .word 33
1860 .byte $81 ;vert ored w/ # items
1865 ;
1870 .word filequittext
1875 .byte 0 ;menu action
1880 .word doexit ;rtn
1885 ;
1890 filequittext .byte 'quit'
1895 .byte 0
1900 ;
1905 doexit =*
1910 jmp enterdesktop
1915 ;
1920 operatemenu =*
1925 .byte 13,55 ;top,bot
1930 .word 23,80 ;left,right
1935 .byte $83 ;vertical or'd w/ #
1940 ;
1945 .word op0text
1950 .byte 0 ;menu action
1955 .word op0rtn
1960 ;
1965 .word op1text
1970 .byte 0
1975 .word mover
1980 ;
1985 .word op2text
1990 .byte 0
1995 .word sizer
2000 ;
2005 op0text .byte 'pattern'
2010 .byte 0
2015 op1text .byte 'mover'
2020 .byte 0
2025 op2text .byte 'sizer'
2030 .byte 0
2035 ;-------------------------
2040 ourpattern .word 0
2045 ;
2050 op0rtn =*
2055 jsr gotofirstmen
2060 ;
2065 lda ourpattern
2070 and #%00011111
2075 sta ourpattern
2080 jsr setpattern
2085 jsr i.rectangle
2090 .byte 13
2095 .byte 199
2100 .word 0
2105 .word 319
2110 lda #$ff
2115 jsr framerectang
2120 ;
2125 jsr i.putstring
2130 .word 92
2135 .byte 10
2140 .byte 'pattern: '
2145 .byte 0
2150 ;
2155 ldx #132
2160 ldy #0
2165 stx r11l
2170 sty r11h
2175 ldy #10
2180 sty r1+1
2185 ldx ourpattern
2190 ldy #0
2195 stx r0
2200 sty r0+1
2205 lda #%11000000
2210 jsr putdecimal
2215 ;
2220 inc ourpattern
2225 rts
2230 ;
2235 ;---------------------------
2240 ;values used to add to pos bytes
2245 dbtop .byte 0
2250 dbbottom .byte 0
2255 dbleft .byte 0
2260 dbright .byte 0
2265 ;=====
2270 mover =*
2275 jsr gotofirstmen
2280 ;
2285 dodbagain =*
2290 jsr clearadder
2295 ldx #<ourdbtable
2300 ldy #>ourdbtable
2305 stx r0l
2310 sty r0h
2315 jsr dodlgbox
2320 lda r0 ;returned by db
2325 bmi doourrtns
2330 ; its 'ok'
2335 rts
2340 ;
2345 doourrtns =*
2350 cmp #$82
2355 bcs ourrtns1
2360 lda #2
2365 sta dbtop
2370 sta dbbottom
2375 jsr dbsubtract
2380 jmp ourrtns4
2385 ;
2390 ourrtns1 =*
2395 cmp #$83
2400 bcs ourrtns2
2405 lda #2
2410 sta dbleft
2415 sta dbright
2420 jsr dbsubtract
2425 jmp ourrtns4
2430 ;
2435 ourrtns2 =*
2440 cmp #$84
2445 bcs ourrtns3
2450 lda #2
2455 sta dbtop
2460 sta dbbottom
2465 jsr dbadd
2470 jmp ourrtns4
2475 ;
2480 ourrtns3 =*
2485 lda #2
2490 sta dbleft
2495 sta dbright
2500 jsr dbadd
2505 ;
2510 ourrtns4 =*
2515 jsr displayvals
2520 jmp dodbagain
2525 ;
2530 ;-----------------------------
2535 ;use the same db, process
2540 ;the results differently
2545 ;
2550 sizer =*
2555 jsr gotofirstmen
2560 ;
2565 dodbagainz =*
2570 jsr clearadder
2575 ldx #<ourdbtable
2580 ldy #>ourdbtable
2585 stx r0l
2590 sty r0h
2595 jsr dodlgbox
2600 lda r0 ;returned by db
2605 bmi doourrtnsz
2610 rts
2615 ;
2620 doourrtnsz =*
2625 cmp #$82
2630 bcs ourrtns1z
2635 lda #2
2640 sta dbtop
2645 jsr dbsubtract
2650 jsr clearadder
2655 lda #2
2660 sta dbbottom
2665 jsr dbadd
2670 jmp ourrtns4z
2675 ;
2680 ourrtns1z =*
2685 cmp #$83
2690 bcs ourrtns2z
2695 lda #2
2700 sta dbleft
2705 jsr dbsubtract
2710 jsr clearadder
2715 lda #2
2720 sta dbright
2725 jsr dbadd
2730 jmp ourrtns4z
2735 ;
2740 ourrtns2z =*
2745 cmp #$84
2750 bcs ourrtns3z
2755 lda #2
2760 sta dbtop
2765 jsr dbadd
2770 jsr clearadder
2775 lda #2
2780 sta dbbottom
2785 jsr dbsubtract
2790 jmp ourrtns4z
2795 ;
2800 ourrtns3z =*
2805 lda #2
2810 sta dbleft
2815 jsr dbadd
2820 jsr clearadder
2825 lda #2
2830 sta dbright
2835 jsr dbsubtract
2840 ;
2845 ourrtns4z =*
2850 jsr displayvals
2855 jmp dodbagainz
2860 ;
2865 ;----------db subs--------------
2870 ;
2875 clearadder =*
2880 lda #0
2885 sta dbtop
2890 sta dbbottom
2895 sta dbleft
2900 sta dbright
2905 rts
2910 ;
2915 dbsubtract =*
2920 sec
2925 lda ourdbtable+1 ;top of db
2930 sbc dbtop
2935 sta ourdbtable+1
2940 sec
2945 lda ourdbtable+2 ;bot of db
2950 sbc dbbottom
2955 sta ourdbtable+2
2960 sec
2965 lda ourdbtable+3 ;left of db
2970 sbc dbleft
2975 sta ourdbtable+3
2980 lda ourdbtable+4
2985 sbc #0
2990 sta ourdbtable+4
2995 sec
3000 lda ourdbtable+5 ;rightt of db
3005 sbc dbright
3010 sta ourdbtable+5
3015 lda ourdbtable+6
3020 sbc #0
3025 sta ourdbtable+6
3030 rts
3035 ;
3040 dbadd =*
3045 clc
3050 lda ourdbtable+1 ;top of db
3055 adc dbtop
3060 sta ourdbtable+1
3065 clc
3070 lda ourdbtable+2 ;bot of db
3075 adc dbbottom
3080 sta ourdbtable+2
3085 clc
3090 lda ourdbtable+3 ;left of db
3095 adc dbleft
3100 sta ourdbtable+3
3105 lda ourdbtable+4
3110 adc #0
3115 sta ourdbtable+4
3120 clc
3125 lda ourdbtable+5 ;rightt of db
3130 adc dbright
3135 sta ourdbtable+5
3140 lda ourdbtable+6
3145 adc #0
3150 sta ourdbtable+6
3155 rts
3160 ;
3165 ;
3170 displayvals =*
3175 ;
3180 lda #0
3185 jsr setpattern
3190 jsr i.rectangle
3195 .byte 1
3200 .byte 11
3205 .word 239
3210 .word 318
3215 ;
3220 ldx #210
3225 ldy #0
3230 stx r11l
3235 sty r11h
3240 ldy #10
3245 sty r1h
3250 ldx ourdbtable+1
3255 ldy #0
3260 stx r0l
3265 sty r0h
3270 lda #%11000000
3275 jsr putdecimal
3280 ;
3285 ldx #235
3290 ldy #0
3295 stx r11l
3300 sty r11h
3305 ldx ourdbtable+2
3310 ldy #0
3315 stx r0
3320 sty r0h
3325 lda #%11000000
3330 jsr putdecimal
3335 ;
3340 ldx #4
3345 ldy #1
3350 stx r11l
3355 sty r11h
3360 ldx ourdbtable+3
3365 ldy ourdbtable+4
3370 stx r0
3375 sty r0h
3380 lda #%11000000
3385 jsr putdecimal
3390 ;
3395 ldx #29
3400 ldy #1
3405 stx r11l
3410 sty r11h
3415 ldx ourdbtable+5
3420 ldy ourdbtable+6
3425 stx r0
3430 sty r0h
3435 lda #%11000000
3440 jsr putdecimal
3445 rts
3450 ;------------------------------
3455 ourdbtable =*
3460 ;
3465 .byte $01 ;pos/shadow patrn
3470 ;
3475 .byte 50 ;top
3480 .byte 86 ;bott
3485 .word 48 ;left
3490 .word 120 ;right
3495 ;
3500 .byte 1 ;ok
3505 .byte 1 ;x byt
3510 .byte 16 ;y pixel
3515 ;
3520 .byte $12 ;user icon
3525 .byte 1 ;x offset
3530 .byte 4 ;y offset
3535 .word dbicon1 ;addr of icon table
3540 ;
3545 .byte $12
3550 .byte 3,4
3555 .word dbicon2
3560 ;
3565 .byte $12
3570 .byte 5,4
3575 .word dbicon3
3580 ;
3585 .byte $12
3590 .byte 7,4
3595 .word dbicon4
3600 ;
3605 .byte 0 ;end
3610 ;--------------------------
3615 ;db user icon tables, graphics
3620 ;& service routines for mover
3625 ;
3630 dbicon1 =*
3635 .word dbi1bitmap ;addr of picture data
3640 .byte 0,0 ;x,y-already set!
3645 .byte 1 ;bytes wide
3650 .byte 8 ;pixels hi
3655 .word dbi1rtn ;addr of svc rtn
3660 ;
3665 dbi1bitmap =*
3670 ;
3675 .byte $88 ;format 2, use the next 8 bytes
3680 .byte %11111111
3685 .byte %11100111
3690 .byte %11000011
3695 .byte %10000001
3700 .byte %11100111
3705 .byte %11100111
3710 .byte %11100111
3715 .byte %11111111
3720 ;
3725 dbi1rtn =*
3730 ;
3735 lda #$81
3740 sta sysdbdata
3745 ; and get out
3750 jmp rstrfrmdialo
3755 ; -------------------------
3760 dbicon2 =*
3765 .word dbi2bitmap
3770 .byte 0,0,1,8
3775 .word dbi2rtn
3780 ;
3785 dbi2bitmap =*
3790 .byte $88
3795 .byte %11111111
3800 .byte %11101111
3805 .byte %11001111
3810 .byte %10000001
3815 .byte %10000001
3820 .byte %11001111
3825 .byte %11101111
3830 .byte %11111111
3835 ;
3840 dbi2rtn =*
3845 lda #$82
3850 sta sysdbdata
3855 jmp rstrfrmdialo
3860 ;
3865 ;
3870 dbicon3 =*
3875 .word dbi3bitmap
3880 .byte 0,0,1,8
3885 .word dbi3rtn
3890 ;
3895 dbi3bitmap =*
3900 .byte $88
3905 .byte %11111111
3910 .byte %11100111
3915 .byte %11100111
3920 .byte %11100111
3925 .byte %10000001
3930 .byte %11000011
3935 .byte %11100111
3940 .byte %11111111
3945 ;
3950 dbi3rtn =*
3955 ;
3960 lda #$83
3965 sta sysdbdata
3970 jmp rstrfrmdialo
3975 ; -------------------------
3980 ;
3985 ;
3990 dbicon4 =*
3995 .word dbi4bitmap
4000 .byte 0,0,1,8
4005 .word dbi4rtn
4010 ;
4015 dbi4bitmap =*
4020 ;
4025 .byte $88
4030 .byte %11111111
4035 .byte %11110111
4040 .byte %11110011
4045 .byte %10000001
4050 .byte %10000001
4055 .byte %11110011
4060 .byte %11110111
4065 .byte %11111111
4070 ;
4075 dbi4rtn =*
4080 lda #$84
4085 sta sysdbdata
4090 jmp rstrfrmdialo
4095 ;
4100 endofcode =*
4105 .end
4110 ;
4115 thats all folks!!