For smaller fonts, bitmaps are easier to design anyway.
They tend to be represented as "one, long bitmap" rather than a lot of little bitmaps.
Code: Select all
;*****************************************************************************
;Process commandline subroutine. *
;puts indices to individual arguments into memory location labled ARG_INDEX *
;*****************************************************************************
process_cmdln:; PHA
; PHX
; PHY
STZ CMDLN_ERROR ;clear command line error byte
STZ ARG_CNT ;reset argument count
LDX #$00 ;clear X register
LDY #$00 ;clear Y register
find_spaces: LDA COM1_RXBUF,X ;get current character
CMP #$00 ;is it a NULL?
BEQ cmdln_exit ;if its a NULL, we are at the end of the string. Return from subroutine
CMP #$20 ;is it a space?
BEQ add_arg ;if its a space, branch to add argument
INX ;increment to next character
JMP find_spaces ;keep looking
add_arg: STZ COM1_RXBUF,X ;convert SPACE into NULL.
INX ;increment character index. Will be at first char of argument now
STX ARG_INDEX,Y ;store index into string buffer to current argument
INY ;increment argument count index.
CPY #$04 ;check if we are above max number of arguments
BCS cmdln_err ;if too many args, error and rts
STY ARG_CNT ;store number of arguments.
JMP find_spaces ;go back to searching string for aruments
cmdln_err: LDA #$FF
STA CMDLN_ERROR ;put $FF in error flag byte
STZ ARG_CNT ;reset argument count
cmdln_exit:
;PLY
;PHX
;PHA
RTS Code: Select all
;PLY
;PHX
;PHA
RTSCode: Select all
...
add_arg: STZ COM1_RXBUF,X ;convert SPACE into NULL.
INX ;increment character index. Will be at first char of argument now
STX ARG_INDEX,Y ;store index into string buffer to current argument
INY ;increment argument count index.
CPY #$04 ;check if we are above max number of arguments
BCS cmdln_err ;if too many args, error and rts
STY ARG_CNT ;store number of arguments.
JMP find_spaces ;go back to searching string for aruments
...