CBM64 Bard's Tale 1 Disassembly
Darendor wrote:I've located the dungeon events jump table on the BTI boot disk.
It should be found in the file EA3.PRG, at addresses $132B through $1364:Now, there is some concern about adding loadable dungeon events to the dungeon disk due to having to extend this table, and doing so might corrupt the game data. However, consider the next three bytes beyond the table ($1365 to $1367):Code: Select all
1b 0c 0d 0e 0b 00 0f 10 1c 1d 1e 11 12 14 13 1f 20 21 22 23 24 25 15 26 27 28 29 2a 2b 2c 2d 2e 2f 16 18 17 30 31 32 33 34 19 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44
There is no NM1A.PRG, NM8D.PRG, or NM1B.PRG on the dungeon disk, meaning at least three more events can be safely put on the disk.Code: Select all
1A 8D 1B
Thoughts?
I've gone ahead and attempted a disassemble of the event NM31.PRG - the magic mouth in Kylearan's Tower that asks for the name of the endless byway in Skara Brae.
Note that [cr] means a carriage return and that the tilde represents the DC byte, meaning end of text string.
Now, this means that events requiring input from the user are self-contained. I am wondering what the bytes from $0F3 to the end of the file mean:
What's interesting about the text bit is that the code for > actually generates an input field.
Consider:
Code: Select all
NM1A.PRG - copied from NM31.PRG | Magic Mouth [SINISTER] in Ky Tower
$002: INC C1
$004: LDX 2D
$006: JSR $0803
$009: LDA BB
$00B: STA 59
$00D: LDA 5A
$00F: STA 58
$011: JSR $080C
$014: JSR $0806
$017: LDY BB
$019: LDX 63
$01B: JSR $0809
$01E: INC 1D
$020: JSR $081B
$023: BCS 2A
$025: LDX 07
$027: LDA $0334,X
$02A: CMP $BBD7,X
$02D: BNE $CA20
$030: BPL F5
$032: LDA 58
$034: STA 85
$036: SED
$037: JSR $0806
$03A: LDY BB
$03C: LDX DF
$03E: JSR $0809
$041: JSR $AE09
$044: LDY 29
$046: LDA $(6E),Y
$048: AND FB
$04A: STA $(6E),Y
$04C: JMP $AE03
$04F: JSR $0806
$052: LDY BB
$054: LDX E8
$056: JSR $0809
$059: JMP $AE03
$05C-$064 = text "Mouth...~" [Caption text]
$065-$0F2 = text "A magic mouth on the wall speaks to you, saying this:[cr]'Name the endless byway and your path shall be guaranteed:'[cr][cr]>SINISTERRight...~Wrong...~
$0F3-0100 = unknown bytes
Now, this means that events requiring input from the user are self-contained. I am wondering what the bytes from $0F3 to the end of the file mean:
Code: Select all
BA FF A0 FC DE BF 00 00 00 01 20 E1 F6 E5
What's interesting about the text bit is that the code for > actually generates an input field.
Consider:
- Quantum Reality
- Posts: 91
- Joined: Mon Mar 15, 2010 8:34 pm
Thats bull. The ">" only shows a ">". The engine routineDarendor wrote:What's interesting about the text bit is that the code
for > actually generates an input field.
at 081b handles all the input including prompting. This
could easily have been read in the post marked as
ITEM02 in this thread. Your posted code fragment shows
this call clearly:
$020: JSR $081B
I T E M # 13
Last update: 2010-04-30
Making own events....
Since the item came up to me several times now, I here explain
in short again, how you can make events.
First: it is in no way necessary to manipulate the offset table for
the generation of file names for events. Just reuse the existing
filenames, as given in the filelist, for your own events. You can
even create a lot more events than the original BT1 is using on
the C64.
On the C64, events can use up to 5 mem blocks (1280 bytes).
They are loaded by the engine to $bb00. If you have small events
with not too much text, you can pack two or more into one file.
You can then reference the same file (i. e. give the same offset
into the table to generate filenames) more than once. You can
do that even twice for the same level.
In your own event, you can check this variables to decide, which
part of your event machine code you want to execute:
$e0 the level number you are in, 0 to f (=NMA0 to NMAF)
$28 the party's present NORTH coordinate in the level
$29 the party's present EAST coordinate in the level
Thus you can determine, where you are and hence which of the
two (or more) events within one file you want to call.
This refers to dungeon events.
I hope this clears things up.
Last update: 2010-04-30
Making own events....
Since the item came up to me several times now, I here explain
in short again, how you can make events.
First: it is in no way necessary to manipulate the offset table for
the generation of file names for events. Just reuse the existing
filenames, as given in the filelist, for your own events. You can
even create a lot more events than the original BT1 is using on
the C64.
On the C64, events can use up to 5 mem blocks (1280 bytes).
They are loaded by the engine to $bb00. If you have small events
with not too much text, you can pack two or more into one file.
You can then reference the same file (i. e. give the same offset
into the table to generate filenames) more than once. You can
do that even twice for the same level.
In your own event, you can check this variables to decide, which
part of your event machine code you want to execute:
$e0 the level number you are in, 0 to f (=NMA0 to NMAF)
$28 the party's present NORTH coordinate in the level
$29 the party's present EAST coordinate in the level
Thus you can determine, where you are and hence which of the
two (or more) events within one file you want to call.
This refers to dungeon events.
I hope this clears things up.
Re: CBM64 Bard's Tale 1 Disassembly
Updates...
The preamble post now contains links and update dates to all major items.
The preamble post now contains links and update dates to all major items.