Re: A86: TextShadowing and other Questions


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

Re: A86: TextShadowing and other Questions




When writting a program or a game, you will no doubt need lots of temporary
variable storage.  This is used for things like scores, bullets, enemy
locations, player's location, etc.  To store these, you need some "scratch"
memory to use.  There are several places in ram that can be used:

_textShadow	; 168 bytes  -- stores the actual text on the homescreen
_cmdShadow	; 168 bytes  -- I *think* this is the APD buffer
_plotSScreen  ; 1024 bytes -- the "graph screen"...good for a double buffer
$8800-$b800	; 12289 bytes -- free space on RAM PAGE 1
$f600		; 1024(?) bytes -- free space after _asm_exec_ram

The ram at $f600 is good for a double buffer or grayscale.  I'm not sure
exactly how much you can use, but I know at least 1024 bytes is safe.  The
ram at $8800-$b800 is just temp space on ram page 1.  Thanks to Matthew
Shepcar for telling me about that.  You can use more than that, but it is
not recommended because you will overwrite the floating point stack...but
that would have to be an awfully big game to use more than 12k scratch space.

Second, to clear up this highscore/initial stuff.  When you want to save
things (highscores...), you need to set aside space in your program for
that.  You do this using the .db (declare byte) assembler directive:

Score8
 .db $00	; 8-bit score (0-255)
Score16:
 .db $00,$00 ; 16-bit score (0-65536)
Initials:
 .db "DAP"	; 3-bytes for initials

Once you have done this, the assembler will add these bytes to your
compiled program.  These must NOT be executed, or it will crash the calc.
When the program runs, the Asm( command copies the program from where ever
it is in ram to _asm_exec_ram and runs it.  When it is done, it is NOT
copied back.  This is known as write-back, or program-write-back.  You must
actually change the program itself at where ever it is in ram.  Email me if
you want the code to do it, I don't have it with me at the moment.  Look at
the ZTetris source code for an example on this.

BTW, please know what you are talking about before you reply.  It only
confuses people when you guess something because you don't know yourself.

At 11:31 AM 8/28/98 -0700, you wrote:
>
>I have seen _TextShadow in many games and i have heard lots of people talk
>about it... could someone please tell me what it is and does.  Also I know
>that this is a general question, but what are the disadvantages/advantages
>for not allowing interupts in a program: di.  Thanks
>************************************
>dave
>IRQ:16817590
>E-mail: scheltem@aaps.k12.mi.us
>TI86 Basic Programming Center
>http://www.geocities.com/TimesSquare/Ring/8708/
>
>-----Original Message-----
>From: JBrett <tbarwick@esn.net>
>To: ASM86 Mailing List <assembly-86@lists.ticalc.org>
>Date: Friday, August 28, 1998 4:14 AM
>Subject: Re: A86: Variables...
>
>
>>
>>I hope this will help:
>>Using _textshadow would be better.
>>You can use something like :
>>
>>score equ _textshadow+ (whatever number you want)
>>HiScoretemp equ _textshadow+ (another value)
>>Hiscore:
>>    .dw (whatever the preset hiscore is)
>>HiScrname:
>>    .db "GFX",0
>>--------------
>>Jbrett
>>tbarwick@esn.net
>>http://ww2.esn.net/~tbarwick
>>I just added a TI-86 page, Check it out!!!
>>-----Original Message-----
>>From: DieKenny97@aol.com <DieKenny97@aol.com>
>>To: assembly-86@lists.ticalc.org <assembly-86@lists.ticalc.org>
>>Date: Thursday, August 27, 1998 9:37 PM
>>Subject: Re: A86: Variables...
>>
>>
>>>
>>>In a message dated 98-08-27 21:19:11 EDT, you write:
>>>
>>><< In my program, I use this to store initials:
>>>
>>> HiInitials:
>>> .db $47,$46,$58
>>>
>>> (Initials: GFX)
>>>
>>> Then if you get a hi score, you input your initials with a routine i
>>wrote,
>>> and then it stores the new numbers into the  .db   thing.  When you go to
>>the
>>> high score thing it loads hl with the first intial, and displays all
>three
>>> correctly.  When I quit the program and run it again, the initials are
>>>changed
>>> back to GFX...   I know i didn't reset them each time it is run.
>>>
>>> Does anyone know why this would happen?
>>>
>>> The same thing happens with a high score, it is set, but when the program
>>is
>>> closed and opened again, it is set back to zero..
>>>  >>
>>>I think it always rests the hi score name because you have the HiNitial
>>rest
>>>bak to "GFX" all the time.  Try changing it to this and see if it works.
>>>
>>> HiInitials:
>>> .db $00
>>>
>>>I can't garuantee that will work but its worth a shot if you haven't tried
>>>that already.
>>>
>>>~Matt
>>>
>>
>>
>>
>

--
David Phillips
mailto:electrum@tfs.net
ICQ: 13811951
AOL/AIM: Electrum32


References: