Mirror of CollapseOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 line
588B

  1. : $f EDPOS @ PREVPOS @ 2DUP = IF 2DROP EXIT THEN
  2. 2DUP > IF DUP pos! SWAP THEN
  3. ( p1 p2, p1 < p2 ) OVER - 64 MIN ( pos len ) FBUF _zbuf
  4. SWAP _cpos FBUF ( len src dst ) ROT MOVE ;
  5. : $R ( replace mode )
  6. mode! 'R' EMIT
  7. BEGIN setpos C< DUP 0xd = NOT IF
  8. EDPOS @ _cpos C! 1 EDPOS +! BLK!! 0
  9. THEN UNTIL mode! SPC contents ;
  10. : $O EDPOS @ 0x3c0 ( 15 * 64 ) >= IF EXIT THEN
  11. _U EDPOS @ 0x3c0 AND DUP pos! _cpos _zbuf BLK!! contents ;
  12. : $o EDPOS @ 64 < IF EXIT THEN EDPOS @ 64 + EDPOS ! $O ;
  13. : $D acc@ 0 DO 16 EDPOS @ 64 / DO i _mvln- LOOP LOOP
  14. BLK!! contents ;