mirror of
https://github.com/bobbimanners/Zapple-II.git
synced 2024-05-31 14:41:31 +00:00
CCP accepts upper or lower case input
This commit is contained in:
parent
f2270d2049
commit
a6db61fd0f
|
@ -1888,15 +1888,12 @@ N2H2 OR 0F0H ;
|
||||||
; - FILENAME.COM - Load and run FILENAME.COM at 0100H
|
; - FILENAME.COM - Load and run FILENAME.COM at 0100H
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
; TODO: Only A: drive seems to work properly for now
|
|
||||||
; TODO: Upper-case all characters from console!!
|
; TODO: Upper-case all characters from console!!
|
||||||
; TODO: Implement the built-in commands using a table
|
; TODO: Implement the built-in commands using a table
|
||||||
; TODO: Built-in commands argument handling
|
; TODO: Built-in commands argument handling
|
||||||
; TODO: Parse * wildcard and generate FCB with ?s
|
; TODO: Parse * wildcard and generate FCB with ?s
|
||||||
; TODO: Command tail -> 080F buffer
|
; TODO: Command tail -> 080F buffer
|
||||||
; TODO: Build default FCB1 and 2 from args, if present
|
; TODO: Build default FCB1 and 2 from args, if present
|
||||||
; TODO: Improve .COM loading (allow drive to be specified)
|
|
||||||
; TODO: Right now programs do not load from drives other than A:
|
|
||||||
|
|
||||||
; Get a line of text from the console & handle it
|
; Get a line of text from the console & handle it
|
||||||
CCP
|
CCP
|
||||||
|
@ -1912,6 +1909,10 @@ CCPL1 LD A,(CURDRV) ; Get current drive & user number
|
||||||
LD A,120 ; Max line length
|
LD A,120 ; Max line length
|
||||||
LD (DE),A ; Stored in first char of buffer
|
LD (DE),A ; Stored in first char of buffer
|
||||||
CALL C_READSTR ; Get a line from the user
|
CALL C_READSTR ; Get a line from the user
|
||||||
|
LD H,D ; DE->HL
|
||||||
|
LD L,E ; ...
|
||||||
|
INC HL ; Skip over capacity byte
|
||||||
|
CALL UCASE ; Convert buffer to uppercase
|
||||||
|
|
||||||
LD A,(FILEBUF+1) ; Number of chars entered
|
LD A,(FILEBUF+1) ; Number of chars entered
|
||||||
CP 0 ; If none ...
|
CP 0 ; If none ...
|
||||||
|
@ -1987,6 +1988,23 @@ CCPS4
|
||||||
|
|
||||||
JP CCP ; Go again
|
JP CCP ; Go again
|
||||||
|
|
||||||
|
; Convert input buffer to uppercase
|
||||||
|
; HL points to Pascal-style string (length byte first)
|
||||||
|
UCASE LD C,(HL) ; Length of string
|
||||||
|
UCL1 LD A,C ; See if any chars are left
|
||||||
|
CP 0 ; ...
|
||||||
|
RET Z ; If 0, we are done
|
||||||
|
INC HL ; Advance to next char
|
||||||
|
DEC C ; Decrement count remaining
|
||||||
|
LD A,(HL) ; Get char from buffer
|
||||||
|
CP 'z' ; Compare with ASCII 'z'
|
||||||
|
JP NC,UCS1 ; If >'z' nothing to do
|
||||||
|
CP 'a'-1 ; Compare with char before ASCII 'a'
|
||||||
|
JP C,UCS1 ; If <='a'-1 then nothing to do
|
||||||
|
SUB 'a'-'A' ; Convert to upper case
|
||||||
|
UCS1 LD (HL),A ; Put converted char back
|
||||||
|
JP UCL1 ; Loop
|
||||||
|
|
||||||
; Load and run a .COM file to 0100H
|
; Load and run a .COM file to 0100H
|
||||||
; DE is the address of the FCB describing the file to run
|
; DE is the address of the FCB describing the file to run
|
||||||
RUNCOM CALL F_OPEN ;
|
RUNCOM CALL F_OPEN ;
|
||||||
|
|
Binary file not shown.
BIN
zapple2.po
BIN
zapple2.po
Binary file not shown.
Loading…
Reference in New Issue
Block a user