Michael J. Mahon wrote:
> option8 <
opt...@gmail.com> wrote:
>> Hello all.
>>
>> Next month at Kansas Fest, I'll be presenting a quick session on simple
>> methods for hacking saved game files, using "The Bard's Tale" character
>> disk as my example.
>>
>> In my digging, I've already found the locations of some of the
>> characters' attributes - experience points, gold, HP, etc - but it
>> puzzled me why I couldn't find/change their names or any useful strings
>> in the disk image.
>>
...
>>
>> Is this something the author would have done to make the data less
>> human-readable, or is it just stored in some format I don't grasp? Other
>> attributes are stored strangely as well. For instance, a character's with
>> 123 gold pieces is stored in a string of bytes, one per digit, thus:
>> 01 02 03
>>
>> instead of just 0x7B as I would have expected.
That's probably a funny way to do BCD math.
>> Finally, I isolated where the character's name is stored in the hex dump.
>> I had been looking for something like this (for a character named
>> "BRIAN"):
>> 42 52 49 41 4E
>>
>> but found this instead:
>> C2 D2 C9 C1 CE
>>
>> The string is there, only the ASCII values are offset by 0x80
>
> Actually, "high-ASCII" is quite common on Apple II machines. Most file
> display programs will display both low-ASCII and high-ASCII.
>
> The ROM console output routine, COUT, expects high-ASCII, IIRC.
Right. "Offset by $80" actually means the high-bit is set. The standard
procedure for sending text to COUT is to do a ORA #$80 then JSR $FDED
(unless you know that the high-bit is already set).
--
]DF$
Apple II Book:
http://macgui.com/newa2guide/
Usenet:
http://macgui.com/usenet/ <-- get posts by email!
Apple II Web & Blog hosting:
http://a2hq.com/