In this edition:
Clockwork Knight 2 introduces a new game mechanic: the Barobaro stages.
Normally those stages automatically scroll, preventing you from exploring them.
I’ve produced a patch to let you play as Pepper in those stages, and to disable automatic scrolling.
Get the patch from SegaXtreme.
Here’s a video of Pepper running through 5-2, which is normally a Barobaro level:
And here’s Pepper in 7-2:
Intro
Clockwork Knight 2 is more or less a straightforward sequel - you get the first game again, but more of it. There is a cool new mechanic, though: you can ride Barobaro, Pepper’s “nearsighted donkey” in a couple of levels.
The Barobaro levels are auto-scrolling. Pepper and Barobaro move forward by default, and your job is to avoid enemies and obstacles till you make it to the end. There are two of these: 5-2 (Kid’s Room) and 7-2 (Bath Room).
A question presents itself: what if you could explore the Barobaro levels as Pepper?
Technical details: character selection
There’s an interesting bit of code that runs while your level is loading in CK2. It looks at a table indexed by level for either a B
(42
in ASCII) character or a T
character (54
in ASCII):
It turns out that the three areas of Kid’s Room and Bath Room use the TBT
value, and the three areas of Study Room and Clock Tower use the TTT
level. Those match up perfectly with the Barobaro levels: T is for Tongara (a.k.a. Pepper) and B is for Barobaro.
If we try swapping B for T in Area 5-2, we get a crash:
But there’s a helpful error message there! A52PLTB.BIN
is used for Area 5-2, as the name suggests. Maybe we need to use a file that matches with the non-Barobaro gameplay? Here’s what you get if you replaces the references to the Area 5-2 file with the Area 5-1 file:
Progress - now the issue is A52PLCG.BIN
. Will pointing to Area 5-1’s file work again?
Sort of, haha. The camera still auto-scrolls and leaves us behind! There is more work to do…
Technical details: rewriting the camera code
Interestingly, each level of Clockwork Knight 2 (and probably Clockwork Knight) has its own camera code. It gets loaded to the beginning of the Saturn’s Low Work RAM around address 00200000
.
The ultimate goal of the camera code is to modify the values at the fixed addresses 0605a0c4
(camera X position) and 0605a0c8
(camera Y position). For the Pepper levels, the main determinate is his position (X at 060428e0
, Y at 060428e4
). But for the Barobaro levels, the camera is primary - it will actually move Pepper and Barobaro if they hit the left edge.
I replaced all of that code with the simplest camera possible: track Pepper’s X and Y positions exactly. This misses a lot of the nuances of the camera used for the non-Barobaro levels (crouching down doesn’t show us the area below, for example), but it does let us play 5-2.
Playing as Pepper
Most of the gimmicks in 5-2 work, including the level-specific enemies and track switches.
There are some caveats, though:
The sections where the level’s track bends don’t function properly - they launch Pepper into the foreground or background (and injure him, for some reason).
There’s one part where the tracks cross that you can get stuck on.
The early exit doesn’t work.
Stage 7-2 is generally functional, and you can easily complete it on foot.
Issues with 7-2:
The blue whales that take you into the foreground or background: when there are two lined up, you can get stuck bouncing between them.
Waterfalls: they are pretty flaky, and it’s tough to get them to warp you.
The hidden section: you have to keep moving to get past the underwater bits
If you lose all your gears, the game crashes - I think it’s because of the wrong “CG” files being loaded. To prevent this, I made Pepper invincible:
06008c0e 0009
This prevents the game from recording the fact that you lost a gear. The game still crashes if you fall into a pit, however.
Outro
In a future edition we’ll do the opposite trick: putting Barobaro in some of the Pepper-only stages. Stay tuned!
If you have ideas for games to examine (or hacks like this to investigate), send them to me! I’m @memory_fallen on X/Twitter.
Many thanks to Tongara from ClockworkKnight.com for testing this patch.