Re: A85: permanent varibles
[Prev][Next][Index][Thread]
Re: A85: permanent varibles
this isn't too difficult. ok here is the code you need:
have a label in your game somewhere like this:
Score:
.dw 0 ;score is up to 64K
If bc has the score you want to load, do this:
ld hl,Score
ld de,(PROGRAM_ADDR)
add hl,de
ld (hl),bc ;score now in permanent memory
also somewhere in the program, you need to set a flag telling ZShell
that you modified the string (at the Score data location). you can do
this at the very beginning if you want. i hope it is correct, i don't
have the ZS header file on my computer, so take a look in there.
ld hl,,ZS_BITS ;set zshell flags
set 0,(hl) ;program has been modified
that's it!
-mike pearce
On Tue, 14 Apr 1998 21:01:20 -0500, you wrote:
>
>Ok, lets say that I have a score in (score) memory variable. How would I
>go about storing it as a permanent variable in the memory (for a
>hi-score). Could who ever answers this please be as completeas possible.
> Thanks. I have asked this multiple times and each time I get just a
>piece to the puzzle instead of all the pieces. This would be for
>Z-Shell, not Rigel or Usgard. Thank you very much.
>
> - Mike
>
References: