Re: A86: saving high scores


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

Re: A86: saving high scores




i've uploaded a writeback routine in the asm source code section (not 
routines, but regular source.  they messed up).  it will copy a block of info 
into the original program code.

here's the code:

#include "ti86abs.inc"		;defines absolute addressing routines

save_data:
	ld hl,varname-1
	rst 20h				;copy to OP1
	rst 10h				;_findsym
	ld a,b
	ld hl,data_start-_asm_exec_ram+4		;offset
	add hl,de				;hl=pointer to data in 
original prog
	adc a,0				;in case we overlapped pages
	call _SET_ABS_DEST_ADDR
	xor a					;no absolute addressing now
	ld hl,data_start			;get data from here
	call _SET_ABS_SRC_ADDR
	ld hl,data_end-data_start	;number of bytes to save
	call _SET_MM_NUM_BYTES
	jp _mm_ldir			;copy data and return


store the varname like this:
varname:
	.db 7,"varname"			;7 letters, then each character


In a message dated 5/21/99 18:04:00 Eastern Daylight Time, McBorder@aol.com 
writes:

> is there a good high score routine out there.
>  
>  i need to save a byte from 
>  score = _textShadow
>  
>  to
>  
>  highscore:
>  	.db 0
>  i cant get anything to work