Re: A83: Code again...


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

Re: A83: Code again...




Whoa,  I didn't realize using PGMIO_EXEC was like that.  Linus' message
confused me, no offense ;  )  This is a long message.

I use Jimmy Mardell's string input routine, ported to the 83 by Ahmed,
the GET_KEY equates are further below :

WaK:
	push	hl
	call	GET_KEY			; Getkey call, from
Ahmed
	cp	$38
	jr	z,BackSpace
	cp	$0F
	jr	z,NameDone
	cp	$21
	jr	nz,CheckLetter
	ld	a,32
	pop	hl
	jr	PutLetter
CheckLetter:
	ld	hl,Letters	; Compares key with table to find out
	push	bc		; which letter to display
	ld	bc,26
	cpir
	ld	d,c
	pop	bc
	pop	hl
	jr	nz,WaK
	ld	a,65
	add	a,d
PutLetter:
	ld	c,a
	ld	a,b
	cp	8		; 8 letter limit for my prog, set it
up to 16
	jr	z,WaK
	ld	(hl),c
	inc	hl
	inc	b
	ld	a,c
	call	_putc
	jr	WaK
BackSpace:
	pop	hl
	ld	a,b
	or	a
	jr	z,WaK
	dec	b
	dec	hl
	push	hl
	ld	(hl),32
	ld	hl,$800D
	dec	(hl)
	ld	a,32
	call	_putc
	dec	(hl)
	pop	hl
	jr	WaK
NameDone:
	pop	hl

Letters:
 .db $1A,$22,$2A,$0B,$13,$1B,$23,$2B,$0C,$14,$1C	;Table of letters
for input
 .db $24,$2C,$0D,$15,$1D,$25,$2D,$0E,$16,$1E,$26
 .db $2E,$1F,$27,$2F

Key Equates:

;
;  GET_KEY key .equates
;
GET_KEY  = $4014
;---------------
K_NONE   = $00
K_DOWN   = $01
K_LEFT   = $02
K_RIGHT  = $03
K_UP     = $04
K_ENTER  = $09
K_PLUS   = $0A
K_MINUS  = $0B
K_TIMES  = $0C
K_DIV    = $0D
K_CARROT = $0E
K_CLEAR  = $0F
K_NEG    = $11
K_3      = $12
K_6      = $13
K_9      = $14
K_PARENR = $15
K_TAN    = $16
K_VARS   = $17
K_PERIOD = $19
K_2      = $1A
K_5      = $1B
K_8      = $1C
K_PARENL = $1D
K_COS    = $1E
K_PRGM   = $1F
K_STAT   = $20
K_0      = $21
K_1      = $22
K_4      = $23
K_7      = $24
K_COMMA  = $25
K_SIN    = $26
K_MATRIX = $27
K_XTO    = $28
K_ON     = $29
K_STO    = $2A
K_LN     = $2B
K_LOG    = $2C
K_SQR    = $2D
K_INVE   = $2E
K_MATH   = $2F
K_ALPHA  = $30
K_GRAPH  = $31
K_TRACE  = $32
K_ZOOM   = $33
K_WINDOW = $34
K_YEDIT  = $35
K_2ND    = $36
K_SECOND = $36
K_MODE   = $37
K_DEL    = $38
;---------------
G_NONE   = $00
G_DOWN   = $01
G_LEFT   = $02
G_RIGHT  = $03
G_UP     = $04
G_ENTER  = $09
G_PLUS   = $0A
G_MINUS  = $0B
G_TIMES  = $0C
G_DIV    = $0D
G_CARROT = $0E
G_CLEAR  = $0F
G_NEG    = $11
G_3      = $12
G_6      = $13
G_9      = $14
G_PARENR = $15
G_TAN    = $16
G_VARS   = $17
G_PERIOD = $19
G_2      = $1A
G_5      = $1B
G_8      = $1C
G_PARENL = $1D
G_COS    = $1E
G_PRGM   = $1F
G_STAT   = $20
G_0      = $21
G_1      = $22
G_4      = $23
G_7      = $24
G_COMMA  = $25
G_SIN    = $26
G_MATRIX = $27
G_XTO    = $28
G_ON     = $29
G_STO    = $2A
G_LN     = $2B
G_LOG    = $2C
G_SQR    = $2D
G_INVE   = $2E
G_MATH   = $2F
G_ALPHA  = $30
G_GRAPH  = $31
G_TRACE  = $32
G_ZOOM   = $33
G_WINDOW = $34
G_YEDIT  = $35
G_2ND    = $36
G_SECOND = $36
G_MODE   = $37
G_DEL    = $38


On Fri, 14 Aug 1998 02:12:55 +0900 "James Matthews"
<matthews@tkb.att.ne.jp> writes:
>
>Ok guys...Harper helped me a lot...its a lot better, now, but still 
>isn't
>working!  Here's the updated version:
>
>.NOLIST
>#define equ .equ
>#define EQU .equ
>#define end .end
>#include "ti83asm.inc"
>#include "tokens.inc"
>.LIST
>
>PGMIO_EXEC         equ           50B2h
>_formDisp          equ           4D0Eh
>
>.org 9327h
>
>        call    _clrLCDFull
>        call    _homeup
>        ld      hl,ScoreText
>	call    _puts
>        call    _newline
>	ld      a,(highscore)
>	ld	l,a
>	ld      h,0
>	call	_dispHL		; Display high score
>        call    _newline
>
>        ld      de,821ch
>        ld      hl,prompt
>        ld      bc,16
>        ldir
>        ld      a,1
>        ld      (ASM_IND_CALL),a
>
>        call    PGMIO_EXEC
>
>	call    _convop1
>	ld      a,e
>	ld	(HighScore),a
>	ret
>	
>
>prompt:         .db "Points: ",0
>ScoreText:      .db "High Score: ",0
>HighScore:	.db 0	
>.end
>.end
>
>Thanks...
>
>James.
>____________________
>
>James Matthews.
>E-mail (family):    matthews@tkb.att.ne.jp
>E-mail (private):  james_matthews@hotmail.com
>
>Homepage:  http://home.att.ne.jp/gold/tomcat21/index.html
>ICQ:  7413754
>____________________________________
>

_____________________________________________________________________
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]


References: