8-Bit BTCS - Mangar's Special Event disassembled

Any developer realated stuff
User avatar
ZeroZero
Posts: 286
Joined: Tue Mar 10, 2009 9:10 pm
Location: Germany

Post by ZeroZero »

Excellent work, Twoflower. A complete monster list (for DOS version) is available, but it is, afaik, identical to the C64 version. As well an item list, so you can equip your char with whatever item you like.

See here:
http://www.cheek.org/bard/monsters.htm

Also, I suspect the monster gfx to be in files NM50 +. Not every monster has an own gfx, many have the same, like all levels conjurers and magicians, dragons etc.

Twoflower, pm me a messenger addy (ICQ, Skype or MSN) so we can get in touch. Many of the things you showed here are known from the dungeon layout and it seems that BT is following some basic rules. If we find them we have less work. E.g. whereever text is, it is preceeeded by an offset table, however that seems to be of absolute memory addresses, so to find relative offsets, just substract the first address from every member of the offset table.

Btw, the dungeon layout is now decoded completely, including the last byte. Using the dungeon viewer I programmed in VB6 (yes, but it is fast for drafts) I could see that EVERY stairs in first levels at 0,0 have the flag for what we thought means "stairs up". In fact that flag means "stairs to previous level", and its direction is given by the one missing byte. Portals, however, always have absolute meaning of "up/down".

Anyway I can send you the complete dungeon file mem map and a copy of my dungeon viewer in VB, reading from D64 files, via a messenger.
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Twoflower, pm me a messenger addy (ICQ, Skype or MSN) so we can get in touch. Many of the things you showed here are known from the dungeon layout and it seems that BT is following some basic rules. If we find them we have less work. E.g. whereever text is, it is preceeeded by an offset table, however that seems to be of absolute memory addresses, so to find relative offsets, just substract the first address from every member of the offset table.
In the dungeons we have the offset with that whole 20 FD bit...is this what you mean?
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

If you notice at the very end of NM44 each of the 7 character conditions is listed, seperated by FF - Old , Nuts, Para, Psnd, Dead etc...

I think beyond this might be the table offsets ZeroZero is talking about, or maybe immediately before.
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

ZeroZero has deduced that $0806 is the "clear text window" routine.
User avatar
Twoflower
Posts: 128
Joined: Thu Mar 19, 2009 12:40 am
Location: Haarlem, NL
Contact:

Post by Twoflower »

The Mangar-event was really a good example to take. I just took a quick peek at it, and I will try to comment the source, row by row, to explain what it does. Until then, this is a short list of some of the $0800 routines used in the special event:

Code: Select all

0803		LDX#$(picturenumber 00-24, 2A-2F), JSR $0803 loads it.
0806		Clear text window.
0809		Plot text, based on location given in accumulators X+Y.
080C		Store in textbox (f.ex "Kylearan").
080F		Wait for keypress.
0893		Loads monsterevent based on A) 03B0-03B7 (type) B) 03B8-03BF (amount).
Using a cartridge, freezing and starting the Mangar file from $BB61 instead of $BB00 will bring you directly to Kylearan, who rewards you with the mentioned heaps of experience points. I'll try to analyze how the XP are distributed out tomorrow.
Is there any other special event which rewards you with XP?
/Twoflower
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Twoflower wrote:The Mangar-event was really a good example to take. I just took a quick peek at it, and I will try to comment the source, row by row, to explain what it does. Until then, this is a short list of some of the $0800 routines used in the special event:

Code: Select all

0803		LDX#$(picturenumber 00-24, 2A-2F), JSR $0803 loads it.
0806		Clear text window.
0809		Plot text, based on location given in accumulators X+Y.
080C		Store in textbox (f.ex "Kylearan").
080F		Wait for keypress.
0893		Loads monsterevent based on A) 03B0-03B7 (type) B) 03B8-03BF (amount).
Using a cartridge, freezing and starting the Mangar file from $BB61 instead of $BB00 will bring you directly to Kylearan, who rewards you with the mentioned heaps of experience points. I'll try to analyze how the XP are distributed out tomorrow.
Is there any other special event which rewards you with XP?
There are no other events that award experience, unless you count the preset battles (69 Wights, for instance).
User avatar
ZeroZero
Posts: 286
Joined: Tue Mar 10, 2009 9:10 pm
Location: Germany

Events

Post by ZeroZero »

I also started to decode the events (and got help from someone we all admire), however there still remain unknown parts... Her are my results:

NM1F 99,9% (just I dunno which address stores N and which stores E coordinate of $fc13 and $fc14, but a simple test could clear this)
NM20 99%, unknown are the vars at $c1, $f5 and $3a
NM21 99%, unkown vars: $1d, $c8 and $46

Apart from that these events are fully decoded.

Code: Select all

JSR 0803 4c 2a 0d JMP $0d2a	x		Load a gfx file, NM50 + x, 00 <= x <= 40
JSR 0806 4c fc 1e JMP $1efc	-		Clear text window
JSR 0809 4c c9 0a JMP $0ac9	y, x		Low, High byte of text in file, output text in text window
JSR 080c 4c 81 0b JMP $0b81	$59, $58	output text, stored in $58, $59, into caption below gfx
JSR 080f 4c 59 19 JMP $1959	-		wait for key pressed
JSR 083f 4c cc 19 JMP $19cc	-		get the key pressed, load into A
JSR 084b 4c 44 10 JMP $1044			update values of the party on screen
JSR 0857 4c 7e 1a JMP $1a7e	a		Pause, wait, value in a
JSR 0893 4c c2 49 JMP $49c2			start and manage fight, give rewards out
JSR 089c 4c 5f 55 JMP $555f	$44, $45	cause ($45) HP damage to char in slot ($44)
JMP ae03					return to main program
JSR ae09					repaint the gfx window with the dungeon/city view
JMP ae0c					return to main with new N and E coordinate
JSR ae0f			a		move the party one space into the direction in a
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

You guys are the smart.
Post Reply