Re: A86: Good place for a highscore ?
[Prev][Next][Index][Thread]
Re: A86: Good place for a highscore ?
A good way to save highscores is using this routine by Jimmy Mardell just before your program exits. I hope this helps.
ld hl,ProgName
rst 20h
rst 10h
ex de,hl
ld a,b
ld de,HIGHSCORE-$D748+4
add hl,de
adc a,0
ld de,HIGHSCORE
ld b,2 ;load into b # of bytes HIGHSCORE is
RepCopy:
push af
push hl
call $46c3
ld a,(de)
ld (hl),a
pop hl
pop af
call $4637
inc de
djnz RepCopy
;GAME is case-sensitive name of program as recognized
;by calc, the 4 is amount of letters in name of
;program.
ProgName:
.db $12,4,"GAME"
HIGHSCORE:
.db 0,0
--
On Tue, 29 Dec 1998 13:14:25 Thomas Bladh wrote:
>
>I was wondering what would be the best place
>in memory for saving a highscore. I have it
>working at $F688 (8000 bytes into _asm_exec_ram)
>this seems to be a safe place as it will only be
>overwritten if a program larger than 8k is loaded. It is
>however far from ideal. One idea would be to create
>a string variable and store the data in it.
>
>What would be the best way of solving this problem ?
>
>/Thomas Bladh(tiberius@swipnet.se)
>
>
HotBot - Search smarter.
http://www.hotbot.com