Page 3 of 6

Re: C64 BT2: complete monster list

Posted: Tue Mar 08, 2022 9:15 am
by Darendor
The game code at $b187 has the attack texts, but I do not know how the code references them.

Re: C64 BT2: complete monster list

Posted: Tue Mar 08, 2022 9:18 am
by Darendor
swings at
slashes at
kicks at
punches at
claws at
tears at
bites at
gnaws on
stabs at
slams
strikes at
gropes at
reaches toward
peers at

14 texts, which means 2 bytes representing 2 bitfields, no?

Re: C64 BT2: complete monster list

Posted: Tue Mar 08, 2022 9:19 am
by Weber G
check post 115:

Code: Select all

951D	A0	1C	  	LDY #$1C	
951F	B1	67	  	LDA ($67),Y	
9521	4A	  	  	LSR A	
9522	4A	  	  	LSR A	
9523	29	FC	  	AND #$FC	
9525	18	  	  	CLC 	
9526	69	00	  	ADC #$00	
9528	AA	  	  	TAX 	
9529	BC	67	B1	LDY $B167,X	
952C	BD	66	B1	LDA $B166,X	

Re: C64 BT2: complete monster list

Posted: Tue Mar 08, 2022 9:38 am
by Darendor
Weber G wrote: Tue Mar 08, 2022 9:19 am check post 115:

Code: Select all

951D	A0	1C	  	LDY #$1C	
951F	B1	67	  	LDA ($67),Y	
9521	4A	  	  	LSR A	
9522	4A	  	  	LSR A	
9523	29	FC	  	AND #$FC	
9525	18	  	  	CLC 	
9526	69	00	  	ADC #$00	
9528	AA	  	  	TAX 	
9529	BC	67	B1	LDY $B167,X	
952C	BD	66	B1	LDA $B166,X	
Byte 1C is the bitfield indicating the attack text right?

So the text fields start at $b166?

Re: C64 BT2: complete monster list

Posted: Tue Mar 08, 2022 9:57 am
by Weber G
just an example with the wolfman:

1C = 20h = 0010 0000bin => loaded in A
2x LSR A => result: 0000 1000bin
AND A with FCh:
A: 0000 1000
FC: 1111 1100
result: 0000 1000 => 08h
TAX => X = 08h
LDY $B167,X => load Y with content of $B167+08 = $B16F => content is B1
Y = B1
LDA $B166,X => load A with contant of $B166+08 = $B16E => content is B7
A = B7
Y and A = B1 & B7 => adress $B1B7 (start adress of text)
$B1B7 A0 E3 EC E1 F7 F3 A0 E1 F4 A0 DC => _claws_at_*

Re: C64 BT2: complete monster list

Posted: Tue Mar 08, 2022 10:38 am
by Darendor
Weber G wrote: Tue Mar 08, 2022 9:57 am just an example with the wolfman:

1C = 20h = 0010 0000bin => loaded in A
2x LSR A => result: 0000 1000bin
AND A with FCh:
A: 0000 1000
FC: 1111 1100
result: 0000 1000 => 08h
TAX => X = 08h
LDY $B167,X => load Y with content of $B167+08 = $B16F => content is B1
Y = B1
LDA $B166,X => load A with contant of $B166+08 = $B16E => content is B7
A = B7
Y and A = B1 & B7 => adress $B1B7 (start adress of text)
$B1B7 A0 E3 EC E1 F7 F3 A0 E1 F4 A0 DC => _claws_at_*
1C = 20 hex? What?

I don't understand this whole AND and OR business. The way I understand AND / OR is when I go to McDonalds, I get a Big Mac AND fries, OR sometimes I just get fries and a drink.

Anyways....

I get that the text strings are at b167.

Could you just show me where the tables I need are found? I'm running out of Tylenol here...

Re: C64 BT2: complete monster list

Posted: Tue Mar 08, 2022 11:28 am
by Weber G
I get that the text strings are at b167.
Wrong! The text strings are not at $B167. The addresses where the text strings are, are att $B167!

Sorry, but if you don't understand my last post, do something to understand it.

Re: C64 BT2: complete monster list

Posted: Tue Mar 08, 2022 11:30 am
by Darendor
Is " claws at " not at $b167?

I guess 1C is the offset from b167 to find the relevant text, then.

Re: C64 BT2: complete monster list

Posted: Tue Mar 08, 2022 11:36 am
by Darendor
Oh for....

I was reading "B" at "6". They look similar when you're tired/confused.

Re: C64 BT2: complete monster list

Posted: Tue Mar 08, 2022 11:50 am
by Darendor
So I tried to figure out the offset for 50...

50 LSR twice - > 00010100, AND with #$FC -> 14; b168 + 14 & b167 + 14 will give address for attack text (b17c + b17b; b102)

Only, that's somehow wrong.

Re: C64 BT2: complete monster list

Posted: Tue Mar 08, 2022 12:12 pm
by Weber G
it's not $B168 but $B166

and the result address is $B1FA

Re: C64 BT2: complete monster list

Posted: Tue Mar 08, 2022 12:22 pm
by Darendor
Yes, I've since progressed a bit working on it.

It seems that 57 and 50 both convert to 14 for some reason, is that accurate?

Re: C64 BT2: complete monster list

Posted: Tue Mar 08, 2022 12:27 pm
by Weber G
It seems that 57 and 50 both convert to 14 for some reason, is that accurate?
Yes, only bit2 to bit7 is used for the attack text. That's why 2xLSR is used.

Re: C64 BT2: complete monster list

Posted: Tue Mar 08, 2022 12:45 pm
by Darendor
Something else I noticed is that any given monster will use a pair of attack texts.

For example, the Colossus will use " slams " and " strikes at ". It seems a 50% chance for either. Did you notice this too?

Also, are bits 1 and 0 of the byte used for the special attack type?

Re: C64 BT2: complete monster list

Posted: Tue Mar 08, 2022 12:55 pm
by Darendor
The offset for Lagoth Zanta is 10 (derived from 4e), which is hex 00010000.

Bits 0-3 are 0; yet he supposedly critically hits. :?

What's up with that?