# HG changeset patch # User boisy # Date 1070246802 0 # Node ID 148d610f55a4122444880cbfda0f0677a9fca672 # Parent e0d84a845d1a3c03289d93156a157f68f730dea4 Start of 6809izatino of code diff -r e0d84a845d1a -r 148d610f55a4 3rdparty/packages/multivue/cmds_6809/gshell.asm --- a/3rdparty/packages/multivue/cmds_6809/gshell.asm Sun Nov 30 23:24:19 2003 +0000 +++ b/3rdparty/packages/multivue/cmds_6809/gshell.asm Mon Dec 01 02:46:42 2003 +0000 @@ -1,8 +1,6 @@ nam GShell Graphics Shell ttl Source derived by Kent D. Meyers. - IFNE H6309 - * Signal handlers will have to handle new RBF call for directory updates * DIR has to be open (uses path #), but can be in READ+DIR mode * Renames, etc. will have to close DIR 1st, do function, re-open. @@ -358,7 +356,12 @@ stx >MEMEND Save as end of data memory ptr leay ,U Point Y to start of data area bsr MAIN Call main GSHELL routine + IFNE H6309 clrd No error & exit + ELSE + clra + clrb + ENDC std ,--s lbra EXIT @@ -544,7 +547,13 @@ rts * Shut cursor & scaling off -CURSCLOF clrd +CURSCLOF + IFNE H6309 + clrd + ELSE + clra + clrb + ENDC pshs d ldb 5,S pshs d @@ -719,7 +728,13 @@ WAITRTN2 lbra WAITLOOP * Same screen overlay shell -LETTERS clrd +LETTERS + IFNE H6309 + clrd + ELSE + clra + clrb + ENDC pshs d pshs d No parameter for calling program incb @@ -824,7 +839,12 @@ pshs U lbsr UNSLICON Bad dir, unselect drive leas 2,S + IFNE H6309 clrd + ELSE + clra + clrb + ENDC std SELECTED Current device=none ldd 2,S Did user have a different drive selected before? beq ICONEXT2 No, exit @@ -928,7 +948,12 @@ lbsr UNSLICON Unselect icon lbsr ENBLSOFF Shut all FILES menu items off leas 2,S + IFNE H6309 clrd + ELSE + clra + clrb + ENDC std SELECTED Set selected file/device to none ICONEXIT leas 4,S puls U,PC @@ -1004,7 +1029,13 @@ EXECAIFP pshs d Save ptr to parms string lbsr STPREFIX Prefix that onto Fork line string leas 2,S -EXECAIF2 clrd +EXECAIF2 + IFNE H6309 + clrd + ELSE + clra + clrb + ENDC pshs d,U ldd ID.MNAME,U Get ptr to module name to fork pshs d @@ -1085,7 +1116,12 @@ std ,S Save it lbsr UNSLICON Unselect the current drive leas 2,S + IFNE H6309 clrd + ELSE + clra + clrb + ENDC std STRTICON Set ptr to start icon for screen to NONE std SELECTED Current selected icon to NONE std DEVICNOW Current selected device to NONE @@ -1102,7 +1138,12 @@ * Entry: 0-1,s RTS address * 2-3,s ptr to GD.* (process table entry ptr) to kill KILPDESC pshs U + IFNE H6309 clrd No entry found yet + ELSE + clra + clrb + ENDC pshs d Save it ldu PTBLSPTR Get ptr to start of process descriptor table beq KILPDS00 None, exit @@ -1217,7 +1258,12 @@ lbsr PUTSTRNG leas 2,S std GD.MNAME,U Save ptr to module name + IFNE H6309 clrd + ELSE + clra + clrb + ENDC std GD.MTYPE,U Default stuff to zeros std GD.INDVC,U ??? to 0 std GD.PRCID,U Process ID # to 0 @@ -1263,7 +1309,12 @@ lbsr GCSETOFF Shut graphics cursor off lbsr MOUSOFF Shut mouse off lbsr WIPICONS Wipe icons off screen (should not touch dir bar) + IFNE H6309 clrd + ELSE + clra + clrb + ENDC std SELECTED 0 out currently selected icon ptr ldd MAXICONS Get # icons/screen muld SCREENOW Multiply by screen set # @@ -1273,11 +1324,20 @@ DRAWSCR1 ldu FL.LINK,U DRAWSCR2 ldd 2,S Get screen set # we want to print + IFNE H6309 decd Base 0 + ELSE + subd #$0001 + ENDC std 2,S Save it back bge DRAWSCR1 If not 1st, skip ahead stu STRTICON Save ptr to 1st icon on current screen + IFNE H6309 clrd + ELSE + clra + clrb + ENDC bra DRAWSCR4 DRAWSCR3 pshs U @@ -1285,7 +1345,11 @@ leas 2,S ldu FL.LINK,U ldd 2,S + IFNE H6309 incd + ELSE + addd #$0001 + ENDC DRAWSCR4 std 2,S stu -2,S beq DRAWSCR5 @@ -1323,7 +1387,13 @@ leas 3,s Eat stack decb Base 0 for scroll bar SETSTAT call bge NotNeg not negative, skip ahead -Force0 clrd Force to 0 +Force0 + IFNE H6309 + clrd Force to 0 + ELSE + clra + clrb + ENDC NotNeg cmpb #20 Past end? bls DRAWSCR6 No, good, so update scroll bars ldb #20 Force to 20 @@ -1378,7 +1448,12 @@ lbsr CWAREA Clear out interior window lbsr CLRSCRN lbsr FULLSCRN Full interior window size (except border) + IFNE H6309 clrd Redo scroll bars at 0,0 + ELSE + clra + clrb + ENDC std 4,S std 2,S lbsr ST.SBAR @@ -1390,7 +1465,12 @@ ldb #$ff Flag that we have to redo icons stb WIPED bsr WIPICONS Wipe icons off screen (leave current dir border) + IFNE H6309 clrd + ELSE + clra + clrb + ENDC std FILESCTR # files in current dir=0 ldb #PTR.SLP Hourglass ptr pshs d,X,Y @@ -1469,7 +1549,11 @@ std DIRPTR CLASTEST ldd ,S Get # of dir entries in this 2k block + IFNE H6309 decd Subtract 1 + ELSE + subd #$0001 + ENDC std ,S bge CLASSIFY Still going, classify file type, otherwise, get next 2k block @@ -1502,11 +1586,21 @@ fcb NUL * Count # of screens to hold icons -CNTSCRNS clrd +CNTSCRNS + IFNE H6309 + clrd + ELSE + clra + clrb + ENDC std SCREENOW Set current "screen" of icons to 0 (1st) ldd FILESCTR Get # files current dir beq CNTSCRN2 zero, save & exit + IFNE H6309 decd + ELSE + subd #$0001 + ENDC divd MAXICONS+1 Divide by # icons/"screen" clra 16 bit result CNTSCRN2 std NSCREENS Save # of icon "screens" & return @@ -1771,8 +1865,15 @@ bne Minus9 leax -16,x ldd FL.XSTRT,u Get original icon start again + IFNE H6309 lsld Put column # in A lsld + ELSE + lslb + rola + lslb + rola + ENDC AdjLoop leax 2,x 2 pixels per column deca bne AdjLoop @@ -2084,7 +2185,12 @@ FILE.XXX pshs U ldu 4,S Get ptr to file table entry leas -64,S Make large buffer on stack + IFNE H6309 clrd + ELSE + clra + clrb + ENDC std 28,S ldd FL.FNAME,U Get ptr to filename pshs d @@ -2185,9 +2291,18 @@ ldd NXTICONO,Y ldx 22+6,S std ,X + IFNE H6309 incd + ELSE + addd #$0001 + ENDC std NXTICONO,Y + IFNE H6309 clrd + ELSE + clra + clrb + ENDC std ID.LINK,X ldd #24 std ,S @@ -2217,7 +2332,12 @@ leas 2,S FILEXXX2 ldd 30,S bge FILEXXX3 + IFNE H6309 clrd + ELSE + clra + clrb + ENDC bra FILEXXX6 FILEXXX3 ldd 28,S @@ -2278,7 +2398,12 @@ ISIT.AIF ldx 2,S ldd ,X++ + IFNE H6309 andd #$5f5f + ELSE + anda #$5f + andb #$5f + ENDC cmpd #"AI bne ISITAIF4 ldd ,X @@ -3265,7 +3390,12 @@ FLSORT lbsr SUREBOX6 std -2,S beq FLSORT1 + IFNE H6309 clrd + ELSE + clra + clrb + ENDC pshs d pshs d No parameter for program pshs d No overlay window @@ -4104,7 +4234,13 @@ * Select off of the TANDY menu * Entry: 0-1,s = RTS parameter * 2-3,s = Menu item # selected -TNDYSLCT clrd Put 4 zero bytes on stack +TNDYSLCT + IFNE H6309 + clrd Put 4 zero bytes on stack + ELSE + clra + clrb + ENDC pshs D pshs D ldb 7,S Get 1 byte version of menu item selected @@ -4420,7 +4556,12 @@ pshs d lbsr ST.RELEA leas 2,S + IFNE H6309 clrd Clear out signal received & return + ELSE + clra + clrb + ENDC std 128k RAM, try to make new window??? ISCR512K pshs U ldu 4,S Get ptr to current GD (forked process table) structure + IFNE H6309 clrd + ELSE + clra + clrb + ENDC std ACTVSCRN Current active screen to none std DWSETSTY New window type to none ldx 6,S @@ -5357,7 +5532,13 @@ cmpa #25 routine bne ISC512K6 * New window is full size goes here -ISC512K3 clrd Default window x,y start to 0,0 +ISC512K3 + IFNE H6309 + clrd Default window x,y start to 0,0 + ELSE + clra + clrb + ENDC std GD.XSTRT,U std GD.YSTRT,U ldd #319 Default to 320 X pixel size @@ -5428,7 +5609,11 @@ bsr DIVDX8 std 4,S ldd GD.XEND,U Save X window size + IFNE H6309 incd + ELSE + addd #$0001 + ENDC bsr DIVDX8 subd 4,S std 8,S @@ -6212,14 +6397,24 @@ leas 2,S FIXDRTBX ldx ptr (Get ptr to current allocp (last mem entry?) bra MALLOC3 @@ -6538,7 +6768,12 @@ bne MALLOC2 lbsr MORECORE nunits above return addr (Get more data mem) bne MALLOC2 if (p = .... == 0) (Get mem failed?) + IFNE H6309 clrd set up zero for return + ELSE + clra + clrb + ENDC MALLOC7 leas 2,S puls U,PC @@ -6660,7 +6895,12 @@ F.NML1 bcc F.NML2 puls X,Y stb ERRNO+1,Y + IFNE H6309 clrd + ELSE + clra + clrb + ENDC rts F.NML2 sty [10,S] @@ -6703,7 +6943,13 @@ * Exit: [,x] child's exit code * D=0 - if [,x] ptr was 0 * else D= Child's proces # -F.WAIT clrd Wait for signal +F.WAIT + IFNE H6309 + clrd Wait for signal + ELSE + clra + clrb + ENDC os9 F$WAIT bcs OS9ERR2 Error, save error code & return (no child process) ldx 2,S Get ptr to ??? @@ -6737,7 +6983,12 @@ READ1 bcc WRITE10 cmpb #E$EOF EOF error? bne WRITERR No, report error + IFNE H6309 clrd If EOF error, report 0 bytes read + ELSE + clra + clrb + ENDC puls Y,PC * Read line: Exits with D=# bytes read @@ -6874,7 +7125,13 @@ bne STRNCMP4 No, exit with <> tstb End of string early? bne STRNCMP1 No, continue comparing -STRNCMP2 clrd Exit with = +STRNCMP2 + IFNE H6309 + clrd Exit with = + ELSE + clra + clrb + ENDC puls X,U,PC * If done up to max length, compare last chars of each string @@ -7020,7 +7277,12 @@ bcs SCSIZERR stx [8,S] Save X size (by pointer) sty [10,S] Save Y size (by pointer) + IFNE H6309 clrd + ELSE + clra + clrb + ENDC bra SCSIZEXT SCSIZERR ldy 2,S Get data area pointer back @@ -7249,7 +7511,12 @@ * Exit: D=signed 16 bit value ATOI pshs U Preserve U ldu 4,S Get ptr to text to convert + IFNE H6309 clrd Clear carry, and default # to 0 + ELSE + clra + clrb + ENDC pshs CC,d,dp CC=storage for current ASC char, dp=sign, D=current result ATOI1 ldb ,U+ Get 1st ascii character stb ,S Save it @@ -7407,7 +7674,12 @@ rts SYSRET bcs OS9ERR + IFNE H6309 clrd + ELSE + clra + clrb + ENDC rts EXIT @@ -7992,7 +8264,3 @@ emod MODSIZE equ * end - - ELSE -* 6809 version - ENDC