[ 53280,0:53281,0:646,(162):"":" USE LYNX TO DISSOLVE THIS FILE":10 2 *LYNX XV BY WILL CORLEY 7 MAJREORG.LNK.CVT 5 S 56 S/MAJREORG.CVT 170 S 91 S/MAJREORG2.CVT 86 S 29 H/MAJREORG.CVT 8 S 70 REORGDESIGNS.CVT 8 S 173 REORGDESIGNS.CVT 5 S 237 MAJREORGDOCS.CVT 31 S 63 MajReOrg.lnk2PRG formatted GEOS file V1.0AWrite Image V2.0geoWrite V2.1  ...݅ ( >1 59 ..  9 < <` " . r " `(@1ʎsAڢ9 V&8P ;***************************** ;* ;*  The Major ReOrg ;* ;* (C) 2001 Bo Zimmerman ;* ;***************************** .output MajorReOrg .header H/MajReOrg.rel .seq .psect $0400 S/MajReOrg.rel APIcommon.rel MODferr.rel MODtbox.rel MODscrn.rel S/MajReOrg2.rel seen by executing the program. Please send any and all reports of praise or problems to bo@zimmers.net, or to the address shown on the registration screen. Only registered users will receive bug fS/MajReOrg2PRG formatted GEOS file V1.0ArWWrite Image V2.0Bo ZimmermangeoWrite V2.0  Here is some text to play with in the level of happiness one can expect from being able to do s3^DPEv`F"_4etSvzC'[![8P0 ;***************************** ;* ;*  The Major ReOrg ;* ;* (C) 2001 Bo Zimmerman ;* ;*****************************  .if Pass1 8P0.include GEOSequates .endif ProgStart: jsr ClrScrn jsr Fix80 ldb IsFolderOn,#0 jsr FolderOff ReStart: jsr OpenDisk ; reopen current disk ldx #A1L jsr GetPtrCurDkNm ldw A2,#DiskName ; now copy disk name ldy #0 10$: lda (A1),y beq 11$ cmp #$a0 beq 11$ sta (A2),y iny cpy #16 bne 10$ 11$: ldw SysDir,#0 lda #0 sta (A2),y jsr DlgBox ; the opening box cbi sysDBData,#$06 ; disk icon bne 12$ jsr FBOXchgd bra 98$ 12$: cmp #$02 ; error icon bne 13$ jmp ByeByeNow 13$: cmp #$01 bne 14$ jmp Begin ; start the application 14$: 98$: jmp ReStart ByeByeNow: jsr FolderOff jmp EnterDeskTop l as MP3 and gateWay.  @STARTING OFF  MajReOrg is executed by double-clicking on its icon from the deskTop. The initial dialog that is presented allows the user to select the drive, disk, and d8P0 FolderOn: lda IsFolderOn beq 10$ rts 10$: lda GMode beq 11$ jsr MouseOff 11$: ldb IsFolderOn,#1 ldb R3L,#2 ldw R4,#sFolder2 jsr DrawSprite ldb R3L,#2 jsr EnablSprite rts FolderOff: lda IsFolderOn bne 10$ rts 10$: ldb IsFolderOn,#0 ldb R3L,#2 jsr DisablSprite lda GMode beq 11$ jsr MouseUp 11$: rts SysDir,#0 lda #0 sta (A2),y jsr DlgBox ; the opening box cbi sysDBData,#$06 ; disk icon bne 12$ jsr FBOXchgd bra 98$ 12$: cmp #$02 ; error icon bne 13$ 8P0 Fix80: ldw GMode,#0 cwi rightMargin,#320 bgt 10$ rts 10$: ldb GMode+1,#$80 F802: ldx #0 11$: lda F80TAB2,x beq 99$ sta R0L inx lda F80TAB2,x sta R0H inx txa pha jsr Fix80p pla tax bne 11$ 99$: jmp F803 F80TAB2: .word CVT1,CVT2,CVT3,CVT4,CVT5,CVT6,CVT7,CVT8,INF1,INF2,INF3,0 ,CVT8,INF1,INF2,INF3,0 3,0 3,0 0 sta (A2),y jsr DlgBox ; the opening box cbi sysDBData,#$06 ; disk icon bne 12$ jsr FBOXchgd bra 98$ 12$: cmp #$02 ; error icon bne 13$ 8P0 F803: ldx #0 10$: lda F80TAB,x beq 99$ sta R0L inx lda F80TAB,x sta R0H inx ldy #0 lda (R0),y ora #$80 sta (R0),y ldy #2 lda (R0),y ora #$80 sta (R0),y bra 10$ 99$: lda CVP1 ora #$80 sta CVP1  rts 8P0F80TAB: .word CVB1,CVB2,CVB3,IGX1,IGX2,IGX3,IGX4,0 ts 2 ora #$80 sta CVB2 lda CVB2+2 ora #$80 sta CVB2+2 lda CVB3 ora #$80 sta CVB3 lda CVB3+2 ora #$80 sta CVB3+2 lda IGX1 ora #$80 sta IGX1 lda IGX1+2 ora #$88P0 Fix80p: ldy #0 lda (R0),y ; a null ends the fun beq 99$ tax lda FIX80x,x ; cross ref to x offset beq 10$ ; if EQ, skip to next step tay lda (R0),y ; otherwise, get x byte clc adc #$80 ; add #$80 sta (R0),y 10$: lda FIX80len,x ; now get next cmd offset beq 99$ ; eq means no more clc adc R0L sta R0L lda #$00 adc R0H sta R0H jmp Fix80p 99$: rts FIX80len: .byte 0,4,4,4,1,2,0,4,3,2,4 FIX80x: .byte 0,2,2,2,0,0,2,2,2,0,2 ull ends the fun beq 99$ tax lda FIX808P0 OpenPres: lda mouseData beq 10$ rts ; click or release, I dont recall 10$: ldb R2L,#$4e ldb R2H,#$58 ldw R3,#$53 ldw R4,#$5f  jsr Fix80R3R4  jsr IsMseInRegion 8P0 cmp #$ff beq 11$ rts 11$: jsr InvertRectangle lda SysDir eor #$01 sta SysDir rts clc adc R0L sta R0L lda #$00 adc R0H sta R0H jmp Fix80p 99$: rts FIX80len: .byte 0,4,4,4,1,2,0,4,3,2,4 FIX80x: .byte 0,2,2,2,0,0,2,2,2,0,2 98$ 12$: cmp #$02 ; error icon bne 13$ 8P0 Begin: ldw R1,#DirChain ldw R0,#512 jsr ClearRam ; clear dir chain ldw SrcDCPtr,#DirChain ldw R1,#DestBlks ldw R0,#512 jsr ClearRam ; clear first dest blocks jsr OpenDisk cpx #0 beq 10$ jsr FError jmp ByeByeNow 10$: lda SysDir ; was SysDir selected? beq 11$ ldy #171 ; yes, so look for one lda $8200,y sta SysDir ; and copy it in place iny lda $8200,y sta SysDir+1 11$: mvw SysDir,R1 ; assume a SysDir lda SysDir ; *IS* there a sys dir? bne 12$ mvw $8200,R1 ; then move frst block ptr 12$: ldw R3,#DirChain ; and get all file blocks please jsr FollowChain ; thank you. cpx #0 beq 13$ jsr FError jmp ByeByeNow 13$: ldw DstBPtrT,#DestBlks ; initialiZe dest list ldw DstBPtrB,#DestBlks+2 jsr DrwScn lda #1 jsr UpdateS ; initialiZe source filenames jsr UpdateD ; and dest filenames ldw OtherPressVec,#DoPress rts therPressVec,#DoPress rts rts rts btT00: .byte $1a,$18,"The Major ReOrg v2.0",27,0 AbtT01: .byte "This program is SHAREWARE. Distribu8P0 DoPress: lda mouseData beq 10$ lda SelWin ; release only sig for drags beq 20$ jmp PresChkF ; this is a RELEASE 10$: ldb R2L,#$05 ; check close box ldb R2H,#$0d ldw R3,#$0124 ldw R4,#$0139  jsr Fix80R3R4  jsr IsMseInRegion ; close box pressed? 8P0 cmp #$ff bne 11$ jmp DoClose 11$: jsr PresChkF jsr PresChkA jsr PresChkM jsr PresM2 20$: rts : mvw SysDir,R1 ; assume a SysDir lda SysDir ; *IS* there a sys dir? bne 12$ mvw $82008P0 PresChkA: ldb R2L,#$1b ; start the src up arrows ldb R2H,#$1b avb #33,R2H ldw R3,#$14 ldw R4,#$1f  jsr Fix80R3R4  cwi SrcDCPtr,#DirChain ; already up? 8P0 ble 10$ jsr IsMseInRegion cmp #$ff ; in source top arrow? bne 10$ ldw SrcDCPtr,#DirChain ; good, so move up jmp PresSBut ; yes, so show it 10$: mvb R2H,R2L avb #35,R2H cwi SrcDCPtr,#DirChain ; already up? ble 11$ jsr IsMseInRegion ; in source up arrow? cmp #$ff bne 11$ svw #4,SrcDCPtr cwi SrcDCPtr,#DirChain bge 90$ ldw SrcDCPtr,#DirChain 90$: jmp PresSBut ; yes, so show it 11$: PresCkA2: mvw SrcDCPtr,A0 ; start the downsters ldy #2 lda (A0),y ; is there even a 2nd half pg? bne 99$ ; if no, then skip jmp PresCkA3 ; pretty drastic skip 99$: mvb R2H,R2L avb #34,R2H jsr IsMseInRegion ; in source down arrow? cmp #$ff bne 12$ ldy #4 lda (A0),y ; is there a NEXT page? beq 12$ ; if no, then skip avw #4,SrcDCPtr jmp PresSBut ; yes, so show it 12$: mvb R2H,R2L avb #36,R2H jsr IsMseInRegion ; in source bottom arrow? cmp #$ff bne 13$ 98$: avw #2,A0 ; move to next page ldy #0 ; does this exist? lda (A0),y bne 98$ svw #4,A0 ; so this must be bottom mvw A0,SrcDCPtr jmp PresSBut ; yes, so show it 13$: jmp PresCkA3 PresSBut: jsr InvertRectangle jsr SaveStuff lda #1 jsr UpdateS ; so show the bottom jsr LoadStuff jmp InvertRectangle write jsr PutBlock ; AND WRITE IT, YEAH!!! cpx #0 ; check for an error bne 15$ 14$: cpw A3,DstBPtrB ; was this the last blo8P0 PresCkA3: ldb R2L,#$1b ldb R2H,#$1b avb #33,R2H ldw R3,#$0124 ldw R4,#$012f  jsr Fix80R3R4  cwi DstBPtrT,#DestBlks ; already at the top? 8P0 ble 14$ ; if yes, then ignore jsr IsMseInRegion cmp #$ff ; in dest top arrow? bne 14$ ldw DstBPtrT,#DestBlks jmp PresDBut 14$: mvb R2H,R2L avb #35,R2H cwi DstBPtrT,#DestBlks ; already at the top? ble 15$ ; if yes, then ignore jsr IsMseInRegion ; in dest up arrow? cmp #$ff bne 15$ svw #512,DstBPtrT cwi DstBPtrT,#DestBlks bge 90$ ldw DstBPtrT,#DestBlks 90$: jmp PresDBut 15$: PresCkA4: mvb R2H,R2L ; prepare for next button avb #34,R2H mvw DstBPtrT,Temp2 ; now look ahead avw #512,Temp2 ; two pages cpw Temp2,DstBPtrB ; is that beyond the end? bge 16$ ; if yes, don't check to see if jsr IsMseInRegion ; in dest down arrow? cmp #$ff bne 16$ mvw Temp2,DstBPtrT jmp PresDBut 16$: mvb R2H,R2L ; prepare for last button avb #36,R2H cpw Temp2,DstBPtrB ; are we beyond the end? bge 18$ jsr IsMseInRegion ; in dest bottom arrow? cmp #$ff bne 18$ 17$: avw #256,Temp2 ; prepare to cpw Temp2,DstBPtrB ; loop to the end blt 17$ mvw Temp2,DstBPtrT svw #512,DstBPtrT ; and move back for full view jmp PresDBut 18$: rts PresDBut: jsr InvertRectangle jsr SaveStuff jsr UpdateD ; so show the bottom jsr LoadStuff jmp InvertRectangle r LoadStuff jmp InvertRectangle write jsr PutBlock ; AND WRITE IT, YEAH!!! cpx #0 ; check for an error bne 15$ 14$: cpw A3,DstBPtrB ; was this the last blo8P0 PresChkM: ldb R2L,#$35 ; start the dst up arrows sta R2H avb #11,R2H ldw R3,#$9c ldw R4,#$a8  jsr Fix80R3R4  jsr IsMseInRegion 8P0 cmp #$ff ; move to dest arrow bne 10$ jsr InvertRectangle jsr SaveStuff jsr DoMoveR jsr LoadStuff jmp InvertRectangle 10$: avb #14,R2L mvb R2L,R2H avb #11,R2H jsr IsMseInRegion ; erase from dest arrow cmp #$ff bne 11$ jsr InvertRectangle jsr SaveStuff jsr DoMoveL jsr LoadStuff jmp InvertRectangle 11$: avb #13,R2L mvb R2L,R2H avb #26,R2H jsr IsMseInRegion ; add blank arrow cmp #$ff bne 12$ jsr InvertRectangle jsr SaveStuff jsr DoInsBlank jsr LoadStuff jmp InvertRectangle 12$: rts SaveStuff: mvw R2,Temp2 mvw R3,Temp2+2 mvw R4,Temp2+4 rts LoadStuff: mvw Temp2,R2 mvw Temp2+2,R3 mvw Temp2+4,R4 rts ; in dest down arrow? cmp #$ff bne 16$ mvw Temp2,DstBPtrT jmp PresDBut 16$: mvb R2H,R2L ; prepare for last button avb #36,R2H cpw Temp2,DstBPtrB ; are we beyond the end? bge 18$ 8P0 PresM2: ldb R2L,#$6c ; start the dst up arrows sta R2H avb #11,R2H ldw R3,#$9c ldw R4,#$a8 jsr Fix80R3R4 jsr IsMseInRegion cmp #$ff ; move to dest arrow bne 13$ jsr InvertRectangle jsr SaveStuff jsr i_YNBox .word FlushRtxt0 jsr LoadStuff jsr InvertRectangle cbi sysDBData,#$03 bne 11$ jsr MoveRestR 11$: rts 13$: avb #14,R2L mvb R2L,R2H avb #11,R2H jsr IsMseInRegion ; erase from dest arrow cmp #$ff bne 20$ jsr InvertRectangle jsr SaveStuff jsr i_YNBox .word FlushLtxt0 cbi sysDBData,#$03 bne 15$ ldw R1,#DstSels ldw R0,#10240+16 jsr ClearRam ; clear dest blocks  ldw DstBPtrT,#DestBlks ; initialiZe dest list ldw DstBPtrB,#DestBlks+2  jsr UpdateD 8P0 jsr UpdateS 15$: jsr LoadStuff jmp InvertRectangle 20$: rts FlushLtxt0: .byte $18,"Flush and start over?",27,0 FlushRtxt0: .byte $18,"Move remaining source files?",27,0 ,R2L ; prepare for last button avb #36,R2H cpw Temp2,DstBPtrB ; are we beyond the end? bge 18$ 8P0 PresChkF: lda mouseData beq 11$ jsr DonePress ; this is a RELEASE 10$: rts 11$: ldb SelWin,#0 ; initialize where we started jsr InWhichBox ; now look where we are? bne 20$ 99$: rts ; not in a box? bye bye 20$: sta SelWin ; set up for drag ldb BoxFnd,#$ff jsr ChkFiles ; find which file we're in bne 21$ ; 0 = nada!? lda #$ff 21$: sta SelLst ; to initialize LAST file sei ; now set the vector ldw appMain,#SelMove cli ; and exit rts DonePress: sei ; first, undo the move vector ldw appMain,#0 cli jsr FolderOff jsr InWhichBox ; which window are we in? cmp SelWin ; same as we started? bne 20$ ; if not, special case lda SelLst cmp #$ff ; now selecting. Is good? beq 12$ sta BoxFnd ; yes, so get pointer jsr ChkFiles ; from ChkFiles beq 12$ ; 0 = outside file limits cmp #$ff beq 12$ ; is it still good? cmp SelLst ; start checking double click bne 11$ ; DblClk must be the same file cbi SelWin,#1 ; must be source window too bne 11$ lda dblClickCount beq 11$ ; DblClick must be fast enough jsr Information ; qualified, so info box!! bra 12$ 11$: ldb DblClickCount,#20 ; reset double click jsr Invertify ; invertify 12$: ldb SelWin,#0 ; and clear drag mode rts 20$: cmp #0 ; in ANY window? beq 12$ ; nah, so ferget it cmp #1 ; now in source window? bne 21$ jsr SaveStuff jsr DoMoveL ; yes, so move left jsr LoadStuff bra 22$ 21$: jsr SaveStuff jsr DoMoveR ; and yes, so move right jsr LoadStuff 22$: ldb SelWin,#0 rts rts 8P0 InWhichBox: ldb R2L,#$1b ; check filenames routine ldb R2H,#$a5 ldw R3,#$2c ldw R4,#$95 jsr Fix80R3R4 jsr IsMseInRegion cmp #$ff ; in the source box? bne 15$ lda #1 rts 15$: ldb R2L,#$1b ldb R2H,#$a5 ldw R3,#$ac ldw R4,#$0115 jsr Fix80R3R4 jsr IsMseInRegion cmp #$ff ; in the dest box? bne 20$ lda #2 rts 20$: lda #0 ; nada rts Fix80R3R4: adw GMode,R3 adw GMode,R4 rts  Fix80A3A4: adw GMode,A3 adw GMode,A4 rts  DonePress: sei ; first, undo8P0 ChkFiles: cbi SelWin,#2 ; which box moving from? beq 10$ jsr ChkFSrc ; check the source files bra 11$ 10$: jsr ChkFDst ; check the dest files 11$: lda BoxIdx rts ChkFDst: ldw A1,#DstSels ; check for click in dest top8 ldb A2L,#$1c ldw A3,#$b6 ldw A4,#$010a jsr Fix80A3A4 jsr BoxPres8 beq 10$ rts 10$: lda BoxFnd ; in bot 8, so fix search code cmp #$ff beq 11$ ; bad search no need adjust sec sbc #$08 ; adjust index sta BoxFnd 11$: ldw A1,#DstSels+8 ; check for click in dest bot8 ldb A2L,#$60 jsr BoxPres8 beq 20$ cmp #$ff beq 20$ avb #8,BoxIdx ; fix index for bottom 8 20$: rts ChkFSrc: ldw A1,#SrcSels ldb A2L,#$1c ldw A3,#$36 ldw A4,#$8a  jsr Fix80A3A4  jsr BoxPres8 8P0 beq 10$ rts 10$: lda BoxFnd cmp #$ff beq 11$ sec sbc #$08 sta BoxFnd 11$: ldw A0,#SrcBlk2 ldw A1,#SrcSels+8 ldb A2L,#$60 jsr BoxPres8 beq 20$ cmp #$ff beq 20$ avb #8,BoxIdx 20$: rts 8,BoxIdx 20$: rts rts rts 0$ avb #8,BoxIdx 20$: rts rts8P0 BoxPres8: ldb BoxIdx,#1 ; 8 counter 10$: ldy #0 mvb A2L,R2L sta R2H avb #$08,R2H ; set top and bottom mvw A3,R3 mvw A4,R4 ; set left and right lda BoxFnd cmp BoxIdx beq 14$ ; special cheese checks cmp #$ff ; special cheese check bne 16$ jsr IsMseInRegion ; now see if mouse in there cmp #$ff bne 16$ ; not in box? then next... 14$: lda (A1),y cmp #$ff ; is it messed (empty?) beq 15$ lda BoxIdx ; something found, return rts 15$: ldb BoxIdx,#$ff rts 16$: inc BoxIdx avb #$08,A2L ; adjust the y coordinate cbi BoxIdx,#5 ; further adjustment needed bne 17$ avb #$02,A2L ; do the row adjustment 17$: cbi BoxIdx,#9 beq 18$ inw A1 ; increment selections list bra 10$ ; if not, continue 18$: lda #0 ; nothing found, return nada sta BoxIdx rts so invert 12$: ldb SelWin,#0 rts 20$: cmp #0 ; in ANY window? beq 12$ ; nah, so ferget it cmp #1 ; now in source window? bne 21$ jsr SaveStuff jsr DoMoveL ; yes, so move left jsr LoadStuff bra 22$ 21$: jsr SaveSt8P0 MoveRestR: cwi SrcDCPtr,#DirChain beq 10$ ldw SrcDCPtr,#DirChain ; good, so move up jsr PresSBut ; yes, so show it 10$: RMLp0: ldw A0,#SrcBlk1+2 ; start with first block ldb Temp3,#0 ; a counter RMLp1: ldy #0 lda (A0),y ; anything THERE? beq RMLp2 mvw A0,A2 jsr FSrcNDst ; is this file already there? beq RMLp2 ; if found, dont add it 10$: jsr AddA0UseA1 ; it is, so add it mvw Temp3+5,R1 ; Temp3+5 comes from jsr ldw R0,#256 ; initializing something jsr ClearRam ; initialize it please RMLp2: avw #32,A0 ; increment block pointer inc Temp3 ; increment index to srcsels cbi Temp3,#16 ; have we exceeded 2 pgs? bne 11$ ldy #4 lda SrcDCPtr,y ; is there a NEXT page? beq 15$ ; if no, then skip avw #4,SrcDCPtr jsr UpdateS jmp RMLp0 ; go down a page, and probably continue 15$: lda #0 ; *** could be much smarter jsr UpdateS ; yes so update (clr boxes?) jsr UpdateD ; and possibly add filenames? 10$: rts ; and exit 11$: cbi Temp3,#8 ; ready to flip to page 2? bne 12$ ; no, so continue ldw A0,#SrcBlk2 ; start with first block avw #2,A0 ; and increment to second one 12$: jmp RMLp1 ; and move on MLp1 ; and move on on on fy 12$: ldb SelWin,#0 ; and clear drag mode rts 20$: cmp #0 ; in ANY window? beq 12$ ;8P0 SelMove: jsr InWhichBox cmp SelWin ; are we even in the box? bne 20$ ; no, so skip to movement jsr FolderOff ldb BoxFnd,#$ff jsr ChkFiles sta TmpFDex beq 13$ ; if outside the limits, NO 10$: cmp SelLst ; same as last one? beq 13$ cbi SelLst,#$ff beq 12$ mvb SelLst,BoxFnd ; restore last clicked file jsr ChkFiles beq 13$ ; 0 = nada!? 11$: jsr Invertify ; if yes, invert it 12$: mvb TmpFDex,SelLst ; and make THIS the last 13$: rts ; if same as last, exit 20$: jsr FolderOn mvw mouseXPos,R4 svw #5,R4 mvb mouseYPos,R5L svb #3,R5L ldb R3L,#2 jsr PosSprite rts Invertify: dec R2H jsr InvertRectangle ; in box, so invert ldy #0 ; and now invert sel lda (A1),y eor #$01 sta (A1),y ; that outa do it rts rts 8P0 UpdateS: sta SrcLdF jsr ResetTNS ldy #0 ; fuZZy all selections 11$ lda #$ff ; fuZZy them all up first sta SrcSels,y iny cpy #16 ; to save empty block cases blt 11$ jsr i_GraphicsString CVT1: .byte $05,$00 .byte $01,$36,$00,$1c ; MOVEPENTO Xl,Xh,Y .byte $03,$8b,$00,$a4 ; FRAME_RECTO Xl,Xh,Y .byte $01,$33,$00,$5f .byte $02,$8b,$00,$5f .byte $00 esetTNS: mvw SrcDCPtr,A0 ldy #0 10$: lda (A0),y ; fetch dirchain pointers sta SrcTNS1,y iny cpy #4 ; both blocks 8P0 UpS2: lda SrcTNS1 ; if not a block, don't do beq 13$ lda SrcLdF beq 12$ ldw R1,#SrcBlk1 ldw R0,#256 ; clear dir block jsr ClearRam mvw SrcTNS1,R1 ldw R4,SrcBlk1 ; now get the first jsr GetBlock cpx #0 beq 12$ jsr FError jmp ByeByeNow 12$: ldb A0L,#$22 ; first filename Y position ldw A2,#SrcBlk1+2 ldw A3,#SrcBlk2 ldb Temp1+19,#0 ldw A5,SrcSels ldw A6,#$36 jsr UpDFNames 13$: lda SrcTNS2 ; if not a block, don't do beq 15$ lda SrcLdF beq 14$ ldw R1,#SrcBlk2 ldw R0,#256 ; clear dir block jsr ClearRam mvw SrcTNS2,R1 ldw R4,SrcBlk2 ; now get the second jsr GetBlock cpx #0 beq 14$ jsr FError jmp ByeByeNow 14$: avb #$03,A0L ; first filename Y position ldw A2,#SrcBlk2+2 ldw A3,#SrcBlk2+256 ldb Temp1+19,#0 ldw A5,SrcSels+8 ldw A6,#$36 jsr UpDFNames 15$: rts  ResetTNS: mvw SrcDCPtr,A0 ldy #0 10$: lda (A0),y ; fetch dirchain pointers sta SrcTNS1,y iny cpy #4 ; both blocks please blt 10$ rts ldb A2L,#$60 jsr BoxPres8 beq 20$ cmp #$8P0 UpDFNames: ldy #0 ; does file exist? lda #$ff ; mess selection, by default sta (A5),y ldy #1 lda (A2),y ; first check anything AT ALL? beq 12$ ; if not, stay fuZZy, and skip cwi A5,#SrcSels blt 90$ ; check for dest only if src cwi A5,#SrcSels+16 bgt 90$ ; defined by A5 parm ldy #0 lda (A2),y ; now check file type beq 12$ ; if null, skip jsr FSrcNDst ; if in src, check for dest beq 12$ 90$: ldy #0 tya ; clear selection, for draw sta (A5),y ldy #3 10$: lda (A2),y ; start copying filename beq 11$ cmp #$a0 beq 11$ sta Temp1-2,y iny cpy #19 ; 16+3=19 bne 10$ 11$: lda #0 ; finish copying filename sta Temp1-2,y ldb Temp1,#27 ; set styles off ldw R0,#Temp1 mvw A6,R11 ; set the filename column  adw GMode,R11  mvw A0L,R1H ; set the filename row 8P0 jsr PutString ; and display it, yeah! 12$: inc Temp1+19 avb #$08,A0L ; adjust the y coordinate cbi Temp1+19,#4 ; further adjustment needed bne 13$ avb #$02,A0L ; do the row adjustment 13$: avw #32,A2 cpw A2,A3 ; are we out of block files? bge 14$ inw A5 ; increment selections list jmp UpDFNames ; if not, continue 14$: rts ename Y position ldw A2,#SrcBlk2+2 ldw A3,#SrcBlk2+256 ldb Temp1+19,#0 ldw A5,SrcSels+8 ldw 8P0 FSrcNDst: ldw A4,#DestBlks+2 ; start looking 10$: cpw A4,DstBPtrB ; but are we done already? blt 11$ ; if yes, skip ldx #$ff ; return a NOT FOUND rts 11$: ldy #0 12$: lda (A4),y ; is there anything at all? cmp (A2),y bne 13$ iny cpy #$13 blt 12$ ldx #0 rts ; same, so return a "found" 13$: avw #32,A4 ; continue searching dest blk bra 10$ ing dest blk bra 10$ / del me later  ldy #1 8P0 lda (A2),y ; copy starting block s8P0 UpdateD: jsr i_GraphicsString  CVT2: .byte $05,$00 8P0 .byte $01,$b2,$00,$1c ; MOVEPENTO Xl,Xh,Y .byte $03,$0a,$01,$a4 ; FRAME_RECTO Xl,Xh,Y .byte $01,$af,$00,$5f .byte $02,$10,$01,$5f .byte $00 ldy #0 ; fuZZy all selections 10$ lda #$ff ; fuZZy them all up first sta DstSels,y iny cpy #16 ; to save empty block cases blt 10$ mvw DstBPtrT,A2 ; set first page pointers avw #2,A2 cpw A2,DstBPtrB ; is there anything to show? bge 11$ mvw DstBPtrT,A3 ; set end of this page avw #256,A3 ldb A0L,#$22 ; first filename Y position ldb Temp1+19,#0 ldw A5,DstSels ldw A6,#$b6 jsr UpDFNames 11$: mvw DstBPtrT,A2 ; set first page pointers avw #258,A2 cpw A2,DstBPtrB ; is there anything to show? bge 12$ mvw DstBPtrT,A3 ; set end of this page avw #512,A3 avb #$03,A0L ; first filename Y position ldb Temp1+19,#0 ldw A5,DstSels+8 ldw A6,#$b6 jsr UpDFNames 12$: rts ,A0L ; do the row adjustment 13$: avw #32,A2 cpw A2,A3 ; are we o8P0 DoMoveR: ldw A0,#SrcBlk1+2 ; start with first block ldb Temp3,#0 ; index into SrcSels ldb Temp3+1,#0 ; refresh dest flag mvw DstBPtrB,Temp3+7 ; save for updated chk later DMLp1: ldy Temp3 lda SrcSels,y ; was this one selected? cmp #$01 bne DMLp2 ; if yes, skip ahead jsr AddA0UseA1 mvw Temp3+5,R1 ; new block, so ldw R0,#256 jsr ClearRam ; initialize it please ldb Temp3+1,#$ff ; set dirty flag DMLp2: avw #32,A0 ; increment block pointer inc Temp3 ; increment index to srcsels cbi Temp3,#16 ; have we exceeded 2 pgs? bne 11$ lda Temp3+1 ; any dest changes? beq 10$ ; *** next two lines lda #0 ; *** could be much smarter jsr UpdateS ; yes so update (clr boxes?) mvw DstBPtrT,Temp3+5 ; determine if dest refresh ok avw #512,Temp3+5 ; by seeing if DstBPtrB inside cpw Temp3+7,Temp3+5 ; viewable block bge 10$ jsr UpdateD ; and possibly add filenames? 10$: rts ; and exit 11$: cbi Temp3,#8 ; ready to flip to page 2? bne 12$ ; no, so continue ldw A0,#SrcBlk2 ; start with first block avw #2,A0 ; and increment to second one 12$: jmp DMLp1 ; and move on $: jmp DMLp1 ; and move on on on ; if not, continue 14$: rts : jsr SaveStuff jsr DoMoveR ; and yes, so move right jsr LoadStuff 22$: ldb SelWin,#0 rts eStu8P0 DoMoveL: mvw DstBPtrB,A8 ; save for much much later mvw DstBPtrT,A7 ; and save this too mvw DstBPtrT,A0 ; start with first block avw #2,A0 ldb Temp3,#0 ; index into SrcSels & actual sta Temp3+1 ; refresh dest flag sta Temp3+2 ; actual counter sta Temp3+3 ; page counter DMLLp1: cbi Temp3,#16 bge 11$ ldy Temp3 lda DstSels,y ; was this one selected? cmp #$01 beq 12$ ; if yes, then initialiZe? 11$: cpw A0,DstBPtrB blt DMLLp2 jsr AddA0UseA1 jmp DMLLp2 12$: cpw A0,DstBPtrB bge DMLLp2 ldb Temp3+1,#$ff mvw A0,DstBPtrB DMLLp2: avw #32,A0 ; increment block pointer cpw A0,A8 ; have we exceeded all pgs? blt 12$ lda Temp3+1 ; any dest changes? beq 11$ mvw DstBPtrB,R1 mvw A8,R0 sbw R1,R0 jsr ClearRam lda #0 ; *** could be much smarter jsr UpdateS ; yes so update (clr boxes?) jsr UpdateD ; and possibly add filenames? 11$: rts ; and exit 12$: inc Temp3 ; increment index to srcsels inc Temp3+3 cbi Temp3+3,#8 ; ready to flip to page 2? bne 13$ ; no, so continue ldb Temp3+3,#0 avw #256,A7 ; increment old DstBPtrT mvw A7,A0 ; start with first block avw #2,A0 ; and giddi-up 13$: jmp DMLLp1 ; and ramble on on jmp DMLLp1 ; and ramble on on on jmp DMLLp1 ; and ramble on on on window? beq 12$ ;8P0 AddA0UseA1: mvw DstBPtrB,A1 ; set up to add new one ldy #0 10$: lda (A0),y sta (A1),y ; copy over new entry iny cpy #32 ; and be happy blt 10$ mvw DstBPtrT,Temp3+5 11$: inc Temp3+6 ; increment pager cpw DstBPtrB,Temp3+5 bge 11$ ; loop until have next page blk avw #32,DstBPtrB ; now increment dest cpw DstBPtrB,Temp3+5 ; did we move past barrier? blt 12$ mvw Temp3+5,DstBPtrB ; move in new spot avw #$02,DstBPtrB ; and set to correct offset 12$: rts #$02,DstBPtrB 8P0 DoInsBlank: ldw A0,#Blank jsr AddA0UseA1 jsr UpdateD rts Add8Blanks: mvw DstBPtrB,Temp2+6 ; save the end dest pointer ldb Temp2+3,#0 11$: ldw A0,#Blank ; add eight blanks for fun jsr AddA0UseA1 inc Temp2+3 cbi Temp2+3,#8 blt 11$ mvw Temp2+6,DstBPtrB ; restore the end dest ptr rts Blank: .byte $00,$ff,$ff .byte $a0,$a0,$a0,$a0,$a0,$a0,$a0,$a0 .byte $a0,$a0,$a0,$a0,$a0,$a0,$a0,$a0 .byte $00,$00,$00,$00,$00,$00,$00,$00 .byte $00,$00,$00,$00,$00 .byte $00,$00,8P0 DrwScn: lda #0 ; prepare to clear screen jsr SetPattern ldb R2L,#0 ldb R2H,#199 ldw R3,#0 mvw rightMargin,R4 jsr Rectangle ; clear the screen jsr $c1a8 ; i_GraphicsString CVT3: .byte $01,$2c,$00,$1b ; MOVEPENTO Xl,Xh,Y .byte $07,$95,$00,$a5 ; FRAME_RECTO Xl,Xh,Y .byte $01,$ac,$00,$1b ; MOVEPENTO Xl,Xh,Y .byte $07,$15,$01,$a5 ; FRAME_RECTO Xl,Xh,Y .byte $06,$b9,$00,$18,$18,"New Directory",27,0 jsr $c1a8 ; i_GraphicsString CVT4: .byte $06,$33,$00,$18,$18,"Existing Directory",27,0 jsr $c1a8 ; i_GraphicsString CVT5: .byte $01,$96,$00,$1d ; MOVEPENTO Xl,Xh,Y .byte $05,$01 ; NEWPATTERN .byte $03,$99,$00,$a6 ; RETANGLETO Xl,Xh,Y .byte $01,$16,$01,$1d ; MOVEPENTO Xl,Xh,Y .byte $03,$19,$01,$a8 ; RETANGLETO Xl8P0 CVT5: .byte $01,$96,$00,$1d ; MOVEPENTO Xl,Xh,Y .byte $05,$01 ; NEWPATTERN .byte $03,$99,$00,$a6 ; RETANGLETO Xl,Xh,Y .byte $01,$16,$01,$1d ; MOVEPENTO Xl,Xh,Y .byte $03,$19,$01,$a8 ; RETANGLETO Xl,Xh,Y .byte $01,$2f,$00,$a5 ; MOVEPENTO Xl,Xh,Y .byte $03,$99,$00,$a8 ; RETANGLETO Xl,Xh,Y .byte $01,$b0,$00,$a5 ; MOVEPENTO Xl,Xh,Y .byte $03,$19,$01,$a8 ; RETANGLETO Xl,Xh,Y .byte $01,$9c,$00,$35 ; MOVEPENTO Xl,Xh,Y .byte $07,$a8,$00,$40 ; FRAME_RECTO Xl,Xh,Y .byte $01,$9f,$00,$3a ; MOVEPENTO Xl,Xh,Y .byte $02,$a3,$00,$3a ; LINETO Xl,Xh,Y .byte $01,$a2,$00,$37 ; MOVEPENTO Xl,Xh,Y .byte $02,$a5,$00,$3a ; LINETO Xl,Xh,Y .byte $01,$a5,$00,$3a ; MOVEPENTO Xl,Xh,Y .byte $02,$a2,$00,$3d ; LINETO Xl,Xh,Y .byte $01,$9c,$00,$43 ; MOVEPENTO Xl,Xh,Y .byte $07,$a8,$00,$4e ; FRAME_RECTO Xl,Xh,Y .byte $01,$a0,$00,$48 ; MOVEPENTO Xl,Xh,Y .byte $02,$a4,$00,$48 ; LINETO Xl,Xh,Y .byte $01,$9e,$00,$48 ; MOVEPENTO Xl,Xh,Y .byte $02,$a1,$00,$45 ; LINETO Xl,Xh,Y .byte $01,$9e,$00,$48 ; MOVEPENTO Xl,Xh,Y .byte $02,$a1,$00,$4b ; LINETO Xl,Xh,Y .byte $01,$94,$00,$5f ; MOVEPENTO Xl,Xh,Y .byte $02,$2c,$00,$5f ; LINETO Xl,Xh,Y .byte $01,$2c,$00,$3c ; MOVEPENTO Xl,Xh,Y .byte $02,$33,$00,$3c ; LINETO Xl,Xh,Y .byte $01,$2d,$00,$81 ; MOVEPENTO Xl,Xh,Y .byte $02,$34,$00,$81 ; LINETO Xl,Xh,Y .byte $01,$8f,$00,$81 ; MOVEPENTO Xl,Xh,Y .byte $02,$95,$00,$81 ; LINETO Xl,Xh,Y .byte $01,$96,$00,$3c ; MOVEPENTO Xl,Xh,Y .byte $02,$8f,$00,$3c ; LINETO Xl,Xh,Y .byte $01,$ac,$00,$5f ; MOVEPENTO Xl,Xh,Y .byte $02,$15,$01,$5f ; LINETO Xl,Xh,Y .byte $01,$ad,$00,$3c ; MOVEPENTO Xl,Xh,Y .byte $02,$b3,$00,$3c ; LINETO Xl,Xh,Y .byte $01,$ac,$00,$81 ; MOVEPENTO Xl,Xh,Y .byte $02,$b3,$00,$81 ; LINETO Xl,Xh,Y .byte $01,$15,$01,$3c ; MOVEPENTO Xl,Xh,Y .byte $02,$10,$01,$3c ; LINETO Xl,Xh,Y .byte $01,$16,$01,$81 ; MOVEPENTO Xl,Xh,Y .byte $02,$10,$01,$81 ; LINETO Xl,Xh,Y .byte $01,$9c,$00,$50 ; MOVEPENTO Xl,Xh,Y .byte $07,$a8,$00,$6a ; FRAME_RECTO Xl,Xh,Y ;right .byte $01,$98P0 ;right .byte $01,$9c,$00,$6c ; MOVEPENTO Xl,Xh,Y .byte $07,$a8,$00,$77 ; FRAME_RECTO Xl,Xh,Y ;.byte $01,$9f,$00,$71 ; MOVEPENTO Xl,Xh,Y ;.byte $02,$a3,$00,$71 ; LINETO Xl,Xh,Y .byte $01,$a2,$00,$6e ; MOVEPENTO Xl,Xh,Y .byte $02,$a5,$00,$71 ; LINETO Xl,Xh,Y .byte $01,$a5,$00,$71 ; MOVEPENTO Xl,Xh,Y .byte $02,$a2,$00,$74 ; LINETO Xl,Xh,Y;;;**eoa .byte $01,$a4,$00,$6e ; MOVEPENTO Xl,Xh,Y .byte $02,$a7,$00,$71 ; LINETO Xl,Xh,Y .byte $01,$a7,$00,$71 ; MOVEPENTO Xl,Xh,Y .byte $02,$a4,$00,$74 ; LINETO Xl,Xh,Y;;;***eoa .byte $01,$a0,$00,$6e ; MOVEPENTO Xl,Xh,Y .byte $02,$a3,$00,$71 ; LINETO Xl,Xh,Y .byte $01,$a3,$00,$71 ; MOVEPENTO Xl,Xh,Y .byte $02,$a0,$00,$74 ; LINETO Xl,Xh,Y;;;***eoa ;left .byte $01,$9c,$00,$7a ; MOVEPENTO Xl,Xh,Y .byte $07,$a8,$00,$85 ; FRAME_RECTO Xl,Xh,Y ;.byte $01,$9f,$00,$7f ; MOVEPENTO Xl,Xh,Y ;.byte $02,$a3,$00,$7f ; LINETO Xl,Xh,Y .byte $01,$a0,$00,$7c ; MOVEPENTO Xl,Xh,Y .byte $02,$9d,$00,$7f ; LINETO Xl,Xh,Y .byte $01,$9d,$00,$7f ; MOVEPENTO Xl,Xh,Y .byte $02,$a0,$00,$82 ; LINETO Xl,Xh,Y .byte $01,$a2,$00,$7c ; MOVEPENTO Xl,Xh,Y .byte $02,$9f,$00,$7f ; LINETO Xl,Xh,Y .byte $01,$9f,$00,$7f ; MOVEPENTO Xl,Xh,Y .byte $02,$a2,$00,$82 ; LINETO Xl,Xh,Y .byte $01,$a4,$00,$7c ; MOVEPENTO Xl,Xh,Y .byte $02,$a1,$00,$7f ; LINETO Xl,Xh,Y .byte $01,$a1,$00,$7f ; MOVEPENTO Xl,Xh,Y .byte $02,$a4,$00,$82 ; LINETO Xl,Xh,Y .byte $06,$9e,$00,$58,$18,"X",27,0 Xl,Xh,Y .byte $ .byte $02,$8f,$00,$3c ; LINETO Xl,Xh,Y .byte $01,$ac,$08P0 jsr $c1a8 ; i_GraphicsString CVT6: .byte $01,$9f,$00,$5f ; MOVEPENTO Xl,Xh,Y .byte $02,$a4,$00,$5f ; LINETO Xl,Xh,Y .byte $01,$a2,$00,$5b ; MOVEPENTO Xl,Xh,Y .byte $02,$a6,$00,$5f ; LINETO Xl,Xh,Y .byte $01,$a6,$00,$5f ; MOVEPENTO Xl,Xh,Y .byte $02,$a2,$00,$63 ; LINETO Xl,Xh,Y .byte $00 ; end of table jsr $c1ab ; i_BitmapUp .word Bitmap00 CVB1: .byte $24,$18,$02,$90 ; col, row, width, height jsr $c1ab ; i_BitmapUp .word Bitmap00 CVB2: .byte $02,$18,$02,$90 ; col, row, width, height jsr $c1a8 ; i_GraphicsString CVT7: .byte $01,$04,$00,$03 ; MOVEPENTO Xl,Xh,Y .byte $07,$3a,$01,$c4 ; FRAME_RECTO Xl,Xh,Y .byte $01,$04,$00,$05 ; MOVEPENTO Xl,Xh,Y .byte $07,$3a,$01,$0f ; FRAME_RECTO Xl,Xh,Y .byte $01,$04,$00,$07 ; MOVEPENTO Xl,Xh,Y .byte $07,$3a,$01,$0d ; FRAME_RECTO Xl,Xh,Y .byte $01,$04,$00,$09 ; MOVEPENTO Xl,Xh,Y .byte $07,$3a,$01,$0b ; FRAME_RECTO Xl,Xh,Y .byte $01,$24,$01,$05 ; MOVEPENTO Xl,Xh,Y .byte $05,$00 ; NEWPATTERN .byte $03,$39,$01,$0d ; RETANGLETO Xl,Xh,Y .byte $01,$29,$01,$06 ; MOVEPENTO Xl,Xh,Y .byte $05,$01 ; NEWPATTERN .byte $03,$34,$01,$0c ; RETANGLETO Xl,Xh,Y .byte $01,$24,$01,$03 ; MOVEPENTO Xl,Xh,Y .byte $07,$3a,$01,$0f ; FRAME_RECTO Xl,Xh,Y .byte $06,$65,$00,$0c,$1a,$18,"The Major ReOrg 2.1",27,0 lda #[(ClkBoxes) sta $02 ; R0L lda #](ClkBoxes) sta $03 ; R0H jsr $c15a ; DoIcons - start click boxes rts ; exit from screen routine ClkBoxes: .byte $01,$00,$00,$00 ; # clkboxes, mouse Xl,Xh,Y .word Bitmap02 CVB3: .byte $11,$af,$06,$10 ; col, row, width, height .word DoDone ; routine to execute on done DoNada: rts Xl,Xh,Y .byte $02,$b3,$00,$3c ; LINETO Xl,Xh,Y .byte $01,$ac,$00,$81 ; MOVEPENTO Xl,Xh,Y .byte $02,$b3,$00,$81 ; LINETO Xl,Xh,Y .byte $01,$15,$01,$3c8P0 ;**************************************************** ;*  @DoDone - called when the Done button is hit. Ensures all source ;* files are copied to dest window. Adds some trailing blank entries ;* to the dest block, writes back dest blocks, and saves BAM. ;**************************************************** DoDone: jsr AllMoved ; are all src files in dest? beq 10$ ; if yes, skip ahead jsr i_CNCLBox ; if not, cancel .word MAJtxt2 rts 10$: jsr Add8Blanks ; now add 8 dest blanks 15$: jsr WrDnAlloc ; write dest & alloc new blks beq 16$ jsr FError jmp ByeByeNow 16$: ldy #0 ; check for stray src sectors lda (A1),y beq 17$ sta R6L ; by pulling from A1 list iny lda (A1),y ; both bytes sta R6H jsr FreeBlock ; then free the sector avw #2,A1 ; point to next bra 16$ ; and go back for more 17$: jsr PutDirHead ; now update BAM jsr OpenDisk ; and re-open the disk jsr i_OKBox .word MAJtxt0 jsr ClrScrn jsr AbtBox  jmp ByeByeNow  MAJtxt0: .byte $18,"Directory updated.",27,0 8P0MAJtxt1: .byte $18,"Save Changes?",27,0 MAJtxt2: .byte $18,"Please move all files first.",27,0 e all files first.",27,0 7,0 7,0 e all files first.",27,0 7,0 7,0 _RECTO Xl,Xh,Y .byte $06,$65,$00,$0c,$1a,$18P0 ;**************************************************** ;*  @WrDnAlloc - Traverses DestBlks to save directory entries back ;* onto disk, using sectors in DirChain. Will continue until DirChain is ;* exhausted, after which it will allocate its own sectors. ;* Uses A1-A5, and R1,R4 ;**************************************************** WrDnAlloc: ldw A1,#DirChain+2 ; points to NEXT TNS block ldw A2,#DestBlks ; init dest blocks traversal ldw A3,#DestBlks+254 ; pointers, here and ahead mvw DirChain,A4 ; snag the First TNS to write WrDN2: ldy #0 ; snag the TNS to write lda (A1),y ; and snag NEXT TNS block sta A5L ; and save it here for later iny lda (A1),y sta A5H ; now done with that cpw A3,DstBPtrB ; is this the last dest block? bge 12$ ; if span DstBPtrB, then yes lda A5L ; is there a NEXT-ALLOC block? bne 13$ ; if yes, then keep going mvw A4,R3 ; get ready to allocate jsr SetNextFree ; and allocate new block mvw R3,A5 ; and write NEXT TNS back bra 13$ ; now skip ahead to actual wr 12$: ldw A5,#$ff00 ; set last block pointers 13$: ldy #0 lda A5L ; now copy over NEXT chain sta (A2),y iny lda A5H ; into dest block buffer sta (A2),y jsr FindDirEntries mvw A2,R4 ; set pointer to buffer mvw A4,R1 ; restore this block to write jsr PutBlock ; AND WRITE IT, YEAH!!! cpx #0 ; check for an error bne 15$ 14$: cpw A3,DstBPtrB ; was this the last block? blt 16$ ; if spanned DstBPtrB, then yes ldx #0 ; return no worries 15$: rts 16$: avw #2,A1 ; increment sectors avw #256,A2 ; movw dest buffers along avw #256,A3 mvw A5,A4 ; move NEXT block into THIS jmp WrDN2 ; and go back for more k for more ore ore DN2 ; and go back for more ore ore ore ore ore ore ore DN2 ; and go back for more ore ore ,$01,$3c8P0 FindDirEntries: ldy #2 10$: lda (A2),y ; check this entru and #$0f ; filter the irrelevant cmp #$06 ; is it a sixer? beq 12$ ; if yes, skip ahead 99$: cpy #200 ; was this the last? blt 11$ rts 11$: tya add #32 tay bne 10$ 12$: tya pha iny lda (A2),y sta R1L iny lda (A2),y sta R1H ldw R4,#SrcBlk2 jsr GetBlock ldy #36 lda A4L sta SrcBlk2,y iny lda A4H sta SrcBlk2,y iny pla sta SrcBlk2,y pha ldw R4,#SrcBlk2 jsr PutBlock pla tay bne 99$ ointers,8P0 DoClose: jsr i_YNBox .word MAJtxt1 cbi sysDBData,#$03 beq 10$ jsr ClrScrn jsr AbtBox jmp ByeByeNow 10$: jmp DoDone Done ne 10$ jsr FError jmp ByeByeNow 10$: ldw A2,#SrcBlk1+2 11$: ldy #0 ; is this a real file? lda8P0 AllMoved: ldw A0,#DirChain AM1: ldy #0 lda (A0),y sta R1L iny lda (A0),y sta R1H ldw R4,#SrcBlk1 jsr GetBlock cpx #0 beq 10$ jsr FError  jmp ByeByeNow  10$: ldw A2,#SrcBlk1+2 8P011$: ldy #0 ; is this a real file? lda (A2),y ; check file type... beq 12$ ; if eq, then skip other chks jsr FSrcNDst ; if in src, check for dest beq 12$ ldx #$ff ; not found, so return error rts 12$: avw #32,A2 ; move to next file cwi A2,#SrcBlk1+254 ; see if done with this block blt 11$ ; if not, continue avw #2,A0 ; done w/ block, so set nxt ldy #0 lda (A0),y ; was that the last block? beq 13$ jmp AM1 ; no, so keep looking 13$: ldx #0 ; return an ALL-GOOD rts return an ALL-GOOD rts rts rt8P0 DlgBox: lda #[(DlgDat) sta $02 ; set lsb for dialog data lda #](DlgDat) sta $03 ; set msb for dialog data jmp $c256 ; call DoDlgBox and leave! DlgDat: .byte $81 ; size flag, and shadow pattern .byte $0b,$12,$13 ; static text .word DlgD00 .byte $0b,$12,$23 ; static text .word DlgD01 .byte $0c,$30,$23 ; static text .byte A2L .byte $01,$02,$48 ; OK button .byte $06,$09,$48 ; DISK button .byte $12,$10,$48 ; user clickbox .word DlgU00 .byte $0b,$24,$35 ; static text .word DlgD02 .byte $13 ; all external dialog gfx .word DlgGfx .byte $11 ; set otherPressVec .word OpenPres .byte $00 ; end of table DlgD00: .byte $1a,$18,"The Major ReOrg v2.1",27,0 DlgD01: .byte $18,"Disk:",27,0 DlgD02: .byte "Use System directory",27,0 DlgGfx: jsr $c1a8 ; i_GraphicsString CVT8: .byte $01,$53,$00,$4e ; MOVEPENTO Xl,Xh,Y .byte $07,$5f,$00,$58 ; FRAME_RECTO Xl,Xh,Y .byte $00 ; end of table rts DlgU00: .word Bitmap04 ; pointer to graphics data .word $ffff CVP1: .byte $06,$10 ; pic width and height .word FBOXswdv DlgR00: lda #$14 ; sysDBData code sta $851d jmp $c2bf ; RstrFrmDialogue XT chain sta (A2),y iny lda A5H ; into dest block buffer sta (A2),y jsr FindDirEntries mvw A2,R4 ; set pointer to buffer mvw A4,R1 ;8P0  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 FBOXtxt7: .byte $18,"Insert new disk.",27,0 drive.",27,0 FBOXswd2 rts e $01,$02,$48 ; OK button .byte $06,$09,$48 ; DISK button .byte $12,$10,$48 ; user clickbox .word DlgU00 .byte $0b,$24,$35 ; static t8P0 FBOXswdv: jsr FBOXswd2 cpx #$00 ;check for error! beq 21$ jsr FBOXswd2 ldb sysDBData,#$02 ;error detected, return abort! jmp RstrFrmDialog 21$: ldb sysDBData,#$14 jmp RstrFrmDialog ;no error, jump back FBOXswd2:  ldy curDrive iny cpy #12 bne 11$ ldy #8 11$: tya jsr SetDevice  jsr OpenDisk cpx #0 bne FBOXswd2 rts wd2 cpx #$00 ;check for error! beq 21$ jsr FBOXswd2 ldb sysDBData,#$02 ;error detected, return abort! jmp RstrFrmDialog 21$: ldb sys8P0 AbtBox: mvb GMode+1,AbtDat+4 mvb GMode+1,AbtDat+6 inc AbtDat+6 lda #[(AbtDat) sta $02 ; set lsb for dialog data lda #](AbtDat) sta $03 ; set msb for dialog data jmp $c256 ; call DoAbtBox and leave! AbtDat: .byte $01 ; size flag, and shadow pattern .byte $20,$b5,$40,$00,$1e,$01 ; dialog box dimensions .byte $0b,$06,$0b ; static text .word AbtT00 .byte $0b,$06,$17 ; static text .word AbtT01 .byte $0b,$06,$21 ; static text .word AbtT02 .byte $0b,$07,$2a ; static text .word AbtT03 .byte $0b,$07,$35 ; static text .word AbtT04 .byte $0b,$07,$47 ; static text .word AbtT05 .byte $0b,$07,$52 ; static text .word AbtT06 .byte $0b,$07,$5d ; static text .word AbtT07 .byte $01,$12,$7e ; OK button .byte $00 ; end of table AbtT00: .byte $1a,$18,"The Major ReOrg v2.1",27,0 AbtT01: .byte "This program is SHAREWARE. Distribute it",27,0 AbtT02: .byte "as you like. If you enjoy it, send your",27,0 AbtT03: .byte "registration fee of $10 USD to the",27,0 AbtT04: .byte "following address:",27,0 AbtT05: .byte "Bo Zimmerman",27,0 AbtT06: .byte "1907 Cameo Drive",27,0 AbtT07: .byte "Round Rock, TX 78664",27,0 A5H ; into dest block buffer sta (A2),y jsr FindDirEntries mvw A2,R4 ; set pointer to buffer mvw A4,R1 ;8P0  Bitmap00: @Bitmap02: ABitmap04: CBitmap05: B ; that's all folks! yte 128,16,0 ;3-5 .byte 128,31,255 ;6-8 .byte 128,0,1 ;9-11 .byte 128,0,1 ;12-14 .byte 128,0,1 ;15-17 .byte 128,0,1 ;18-20 .byt0P0 DEFHead: .byte $00,$ff .byte $03,$15,$bf sFolder: .byte 127,224,0 ; DEF SPRITE -- 0-2 .byte 128,16,0 ;3-5 .byte 128,31,255 ;6-8 .byte 128,0,1 ;9-11 .byte 128,0,1 ;12-14 .byte 128,0,1 ;15-17 .byte 128,0,1 ;18-20 .byte 128,0,1 ;21-23 .byte 128,0,1 ;24 .byte 128,0,1 ;27 .byte 128,0,1 ;30 .byte 128,0,1 ;33 .byte 128,0,1 ;36 .byte 255,255,255 ;39 .byte 0,0,0 ;42 .byte 0,0,0 ;45 .byte 0,0,0 ;48 .byte 0,0,0 ;51 .byte 0,0,0 ;54 .byte 0,0,0 ;57 .byte 0,0,0 ;60 .byte $82 ; SEQ .byte 0 ; NON-GEOS .byte 0 .word 0 .word $0000 .word $0000 .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,$00 .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,$00 .byte $00,$00,$00,$00,$00,$00,$00,$00 .byte $00,$00,$00,$00,$00,$00,$00,$00 .block 144-117 1 ; static text .word AbtT0a .byte $01,$12,$7e ; OK button .byte $00 ; end of table AbtT00: .byte $1a,$18,"The Major ReOrg v2.0",27,0 AbtT01: .byte "This program is SHAREWARE. Distribu0P0 sFolder2: .byte 127,224,0 ; DEF SPRITE -- 0-2 .byte 128,16,0 ;3-5 .byte 128,31,255 ;6-8 .byte 128,0,1 ;9-11 .byte 128,0,1 ;12-14 .byte 128,0,1 ;15-17 .byte 128,0,1 ;18-20 .byte 128,0,1 ;21-23 .byte 128,0,1 ;24 .byte 128,0,1 ;27 .byte 128,0,1 ;30 .byte 128,0,1 ;33 .byte 128,0,1 ;36 .byte 255,255,255 ;39 .byte 0,0,0 ;42 .byte 0,0,0 ;45 .byte 0,0,0 ;48 .byte 0,0,0 ;51 .byte 0,0,0 ;54 .byte 0,0,0 ;57 .byte 0,0,0 ;60 .byte 14 reloading IsFolderOn: .block 10P0 .ramsect GMode: .block 2 Temp1: .block 20 Temp2: .block 10 Temp3: .block 10 SysDir: .block 2 ; sys dir flag DiskName: .block 20 ; name of this disk DirChain: .block 512 ; tracks n secs of directory SrcDCPtr: .block 2 ; pointer into DirChain SrcTNS1: .block 2 ; work pointer to src blk 1 SrcTNS2: .block 2 ; work pointer to src blk 2 SrcBlk1: .block 256 SrcBlk2: .block 256 SrcSels: .block 16 ; two pages of selections SrcLdF: .block 1 ; flag for reloading IsFolderOn: .block 1 ; whether sprite is on. SelWin: .block 1 ; 0=Src, 1=Dst SelLst: .block 1 ; last selected BoxIdx: .block 1 ; counts BoxPres8 index BoxFnd: .block 1 ; which index BoxPres8 2 find TmpFDex: .block 1 ; temporary dragged index DstBPtrT: .block 2 ; destination block top pointer DstBPtrB: .block 2 ; destination block bot pointer DstSels: .block 16 ; two pages of selections DestBlks: .block 10240 ; the rest of memorynjoy it, send your",27,0 AbtT03: .byte "registration fee of $10 USD to the",27,0 AbtT04: .byAA A AAAAAAAAAAAAAAAAAA   AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA  AAAAAAAAAAAAAAAAAA A AA$>31x1f1f1f1f33f>fx ȟj`9 8@fUUUUUUUUUUUUUVPPUUUUUUUU쒪UsUٞٳٳ?03 S/MajReOrg22UPRG formatted GEOS file V1.0AWrite Image V2.0geoWrite V2.1  ...݅ ( >1 59 ..  9 < <` " . r " `(@1ʎsAڢ9 V& 2*cB;Hm>8P ;***************************** ;* ;*  The Major ReOrg ;* ;* (C) 2001 Bo Zimmerman ;* ;*****************************  .noeqin 8P .if Pass1 .include GEOSequates .endif .eqin lrS8P0 Information: ldw A3,#SrcBlk1 ; first find which block mvb SelLst,TmpFDex ; compare A3 to SrcBlk2 later dec TmpFDex ; and copy over work index cbi TmpFDex,#7 ble 10$ ; if in second page ldw A3,SrcBlk2 ; fix for second page svb #8,TmpFDex 10$: avw #2,A3 ; now get pointer ldx TmpFDex ; by looping in 32 chunks beq 12$ 11$: avw #32,A3 dex ; until we point to real entry bne 11$ 12$: jsr PrepHdr ; get Info Block bne 99$ ; BNE is an error 16$: ldy #3 ; copy over filename 17$: lda (A3),y beq 13$ cmp #$A0 ; stop at A0, of course beq 13$ sta EditFile-3,y iny bne 17$ 13$: lda #0 sta EditFile-3,y ; the final zero mvw A3,SaveFEnt jsr InfoBox lda sysDBData beq 99$ mvw SaveFEnt,A3 jmp Save 99$: rts Ent,A3 jmp8P0 PrepHdr: ldy #$13 ; is there an info sector? lda (A3),y bne 13$ ; EQ means no, so skip jmp PrepHdr2 13$: sta R1L iny lda (A3),y ; get rest of info T&S sta R1H ldw R4,#InfoBlock jsr GetBlock ; now we got it! cpx #0 beq 10$ rts ; exit with error!! 10$: lda InfoBlock+$45 ; is geos type? ldy #0 ; now copy over class 11$: lda InfoBlock+$4d,y sta EditClass,y iny cpy #12 ; 0-11 are the class blt 11$ ldb EditClass+12,#0 ; and put the end 12$: lda InfoBlock+$4d,y ; now copy over version sta EditVer-12,y iny cpy #16 ; 12-16 are the ver blt 12$ ldb EditVer+4,#0 ; and put the end er..done? sta InfoBlock+$4d,y mvw InfoBlock+$47,R0L ldw A2,#EditLoad jsr HexW mvw InfoBlock+$49,R0L ldw A2,#EditEnd jsr HexW mvw InfoBlock+$4b,R0L ldw A2,#EditExe jsr HexW ldx #0 rts PrepHdr2: ldy #0 ; remember YOUR T&S!! 16$: lda DEFHEAD,y ; for later! sta InfoBlock,y iny bne 16$ ldb EditVer,#0 ; init irrelevant ldb EditClass,#0 ldb EditLoad,#0 ldb EditExe,#0 ldb EditEnd,#0 ldy #$00 ; copy over relavent data lda (A3),y sta InfoBlock+$44 ; this is the DOS type ldy #$15 lda (A3),y sta InfoBlock+$46 ; this is the STRUCT type ldy #$16 lda (A3),y sta OldGeoType sta InfoBlock+$45 ; this is the GEOS type 17$: ldx #$00 rts OS type 17$: ldx #$00 rts rts  `HH 8hh,0`HHHHH hh tŠH h8LLw 0`Linker .dbg V1.08P0 InfoBox: mvb GMode+1,InfoDat+4 mvb GMode+1,InfoDat+6 inc InfoDat+6 lda #[(InfoDat) sta $02 ; set lsb for dialog data lda #](InfoDat) sta $03 ; set msb for dialog data jmp $c256 ; call DoDlgBox and leave! InfoDat: .byte $01 ; size flag, and shadow pattern .byte $11,$bd,$33,$00,$21,$01 ; dialog box dimensions .byte $0b,$07,$17 ; static text .word DlgT00 .byte $0b,$07,$25 ; static text .word DlgT01 .byte $0b,$07,$33 ; static text .word DlgT02 .byte $0b,$07,$41 ; static text .word DlgT03 .byte $0b,$07,$4e ; static text .word DlgT04 .byte $0b,$90,$4e ; static text .word DlgT05 .byte $0b,$50,$4e ; static text .word DlgT06 .byte $0b,$07,$5d ; static text .word DlgT07 .byte $0b,$07,$6b ; static text .word DlgT08 .byte $0b,$69,$6b ; static text .word DlgT09 .byte $0b,$07,$79 ; static text .word DlgT0a .byte $0b,$07,$87 ; static text .word DlgT0b .byte $0b,$07,$94 ; static text .word DlgT0c .byte $0b,$ba,$28 ; static text .word DlgT0d .byte $0b,$b6,$3a ; static text .word DlgT0e .byte $0b,$07,$0a ; static text .word DlgT0f .byte $11 .word InfoVec .byte $13 ; all external dialog gfx .word InfoGfx .byte $00 ; end of table DlgT00: .byte "File Name:",27,0 DlgT01: .byte "Dos File Type:",27,0 DlgT02: .byte "GEOS File Type:",27,0 DlgT03: .byte "File Structure:",27,0 DlgT04: .byte "Load$",27,0 DlgT05: .byte "Run$",27,0 DlgT06: .byte "End$",27,0 DlgT07: .byte "Class:",27,0 DlgT08: .byte "Version:",27,0 DlgT09: .byte "Display:",27,0 DlgT0a: .byte "Author:",27,0 DlgT0b: .byte "Data App:",27,0 DlgT0c: .byte "Comments:",27,0 DlgT0d: .byte $18,"SAVE",27,0 DlgT0e: .byte $18,"CANCEL",27,0 DlgT0f: .byte $18,"File Information",27,0 RAME_RECTO Xl,Xh,Y .byte $01,$e8,$00,$42 ; MOVEPENTO Xl,Xh,Y .byte8P0 InfoGfx: jsr $c1a8 ; i_GraphicsString INF1: .byte $01,$7f,$00,$2d ; MOVEPENTO Xl,Xh,Y .byte $07,$ce,$00,$37 ; FRAME_RECTO Xl,Xh,Y .byte $01,$6b,$00,$1f ; MOVEPENTO Xl,Xh,Y .byte $07,$f4,$00,$29 ; FRAME_RECTO Xl,Xh,Y .byte $01,$7f,$00,$3b ; MOVEPENTO Xl,Xh,Y .byte $07,$ce,$00,$45 ; FRAME_RECTO Xl,Xh,Y .byte $00 ; end of table jsr $c1ab ; i_BitmapUp .word Bitmap05 IGX1: .byte $18,$2c,$02,$10 ; col, row, width, height jsr $c1ab ; i_BitmapUp .word Bitmap05 IGX2: .byte $18,$3a,$02,$10 ; col, row, width, height jsr $c1ab ; i_BitmapUp .word Bitmap05 IGX3: .byte $18,$48,$02,$10 ; col, row, width, height jsr $c1a8 ; i_GraphicsString INF2: .byte $01,$7f,$00,$49 ; MOVEPENTO Xl,Xh,Y .byte $07,$cc,$00,$53 ; FRAME_RECTO Xl,Xh,Y .byte $01,$55,$00,$57 ; MOVEPENTO Xl,Xh,Y .byte $07,$7a,$00,$61 ; FRAME_RECTO Xl,Xh,Y .byte $01,$9a,$00,$57 ; MOVEPENTO Xl,Xh,Y .byte $07,$bf,$00,$61 ; FRAME_RECTO Xl,Xh,Y .byte $01,$d9,$00,$57 ; MOVEPENTO Xl,Xh,Y .byte $07,$fe,$00,$61 ; FRAME_RECTO Xl,Xh,Y .byte $01,$6b,$00,$65 ; MOVEPENTO Xl,Xh,Y .byte $07,$f4,$00,$6f ; FRAME_RECTO Xl,Xh,Y .byte $01,$6b,$00,$73 ; MOVEPENTO Xl,Xh,Y .byte $07,$91,$00,$7d ; FRAME_RECTO Xl,Xh,Y .byte $00 ; end of table jsr $c1ab ; i_BitmapUp .word Bitmap05 IGX4: .byte $1d,$72,$02,$10 ; col, row, width, height jsr $c1a8 ; i_GraphicsString INF3: .byte $01,$bd,$00,$73 ; MOVEPENTO Xl,Xh,Y .byte $07,$f4,$00,$7d ; FRAME_RECTO Xl,Xh,Y .byte $01,$6b,$00,$81 ; MOVEPENTO Xl,Xh,Y .byte $07,$f4,$00,$8b ; FRAME_RECTO Xl,Xh,Y .byte $01,$6b,$00,$8f ; MOVEPENTO Xl,Xh,Y .byte $07,$f4,$00,$99 ; FRAME_RECTO Xl,Xh,Y .byte $01,$6b,$00,$9d ; MOVEPENTO Xl,Xh,Y .byte $07,$1e,$01,$bb ; FRAME_RECTO Xl,Xh,Y .byte $01,$e8,$00,$42 ; MOVEPENTO Xl,Xh,Y .byte $07,$0e,$01,$4e ; FRAME_RECTO Xl,Xh,Y .byte $01,$e8,$00,$30 ; MOVEPENTO Xl,Xh,Y .byte $07,$0e,$01,$3c ; FRAME_RECTO Xl,Xh,Y .byte $01,$ea,$00,$3c ; MOVEPENTO Xl,Xh,Y .byte $05,$01 ; NEWPATTERN .byte $03,$10,$01,$3e ; RETANGLETO Xl,Xh,Y .byte $01,$0e,$01,$32 ; MOVEPENTO Xl,Xh,Y .byte $03,$10,$01,$3d ; RETANGLETO Xl,Xh,Y .byte $01,$ea,$00,$4f ; MOVEPENTO Xl,Xh,Y .byte $03,$10,$01,$50 ; RETANGLETO Xl,Xh,Y .byte $01,$0e,$01,$44 ; MOVEPENTO Xl,Xh,Y .byte $03,$10,$01,$50 ; RETANGLETO Xl,Xh,Y .byte $00 ; end of table jsr InitFields rts Up ; .word Bitmap02 ; .byte $21,$14,$03,$18 ; col, row, width, height jsr InitFields rts ` p`  Linker .obj V1.08P0 InitFields: ldw A2,#EditFile ldb A3H,#16 ldb R2L,#$17 jsr PutFStd2 ldw R0,#EditClass ldb R1H,#$5d jsr PutFStd ldw R0,#EditVer ldb R1H,#$6b jsr PutFStd ldw R0,#InfoBlock+$61 ldb R1H,#$79 jsr PutFStd ldw R0,#InfoBlock+$75 ldb R1H,#$87 jsr PutFStd ldw R0,#EditLoad ldb R1H,#$4f ldw R11,#$fff1 jsr PutField ldw R0,#EditEnd ldb R1H,#$4f ldw R11,#$0036 jsr PutField ldw R0,#EditExe ldb R1H,#$4f ldw R11,#$0075 jsr PutField jmp InitFie2 f ldw R118P0 InitFie2: jsr ComBox  jsr  R3R4X2GM  jsr i_PrintTBox 8P0 .word InfoBlock + $a0 .byte 2 .byte 90 ldb R1L,#$00 avb #$0f,R1H avw #$32,R11 adw InfoDat+3,R11 svb #$06,R1H jsr Wheelify jsr EFName rts ComBox: ldw R3,#$006b+$02 ldw R4,#$011e-$05 ldb R2L,#$9d+$08 ldb R2H,#$bb rts R3R4X2GM: lda GMode+1 bne 10$ rts 10$: asl R3L rol R3H asl R4L rol R4H rts rol R4H rts sr PutField ldw R0,#EditExe ldb R1H,#$4f ldw R118P0 PutFStd: ldw R11,#$07 PutField: avb #$0f,R1H avw #$32,R11 adw InfoDat+3,R11 jsr SVALL ldw StringFaultVec,#STRF1 jsr PutString jsr RDALL rts GetFStd: ldw R11,#$07 GetField: ldw keyVector,#NADA ldb R1L,#$00 avb #$0f,R1H avw #$32,R11 adw InfoDat+3,R11 svb #$06,R1H jsr SVALL ldw StringFaultVec,#STRF1 jsr GetString rts NADA: rts jmp RDALL SVALL: mvw leftMargin,SVLEFT mvw rightMargin,SVRIGHT mvw StringFaultVec,SVFAULT ldw rightMargin,#$011e adw GMode,rightMargin mvw R11,leftMargin mvb R1H,OLDY rts RDALL: mvw SVRIGHT,rightMargin mvw SVLEFT,leftMargin mvw SVFAULT,StringFaultVec rts SVRIGHT: .block 2 SVFAULT: .block 2 SVLEFT: .block 2 OLDY: .block 1 STRF1: mvw leftMargin,R11 avb #$0a,R1H jmp PutString Xh,Y .byte $01,$55,$00,$57 ; MOVEPENTO Xl,Xh,Y .byte $07,$7a,$00,$61 ; FRAME_RECTO Xl,Xh,Y .byte $01,$9a,$00,$57 ; MOVEPENTO Xl,Xh,Y .byte $07,$bf,$00,$61 ; FRAME_RECTO Xl,Xh,Y .byte $01,$d9,$00,$57 ; MOVEPENTO Xl,Xh,Y .byte $07,$fe,$00,$618P0 PutFStd2: ldw R3,#$07 ldb A3L,#0 PutFeld2: avb #$0f,R2L avw #$32,R3 adw InfoDat+3,R3 mvw R3,R4 avw #100,R4 mvb R2L,R2H jsr R3R4X2GM jsr PrintTBox rts GetFStd2: ldw R3,#$07 ldb A3L,#0 GetFeld2: avb #$0f,R2L avw #$32,R3 adw InfoDat+3,R3 mvw R3,R4 avw #100,R4 mvb R2L,R2H jsr R3R4X2GM jsr OpenTBox rts FakeCR: lda #$0d sta keyData lda keyVector+1 beq 10$ jmp (keyVector) 10$: rts ldw R0,#GEOTAB jsr TABME ldw R11,#$1b ldb R1H,#$33 jmp PutField UpSTR8P0 Wheelify: jsr UpDOSTYPE jsr UpGEOTYPE jsr UpSTRUCT jsr UpDISPLAY rts UpDOSTYPE: lda InfoBlock+$44 ; filter out the type to get base type and #$0f tax ldw R0,#DOSTAB ; show the base type jsr TABME ldb R1H,#$25 ldw R11,#$1b jsr PutField 11$: lda InfoBlock+$44 ; is write protected? and #$40 beq 99$ ldw R0,#WP1 jmp PutString 99$: ldw R0,#SP1 jsr PutString UpGEOTYPE: ldx InfoBlock+$45 ldw R0,#GEOTAB jsr TABME ldw R11,#$1b ldb R1H,#$33 jmp PutField UpSTRUCT: ldw R0,#STRUCT0 lda InfoBlock+$46 beq 10$ ldw R0,#STRUCT1 10$: ldb R1H,#$41 ldw R11,#$1b jmp PutField UpDISPLAY: ldx #0 lda InfoBlock+$60 cmp #64 blt 20$ inx cmp #128 blt 20$ inx cmp #192 blt 20$ inx 20$: ldw R0,#DISTAB jsr TABME ldb R1H,#$6b ldw R11,#$59 jmp PutField eld Xl,Xh,Y .byte $07,$7a,$00,$61 ; FRAME_RECTO Xl,Xh,Y .byte $01,$9a,$00,$57 ; MOVEPENTO Xl,Xh,Y .byte $07,$bf,$00,$61 ; FRAME_RECTO Xl,Xh,Y .byte $01,$d9,$00,$57 ; MOVEPENTO Xl,Xh,Y .byte $07,$fe,$00,$618P0 TABME: cpx #0 ; reached yet? beq 99$ ldb A5L,#0 ; UNKNOWN flag 10$: inw R0 ldy #0 lda (R0),y ; loop until 0 beq 12$ cmp UNK,y ; but also compare to UNK bne 10$ inc A5L ; an UNK char... set flag bne 10$ ldw R0,#UNK ; UNKNOWN recognized... rts 12$: inw R0 ; prepare to loop dex bne TABME ; through next entry 99$: rts GEOTAB: .byte "NON-GEOS ",0 .byte "BASIC Prg. ",0 .byte "Assembly ",0 .byte "Data File ",0 .byte "System File ",0 .byte "Desk Acc. ",0 .byte "Application ",0 .byte "App. Data ",0 .byte "Font File ",0 .byte "Printer Drv. ",0 .byte "Input Driver ",0 .byte "Disk Device ",0 .byte "Sys. Boot ",0 .byte "Temporary ",0 .byte "Auto Exec. ",0 .byte "Input 128 ",0 UNK: .byte "Unknown",0 DOSTAB: .byte "DEL",0 .byte "SEQ",0 .byte "PRG",0 .byte "USR",0 .byte "REL",0 .byte "CBM",0 .byte "DIR",0 .byte "Unknown",0 WP1: .byte " (WP) ",0 SP1: .byte " ",0 STRUCT0: .byte "SEQUENTIAL",0 STRUCT1: .byte "VLIR ",0 DISTAB: .byte "40 COLS ",0 .byte "40/80 ",0 .byte "64 ONLY ",0 .byte "80 COLS ",0 .byte "Unknown",0 RECTO Xl,Xh,Y .byte $01,$6b,$00,$73 ; MOVEPENTO Xl,Xh,Y .byte $07,$91,$00,$7d ; FRAME_RECTO Xl,Xh,Y .byte $00 ; end of table jsr $c1ab ; i_BitmapUp .8P0 InfoVec: ldw R0,#INF1 jsr ClkAll beq 10$ bne 20$ 10$: ldw R0,#INF2 jsr ClkAll beq 11$ avb #$10,ClkAllT bra 20$ 11$: ldw R0,#INF3 jsr ClkAll beq 12$ avb #$20,ClkAllT bra 20$ 12$: rts 20$: jmp VecDo nop fname b8P0 VecDo: lda mouseData bne 21$ rts 21$: jsr FakeCR  cbi ClkAllT,#$25 ; cancel 8P0 bne 22$ ldb sysDBData,#$00 jmp RstrFrmDialog 22$: cbi ClkAllT,#$26 ; save bne 23$ ldb sysDBData,#$01 jmp RstrFrmDialog 23$: cbi ClkAllT,#$02 ; fname bne 24$ jmp EFName 24$: cbi ClkAllT,#$15 ; class bne 25$ jmp EClass 25$: cbi ClkAllT,#$16 ; ver bne 26$ jmp EVer 26$: cbi ClkAllT,#$22 ; author bne 27$ jmp EAuthor 27$: cbi ClkAllT,#$23 ; app dat bne 28$ jmp EAppDat 28$: cbi ClkAllT,#$01 ; dos type bne 29$ jmp EDOSType 29$: cbi ClkAllT,#$03 ; geos type bne 30$ jmp EGEOType 30$: jmp VecDo2 nop nop nop nop OType 30$: jmp VecDo2 nop nop nop "Auto Exec. ",0 .byte "Input 128 ",0 UNK: .byte "Unkn8P0 VecDo2: cbi ClkAllT,#$11 ; file struct bne 31$ jmp EStruct 31$: cbi ClkAllT,#$21 ; display bne 32$ jmp EDisplay 32$: cbi ClkAllT,#$12 ; load bne 33$ jmp ELoad 33$: cbi ClkAllT,#$13 ; end bne 34$ jmp EEnd 34$: cbi ClkAllT,#$14 ; exe bne 35$ jmp EExe 35$: cbi ClkAllT,#$24 ; comments bne 36$ ldw keyVector,#NADA jsr ComBox  jsr  R3R4X2GM  jsr i_PrintTBox 8P0 .word InfoBlock + $a0 .byte 3 .byte 90 jsr TBOXResume 36$: rts ty8P0 ClkAll: ldb ClkAllT,#0 ClkAll2: ldy #0 lda (R0),y ; a null ends the fun beq 99$ sta ClkAllB cmp #$01 ; movepento beq 11$ cmp #$07 bne 10$ ldy ClkAllB lda FIX80x,y ; cross ref to x offset beq 10$ ; if EQ, skip to next step tay dey lda (R0),y ; otherwise, get x byte sta R4L iny lda (R0),y sta R4H iny lda (R0),y sta R2H inc ClkAllT jsr IsMseInRegion cmp #$ff bne 10$ jsr InvertRectangle lda ClkAllT rts 11$: ldy ClkAllB lda FIX80x,y ; cross ref to x offset beq 10$ ; if EQ, skip to next step tay dey lda (R0),y ; otherwise, get x byte sta R3L iny lda (R0),y sta R3H iny lda (R0),y sta R2L 10$: ldy ClkAllB lda FIX80len,y ; now get next cmd offset beq 99$ ; eq means no more clc adc R0L sta R0L lda #$00 adc R0H sta R0H jmp ClkAll2 99$: lda #0 rts lkAllT: .byte 0 ClkAllB: .byte 0 mp EDisplay 32$: cbi ClkAllT,#$12 ; load bne 33$ jmp ELoad 33$: cbi ClkAllT,#$13 ; end bne 34$ jmp EEnd 34$: cbi ClkAllT,#$14 ; exe bne 35$ jmp EExe 38P0 EFName: ldw A2,#EditFile ldb A3H,#16 ldb R2L,#$17 jmp GetFStd2 EClass: ldw R0,#EditClass ldb R1H,#$5d ldb R2L,#$0c jmp GetFStd EVer: ldw R0,#EditVer ldb R1H,#$6b ldb R2L,#$04 jmp GetFStd EAuthor: ldw R0,#InfoBlock+$61 ldb R1H,#$79 ldb R2L,#$12 jmp GetFStd EAppDat: ldw R0,#InfoBlock+$75 ldb R1H,#$87 ldb R2L,#$12 jmp GetFStd EDOSType: inc InfoBlock + $44 lda InfoBlock + $44 and #$0f cmp #$07 blt 99$ lda InfoBlock + $44 and #$40 ; wp set? bne 10$ ldb InfoBlock + $44,#$c0 bra 99$ 10$: ldb InfoBlock + $44,#$80 99$: jmp UpDOSTYPE EGEOType: inc InfoBlock + $45 lda InfoBlock + $45 cmp #$10 blt 99$ ldb InfoBlock + $45,#$00 99$: jmp UpGEOTYPE EStruct: lda InfoBlock + $46 eor #$01 sta InfoBlock + $46 jmp UpSTRUCT a InfoBlock + $46 eor #$01 sta InfoBlock + $46 jmp UpSTRUCT is file to GEOS?",27,0 yte "DIR",0 .byte "Unknown",0 WP1: .byte " (WP) ",0 SP1: .byte " ",0 STRUCT0: .byte "SEQUENTIAL",0 STRUCT1: .byte "VLIR ",0 DISTAB:8P0 ELoad: ldw R0,#EditLoad ldb R1H,#$4f ldw R11,#$fff1 ldb R2L,#$04 jmp GetField EEnd: ldw R0,#EditEnd ldb R1H,#$4f ldb R2L,#$04 ldw R11,#$0036 jmp GetField EExe: ldw R0,#EditExe ldb R1H,#$4f ldb R2L,#$04 ldw R11,#$0075 jmp GetField EDisplay: lda InfoBlock + $60 bne 10$ ldb InfoBlock + $60,#64 jmp UpDISPLAY 10$: lda InfoBlock + $60 cmp #64 bne 11$ ldb InfoBlock + $60,#128 jmp UpDISPLAY 11$: lda InfoBlock + $60 cmp #128 bne 12$ ldb InfoBlock + $60,#192 jmp UpDISPLAY 12$: ldb InfoBlock + $60,#0 jmp UpDISPLAY 8P0 EComments: jsr TBOXResume rts H,#$4f ldw R11,#$fff1 ldb R2L,#$04 jmp GetField EEnd: ldw R0,#EditEnd ldb R1H,#$4f ldb R2L,#$04 ldw R11,#$0036 jmp GetField E8P0 HexW: lda R0H ; do the high bytes first jsr HexB ; put the high bytes in buf +1,+2 inw A2 inw A2 ; now point to buf +3,+4 lda R0L ; get the low order byte jsr HexB ; and write them out dew A2 dew A2 ; back up to where we started... rts HexB: sta HexSave ; save it for a sec lsr a lsr a lsr a lsr a ; get the high nibble tay lda HexTable,y ldy #0 sta (A2),y ; store the high nibble digit lda HexSave and #$0f ; mask out low nibble tay lda HexTable,y ; gimmi a digit ldy #1 sta (A2),y ; store the low nibble digit iny lda #0 sta (A2),y ; store the string terminator rts HexTable: .byte '0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','A','B','C','D','E','F','*' ValTable: .byte 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,10,11,12,13,14,15,0 HexSave: .byte 0 .byte "REL",0 .byte "CBM",0 .byte "DIR",0 .byte "Unknown",0 WP1: .byte " (WP) ",0 SP1: .byte " ",0 STRUCT0: .byte "SEQUENTIAL",0 STRUCT1: .byte "VLIR ",0 DISTAB:8P0 Save: jsr i_YNBox .word YNStr1 cbi sysDBData,#$03 beq 90$ rts 90$: lda InfoBlock+$45 ; is geos type? beq 12$ ldw R0,#EditEnd jsr UnHex bne 10$ mvw R1,InfoBlock+$49 10$: ldw R0,#EditLoad jsr UnHex bne 11$ mvw R1,InfoBlock+$47 11$: ldw R0,#EditExe jsr UnHex bne 12$ mvw R1,InfoBlock+$4b 12$: ldw R0,#EditClass ldw R1,#InfoBlock+$4d ldb R2L,#12 jsr SaveNFill ldw R0,#EditVer ldw R1,#InfoBlock+($4d + $0c) ldb R2L,#4 jsr SaveNFill lda InfoBlock+$44 ldy #$00 sta (A3),y lda InfoBlock+$45 ldy #$16 sta (A3),y lda InfoBlock+$46 ldy #$15 sta (A3),y ldw R0,#EditFile-3 ldy #$03 14$: lda (R0),y beq 15$ sta (A3),y iny bne 14$ 15$: cpy #19 bge 17$ 16$: lda #$a0 sta (A3),y iny cpy #19 blt 16$ 17$: jmp Save2 YNStr1: .byte "Confirm: Update this file?",27,0 YNStr2: .byte "Convert this file to GEOS?",27,0 31$ jmp EStruct 31$: cbi ClkAllT,#$21 ; display bne 32$ jmp EDisplay 32$: cbi ClkAllT,#$12 ; load bne 33$ jmp ELoad 33$: cbi ClkAllT,#$13 8P0 Save2: jsr OpenDisk ldy #$13 lda (A3),y bne 20$ lda OldGeoType ; if WAS a geotype, forget it bne 20$ lda InfoBlock+$45 ; if is NOT a geotype now, forget it beq 21$ jsr i_YNBox ; otherwise, potentially convert it .word YNStr2 cbi sysDBData,#$03 beq 10$ rts 10$: jsr geoCvrt beq 20$ rts 20$: ldy #$13 lda (A3),y sta R1L iny lda (A3),y sta R1H ldw R4,#InfoBlock jsr PutBlock ; saved the info block! cpx #0 beq 21$ rts 21$: jsr ResetTNS cwi A3,#SrcBlk2 bge 25$ mvw SrcTNS1,R1 ldw R4,#SrcBlk1 jsr PutBlock ; updated directory entry lda #1 ; *** could be much smarter jmp UpdateS ; yes so update (clr boxes?) 25$: mvw SrcTNS2,R1 ldw R4,#SrcBlk2 jsr PutBlock ; updated directory entry lda #1 ; *** could be much smarter jmp UpdateS ; yes so update (clr boxes?) tr2: .byte "Convert this file to GEOS?",27,0 yte "DIR",0 .byte "Unknown",0 WP1: .byte " (WP) ",0 SP1: .byte " ",0 STRUCT0: .byte "SEQUENTIAL",0 STRUCT1: .byte "VLIR ",0 DISTAB:8P0 SaveNFill: ldy #0 13$: lda (R0),y ; class loop beq 14$ sta (R1),y iny cpy R2L blt 13$ 14$: cpy R2L bge 16$ 15$: lda #32 sta (R1),y iny cpy R2L blt 15$ 16$: rts UnHex: ldw R1,#0 ldy #0 10$: lda (R0),y jsr HexABit bcs 99$ jsr HiNybble sta R1H iny lda (R0),y jsr HexABit bcs 99$ ora R1H sta R1H iny lda (R0),y jsr HexABit bcs 99$ jsr HiNybble sta R1L iny lda (R0),y jsr HexABit bcs 99$ ora R1L sta R1L ldx #0 rts 99$: ldx #$ff rts HexABit: ldx #0 10$: cmp HexTable,x beq 11$ inx cpx #22 blt 10$ lda #0 sec rts 11$: lda ValTable,x clc rts HiNybble: asl a asl a asl a asl a rts S ; yes so update (clr boxes?) 25$: mvw SrcTNS2,R1 ldw R4,#SrcBlk2 jsr PutBlock ; updated directory entry8P0 geoCvrt: ldw R2,#$05 ldw R6,#BlkBuf jsr BlkAlloc cpx #0 beq 11$ rts 11$: ldy #$13 lda BlkBuf sta (A3),y iny lda BlkBuf+1 sta (A3),y jsr PutDirHead cpx #0 rts EditFile: .block 17 ; filename being edited Edi8P0 .ramsect ClkAllT: .block 1 ClkAllB: .block 1 SaveFEnt: .block 2 ; saving pointer to dir entry InfoBlock: .block 258 ; information sector LstRel: .block 1 ; last item released OldGeoType: .block 1 ; old geos type EditFile: .block 17 ; filename being edited EditClass: .block 13 ; 12 character class EditVer: .block 7 ; 4 char version EditLoad: .block 7 ; 4 char load addr EditExe: .block 7 ; 4 char exe addr EditEnd: .block 7 ; 4 char end addr BlkBuf: .block 20 ; new info sector t&s TheEnd: .block 1 beq 11$ inx cpx #22 blt 10$ lda #0 sec rts 11$: lda ValTable,x clc rts HiNybble: asl a asl a asl a asl a rts ory entry lda #1 ; *** could be much smarter jmp UpdateS ; yes so update (clr boxes?) blt 16$ 17$: jFStd: ldw R11,#$07 PutField: avb #$0f,R1H avw #$32,R11 adw InfoDat+3,R11 jsr SVALL ldw StringFaultVec,#STRF1 jsr PutString jsr RDALL rts GetFStd: ldw R11,#$07 GetField: ldw keyVector,#NADA ldb R1L,#$00 avb #$H/MajReOrg2PRG formatted GEOS file V1.0AWrite Image V2.0geoWrite V1.1GEOPROGRAMMER sample file.F P ;***************************** ;* ;*  The Major ReOrg ;* ;* (C) 2001 Bo Zimmerman ;* ;*****************************  .noglbl  P.noeqin .if Pass1 .include GEOSequates .endif .glbl .eqin .header ;start of header section .word 0 ;first two bytes = 0 .byte 3 ;width in bytes .byte 21 ;and height in scanlines of: @ .byte $80 | 3 ;Commodore type, bit 7 S .byte APPLICATION ;Geos file type .byte SEQUENTIAL ;Geos file structure type .word ProgStart ;load address of program .word $3ff ;end address, needed for ;desk accessories. .word ProgStart ;init address of program .byte "MajorReOrg 2.1a",0,0,0,64 ;perm. filename 12 chars, ;4 char version number, ;3 zeroes, ;40/80 column flag. .byte "Bo Zimmerman ",0 ;19 character author name ;end of header section which is checked for accuracy .block 160-117 ;skip 43 bytes... .byte "Organize directories and modify files.",0 .endh ve, disk, and dsKKqIIq<31x1f1f1f1f33f>fx _ٻٙٙٙٙۙ ($AA A AAAAAAAAAAAAAAAAAA   AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA  AAAAAAAAAAAAAAAAAA A AA$(AA A AAAAAAAAAAAAAAAAAA   AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA  AAAAAAAAAAAAAAAAAA A AA$ : : :   :  $9  )4  $:HeThe Major ReOrg5H The Major ReOrg v1.05@)%Disk:4H4H;^Hٞٳٳ?03 = SN_X5$,7Use System directory3@ OpenPresReOrgDesigns2c PRG formatted GEOS file V1.09???9Aԑ7 <>> 2=> OP> DPMajReOrgDocs 9PRG formatted GEOS file V1.0AWrite Image V2.0geoWrite V2.1  ...݅ ( >1 59 ..  9 < <` " . r " `(@1ʎsAڢ9 V& ?@@@@@@@@@ The Major ReOrg 2.1 @00000000(c) 2001 by Bo Zimmerman @00000000This program is shareware. If you find the program useful, please register it. It will encourage me to continue developing this software. Registration instructions can be seen by executing the program. Please send any and all reports of praise or problems to bo@zimmers.net, or to the address shown on the registration screen. Only registered users will receive bug fixes and new feature enhancements.  @INTRODUCTION 800000000 The Major ReOrg is a GEOS application which provides a combination directory organizer and GEOS file information editor. MajReOrg will run on GEOS 64 or 128 v2.0 or higher. It will also run on Wheels 64 and 128, as well as MP3 and gateWay.  @STARTING OFF  MajReOrg is executed by double-clicking on its icon from the deskTop. The initial dialog that is presented allows the user to select the drive, disk, and directory or subdirectory that will be organized. Use the Drive button to cycle through drives A, B, C, and D. Use the Disk button to insert a new disk into a floppy drive, or (under Wheels) select a new partition or subdirectory. Also on this dialog is a box which reads: "Use System Directory". This option will default unselected, meaning that the main directory is has been selected to be organized. If the option is selected, the "System Directory" under Wheels, which is the same as the "Border" area under GEOS, will be selected.  @MAJREORG MAIN SCREEN  After clicking the OK button, MajReOrg will open up the selected directory and present the main screen. This main screen can be broken into several parts: the Existing Directory window on the left, the New Directory window on the right, the Exit box in the upper left hand corner, the Done button at the bottom, and the Function buttons running vertically between the two windows. These buttons are, from top to bottom, the right arrow button, the left arrow button, the Spacer button, the right Flush button, and the left Flush button. The New and Existing Directory windows both have a set of arrow buttons running along the side of them. Clicking the down arrow will show the next two pages of files. Clicking the up arrow will show the previous two pages of files. Clicking the farthest up arrow will show the first two pages of files, while clicking the farthest down arrow will show the last page or pages of files.  @ORGANIZING DIRECTORIES  To organize a new directory, all of the files from the Existing Directory window must be moved to the New Directory window, in the order which you would like them to appear on your disk or directory. To do this, you must first select one or more files from the currently displayed page of files in the Existing Directory window. Selecting files will highlight them, allowing you to either drag those files to the New Directory window, or use the right arrow button to move the files to the New Directory window. Files moved to the New Directory window will always appear in the order in which they were moved. Files in the New Directory window may also be selected and moved, using the single left arrow button, back to their old spot in the Existing Directory window. You may have to use the up and down page arrow buttons to see the changes being made. The other three Function buttons not yet mentioned are the Spacer button, which has an "X" along with a right arrow, and the two Flush buttons, which have a pair of double right arrows. The Spacer button will insert a blank file spacer into the New Directory  window. After clicking this button once, subsequent files moved into the directory will appear one space down from where 800000000 window. After clicking this button once, subsequent files moved into the directory will appear one space down from where you would expect. Normally, new files in a directory always favor empty entries like these before being added to the end of a directory. The right Flush button will move all remaining files in the Existing Directory window, in the order in which they appear there, into the New Directory window. The left Flush button will clear the New Directory window and reset the Existing Directory window to its default state. After you have finished moving all of the files to the New Directory window, and they are ordered to your liking, you may click the Done button at the bottom of the screen. The Done button will save your new file list onto the disk or directory, and return to the deskTop. If all of the files have not yet been moved, you will receive an error dialog and be allowed to move the remaining files.  @EXITING  If you wish to exit MajReOrg before writing your new directory to the disk, select the Exit button in the upper right hand corner. You will be prompted about saving your changes. Selecting No will take you back to the deskTop without ANY directory organizer changes having been saved to the disk. As mentioned below, changes which are Saved using the file editor are not discarded when exiting in this way.  @FILE INFORMATION EDITOR  MajReOrg, in addition to being a fine directory editor, also includes a file header editor. To edit a file's information header, find its name in the Existing Directory window and double-click on the name. This will bring up the File Information dialog. When editing normal, non-GEOS files, this editor may be used to create a GEOS-style directory header. Change only the Filename and DOS File Type fields on a non-GEOS file to avoid converting the file to GEOS. Please be very careful with this editor. If you do not know what you are doing, don't mess with it! If you would like to find out what you are doing, the GEOS Programmers Reference Guide is a good start. Either way, when you are done making changes, you may click the Save button to immediately change the file and return to the MajReOrg main screen. Clicking cancel will abandon any changes.  @CLOSING  The author of this program knows that MajReOrg has a stupid, punnish name, and does not require user feedback regarding this matter. It was written during a weekend where on Friday I knew where I was on the corporate organization chart where I worked, but did not know where I would appear Monday, as the company bosses were completing the plans for yet another Major Reorganization. Anyways, this program is also a living testimony to the usefulness of geoBEAVER. I highly recommend downloading it off my web site if you intend to do any GEOS programming. Lastly, special thanks to Dale Sidebottom for first pumping up my ego by telling me how great this program is, and then by helping to improve the program by suggesting the inclusion of the two Flush buttons.  @