Autoboot Castlevania games from Konami Collection!

Started by dACE, June 27, 2015, 01:05:41 PM

Previous topic - Next topic

SCD

You did a excellent job on the autoboot hacks for the colorized versions of the first two GB Castlevania games. Are there any plans of doing autoboot hacks for the colorized versions of Operation C and Quarth and giving them their corrected title logos as well?

Carnivol

Quote from: KingMike on July 04, 2015, 09:42:44 AM
Those versions do some strange things.
I also notice that Probotector in the collection enables the stage select right away. Did the original EU version do that? (I know, in the original releases, it was unlocked in the Japanese version but locked with a code on the US version)
They renamed Quarth as "Block Game" which is very strange but perhaps permissible as from what I hear the original standalone version was not released in EU. However, Motocross Maniacs was renamed "Bikers" and that was originally released in EU?

Yeah, at least the first Probotector did not have any stage select available from the get-go in the original EU release (no idea if it's even there at all on the original B&W cart). As for the other two? No clue.

marioxb

Quote from: SCD on July 05, 2015, 04:19:06 AM
You did a excellent job on the autoboot hacks for the colorized versions of the first two GB Castlevania games. Are there any plans of doing autoboot hacks for the colorized versions of Operation C and Quarth and giving them their corrected title logos as well?

Also Motocross Maniacs, Nemesis, Gradius: Interstellar Assault and I'd also like that train game to be called Loco-Motion

dACE

Seems like you can boot Probotector, just as easy - by adjusting the replacement hex a little:

Same Offset: 1 8B5C

Change:
3E 01 EA A0 C0 EA A1 C0 3E 08 EA A1 C0

Into:
3E 09 EA A1 C0 3E 03 EA B0 C0 EA A0 C0

The last part copies the value 03 (which is Probotectors sequence on the rom) to a memory address that I thought 'needed' the value 01 - which happens to be Castlevanias sequence. But - as it seems - you can obviously replace that value with 03 - so there you go.

/dACE

Vanya

Hmmm... Now that a single game on these compilations be singled out for booting purposes is there anything stopping us from expanding the games by cannibalizing the others' space? Would be nice to have a version of CVA2 that has both the cross and the axe available.

RichterSnipes

This is a wonderful patch! I've been hoping hacks like these would show up, as I prefer my games as "standalone" releases as opposed to compilations.

However, there's one glaring issue: the lack of the Konami name/logo. Until the end credits, the company name doesn't appear anywhere in the game. That absence makes it feel like I'm playing a bootleg copy of the game. Would it be possible to re-insert the Konami splash screen that appears right after the "Licensed by Nintendo" screen?

dACE

You don't need to re-insert anything, just move the 'hi-jack' from the current 'screen-transition' to the next (which I think is the Konami logo).

You would of course have to do a little debugging to figure out the ROM offset.

/dACE

RichterSnipes

#27
But of course. I figured you hadn't actually removed it from the ROM outright, just that it didn't show up in-game. And thanks for the tip, I've got it showing up again. Insert the hijack code at 64158 instead of 64140 (or 64153 instead of 6413B, if you're using the insert from the first post; I just used the differing bytes).

Thank you for your work on this! You have no idea how much I appreciate patches such as this one.  :)

EDIT: I just noticed that pushing SELECT on the title screen for the game returns you to the game selection screen. It might not matter much since it doesn't seem like any of these games use it otherwise (just unbind that button), but it's still a remainder of the game being part of a compilation.

Another thing:you can press the START button while the Konami logo is on screen, which will take you to the compilation's title screen. I found that this behavior can be changed with the byte at 64152. Changing it to "EA" seems to work. Yeah, I've edited this post a LOT!

tc

Quote from: marioxb on July 10, 2015, 12:48:12 PM
Also Motocross Maniacs, Nemesis, Gradius: Interstellar Assault and I'd also like that train game to be called Loco-Motion

While we're at it, add a subtitle for Mystical Ninja Starring Goemon. It reused the GB game's name from just two years earlier. (which itself had little to do with the N64 game either) :P

Quote from: Carnivol on July 05, 2015, 03:49:51 PM
Yeah, at least the first Probotector did not have any stage select available from the get-go in the original EU release (no idea if it's even there at all on the original B&W cart). As for the other two? No clue.

Of the game's five releases, two hid the stage select: B&W US and EU. Same code accesses it.

Rodimus Primal

It would be cool to port in the US title screens for all 4 games in each collection and make each one Auto-Boot. I much rather have Operation C than Probetector in color.

ShadowOne333

#30
Sorry to bump this thread.

I got in contact with user RichterSnipes to ask him if he got Castlevania The Adventure (Konami Collection Vol. 1) working with the Konami logo for the autoboot.
He gave it a try and got the offsets to make the Konami logo appear, and afterwards boot into the Castlevania title screen.

He already got Castlevania II (Konami Collection Vol. 2) working, so for anyone interested, I'll leave the information here:

Quote from: RichterSnipesFor Vol. 1, make the indicated byte changes in the OP at 18BA8 instead of 18B5A. To prevent the Start button from taking you to the collection's title screen on the Konami logo, set the byte at 18B9C to "EA".

The "Select button" thing that he mentioned in a previous post is that, at the Title Screen of the Castlevania games, you can go back to the Collection's Game selection Menu by pressing Select.

I do have some ASM experience (very little, but it's something) with the Run Button patch I made for EarthBound, so I kinda get the idea of how it works.
The quickest way for me to make this work would be to completely remove the opcode/routine that detects the Select button with an EA (NOP/No operation) , so that would make the Select button actually do nothing at all.

Do any of you guys know if the Select button is used in both Castlevania games in any way?
I want to be sure, if they don't use the Select button then I might as well just ditch the whole routine for the Select button, that way we are locked up into the actual Castlevania game without a chance to go back to the Game selection menu and have the autoboot hacks in the cleanest way possible.

-------------------------------------------------------------

EDIT:
I already found the RAM address where the button inputs are being stored for both games

It's in 0xC10C for Konami Collection Vol. 1 (Castlevania The Adventure) and in 0xC886 for Konami Collection Vol. 4 (Castlevania II)
The Select button has a value of 0040.
So the opcode for that one should be something like (For Castlevania The Adventure):

LDA $C10C, // Load RAM offset for Select Button input
AND #$0040, // AND accumulator comparing with HEX value for Select Button input


Something along those lines.
Now the thing is that I don't know what kind of ASM Gameboy Color games use.
I am only familiar with 65816. Does GBC use Z80?

KingMike

GB/GBC uses a modified Z80 (with a different instruction set).

NOP is 0 I recall on the Z80.

Reading the controls on the Game Boy is a bit trickier and you'd have to read a GB MMIO doc.
The gamepad IO register can only read the buttons or the D-Pad at once, so naturally multiple reads are necessary.

Oh... I see you found the RAM address. Well, it would still be good to know how reads are done.
"My watch says 30 chickens" Google, 2018

ShadowOne333

Quote from: KingMike on March 21, 2016, 03:55:13 PM
GB/GBC uses a modified Z80 (with a different instruction set).

NOP is 0 I recall on the Z80.

Reading the controls on the Game Boy is a bit trickier and you'd have to read a GB MMIO doc.
The gamepad IO register can only read the buttons or the D-Pad at once, so naturally multiple reads are necessary.

Oh... I see you found the RAM address. Well, it would still be good to know how reads are done.
I find it easier to look it up on the RAM. :P
I already found the RAM addresses for the button inputs for both games and I updated my previous edit to include both offsets now.
So right now all I gotta do is find the damn routine in charge of reading that one.
I am having quite a hard time because I am not familiar with Z80 ASM at all haha.

I can see some opcodes but I cannot seem to find anything related to those RAM addresses and an LDA opcode. :/

zonk47

#33
Z80 assembly is pretty simple.

The Z80 uses several bytes of special memory (called "registers") to manage itself. To manage the Z80, you have to move data between these registers and memory using the "ld" instruction (for "load").

The action happens at the A register (for "accumulator"). The CPU's math instructions (ADD, SUB) use the A register for basic arithmetic. There are additional registers, called flag registers, which help it do things that are difficult to do at 8 bits, like division. (in Z80 there is no division instruction, so you have to set the accumulator to the number you are dividing, and follow up with a loop which subtracts the divisor from the accumulator until it hits 0 or below (which you check with the CMP ("compare" instruction), which determines if the acculmulator is negative, which you follow up with "branch if not 0" (BNZ) back to the start address of the loop, while keeping track inside the loop of the number of times you looped (probably by increasing the C (for "Count") register via "INC C"). The count of the loops is the quotient. For multiplication, you use a loop to add x amount of times). There are a few other registers which can be used for purposes like setting aside memory for subroutines and buffering variables, so that the CPU doesn't have to waste time going back and forth from RAM when it doesn't have to. (this is important because RAM reads can really slow things down)

The Pentium is actually only the latest version of the Z80 architecture (which is an improvement over the Intel 4004, the very first microprocessor). In later versions, "ld" is replaced with "mov", which makes more sense IMO.

It's not drastically different from the TI graphing calcs, if you're familiar with those. And it's a lot simpler than the NES/Atari CPU, the 6502.

Here's a list of all Z80 instructions: http://clrhome.org/table/
A good slave does not realize he is one; the best slave will not accept that he has become one.

KingMike

Again, you will need a separate instruction set specifically for the Game Boy, because Nintendo changed it from the standard. They added some instructions (such as ld to/from $FFxx, similar to the Zero Page mode on 65xx), removed some instructions (such as the X/Y registers and its instruction sub-sets) and moved some instructions (same effect but different opcodes).
"My watch says 30 chickens" Google, 2018

zonk47

Quote from: KingMike on March 22, 2016, 01:46:02 AM
Again, you will need a separate instruction set specifically for the Game Boy, because Nintendo changed it from the standard. They added some instructions (such as ld to/from $FFxx, similar to the Zero Page mode on 65xx), removed some instructions (such as the X/Y registers and its instruction sub-sets) and moved some instructions (same effect but different opcodes).

I think all he needs are the mnemonics.
A good slave does not realize he is one; the best slave will not accept that he has become one.

MathUser2929

I hope you upload the updated patch to the website. I was thinking of downloading these sometime.

ShadowOne333

I am trying. :c
No luck so far.

Quote from: MathUser2929 on March 22, 2016, 10:57:39 AM
I hope you upload the updated patch to the website. I was thinking of downloading these sometime.
I already sent the submission request, they should be upin a few hours or tomorrow at least.

MathUser2929

Is someone gonna make a patch to auto boot Operation C? I tried following some of the steps, it don't go to the konami screen, but it goes to the probector screen right away. But then select and start still do what we don't want them too. I ain't able to make a good enough hack so someone else that can follow this better should do it.

Edit:BTW, great hack. I used it today to play castlevania adventure.

ShadowOne333

Quote from: MathUser2929 on March 31, 2016, 12:55:55 AM
Is someone gonna make a patch to auto boot Operation C? I tried following some of the steps, it don't go to the konami screen, but it goes to the probector screen right away. But then select and start still do what we don't want them too. I ain't able to make a good enough hack so someone else that can follow this better should do it.

Edit:BTW, great hack. I used it today to play castlevania adventure.
dACE posted a wayto autoboot Probotector too:
http://www.romhacking.net/forum/index.php/topic,19999.msg282714.html#msg282714

Its just a matter of changing some bytes in the autoboot code and that's it.