[ 53280,0:53281,0:646,(162):"":" USE LYNX TO DISSOLVE THIS FILE":10 3 *LYNX XV BY WILL CORLEY 23 GEOSEQUATES.CVT 52 S 96 APICOMMON.CVT 12 S 211 MODSTRING.CVT 58 S 160 MODVPRG.CVT 25 S 40 MODSEQW.CVT 59 S 151 MODGEOWX.CVT 69 S 63 MODFBOX.CVT 53 S 90 MODSEQWX.CVT 57 S 184 MODWIN2.CVT 89 S 226 MODFLIST.CVT 58 S 14 MODCLICKS.CVT 25 S 92 MODDAAB.CVT 23 S 104 MODFERR.CVT 16 S 136 MODSCRN.CVT 25 S 50 MODVLIRX.CVT 24 S 166 MODSEQRX.CVT 24 S 166 MODSEQR.CVT 32 S 186 MODSECIO.CVT 43 S 138 MODDEMO.CVT 23 S 168 MODGEORX.CVT 136 S 240 MODTBOX.CVT 29 S 82 MODFCOPY.CVT 68 S 234 MODCONVERT.CVT 47 S 168 GEOSequates'3PRG formatted GEOS file V1.0AWrite Image V2.0geoWrite V1.1GEOPROGRAMMER sample file.-\.5`` R0 == $0002 R0H == $03 R0L == $02 R1 == $0004 R1H == $05 R1L == $04 R2 == $0006 R2H == $07 R2L == $06 R3 == $0008 R3H == $09 R3L == $08 R4 == $000a R4H == $0b R4L == $0a R5 == $000c R5H == $0d R5L == $0c R6 == $000e R6H == $0f R6L == $0e R7 == $0010 R7H == $11 R7L == $10 R8 == $0012 R8H == $13 R8L == $12 R9 == $0014 R9H == $15 R9L == $14 R10 == $0016 R10H == $17 R10L == $16 R11 == $0018 R11H == $19 R11L == $18 R12 == $001a R12H == $1b R12L == $1a R13 == $001c R13H == $1d R13L == $1c R14 == $001e R14H == $1f R14L == $1e R15 == $0020 R15H == $21 R15L == $20 A0 == $fb A0L == $fb A0H == $fc A1 == $fd A1L == $fd A1H == $fe A2 == $70 A2L == $70 A2H == $71 A3 == $72 A3L == $72 A3H == $73 A4 == $74 A4L == $74 A4H == $75 A5 == $76 A5L == $76 A5H == $77 A6 == $78 A6L == $78 ` A6H == $79 A7 == $7a A7L == $7a A7H == $7b A8 == $7c A8L == $7c A8H == $7d A9 == $7e A9L == $7e A9H == $7f Fp`0 BACK_SCR_BASE == $6000 APP_VAR == $7F` A6H == $79 A7 == $7a A7L == $7a A7H == $7b A8 == $7c A8L == $7c A8H == $7d A9 == $7e A9L == $7e A9H == $7f $0008 R3H == $09 R3L == $08 R4 == $000a R4H == $0b R4L == $0a R5 == $000c R5H == $0d R5L == $0c R6 == $000e R6H == `0 BACK_SCR_BASE == $6000 APP_VAR == $7F40 SPRITE_PICS == $8A00 COLOR_MATRIX == $8C00 DISK_BASE == $9000 SCREEN_BASE == $A000 curPattern == $0022 string == $0024 baselineOffset == $0026 curSetWidth == $0027 curHeight == $0029 curIndexTable == $002a cardDataPntr == $002c currentMode == $002e dispBufferOn == $002f mouseOn == $0030 msePicPtr == $0031 windowTop == $0033 windowBottom == $0034 leftMargin == $0035 rightMargin == $0037 pressFlag == $0039 mouseXPos == $003a mouseYPos == $003c returnAddress == $003d STATUS == $0090 curDevice == $00BA diskBlkBuf == $8000 fileHeader == $8100 curDirHead == $8200 fileTrScTab == $8300 dirEntryBuf == $8400 DrACurDkNm == $841e DrBCurDkNm == $8430 dataFileName == $8442 dataDiskName == $8453 PrntFilename == $8465 PrntDiskName == $8476 curDrive == $8489 diskOpenFlg == $848a isGEOS == $848b numDrives == $848d driveType == $848e curRecord == $8496 usedRecords == $8497 fileWritten == $8498 fileSize == $8499 appMain == $849b intTopVector == $849d intBotVector == $849f mouseVector == $84a1 keyVector == $84a3 inputVector == $84a5 mouseFaultVec == $84a7 otherPressVec == $84a9 StringFaultVec == $84ab alarmTmtVector == $84ad BRKVector == $84af RecoverVector == $84b1 selectionFlash == $84b3 alphaFlag == $84b4 iconSelFlag == $84b5 faultData == $84b6 menuNumber == $84b7 mouseTop == $84b8 mouseBottom == $84b9 mouseLeft == $84ba mouseRight == $84bc r` stringX == $84be stringY == $84c0 mousePicData == $84c1 maxMouseSpeed == ` stringX == $84be stringY == $84c0 mousePicData == $84c1 maxMouseSpeed == $8501 minMouseSpeed == $8502 mouseAccel == $8503 keyData == $8504 mouseData == $8505 inputData == $8506 random == $850a saveFontTab == $850c dblClickCount == $8515 year == $8516 month == $8517 day == $8518 hour == $8519 minutes == $851a seconds == $851b alarmSetFlag == $851c sysDBData == $851d screencolors == $851e dlgBoxRamBuf == $851f savedmoby2 == $88bb ramExpSize == $88c3 sysRAMFlg == $88c4 curType == $88c6 inputDevName == $88cb DrCCurDkNm == $88dc DrDCurDkNm == $88ee dir2Head == $8900 x`0 InitForPrint == $7900 StartPrint == $7903 PrintBuffer == $7906 StopPrint == $7909 GetDimensions == $790c PrintASCII == $790f Sta`0 InitForPrint == $7900 StartPrint == $7903 PrintBuffer == $7906 StopPrint == $7909 GetDimensions == $790c PrintASCII == $790f StartASCII == $7912 SetNLQ == $7915 Get1stDirEntry == $9030 GetNxtDirEntry == $9033 AllocateBlock == $9048 ReadLink == $904B BootGEOS == $c000 ResetHandle == $c003 InterruptMain == $c100 InitProcesses == $c103 RestartProcess == $c106 EnableProcess == $c109 BlockProcess == $c10c UnblockProcess == $c10f FreezeProcess == $c112 UnfreezeProcess == $c115 HorizontalLine == $c118 InvertLine == $c11b RecoverLine == $c11e VerticalLine == $c121 Rectangle == $c124 FrameRectangle == $c127 InvertRectangle == $c12a RecoverRectangle == $c12d DrawLine == $c130 DrawPoint == $c133 GraphicsString == $c136 SetPattern == $c139 GetScanLine == $c13c TestPoint == $c13f BitmapUp == $c142 PutChar == $c145 PutString == $c148 UseSystemFont == $c14b StartMouseMode == $c14e DoMenu == $c151 RecoverMenu == $c154 RecoverAllMenus == $c157 DoIcons == $c15a DShiftLeft == $c15d BBMult == $c160 BMult == $c163 DMult == $c166 Ddiv == $c169 DSdiv == $c16c Dabs == $c16f Dnegate == $c172 Ddec == $c175 ClearRam == $c178 FillRam == $c17b MoveData == $c17e InitRam == $c181 PutDecimal == $c184 GetRandom == $c187 MouseUp == $c18a MouseOff == $c18d DoPreviousMenu == $c190 ReDoMenu == $c193 GetSerialNumber == $c196 Sleep == $c199 ClearMouseMode == $c19c i_Rectangle == $c19f z`0 i_FrameRectangle == $c1a2 i_RecoverRectangle == $c1a5 i_GraphicsString == $c1a8 i_BitmapU`0 i_FrameRectangle == $c1a2 i_RecoverRectangle == $c1a5 i_GraphicsString == $c1a8 i_BitmapUp == $c1ab i_PutString == $c1ae GetRealSize == $c1b1 i_FillRam == $c1b4 i_MoveData == $c1b7 GetString == $c1ba GotoFirstMenu == $c1bd InitTextPrompt == $c1c0 MainLoop == $c1c3 DrawSprite == $c1c6 GetCharWidth == $c1c9 LoadCharSet == $c1cc PosSprite == $c1cf EnablSprite == $c1d2 DisablSprite == $c1d5 CallRoutine == $c1d8 CalcBlksFree == $c1db ChkDkGEOS == $c1de NewDisk == $c1e1 GetBlock == $c1e4 PutBlock == $c1e7 SetGEOSDisk == $c1ea SaveFile == $c1ed SetGDirEntry == $c1f0 BldGDirEntry == $c1f3 GetFreeDirBlk == $c1f6 |`0 WriteFile == $c1f9 BlkAlloc == $c1fc ReadFile == $c1ff SmallPutChar == $c202 FollowC`0 WriteFile == $c1f9 BlkAlloc == $c1fc ReadFile == $c1ff SmallPutChar == $c202 FollowChain == $c205 GetFile == $c208 FindFile == $c20b CRC == $c20e LdFile == $c211 EnterTurbo == $c214 LdDeskAcc == $c217 ReadBlock == $c21a LdApplic == $c21d WriteBlock == $c220 VerWriteBlock == $c223 FreeFile == $c226 GetFHdrInfo == $c229 EnterDeskTop == $c22c StartAppl == $c22f ExitTurbo == $c232 PurgeTurbo == $c235 DeleteFile == $c238 FindFTypes == $c23b RstrAppl == $c23e ToBasic == $c241 FastDelFile == $c244 GetDirHead == $c247 PutDirHead == $c24a NxtBlkAlloc == $c24d ImprintRectangle == $c250 i_ImprintRectangle == $c253 DoDlgBox == $c256 RenameFile == $c259 InitForIO == $c25c DoneWithIO == $c25f DShiftRight == $c262 CopyString == $c265 CopyFString == $c268 CmpString == $c26b CmpFString == $c26e FirstInit == $c271 OpenRecordFile == $c274 CloseRecordFile == $c277 NextRecord == $c27a PreviousRecord == $c27d PointRecord == $c280 DeleteRecord == $c283 InsertRecord == $c286 AppendRecord == $c289 ReadRecord == $c28c WriteRecord == $c28f !k`0 SetNextFree == $c292 UpdateRecordFile == $c295 GetPtrCurDkNm == $c298 PromptOn == $c29b PromptOff == $c29e OpenDisk == $c2a1 DoInlineReturn == $c2a4 GetNextChar == $c2a7 Bitm`0 SetNextFree == $c292 UpdateRecordFile == $c295 GetPtrCurDkNm == $c298 PromptOn == $c29b PromptOff == $c29e OpenDisk == $c2a1 DoInlineReturn == $c2a4 GetNextChar == $c2a7 BitmapClip == $c2aa FindBAMBit == $c2ad SetDevice == $c2b0 IsMseInRegion == $c2b3 ReadByte == $c2b6 FreeBlock == $c2b9 ChangeDiskDevice == $c2bc RstrFrmDialogue == $c2bf Panic == $c2c2 BitOtherClip == $c2c5 StashRAM == $c2c8 FetchRAM == $c2cb SwapRAM == $c2ce VerifyRAM == $c2d1 DoRAMOp == $c2d4 ;Jump addresses within input drivers InitMouse == $fe80 ;address of InitMouse entry (MOUSE_JMP) SlowMouse == $fe83 ;address of SlowMouse entry UpdateMouse == $fe86 ;address of UpdateMouse entry SetMouse == $fe89 ;address of SetMouse entry (128 only!) 5l``0 NOT_GEOS = 0 BASIC = 1 ASSEMBLY = 2 DATA = 3 SYSTEM = 4 DESK_ACC = 5 APPLICATION = 6 APPL_DATA = 7 FONT = 8 PRINTER = 9 INPUT_DEVICE = 10 DISK_DEVICE = 11 SYSTEM_BOOT = 12 TEMPORARY = 13 AUTO_EXEC = 14 INPUT_128 = 15 SEQUENTIAL = 0 VLIR = 1 in`0 HORIZONTAL = %00000000 VERTICAL = %10000000 CONSTRAINED = %01000000 UN_CONSTRAINED = %00000000 SUB_MENU = $80 DYN_SUB_MENU = $40 MENU_ACTION = $00 BOLDON = 24 ITALICON = 25 OUTLINEON = 26 PLAINTEXT =`0 HORIZONTAL = %00000000 VERTICAL = %10000000 CONSTRAINED = %01000000 UN_CONSTRAINED = %00000000 SUB_MENU = $80 DYN_SUB_MENU = $40 MENU_ACTION = $00 BOLDON = 24 ITALICON = 25 OUTLINEON = 26 PLAINTEXT = 27 USELAST = 127 SHORTCUT = 128 ST_WR_FORE = $80 ST_WR_BACK = $40 ST_WRGS_FORE = $20 MOVEPENTO = 1 LINETO = 2 RECTANGLETO = 3 NEWPATTERN = 5 ESC_PUTSTRING = 6 FRAME_RECTO = 7 PEN_X_DELTA = 8 PEN_Y_DELTA = 9 PEN_XY_DELTA = 10 SET_LEFTJUST = %10000000 SET_RIGHTJUST = %00000000 SET_SUPRESS = %01000000 SET_NOSUPRESS = %00000000 Jr`0 .macro ldb dest,value ;ldb DEST with VALUE lda #value sta dest .endm .macro ldw dest,value ;ldw DEST with VALUE lda #](value) sta dest+1 lda #[(value) sta dest`0 .macro ldb dest,value ;ldb DEST with VALUE lda #value sta dest .endm .macro ldw dest,value ;ldw DEST with VALUE lda #](value) sta dest+1 lda #[(value) sta dest+0 .endm .macro mvb source,dest ;mvb SOURCE to DEST lda source sta dest .endm .macro mvw source,dest ;mbw SOURCE to DEST lda source+1 sta dest+1 lda source+0 sta dest+0 .endm .macro add source ;add SOURCE clc adc source .endm .macro adb source,dest ;adb SOURCE in-to DEST clc lda source adc dest sta dest .endm .macro adw source,dest ;adw SOURCE in-to DEST lda source clc adc dest+0 sta dest+0 lda source+1 adc dest+1 sta dest+1 .endm .macro avb value,dest ;avb VALUE in-to DEST lda dest clc adc #value sta dest .endm .macro avw value,dest ;avw VALUE in-to DEST clc lda #[(value) adc dest+0 sta dest+0 .if (value >= 0) && (value <= 255) bcc noInc inc dest+1 noInc: .else lda #](value) adc dest+1 sta dest+1 .endif ` .endm u`` .macro sub source ;sub SOURCE sec sbc source .endm .macro sbb source,dest ;sbb SOURCE from-to DEST sec lda dest sbc source sta dest .endm .macro sbw source,dest ;sbw SOURCE from-to DEST lda dest+0 sec sbc source+0 sta dest+0 lda dest+1 sbc source+1 sta dest+1 .endm  .macro svb value,dest lda dest sec sbc #value sta dest .endm  .macro svw value,dest ;svw VALUE in-to DEST lda dest+0 sec sbc #[(value) sta dest+0 .if (value >= 0) && (value <= 255) bcs noDec dec dest+1 noDec: .else lda dest+1 sbc #](value) sta dest+1 .endif .endm .macro cpb source,dest ;cpb SOURCE to DEST lda source cmp dest .endm .macro cbi source,immed ;cbi SOURCE to IMMED lda source cmp #immed .endm .macro cpw source,dest ;cpw SOURCE to DEST lda source+1 cmp dest+1 bne done lda source+0 cmp dest+0 done: .endm .macro cwi source,immed ;cwi SOURCe to IMMED lda source+1 cmp #](immed) y` bne done lda source+0 cmp #[(immed)` bne done lda source+0 cmp #[(immed) done: .endm .macro phb source ;phb SOURCE lda source pha .endm .macro phw source ;phw SOURCE lda source+1 pha lda source+0 ` pha .endm .macro plb dest ;plb DEST pla sta dest .endm ` .macro plw dest ;plw DEST pla sta dest+0 pla sta dest+1 .endm .macro bra addr ;bra ADDR clv bvc addr .endm .macro blt dest bcc dest .endm .macro bgt dest beq NoEq bcs dest NoEq: .endm .macro ble dest beq dest bcc dest .endm .macro bge dest bcs dest .endm .macro ylp dest dey bne dest .endm .macro inw source inc source+0 bne done inc source+1 done: .endm .macro dew source ` dec source+0 uy` lda source+0 cmp #255 bne done dec source+1 done: .endm adCharSet == $c1cc PosSprite == $c1cf EnablSprite == $c1d2 DisablSprite == $c1d5 CallRoutine == $c1d8 CalcBlksFree == $c1db ChkDkGEO` lda source+0 cmp #255 bne done dec source+1 done: .endm adCharSet == $c1cc PosSprite == $c1cf EnablSprite == $c1d2 DisablSprite == $c1d5 CallRoutine == $c1d8 CalcBlksFree == $c1db ChkDkGEOS == $c1de NewDisk == $c1e1APIcommon$ PRG formatted GEOS file V1.0AWrite Image V2.0geoWrite V2.1  ...݅ ( >1 59 ..  9 < <` " . r " `(@1ʎsAڢ9 V&jP0h ;**************************************** ;* APIcommon - geoProjects library (C) 1998 Bo Zimmerman ;* ;* Intro: ;* Handles register, status and other saves and ;* restores for other MODules and API modules. ;* .x is the only protected register for i_function ;* calls. A2-A6 are the protected app-registers. ;* ;* Functions: ;* APISavRegs Save status, .a, .x ;* APIResRegs Restore .a, .x, status (last done!!) ;* APISavSys Save status, .a, .x, A2-A6 ;* APIreturn Send param bytes in .y, restore and return! ;* APIinit Save system, return address, get params ;* ;* Comments: ;* Perhaps this works.. who knows? ;**************************************** 0 .psect @;* Saves status, .x, and .a. Exits with .x intact APISavRegs: php sta APIRegBuf stx APIRegBuf+1 pla sta APIRegBuf+3 rts  ;* Restores .a, .x, .y, and status  APIResRegs: @ lda APIRegBuf+3 pha ldy APIRegBuf+2 ldx APIRegBuf+1 lda APIRegBuf plp rts Dl@0 APISavSys: jsr APISavRegs sty APIRegBuf+2 ldx #10 10$: lda $6f,x sta APISysBuf,x dex bne 10$ rts APIreturn@0 APISavSys: jsr APISavRegs sty APIRegBuf+2 ldx #10 10$: lda $6f,x sta APISysBuf,x dex bne 10$ rts APIreturn: jsr APISavRegs tya clc adc $3d sta $3d bcc 10$ lda $3e adc #0 sta $3e 10$: lda $3e pha lda $3d pha ldx #10 20$: lda APISysBuf,x sta $6f,x dex bne 20$ jmp APIResRegs Am@0 APIinit: jsr APISavSys pla sta APIAddBuf pla sta APIAddBuf+1 pla sta $3d pla sta $3e lda APIAddBuf+1 pha lda APIAddBuf pha ld@0 APIinit: jsr APISavSys pla sta APIAddBuf pla sta APIAddBuf+1 pla sta $3d pla sta $3e lda APIAddBuf+1 pha lda APIAddBuf pha ldy #10 ldx #10 10$: lda ($3d),y sta $6f,x dey dex bne 10$ jmp APIResRegs n@0 .ramsect APIRegBuf: .block 3 APISysBuf: .block 11 APIAddBuf: .block 2 APITemp1: .block 30 APITemp2: .block 30 APITemp3: .block 30 APITemp4: .block 30 APITemp5: .block 30a ;W3MODflist3a 1MODstring$9PRG formatted GEOS file V1.0AWrite Image V2.0geoWrite V2.1  ...݅ ( >1 59 ..  9 < <` " . r " `(@1ʎsAڢ9 V&cw4g[=k)c|W0h .noeqin .include GEOSequates .glbl .eqin ;**************************************** ;* MODstring - geoProjects library (C) 1998 Bo Zimmerman 0h;* ;* Intro: ;* This module handles all facets of string ;* manipulation. ;* ;* Functions: ;* AppStr( .word Pointer to dest str ;* .word Pointer to source str) * ;* StrLen( .word Pointer to string) * ;* RevStr( .word Pointer to string) * ;* ToUpper( .word Pointer to string) * ;* ToLower( .word Pointer to string) * ;* ToPETSKII( .word Pointer to string) * ;* ToASCII( .word Pointer to string) * ;* InStr( .word Pointer to string to search ;* .word Pointer to string to find) * ;* CmpStr( .word Pointer to string ;* .word Pointer to string) * ;* CpyStr( .word Pointer to source string ;* .word Pointer to destination) * ;* ;* * = Includes a i_Function. Also most of these ;* (but not all!), return the str length. ;* ;* Comments: ;* An InsertStr, Mid, Left, Right, are not included! ;* You can get GetStrWidth from MODwin2 ;**************************************** (H.psect (H0 ;******************************* ;* AppStr ;* ;* Inputs: ;* A2 Pointer to null-terminated ;* string to append to. ;* A3 Pointer to null-terminated ;* string to append. ;* Outputs: ;* .a High byte of new string length ;* .x Low byte of new string length ;******************************* AppStr: jsr StrLen tay txa clc adc A2L ; point to proper place... sta A4L tya adc A2H sta A4H ;... and copy pointer to A4 ldy #0 10$: lda (A3),y ; get byte of appendable string sta (A4),y beq 11$ ; end reached, we are done! iny bne 10$ ; appendable str len < 255!!! 11$: jmp StrLen ; fullfill the return parameters Io(H0 ;******************************* ;* i_AppStr ;* ;* Inputs: ;* .word Pointer (H0 ;******************************* ;* i_AppStr ;* ;* Inputs: ;* .word Pointer to a null-terminated ;* string to append to. ;* .word Pointer to a null terminated ;* string to append. ;* Outputs: ;* .a High byte of new string length ;* .x Low byte of new string length ;******************************* i_AppStr: jsr APIinit jsr AppStr ldy #4 ; 2 word pointers = 4 bytes jmp APIreturn *r(H0 ;******************************* ;* StrLen ;* ;* Inp(H0 ;******************************* ;* StrLen ;* ;* Inputs: ;* A2 Pointer to a null-terminated ;* string. ;* Outputs: ;* .a string length (high byte) ;* .x string length (low byte) ;******************************* StrLen: ldx #0 ldb A5L,#0 ; clear length counters mvw A2,A4 ; prepare work pointer ldy #0 10$: lda (A4),y ; check a byte beq 12$ ; if zero found, exit inx ; otherwise, add 1 bne 11$ ; if this flips over 255... inc A5L ; add one to the high byte 11$: inc A4L ; now increment work pointer bne 10$ ; if this does not flip, get next char inc A4H ; otherwise increment high byte bne 10$ ; if this does not flip, get next char 12$: lda A5L ; get high byte into .a rts ; and exit! s(H0(H0 ;******************************* ;* i_StrLen ;* ;* Inputs: ;* .word Pointer to a null-terminated ;* string. ;* Outputs:  ;* .a string length (high byte) ;* .x string length (low byte)  ;******************************* (H0 i_StrLen: jsr APIinit jsr StrLen ldy #2 ; 1 word pointers = 2 bytes jmp APIreturn w(H0 ;******************************* ;* RevStr ;* ;* Inputs: ;* A2 Pointer to null-terminated ;* string(H0 ;******************************* ;* RevStr ;* ;* Inputs: ;* A2 Pointer to null-terminated ;* string to reverse. ;* Outputs: ;* .a NULL ;* .x NULL ;******************************* RevStr: mvw A2,A4 ; save it for the fun ofit jsr StrLen ; get length of A2 clc adc A2H ; add hb length to A2 -> A3 sta A3H txa adc A2L ; add lb length to A2 -> A3 sta A3L cpw A2,A3 ; was the length zero? bne 11$ 10$: mvw A4,A2 ; restore original pointer lda #0 ldx #0 rts ; yes! so done. 11$: ldy #0 ; A3 should start off pointing to NULL dew A3 lda (A2),y ; get front byte of src sta APITemp1 ; save it! lda (A3),y ; get hind byte of src sta (A2),y ; save it to front of dest lda APITemp1 ; now restore front byte of src sta (A3),y ; save it to hind end of dest cpw A2,A3 ; did we copy the same byte? beq 10$ ; yes, so we're done! inw A2 cpw A2,A3 ; are front/hind now the same? beq 10$ ; yes, so we're done bne 11$ ; no, so decrement hind and do over ; the end! x((H0 ;******************************* ;* i_RevStr ;* ;* Inputs: ;* .word Pointer to null-terminated ;* string to reverse. ;* Outputs: ;* .a NULL ;* .x NULL ;******************************* i_RevStr: jsr APIinit jsr RevStr ldy #2 ; 1 word pointers = 2 bytes jmp APIreturn z(H0 ;******************************* ;* ToUpper ;* ;* Inputs:  ;* A2 Pointer to null-terminated (H0;* string to convert to uppercase.  ;* Ou(H0 ;******************************* ;* ToUpper ;* ;* Inputs:  ;* A2 Pointer to null-terminated (H0;* string to convert to uppercase.  ;* Outputs: (H0;* .a NULL ;* .x NULL ;******************************* ToUpper: mvw A2,A4 ; save it for the fun of it ldy #0 10$: lda (A4),y beq 12$ cmp #'a' blt 11$ cmp #'z' bgt 11$ sec sbc #'a' - 'A' sta (A4),y 11$: inw A4 bra 10$ 12$: lda #0 ldx #0 rts |(H(H0 ;******************************* ;* i_ToUpper ;*  ;* Inputs:  ;* .word Pointer to null-terminated (H0;* string to convert to uppercase. ;* Outputs: ;* .a NULL ;* .x NULL ;******************************* i_ToUpper: jsr APIinit jsr ToUpper ldy #2 ; 1 word pointers = 2 bytes jmp APIreturn StartAppl == $c22f ExitTurbo == $c232 PurgeTurbo == $c235 DeleteFile == $c238 FindFTypes == $c23b RstrAppl == $c23e ToBasic == $c241 FaUUUUUUUU(H0 ;******************************* ;* ToLower ;* ;* Inputs:  ;* A2 Pointer to null-terminated ;* string to convert to lowercase.  ;* Outputs: (H0;* .a NULL ;* .x NULL ;******************************* ToLower: mvw A2,A4 ; save it for the fun of it ldy #0 10$: lda (A4),y beq 12$ cmp #'A' blt 11$ cmp #'Z' bgt 11$ clc adc #'a' - 'A' sta (A4),y 11$: inw A4 bra 10$ 12$: lda #0 ldx #0 rts .i(H0 ;**********(H0 ;******************************* ;* i_ToLower ;*  ;* .word Pointer to null-terminated ;* string to convert to lowercase.  ;* Outputs: (H0;* .a NULL ;* .x NULL ;******************************* i_ToLower: jsr APIinit jsr ToLower ldy #2 ; 1 word pointers = 2 bytes jmp APIreturn hl(H0 ;******************************* ;* ToPETSKII ;* ;* Inputs:  ;* A2 Pointer to null-terminated ;* string to convert to PETSKI(H0 ;******************************* ;* ToPETSKII ;* ;* Inputs:  ;* A2 Pointer to null-terminated ;* string to convert to PETSKII.  ;* Outputs: (H0;* .a NULL ;* .x NULL ;******************************* ToPETSKII: mvw A2,A4 ; save it for the fun of it ldy #0 10$: lda (A4),y beq 16$ ; the end is found! cmp #13 beq 15$ ; CR is only good code cmp #8 bne 11$ lda #20 ; convert delete to backspace bra 14$ 11$: cmp #32 ; below the space is bad news blt 13$ cmp #65 ; check below 'a' blt 15$ ; those are ok cmp #90 ; check below 'z' bgt 12$ clc adc #128 bra 14$ 12$: cmp #97 ; this is ascii 'a' blt 15$ cmp #126 bgt 13$ sec sbc #32 ; converts to petskii 'a' bra 14$ 13$: lda #$00 14$: sta (A4),y 15$: inw A4 bra 10$ 16$: lda #0 ldx #0 rts m(H0 ;******************************* ;* i_ToPETSKII ;*  ;* Inputs:  ;* .word Pointer to null-terminated (H0;* string to convert to (H0 ;******************************* ;* i_ToPETSKII ;*  ;* Inputs:  ;* .word Pointer to null-terminated (H0;* string to convert to PETSKII. ;* Outputs: ;* .a NULL ;* .x NULL ;******************************* i_ToPETSKII: jsr APIinit jsr ToPETSKII ldy #2 ; 1 word pointers = 2 bytes jmp APIreturn p(H0 ;******************************* ;* ToASCII ;* ;* Inputs: ;* A2 Pointer to null-terminated ;* string to convert(H0 ;******************************* ;* ToASCII ;* ;* Inputs: ;* A2 Pointer to null-terminated ;* string to convert to ASCII. ;* Outputs: ;* .a NULL ;* .x NULL ;******************************* ToASCII: mvw A2,A4 ; save it for the fun of it ldy #0 10$: lda (A4),y beq 16$ ; the end is found! cmp #13 beq 15$ ; CR is only good code cmp #20 bne 11$ lda #8 ; convert delete to backspace bra 14$ 11$: cmp #32 ; below the space is bad news blt 13$ cmp #65 ; check below 'a' blt 15$ ; those are ok cmp #90 ; check below 'z' bgt 12$ clc adc #32 bra 14$ 12$: cmp #96 ; this is petskii chars blt 15$ cmp #192 blt 13$ cmp #217 bgt 13$ sec sbc #128 ; converts to ascii 'A' bra 14$ 13$: lda #'.' 14$: sta (A4),y 15$: inw A4 bra 10$ 16$: lda #0 ldx #0 rts ^r(H0 ;******************************* ;* i_ToASCII ;*  ;* Inputs:  ;* .word Pointer to null-terminated (H0;* string to convert to ASCII. ;* Outputs: ;* (H0 ;******************************* ;* i_ToASCII ;*  ;* Inputs:  ;* .word Pointer to null-terminated (H0;* string to convert to ASCII. ;* Outputs: ;* .a NULL ;* .x NULL ;******************************* i_ToASCII: jsr APIinit jsr ToASCII ldy #2 ; 1 word pointers = 2 bytes jmp APIreturn u(H0 ;******************************* ;* InStr ;* ;* Inputs: ;* A2 Pointer to null-terminated ;* string to search. ;* A3 Poi(H0 ;******************************* ;* InStr ;* ;* Inputs: ;* A2 Pointer to null-terminated ;* string to search. ;* A3 Pointer to null-terminated ;* string to search for. ;* Outputs: ;* .a high byte of found index ;* .x low byte of found index + 1 ;******************************* InStr: mvw A2,A4 ; copied just for the fun of it ldw A5,#1 ; the future .a and .x 10$: ldy #0 11$: lda (A3),y ; get first char of search string beq 13$ ; done, or found I guess cmp (A4),y ; compare it to searched string bne 12$ ; nope, so increment and move on iny ; yep, so increment y and try next bne 11$ ; search string < 255 chars!! 12$: inw A4 inw A5 ; increment index and searched str ldy #0 lda (A4),y ; are we done with searched string? bne 10$ ; no, so continue w/ next char lda #0 ; not found, exit! ldx #0 rts 13$: lda A5H ; found, so we can exit! ldx A5L ; fill .x last! rts w(H0 ;******************************* ;* i_InStr ;* ;* Inputs: (H0 ;******************************* ;* i_InStr ;* ;* Inputs: ;* .word Pointer to null-terminated ;* string to search. ;* .word Pointer to null-terminated ;* string to search for. ;* Outputs: ;* .a high byte of found index ;* .x low byte of found index + 1 ;******************************* i_InStr: jsr APIinit jsr InStr ldy #4 ; 2 word pointers = 4 bytes jmp APIreturn $y(H0 ;******************************* ;* CpyStr ;* ;* Inputs: ;* A2 Poi(H0 ;******************************* ;* CpyStr ;* ;* Inputs: ;* A2 Pointer to null-terminated ;* string to copy. ;* A3 Pointer to destination. ;* Outputs: ;* .a high byte of string length ;* .x low byte of string length ;******************************* CpyStr: ldx #A2 ldy #A3 jsr CopyString ; use the kernel! (not safe though!) jmp StrLen ; get this for free z(H0 ;******************************* ;* i_CpyStr ;* ;* Inputs: ;* .word Pointer to(H0 ;******************************* ;* i_CpyStr ;* ;* Inputs: ;* .word Pointer to null-terminated ;* string to copy. ;* .word Pointer to destination. ;* Outputs: ;* .a high byte of string length ;* .x low byte of string length ;******************************* i_CpyStr: jsr APIinit jsr CpyStr ldy #4 ; 2 word pointers = 4 bytes jmp APIreturn {(H0 ;******************************* ;* CmpStr ;* ;* Inputs: ;* A2 Pointer to null-terminated ;* s(H0 ;******************************* ;* CmpStr ;* ;* Inputs: ;* A2 Pointer to null-terminated ;* string to compare. ;* A3 Pointer to null-terminated. ;* string to compare ;* Outputs: ;* .a ? ;* .x ? ;******************************* CmpStr: ldx #A2 ldy #A3 jmp CmpString ; use the kernel! (not safe though!) |(H0 ;******************************* ;* i_CmpStr ;* ;* Inputs: ;* .word Pointer to null-terminated ;* string to compare. ;* .word Point(H0 ;******************************* ;* i_CmpStr ;* ;* Inputs: ;* .word Pointer to null-terminated ;* string to compare. ;* .word Pointer to null-terminated. ;* string to compare ;* Outputs: ;* .a ? ;* .x ? ;******************************* i_CmpStr: jsr APIinit jsr CmpStr tsx ; the status must be preserved! stx APIRegBuf+3 ldy #4 ; 2 word pointers = 4 bytes jmp APIreturn se.  ;* Outputs: (H0;* .a NULL ;* .x NULL ;*************************MODvPrg%PRG formatted GEOS file V1.0AWrite Image V2.0geoWrite V2.1  ...݅ ( >1 59 ..  9 < <` " . r " `(@1ʎsAڢ9 V&;F((H .noeqin .include GEOSequates .glbl .eqin ;**************************************** ;* MODvPrg  - geoProjects library (C) 1998 Bo Zimmerman (H;* ;* Intro: ;* This module provides minimal support to the ;* creation of VLIR applications. It must be ;* the last main module, as the code "swap" ;* area is set at the end of the ramsect here. ;* ;* Functions: ;* InitVPrg(.word app perm name), x=errors ;* i_InitVPrg(.word app perm name), x=errors ;* LdMod(.byte module # 1..2..3..), x=errors ;* i_LdMod(.byte module # 1..2..3..), x=errors ;* VJump(.byte [module, ]VPRGBase offset), x=errors ;* ;* Comments: ;**************************************** .psect ng ;* .word Pointer to string) * ;* CpyStr0H0 ;******************************* ;* InitVPrg ;* ;* Inputs: ;* A2 pointer to app perm name ;* curDrive - must be right ;* Outputs: ;* .x errors if any, 0 = ok ;******************************* InitVPrg: jsr OpenDisk ldx #A3L ; fetch disk name jsr GetPtrCurDkNm ldy #0 10$: lda (A3),y ; copy disk name sta VPRGdNam,y lda (A2),y sta VPRGcNam,y iny cpy #16 blt 10$ ldw R6,#VPRGaNam ; prepare to save app name mvb curDrive,VPRGdriv ; store app device mvw A2,R10 ldb R7L,#APPLICATION ldb R7H,#1 ; find the app by type jsr FindFTypes cpx #0 beq 12$ 11$: rts 12$: ldw R0,#VPRGaNam ; now open the app by name jsr OpenRecordFile cpx #0 bne 11$ mvw R1,VPRGtns ldw R0,#fileHeader+4 ; copy the t&s table ldw R1,#VPRGtabl ldw R2,#128 ; half the links only! jsr MoveData jsr CloseRecordFile ldb VPRGcurr,#$ff ; set curr module to nothing ldx #0 rts mp OpenDisk 0H0 ;******************************* ;* i_InitVPrg ;* ;* Inputs: ;* .word pointer to app perm name ;* curDrive - must be right ;* Outputs: ;* .x errors if any ;******************************* i_InitVPrg: jsr APIinit jsr InitVPrg ldy #2 ; 1 word pointer = 2 bytes jmp APIreturn p0H0 ;******************************* ;* LdMod ;* ;* Inputs: ;* A2L module # to load ;* Outputs: ;* .x errors if any, 0 = ok ;******************************* LdMod: 0H0 ;******************************* ;* LdMod ;* ;* Inputs: ;* A2L module # to load ;* Outputs: ;* .x errors if any, 0 = ok ;******************************* LdMod: mvb curDrive,A2H ; save current device lda A2L cmp VPRGcurr ; are we already in this module? bne 10$ ldx #0 ; yes so exit w/o error rts 10$: lda VPRGdriv ; set back to app drive jsr VPRGdev jsr VPRGok cpx #0 beq 11$ stx A3L bne 13$ 11$: lda A2L ; now prepare to sta VPRGcurr ; forgot to store it!! sec sbc #1 ; get t&s from table asl a tay lda VPRGtabl,y sta R1L ; get t&s from table lda VPRGtabl+1,y sta R1H ldw R7,#VPRGbase ldw R2,#$ffff jsr ReadFile ; read the module in stx A3L ; save errors 13$: lda A2H jsr VPRGdev ; restore incoming curDevice ldx A3L ; restore x for errors and exit rts VPRGdev: cmp curDrive ; change drives if necessary beq 10$ jsr SetDevice 10$: jmp OpenDisk 3L ; save errors 13$: lda A2H jsr VPRGdev ; restore incoming curDevice ldx A3L ; restore x for errors and e0H0 ;******************************* ;* i_LdMod ;* ;* Inputs: ;* .byte module # to load ;* Outputs: ;* .x errors if any ;******************************* i_LdMod: jsr APIinit jsr LdMod ldy #1 ; 1 byte = 1 byte jmp APIreturn fr0H0 .ramsect VPRGtabl: .block 130 VPRGcurr: .block 2 VPRGdriv: .block 1 AppName: .block 20 ; application name storage VPRGbase:outines \5 GEOSequates b )3APIcommon.rela0H0 ;******************************* ;* VJump ;* ;* Inputs: ;* A2L [module, ]VPRGBase offset ;* Outputs: ;* .x errors if any, 0 = ok ;******************************* VJump: lda A2L sta A4L lsr a lsr a lsr a lsr a sta A2L jsr LdMod lda A4L sta A2L cpx #0 beq 10$ rts 10$: and #$0f add #[VPRGbase sta VPRGjmpt+1 lda #0 adc #]VPRGbase sta VPRGjmpt+2 pla pla ; pull the olde return address VPRGjmpt: jmp VPRGbase ame jsr GetPtrCurDkNm ldy #0 ; now see if disk is0H0 VPRGok: ldx #A3L ; now get this disks name jsr GetPtrCurDkNm ldy #0 ; now see if disk is ok... 11$: lda (A3),y cmp VPRGdNam,y ; comparing... bne 12$ iny ; otherwise, continue cpy #16 blt 11$ ldx #0 rts 12$: mvw A2,APITemp2 mvw VPRGtns,R1 ldw R4,#fileHeader jsr GetBlock cpx #0 bne 14$ ldw R0,#fileHeader+4 ; copy the t&s table ldw R1,#VPRGtabl ldy #127 13$: lda (R0),y ; see if we are still on save drive cmp (R1),y bne 14$ dey bne 13$ ldx #0 ; verified again rts 14$: ldw A2,#VPRGcNam jsr InitVPRG mvw APITemp2,A2 rts t t&s from table lda VPRGtabl+1,y sta R1H ldw R7,#VPRGbase ldw R2,#$ffff jsr ReadFile ; read the module in stx A3L ; save errors 13$: lda A2H jsr VPRGdev ; restore incoming curDe0H0 .ramsect VPRGtabl: .block 130 VPRGcurr: .block 2 VPRGdriv: .block 1 VPRGtns: .block 1; track and sector of vlir block VPRGaNam: .block 20 ; application name storage VPRGdNam: .block 20; application disk name VPRGcNam: .block 20; application class name VPRGbase:RG mvw APITemp2,A2 rts f add #[VPRGbase sta VPRGjmpt+1 lda #0 adc #]VPRGbase sta VPRGjmpt+2 pla pla ; pull the olde return address VPRGjmpt: jmp VPRGbase pare to sta VPRGcurr ; forgot to store it!! sec MODseqW%:PRG formatted GEOS file V1.0AWrite Image V2.0geoWrite V2.1  ...݅ ( >1 59 ..  9 < <` " . r " `(@1ʎsAڢ9 V&;.FS^:(@q .noeqin (H.include GEOSequates .glbl .eqin (Hh;**************************************** ;* MODseqW  - geoProjects library (C) 1998 Bo Zimmerman (Hh;* ;* Intro: ;* This modules supports C= seq/prg file ;* creation and writing. A write buffer ;* and directory entries will be maintained ;* during execution. ;* ;* Functions: ;* CreatSF( .word Filename pointer ;* .byte Splat file type) * ;* PutSByte( .a Byte to write out) * ;* PutSString( .word String pointer) * ;* PutSBuf( .word Buffer pointer ;* .word Number of bytes) * ;* PutSMem( .word Buffer pointer ;* .word Last byte pointer) * ;* ClosSF( .byte File type to save as) * ;* CpyFName( A2 Pointer to filename ;* A3 Destination pointer) ;* MakeFNUpp( A2 Pointer to filename) ;* ;* * = includes i_Function call, and returns ;* status in the .x register ;* ;* Comments: ;* A multi file version will have to await (H;* some thought to the multiple-dir block ;* problem (two files sharing a dir block). ;* There is also the problem of shared ;* BAM space between different disks. ;* In the meantime, consider a MODseqWx ;* that has swap buffers equal in size to ;* the ramsects in this module. A Swap- ;* Drive function would restore settings ;* from the buffer, allowing files on sepa- ;* rate drives at least. ;**************************************** .psect (H0 ;****************************** ;* CreatSF Create a new c= sequential file ;* Inputs: ;* A2 pointer to a file name ;* A3L file type (splat type) ;* curDrive drive to create file on ;* Outputs: ;* .x status ;* .a 0 ;****************************** CreatSF: mvb curDrive,SIOWdrv jsr MakeFNUpp ; all c= filenames uppercase ONLY mvw A2, R6 ; copy filename pointer for GEOS ldb $886e,#1 jsr FindFile ; ensure file doesn't already exist cpx #5 ; file not found only good error beq 11$ cpx #0 ; zero means file exists bne 10$ ldx #63 ; so change it to 63--file exists 10$: lda #0 ; two obligatory bytes  rts ; exit in early disgrace 11$: jsr OpenDisk ; no errors yet, so read in BAM cpx #0 bne 10$ ; a bad disk error, so exit ldw R2,#3 ; allocate 3 bytes to get a new block ldy #0 ldw R6,#APITemp1 jsr BlkAlloc cpx #0 ; allocated, so check for errors bne 10$ ; another bad disk error! Exit! mvw APITemp1,SIOWTnS; restore saved t&s list jsr SIOWiniBlk ; clear out the given sector ldb R10L,#0 jsr GetFreeDirBlk ; now find a directory entry cpx #0 bne 10$ ; a error getting dir entry! mvw R1,SIOWdirTS ; OK! now save the dir block tk & sec tya ; prepare index into dir blk jsr SIOWiniDir ; create pointer, copy dir block mvb A3L,APITemp1 ; save the file type mvw SIOWdirPtr,A3 ; copy work dir pointer mvw SIOWdirPtr,R1 ldw R0,#$1d ; clear some space in dir block jsr ClearRam ldy #0 ; now init the dir entry lda APITemp1 ; set as unclosed PRG file sta (A3),y ; write into dir entry iny lda SIOWTnS ; pointer to first track sta (A3),y ; write into dir entry iny lda SIOWTnS+1 ; pointer to first sector sta (A3),y ; write into dir entry ldw SIOWFsize,#1 ; init the file size avw #3,A3 ; set up for filename copy jsr CpyFname ; copy filename A2 into space A3 jsr SIOWSvBAM ; save this disks BAM map mvw SIOWdirTnS,R1 ; restore dir block Tk & sec ldw R4,#SIOWdirBlk jsr PutBlock ; save the directory entry back cpx #0 lda #0 rts (H0 ;****************************** ;* i_CreatSF Create a new c= sequential file ;* Inputs: ;* .word pointer to a file name ;* .byte file type (splat type, 0=PRG) ;* curDrive drive to create file on ;* Outputs: ;* .x status ;* .a 0 ;****************************** i_CreatSF: jsr APIinit lda A3L ; check splat type beq 10$ ldb A3L,#2 ; default file type is #2 (PRG) 10$: jsr CreatSF ldy #3 ; three byte parameter list jmp APIreturn z(H0 ;(H0 ;****************************** ;* PutSByte Output a byte to a sequential file ;* Inputs: ;* .a byte to write out ;* Outputs: ;* .x status ;* .a ? ;****************************** PutSByte: inc SIOWBuf+1 ; increment byte pointer beq 11$ ; exit on wrap over ldy SIOWBuf+1 ; otherwise write the byte sta SIOWBuf,y ldx #0 ; clear errors and exit  10$: rts ; no new block must be written 11$: sta APITemp1 ; save byte for later  jsr  SIOWrDrv  jsr SIOWLdBAM ; reload this disks BAM (H0 avw #1,SIOWFsize ; increment file size ldw R2,#3 ; 3 bytes is all thats needed... ldw R6,#APITemp2 ; to allocate 1 new block jsr BlkAlloc cpx #0 ; now check for errors bne 10$ ; an error? yes = to the exit jsr SIOWSvBAM ; save the updated BAM mvw APITemp2,SIOWBuf; clean, so create link mvw SIOWTnS,R1 ; restore this blocks Tk & Sec ldw R4,#SIOWBuf ; and ready it for writing jsr PutBlock ; the block is written! cpx #0 ; was there an error on that write? bne 10$ ; if so, then exit mvw APITemp2,SIOWTnS; now save the new Tk and Sec jsr SIOWiniBlk ; re-clear the buffer block lda APITemp1 ; restore the byte to write jmp PutSByte ; and write it out jsr SIOWiniDir ; create pointe(H0 ;****************************** ;* i_PutSByte Output a byte to a sequential file ;* Inputs: ;* .byte byte to write out ;* Outputs: ;* .x status ;* .a byte written ;****************************** i_PutSByte: jsr APIinit lda A2L jsr PutSByte ldy #1 lda A2L jmp APIreturn Byte ldy #1 lda A2L jmp APIreturn ,y ldx #0 ; clear errors and exit  10$: rts ; no new block must be written 11$: sta APITemp1 ; save byte for later jsr SIOWrDrv jsr SIOWLdBAM ; rel(H0 ;****************************** ;* PutSString Output a string to a sequential file ;* Inputs: ;* A2 pointer to $ to write out ;* Outputs: ;* .x status ;* .a ? ;* Destroyed: ;* A3 ptr to string Null ;****************************** PutSString: mvw A2,A3 ; create a work pointer SIOWSS2: ldy #0 lda (A3),y ; get a byte beq 11$ ; if NULL, end jsr PutSByte ; otherwise write it out cpx #0 ; check for disk error bne 11$ ; if error, also exit inc A3L ; otherwise increment work pointer bne 10$ ; if low byte no zeroed, skip inc A3H ; increment high byte of wk ptr 10$: jmp SIOWSS2 ; go write the next byte 11$: rts S2 ; go write the next byte 11$: rts errors bne 10$ ; an error? yes = to the exit jsr SIOWSvBAM ; save t(H0 ;****************************** ;* i_PutSString Output a string to a sequential file ;* Inputs: ;* .word pointer to $ to write out ;* Outputs: ;* .x status ;* .a ? ;****************************** i_PutSString: jsr APIinit jsr PutSString ldy #2 jmp APIreturn sr PutSString ldy #2 jmp APIreturn (A3),y ; get a byte beq 11$ ; if NULL, end jsr PutSByte ; otherwise write it out cpx #0 ; check for disk error bne 11$ ; if error, also exit inc A3L ; otherwise increm(H0 ;****************************** ;* PutSBuf Output a buffer to a seq file ;* Inputs: ;* A2 pointer to buffer ;* A3 number of bytes to write ;* Outputs: ;* .x status ;* .a ? ;* Destroyed: ;* A3 converted to last byte ;****************************** PutSBuf: adw A2,A3 ; convert to PutSMem dec A3L ; now lose the extra byte cbi A3L,#255 bne 10$ dec A3H 10$: jmp PutSMem 5 bne 10$ dec A3H 10$: jmp PutSMem r bne 11$ ; if error, also exit inc A3L ; otherwise increm(H0 ;****************************** ;* i_PutSBuf Output a buffer to seq file ;* Inputs: ;* .word pointer to buffer ;* .word number of bytes to write ;* Outputs: ;* .x status ;* .a ? ;* Destroyed: ;****************************** i_PutSBuf: jsr APIinit jsr PutSBuf ldy #4 jmp APIreturn jsr PutSBuf ldy #4 jmp APIreturn e cbi A3L,#255 bne 10$ dec A3H 10$: jmp PutSMem 5 bne 10$ dec A3H 10$: jmp PutSMem r bne 11$ ; if error, also exit inc A3L ; otherwise increm(H0 ;****************************** ;* PutSMem Output a block of memory to a seq file ;* Inputs: ;* A2 pointer to start location ;* A3 pointer to last byte ;* Outputs: ;* .x status ;* .a ? ;* Destroyed: ;* A2 will point to end of buffer ;****************************** PutSMem: 10$: ldy #0 lda (A2),y ; get the byte jsr PutSByte ; write it out cpx #0 ; check for an error bne 12$ ; if error found, then exit cpw A2,A3 ; now see if end is reached beq 12$ ; if yes, then exit inc A2L ; otherwise increment A2 bne 11$ ; no low byte overflow? inc A2H ; low byte overflow means inc A2H 11$: bra 10$ ; and write the next byte 12$: rts $ ; and write the next byte 12$: rts an error? yes = to the exit jsr SIOWSvBAM ; save t(H0 ;****************************** ;* i_PutSMem Output a block of memory to seq file ;* Inputs: ;* .word pointer to start location ;* .word pointer to last byte ;* Outputs: ;* .x status ;* .a ? ;* Destroyed: ;****************************** i_PutSMem: jsr APIinit jsr PutSMem ldy #4 jmp APIreturn jsr PutSMem ldy #4 jmp APIreturn e it out cpx #0 ; check for an error bne 12$ ; if error found, then exit cpw A2,A3 ; now see if end is reached beq 12$ ; if yes, th(H0 ;****************************** ;* ClosSF Close a file opened with CreatSF ;* Inputs: ;* A2L file type to close as ;* Outputs: ;* .x status ;* .a 0 ;****************************** ClosSF: jsr SIOWrDrv mvw SIOWTnS,R1 ; restore last tk & sec ldw R4,#SIOWBuf ; and get the last block jsr PutBlock ; write the block out cpx #0 ; an error is checked for  bne 11$ ; if error found, skip rest  mvw SIOWdirPtr,A4 ; restore directory pointer ldy #0 lda A2L ; get the file type ready sta (A4),y ; save the file type ldy #$1c ; ready the file size index lda SIOWFsize ; get the file size low byte sta (A4),y ; and write it to the buffer iny ; prepare the file size index+1 lda SIOWFsize+1 ; get the file size high byte sta (A4),y ; and write it to the buffer mvw SIOWdirTnS,R1 ; restore dir block tk and sec ldw R4,#SIOWdirBlk ; prepare the dir block itself jsr PutBlock ; write it to disk cpx #0 ; an error on that write? bne 11$ ; if so, then exit jsr SIOWLdBAM ; restore the BAM block jsr PutDirHead ; and send the BAM back to disk 11$: lda #0 rts BAM back to disk 11$: lda #0 rts to disk 11$: lda #0 rts ts ts ts ite it out tSByte ; and write it out ut ut ut ut jsr SIOWiniDir ; create pointe(H0 ;****************************** ;* i_ClosSF Close a file opened with CreatSF ;* Inputs: ;* .byte file type (0=PRG) ;* Outputs: ;* .x status ;* .a 0 ;****************************** i_ClosSF: jsr APIinit lda A2L bne 10$ ldb A2L,#130 10$: jsr ClosSF ldy #1 jmp APIreturn sSF ldy #1 jmp APIreturn rite the block out cpx #0 ; an error is checked for  bne 11$ ; if error found, skip rest  mvw SIOWdirPtr,A4 ; restore directory pointer ldy #0 lda A2L ; get th(H0 ;****************************** ;* CpyFName Copy a filename A2->A3 ;* Inputs: ;* A2 file name to copy ;* A3 destination for filename ;* Outputs: ;* .a ? ;****************************** CpyFname: ldy #$ff ; prepare for filename copy 10$: iny lda (A2),y ; copy filename chars sta (A3),y beq 11$ ; keep going until NULL, cmp #$A0 ; or a pad character is found. bne 10$ 11$: cpy #16 ; now, until all 16 chars filled in... beq 12$ lda #$A0 ; ...pad with these damn things sta (A3),y iny bne 11$ 12$: rts {(H0 ;****************************** ;* MakeFNUpp Make a filename uppercase ;* Inputs: ;* A2 file name to change ;* Outputs: ;* .a ? ;****************************** MakeFNUpp: ldy (H0 ;****************************** ;* MakeFNUpp Make a filename uppercase ;* Inputs: ;* A2 file name to change ;* Outputs: ;* .a ? ;****************************** MakeFNUpp: ldy #$ff 10$: iny ; loop through filename chars lda (A2),y beq 11$ ; loop until NULL char... cmp #$A0 ; ...or a pad character is found beq 11$ cmp #'a' ; otherwise look at the byte blt 10$ ; if greater than a... cmp #'z' ; ...and less = z... bgt 10$ ; then its lowercase! sec sbc #'a' - 'A' ; now fix it sta (A2),y ; and save it back bra 10$ 11$: rts f|@h0 SIOWSvBAM: ldy #$00 10$: lda $8200,y sta SIOWBAM,y iny bne 10$ rts SIOWLdBAM: ldy #$00 10$: lda SIOWBAM,y sta $8200,y iny bne 10$ rts er to null-@h0 SIOWrDrv: cpb curDrive,SIOWdrv beq 99$ lda SIOWdrv jsr SetDevice 99$: rts M: ldy #$00 10$: lda SIOWBAM,y sta $8200,y iny bne 10$ rts rts ************ MakeFNUpp: ldy #$ff 10$: iny ; loop through filename char@h0 SIOWSvBAM: ldy #$00 10$: lda $9c80,y sta SIOWBAM,y iny bne 10$ rts SIOWLdBAM: ldy #$00 10$: lda SIOWBAM,y sta $9c80,y iny bne 10$ rts ***************** MakeFNUpp: ldy #$ff 10$: iny ; loop through filename char@h0 SIOWiniBlk: ldw R0,#256 ldw R1,#SIOWBuf jsr ClearRam inc SIOWBuf+1 ; initialize the number of bytes rts SIOWiniDir: clc ; first, create pointer to block adc #[(SIOWdirBlk) ; assume .a has index sta SIOWdirPtr lda #0 adc #](SIOWdirBlk) ; and try to handle carrys sta SIOWdirPtr+1 ldy #0 10$: lda $8000,y ; now copy block from $8000 sta SIOWdirBlk,y ; to our own block buffer iny bne 10$ ; copy until done rts bgt 10$ ; then its lowercase! sec sbc #'a' - 'A'@h0 .ramsect SIOWBuf: .block 256 ; working output buffer SIOWdirBlk: .block 256 ; working directory block?! SIOWBAM: .block 256 ; working BAM block?! SIOWdirTS: .block 2 ; directory entry track & sector SIOWFsize: .block 2 ; working file siZe SIOWdirPtr: .block 2 ; directory entry pointer SIOWTnS: .block 2 ; track and sector holder SIOWdrv: .block 1 ; drive file created on buffer iny bne 10$ ; copy until done rts bgt 10$ ; then its lowercase! sec sbc #'a' - 'A'MODgeoWx%EPRG formatted GEOS file V1.0AWrite Image V2.0geoWrite V2.1  ...݅ ( >1 59 ..  9 < <` " . r " `(@1ʎsAڢ9 V&CZf5a\VAz? .noeqin (H.include GEOSequates GEOWLBuf = $8100 ; fileHeader is our Links buffer GEOWLTnS = $7ffe ; Links TNS ($8873) GEOWPTnS = $7ffc ; Page TNS ($886f) GEOWLptr = $7ffa ; Page Pointer into links ($8877) GEOWLnum = $7ff8 ; LineNum ($8879) GEOWCTnS = $7ff6 ; picture track and sector ($887a) GEOWCBuf = $8300 ; curRecord = current PICTURE record .glbl .eqin (Hh;**************************************** ;* MODgeoWx  - geoProjects library (C) 1998 Bo Zimmerman (Hh;* ;* Intro: ;* This modules supports the creation of ;* geoWrite files, and includes support ;* for adding pictures. This version is ;* multi-module (VLIR). It does this by ;* bastardiZing all the standard GEOS ;* disk buffers, so protect them. ;* ;* Functions: ;* CreatWF( .word Filename pointer) * ;* PutWByte( .a Byte to write out) * ;* PutWString( .word String pointer) * ;* PutWBuf( .word Buffer pointer ;* .word Number of bytes) * ;* PutWMem( .word Buffer pointer ;* .word Last byte pointer) * ;* PutWPic( .word Pointer to photo scrap ;* .word Pointer to last byte) * ! ;* GWPage() - closes current page & opens another. ;* CloseWF( .word Filename pointer) * ;* ;* * = includes i_Function call, and returns ;* status in the .x register ;* ;* Comments: ;* ! The only non-standard aspect here is PutWPic. A2 ;* should point to a width byte, followed by a SINGLE ;* height byte, followed by the data. A3 should ;* point just beyond the last byte. ;**************************************** .psect (H0 ;****************************** ;* CreatWF Create a new geoWrite file ;* Inputs: ;* A2 pointer to a file name ;* curDrive drive to create file on ;* Outputs: ;* .x status ;* .a 0 ;****************************** CreatWF: jsr OpenDisk cpx #0 beq 10$ rts 10$:  mvw A2,R6 ldb $886e,#$ff jsr FindFile ; see if file already exists cpx #0 bne 11$ ldx #63 99$: rts 11$: mvw A2,GEOWHead  ldw R9,#GEOWHead ldb R10L,#0 jsr SaveFile ; create the geoWrite VLIR file cpx #0 bne 99$ ldy #2 lda fileTrScTab,y ; find the links block sta GEOWLTnS iny lda fileTrScTab,y sta GEOWLTnS+1 iny ; here is the free sector i forgot lda fileTrScTab,y sta APITemp2 iny lda fileTrScTab,y ; ill make use... sta APITemp2+1 ldw R1,#GEOWLBuf ldy #0 12$: lda #0 sta (R1),y iny ; init the links page lda #$ff sta (R1),y iny bne 12$ ldw R4,#GEOWLBuf mvw GEOWLTnS,R1 jsr PutBlock ; put the first links block cpx #0 beq 13$ rts 13$: ldy #0 14$: lda $9c80,y ; save the BAM here, please sta BAM3HEAD,y iny bne 14$ ldw GEOWLptr,#GEOWLBuf+2 ; gets to the first record ldw fileSize,#3 ; we start w/ info, links, and 1 more ldb curRecord,#64 ; current picture record, thanks. jmp GEOWfstP ; set up the first page is Put(H0 ;****************************** ;* i_CreatWF Create a new c= geowrite file ;* Inputs: ;* .word pointer to a file name ;* curDrive drive to create file on ;* Outputs: ;* .x status ;* .a 0 ;****************************** i_CreatWF: jsr APIinit jsr CreatWF ldy #2 ; two byte parameter list jmp APIreturn u(H0 ;****************************** ;* PutWByte Output a byte to a geowrite file ;* Inputs: ;* .a byte to write out ;* curDrive driv(H0 ;****************************** ;* PutWByte Output a byte to a geowrite file ;* Inputs: ;* .a byte to write out ;* curDrive drive to create file on ;* Outputs: ;* .x status ;* .a ? ;****************************** PutWByte:  sta R10L ; save the byte for a sec 10$: lda diskBlkBuf+1 bne 12$ ; have we gone over? jsr GEOWnxtB beq 10$ ; if no error, then try again rts ; return an error 12$: ldy diskBlkBuf+1 lda R10L sta diskBlkBuf,y inc diskBlkBuf+1 ldx #0 ; return no error rts Bw(H0 ;****************************** ;* i_PutWByte Output a byte to a geowrite file ;* Inputs: ;* .byte byte to write out ;* curDrive drive to create file on ;* Outputs: ;* .x status ;* .a byte wri(H0 ;****************************** ;* i_PutWByte Output a byte to a geowrite file ;* Inputs: ;* .byte byte to write out ;* curDrive drive to create file on ;* Outputs: ;* .x status ;* .a byte written ;****************************** i_PutWByte: jsr APIinit lda A2L jsr PutWByte ldy #1 lda A2L cpx #0 jmp APIreturn tz(H0 ;****************************** ;* PutWString Output a string to a geowrite file ;* Inputs: ;* A2 pointer to $ to wri(H0 ;****************************** ;* PutWString Output a string to a geowrite file ;* Inputs: ;* A2 pointer to $ to write out ;* curDrive drive to create file on ;* Outputs: ;* .x status ;* .a ? ;* Destroyed: ;* A2 ptr to string Null ;****************************** PutWString:  ldy #0 ; increments A2, so this is necc lda (A2),y bne 11$ ; Zero is delimeter ldx #0 ; non-disk exit though rts 11$: jsr PutWByte bne 13$ ; finally save the byte inw A2 ; increment the string pointer cbi R10L,#13 ; a CR is a special case bne PutWString ; loop back if not a CR inc  GEOWLnum cbi  GEOWLnum ,#65 bne PutWString ; if plenty of lines left, loop back jsr GWPage ; close this page & move to next beq PutWString ; loop back up to keep going... 13$: rts {(H0 ;****************************** ;* i_PutWString Output a string to a geowrite file ;* Inputs: ;* .word pointer to $ to write out ;* curDrive drive to create file on (H0 ;****************************** ;* i_PutWString Output a string to a geowrite file ;* Inputs: ;* .word pointer to $ to write out ;* curDrive drive to create file on ;* Outputs: ;* .x status ;* .a ? ;****************************** i_PutWString: jsr APIinit jsr PutWString ldy #2  cpx #0  jmp APIreturn |(H0 ;****************************** ;* PutWBuf Output a buffer to a geowrite file ;* Inputs: ;* A2 pointer to buffer ;* A3 nu(H0 ;****************************** ;* PutWBuf Output a buffer to a geowrite file ;* Inputs: ;* A2 pointer to buffer ;* A3 number of bytes to write ;* curDrive drive to create file on ;* Outputs: ;* .x status ;* .a ? ;* Destroyed: ;* A2 converted to last byte ;****************************** PutWBuf: ldy #0 lda (A2),y jsr PutWByte bne 10$ inw A2 dew A3 cwi A3,#0 bne PutWBuf 10$: rts 4h(H0 ;****************************** ;* i_PutWBuf(H0 ;****************************** ;* i_PutWBuf Output a buffer to geowrite file ;* Inputs: ;* .word pointer to buffer ;* .word number of bytes to write ;* curDrive drive to create file on ;* Outputs: ;* .x status ;* .a ? ;* Destroyed: ;****************************** i_PutWBuf: jsr APIinit jsr PutWBuf ldy #4  cpx #0  jmp APIreturn i(H0 ;****************************** ;* PutWMem Output a block of memory to a geowrite file ;* In(H0 ;****************************** ;* PutWMem Output a block of memory to a geowrite file ;* Inputs: ;* A2 pointer to start location ;* A3 pointer to last byte ;* curDrive drive to create file on ;* Outputs: ;* .x status ;* .a ? ;* Destroyed: ;* A2 will point to end of buffer ;****************************** PutWMem: ldy #0 lda (A2),y jsr PutWByte bne 10$ inw A2 cpw A2,A3 bne PutWMem 10$: rts zk(H0 ;****************************** ;(H0 ;****************************** ;* i_PutWMem Output a picture to geowrite file ;* Inputs: ;* .word pointer to a photo scrap ;* .word pointer to number of bytes ;* curDrive drive to create file on ;* Outputs: ;* .x status ;* .a ? ;* Destroyed: ;****************************** i_PutWMem: jsr APIinit jsr PutWMem ldy #4  cpx #0  jmp APIreturn p(H0 ;****************************** ;* PutWPic Output a picture to a geowrite file ;* I(H0 ;****************************** ;* PutWPic Output a picture to a geowrite file ;* Inputs: ;* A2 pointer to photo scrap ;* A3 pointer to last byte ;* Outputs: ;* .x status ;* .a ? ;* Destroyed: ;* A2 will point to end of buffer ;****************************** PutWPic:  lda #$10 ; put gfx escape jsr PutWByte ldy #0 lda (A2),y ; put the width jsr PutWByte ldy #1 lda (A2),y ; put the height lsb jsr PutWByte lda #0 jsr PutWByte ; put the height hsb cpx #0 beq 11$ 98$: rts 11$: lda curRecord jsr PutWByte ; put the VLIR link into page bne 98$ ldw R0,#256 ldw R1,#GEOWCBuf ; GEOWCBuf is our pic buffer!!! jsr ClearRam ; gimma a fresh, happy piece ldb GEOWCBuf,$00 ldb GEOWCBuf+1,$02 ; prepare for next block please jsr GEOWaloc beq 10$ rts 10$: mvw APITemp2,GEOWCTnS lda curRecord ; get index into Links asl a ; multiply by two tay ; and make it an index iny iny ; point beyond the block link lda GEOWCTnS sta GEOWLBuf,y ; by copying our new TNS iny lda GEOWCTnS+1 sta GEOWLBuf,y ; to the Links table mvw GEOWLTnS,R1 ldw R4,#GEOWLBuf jsr PutBlock ; now resave the Links data cpx #0 bne 50$ jsr GEOWputP beq 50$ rts 50$: mvw GEOWCTnS,R1 ldw R4,#GEOWCBuf ; save the last sector jsr PutBlock inc curRecord ; and increment it for later ldx #0 ; and return with happiness  rts &r(H0 ;****************************** ;* i_PutWPic Output a picture to geowrite file ;* Inputs: ;* .word pointer to a photo scrap ;* (H0 ;****************************** ;* i_PutWPic Output a picture to geowrite file ;* Inputs: ;* .word pointer to a photo scrap ;* .word pointer to last byte ;* Outputs: ;* .x status ;* .a ? ;* Destroyed: ;****************************** i_PutWPic: jsr APIinit jsr PutWPic ldy #4 cpx #0 jmp APIreturn u(H0 ;****************************** ;* CloseWF Close a file opened with CreatWF ;* Inputs: A2 file name to close ;* curDrive drive file c(H0 ;****************************** ;* CloseWF Close a file opened with CreatWF ;* Inputs: A2 file name to close ;* curDrive drive file created on ;* Outputs: ;* .x status ;* .a 0 ;****************************** CloseWF:  lda #0 jsr PutWByte ; is this necessary? jsr GEOWClo2  ldy #0 11$: lda BAM3HEAD,y sta $9c80,y iny bne 11$  jsr PutDirHead ; write 18,0 -- experiment with no (H0 cpx #0 bne 10$ mvw A2,R6 ldb $886e,#$ff jsr FindFile ; this shouldn't take long cpx #0 bne 10$ ; always check for errors ldy #$1c lda fileSize ; now fix the file siZe sta (R5),y iny lda fileSize+1 sta (R5),y ; please thank you ldw R4,#$8000 jsr PutBlock ; and save the dir sector back cpx #0 10$: rts GEOWClo2: dec diskBlkBuf+1 ; make the pointer proper mvw GEOWPTnS,R1 ldw R4,#diskBlkBuf jsr PutBlock ; save the last block cpx #0 bne 11$ mvw  GEOWLTnS ,R1 ldw R4,# GEOWLBuf jsr PutBlock ; and save the links again... cpx #0 11$: rts CTnS+1 sta GEOWLBuf,y ; to the Links table mvw GEOWLTnS,R1 ldw R4,#GEOWLBuf jsr PutBlock ; now resave the Links data cpx #0 bne 50$ jsr GEOWputP beq 50$ rts 50$: mvw GEOWCTnS,R1 ldw R4,#GEOWCBuf ; save the last sector jsr PutBloc(H0 ;****************************** ;* i_CloseWF Close a file opened with CreatWF ;* Inputs: .word file name to close ;* curDrive drive file created on ;* Outputs: ;* .x status ;* .a 0 ;****************************** i_CloseWF: jsr APIinit jsr CloseWF ldy #2 cpx #0 jmp APIreturn x(H0 ;****************************** ;* GWPage Close this page and move to next ;* Inputs: ;* curDrive drive file created on ;* Outputs: ;* .x status ;* .a(H0 ;****************************** ;* GWPage Close this page and move to next ;* Inputs: ;* curDrive drive file created on ;* Outputs: ;* .x status ;* .a 0 ;******************************  GWPage: lda #12 jsr PutWByte ; page break, please bne 11$ jsr GEOWClo2 ; close this page bne 11$ jsr GEOWnewP ; start the next one... 11$: rts !{@h0 GEOWnewP: inw GEOWLptr ; increment links for next page inw GEOWLptr ; twice jsr GEOWaloc ; get o@h0 GEOWnewP: inw GEOWLptr ; increment links for next page inw GEOWLptr ; twice jsr GEOWaloc ; get our first page sector beq 10$ rts ; error is returned 10$: GEOWfstP: mvw APITemp2,GEOWPTnS ; and save it ldw R0,#256 ldw R1,#diskBlkBuf jsr ClearRam ; gimma a fresh, happy piece mvw GEOWLptr,R0 ldy #0 ; save link in Links for this page lda GEOWPTnS sta (R0),y iny lda GEOWPTnS+1 ; save link in Links for this page sta (R0),y ldy #0 12$: lda GEOWPtop,y ; copy in the top of page data sta diskBlkBuf,y iny cpy #33 blt 12$ ldx #1 ; return no error stx  GEOWLnum ldx #0 rts ; and we're done! #|@h0 GEOWnxtB: jsr GEOWaloc ; save this allocated block beq 12$ 10$: cpx #0 11$: @h0 GEOWnxtB: jsr GEOWaloc ; save this allocated block beq 12$ 10$: cpx #0 11$: rts ; return an error! 12$: mvw  APITemp2 ,diskBlkBuf ; save the block linker mvw GEOWPTnS,R1 ldw R4,#diskBlkBuf; save the last sector jsr PutBlock cpx #0 bne 11$ ; save it mvw APITemp2,GEOWPTnS ldw R0,#256 ldw R1,#diskBlkBuf jsr ClearRam ; gimma a fresh, happy piece ldb diskBlkBuf,$00 ldb diskBlkBuf+1,$02 ; prepare for next block please bra 10$ GEOWaloc: ldy #0 10$: lda BAM3HEAD,y sta $9c80,y iny bne 10$ ldw R2,#200 ; allocates a block in memory ldw R6,#APITemp2 ; and returns it in APITemp2 jsr BlkAlloc cpx #0 bne 11$ inw fileSize ldy #0 12$: lda $9c80,y sta BAM3HEAD,y iny bne 12$ cpx #0 ; reestablish the .x factor 11$: rts PutBlock ; save the last block cpx #0 bne 11$ mvw  GEOWLTnS ,R1 ldw R4,# GEOWLBuf jsr PutBlock ; and save the links again... cpx #0 11$: rts eyond the block link lda GEOWCTnS sta GEOWLBuf,y ; by copying our new TNS @h0 GEOWputP: ldy #0 ; now start on the picture itself lda (A2),y ; put the width jsr GEOWppB ldy #1 lda (A2),y ; put the height lsb jsr GEOWppB lda #0 jsr GEOWppB ; put the height hsb beq 11$ 99$: rts 11$: mvw A2,A4 ; get us a work pointer to data avw #2,A4 ; by pointing it at it 12$: cpw A4,A3 blt 13$ ; if they are equal, we are done! ldx #0 ; if everything's cool, no prob rts 13$: ldy #0 lda (A4),y jsr GEOWppB ; now its all conventional copying bne 99$ ; an unusual way to exit, but ohwell inw A4 bra 12$ GEOWppB: sta R10L ; save the byte for a sec 10$: lda GEOWCBuf+1 bne 14$ ; have we gone over? jsr GEOWaloc ; save this allocated block beq 13$ 11$: cpx #0 12$: rts ; return an error! 13$: mvw  APITemppp QCy } Ǚ㋁GgeoWAR V1.0Lysle E. Shields Play the game of world domination !@h0 GEOWHead: 0P .word $0000 .byte $03,$15,$bf 0P` .byte $ff,$ff,$ff,$80,$00,$01,$8f,$ff .byte $01,$88,$01,$01,$8b,$ff,$c1,$8a .byte $00,$41,$8a,$ff,$f1,$8a,$80,$11 .byte $8a,$8e,$11,$8a,$80,$11,$8a,$bf .byte $91,$8a,$80,$11,$8a,$9f,$11,$8a .byte $80,$11,$8a,$bf,$91,$8e,$80,$11 .byte $82,$bf,$91,$83,$80,$11,$80,$80 .byte $11,$80,$ff,$f1,$ff,$ff,$ff .byte $83 0P0 .byte APPL_DATA .byte VLIR .word 0 .word $00f0 .word $5772 ; ???? .byte "Write Image V2.0",0,0,0,$00 .byte "Bo Zimmerman",0,0,0,0,0,0,0,0 .byte "geoWrite V2.0",0,0,0,$00 .byte $01,$00,$00,$00,$00,$00,$00,$f0 .byte $02,$20,$12,$0e,$20,$b7,$c1,$cc .block 144-117 &p@@h0 GEOWPtop : .byte $00,$21 ; number of bytes (temp link) = 33 .byte $11,$00,$00,$df,$01,$38,$00,$50 .byte $00,$b0,$00,$df,$01,$df,$01,$df .byte $01,$df,$01,$df,$01,$00,$00,$30 .byte $00,$00,$00,$17,$09,$00,$00  R@h0 .ramsect BAM3HEAD: .block 256 umber of bytes (temp link) = 33 .byte $11,$00,$00,$df,$01,$38,$00,$50 .byte $00,$b0,$00,$df,$01,$df,$01,$df .byte $01,$df,$01,$df,$01,$00,$00,$30 .byte $00,$00,$00,$17,$09,$00,$00  $8aMODfbox%4PRG formatted GEOS file V1.0AWrite Image V2.0geoWrite V2.1  ...݅ ( >1 59 ..  9 < <` " . r " `(@1ʎsAڢ9 V&%:yiRZ[Z0P .noeqin .include GEOSequates .glbl .eqin ;**************************************** ;* MODfbox  - geoProjects library (C) 1998 Bo Zimmerman 0P;* ;* Intro: ;* This is a fantastic module that handles the entire ;* opening screens for a typical application, from ;* create to open to exit ;* ;* Functions: ;* FileBox(A2 pointer to intro graphics routine or 0 ;* A3 pointer to clear intro graphics or 0 ;* A4 perm data name to use ;* A5 pointer to dest filename only ;* curDrive - a bad place for DISK icons): ;* .x errors if any, 0 = ok ;* curDrive - device file is on ;* sysDBData - 0=create, $ff=open ;* ;* Comments: ;**************************************** dule (VLIR). It does this by ;* bast0P0 ;******************************* ;* FileBox ;* ;* Inputs: ;* A2 pointer to intro graphics routine or 0 ;* A3 pointer to clear intro graphics or 0 ;* A4 perm data name to use ;* A5 pointer to dest filename only ;* ;* curDrive - a bad place for DISK icons ;* Outputs: ;* .x errors if any, 0 = ok ;* curDrive - device file is on ;* sysDBData - 0=create, $ff=open ;* A5 - points to the destination filename ;*******************************  FileBox: lda numDrives cmp #1 ; only one drive? bne 10$ ldb FBOXnod1,#0 ; clear out drive/disk possibility ldb FBOXnoo1,#0 ; and on open box 10$: lda curDrive sta FBOXddrv lda A2H beq 11$ mvw A2,FBOXdo+1 ; set up any intro routine lda A3H beq 11$ mvw A3,FBOX2+1 ; set up any clear intro routine 11$: jmp FBOXdo =n0P0 FBOXdo: jsr FBOXnada ;draw any intro type stuff ldw R0,#FBOXfbox   ;open create/open/quit box jsr DoDlgBox FBOX2: jsr FBOXnada ;clear any intro type stuff lda sysDBData bne 0P0 FBOXdo: jsr FBOXnada ;draw any intro type stuff ldw R0,#FBOXfbox   ;open create/open/quit box jsr DoDlgBox FBOX2: jsr FBOXnada ;clear any intro type stuff lda sysDBData bne 11$ lda FBOXddrv ;restore initial drive jsr SetDevice jmp EnterDeskTop ;quit click box 11$: cmp #$0f bne 12$ jmp FBOXcrdo ;do create routine 12$: jmp FBOXopdo ;do open routines tq0P0 FBOXopdo: ldb FBOXnoo2,#$06 ; reset disk icon cpb curDrive,FBOXddrv bne 0P0 FBOXopdo: ldb FBOXnoo2,#$06 ; reset disk icon cpb curDrive,FBOXddrv bne 10$ ldb FBOXnoo2,#0 ; clear out disk icon 0P010$: ldw $885b,#$ff00 0P055$: jsr FBOXmvnm mvw A4,R10 ;permanent filename mvw A5,R5 ;filename location ldb R7L,#APPL_DATA ;type of file ldw R0,#FBOXobox ;opening box jsr DoDlgBox cbi sysDBData,$00 ;was any click hit? beq 55$ cmp #$02 ;was cancel hit? bne 22$ 21$: jmp FBOXdo 22$: cmp #$06 ;change disks? bne 23$ ldw $885b,#$ff00 ;reclear selection jsr FBOXchgd bne 21$ ;a change disk error? bra 55$ 23$: cmp #$05 ;miscellaneous click boxes? bne FBOXopdo  ldy #0 lda (A5),y ;non-null filename beq 21$  jsr FBOXopen 0P0 ldb sysDBData,#$ff ;denote an open and exit 44$: rts v0P0 FBOXsele: ;This routine handles clicks in the filename box lda mouseData ;was button pressed? bmi 94$ jsr FBOXckch ;check all filenames for click cmp #$ff be0P0 FBOXsele: ;This routine handles clicks in the filename box lda mouseData ;was button pressed? bmi 94$ jsr FBOXckch ;check all filenames for click cmp #$ff beq 94$ ;no filename was selected clc adc $885b sta APITemp2 ;save new filename index lda $885c cmp #$ff ;anything clicked before? beq 93$ ;yes, so exit! sec sbc $885b ;find old screen index tax lda ClkCht,x ;calculate old screen index sta R2L clc adc #$0c sta R2H jsr InvertRectangle ;un-invert old choice 93$: mvb APITemp2,$885c ;save new index 94$: rts FBOXckch: ;This routine finds which filename is clicked on ldb A6L,#$00 ;set temporary index 92$: ldx A6L lda ClkCht,x ;calculate filename box dimen. sta R2L ;top clc adc #$0c sta R2H ;bottom ldw R3,#$0047 ;now set left ldw R4,#$00c1 ; and right jsr IsMseInRegion cmp #$ff ;click was not on that filename bne 93$ jsr InvertRectangle ;if it was, invert the filename lda A6L ;here is your new index? rts ;and exit 93$: inc A6L lda A6L cbi A6L,#$05 ;otherwise go back and check bne 92$ ; the rest. lda #$ff rts ClkCht: .byte $24,$32,$40,$4e,$5c,$6a ;chart for calculating the top and bottom scanlines x0P0 FBOXobox: .byte $80 | $01 .byte 16 ;getFiles0P0 FBOXobox: .byte $80 | $01 .byte 16 ;getFiles .byte $06,$03 ;XOffset, YOffset .byte 11 .byte $84,$09 .word FBOXtxt4 .byte 12 .byte $84,$13 .byte A6 .byte 17 ;Routine on Click .word FBOXsele ;routine to execute on otherPress .byte $05,$11,$16 ;OPEN icon .byte $02,$11,$4c ;Cancel icon FBOXnoo1: .byte 18 ;drive icon .byte $11,$28 .word FBOXdcon FBOXnoo2: .byte $06,$11,$3a ;DISK icon .byte 0 ;end of defintion FBOXdcon: .word FBOXdmag ;graphic location .word 0 ;leave this at 0 .byte FBOXdwid ;width .byte FBOXdhit ;height .word FBOXswdv ;location of action routine FBOXdmag: @ FBOXdwid =picW FBOXdhit =picH z0P0 FBOXopen : ldw A6,#$8300 ;Set start of filename grid ldx $880P0 FBOXopen : ldw A6,#$8300 ;Set start of filename grid ldx $885c ;Find filename index bne 12$ ;If first filename, your done! beq 13$ 12$: avw #$11,A6 ;Otherwise go to next filename dex bne 12$ ;Keep on to fname index 13$: ldy #$00 ;Now move filename 14$: lda (A6),y ; onto valid position sta (A5),y iny cpy #$11 ;Up to max 17 characters bne 14$ lda #$00 ;Then set EOL character as last sta (A5),y rts  |0P0 FBOXcrdo: ldb FBO0P0 FBOXcrdo: ldb FBOXnod2,#$06 ; reset disk icon cpb curDrive,FBOXddrv bne 10$ ldb FBOXnod2,#0 ; clear out disk icon 0P010$: jsr FBOXmvnm 0P0 ldw R0,#FBOXcbox ;now perform actual dialog box ldw A6,#FBOXdnam jsr DoDlgBox cbi sysDBData,#$02 ;was cancel hit? bne 15$ 14$: jmp FBOXdo ;back to start 15$: cmp #$06 ;change disks bne 16$ jsr FBOXchgd bne 14$ ;a change disk error? jmp FBOXcrdo 16$: cmp #$f0 ;if other than filename, repeat 0P0 beq FBOXcrdo ldy #0 lda (A5),y ;non-null filename beq 14$ jsr FBOXcrve cpx #0 bne FBOXcrdo ldb sysDBData,#$00 ;denote a create and exit rts Oh0P0 FBOXswdv: jsr FBOXswd2 0P0 FBOXswdv: jsr FBOXswd2 cpx #$00 ;check for error! beq 21$ jsr FBOXswd2 ldb sysDBData,#$02 ;error detected, return abort! jmp RstrFrmDialog 21$: ldb sysDBData,#$f0 ;denoted Drive icon jmp RstrFrmDialog ;no error, jump back FBOXswd2:  ldy curDrive iny cpy #11 bne 11$ ldy #8 11$: tya jsr SetDevice  jsr OpenDisk cpx #0 bne FBOXswd2 rts oi0P0 FBOXchgd: 10$: ldw R0,#FBOXcdbx ;handle swap disk box jsr DoDlgBox jsr OpenDisk ;ope0P0 FBOXchgd: 10$: ldw R0,#FBOXcdbx ;handle swap disk box jsr DoDlgBox jsr OpenDisk ;open new disk cpx #0 bne 10$ rts FBOXcdbx: .byte $80 | $01 .byte 11 ;add text .byte $0e,$12 .word FBOXtxt7 .byte $01,$0f,$42 ;OK icon .byte 0 ;end of defintion j0P0 FBOXmvnm: ldx #A6 ;discover the current drives jsr GetPtrCurDkNm ;name. should this be a routine? ldy #$00 17$: lda (A6),y ;copy disk name to buffer... cmp #$a0 ;so that a 0 can be adde0P0 FBOXmvnm: ldx #A6 ;discover the current drives jsr GetPtrCurDkNm ;name. should this be a routine? ldy #$00 17$: lda (A6),y ;copy disk name to buffer... cmp #$a0 ;so that a 0 can be added beq 18$ ;and thus be readable by sta FBOXdnam,y ;the dialog box routines iny cmp #$a0 beq 18$ cpy #18 bne 17$ 18$: lda #0 ;now add rol to end sta FBOXdnam,y rts m0P0 FBOXcrve: jsr GetDirHead ;get BAM into memory cpx #0 bne 99$ ; exit on dis0P0 FBOXcrve: jsr GetDirHead ;get BAM into memory cpx #0 bne 99$ ; exit on disk error ldw R5,#$8200 ;point to BAM jsr CalcBlksFree lda R4H bne 11$ lda R4L cmp #$14 ;20 blocks minimum bcs 11$ ldw A6,#FBOXtxt9 ;not enough blocks 10$: ldw R0,#FBOXnbox jsr DoDlgBox ;whine and exit ldx #$ff 99$: rts 11$: ldb $886e,#$ff ;check for file existance mvw A5,R6 jsr FindFile cpx #$05 ;this or that error? beq 13$ cpx #$00 bne 12$ ldw A6,#FBOXtxt8 bra 10$ 12$: ldw A6,#FBOXtxtA ;other errors bra 10$ 13$: ldx #$00 rts ;enough blocks FBOXnbox: .byte $80 | $01 .byte 12 ;add text .byte $20,$1b .byte A6 .byte $02,$0f,$40 ;cancel icon .byte 0 ;end of defintion Np0P0 FBOXcbox: .byte $0P0 FBOXcbox: .byte $80 | $01 .byte 11 ;add text .byte $16,$11 .word FBOXtxt4 .byte 12 .byte $43,$11 .byte A6 .byte 11 ;add text .byte $16,$22 .word FBOXtxt5 .byte 13 ;GetString .byte $16,$33 ;XOffset.Yalso .byte A5 .byte 18 ;maximum # of chars to accept. .byte $02,$10,$47 ;Cancel icon FBOXnod1: .byte 18 ;drive icon .byte $09,$47 .word FBOXdcn2 FBOXnod2: .byte $06,$02,$47 ;DISK icon .byte 0 ;end of defintion FBOXdcn2: .word FBOXdmag ;graphic location .word 0 ;leave this at 0 .byte FBOXdwid ;width, set below .byte FBOXdhit ;height, set below .word FBOXswdv ;location of action routine s0P0 FBOXfbox: .byte $80 | $01 .byte 11 ;add text .byte $16,$13 .word FBOXtxt0 .byte $00P0 FBOXfbox: .byte $80 | $01 .byte 11 ;add text .byte $16,$13 .word FBOXtxt0 .byte $05,$02,$32 ;OPEN icon .byte 18 ;user icon .byte $02,$1c .word FBOXccon .byte 18 ;user icon .byte $02,$49 .word FBOXqcon .byte 11 ;add text .byte $46,$26 .word FBOXtxt1 .byte 11 ;add text .byte $46,$3e .word FBOXtxt2 .byte 11 ;add text .byte $46,$53 .word FBOXtxt3 .byte 0 ;end of defintion FBOXccon: .word FBOXcmag ;graphic location .word 0 ;leave this at 0 .byte FBOXcwid ;width, set below .byte FBOXchit ;height, set below .word FBOXcrea ;location of action routine FBOXcmag: B FBOXcwid =picW FBOXchit =picH FBOXqcon: .word FBOXqmag ;graphic location .word 0 ;leave this at 0 .byte FBOXqwid ;width, set below .byte FBOXqhit ;height, set below .word FBOXquit ;location of action routine FBOXqmag: A FBOXqwid =picW FBOXqhit =picH t0P0 FBOXquit: ldb sysDBData,#$00 ;clear response, exit jmp RstrFrmDialogue FBOXcrea: ldb sysDBData,#0P0 FBOXquit: ldb sysDBData,#$00 ;clear response, exit jmp RstrFrmDialogue FBOXcrea: ldb sysDBData,#$0f ;create response, exit jmp RstrFrmDialogue FBOXnada: rts v0P0 FBOXt xt0: .byte $18,"P0P0 FBOXt xt0: .byte $18,"Please select an option:",27,0 FBOXtxt1: .byte $18,"new work file",27,0 (XFBOXtxt2: .byte $18,"existing file",27,0 FBOXtxt3: .byte $18,"to deskTop",27,0 FBOXtxt4: .byte $18,"On Disk:",27,0 FBOXtxt5: .byte $18,"Please enter new filename:",27,0 FBOXtxt6: .byte $18,"Enter new file name:",27,0   FBOXtxt7: .byte $18,"Insert new disk into disk drive.",27,0 FBOXtxt8: .byte $18," ERROR:  File exists!",27,0 FBOXtxt9: .byte $18," ERROR:  Disk full!",27,0 FBOXtxtA: .byte $18,"ERROR: Cannot create!",27,0 Fw8X0 .ramsect FBOXdnam: .block 20 FBOXddrv: .block 1 @wٞٳٳ?08X0 .ramsect FBOXdnam: .block 20 FBOXddrv: .block 1 @wٞٳٳ?03 Axٻٙٙٙٙۙٞٳٳ?03 Axٻٙٙٙٙۙ B^x``<3fc33>c3?fc0fc3fc3ٻٙٙٙٙۙ B^x``<3fc33>c3?fc0fc3fc3?9 .word FBOXswdv ;location of action routine FBOXdmag: @ FBOXdwid =pi``<3fc33>c3?fc0fc3fc3?9 .word FBOXswdv ;location of action routine FBOXdmag: @ FBOXdwid =picW FBOXdhit =picH z0P0 FBOXopen : ldw A6,#$8300 ;Set start MODseqWx%8PRG formatted GEOS file V1.0AWrite Image V2.0geoWrite V2.1  ...݅ ( >1 59 ..  9 < <` " . r " `(@1ʎsAڢ9 V&`Skxr](@ .noeqin (H.include GEOSequates .glbl .eqin (Hh;**************************************** ;* MODseqW  - geoProjects library (C) 1998 Bo Zimmerman (Hh;* ;* Intro: ;* This modules supports C= seq/prg file ;* creation and writing. A write buffer ;* and directory entries will be maintained ;* during execution. ;* ;* Functions: ;* CreatSF( .word Filename pointer ;* .byte Splat file type) * ;* PutSByte( .a Byte to write out) * ;* PutSString( .word String pointer) * ;* PutSBuf( .word Buffer pointer ;* .word Number of bytes) * ;* PutSMem( .word Buffer pointer ;* .word Last byte pointer) * ;* ClosSF( .byte File type to save as) * ;* CpyFName( A2 Pointer to filename ;* A3 Destination pointer) ;* MakeFNUpp( A2 Pointer to filename) ;* ;* * = includes i_Function call, and returns ;* status in the .x register ;* ;* Comments: ;* A multi file version will have to await (H;* some thought to the multiple-dir block ;* problem (two files sharing a dir block). ;* There is also the problem of shared ;* BAM space between different disks. ;* In the meantime, consider a MODseqWx ;* that has swap buffers equal in size to ;* the ramsects in this module. A Swap- ;* Drive function would restore settings ;* from the buffer, allowing files on sepa- ;* rate drives at least. ;**************************************** .psect ollowed by the data. A3 should ;* point just beyon(H0 ;****************************** ;* CreatSF Create a new c= sequential file ;* Inputs: ;* A2 pointer to a file name ;* A3L file type (splat type) ;* curDrive drive to create file on ;* Outputs: ;* .x status ;* .a 0 ;****************************** CreatSF: jsr MakeFNUpp ; all c= filenames uppercase ONLY mvw A2, R6 ; copy filename pointer for GEOS ldb $886e,#1 jsr FindFile ; ensure file doesn't already exist cpx #5 ; file not found only good error beq 11$ cpx #0 ; zero means file exists bne 10$ ldx #63 ; so change it to 63--file exists 10$: lda #0 ; two obligatory bytes  rts ; exit in early disgrace 11$: jsr OpenDisk ; no errors yet, so read in BAM cpx #0 bne 10$ ; a bad disk error, so exit ldw R2,#3 ; allocate 3 bytes to get a new block ldy #0 ldw R6,#APITemp1 jsr BlkAlloc cpx #0 ; allocated, so check for errors bne 10$ ; another bad disk error! Exit! mvw APITemp1,SIOWTnS; restore saved t&s list jsr SIOWiniBlk ; clear out the given sector ldb R10L,#0 jsr GetFreeDirBlk ; now find a directory entry cpx #0 bne 10$ ; a error getting dir entry! mvw R1,SIOWdirTS ; OK! now save the dir block tk & sec tya ; prepare index into dir blk jsr SIOWiniDir ; create pointer, copy dir block mvb A3L,APITemp1 ; save the file type mvw SIOWdirPtr,A3 ; copy work dir pointer mvw SIOWdirPtr,R1 ldw R0,#$1d ; clear some space in dir block jsr ClearRam ldy #0 ; now init the dir entry lda APITemp1 ; set as unclosed PRG file sta (A3),y ; write into dir entry iny lda SIOWTnS ; pointer to first track sta (A3),y ; write into dir entry iny lda SIOWTnS+1 ; pointer to first sector sta (A3),y ; write into dir entry ldw SIOWFsize,#1 ; init the file size avw #3,A3 ; set up for filename copy jsr CpyFname ; copy filename A2 into space A3 jsr SIOWSvBAM ; save this disks BAM map mvw SIOWdirTnS,R1 ; restore dir block Tk & sec ldw R4,#SIOWdirBlk jsr PutBlock ; save the directory entry back cpx #0 bne 99$ lda #0 99$: rts (H0 ;****************************** ;* i_CreatSF Create a new c= sequential file ;* Inputs: ;* .word pointer to a file name ;* .byte file type (splat type, 0=PRG) ;* curDrive drive to create file on ;* Outputs: ;* .x status ;* .a 0 ;****************************** i_CreatSF: jsr APIinit lda A3L ; check splat type beq 10$ ldb A3L,#2 ; default file type is #2 (PRG) 10$: jsr CreatSF ldy #3 ; three byte parameter list jmp APIreturn z(H0 ;(H0 ;****************************** ;* PutSByte Output a byte to a sequential file ;* Inputs: ;* .a byte to write out ;* curDrive drive to create file on ;* Outputs: ;* .x status ;* .a ? ;****************************** PutSByte: inc SIOWBuf+1 ; increment byte pointer beq 11$ ; exit on wrap over ldy SIOWBuf+1 ; otherwise write the byte sta SIOWBuf,y ldx #0 ; clear errors and exit  10$: rts ; no new block must be written 11$: sta APITemp1 ; save byte for later jsr SIOWLdBAM ; reload this disks BAM avw #1,SIOWFsize ; increment file size ldw R2,#3 ; 3 bytes is all thats needed... ldw R6,#APITemp2 ; to allocate 1 new block jsr BlkAlloc cpx #0 ; now check for errors bne 10$ ; an error? yes = to the exit jsr SIOWSvBAM ; save the updated BAM mvw APITemp2,SIOWBuf; clean, so create link mvw SIOWTnS,R1 ; restore this blocks Tk & Sec ldw R4,#SIOWBuf ; and ready it for writing jsr PutBlock ; the block is written! cpx #0 ; was there an error on that write? bne 10$ ; if so, then exit mvw APITemp2,SIOWTnS; now save the new Tk and Sec jsr SIOWiniBlk ; re-clear the buffer block lda APITemp1 ; restore the byte to write jmp PutSByte ; and write it out G|(H0 ;****************(H0 ;****************************** ;* i_PutSByte Output a byte to a sequential file ;* Inputs: ;* .byte byte to write out ;* curDrive drive to create file on ;* Outputs: ;* .x status ;* .a byte written ;****************************** i_PutSByte: jsr APIinit lda A2L jsr PutSByte ldy #1 lda A2L jmp APIreturn sta $8200,y iny bne 10$ rts er to null-terminated ;* string to compare. ;* .word Pointer to null-terminated. ;* string to compare ;* Outputs: ;* .a ? ;* .(H0 ;****************************** ;* PutSString Output a string to a sequential file ;* Inputs: ;* A2 pointer to $ to write out ;* curDrive drive to create file on ;* Outputs: ;* .x status ;* .a ? ;* Destroyed: ;* A3 ptr to string Null ;****************************** PutSString: mvw A2,A3 ; create a work pointer SIOWSS2: ldy #0 lda (A3),y ; get a byte beq 11$ ; if NULL, end jsr PutSByte ; otherwise write it out cpx #0 ; check for disk error bne 11$ ; if error, also exit inc A3L ; otherwise increment work pointer bne 10$ ; if low byte no zeroed, skip inc A3H ; increment high byte of wk ptr 10$: jmp SIOWSS2 ; go write the next byte 11$: rts  j(H0 ;****************************** ;*(H0 ;****************************** ;* i_PutSString Output a string to a sequential file ;* Inputs: ;* .word pointer to $ to write out ;* curDrive drive to create file on ;* Outputs: ;* .x status ;* .a ? ;****************************** i_PutSString: jsr APIinit jsr PutSString ldy #2 jmp APIreturn k(H0 ;****************************** ;* PutSBuf Output a buffer to a seq file ;* Inputs: ;* A2 pointer to buffer ;* A3 number of bytes to wr(H0 ;****************************** ;* PutSBuf Output a buffer to a seq file ;* Inputs: ;* A2 pointer to buffer ;* A3 number of bytes to write ;* curDrive drive to create file on ;* Outputs: ;* .x status ;* .a ? ;* Destroyed: ;* A3 converted to last byte ;****************************** PutSBuf: adw A2,A3 ; convert to PutSMem dec A3L ; now lose the extra byte cbi A3L,#255 bne 10$ dec A3H 10$: jmp PutSMem =m(H0 ;************************(H0 ;****************************** ;* i_PutSBuf Output a buffer to seq file ;* Inputs: ;* .word pointer to buffer ;* .word number of bytes to write ;* curDrive drive to create file on ;* Outputs: ;* .x status ;* .a ? ;* Destroyed: ;****************************** i_PutSBuf: jsr APIinit jsr PutSBuf ldy #4 jmp APIreturn p(H0 ;****************************** ;* PutSMem Output a block of memory to a seq file ;* Inputs: ;* A2 pointer to st(H0 ;****************************** ;* PutSMem Output a block of memory to a seq file ;* Inputs: ;* A2 pointer to start location ;* A3 pointer to last byte ;* curDrive drive to create file on ;* Outputs: ;* .x status ;* .a ? ;* Destroyed: ;* A2 will point to end of buffer ;****************************** PutSMem: 10$: ldy #0 lda (A2),y ; get the byte jsr PutSByte ; write it out cpx #0 ; check for an error beq 12$ ; if error found, then exit cpw A2,A3 ; now see if end is reached beq 12$ ; if yes, then exit inc A2L ; otherwise increment A2 bne 11$ ; no low byte overflow? inc A2H ; low byte overflow means inc A2H 11$: bra 10$ ; and write the next byte 12$: rts q(H0 ;***************(H0 ;****************************** ;* i_PutSMem Output a block of memory to seq file ;* Inputs: ;* .word pointer to start location ;* .word pointer to last byte ;* curDrive drive to create file on ;* Outputs: ;* .x status ;* .a ? ;* Destroyed: ;****************************** i_PutSMem: jsr APIinit jsr PutSMem ldy #4 jmp APIreturn u(H0 ;****************************** ;* ClosSF Close a file opened with CreatSF ;* Inputs: ;* A2L file t(H0 ;****************************** ;* ClosSF Close a file opened with CreatSF ;* Inputs: ;* A2L file type to close as ;* curDrive drive file created on ;* Outputs: ;* .x status ;* .a 0 ;****************************** ClosSF: mvw SIOWTnS,R1 ; restore last tk & sec ldw R4,#SIOWBuf ; and get the last block jsr PutClock ; write the block out cpx #0 ; an error is checked for  bne 11$ ; if error found, skip rest  mvw SIOWdirPtr,A4 ; restore directory pointer ldy #0 lda A2L ; get the file type ready sta (A4),y ; save the file type ldy #$1c ; ready the file size index lda SIOWFsize ; get the file size low byte sta (A4),y ; and write it to the buffer iny ; prepare the file size index+1 lda SIOWFsize+1 ; get the file size high byte sta (A4),y ; and write it to the buffer mvw SIOWdirTnS,R1 ; restore dir block tk and sec ldw R4,#SIOdirBlk ; prepare the dir block itself jsr PutBlock ; write it to disk cpx #0 ; an error on that write? bne 11$ ; if so, then exit jsr SIOWLdBAM ; restore the BAM block jsr PutDirHead ; and send the BAM back to disk 11$: lda #0 rts Lw(H0 ;****************************** ;* i_ClosSF Close a file opened with CreatSF ;* Inputs: ;* .byte file typ(H0 ;****************************** ;* i_ClosSF Close a file opened with CreatSF ;* Inputs: ;* .byte file type (0=PRG) ;* curDrive drive file created on ;* Outputs: ;* .x status ;* .a 0 ;****************************** i_ClosSF: jsr APIinit lda A2L bne 10$ ldb A2L,#130 10$: jsr ClosSF ldy #1 jmp APIreturn sy(H0 ;****************************** ;* CpyFName Copy a filename A2->A3 ;* Inputs: ;* A2 file name to copy ;* A3 destination for f(H0 ;****************************** ;* CpyFName Copy a filename A2->A3 ;* Inputs: ;* A2 file name to copy ;* A3 destination for filename ;* Outputs: ;* .a ? ;****************************** CpyFname: ldy #$ff ; prepare for filename copy 10$: iny lda (A2),y ; copy filename chars sta (A3),y beq 11$ ; keep going until NULL, cmp #$A0 ; or a pad character is found. bne 10$ 11$: cpy #16 ; now, until all 16 chars filled in... beq 12$ lda #$A0 ; ...pad with these damn things sta (A3),y iny bne 11$ 12$: rts {(H0 ;****************************** ;* MakeFNUpp Make a filename uppercase ;* Inputs: ;* A2 file name to change ;* Outputs: ;* .a ? ;****************************** MakeFNUpp: ldy (H0 ;****************************** ;* MakeFNUpp Make a filename uppercase ;* Inputs: ;* A2 file name to change ;* Outputs: ;* .a ? ;****************************** MakeFNUpp: ldy #$ff 10$: iny ; loop through filename chars lda (A2),y beq 11$ ; loop until NULL char... cmp #$A0 ; ...or a pad character is found beq 11$ cmp #'a' ; otherwise look at the byte blt 10$ ; if greater than a... cmp #'z' ; ...and less = z... bgt 10$ ; then its lowercase! sec sbc #'a' - 'A' ; now fix it sta (A2),y ; and save it back bra 10$ 11$: rts f|@h0 SIOWSvBAM: ldy #$00 10$: lda $8200,y sta SIOWBAM,y iny bne 10$ rts SIOWLdBAM: ldy #$00 10$: lda SIOWBAM,y sta $8200,y iny bne 10$ rts er to null-@h0 SIOWSvBAM: ldy #$00 10$: lda $9c80,y sta SIOWBAM,y iny bne 10$ rts SIOWLdBAM: ldy #$00 10$: lda SIOWBAM,y sta $9c80,y iny bne 10$ rts ***************** MakeFNUpp: ldy #$ff 10$: iny ; loop through filename char@h0 SIOWiniBlk: ldw R0,#256 ldw R3,#SIOWBuf jsr ClearRam inc BlkBuf+1 ; initialize the number of bytes rts SIOWiniDir: clc ; first, create pointer to block adc #[(SIOWdirBlk) ; assume .a has index sta SIOWdirPtr lda #0 adc #](SIOWdirBlk) ; and try to handle carrys sta SIOWdirPtr+1 ldy #0 10$: lda $8000,y ; now copy block from $8000 sta SIOWdirBlk,y ; to our own block buffer iny bne 10$ ; copy until done rts h@h0 .ramsect SIOWBu@h0 .ramsect SIOWBuf: .block 256 SIOWdirBlk: .block 256 SIOWBAM: .block 256 SIOWdirTS: .block 2 SIOWFsize: .block 2 SIOWdirPtr: .block 2 SIOWTnS: .block 2$: jmp SIOWSS2 ; go write the next byte 11$: rts  j(H߃MODwin2%XPRG formatted GEOS file V1.0AWrite Image V2.0geoWrite V2.1  ...݅ ( >1 59 ..  9 < <` " . r " `(@1ʎsAڢ9 V&vvDL`|dsY?0P .noeqin .include GEOSequates .glbl .eqin ;**************************************** ;* MODwin2  - geoProjects library (C) 1998 Bo Zimmerman 0P;* ;* Intro: ;* Handles creation of two movable/resizable ;* windows. Creates new RecoverVector, ;* appMain, and mouseFaultVec in support. ;* ;* Functions: ;* Win1Mv(.byte Window 1 top ;* .byte Window 1 bottom ;* .word Window 1 x position ;* .word Window 1 y position ;* .byte Draw now? 0=yes, 1=no)* ;* Win2Mv( same as Win1Mv )* ;* Win1Init (.word Pointer to window 1 titlebar ;* .word Pointer to "close" routine ;* .word Pointer to complex draw code ;* .byte Enabled? 0=no, 1=yes)* ;* Win2Init( same as Win1Init )* ;* WindInit (.word Pointer to custom appMain code ;* .word Pointer to custom click code ;* .byte Which window active? 1 or 2? ;* .byte Draw windows now? 0=no, 1=yes) * ;* WinAct (.byte 0=swap, 1=act 1, 2=act 2) * ;* .x has active window number ;* IsOverlap() - .a - If no overlap, 0. Overlapped, $ff ;* DrawWin1() - unprotected redraw of window 1 ;* DrawWin2() - unprotected redraw of window 2 ;* RedyWin1() - puts win 1 dimensions in R2-R4 ;* RedyWin2() - puts win 2 dimensions in R2-R4 ;* RedyWinA() - puts actv win dimensions in R2-R4 ;* DrawWinA() - unprotected redraw of active win ;* RedyWinI() - puts inactv win dimensions in R2-R4 ;* DrawWinI() - unprotected redraw of inactive win ;* GetStrWidth( R0 points to string) - returns width ;* APITemp2 contains width ;* APITemp2+2 contains # chars ;* APITemp2+3 contains max height ;* ;* Comments: ;* * = includes a i_ version of this function ;* Enabled properties not yet implemented ;**************************************** .psect 0P0 ;******************************* ;* Win1Mv ;* ;* Inputs: ;* A2L Window 1 top ;* A2H Window 1 bottom ;* A3 Window 1 x position ;* A4 Window 1 y position ;* A5L Draw now? 0=yes, 1=no ;* ;* Outputs: ;* .a 0 ;* .x 0 ;******************************* Win1Mv: mvw A2,WIN1Top mvw A3,WIN1Left mvw A4,WIN1Right lda A5L beq 10$ jsr DrawWin1 10$: lda #0 tax rts p0P0 ;******************************* ;* i_Win1Mv ;* ;* Inputs: ;* .byte Window 1 top 0P0 ;******************************* ;* i_Win1Mv ;* ;* Inputs: ;* .byte Window 1 top ;* .byte Window 1 bottom ;* .word Window 1 x position ;* .word Window 1 y position ;* .byte Draw now? 0=yes, 1=no ;* ;* Outputs: ;* .a 0 ;* .x 0 ;******************************* i_Win1Mv: jsr APIinit jsr Win1Mv ldy #7 ; 2 word ptrs + 3 bytes = 7 bytes jmp APIreturn 1 59 ..  9 < <` " . r " `(@1ʎsAڢ9 V&C;6q $0P .noeqin .include GEOSequates .glbl .eqin ;**************************************** ;* MODflist  - geoProjects library (C) 1998 Bo Zimmerman 0P;* ;* Intro: ;* Retreives list of filenames (all), includes ;* all manner of list traversal/display funcs. ;* ;* Functions: ;* FileList (.word Location of dest buffer ;* .word End of dest buffer ;* opened curDrive) .x=errors, .a=# read * ;* File2List (.word Location of dest buffer ;* .word End of dest buffer ;* .byte # items to skip ;* .byte max items to read ;* opened curDrive) .x=errors, .a=# read * ;* CopyFnam(.word Pointer to filename ;* .word Pointer to destination) * ;* PrntList (A2 Pointer to top of printable list ;* A3L Which relative item to highlight) * ! ;* .a=highlight, .x=# shown ;* DownList(.word Pointer to start item ;* .word Where to put result ptr ;* .byte How far down to point) * ;* .x =0 is ok, 1 is too far ;* UpList (.word Pointer to start item ;* .word Pointer to start o' list ;* .word Where to put result ptr ;* .byte How far up to point) * ;* .x =0 is ok, 1 is too far ;* ClkList () ! .x=0 or which one ;* PikList (.byte Which to affect) * ! ;* .x = 0 is ok, 1 is not done ;* ;* Comments: ;* * = includes i_ version ;* ! = requires the following: ;* R2L Top of box to print in ;* R2H Bottom of box ;* R3 Left side of box ;* R4 Right side of box ;**************************************** .psect R0 points to string) - returns width ;* APITemp2 contains width ;* APITemp2+20P0 ;******************************* ;* FileList ;* ;* Inputs: ;* A2 Location of dest buffer ;* A3 End of dest buffer ;* ;* Outputs: ;* .a ? ;* .x errors, if any ;******************************* FileList: ldw A4,#0 jmp File2List txa ; check for dir header error beq 11$ 10$: rts ; disk error!! 11$: svw #3,A2 jsr Get1stDirEntry 12$: txa bne 10$ ; check for error (and eof?) tya bne 10$ ; end of directory perhaps? lda (R5),y ; does the file exist? beq 16$ ; no, so sk0P0 ;******************************* ;* i_FileList ;* ;* Inputs: ;* .word Location of dest buffer ;* .word End of dest buffer ;* ;* Outputs: ;* .a ? ;* .x errors, if any ;******************************* i_FileList: jsr APIinit jsr FileList ldy #4 ; 2 word ptrs = 4 bytes jmp APIreturn  s0P0 ;******************************* ;* CopyFnam ;* ;* Inputs: ;* A2 Pointer to filename ;* A3 Pointer to destination ;* ;* Outputs: ;* .a 0 ;* .x 0 ;*****0P0 ;******************************* ;* File2List ;* ;* Inputs: ;* A2 Location of dest buffer ;* A3 End of dest buffer ;* A4L number of entries to skip ;* A4H number of entries total ;* ;* Outputs: ;* .a ? ;* .x errors, if any ;******************************* File2List: ldb A5L,#1 ldb A5H,#1 jsr OpenDisk txa ; check for dir header error beq 11$ 10$: dec A5H lda A5H  rts ; disk error!! 0P011$: svw #3,A2 jsr Get1stDirEntry 12$: txa bne 10$ ; check for error (and eof?) tya bne 10$ ; end of directory perhaps? lda (R5),y ; does the file exist? beq 16$ ; no, so skip to next jsr FLSTok ; this is for FileLst2 bcs 16$ iny iny 13$: iny ; now jump to filename itself lda (R5),y ; get a letter of the filename cmp #$a0 ; end of the filename reached? beq 14$ sta (A2),y ; y offset is ok, R6 is offset too! cpy #$13 ; too far? bne 13$ ; no, so get next letter to copy 14$: lda #0 ; put filename delimeter in sta (A2),y iny ; step out one byte for 0 sta (A2),y ; spare 0, just in case tya ; add file length to R6 clc adc A2L sta A2L bcc 15$ inc A2H 15$: svw #3,A2 ; and take 3 right back! 16$: cpw A2,A3 ; run out of space yet? bge 17$ ; yes, so get outa here jsr GetNxtDirEntry ; try for the next bra 12$ 17$: dec A5H lda A5H rts ************************* .psect ******************* .psect ect ect h8LLw 0`Linker .dbg V1.00P0 ;******************************* ;* i_File2List ;* ;* Inputs: ;* .word Location of dest buffer ;* .word End of dest buffer ;* .byte number of entries to skip ;* .byte number of entries total ;* ;* Outputs: ;* .a ? ;* .x errors, if any ;******************************* i_File2List: jsr APIinit jsr FileList ldy #6 ; 2 word ptrs + 2 bytes = 6 bytes jmp APIreturn w #3,A2 jsr Get1stDirEntry 12$: txa bne 10$ ; check for error (and eof?) tya bne 10$ ; end of directory 0P0 ;******************************* ;* CopyFnam ;* ;* Inputs: ;* A2 Pointer to filename ;* A3 Pointer to destination ;* ;* Outputs: ;* .a 0 ;* .x 0 ;******************************* CopyFnam: ldy #0 10$: lda (A2),y ; copy disk name over sta (A3),y beq 12$ ; a surprising null found in name? cmp #$a0 ; $a0 delimeter reached in name? beq 11$ iny cpy #16 ; name gone too long? bne 10$ 11$: lda #0 sta (A3),y 12$: tax rts rts nd eof?) tya bne 10$ ; end of directory p0P0 ;******************************* ;* i_CopyFnam ;* ;* Inputs: ;* .word Pointer to filename ;* .word Pointer to destination ;* ;* Outputs: ;* .a 0 ;* .x 0 ;******************************* i_CopyFnam: jsr APIinit jsr CopyFnam ldy #4 ; 2 word ptrs = 4 bytes jmp APIreturn vw0P0 ;******************************* ;* PrntList ;* ;* Inputs: ;* A2 Pointer to list ;* A3L Which to highlight ;* R2L Top of box to print in ;* R2H Bottom of box ;* R3 L0P0 ;******************************* ;* PrntList ;* ;* Inputs: ;* A2 Pointer to start of printable list ;* A3L Which relative item to highlight ;* R2L Top of box to print in ;* R2H Bottom of box ;* R3 Left side of box ;* R4 Right side of box ;* ;* Outputs: ;* .a 1=highlight, 0=not ;* .x number shown ;******************************* PrntList: jsr UseSystemFont ; save old margin first ldx #0 10$: lda windowTop,x ; save margins sta APITemp1,x inx cpx #6 bne 10$ mvw StringFaultVec,APITemp1+6 ldx #0 11$: lda R2L,x ; get new margins sta APITemp1+8,x sta windowTop,x inx cpx #6 bne 11$ ldw StringFaultVec,#0 mvw A2,R0 ; now prepare to print mvb windowTop,R1H ldb A3H,#1 ; init which is shown/#total ldb A4L,#0 ; init the highlight flag r PikList 17$: lda A4L ; get the highlight flag ldx A3H ; get the total shown rts o copy 14$: lda #0 ; put filename delimeter in sta (A2),y iny ; step out one byte for 0 sta (A2),y ; spare 0, just in case tya ; add fil0P0 ;******************************* ;* PrntList ;* ;* Continued ;******************************* 12$: mvw leftMargin,R11 avb #8,R1H cpb R1H,windowBottom bge 14$ ; too far down? ldy #0 lda (R0),y beq 14$ jsr PutString inc A3H ldy #$ff 13$: iny ; find end of string lda (R0),y bne 13$ iny lda (R0),y ; was this the terminating point? beq 14$ tya ; no, so set pointer for next clc adc R0L sta R0L bcc 12$ inc R0H bne 12$ 14$: ldx #0 15$: lda APITemp1,x ; restore margins sta windowTop,x inx cpx #6 bne 15$ mvw APITemp1+6,StringFaultVec ldx #0 16$: lda APITemp1+8,x ; restore R2L sta R2L,x inx cpx #6 bne 16$ lda A3L ; shall we highlight? beq 17$ cmp A3H ; so far, no bgt 17$ inc A4L ; set highlight flag mvb A3L,A2L jsr PikList 17$: lda A4L ; get the highlight flag ldx A3H ; get the total shown rts |0P0 ;******************************* ;* i_PrntList ;* ;* Inputs: ;* .word Pointer to list ;* .byte Which to hi0P0 ;******************************* ;* i_PrntList ;* ;* Inputs: ;* .word Pointer to start of printable list ;* .byte Which relative item to highlight ;* R2L Top of box to print in ;* R2H Bottom of box ;* R3 Left side of box ;* R4 Right side of box ;* ;* Outputs: ;* .a 1=highlight, 0=not ;* .x number shown ;******************************* i_PrntList: jsr APIinit jsr PrntList ldy #3 ; 1 word ptrs + 1 byte = 3 bytes jmp APIreturn r bne 11$ 12$: jsr FLSTincA ; new item, s0P0 ;******************************* ;* DownList ;* ;* Inputs: ;* A2 Pointer to start item ;* A3 Where to put result ptr ;* A4L How far down to point ;* ;* Outputs: ;* .a 0 ;* .x 0=found, 1=too far ;******************************* DownList: lda #$ff sta A5L ; init the which one pointer 10$: inc A5L cpb A5L,A4L beq 14$ ldy #0 ; start the search loop 11$: lda (A2),y beq 12$ ; end of this string jsr FLSTincA ; increment pointer bne 11$ 12$: jsr FLSTincA ; new item, so increment pointer 13$: lda (A2),y bne 10$ ; not end of list, so look at nxt ldx #1 rts 14$: ldy #0 ; start the search loop  lda A2L ; found. so update ptr, exit 0P0