Castlevania Dungeon Forums

The Castlevania Dungeon Forums => General Castlevania Discussion => Topic started by: TheouAegis on October 04, 2013, 05:12:52 AM

Title: What the heck does this go to?
Post by: TheouAegis on October 04, 2013, 05:12:52 AM
In CV3, I haven't replayed through the entire game whilst watching variables, but I can't figure out what aspect of the game this piece of code applies to. It's  a status effect code, but it should be noted that status effects in CV3 simply refer to being acted upon (not attacked, though), such as being carried by current or riding a platform. This code is from when Trevor's status is 6 -- for the record, Medusa's petrification status is 13, so this does not belong to that.

Code: [Select]
0E:9331:A6 D1     LDX $00D1 = #$00
0E:9333:86 CF     STX $00CF = #$00
0E:9335:A4 90     LDY $0090 = #$00
0E:9337:88        DEY
0E:9338:F0 1A     BEQ $9354
0E:933A:88        DEY
0E:933B:F0 17     BEQ $9354
0E:933D:A9 00     LDA #$00
0E:933F:8D 09 05  STA $0509 = #$00
0E:9342:8D F2 04  STA $04F2 = #$01
0E:9345:8D 37 05  STA $0537 = #$00
0E:9348:8D 20 05  STA $0520 = #$00
0E:934B:20 01 80  JSR $8001
0E:934E:20 23 87  JSR $8723
0E:9351:4C FB 86  JMP $86FB
0E:9354:A6 91     LDX $0091 = #$00
0E:9356:BD F2 04  LDA $04F2,X @ $0502 = #$00
0E:9359:8D F2 04  STA $04F2 = #$01
0E:935C:BD 20 05  LDA $0520,X @ $0530 = #$00
0E:935F:8D 20 05  STA $0520 = #$00
0E:9362:A9 00     LDA #$00
0E:9364:8D 09 05  STA $0509 = #$00
0E:9367:8D 37 05  STA $0537 = #$00
0E:936A:F0 E2     BEQ $934E

00D1 would be storing the ID of whatever object is applying this status effect on Trevor (or whomever). So anytime you see NNNN,X, it's referring to that object. So the code lodes up some timer variable (90) and counts it down 2 ticks at a time. If the timer hasn't reached 0, Trevor seems to be paralyzed. When the timer finally reaches 0, Trevor's vertical speed is set to 0 and his horizontal speed is set to match that of the object.

What in CV3 has that kind of behavior? The paralysis over time sounds like Medusa, but the affect after the timer counts down wasn't an aspect of her petrification. It almost sounds like a hit-stun-knockback attack effect, but Trevor's knockback codes usually apply a vertical speed as well as set his knockback flag; none of that is happening here. Trevor freezes for a sec, then scoots along sideways.

I hope someone here can figure out where this code belongs.
Title: Re: What the heck does this go to?
Post by: Jorge D. Fuentes on October 04, 2013, 09:17:01 AM
Sounds like when Trevor is approaching the end of a stage door with no boss.
About 8-10 tiles away, you lose control of Trevor, and Trevor will auto-walk to the Door Object, and go through it. You have no control of Trevor during this (perhaps that's what's read as 'paralyzed').

It happens at these times:
-Upon reaching the bottom of the clock tower on the way down. (2)
-Upon reaching the end of the first half of the forest, after the lightning plateau. (3)
-Upon defeating Medusa/SnakeWarrior in the Haunted Ship. (4)
-Upon exiting Alucard's Mausoleum Cavern (5)
-Upon defeating the Giant Bat in the Castle Mines (7)

Maybe this is it?
Title: Re: What the heck does this go to?
Post by: TheouAegis on October 04, 2013, 04:49:33 PM
Hm. That's possible. Trevor doesn't stop moving in those situations, but it's possible something else is setting his movement right after it stops him, so it never visibly stops. I'll check that at the forest door. Thanks for the suggestion.
Title: Re: What the heck does this go to?
Post by: TheouAegis on October 05, 2013, 03:25:22 PM
Nope, auto-walk seems to be 14 (didn't even know it went past 13). Guess I'll have to play through the whole game again today...  :(

Edit: HURR-DURR! It goes to the small gears! I don't know how the hell I missed that. I kept thinking the small gear counted as a moving platform, but it has its own status attribute. What the hell, Brain?!

On a related note, the rotating gears appear to have been programmed by someone else, as 00D1 should have been 0089 or 008E, possibly suggesting they were added as an afterthought (and now they're a staple in CV games).