A85: **BAD CHECKSUM** WTF did I do?


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

A85: **BAD CHECKSUM** WTF did I do?




I have a really weird problem.  I have three SAVE slots on this game I'm
working on... One for each of three characters: Tifa, Cloud, And Cid. ;-) They
are each stored like this at the end of my program:

CidSAVE:
.db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0  ;88 bytes o' data for Cid
.db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

CloudSAVE:
.db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0  ;88 bytes o' data for Cloud
.db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

TifaSAVE:
.db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0  ;88 bytes o' data for Tifa
.db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0


I was under the distinct impression that One could overwrite these areas of
memory by saving over them in a program, since they are in truth nothing more
than a reserved part of memory.  If indeed this is the case, I am wondering
WHY on EARTH I get an error when I try to initialize it via this routine.
Sure, the program finishes, no crashes, BUT I get a bad checksum, leading me
to believe I've done something HORRIBLY wrong. :-)  I'm SURE it's this part of
the program, too, because I've painstakingly gone through and put "ret" after
some lines JUST to see where the error arose.  Here's the initialization
routine:

InitSAVE:
<<LD HL with address of save to initialize, I'm SURE this is done correctly.>>
	LD B, 87
	LD A, 0
LoopErase:
	LD (HL), A
	INC HL
	djnz LoopErase
	Continue with program... not a called routine...


Follow-Ups: