home *** CD-ROM | disk | FTP | other *** search
- Color80src
- PRG formatted GEOS file V1.0
- CONVERTED WITH GEOSHELL V2.2
- Write Image V2.1
- geoWrite V2.1
- ;*****************************************
- ; Color80src
- ; transient command source code. This command
- ; may be used to set the screen colors while using
- ; geoSHELL in 80 column mode.
- ; Copyright 1994 by Maurice Randall
- ; Charlotte, Mich. 48813
- ; For Use Only By Registered Owners Of The
- ; geoSHELL Programmer's Development Package
- ;*****************************************
- .if Pass1
- .noglbl
- .noeqin
- .include geosSym
- .include geosMac
- .eqin
- .glbl
- .endif
- .psect
- Color80:
- bit screenmode ;what mode are we in?
- bmi 10$ ;branch if 80 columns.
- bvc 5$ ;branch if 128-40.
- jmp Mode_64 ;handle the 64.
- jmp Mode_40_128 ;handle the 128-40.
- jmp Mode_80_128 ;go for it.
- ;a few equates are defined here.
- lftmonlocation = 10
- uppmonlocation = 48
- lftsquare = 44
- topsquare = 48
- toptext = topsquare+6
- ;color selections are stored here.
- tempBackground:
- .block 1
- tempShell:
- .block 1
- tempText:
- .block 1
- tempPad:
- .block 1
- tempBorder:
- .block 1
- ;tell the 64 user that this command only works in 128 mode.
- Mode_64:
- jsr Only128
- jmp NoMoreCmds ;this was in the original source.
- ;Only128 now jumps thro
- ;tell the 64 user that this command only works in 128 mode.
- Mode_64:
- jsr Only128
- jmp NoMoreCmds ;this was in the original source.
- ;Only128 now jumps through NoMoreCmds
- ;making this step unnecessary.
- ;tell the user that this command only works in 80 column mode.
- Mode_40_128:
- LoadW r0,#only80text
- lda #(IN_THREE|TR_CR)
- jsr OtherMessages
- jmp NoMoreCmds
- only80text:
- .byte "This is an 80 column command!",0
- onlycolortext:
- .byte "Issue the RGB command first!",0
- MonitorPic:
- MonPicWidth = picW
- MonPicHeight = picH
- SolidSquare:
- squarewidth = picW
- squareheight = picH
- EmptySquare:
- ;there is a real icon here. It is actually
- ;a blank photo scrap.
- BlankSquare:
- MonitorPic:
- MonPicWidth = picW
- MonPicHeight = picH
- SolidSquare:
- squarewidth = picW
- squareheight = picH
- EmptySquare:
- ;there is a real icon here. It is actually
- ;a blank photo scrap.
- BlankSquare:
- Mode_80_128:
- bit videomode ;are we in color mode?
- bmi 10$ ;branch if so.
- LoadW r0,#onlycolortext
- lda #(IN_THREE|TR_CR)
- jsr OtherMessages ;tell the user to use RGB mode.
- jmp NoMoreCmds ;and exit.
- ldx #0
- Mode_80_128:
- bit videomode ;are we in color mode?
- bmi 10$ ;branch if so.
- LoadW r0,#onlycolortext
- lda #(IN_THREE|TR_CR)
- jsr OtherMessages ;tell the user to use RGB mode.
- jmp NoMoreCmds ;and exit.
- ldx #0
- lda backcolor,x ;move the current colors
- sta tempBackground,x ;to a temporary storage area.
- cpx #5
- bne 20$
- jsr unsetPrompt ;eliminate the cursor blink.
- ;at this point we will set our own colors for color80 independently
- ;of those that may already be set.
- LoadB brdrcolor,#LT80GREY
- jsr SetBrdrColor ;change the border color.
- LoadB backcolor,#LT80GREY ;set the background color.
- LoadB textcolor,#BLACK80 ;set the text color.
- jsr ClearScreen ;now ClearScreen will use our new colors.
- jsr i_BitmapUp ;display the picture of the monitor.
- .word MonitorPic
- .byte lftmonlocation
- .byte uppmonlocation
- .byte MonPicWidth
- .byte MonPicHeight
- jsr SetColTable ;color the little monitor.
- jsr SetIcons ;set up our own icons.
- jsr AddText ;display neccessary text to the screen.
- jsr DispColors ;display the color bar.
- rts ;exit to main loop and let GEOS
- ;get user input for the icons.
- SetIcons:
- LoadW r0,#IconTable
- jsr DoIcons ;point GEOS to our little icons.
- LoadW otherPressVector,#$00 ;make sure this is zero'd for
- ;this command. (geoSHELL leaves the
- ;mouse running)
- jsr MouseOff
- LoadB mouseBottom,#168 ;keep the mouse off the lower part
- ;of the screen. Or it will do
- ;funny things to the screen.
- jmp MouseUp
- IconTable:
- .byte 22
- .word 0
- .byte 0
- IconPointer:
- .word SolidSquare
- .byte lftsquare
- .byte topsquare
- .byte squarewidth
- .byte squareheight
- .word DoColorSource
- .word EmptySquare
- .byte lftsquare
- .byte topsquare+16
- .byte squarewidth
- .byte squareheight
- .word DoColorSource
- .word EmptySquare
- .byte lftsquare
- .byte topsquare+32
- .byte squarewidth
- .byte squareheight
- .word DoColorSource
- .word EmptySquare
- .byte lftsquare
- .byte topsquare+48
- .byte squarewidth
- .byte squareheight
- .word DoColorSource
- .word EmptySquare
- .byte lftsquare
- .byte topsquare+64
- .byte squarewidth
- .byte squareheight
- .word DoColorSource
- .word EmptySquare
- .byte lftsquare
- .byte topsquare+80
- .byte squarewidth
- .byte squareheight
- .word DoExit
- ;the icon table from the previous page continues here.
- ColorIcons:
- .word BlankSquare
- .byte 16,152,3,8
- .word DoCBar
- .word BlankSquare
- .byte 19,152,3,8
- .word DoCBar
- .word BlankSquare
- .byte 22,152,3,8
- ;the icon table from the previous page continues here.
- ColorIcons:
- .word BlankSquare
- .byte 16,152,3,8
- .word DoCBar
- .word BlankSquare
- .byte 19,152,3,8
- .word DoCBar
- .word BlankSquare
- .byte 22,152,3,8
- .word DoCBar
- .word BlankSquare
- .byte 25,152,3,8
- .word DoCBar
- .word BlankSquare
- .byte 28,152,3,8
- .word DoCBar
- .word BlankSquare
- .byte 31,152,3,8
- .word DoCBar
- .word BlankSquare
- .byte 34,152,3,8
- .word DoCBar
- .word BlankSquare
- .byte 37,152,3,8
- .word DoCBar
- .word BlankSquare
- .byte 40,152,3,8
- .word DoCBar
- .word BlankSquare
- .byte 43,152,3,8
- .word DoCBar
- .word BlankSquare
- .byte 46,152,3,8
- .word DoCBar
- .word BlankSquare
- .byte 49,152,3,8
- .word DoCBar
- .word BlankSquare
- .byte 52,152,3,8
- .word DoCBar
- .word BlankSquare
- .byte 55,152,3,8
- .word DoCBar
- .word BlankSquare
- .byte 58,152,3,8
- .word DoCBar
- .word BlankSquare
- .byte 61,152,3,8
- .word DoCBar
- ;this routine just puts the text on the screen that you see when
- ;this routine just puts the text on the screen that you see when
- ;you execute color80. GEOS PutString is used for this.
- AddText:
- jsr i_PutString
- .word 8*lftsquare+48
- .byte toptext
- .byte "Background Color"
- .byte GOTOXY
- .word 8*lftsquare+48
- .byte toptext+16
- .byte "Shell Color"
- .byte GOTOXY
- .word 8*lftsquare+48
- .byte toptext+32
- .byte "Text Color"
- .byte GOTOXY
- .word 8*lftsquare+48
- .byte toptext+48
- .byte "Pad Color"
- .byte GOTOXY
- .word 8*lftsquare+48
- .byte toptext+64
- .byte "Border Color"
- .byte GOTOXY
- .word 8*lftsquare+48
- .byte toptext+80
- .byte "Exit",0
- ;here's where we draw the colorbar that is near the bottom.
- DispColors:
- jsr i_FrameRectangle ;first build a fra
- ;here's where we draw the colorbar that is near the bottom.
- DispColors:
- jsr i_FrameRectangle ;first build a frame around the area.
- .byte 151
- .byte 160
- .word 127
- .word 512
- .byte 255
- lda textcolor ;put the text color into the
- asl a ;high nybble.
- asl a
- asl a
- asl a
- ldx #0
- sta cbarColors,x ;and build a table of colors
- clc ;with each possible background
- adc #1 ;color in the low nybble.
- inx ;we're building the table because
- cpx #16 ;textcolor can vary.
- bne 10$
- LoadW r0,#cbarTable ;use a geoSHELL routine to put the
- LoadW r1,#cbarColors ;colorbar colors on the screen.
- jsr ColorScreen
- ;originally, some more code was
- ;going in here, that's why the jsr
- ;followed by an rts.
- ;this is a table of compressed bytes that ColorScreen recognizes.
- ;refer to the appendix and the ColorScreen routine for info on
- ;how this works. You might call this table a 'color scrap'.
- cbarTable:
- .byte 19,16 ;start at row 19, column 16.
- .byte 1 ;do the next
- .byte 16 ;16 commands one time.
- .byte 3,0,3,1,3,2,3,3,3,4,3,5,3,6,3,7
- .byte 3,8,3,9,3,10,3,11,3,12,3,13,3,14,3,15
- .byte 0 ;a zero command ends the scrap.
- ;this is a table of color combinations that ColorScreen reads
- ;to use with the compressed bytes above. This table is constructed above.
- cbarColors:
- .block 16
- colorsource: ;identifies the area that is currently
- .block 1 ;selected, such as 'Border Color'.
- ;this is jumped to when the user clicks on one of the area icon
- colorsource: ;identifies the area that is currently
- .block 1 ;selected, such as 'Border Color'.
- ;this is jumped to when the user clicks on one of the area icons.
- DoColorSource:
- MoveB r0L,colorsource ;GEOS sets r0L. We save it here.
- jsr ClearSquares ;make all the icons point to an
- ;empty icon picture.
- lda colorsource
- asl a
- asl a
- asl a
- jsr SetSquare ;set one pointer to the icon
- ;that has been clicked on.
- jmp SetIcons ;and let GEOS redraw the icons.
- ;this is jumped to when the user clicks on 'exit'.
- DoExit:
- ldx #0
- lda tempBackground,x ;put all selected colors into
- sta backcolor,x ;the table that geoSHELL sees.
- cpx #5
- bne 10$
- jsr ClearScreen ;clear the entire screen.
- jsr ReDoWindow ;and get the geoSHELL window back.
- jsr R_Icons ;make sure the default icon is set.
- jmp ExitCommand ;and exit cleanly.
- ;point all icons in the table at an empty square.
- ClearSquares:
- ldx #0
- lda #[EmptySquare
- sta IconPointer,x
- lda #]EmptySquare
- sta IconPointer+1,x
- adc #8
- cpx #40
- bcc 10$
- ;point the desired icon at a solid square.
- SetSquare:
- lda #[SolidSquare
- sta IconPointer,x
- lda #]SolidSquare
- sta IconPointer+1,x
- ;when the user clic
- ;when the user clicks on a color in the colorbar, GEOS jumps here.
- DoCBar:
- lda r0L
- sbc #6
- ldx colorsource ;get the current area that we will change.
- sta tempBackground,x ;and store the color there.
- jsr SetColTable ;this should have been made to just
- rts ;jump through to the next routine.
- ;here is where we change the colors on the color80 screen as the
- ;user selects a different color for a certain area. This will
- ;alter the color table that ColorScreen will use when it colors
- ;the little monitor that is drawn on the screen.
- SetColTable:
- lda tempBorder
- asl a
- asl a
- asl a
- asl a
- ora tempBackground
- sta ColMon0
- lda tempShell
- asl a
- asl a
- asl a
- asl a
- ora tempPad
- sta ColMon1
- lda tempText
- asl a
- asl a
- asl a
- asl a
- ora tempPad
- sta ColMon2
- LoadW r0,#ColMonTable ;point r0
- LoadW r1,#ColMon0 ;and r1
- jmp ColorScreen ;and recolor the little monitor.
- ;this is the color scrap that is used to color the little monitor.
- ColMo
- ;this is the color scrap that is used to color the little monitor.
- ColMonTable:
- .byte uppmonlocation/8+1
- .byte lftmonlocation+2
- .byte 1,4
- .byte 27,0,53,255,3,0,21,1
- .byte 3,6
- .byte 3,0,53,255,3,0,1,1,19,2,1,1
- .byte 1,9
- .byte 3,0,53,255,3,0,21,1,3,0,53,255,27,0,53,255,27,0
- .byte 0
- ;and this is the table of colors that is used with the color scrap
- ;for the little monitor.
- ;for this we only need three different color combinations to
- ;color the little monitor on the screen.
- ;this table is built as the user clicks on the colorbar.
- ColMon0:
- .block 1
- ColMon1:
- .block 1
- ColMon2:
- .block 1
- DDD@!!
- ta ColMon0
- lda tempShell
- asl a
- asl a
- asl a
- asl a
- ora tempPad
- sta ColMon1
- lda tempText
- asl a
- asl a
- ta ColMon0
- lda tempShell
- asl a
- asl a
- asl a
- asl a
- ora tempPad
- sta ColMon1
- lda tempText
- asl a
- asl a
- asl a
- asl a
- ora tempPad
- sta ColMon2
- LoadW r0,#ColMonTable ;point r0
- LoadW r1,#ColMon0 ;and r1
- ta ColMon0
- lda tempShell
- asl a
- asl a
- asl a
- asl a
- ora tempPad
- sta ColMon1
- lda tempText
- asl a
- asl a
- asl a
- asl a
- ora tempPad
- sta ColMon2
- LoadW r0,#ColMonTable ;point r0
- LoadW r1,#ColMon0 ;and r1
- jmp Colo
-