Browse Source

shell: de-macro-ize

pull/10/head
Virgil Dupras 5 years ago
parent
commit
45b8e84e2a
4 changed files with 5 additions and 14 deletions
  1. +5
    -8
      parts/z80/shell.asm
  2. +0
    -2
      recipes/rc2014/glue.asm
  3. +0
    -2
      recipes/rc2014/sdcard/glue.asm
  4. +0
    -2
      tools/emul/shell/shell_.asm

+ 5
- 8
parts/z80/shell.asm View File

@@ -15,10 +15,9 @@

; *** REQUIREMENTS ***
; stdio
; blkdev

; *** DEFINES ***
; SHELL_IO_GETC: Macro that calls a GetC routine for I/O ("load" cmd)
; SHELL_IO_PUTC: Macro that calls a PutC routine for I/O ("save" cmd)
; SHELL_EXTRA_CMD_COUNT: Number of extra cmds to be expected after the regular
; ones. See comment in COMMANDS section for details.
; SHELL_RAMSTART
@@ -397,8 +396,7 @@ shellPeek:

; Load the specified number of bytes (max 0xff) from IO and write them in the
; current memory pointer (which doesn't change). This gets chars from
; SHELL_IO_GETC, which can be different from STDIO_GETC. Coupled with the
; "blockdev" part, this allows you to dynamically select your IO source.
; blkGetCW.
; Control is returned to the shell only after all bytes are read.
;
; Example: load 42
@@ -411,7 +409,7 @@ shellLoad:
ld a, (hl)
ld b, a
ld hl, (SHELL_MEM_PTR)
.loop: SHELL_IO_GETC
.loop: call blkGetCW
jr nz, .ioError
ld (hl), a
inc hl
@@ -428,8 +426,7 @@ shellLoad:

; Load the specified number of bytes (max 0xff) from the current memory pointer
; and write them to I/O. Memory pointer doesn't move. This puts chars to
; SHELL_IO_PUTC, which can be different from STDIO_PUTC. Coupled with the
; "blockdev" part, this allows you to dynamically select your IO source.
; blkPutC.
; Control is returned to the shell only after all bytes are written.
;
; Example: save 42
@@ -445,7 +442,7 @@ shellSave:
.loop:
ld a, (hl)
inc hl
SHELL_IO_PUTC
call blkPutC
djnz .loop

.end:


+ 0
- 2
recipes/rc2014/glue.asm View File

@@ -25,8 +25,6 @@ STDIO_RAMSTART .equ BLOCKDEV_RAMEND
#include "stdio.asm"

SHELL_RAMSTART .equ STDIO_RAMEND
.define SHELL_IO_GETC call aciaGetC
.define SHELL_IO_PUTC call aciaPutC
SHELL_EXTRA_CMD_COUNT .equ 0
#include "shell.asm"



+ 0
- 2
recipes/rc2014/sdcard/glue.asm View File

@@ -40,8 +40,6 @@ STDIO_RAMSTART .equ BLOCKDEV_RAMEND
#include "stdio.asm"

SHELL_RAMSTART .equ STDIO_RAMEND
.define SHELL_IO_GETC call blkGetCW
.define SHELL_IO_PUTC call blkPutC
SHELL_EXTRA_CMD_COUNT .equ 3
#include "shell.asm"
.dw sdcInitializeCmd, blkBselCmd, blkSeekCmd


+ 0
- 2
tools/emul/shell/shell_.asm View File

@@ -30,8 +30,6 @@ STDIO_RAMSTART .equ BLOCKDEV_RAMEND
#include "fs_cmds.asm"

SHELL_RAMSTART .equ FS_RAMEND
.define SHELL_IO_GETC call blkGetC
.define SHELL_IO_PUTC call blkPutC
SHELL_EXTRA_CMD_COUNT .equ 7
#include "shell.asm"
.dw blkBselCmd, blkSeekCmd, fsOnCmd, flsCmd, fnewCmd, fdelCmd, fopnCmd


Loading…
Cancel
Save