Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bard's Tale character disk format

403 views
Skip to first unread message

option8

unread,
Jun 20, 2013, 4:01:42 PM6/20/13
to
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.

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

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.


If you have any insights, I would appreciate it.


--charles.

Michael J. Mahon

unread,
Jun 20, 2013, 4:13:02 PM6/20/13
to
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.

-michael - NadaNet 3.1 and AppleCrate II: http://home.comcast.net/~mjmahon

D Finnigan

unread,
Jun 20, 2013, 7:44:15 PM6/20/13
to
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/

option8

unread,
Jun 21, 2013, 10:41:32 AM6/21/13
to

> > Actually, "high-ASCII" is quite common on Apple II machines. Most file
>
> > display programs will display both low-ASCII and high-ASCII.


Ah. "high" or "extended" ASCII. I see.

I knew somebody would have the answer.

option8

unread,
Jun 21, 2013, 11:29:15 AM6/21/13
to

> Ah. "high" or "extended" ASCII. I see.

er... any tips on how to display the "high" ascii
"ÂÒÉÁΠÔÈÅ ÆÉÓÔ"
as
"BRIAN THE FIST"?

D Finnigan

unread,
Jun 21, 2013, 12:34:29 PM6/21/13
to
ORA #$7F

Or subtract $80

D Finnigan

unread,
Jun 21, 2013, 12:37:53 PM6/21/13
to
Whoops! That should be AND #$7F to force the high bit off.



option8

unread,
Jun 21, 2013, 2:58:32 PM6/21/13
to
sorry. i should have explained - i'm not trying to display the text on an Apple II, but on my Mac for the presentation :)

Payton Byrd

unread,
Jun 21, 2013, 3:03:23 PM6/21/13
to
On Friday, June 21, 2013 1:58:32 PM UTC-5, option8 wrote:
> sorry. i should have explained - i'm not trying to display the text on an Apple II, but on my Mac for the presentation :)

I'm assuming you're writing a program to do this? If so, the technique above should still work? What language are you using?

option8

unread,
Jun 21, 2013, 7:34:58 PM6/21/13
to

> I'm assuming you're writing a program to do this? If so, the technique above should still work? What language are you using?


i was actually hoping for a command-line switch for hexdump or od that could do it, or a recommendation for a hex editing application with that functionality. otherwise, i may need to hack together a bash script. bleargh.

Daniel Kruszyna

unread,
Jun 22, 2013, 10:19:07 PM6/22/13
to
tr '\200-\377' '\000-\177'

-- Daniel

option8

unread,
Jun 23, 2013, 3:40:35 PM6/23/13
to
Daniel - I'll see what I can get working with tr.

I did manage to write an extremely ugly bash script and get the contents in a readable form. There's a lot more in the file than I anticipated. My kfest presentation is coming together pretty quickly now.

Sheppy

unread,
Jun 26, 2013, 3:10:45 PM6/26/13
to
On 2013-06-20 20:01:42 +0000, option8 said:

> 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.


Oh, I look forward to this. I did a lot of this kind of thing back in
high school. I once wrote a neat BASIC program to convert characters
between BT I, BT II, Ultima III, and Ultima IV. Lost the program years
ago, of course, but it was a lot of fun to hack in and figure all that
out. :)

--

Eric Shepherd (Sheppy)
http://www.sheppyware.net

0 new messages