Re: A85: Progamming in USGARD


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

Re: A85: Progamming in USGARD




On Wed, 9 Dec 1998, Scott Robinson wrote:
> Could someone please send me the source to a program that will 
> prompt the user to enter there name, then, it will say "hello 
> <name>"?? Thanks -- mateoz@home.com
> 
Nobody answered your question the 1st time and I'll tell you why.
Printing it trivial only because there is a ROM routine we use.
ex: 
  ld hl,HelloStr ;ld hl,&HelloStr (in USgard)
  call D_ZT_STR  ;a ROM call

HelloStr:
.db "Hello!",0

But, so far there is no ROM call for GetSting.  So the code is long and
boring, that's why no one answered.  But just a few days ago someone was
talking about making a Usgard clone that would include a standard
InputString routine.  But if you had to write one there are several ways
to do it.

1. Easy (just use the arrow keys to move characters up & down)
2. Actually interpret the keystrokes.. (big)

The routines already exist, so I don't want to sit and pound one out now,
instead I'll ask Usgard programmers to point you in the direction of the
routine.  In case they don't read this far, you can ask where to look.

Any ways, with the routine written the program would look like this:
  ld hl,&NameStr
  call D_ZT_STR
  ld hl,TEXT_MEM
  call &GetString
  call CLEARLCD
  ld hl,$0001			;might be $0100
  ld ($8C00),hl			;Cursor position(I think)
  ld hl,&HelloStr
  call D_ZT_STR
  ld hl,TEXT_MEM
  call D_ZT_STR
  ret

HelloStr:
.db "Hello ",0
NameStr:
.db "Name? ",0

This assumes that GetString adds a zero to the end.
Output:
Name? Bob 
Hello Bob

-Humberto Yeverino Jr.

"I kick ass for the Lord."
-Dead Alive (1992)

***********************************************************
Home Page:                                               
  http://www.engr.csufresno.edu/~humberto/Home.html      

Ti Page:                                                 
  http://www.engr.csufresno.edu/~humberto/tex.html       

z80 Source Page:                                         
  http://www.engr.csufresno.edu/~humberto/z80source.html 

Official Tyrant Home Page:                              
  http://www.engr.csufresno.edu/~humberto/tyrant.html    

E-mail:                                                  
  humberto@engr.csufresno.edu                            
***********************************************************


References: