Page 3 of 4
Posted: Tue Apr 03, 2012 5:36 am
by drifting
Okay. I believe I've found the problem. The saving throw check code uses the melee ndice attribute of the first monster group the party is facing. That offset from the base of the monster group data is $1D.
This section of code takes the dungeon difficulty level, multiplies by 16, adds 7 and stores it at ($67) + $1D. aka the melee ndice attribute.
Code: Select all
a284:0086:1 a5 42 lda $42 ; This is the current dungeon difficulty level
a286:0088:1 0a asl a ; * 16
a287:0089:1 0a asl a
a288:008a:1 0a asl a
a289:008b:1 0a asl a
a28a:008c:1 18 clc
a28b:008d:1 69 07 adc #$07 ; + 7
a28d:008f:1 48 pha
This calculates the saving throw value which is ((16 * level_difficulty) + 7). At this point, $67-68 has the correct address for the first monster group $B700.
Code: Select all
a28e:0090:1 ad 55 a4 lda $a455
a291:0093:1 85 67 sta $67
a293:0095:1 ad 56 a4 lda $a456
a296:0098:1 85 68 sta $68
Now $67-68 has been overwritten by the incorrect value $B300.
Code: Select all
a298:009a:1 a0 1d ldy #$1d
a29a:009c:1 68 pla
a29b:009d:1 91 67 sta ($67),y ; Stored at ($67) + $1D
The trap saving throw data has now been written to the wrong memory location. The melee ndice parameter of the first monster group of the last battle is now used as the saving throw value. To give an idea of the difference, the Zen Master's ndice parameter is 14. The lowest dungeon level (1) has a saving throw value of 23.
Posted: Tue Apr 03, 2012 5:59 am
by Darendor
Is this easily fixed?
Posted: Tue Apr 03, 2012 7:29 am
by drifting
I think so. I've found the spot in the Apple disk images that has $B300. It's easy to change it to $B700. I need to create a low level party to test it out.
Posted: Tue Apr 03, 2012 5:13 pm
by ZeroZero
Excellent job so far, drifting!
Posted: Wed Apr 04, 2012 6:07 am
by drifting
https://github.com/downloads/ChrisAubuc ... 2-dun1.dsk
https://github.com/downloads/ChrisAubuc ... 2-dun2.dsk
These are replacement Apple disk images. I changed two bytes in the trap code to get them (I believe) to work properly.
The first was to change the data at $a456 to point to the proper address for the monster groups. $B700 instead of $B300. Hmm...I wonder if this bug is specific to the Apple version. The disassembly dumps in this thread are offset $400 than what they are when I load these in AppleWin. I wonder if they discovered this bug when moving to the C64.
The second was to change the "jsr $9403" (on Apple) to "jsr $9412" which is, I believe, the do_damage() routine.
In a few tests in the Dark Domain with a low level party it seems it is now working correctly. A poison gas cloud inflicted damage and the poisoned status as it should. Wiped out the entire party except for the high level Archmage used for APAR.
Posted: Thu Apr 05, 2012 2:30 pm
by Darendor
Are the corrections easily applied to the C64 disk images as well?
Posted: Thu Apr 05, 2012 8:19 pm
by drifting
I don't think it will be too difficult. I don't have a C64 emulator set up so I'll have to get one of those going first.
Posted: Fri Apr 06, 2012 5:02 am
by drifting
Posted: Fri Apr 06, 2012 8:30 am
by ZeroZero
Excellent job, drifting.
I just wonder how difficult BT2 is now, that it works like originally intented...
Posted: Tue Apr 10, 2012 8:00 am
by Darendor
ZeroZero wrote:Excellent job, drifting.
I just wonder how difficult BT2 is now, that it works like originally intented...
Well, if the traps were a threat back in the day, I would have modified my dungeon maps to point them out.

Posted: Tue Jan 15, 2013 6:33 am
by Saxon1974
Hot Damn it works! Great work Drifting!
Does someone want to post the working dungeon discs to the main website's list of files?
I still have a hard time believe the game was shipped like this and was never fixed, thats a HUGE bug to miss and its not what I remember back in the day playing this game.
Posted: Wed Jan 16, 2013 3:29 am
by Darendor
I agree, redistributing the D64 images with the corrected trap subroutines would be awesome.
It'd give people a shock who were used to going, "Oh pfft, a MINDTRAP. Big friggin OH MY GOD WHAT THE F@#$%?!"

Posted: Mon Jan 28, 2013 8:45 am
by Saxon1974
Dang, looks like this fix broke the treasure chest traps. Now whenever I get rewarded a chest after battle the traps on these dont work.
I got so excited when I saw this was fixed I started another play though, looks like I might need to wait longer for a working version

Posted: Tue Jan 29, 2013 6:18 am
by Saxon1974
Saxon1974 wrote:Dang, looks like this fix broke the treasure chest traps. Now whenever I get rewarded a chest after battle the traps on these dont work.
I got so excited when I saw this was fixed I started another play though, looks like I might need to wait longer for a working version

Edit post: I went and tried it again with a brand new character disc and it looks like both chest and regular traps do in fact work!
My guess is maybe my using an already used character disc had some saved info on it that had already saved something that hosed the traps? Either way it appears these new dungeon discs work properly with a new game with original boot and character discs.
Thanks again for fixing this issue Drifting. If I run into any other bugs I will post them.

Posted: Tue Jan 29, 2013 6:20 am
by Saxon1974
Darendor wrote:I agree, redistributing the D64 images with the corrected trap subroutines would be awesome.
It'd give people a shock who were used to going, "Oh pfft, a MINDTRAP. Big friggin OH MY GOD WHAT THE F@#$%?!"

Ha yes it would be a big shock eh?
The game is WAY too easy without the traps working. I know someone on the RPGCodex posted that he has a working C64 and the trap events work fine on the real discs.