added Print.asm

added printprompt
cleaned up command code
This commit is contained in:
Stephen Toth 2018-06-28 18:21:16 -04:00
parent abfde4f5bb
commit 9aed40be6f
6 changed files with 22 additions and 30 deletions

View File

@ -15,10 +15,8 @@ Input:
LD C, $00
CALL fshcmdfill
XOR A
LD (CurCol), A
LD HL, PS1
CALL _PutS
CALL printprompt
LD HL, FshCmd
LD DE, FshCmdInptSize
@ -59,6 +57,7 @@ FshFlags: .DB %00000000
#include "includes/Byte.asm"
#include "includes/Char.asm"
#include "includes/Cursor.asm"
#include "includes/Print.asm"
#include "includes/FshCmd.asm"
#include "includes/Err.asm"

View File

@ -13,12 +13,8 @@ fshcmdCOPYfArg0:
call cpHLDE
jr nz, fshcmdCOPYfArg1
fshcmdCOPYfArg0Get:
ld a, 'G'
call _PutC
xor a
ld (CurCol), a
ld hl, fshcmdCOPYfDSource
call _PutS
call printprompt
ld hl, fshcmdCOPYfInputBuffer
ld de, 3
call inputnumstr
@ -37,10 +33,8 @@ fshcmdCOPYfArg1:
call cpHLDE
jr nz, fshcmdCOPYfExe
fshcmdCOPYfArg1Get:
xor a
ld (CurCol), a
ld hl, fshcmdCOPYfDDestination
call _PutS
call printprompt
ld hl, fshcmdCOPYfInputBuffer
ld de, 3
call inputnumstr
@ -62,6 +56,6 @@ fshcmdCOPYfExe:
call _NewLine
jp ErrCatch
fshcmdCOPYfInputBuffer: .db $00, $00, $00, $00, $00, $00
fshcmdCOPYfInputBuffer: .db $00, $00, $00, $00
fshcmdCOPYfDSource: .db "Source= ", 0
fshcmdCOPYfDDestination: .db "Destination= ", 0

View File

@ -13,12 +13,8 @@ fshcmdMOVEfArg0:
call cpHLDE
jr nz, fshcmdMOVEfArg1
fshcmdMOVEfArg0Get:
ld a, 'G'
call _PutC
xor a
ld (CurCol), a
ld hl, fshcmdMOVEfDSource
call _PutS
call printprompt
ld hl, fshcmdMOVEfInputBuffer
ld de, 3
call inputnumstr
@ -37,10 +33,8 @@ fshcmdMOVEfArg1:
call cpHLDE
jr nz, fshcmdMOVEfExe
fshcmdMOVEfArg1Get:
xor a
ld (CurCol), a
ld hl, fshcmdMOVEfDDestination
call _PutS
call printprompt
ld hl, fshcmdMOVEfInputBuffer
ld de, 3
call inputnumstr

View File

@ -13,12 +13,8 @@ fshcmdSETfArg0:
call cpHLDE
jr nz, fshcmdSETfArg1
fshcmdSETfArg0Get:
ld a, 'G'
call _PutC
xor a
ld (CurCol), a
ld hl, fshcmdSETfDIndex
call _PutS
call printprompt
ld hl, fshcmdSETfInputBuffer
ld de, 3
call inputnumstr
@ -37,10 +33,8 @@ fshcmdSETfArg1:
call cpHLDE
jr nz, fshcmdSETfExe
fshcmdSETfArg1Get:
xor a
ld (CurCol), a
ld hl, fshcmdSETfDValue
call _PutS
call printprompt
ld hl, fshcmdSETfInputBuffer
ld de, 5
call inputnumstr

View File

@ -23,11 +23,11 @@ fshcmdVARSfLoop:
pop bc
pop hl
ld c, 0
jr fshcmdVARSfLoopBack
jr fshcmdVARSfLoopEnd
fshcmdVARSfLoopU:
ld a, '_'
call _PutC
fshcmdVARSfLoopBack:
fshcmdVARSfLoopEnd:
inc b
inc de
ld a, b

11
includes/Print.asm Normal file
View File

@ -0,0 +1,11 @@
;;printprompt
;;Sets curcol to 0 and prints prompt
;;Inputs:
;; HL: Prompt String Location
printprompt:
push hl
xor a
ld (CurCol), a
call _PutS
pop hl
ret