Re: A86: User Input


[Prev][Next][Index][Thread]

Re: A86: User Input






>
>
>
>
>>
>>
>>
>>>Date: Sun, 13 Sep 1998 14:14:04 -0700
>>>To: assembly-86@lists.ticalc.org
>>>From: Chicane <chicane@reninet.com>
>>>Subject: A86: User Input
>>>Reply-To: assembly-86@lists.ticalc.org
>>>
>>>
>>>I need a way to get 8 chars of Input for a variable name. There must be
>>>something on ROM page 3, but i cant find it. The PRGM>Edit section on
>>the
>>>calc has one, i need something just like that.
>>>Thanks for any help.
>>>CHICANE
>>>ICQ: #14727618
>>>chicane on EFNET #ti
>>>Homepage: Under Construction.
>>>
>>
>>Use the normal input. Then load OP1 in hl. Call _strlength or whatever
>>and if it is greater then 8 have it go back to your input.
>>Can I have your source to MSE? Just asking =P
>
>That won't work.  They are two different kinds of strings.  The real
problem
>lies in converting the string so it can be made into a variable name.  I
>posted a routine that did this about two months ago, if you want to go back
>and look for it.
>

Here's the routine I used in Z-Blitz.  It has some things specific to the
game & has $1f as an invalid character attached to the front of every
string.  You should at least be able to get the idea, though.

 call CloseGray
 call _clrScrn
 call _homeup
 ld de,_ioPrompt
 ld hl,prompt
 call _mov10B    ;move to prompt buffer
 call _mov10B
 ld hl,(_CLEANTMP)
 push hl     ;save _cleantmp
 ld hl,(_PTempCnt)
 ld (_CLEANTMP),hl
 ld a,$0c     ;value for input str
 ld (_ASAP_IND),a
 call _exec_pg3    ;input the string
 pop hl
 ld (_CLEANTMP),hl   ;put _cleantmp back
 ld a,(iy+$2f)
 ld (h_flags),a
 rst 10h     ;find string in new variable
 ld a,b     ;ld ahl,bde
 ld h,d
 ld l,e
 call _GETB_AHL    ;get the length byte
 inc a
 ld (_OP1+1),a    ;put it into _op1
 ld a,$1f
 ld (_OP1+2),a
 ld a,b     ;get abs addr again
 ex de,hl
 call $4c3f     ;inc ahl by two
 call _SET_ABS_SRC_ADDR   ;move from ahl
 sub a
 ld hl,_OP1+3
 call _ABS_MOV10B_SET_D
 call _RAM_PAGE_1
 ld hl,(h_stack_ptr)
 ld de,board
 and a
 sbc hl,de
 push hl
 call _CREATESTRNG
 ld a,b     ;ld ahl,bde
 ex de,hl
 call $4c3f     ;inc ahl by two
 call _SET_ABS_DEST_ADDR
 pop hl     ;string size
 sub a
 call _SET_MM_NUM_BYTES
 ld a,1
 ld hl,$3000    ;string source
 call _SET_ABS_SRC_ADDR
 call _mm_ldir
 call _RAM_PAGE_1
 jp start