reset fshcmd in input

also made SET use the args instead of just reading them
This commit is contained in:
Stephen Toth 2018-06-23 22:39:39 -04:00
parent caf65684c3
commit 2546f299d3
4 changed files with 61 additions and 25 deletions

View File

@ -9,17 +9,19 @@ Setup:
CALL _homeup ;Put up home CALL _homeup ;Put up home
CALL _ClrLCDFull ;Clear screen CALL _ClrLCDFull ;Clear screen
LD HL, $FF LD HL, $00
CALL fshvarfill CALL fshvarfill
Input: Input:
LD HL, $00 ; fill fshcmd with $00
CALL fshcmdfill
XOR A XOR A
LD (CurCol), A LD (CurCol), A
LD HL, PS1 LD HL, PS1
CALL _PutS CALL _PutS
;TODO: reset CmdFsh mem
LD HL, FshCmd LD HL, FshCmd
LD DE, 0 LD DE, 0
LD DE, FshCmdInptSize LD DE, FshCmdInptSize

Binary file not shown.

View File

@ -70,4 +70,34 @@ fshcmdroute:
jp Fin jp Fin
; fshcmdfill
;; fills fshvars with word
;; Inputs:
;; HL: 16b
fshcmdfill:
push hl
push de
ld d, h
ld e, l
ld hl, FshCmdArg0
ld (hl), e
inc hl
ld (hl), d
inc hl
ld (hl), e
inc hl
ld (hl), d
inc hl
ld (hl), e
inc hl
ld (hl), d
inc hl
ld (hl), e
inc hl
ld (hl), d
pop de
pop hl
ret
#include "includes/commands.inc" #include "includes/commands.inc"

View File

@ -23,34 +23,38 @@ fshcmdSETfArg0Get:
ld de, 3 ld de, 3
call inputnumstr call inputnumstr
call strtob call strtob
ld de, 0 ld hl, FshCmdArg0
ld e, a ld (hl), a
call _NewLine
fshcmdSETfArg1: fshcmdSETfArg1:
push de ld hl, FshCmdArg1
ld hl, FshCmdArg1 ld de, 0
ld e, (hl) ld e, (hl)
inc hl inc hl
ld d, (hl) ld d, (hl)
ex de, hl ex de, hl
ld de, 0 ld de, 0
call cpHLDE call cpHLDE
pop de
jr nz, fshcmdSETfExe jr nz, fshcmdSETfExe
fshcmdSETfArg1Get: fshcmdSETfArg1Get:
push de xor a
call _NewLine ld (CurCol), a
xor a ld hl, fshcmdSETfDValue
ld (CurCol), a call _PutS
ld hl, fshcmdSETfDValue ld hl, fshcmdSETfInputBuffer
call _PutS ld de, 3
ld hl, fshcmdSETfInputBuffer call inputnumstr
ld de, 3 call strtob
call inputnumstr ld hl, FshCmdArg1
call strtob ld (hl), a
pop de
fshcmdSETfExe: fshcmdSETfExe:
ld hl, FshCmdArg0
ld de, 0
ld e, (hl)
ld hl, FshCmdArg1
ld b, (hl)
ld hl, 0 ld hl, 0
ld l, a ld l, b
call fshvarset call fshvarset
call _NewLine call _NewLine
jp Fin jp Fin