Re: A83: Char Table
[Prev][Next][Index][Thread]
Re: A83: Char Table
This is for people who are are both 83 and 85 literate. See below
-----------------------------------------------------------------------------------------------------------------------
Mastermind--benjamin99@juno.com, www.bigfoot.com/~mastermind5
IRC: Master_M
ICQ: 11341114
-Its all about the Benjamins
On Sun, 12 Jul 1998 18:16:12 -0500 Ian Graf <ian_graf@geocities.com>
writes:
>
>this comes from the online usgard school by jimmy mardel (of sqrxz
>fame). this is for the ti-85, but can be ported (the most important
>thing would be to change the key codes).
>
>
> ; Input routine - made by Jimmy Mårdell 97-03-05
> ;
> ; Reads a sentence entered from the keyboard. Only uppercase
> ; letters and space are allowed. Left arrowkey = backspace.
> ;
> ; When calling, HL should point to where the string should
> ; be stored and A should hold the maximum length of the
> ; string. Be sure there are enough space (A+1) to store the
> ; nullterminated string at HL! ($800C) should hold the screen
> ; position where the string starts.
> ;
> ; This input routine will also have a flashing cursor. If you
> ; don't like it, remove all rows where the explanation starts
> ; with a *.
> ;
> ; IMPORTANT: The input must NOT wrap to a new row! Then it
> ; will not work properly. The last char on a row should not
> ; be used either (if cursorcol=0 when calling, the maximum char
> ; length is 20). If you have a cursor, the two last chars should
> ; not be used (max length 19 if the screen location starts to
> ; the far left).
> ;
> ; The routine requires one temporary variable, noLet.
>
> Input:
> push bc
> push de
> push hl
> set 2,(iy+12) ; * Turn cursor blinking on
What's the 83 equivelent of this flag
> ld (noLet),a ; Store the maximum lenght of the string
> ld e,0 ; E = numbers of letters written so far
> WaK:
> ld a,32
> ld ($800E),a ; * Set "character under cursor" to space
What's the 83 equivelent of this RAM area?
> push hl ; * Save HL since GET_KEY destroys HL
> call GET_KEY
The 83 equivelent is _GetKey right?
> cp $02 ; $02 = left key
> jr z,BackSpace
> cp $09 ; $09 = enter
> jr z,NameDone
> cp $11 ; $11 = space
> jr nz,CheckLetter
> ld a,32 ; Space is ascii char 32
> pop hl
> jr PutLetter ; Put the letter on screen and in memory
> CheckLetter:
> ld hl,&Letters ; HL -> letter table
> ld bc,26 ; 26 letters to check
> cpir ; Compare A with each letter until match
> ld d,c ; Then C = the letter. Store in D
> pop hl ; HL -> current position in string
> jr nz,WaK ; Wait until valid keystroke
> ld a,65 ; 65 = ascii char for A
> add a,d ; Now A=ASCII char for the letter pressed
> PutLetter:
> ld c,a
> ld a,(noLet) ; A = max letters
> cp e ; Check if max size is reached
> jr z,WaK ; If so, wait for a new key
> ld (hl),c ; If not, store the key entered
> inc hl ; Point to the next byte in the string
> inc e ; And increase the letter counter
> ld a,c
> call TX_CHARPUT ; Show the chars pressed on the screen
Is this _putc or _putmap?
> jr WaK ; And jump back and wait for a new key
> BackSpace:
> pop hl ; HL -> current position in string
> ld a,e
> or a ; Check if string size = 0
> jr z,WaK ; If so, backspace not allowed - repeat
> res 2,(iy+12) ; * Stopp cursor blinking
> dec e ; Decrease string size
> dec hl ; And string pointer
> push hl
> ld hl,$800D ; HL -> x cursor position
What's the 83 equivelent ram LOCATION?
> dec (hl) ; Decrease it
> ld a,32 ; Overwrite the last letter with a space
> call TX_CHARPUT ; Put the space over the chars
> call TX_CHARPUT ; * And over the blinking cursor
> dec (hl) ; * Decrease the x coordinate twice
> dec (hl)
> pop hl
> set 2,(iy+12) ; * Stopp cursor blinking
> jr WaK ; Wait for a key
> NameDone:
> pop hl ; HL -> current position in string
> ld (hl),0 ; Put a terminating zero at end of string
> res 2,(iy+12) ; * Stopp cursor blinking
> pop hl
> pop de
> pop bc
> ret
>
> ; The keycodes of the letters A-Z stored backways
>
> Letters:
> .db $19,$21,$0A,$12,$1A,$22,$0B,$13,$1B,$23,$2B
> .db $0C,$14,$1C,$24,$2C,$0D,$15,$1D,$25,$2D,$0E
> .db $16,$1E,$26,$2E
>
I change these to the 83 GetKey codes, right?
_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]
Follow-Ups:
References: