home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / genie-commodore-file-library / MRFiles / GS3DVPAK.ARC / MISCSOURCE (.txt) < prev    next >
Encoding:
GEOS ConVerT  |  2019-04-13  |  21.7 KB  |  517 lines

  1. %MiscSource
  2. PRG formatted GEOS file V1.0
  3. CONVERTED WITH GEOSHELL V2.2
  4. Write Image V2.1
  5. geoWrite    V2.1
  6. @MISCELLANEOUS SOURCE CODE
  7. This is a table of contents of the sample source code contained in this file. Feel free to make use of the code contained here for use in your own commands. This helps save time, instead of trying to invent something that has already been done for you. Just use GeoWrite to cut and paste any of these examples into your own source code.
  8. BLANKING AND RESTORING THE 40 COLUMN SCREEN    2
  9.     RstrWindow    2
  10.     BlnkWMessage    3
  11.     BlnkNMessage    4
  12. SENDING DATA TO THE PRINTER    5
  13.     InitPrinter    6
  14.     ByteToPrinter    7
  15. COLORING THE 80 COLUMN SCREEN    8
  16.     Coloring Icons (example)    8
  17.     CloseCommand (example)    8
  18.     icnClrScrap    9
  19.     icnClrCombos    9
  20.     DoColorFrame    10
  21. GIVE geoSHELL COLOR IN 40 COLUMNS    11
  22.     Color40    11
  23.     Add40R0 (used with Color40)    12
  24. SEARCHING THE COMMAND BUFFER    13
  25.     FindSkip    13
  26.     IncR0    14
  27. ;here is the code that will call the routines to blank the 40 column
  28. ;screen and restore them after your command finishes it's task.
  29. ;This method puts a messag
  30. ;here is the code that will call the routines to blank the 40 column
  31. ;screen and restore them after your command finishes it's task.
  32. ;This method puts a message on the bottom of the 40 column screen and
  33. ;also deals with proper handling if the routine is run on an 80 column 128.
  34. ;You will be able to use memory from $a000 to $bdff.
  35. ;If you need the additional 320 bytes that the message on the bottom uses,
  36. ;then use BlnkNMessage in place of BlnkWMessage. BlnkNMessage can be found
  37. ;on the following page. Be sure to call RstrWindow before exiting your command.
  38. ;Also, test your command for anything that might happen while the screen is
  39. ;blanked. You must be able to call RstrWindow to get the window back on the
  40. ;screen for the user.
  41.     ...        ;any code ahead of this...
  42.     jsr    BlnkWMessage    ;blank the screen with a message
  43.             ;at the bottom.
  44.     jsr    DoYourThing    ;this calls your own code.
  45.     jsr    RstrWindow    ;put the geoSHELL window back.
  46.     ...        ;any more additional code....
  47. RstrWindow:
  48.     jsr    StartMouseMode    ;turn the mouse back on.
  49.     bit    screenmode    ;is this 80 column mode?
  50.     bmi    50$    ;branch if so. (80 columns didn't blank)
  51.     jsr    ClearScreen    ;clear the screen.
  52.     jsr    ReDoWindow    ;redraw the window and it's contents.
  53.             ;this is all taking place while the
  54.             ;screen is still blanked, until we
  55.     jsr    FixColors    ;put the color back on the screen.
  56.     jmp    R_Icons    ;do this because the icon gets killed.
  57. ;this routine blanks the 40 column screen and displays a message at the
  58. ;bottom. If in 80 column mode, it will put the same message in the 
  59. ;geoSHELL window since the screen does not have to be blanked. The message
  60. ;will also be placed in the 40 column window in addition to the bottom of
  61. ;the screen.
  62. BlnkWMessage:
  63.     jsr    ClearMouseMode    ;shut the mouse off for now.
  64.     LoadW    r0,#prgrsText    ;point at our message.
  65.     lda    #(IN_ONE|TR_CR)
  66.     jsr    OtherMessage    ;put it on 40 or 80 columns.
  67.     bit    screenmode    ;now check for 80 columns.
  68.     bmi    20$    ;branch if so and skip the rest.
  69.     LoadW    r0,#(24*40)    ;blank only the upper 24 card rows.
  70.     LoadW    r1,#COLOR_MATRIX
  71.     lda    screencolors    ;get the current screencolors.
  72.     and    #%00001111    ;put the background color into
  73.     sta    r2L
  74.     asl    a
  75.     asl    a
  76.     asl    a
  77.     asl    a
  78.     ora    r2L    ;the foreground also.
  79.     sta    r2L
  80.     jsr    FillRam    ;and color the screen.
  81.     PushB    windowBottom    ;make sure that PutString can
  82.     LoadB    windowBottom,#199 ;get down to the bottom of the screen.
  83.     LoadW    r0,#prgrs40Text    ;point r0 for PutString.
  84.     jsr    PutString    ;use GEOS to print this string.
  85.     PopB    windowBottom    ;restore this.
  86.     rts        ;and return.
  87. prgrs40Text:
  88.     .byte    GOTOXY
  89.     .word    24    ;start printing at the 24th pixel.
  90.             ;adjust this for the length of
  91.             ;your message.
  92.     .byte    198
  93. ;put your message here, but leave a leading and trailing space in
  94. ;the message so that the background pattern doesn't brush up against
  95. ;the message, for a better appearance.
  96. prgrsText:
  97.     .byte    " Put Your Message Here... ",0
  98. ;this routine blanks the 40 column screen and allows you to use the
  99. ;entire foreground screen memory area since this routine does not
  100. ;put a message at the bottom of the screen. 
  101. ;80 column mode is still dealt with properly here. The message in this
  102. ;routine will only appear in the window on both the 40 and 80 column screens
  103. ;and not at the bottom of the screen like it does with BlnkWMessage.
  104. BlnkNMessage:
  105.     jsr    ClearMouseMode    ;shut the mouse off for now.
  106.     LoadW    r0,#prgrsText    ;point at our message.
  107.     lda    #(IN_ONE|TR_CR)
  108.     jsr    OtherMessage    ;put it on 40 or 80 columns.
  109.     bit    screenmode    ;now check for 80 columns.
  110.     bmi    20$    ;branch if so and skip the rest.
  111.     LoadW    r0,#(25*40)    ;blank the entire screen.
  112.     LoadW    r1,#COLOR_MATRIX
  113.     lda    screencolors    ;get the current screencolors.
  114.     and    #%00001111    ;put the background color into
  115.     sta    r2L
  116.     asl    a
  117.     asl    a
  118.     asl    a
  119.     asl    a
  120.     ora    r2L    ;the foreground also.
  121.     sta    r2L
  122.     jsr    FillRam    ;and color the screen.
  123.     rts        ;and return.
  124. prgrsText:
  125.     .byte    "Put Your Message Here...",0
  126. ;These routines will allow you to send data to a printer whether it
  127. ;be connected through the serial port or the user port with a geoCable.
  128. ;Just let InitPrinter and ByteToPrinter know which device y
  129. ;These routines will allow you to send data to a printer whether it
  130. ;be connected through the serial port or the user port with a geoCable.
  131. ;Just let InitPrinter and ByteToPrinter know which device you want data
  132. ;sent to. This example uses a variable printDest to identify that. If
  133. ;bit 7 is set, data goes to serial, bit 6 set goes to geoCable. If both
  134. ;bits are set, data goes to both. The following example will load printDest
  135. ;from a parameter the user supplies and proceed to do it's thing.
  136. ;One thing to keep in mind with using the printer: If you are sending text
  137. ;to a printer and also displaying the same text on the screen using
  138. ;geoSHELL routines, the user will get double copies of the data on the
  139. ;printer if he is using the @p or @g commands. Normally, your use of the
  140. ;printer won't involve sending the same text to the screen anyway.
  141.     ...        ;code leading up to this.
  142.     lda    ParamTable+0
  143.     cmp    #'p'
  144.     beq    10$
  145.     cmp    #'g'
  146.     beq    20$
  147.     jmp    MissgFilename    ;display a bad parameter.
  148.     lda    #%10000000
  149.     .byte    $2c
  150.     lda    #%01000000
  151.     sta    printDest
  152.     ...        ;whatever else code you might have.
  153.     jsr    InitPrinter    ;make sure the printer is there.
  154.     bit    goodflag    ;if the printer is not available
  155.             ;you can deal with it however you wish.
  156.             ;in this case we will just exit.
  157.     bmi    30$    ;branch if printer is ready.
  158.     jmp    NoMoreCmds    ;you might display an error message
  159.             ;before this exit if needed.
  160.     jsr    InitForIO
  161.     ...        ;whatever routines you need to load
  162.     ...        ;the accumulator will go here.
  163.     ...        ;usually from a buffer.
  164.     jsr    ByteToPrinter    ;send the byte in the accumulator
  165.             ;to the printer.
  166.     ...        ;now you either go back and do
  167.     ...        ;some more or just end your command.
  168.     jsr    Unlsn    ;in case we're using the serial printer.
  169.     jsr    DoneWithIO
  170. UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
  171. ;this routine checks to make sure that the printer/s is/are connected and
  172. ;ready to accept data. printDest identifies which port/s to find the
  173. ;printer/s at. After this routine is called, if a serial printer is being
  174. ;used, then it will be left in 'listen' mode on the serial bus. Before any
  175. ;disk access can occur, you must call the kernal routine 'Unlsn'. Then
  176. ;before further access to the printer you will have to call InitPrinter again.
  177. InitPrinter:
  178.     bit    printDest    ;where's the printer?
  179.     bmi    10$    ;branch if serial.
  180.     bvs    50$    ;branch if geoCable.
  181.     bpl    20$    ;branch if neither.
  182.     lda    curPrinter    ;printer device # set by 'pconf'.
  183.     jsr    SetDevice
  184.     jsr    InitForIO    ;pop out of GEOS.
  185.     LoadB    STATUS,#0    ;clear STATUS.
  186.     lda    curPrinter
  187.     jsr    Listen    ;tell the printer to listen.
  188.     lda    curSecond    ;secondary address set by 'pconf'.
  189.     ora    #$60
  190.     jsr    Second    ;send a command to the printer.
  191.     lda    STATUS    ;did the printer respond?
  192.     beq    30$    ;branch if so.
  193.     jsr    Unlsn    ;tell the printer to stop listening.
  194.             ;(what printer? there wasn't any)
  195.     jsr    DoneWithIO    ;pop back into GEOS.
  196.     jmp    nogood
  197.     jsr    DoneWithIO    ;pop back into GEOS.
  198.             ;serial printer is still in
  199.             ;listen mode.
  200.     bit    printDest    ;are we also doing the geoCable?
  201.     bvc    80$    ;branch if not.
  202.     jsr    InitForIO    ;pop out of GEOS.
  203.     jsr    Open_GC_Channel    ;check for a printer on the geoCable.
  204.     txa        ;save it for a second.
  205.     beq    60$    ;branch if printer responded.
  206.     jsr    Unlsn    ;otherwise unlisten the serial bus
  207.             ;in case the serial printer is also set.
  208.     jsr    DoneWithIO    ;pop back into GEOS.
  209.     pla        ;well?
  210.     bne    20$    ;branch if no printer.
  211.     jmp    yesgood
  212. printDest:
  213.     .block    1
  214. ;this routine sends a byte to the printer/s.
  215. ;load the accumulator with the byte to send
  216. ;this routine sends a byte to the printer/s.
  217. ;load the accumulator with the byte to send.
  218. ;printDest identifies which port/s to find the printer/s at.
  219. ;InitForIO must be called before this routine.
  220. ;InitPrinter must be called before this routine.
  221. ;call the kernal routine Unlsn after sending the last byte if a serial
  222. ;printer is being used.
  223. ByteToPrinter:
  224.     sta    byteToPrint
  225.     bit    printDest    ;where's the printer?
  226.     bmi    20$    ;branch if serial.
  227.     bvs    50$    ;branch if geoCable.
  228.     jsr    Ciout
  229.     bit    printDest
  230.     bvc    10$
  231.     lda    byteToPrint
  232.     jmp    Send_GC_Byte
  233. byteToPrint:
  234.     .block    1
  235. he serial printer.
  236.     jsr    DoneWithIO
  237. ;this example will clear the 80 column color mode screen and
  238. ;color some icons that you will place on the screen.
  239. ;the current color bytes that are being altered will be saved and
  240. ;then restored upon exit.
  241. ;Modify this routine and use it as desired.
  242.     bit    screenmode    ;is this a 128?
  243.     bmi    20$    ;branch if so.
  244.     LoadW    r0,#colrOnlyText    ;tell the user this command is
  245.     lda    #(IN_TWO|TR_CR)    ;for 128 color mode only.
  246.     jsr    OtherMessage
  247.     jmp    NoMoreCmds    ;and exit.
  248.     bit    videomode    ;are we in color mode?
  249.     bpl    10$    ;branch if not.
  250.     MoveB    backcolor,sbackcolor ;save the default background color.
  251.     MoveB    textcolor,stextcolor ;save the default foreground color.
  252.     MoveB    brdrcolor,sbrdrcolor ;save the default border color.
  253.     MoveB    clr80pattern,sclr80pattern ;save the default pattern.
  254.     LoadB    backcolor,#WHITE80 ;set background to white.
  255.     LoadB    textcolor,#BLACK80 ;set the foreground color to black.
  256.     LoadB    clr80pattern,#0    ;set background pattern #0
  257.     jsr    ClearScreen    ;clear the screen.
  258.     LoadB    brdrcolor,#WHITE80 ;set the border color
  259.     jsr    SetBrdrColor    ;to white.
  260.     ...        ;through this section, use BitmapUp
  261.     ...        ;to put some icons on the screen
  262.     LoadW    r0,#icnClrScrap    ;call ColorScreen to color the icons.
  263.     LoadW    r1,#icnClrCombos
  264.     jmp    ColorScreen
  265.     ...        ;now you can point GEOS at your own
  266.     ...        ;icon table and rts to mainloop
  267. ;one of the icons could call a routine to exit your command such as follows:
  268. CloseCommand:
  269.     MoveB    sbackcolor,backcolor ;restore the default background color.
  270.     MoveB    stextcolor,textcolor ;restore the default foreground color.
  271.     MoveB    sbrdrcolor,brdrcolor ;restore the default border color.
  272.     MoveB    sclr80pattern,clr80pattern ;restore the default pattern.
  273.     jsr    ClearScreen    ;clear the screen.
  274.     jsr    ReDoWindow    ;put geoSHELL just like it was.
  275.     jmp    ExitCommand    ;and exit.
  276. colrOnlyText:
  277.     .byte    "Command Only Works In 128 Color!",0
  278. sbackcolor:
  279.     .block 1
  280. stextcolor:
  281.     .block 1
  282. sbrdrcolor:
  283.     .block 1
  284. sclr80pattern:
  285.     .block 1
  286. ;this Color Scrap will color 8 ico
  287. ;this Color Scrap will color 8 icons that are placed in two rows of 4
  288. ;similar to the way they are arranged on the Desktop. This only colors the
  289. ;areas of the screen where the icons should be. You use BitmapUp to
  290. ;put the icons in place.
  291. ;To use this Color Scrap, point r0 at icnClrScrap and r1 at IcnClrCombos
  292. ;and then call ColorScreen.
  293. ;To understand this Color Scrap, each icon is 6 cards wide and 3 cards tall.
  294. ;The upper left corner of icon #1 is at row 10, column 10. There are 4
  295. ;icons on this row. There is 6 cards separating each icon. The next row of
  296. ;four icons is directly below the first row of icons and is at row 16.
  297. ;Each icon is given a different color.
  298. ;The third row of bytes in this example is repeated 3 times. It begins
  299. ;at column zero and skips over to column 10 without doing any coloring.
  300. ;Then, 6 cards are colored with color #0 from the color table. 6 more cards
  301. ;are skipped and 6 are colored with color #1. This goes on until the
  302. ;rightmost icon gets it's coloring. Then 28 bytes are skipped to put the
  303. ;pointer at the start of the next row. Now this will repeat to color
  304. ;the second card row of each of the top icons. A similar thing happens
  305. ;for the second row of icons later on as you can see.
  306. ;Modify this for your own use.
  307. icnClrScrap:
  308.     .byte    10,0    ;row 10, column 0
  309.     .byte    3,8    ;repeat 8 commands 3 times.
  310.     .byte    10,255,6,0,6,255,6,1,6,255,6,2,6,255,6,3,28,255
  311.     .byte    255    ;a new position command.
  312.     .byte    16,0    ;row 16, column 0
  313.     .byte    3,8    ;repeat 8 commands 3 times.
  314.     .byte    10,255,6,4,6,255,6,5,6,255,6,6,6,255,6,7,28,255
  315.     .byte        ;end of table.
  316. icnClrCombos:
  317.     .byte    (DK80BLUE<<4)|LT80CYAN ;dk blue foregrnd,light cyan backgrnd.
  318.     .byte    (BLACK80<<4)|LT80YELLOW
  319.     .byte    (DK80PURPLE<<4)|WHITE80
  320.     .byte    (DK80RED<<4)|LT80RED
  321.     .byte    (LT80GREY<<4)|BLACK80
  322.     .byte    (DK80BLUE<<4)|LT80GREY
  323.     .byte    (DK80GREEN<<4)|BLACK80
  324.     .byte    (WHITE80<<4)|DK80RED
  325. ;this example will draw a framed rectangle and then color the
  326. ;frame of the rectangle and the space
  327. ;this example will draw a framed rectangle and then color the
  328. ;frame of the rectangle and the space within the rectangle.
  329. ;This particular rectangle will be drawn exactly where the
  330. ;geoSHELL window resides. It will be given a black frame, while the space
  331. ;inside the rectangle will have a white background with a dark blue
  332. ;foreground. This example only works in 80 column color mode.
  333. ;Modify this for your own use.
  334. DoColorFrame:
  335.     jsr    ClearScreen    ;clear the screen with default
  336.             ;foreground and background colors
  337.             ;and background pattern.
  338.     lda    #0    ;use pattern number #0.
  339.     jsr    SetPattern
  340.     jsr    i_Rectangle    ;draw the rectangle.
  341.     .byte    32,167
  342.     .word    16,607
  343.     jsr    i_FrameRectangle    ;and put a frame around it.
  344.     .byte    32,167
  345.     .word    16,607
  346.     .byte    255
  347.     LoadW    r0,#frameScrap
  348.     LoadW    r1,#frameColors
  349.     jmp    ColorScreen
  350. frameScrap:
  351.     .byte    4,2    ;row 4, column 2
  352.     .byte    1,1    ;repeat 1 command set once.
  353.     .byte    74,0    ;color 74 cards, the top of the rectangle.
  354.     .byte    15,5    ;repeate 5 command sets 15 times. 
  355.     .byte    2,255,1,0,72,1,1,0,4,255
  356.             ;color the next 15 rows of the 
  357.             ;rectangle.
  358.     .byte    1,2    ;repeat 2 commands sets once.
  359.     .byte    2,255,74,0    ;color the bottom of the rectangle.
  360.     .byte    0
  361. ;use two different color combinations with this rectangle.
  362. frameColors:
  363.     .byte    (BLACK80<<4)|WHITE80
  364.     .byte    (DK80BLUE<<4)|WHITE80
  365. ;here is a routine that would give color to geoSHELL when in 40 column mode.
  366. ;Just change the equates here to whatever you like.
  367. ;geoSHELL has a built-in
  368. ;here is a routine that would give color to geoSHELL when in 40 column mode.
  369. ;Just change the equates here to whatever you like.
  370. ;geoSHELL has a built-in routine for doing this same thing in 80
  371. ;column mode. The routine is called ColorScreen. It is much simpler
  372. ;to create a Color Scrap for that routine to use. For the 40 column
  373. ;screen, though, geoSHELL has no coloring routines except for FixColors
  374. ;which restores the original screen colors (one foreground and one
  375. ;background color).
  376. BACKBACK    = LTBLUE    ;background color in background area.
  377. BACKFORE    = BLUE    ;foreground color in background area.
  378. SHELLCLR    = RED    ;frame color of geoSHELL.
  379. PADCLR    = WHITE    ;pad color of geoSHELL.
  380. TEXTCLR    = BLACK    ;text color in pad area.
  381. Color40:
  382.     LoadW    r0,#COLOR_MATRIX    ;start of 40 column color area.
  383.     ldy    #0
  384.     lda    #((BACKFORE<<4)|BACKBACK)
  385.     sta    (r0),y    ;color the upper four rows of screen.
  386.     cpy    #160
  387.     bne    10$
  388.     AddVW    #160,r0    ;increment r0 to point at the top row
  389.             ;of the shell frame.
  390.     ldx    #3    ;do this segment three times.
  391.     ldy    #0
  392.     lda    #((BACKFORE<<4)|BACKBACK)
  393.     sta    (r0),y    ;color empty space at left of frame.
  394.     lda    #((SHELLCLR<<4)|PADCLR)
  395.     sta    (r0),y    ;color the top of the frame.
  396.     cpy    #38
  397.     bne    20$
  398.     lda    #((BACKFORE<<4)|BACKBACK)
  399.     sta    (r0),y    ;color the two empty spaces at the right
  400.             ;of the frame.
  401.     sta    (r0),y
  402.     jsr    Add40R0
  403.     bne    15$
  404.     ldx    #12    ;now do 14 rows of the screen in the
  405.             ;pad area.
  406.     ldy    #0
  407.     lda    #((BACKFORE<<4)|BACKBACK)
  408.     sta    (r0),y    ;the empty space at the left.
  409.     lda    #((SHELLCLR<<4)|PADCLR)
  410.     sta    (r0),y    ;one card on the left border of frame.
  411.     lda    #((TEXTCLR<<4)|PADCLR)
  412.     lda    #((TEXTCLR<<4)|PADCLR)
  413.     sta    (r0),y    ;color 37 cards in the pad.
  414.     cpy    #37
  415.     bne    50$
  416.     lda    #((SHELLCLR<<4)|PADCLR)
  417.     sta    (r0),y    ;color the border at the right side.
  418.     lda    #((BACKFORE<<4)|BACKBACK)
  419.     sta    (r0),y    ;color the two empty spaces at the right.
  420.     sta    (r0),y
  421.     jsr    Add40R0    ;point at the next row down.
  422.     dex        ;count down from 12.
  423.     bne    40$    ;branch if more to do.
  424.     ldx    #2
  425.     ldy    #0    ;now we do the bottom of the frame.
  426.     lda    #((BACKFORE<<4)|BACKBACK)
  427.     sta    (r0),y
  428.     lda    #((SHELLCLR<<4)|PADCLR)
  429.     sta    (r0),y
  430.     cpy    #38
  431.     bne    60$
  432.     lda    #((BACKFORE<<4)|BACKBACK)
  433.     sta    (r0),y
  434.     sta    (r0),y
  435.     jsr    Add40R0
  436.     bne    55$
  437.     ldy    #0
  438.     lda    #((BACKFORE<<4)|BACKBACK)
  439.     sta    (r0),y
  440.     cpy    #160
  441.     bne    70$
  442. Add40R0:
  443.     AddVW    #40,r0
  444. ;when you need to look ahead in the command buffer for a text string or
  445. ;another command, this example will show you how to 
  446. ;when you need to look ahead in the command buffer for a text string or
  447. ;another command, this example will show you how to do it.
  448. ;The 'getkey' command has to look forward through an exec or startup file
  449. ;for a left-curly brace followed by a character that represents the key
  450. ;that the user has pressed. This example does it in a similar manner.
  451. ;a4 always points to the next command or your parameter if there is one.
  452. ;From that point until the end of the buffer is all text until a null-byte
  453. ;is encountered, signifying the end of the command buffer, or the
  454. ;startup buffer. It makes no difference whether your command is coming
  455. ;from a startup file in the startup buffer or the keyboard in the
  456. ;command buffer. The only difference is that the startup buffer can hold
  457. ;more commands.
  458. ;In this example, we are simply looking for a string
  459. ;called 'skip'. If goodflag is set upon return then r0 is pointing at
  460. ;skip. No ifs, ands, or buts.
  461. ;a4 does not get altered, however we can skip ahead if we'd like
  462. ;by copying r0 to a4. This particular code loops around perhaps a little
  463. ;too much, but it works perfectly and will return with r0 either pointing
  464. ;at skip for sure or definitely not pointing at it.
  465. FindSkip:
  466.     MoveW    a4,r0    ;point r0 at the start of what's left
  467.             ;in the buffer.
  468.     LoadW    r1,#skipText    ;point r1 at the text to compare to.
  469.     bra    15$    ;go check the first byte.
  470.             ;(the first byte doesn't have to be
  471.             ;a space)
  472.     ldy    #0    ;let's look for the next terminator.
  473.             ;because there has to be a space before
  474.             ;and after 'skip'.
  475.     lda    (r0),y    ;get a byte.
  476.     beq    90$    ;branch if end of buffer.
  477.     jsr    CkTerminators    ;is this a terminator?
  478.     jsr    IncR0    ;increment r0 before checking goodflag.
  479.     bit    goodflag    ;so, was it?
  480.     bmi    15$    ;branch if so.
  481.     bpl    10$    ;or branch if not and keep looking.
  482.     lda    (r0),y    ;get the next byte.
  483.     beq    90$    ;branch if end of buffer.
  484.     cmp    skipText+0    ;does this match the 's'in 'skip'?
  485.     bne    13$    ;branch in case it's a terminator.
  486.     ldx    #r0    ;let GEOS kernal check
  487.     ldy    #r1    ;the two strings.
  488.     lda    #4    ;four characters.
  489.     jsr    CmpFString    ;are they equal?
  490.     beq    60$    ;branch if so.
  491.     jsr    IncR0
  492.     bra    10$    ;branch always.
  493. ;at this point, we have one more check to make. We make sure that the
  494. ;user is using the correct syntax by putting a space after 'skip'.
  495.     ldy    #4    ;point at the byte past 'skip'.
  496.     lda    (r0),y    ;and fetch that byte.
  497.     jsr    CkTerminators    ;maybe this string here is 'skippy'
  498.     bit    goodflag    ;or something else.
  499.     bmi    80$
  500.     jsr    IncR0    ;point at 
  501.     jsr    CkTerminators    ;maybe this string here is 'skippy'
  502.     bit    goodflag    ;or something else.
  503.     bmi    80$
  504.     jsr    IncR0    ;point at the next byte.
  505.     bra    10$    ;branch if not 'skip' with a space
  506.             ;and keep looking.
  507.     rts        ;goodflag is already set.
  508.     jmp    nogood    ;no skip in this buffer.
  509. skipText:
  510.     .byte    "skip"
  511. IncR0:
  512.     inc    r0L    ;increment r0 to the next byte.
  513.     bne    10$    ;branch if it didn't roll over.
  514.     inc    r0H    ;otherwise increment the high byte.
  515.     jsr    ClearScreen    ;clear th
  516. The geoSHELL Programmer's Development Package    Source-PAGE
  517.