# HG changeset patch # User lfantoniosi # Date 1371612341 14400 # Node ID 41a6f70d842d7944637dbba48b12a10803c60579 # Parent 7c844212223527743040aafabe7280d3ab4cc0fc adding minted text editor diff -r 7c8442122235 -r 41a6f70d842d level1/cmds/makefile --- a/level1/cmds/makefile Tue Jun 18 21:41:46 2013 -0400 +++ b/level1/cmds/makefile Tue Jun 18 23:25:41 2013 -0400 @@ -10,7 +10,7 @@ date dcheck debug ded deiniz del deldir devs dir dirsort disasm \ display dmode dsave dump echo edit error exbin format \ free grfdrv help ident iniz irqs link list load login makdir \ - megaread mdir merge mfree mpi os9gen padrom park printerr procs prompt pwd pxd \ + megaread mdir merge mfree minted mpi os9gen padrom park printerr procs prompt pwd pxd \ rename runb save setime shellplus shell_21 sleep \ tee tmode touch tsmon tuneport unlink verify xmode diff -r 7c8442122235 -r 41a6f70d842d level1/cmds/minted.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/level1/cmds/minted.asm Tue Jun 18 23:25:41 2013 -0400 @@ -0,0 +1,2327 @@ +* +* MinTED Minimalist Text Editor for OS-9 6809 +* +* +* This is freeware and open source. Use it as you wish. +* 2013 Luis Antoniosi +* + + nam MinTED + ttl MinTED for OS-9 6809 + ; 2013 Luis Antoniosi + + ifp1 + use defsfile + endc + +tylg set Prgrm+Objct +atrv set ReEnt+rev +rev set $03 +edition set 1 + + mod eom,name,tylg,atrv,start,size + + org 0 + +undo_item struct +previous rmb 2 +next rmb 2 +scrline rmb 2 +cx rmb 1 +cy rmb 1 +key rmb 1 +topstr rmb 2 + endstruct + + org 0 + +sgn_code rmb 1 +cx rmb 1 +cy rmb 1 +tcx rmb 1 +key rmb 1 +edited rmb 1 + +width rmb 2 +height rmb 2 +cntlin rmb 2 +curstr rmb 2 ; temp cur str +curptr rmb 2 ; temp cur ptr +topstr rmb 2 ; top screen current string +topptr rmb 2 ; top screen string pointer +topscr rmb 2 ; +curlen rmb 2 ; current string len +curmsiz rmb 2 ; current malloc size +gotocmd rmb 3 ; cursor locate cmd +malsize rmb 2 +remsize rmb 2 +delstr rmb 2 +renderall rmb 1 +currows rmb 1 + +strlen rmb 2 +prevchar rmb 1 +curchar rmb 1 +strptr rmb 2 ; first string pointer +scrline rmb 2 ; current top screen line +curline rmb 2 ; current cursor screen line +scrlines rmb 2 ; total screen lines +undoptr rmb 2 ; undo first item +undoflag rmb 1 ; +termcap rmb 1 ; terminal capabilities +himem rmb 2 ; application high memory +bufsize rmb 2 ; buffer size +scrbuf rmb 2 ; screen buffer addr +scrsize rmb 2 ; screen buffer size +membuf rmb 2 ; memory buffer addr +memsize rmb 2 ; memory buffer size +memstart rmb 2 ; memory start chunck + + +oldecho rmb 1 ; original term echo3 +oldalf rmb 1 ; original term auto line-feed +filepath rmb 1 ; file path number +argc rmb 2 ; number of args +optbuf rmb 32 ; SS/GS OPT buffer +filename rmb 256 ; filename +readbuf rmb 256 ; read buffer +args rmb 256 ; 128 max args +VAR_SIZE equ . ; work variables size +STACK_SIZE equ 256 ; reserved stack size + + IFEQ Level-1 +buffer rmb (20*1024-VAR_SIZE) + ELSE +buffer rmb (54*1024-VAR_SIZE) + ENDC + + +size equ . + +stdin equ 0 +stdout equ 1 +stderr equ 2 + +K$Shift equ $10 +K$Up equ $0c +K$Down equ $0a +K$Left equ $08 +K$Right equ $09 + +K$ShiftUp equ $1c +K$ShiftDown equ $1a +K$ShiftLeft equ $18 +K$ShiftRight equ $19 + +K$CtrlUp equ $13 +K$CtrlDown equ $12 +K$CtrlLeft equ $10 +K$CtrlRight equ $11 + +K$CtrlK equ $0b +K$CtrlD equ $04 +K$CtrlW equ $17 +K$CtrlR equ $12 +K$CtrlS equ $13 +K$CtrlO equ $0f +K$CtrlG equ $07 +K$CtrlU equ $15 +VDG_CAP equ $00 ; vdg defaul terminal +WIN_CAP equ $01 ; window capabilities (Level 2) + + +name fcs /MinTED/ + fcb edition + +errPNNF fcn "Path Name not found" +errMF fcn "Memory full" +errRF fcn "Error reading file" +errWF fcn "Error writing file" +errBreak fcn " - press break" +msgConfirm fcn "Exit without saving (y/n)?" +msgSave fcn "Save file (y/n)?" +msgRename fcn "Rename/Save as: " +msgSaving fcn "Saving " +msgLineNo fcn "Go to line: " + +msgHelp fcc "Minted: Minimalist Text Editor" + fcb $0a,$0d + fcb $0a,$0d + fcc "Hot keys:" + fcb $0a,$0d + fcb $0a,$0d + fcc "Ctrl+S = Save file" + fcb $0a,$0d + fcc "Ctrl+R = Rename file" + fcb $0a,$0d + fcc "Ctrl+K = Delete line" + fcb $0a,$0d + fcc "Ctrl+D = Duplicate line" + fcb $0a,$0d + fcc "Ctrl+O = Online help" + fcb $0a,$0d + fcc "Ctrl+E = Exit" + fcb $0a,$0d + fcc "Ctrl+G = Go to line" + fcb $0a,$0d + fcc "Ctrl+U = Undo" + fcb $0a,$0d + fcc "Cursor Keys = Move cursor" + fcb $0a,$0d + fcc "Shift+Left = Delete left" + fcb $0a,$0d + fcc "Shift+Right = Delete right" + fcb $0a,$0d + fcc "Shift+Up = Page up" + fcb $0a,$0d + fcc "Shift+Down = Page down" + fcb $0a,$0d + fcc "Ctrl+Left = Go to line begin" + fcb $0a,$0d + fcn "Ctrl+Right = Go to line end" + +brkpnt rts + +start lbsr _getargs + lbsr _init + + lbsr _open + tst next = next + exg d,y + cmpy #0 + beq @free + std ,y ; next->previous = previous +@free puls a,b,y,pc +@first std previous = 0 + bra @free + +; delete the string +; x string ptr +_strdel pshs a,b,y + ldy ,x ; previous + ldd 2,x ; next + cmpy #0 + beq @first + std 2,y ; previous->next = next + exg d,y + cmpy #0 + beq @free + std ,y ; next->previous = previous +@free lbsr _mfree + puls a,b,y,pc +@first std previous = 0 + bra @free + +; resize string +; x str ptr +; d new size +; return x new str +_strres pshs a,b,y + addd #5 + lbsr _mrealloc + bcs @error + ldy ,x ; previous + beq @first + stx 2,y ; previous->next = this +@next ldy 2,x ; next + beq @last + stx ,y ; next->previous = this +@last puls a,b,y,pc +@first stx next = prev->next + sty ,x this->prev = prev + stx 2,y prev->next = this + ldy 2,x + stx ,y next->prev = this +@refr clr ] Usage : Minimalist text editor Hot keys: Ctrl+S = Save file Ctrl+R = Rename file Ctrl+K = Delete line Ctrl+D = Duplicate line Ctrl+O = Online help Ctrl+E = Exit/esc Ctrl+G = Go to line ctrl+U = Undo Cursor keys = Move cursor Shift+Left = Delete left Shift+Right = Delete right Shift+Up = Page up Shift+Down = Page down Ctrl+Left = Go to line begin Ctrl+Right = Go to line end \ No newline at end of file diff -r 7c8442122235 -r 41a6f70d842d level2/coco3/cmds/makefile --- a/level2/coco3/cmds/makefile Tue Jun 18 21:41:46 2013 -0400 +++ b/level2/coco3/cmds/makefile Tue Jun 18 23:25:41 2013 -0400 @@ -18,7 +18,7 @@ date dcheck debug ded deiniz del deldir devs dir dirsort disasm \ display dmem dmode dsave dump echo edit error exbin \ format free grfdrv help ident iniz irqs link list load login \ - makdir mdir megaread merge mfree mmap modpatch montype mpi os9gen padrom park \ + makdir mdir megaread merge mfree minted mmap modpatch montype mpi os9gen padrom park \ pmap proc procs prompt pwd pxd reboot rename save setime \ shell_21 sleep smap tee tmode touch tsmon tuneport unlink verify wcreate xmode diff -r 7c8442122235 -r 41a6f70d842d level2/coco3/sys/makefile --- a/level2/coco3/sys/makefile Tue Jun 18 21:41:46 2013 -0400 +++ b/level2/coco3/sys/makefile Tue Jun 18 23:25:41 2013 -0400 @@ -22,7 +22,7 @@ kill.hp \ link.hp list.hp load.hp login.hp \ makdir.hp mdir.hp megaread.hp merge.hp mfree.hp mmap.hp modpatch.hp \ - montype.hp mpi.hp os9gen.hp \ + montype.hp minted.hp mpi.hp os9gen.hp \ padrom.hp park.hp pmap.hp proc.hp procs.hp prompt.hp pwd.hp pxd.hp \ reboot.hp rename.hp runb.hp \ save.hp setime.hp setpr.hp shell.hp sleep.hp smap.hp \