News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Castlevania III - Disabling enemies droping subweapons  (Read 5078 times)

Cyneprepou4uk

  • Full Member
  • ***
  • Posts: 161
  • Самый лысый ромхакер
    • View Profile
Re: Castlevania III - Disabling enemies droping subweapons
« Reply #20 on: May 30, 2019, 08:27:27 am »
1 - Disables Sub-weapon with modding CPU-RAM $CE counter routine at (unheadered ROM) 2f59c E6 > AE (INC > NOP)

2 - Thank you Cyneprepou4uk for helping me to find this. It means so much to me  :crazy:

3 - LDA ($08), y @7334 = FF. What does this @ mean?

4 - A other Question that did come up was why the health refill of a meat (pork-chop) only works when it drops of a wall. (not candle or enemy)

1 - AE is not NOP, it's LDX with absolute addressing mode. NOP is EA. And you need 2 of them, not just 1, otherwise game will consider next following byte CE as an instruction

2 - you're welcome)

3 - debugger will show you final address after @ which he has calculated. In that particular instruction, final address is based on values in $0008, $0009 and Y

4 - perhaps this buggy meat has different id, changing it to wall's meat id should do the trick. Or you can change pointers for current id so the game will execute the same working subroutine with refilling hp after picking meat up. Choose which one is more suitable
« Last Edit: May 30, 2019, 08:50:10 am by Cyneprepou4uk »
I am the baldest romhacker
NES Romhacking Guide

bogaabogaa

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
Re: Castlevania III - Disabling enemies droping subweapons
« Reply #21 on: May 30, 2019, 09:45:46 am »

I'm interested in this.
That would be a big help to one of my old projects that I have been thinking of resurrecting in the next year or so.
It relies on specific weapons being placed in specific locations, so disabling enemies from dropping them would be great.

It is not the same as in CV 3

Probably simpler but I could not get it to work.

Here some resources:
TAS Disassembly of the CV1 special_item_drop routine: http://tasvideos.org/GameResources/NES/Castlevania.html
RAM Map CV1: https://datacrystal.romhacking.net/wiki/Castlevania:RAM_map

The RAM has a special item counter at 0x7b-(but when I disable the increase like in CV3 at PRG ROM 0x1e109 it will crash)
I am glad if someone could explain the routine (see disassembly) a bit better and a good way to disable it. 

May 30, 2019, 10:30:07 am - (Auto Merged - Double Posts are not allowed before 7 days.)
1 - AE is not NOP, it's LDX with absolute addressing mode. NOP is EA. And you need 2 of them, not just 1, otherwise game will consider next following byte CE as an instruction


I did replace the loading of the Special_Item_Counter (now EAEA) But like this I need to worry that the accumulator might carry something that is = or Greater-Than 05 when it will approach the compare.. But I did change it since I also don't know what 0xcf might be used for. Thanks for pointing this out.




Also I did both-force my way through the 255 options for candle-drops. The meat does not work as a candle-drop. But I found a unused mechanic. The palette does chance when you hit a candle. https://youtu.be/sPkSif8gkEs
« Last Edit: May 30, 2019, 04:24:16 pm by bogaabogaa »
CV ROM DiscordServer
https://discord.gg/PvFgxRg

Marcelo_20XX

  • Jr. Member
  • **
  • Posts: 25
    • View Profile
Re: Castlevania III - Disabling enemies droping subweapons
« Reply #22 on: May 30, 2019, 10:20:06 pm »
Wow! awesome findings, thank you very much for all the inputs guys. I will disable the sub weapon drops in both games right now and share the personal projects I was working on...

@Vanya
No problem mate, here is a picture where I NOPed some instructions of the drop sub routine in Castlevania Rev A and yes it was handled very different on CV3:



When you kill an enemy the random drops sub-routine is called starting at E0A0 of Bank 7...
The code in the picture disables the enemies random dropping of: sub-weapons, gold and invincibility potion. But you can fine tune the NOPs to only disable the sub weapons drops...
« Last Edit: May 30, 2019, 10:45:59 pm by Marcelo_20XX »

Vanya

  • Hero Member
  • *****
  • Posts: 1489
    • View Profile
Re: Castlevania III - Disabling enemies droping subweapons
« Reply #23 on: June 04, 2019, 02:33:50 am »
Awesome! Thanks a lot for that.
Now I have a reason to go back and revisit my old Castlevania Extreme hack.
I know, that is such a 90's hack title. Well, I did work on it in the 90's. ;)
Guess I'll give it a new title too.