The Bugs Bunny Crazy Castle / Birthday Blowout (Kemco NES) thoughts

Started by tygerbug, August 12, 2022, 04:22:50 AM

Previous topic - Next topic

tygerbug

In (Kemco NES) The Bugs Bunny Crazy Castle, it would be interesting to have the CHR used for character sprites change on every level, to allow for five or six or more sets of (four) enemies. This could even be random.

I would fill these "duplicate" CHRs with lots more Looney Tunes characters, as seen in the Game Boy games and so on. Each has four enemies.

Ideally I could also switch the color palettes used when each CHR loads, so that the enemies have their correct colors. (92AC in the hex, something at 8450 also)

"The fact that four of the different seven enemies are recolored Sylvesters is left over from Roger Rabbit's weasels ... and not great. This could ideally be changed for more variety."

This is the only NES Crazy Castle unless you count Blowout, and it's primitive and less advanced than the Game Boy games became. But more variety could certainly be added.

A disassembly by cyneprepou4uk exists.
https://github.com/cyneprepou4uk/NES-Games-Disassembly/tree/main/Bugs%20Bunny%20Crazy%20Castle

This file seems to call out the CHR bank swaps, which occur for the title, ending, and levels. The code seems to be repeated, although I'm not sure about that. Possibly due to the length of the game.
https://github.com/cyneprepou4uk/NES-Games-Disassembly/blob/main/Bugs%20Bunny%20Crazy%20Castle/bank_FF.asm

"Apparently RAM 68 stores the stage number, up to 3C / 60. Five CHRS are needed for the intro, ending, and stage backgrounds. Starting at CHR 5, five or seven more CHRs could be used for enemy sprites (5-9 or 5-B), selected based on stage number."

In theory, a new subroutine could be added somewhere which would switch sprite CHR between maybe five or seven CHRs based on the value of this RAM.

The password to level 60 is YTKX. Game Genie code GXETZZEI grants invincibility. ATUSPYSA grants invincibility from skulls (or no carrot signs).

Bugs Bunny's Crazy Castle NES was originally Roger Rabbit on FDS, and featured an animated ending with large sprites of Roger and Jessica. Nothing like this appears in the NES version, but this scene features in non-animated form in the Proveaux restoration hack of it. It could be "Looney Tunes-ized."

https://www.romhacking.net/hacks/1620/

Possibly the code from the FDS version could be pulled /disassembled to actually animate this ending as intended. The Proveaux restoration hack simply loads the background and one version of the Roger and Jessica sprites.

The Roger Rabbit and Bugs Bunny versions of the game have slightly different graphic layouts - for example the weasel hats are animated, while Sylvester's head is not. I think this can be compensated for, although I haven't tried myself. The above hack splits the difference with this somewhat. Enemies are also faster in Roger Rabbit.

Ideally for a hack, this animated Roger Rabbit ending could be added to the Crazy Castle version, but nothing else changed.

There is a level editor for Crazy Castle NES and several hacks which change the levels.


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

The enemies in Crazy Castle NES are Sylvester, Daffy, Wile E. Coyote, and Yosemite Sam.

Sequels and spinoffs on Game Boy featured Marc Anthony, the Tasmanian Devil, Tweety Bird, Merlin the Magic Mouse, Foghorn Leghorn, Beaky Buzzard, the "Little Ghost" (Ghost Wanted), and a "flame" in the same style. (The Road Runner appeared in non-Kemco games.) By the fourth installment, Elmer Fudd, Pepe Le Pew, Count Bloodcount and a Leprechaun appeared.

Henery Hawk was in Blowout (along with Sylvester Jr, Elmer Fudd, Tweety, Yosemite Sam, etc).

(By the fourth Game Boy installment there was also a larger Gossamer, Witch Hazel, a Cupid, and more bosslike versions of Marc Anthony, Beaky Buzzard, the Tasmanian Devil and other characters. Lola Bunny and Porky appeared in unrelated GBC games, as did Rocky and Mugsy, Barnyard Dawg, Penelope Polecat, Witch Hazel, Mot, Sylvester Jr, Marvin Martian and K-9 ... in forms that might be useable in Crazy Castle.)


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


The Bugs Bunny Birthday Blowout (Kemco NES) has unused cutscenes with Porky Pig, Marc Anthony and Pussyfoot, and the Road Runner. Two cutscene images are unused (Porky and a group shot), and the final (group shot) image, similarly has more characters in the prototype ending data.

There was clearly a decision to scrub characters who don't appear as enemies.

Speedy Gonzales also appears as an enemy in the prototype data.

It would be interesting to reinstate the two cutscenes, and include, perhaps, more Looney Tunes characters as common enemies (Marc Anthony? Speedy? Porky?)

Many of the Looney Tunes characters here appear as larger bosses. (Foghorn Leghorn is very large, and Sylvester, Pepe Le Pew and Taz larger than usual ...)
--

There was an unofficial FDS to Famicom conversion of "Roger Rabbit", using an unusual Mapper to make it work. This game had an animated ending not present in "The Bugs Bunny Crazy Castle," which hackers have yet to replicate. I am not sure if this Mapper could be corrected to something more normal -- either based on this or the FDS data.


https://www.nesdev.org/wiki/NES_2.0_Mapper_415


  One hack nobody's done yet would be to use the graphics/characters from the Mickey Mouse Game Boy games. I have no plans personally ...


Bavi_H

The Bugs Bunny Crazy Castle

In this post, I describe modifications that will change the sprite bank to a specific value for each stage.

I am still researching how to change the sprite color palettes to specific values for each stage or sprite bank. (Status: I have found some spots that change the sprite color palettes, but after I changed them, I noticed Yosemite Sam's colors were still normal. I need to find and understand where Yosemite Sam's -- and maybe other characters'? -- colors get set.)

_____


Investigation Process

  • Spoiler
    I used the disassembly and debugging techniques to look for good points in the code to modify to change the sprite bank to a different value for each stage. I also found likely unused areas of memory in the disassembly (there are a few spots that are all hex FF).

    In one of the unused areas of memory, I put a table of byte values for each of the 64 stages, so each stage can have its own freely chosen sprite bank value.

    I initially found a spot in the code before the pre-stage title card fades in that sets the sprite bank number. This same spot is reached right before a stage fades out. I initially used this spot to jump to some patch code to set the sprite bank number depending on the stage number.

    However, if you use the d-pad on the pre-stage title card to change the stage number, the sprite bank needs to change again because the stage number was changed. So I found another spot in the code that displays the stage number. I put a jump to patch code there to change the sprite bank based on the stage number. Then I realized the original spot was redundantly setting the bank number again, so I ended up removing that part with NOP instructions.
    [close]

About Cyneprepou4uk's disassemblies

  • Spoiler
    Cyneprepou4uk's asm files have extra data at the beginning of most lines. Be aware this extra data isn't part of a normal asm file and the assembler won't be able to process the file with the extra data. When you use the assemble.bat included in the disassembly, it first creates temporary copies of the asm files with the extra data removed from the beginning of every line, then assembles from that.

    Format

    a b         c        d  e     f         g
    C - - - - - 0x008020 02:8010: 20 43 80  JSR sub_8043

    a. A "C" in this spot indicates this address was accessed as code in the original test.
    b. A "D" in this spot indicates this address was accessed as data in the original test.
    c. Offset in the NES file
    d. PRG ROM bank
    e. CPU address
    f. Hex byte values at the address
    g. Assembly code

    When you make modifications to Cyneprepou4uk's asm files, you add new lines with assembly code (g) only. If you modify existing lines, I recommend removing the extra data (a to f) since it no longer matches the updates you made.

    I am making modifications in a "patching" style. This means I am trying to keep as much of the code in the exact same spot as possible. If I need to add longer code, I find free space somewhere to put the longer code, then put a jump to the new code in the original spot.

    When I modify lines in the asm file, I count how many bytes I modified and make sure the addresses resume correctly in the unmodified lines after the modification.
    [close]

Modifications

The PRG+CHR CRC32 of the unmodified NES file is E50A9130. The following sections describe the changes I made. You can use the instructions to modify the disassembly or to hex edit the NES file.


1. List of sprite bank numbers for each stage (64 bytes modified)

  • Note: For testing purposes, I just repeated the values 0, 1, 2, and 3 in a cycle. This list will eventually contain the sprite bank numbers you want to use for each of the 64 stages.

  • Disassembly

    • Spoiler
      In the file bank_FF.asm, find the lines with these CPU addresses

      EB71:
      EB80:
      EB90:
      EBA0:
      EBB0:

      Remove those lines and replace them with the following

      sprite_bank_list:
      .byte $00, $01, $02, $03, $00, $01, $02, $03, $00, $01, $02, $03, $00, $01, $02, $03
      .byte $00, $01, $02, $03, $00, $01, $02, $03, $00, $01, $02, $03, $00, $01, $02, $03
      .byte $00, $01, $02, $03, $00, $01, $02, $03, $00, $01, $02, $03, $00, $01, $02, $03
      .byte $00, $01, $02, $03, $00, $01, $02, $03, $00, $01, $02, $03, $00, $01, $02, $03

      .byte      $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
      [close]
  • Hex Editor

    • Spoiler
      At NES file offset EB81:

      00 01 02 03 00 01 02 03 00 01 02 03 00 01 02 03
      00 01 02 03 00 01 02 03 00 01 02 03 00 01 02 03
      00 01 02 03 00 01 02 03 00 01 02 03 00 01 02 03
      00 01 02 03 00 01 02 03 00 01 02 03 00 01 02 03
      [close]

2. Patch code (14 bytes modified)

  • Disassembly

    • Spoiler
      Near the bottom of the file bank_FF.asm, find the lines with these CPU addresses

      FFBF:
      FFC0:

      Remove those lines and replace them with the following

      change_sprite_bank_and_display_stage_num:

      LDX ram_stage_id_1                   ;   X = current_stage
      LDA sprite_bank_list,X               ; \
      STA ram_chr_bank_1                   ; / ram_chr_bank_1 = Mem[sprite_bank_list + X]
      JSR sub_ED00                         ;   change CHR banks
      JSR sub_F230_replace_tiles_with_new  ;   original JSR to change displayed stage number
      RTS                                  ;   Return

      .byte $FF, $FF, $FF

      At the top of the file bank_FF.asm, find the section with the .export lines. In that section, add the following line

      .export change_sprite_bank_and_display_stage_num
      [close]
  • Hex Editor

    • Spoiler
      At NES file offset FFCF:

      A6 68 BD 71 EB 85 33 20 00 ED 20 30 F2 60
      [close]

3. NOP sprite bank number change before pre-stage title card fade in (4 bytes modified)

  • Disassembly

    • Spoiler
      In the file bank_FF.asm, find the lines with these CPU addresses

      C04B:
      C04D:

      Remove those lines and replace them with the following

      NOP
      NOP
      NOP
      NOP
      [close]
  • Hex Editor

    • Spoiler
      At NES file offset C05B:

      EA EA EA EA
      [close]

4. Jump to patch code at stage number display (3 bytes modified)

  • Disassembly

    • Spoiler
      In the file bank_02.asm, find the line with this CPU address

      02:9375:

      Remove that line and replace it with the following

      JSR change_sprite_bank_and_display_stage_num
      [close]
  • Hex Editor

    • Spoiler
      At NES file offset 9385:

      20 BF FF
      [close]

tygerbug

Here's an unfinished version, with changed enemies.

This allows for 28 enemies. Or 35 if you overwrite the Roger Rabbit ending which isn't used here.

EDIT: V2
https://drive.google.com/file/d/1NiYmXoQc_tFstScLnhmj9O9MCglcQfNV/view?usp=sharing

The first color palettes are set on the Star screen, and include fade-ins and fade-outs. 92AC in the hex, something at 8450 also.

I'd thought about using the Roger Rabbit hack because it at least attempts a non-animated version of the Roger Rabbit ending.

"At NES file offset EB81:"

The Proveaux Roger Rabbit hack is already doing something there so I've gone back to unhacked Crazy Castle for this (either that or I could change the pointer).

Banks used: 0, 6, 7, 8, 9, A, B

Weirdly, Sylvester's sprites when he's been hit and is on the ground seem to be coded to use the incorrect tiles, not matching what's in the CHR. I'll have to fix that. Yes, a mistake in the actual game. There's also some extra walking head animation for Yosemite Sam which seems unused.

Only Sylvester is coded to go through doors and up pipes, the others having less animation. This is a leftover from the weasels in Roger Rabbit, who made more sense being a common enemy. In the later Game Boy games you get more characters who can do this, having up/down animations (which are simply mirrored, using four less tiles than Sylvester here). This does mean that any character replacing Sylvester will be much more common in the levels.

I have been swapping some things around for that reason. (It's odd to have Merlin the Magic Mouse be super common, for instance. I ended up "improving" Wile E Coyote instead.)

I haven't checked the code yet, but it appears that when defeated on the ground, Daffy is only one tile tall, which really didn't fit for any of the new character designs. (This is not true in "Roger Rabbit" or "Mickey Mouse," which shuffle unused tiles around differently.) I had to do terrible things to some of the characters to make them work in that format. His kicking legs are two tiles, which helped a little. The unlucky characters are: Leprechaun, Porky Pig, Gogo Dodo, K-9, Ghost Kid (originally The Flame, who got cut), Sylvester Jr.

The other characters seem to have some missing tiles also when defeated/kicking on the ground, but I tried to make the damage minor. I'll look into it when looking at the game in more depth.

Character lineup:
*Sylvester, Merlin the Magic Mouse, Yosemite Sam, Daffy Duck
*Tasmanian Devil, Beaky Buzzard, Witch Hazel, Leprechaun
*Foghorn Leghorn, Count Bloodcount, Barnyard Dawg, Porky Pig
*Wile E. Coyote, Mugsy, Road Runner, Gogo Dodo
*Marc Anthony, Marvin the Martian, Instant Martian, K-9
*Pepe Le Pew, Elmer Fudd, Gossamer, Ghost Kid
*Tweety Bird, Speedy Gonzales, Henery Hawk, Sylvester Jr.

The first character in each line-up can go in/out doors and up pipes, and is more common. Wile E. Coyote and Merlin the Magic Mouse were swapped for this reason. (Merlin the Magic Mouse and Beaky Buzzard are like this on Game Boy, but not here. Elmer Fudd, Witch Hazel, Porky Pig and K-9 were considered for this treatment.)

These are equivalent to the Roger Rabbit characters:
*Smart@$$ Weasel, Judge Doom, Gorilla Bouncer, Penguin Waiter
and the Mickey Mouse characters:
*Zeke "Big Bad" Wolf, March Hare (or White Rabbit?), Pete, Vulture

Many characters are based on existing Game Boy/NES games but most are redrawn heavily at this point. (Plus added damage animations, if they're not, like Taz, Marc, and Foghorn.) In some cases the Game Boy graphics are used for items, and I considered using them generally, as it's a direct remake.

Last characters listed are one tile high when defeated, like Daffy Duck, which required doing dumb things to their sprites. (This is not true in "Roger Rabbit" or "Mickey Mouse," which shuffle unused tiles around differently.)

First priority was given to characters appearing in other Crazy Castle games, or which had similar suitable sprites.

Possibilities that weren't included:

The Flame (cut at last minute)
Sam Sheepdog
Baby Bear
Mad Scientist
Penelope Polecat
Tina Russo
Lola Bunny
Petunia Pig
Claude Cat
Cool Cat
Pete Puma
The Crusher
Granny
Tweety Hyde
Cecil Turtle
Hopper Kangaroo
Draft Board Man
Egghead Jr.
Egghead

Generally these had no existing sprites and would look similar, at this size, to characters already included.


EDIT: Huh. After I did all that work, I've noticed some hacks of the Game Boy Crazy Castle 2 which include similar enemy work. Let me check ...

Yeah, it doesn't really help me now, but they've implemented almost identical two-frame Pepe Le Pew and Elmer, edited from the same reference. And Beaky Buzzard. I need (and created) more than two frames though. Also an original (?) Marvin the Martian and Gossamer, which I'd also done but differently. Interesting though. Same thought process. This is making me rethink Marvin a little, and maybe Gossamer.

Looks like there's a fox character or something, in an unfinished BBCC 4 hack?

Googie

QuoteThe Bugs Bunny Birthday Blowout (Kemco NES) has unused cutscenes with Porky Pig, Marc Anthony and Pussyfoot, and the Road Runner. Two cutscene images are unused (Porky and a group shot), and the final (group shot) image, similarly has more characters in the prototype ending data.

There was clearly a decision to scrub characters who don't appear as enemies.

Speedy Gonzales also appears as an enemy in the prototype data.

It would be interesting to reinstate the two cutscenes, and include, perhaps, more Looney Tunes characters as common enemies (Marc Anthony? Speedy? Porky?)

Many of the Looney Tunes characters here appear as larger bosses. (Foghorn Leghorn is very large, and Sylvester, Pepe Le Pew and Taz larger than usual ...)
--

This caught my eye, I was playing the game the other day and I had alotta fun with it, who knows down the road someone can make a level of Birthday Blowout. :D

Bavi_H

The Bugs Bunny Crazy Castle

In this post:
1. Sprite Colors Status
2. Characters Used In Each Stage (Characters That Never Appear)



1. Sprite Colors Status

In the disassembly file bank_FF.asm, the table starting at CPU address C68A: (NES file offset 0x00C69A) ("tbl_C68A_palette_spr:") is where sprite palette colors are defined. The following $0F byte and table ("tbl_C69B:") are more sprite palettes that are loaded when a non-Sylvester character is in the stage.

Here are the values from those palette tables, along with notes about what sprites use each palette. (NES technical note: In each four-color sprite palette, the first color ends up as transparent.)

██0F ██17 ██10 ██30 Bugs Bunny (character 0), Gray Sylvester 1 (character 1), Gray Sylvester 2 (character 4), poof clouds and lines, "PAUSE"
██0F ██1A ██29 ██30 Green Sylvester (character 2), pipe bulges
██0F ██00 ██16 ██30 unused palette
██0F ██06 ██26 ██38 Pink Sylvester (character 3), carrots, no carrot sign, juice, boxing glove, bucket, crate, safe, 10-ton weight, "100", "500", "1000", "1UP"
██0F ██21 ██16 ██37 Yosemite Sam (character 5)
██0F ██00 ██37 ██30 Daffy Duck (character 6)
██0F ██17 ██26 ██30 Wile E. Coyote (character 7)

The game loads the first four palettes into the 4 sprite palettes. If there is a non-Sylvester character in the stage (character 5, 6, or 7), the unused palette is replaced with a palette for the non-Sylvester character. If there are multiple non-Sylvester characters in a stage, they all use the palette for the highest character.

Elsewhere in bank_FF.asm, the place where tbl_C68A_palette_spr is used (CPU address C642:) and the place where tbl_C69B is used (CPU address C7E5:) are potential spots to patch the code to load alternative colors.



2. Characters Used In Each Stage (Characters That Never Appear)

The way the characters are assigned to stages in the original game and the way the sprite banks are assigned to stages in the WIP v2 patch, it ends up that Marvin the Martian and Sylvester Jr. don't ever get used. Perhaps you may want to revise the bank assignments for some stages to ensure each character shows up at some point.

Here are the characters in the original game and in each bank of the WIP v2 patch.

characters 1-4character 5character 6character 7
original gameSylvesterYosemite SamDaffy DuckWile E. Coyote
WIP v2 bank 0SylvesterYosemite SamDaffy DuckMerlin the Magic Mouse
WIP v2 bank 6Tasmanian DevilWitch HazelLeprechaunBeaky Buzzard
WIP v2 bank 7Foghorn Leghorn   Barnyard DawgPorky PigCount Bloodcount
WIP v2 bank 8Wile E. CoyoteRoad RunnerGogo Dodo   Mugsy
WIP v2 bank 9Marc AnthonyInstant Martian   K-9Marvin the Martian
WIP v2 bank A   Pepe Le PewGossamerGhost KidElmer Fudd
WIP v2 bank BTweety BirdHenery HawkSylvester Jr.Speedy Gonzales

Here are the characters used in each stage, and the bank assigned to each stage in the WIP v2 patch. This list uses tabs to separate the columns. You can copy the text and paste it into a spreadsheet to work with it (sort, filter, lookup, pivot table or so on). To avoid pasting in "HTML format", you may need to Paste Special as Unformatted Text, or you may need to copy the text and paste into a text editor, then copy the text from there and paste into your spreadsheet. The underscore characters are a workaround to force cells to be text so sorting will work as expected. The "order" column is the order the stages appear in data tables (the special stages are at the end: S3, S2, S4, S1.) If you sort by the "stage" column, the special stages will come after the stage containing their "no carrot sign" entrance.

order stage c1 c2 c3 c4 c5 c6 c7 bank
1 01_ 1 1 0_
2 02_ 1 1 6_
3 03_ 1 1 7_
4 04_ 1 1 8_
5 05_ 1 1 1 9_
6 06_ 1 1 1 A_
7 07_ 1 1 1 B_
8 08_ 1 1 1 0_
9 09_ 1 1 1 1 6_
10 10_ 1 1 1 7_
11 11_ 1 1 1 8_
12 12_ 1 1 9_
13 13_ 1 1 1 1 A_
14 14_ 1 1 1 B_
15 15_ 1 1 1 0_
16 16_ 1 1 6_
17 17_ 1 1 1 1 7_
18 18_ 1 1 1 8_
19 19_ 1 1 1 1 9_
20 20_ 1 1 1 A_
21 21_ 1 1 B_
22 22_ 1 1 1 0_
23 23_ 1 1 1 6_
24 24_ 1 1 1 7_
25 25_ 1 1 1 8_
26 26_ 1 1 9_
27 27_ 1 1 1 A_
28 28_ 1 1 1 B_
29 29_ 1 1 0_
30 30_ 1 1 1 6_
31 31_ 1 1 1 7_
32 32_ 1 1 1 8_
33 33_ 1 1 1 1 9_
34 34_ 1 1 1 A_
35 35_ 1 1 1 B_
36 36_ 1 1 1 0_
37 37_ 1 1 6_
38 38_ 1 1 1 7_
39 39_ 1 1 1 8_
40 40_ 1 1 1 9_
41 41_ 1 1 1 1 A_
42 42_ 1 1 1 1 B_
43 43_ 1 1 0_
44 44_ 1 1 1 6_
45 45_ 1 1 1 7_
46 46_ 1 1 1 1 1 8_
47 47_ 1 1 1 9_
48 48_ 1 1 1 1 A_
49 49_ 1 1 B_
50 50_ 1 1 1 0_
51 51_ 1 1 1 1 6_
52 52_ 1 1 1 1 7_
53 53_ 1 1 1 1 1 8_
54 54_ 1 1 1 1 9_
55 55_ 1 1 1 1 A_
56 56_ 1 1 1 B_
57 57_ 1 1 1 1 0_
58 58_ 1 1 1 1 6_
59 59_ 1 1 1 1 7_
60 60_ 1 1 1 1 1 8_
61 45_S3 1 1 1 1 9_
62 41_S2 1 1 1 1 1 A_
63 60_S4 1 1 1 1 1 B_
64 30_S1 1 1 1 1 0_

Source: In the disassembly file bank_02.asm, the table starting at CPU address 02:B380: (NES file offset 0x00B390) ("tbl_0x00B390_stage_objects:") lists the starting position of characters and objects for each stage. The game uses an X position of 0 to indicate a character or object doesn't exist. If the X position is non-zero than it exists in the stage.


tygerbug

  Thanks for all that research, that clarifies things a lot.

  The multiple Sylvesters made a lot more sense as the Weasels in FDS Roger Rabbit, as they are standing in for multiple characters.

  I had noticed that the other enemies do shift palettes at times, and that explains it, since the palettes just aren't allocated. The "Sylvesters" and other common enemies are stuck with those palettes and the other enemies are underused (and don't have the same behavior, so can't simply be swapped out).

  It might be too complicated to actually allocate palettes based on the CHR banks used here, depending on how much space there is for code. It would be helpful though.

  I've been working on some new intro and ending artwork.
https://twitter.com/TygerbugGarrett/status/1575339537118609408

  I originally designed both with Honey Bunny appearances, but have switched to Lola Bunny. I might provide both as options, I don't know.

  Lola Bunny's head is referenced from Crazy Castle 4. (She also appeared in 3.)  The pose in both cases is referenced from the back of the Crazy Castle NES box.
http://www.vgmuseum.com/end/gbc/a/bugs4.htm
http://www.vgmuseum.com/end/gbc/a/bugs3.htm
http://www.vgmuseum.com/end/fds/a/roger.htm

  One hack nobody's done yet would be to use the graphics/characters from the Mickey Mouse Game Boy games. I have no plans personally ...

__________________________________________

EDIT: Title screen work at 8587/8597.

(sub_8587_draw_title_screen)

The title screen is mostly uncompressed tiles and can simply be pasted in, but that's the blank brick wall version. Each individual brick that falls, to reveal Bugs Bunny or Roger Rabbit, also has to be coded. The bricks start at 835D. They are 8 bytes (tiles) long, separated by "04 02." There are palette selections for what's under the bricks at 8325 (all 01 in Crazy Castle).

According to the Debugger, the ROM offsets are close to the code offsets -- 8951 in the headered ROM is 8941 in the code (ignoring the header).

At 894E, with my current title screen added, the code starts trying to draw the color attributes 11 tiles early at 2B B4 (20 59). It is trying to draw the attributes with some compression, and does not leave much room in the code to do so, stopping at 8965. The result is attributes drawn in the wrong places.

So my code is 11 bytes longer than the original title screen, which did use a little bit of compression. I can cut this down by skipping a line or two at top or bottom, or using the simple compression this game uses, explained by Cynepro:

; FF FF 00 - end token
; FF FF xx - xx is a counter for FF tile
; FF ?? xx - print ?? tile xx times
; ??       - if bytes start from something other than FF, print those bytes (tiles) until next FF is found

The method is explained in the FF disassembly (sub_EDA2_decompressing_screen_data), where it's triggered by FF being used. This screen doesn't really lend itself to such compression, as there's only a few spots where tiles repeat - on the title banner and some of the attributes.

Repeating one tile for the entire top row and making some further repeats later on (including any time FF is used in the attributes) gets us down to the correct length.

84C4 is a simple table for drawing the word balloon sprites on the title screen, called at 849D. It doesn't include positions for this. 8475 has a drawing routine. I would like to move or modify the word balloon but I don't see how to do so currently.

I designed a new word balloon, first with Honey Bunny, then two versions of Lola, which is what I'm using.

__________________________________________

sub_8956_draw_final_screen:
Inbetween the Title and Kemco, at 8966 (ROM), is the ending screen with Bugs and Honey Bunny. Again it's not quite uncompressed- the black areas are skipped with FF, although not much space is saved by it. This ends at 8D4C.

The result is that there's not quite enough room to draw the attributes correctly. Some of that "FF" type compression could free up space -- about 31 bytes are needed.

Using FF compression on a few strings frees up the necessary space here, and this ending is now implemented correctly.

For some reason, some color attributes in lower left are wrong compared to NESST output. It's not a big deal and I've manually replaced them with something which comes close (albeit in pink and blue rather than red and blue, since I had to guess at the appropriate bytes).

I then had to redo it, compressing it more, and those bytes worked this time. I had to redo it because of the background tiles used in the "Roger Rabbit / ACME Factory" ending scene, which I had to relocate to their original places. More on that in a moment.
__________________________________________

At (8D4D) 8D50 - 8DF9 is some code for the KEMCO logo and copyrights. I would prefer to draw an entire screen here, perhaps in free space in 95B9-9E10.

So I have to edit this:
sub_8010_kemco_logo_handler:
C - - - - - 0x008036 02:8026: 20 3D 8D  JSR sub_8D3D_draw_logo_screen
https://github.com/cyneprepou4uk/NES-Games-Disassembly/blob/main/Bugs%20Bunny%20Crazy%20Castle/bank_02.asm

EDIT: I've drawn a full extra screen here, which sets up the story, hijacking a subroutine.

__________________________________________

The animated ending from Roger Rabbit is skipped here. A static version is in the Proveaux hack.

I have created appropriate large sprites for Bugs and Lola Bunny for this Roger Rabbit ending, based on Crazy Castle 3 and Rabbit Rampage, although I didn't put as much polish into the work yet as I would have if I felt it was going to be used. Bugs is larger and darker than maybe he should be (or Lola is smaller), and half of the CHR bank is a tile salad.

I've put the 16 background tiles from this Roger Rabbit ending into the Lola ending - they're present but unused in Crazy Castle - and also in the level GFX bank.

I would suggest the level CHR table be moved to B134. 24B1 replaces 71EB at FFD2 in the ROM.

This is because the Proveaux Roger Rabbit hack uses that space for its ending already. I am still trying to get this to actually run.

EDIT1: Got it to run, but it -- calls blank CHR graphics?

EDIT2: Hijacked one of the later subroutines, rewrote it elsewhere with code which calls the CHR graphics as needed. Working now.

EB80 (70EB) Call for Roger Rabbit ending in Proveaux Hack
95c0 (b095) Roger Rabbit ending in Proveaux Hack

________________________________


https://www.romhacking.net/hacks/1620/

  I don't really "get" what the code is doing in the Roger Rabbit / factory ending at 95c0.

  I can see where it draws Jessica's sprite, and the concrete floor. Where it's drawing Roger and the rest of the background, I don't know.

  Nothing along those lines is lighting up in FCEUX's code/data logger, or is obvious in that section of the code.

  So I've been able to "correct" those but not the rest of the scene. (Which is a static version of something that's fully animated in Roger Rabbit FDS.)

  The uncompressed playfield and metasprite are obvious in the nametable and sprite RAM when playing, but nothing matches in the ROM.

  Similarly, the FDS code for this ending is inscrutable to me but visible in NES RAM.

  There is an FDS to NES conversion - using a strange mapper - called Lucky Rabbit - and I wonder if I could salvage any code from that, or the FDS game, or just see how it runs.

  The code for the last level is YTKX, and invincibility Game Genie code is GXETZZEI.

    I could do a bodge job just moving the graphics around to where the ROM currently thinks they are, but that's not ideal - Bugs wouldn't be the right shape and I'd have to redo work elsewhere.

https://drive.google.com/file/d/1NiYmXoQc_tFstScLnhmj9O9MCglcQfNV/view?usp=sharing

  I'm not sure why, but in the Proveaux Roger Rabbit hack, the invincibility code will cause Roger to kill weasels by touching them, while in the regular game and this hack he does not touch the enemies at all. I don't think it affects normal gameplay, but it's a difference here.

________________________________

EDIT: So I've done a bodge job, moving the various tiles to where the Roger Rabbit / Factory ending expects them to be. This gives me no control over Bugs' sprite here and I had to redo the code for two cutscenes and the Bugs/Lola metasprites. I'd still like to figure out how this code actually works, but this will do for now. I had to redesign one Bugs sprite so that his ears are down and thus fits in the space originally intended for Roger.
________________________________


New level table:

00 0A 07 06 08 00 09 0A 07 06 00 09 0B 08 07 06 09 0B 0A 00 06 0B 09 08 07 06 00 0B 0A 09 06 08 00 0B 0A 07 08 0A 00 09 06 08 0A 07 00 0B 06 09 08 0A 06 0B 07 08 0A 09 00 07 0B 06 0A 09 06 00

I went through Bavi_H's work, where he noted which enemies show up in each level. From this I tried to work out an order which wouldn't be too repetitive and which would include every enemy and give a good mix.


There's more that could be figured out here, but this is probably releasable.

Cyneprepou4uk

Why do you bother with hex editing if you can edit the disassembly?

tygerbug

https://drive.google.com/file/d/1XwMBKbX0uMcTRdLBO4rYLuezUiKvG6pS/view?usp=sharing

  Your disassembly has often been invaluable in figuring out what exactly the code is doing.

  It hadn't occurred to me to edit the disassembly itself but I find it easier to edit the hex in the ROM. That's what I'm used to, and if I'm confused about something I can check it in real-time in FCEUX. I also don't want data to shift around in the ROM.

  Maybe on another project.

  If there were a disassembly of the Roger Rabbit FDS ending somehow, or the Lucky Rabbit bootleg version of it, maybe I could figure out how to implement it properly (unless it was cut for space reasons I suppose, or even so).

  I had meant to experiment with that a bit, although my current compromise version is ... fine.

  I would have copied some of the code into the ROM, knowing that it wouldn't run but trying to check it in the Debugger.

________________________________


  I designed all the enemy animation based on the tile layout in the CHR, without checking it in the code, and now that I have, the code of the actual game seems to be wrong in several places.

  There is some additional animation of Yosemite Sam's head which the ROM doesn't implement. The enemies here don't have animated heads at all, and so they didn't bother to implement these tile swaps. Similarly, some additional defeated animation for Yosemite Sam (lower middle tile) is also in the CHR but not used- another apparent oversight.

  Sylvester's defeated animation uses the wrong tiles for his kicking feet, swapping the lower tile between the two animation frames.

   Wile E. Coyote is missing a tile in one frame of his defeated animation, replaced with a blank one. This doesn't show because of how he's designed, but does show in my designs. Possibly also true of Sylvester?

   I've fixed this stuff but will have to check for further issues.

    I can also verify that Daffy's defeated animation, which only takes up one row of tiles, plus one tile of his kicking feet, actually takes up two full rows of tiles in the code, but blank tiles are inserted. I expected this since this isn't true in "Roger Rabbit."

  I had drawn some very squashed art for these particular enemies, but it is therefore possible to draw them in full, unsquashed form if two or three more tiles can be stolen from elsewhere in the CHR. Probably by mirroring some of the other sprites, like the pipe bulges, or blip-out, or potion. You could also, I suppose, remove "Pause."

  The blip-out uses six tiles but could be done in two.

   This frees up four tiles, three to give Daffy (etc) the full six tiles in defeat, and one for Sylvester, since some of the common enemies (Tasmanian Devil, Marc Anthony, Foghorn Leghorn) are missing a few pixels without this tile.

   It wouldn't be out of line to free up more space and give the enemies more animation, but this project has probably gone far enough in that respect.


________________________________

The nametable for the ACME Factory ending is visible in Lucky Rabbit's code at 18FDB-193B5. It is followed by the nametable for the final image of Jessica and Roger. It is preceded by a nametable for a version of the brick wall which appears in the opening, and before that by -- I think -- the metasprites from the Factory ending, in a somewhat abbreviated format also used in the game itself.

There is blank space in Lucky Rabbit which ends at 16C50. I'm not sure how long the relevant code is in what follows. It's clear that this bootleg is much looser in how it uses its space than the Crazy Castle ROM.

Pasting a little of it into Crazy Castle gets Debugger results which are mostly nonsense ...

https://youtu.be/emTCTsgn8dc?t=856

Changing Lucky Rabbit's (unique) Mapper to 2, in Mesen, causes it to briefly say "loading" before loading a black screen.

https://drive.google.com/file/d/1XZPzymiyWxwZIgXiSNwMuueFgamBOH0T/view?usp=sharing
https://drive.google.com/file/d/1PCvUHpz6Uq_kMe52tRXwbiDktNuWVQmc/view?usp=sharing


________________________________


SpiderDave's notes on the Proveaux hack's ACME Factory ending:

0987E 0986E                           ; ending subroutine
095C0 095B0                           org $95b0
095C0 095B0 A5 FF                         lda $ff
095C2 095B2 29 7F                         and #$7f
095C4 095B4 85 FF                         sta $ff
095C6 095B6 A9 00                         lda #$00
095C8 095B8 8D 01 20                      sta $2001   ; ppu mask
095CB 095BB 20 73 99                      jsr $9973   ; clear all sprites
095CE 095BE 20 6E 98                      jsr $986e   ; draw background tiles
095D1 095C1 20 08 99                      jsr $9908   ; draw ground
095D4 095C4 20 38 96                      jsr $9638   ; load palette
095D7 095C7 20 23 99                      jsr $9923   ; load nametable attributes
095DA 095CA 20 95 98                      jsr $9895   ; draw switch
095DD 095CD 20 DF 98                      jsr $98df   ; draw rope
095E0 095D0 20 01 98                      jsr $9801   ; draw bugs
095E3 095D3 20 D7 97                      jsr $97d7   ; draw lola

looks like we need to write to $7c0 before doing the bugs routine
to change his x position

08010 08000                           bank $02
08010 08000                           base $8000
08010 08000                           
095E0 095D0                           org $95d0
095E0 095D0                               ;jsr $9801   ; draw bugs
095E0 095D0 20 CD FF                      jsr newBugs
095E3 095D3                               
0FFDD 0FFCD                           org $ffcd       ; free space (i hope)
0FFDD 0FFCD                           newBugs:
0FFDD 0FFCD A9 20                         lda #$20    ; load x pos for bugs
0FFDF 0FFCF 8D C0 07                      sta $7c0    ; store
0FFE2 0FFD2 4C 01 98                      jmp $9801   ; draw bugs

Pasted to 9A70: 68AA68A8A9508DC0074C019860FFFFFF

This moves Bugs rightward. There's free space there until 9C37.

989E - brick type for background (alternate lines)

9902- rope length (0D)

In the Bugs routine there's a LDA $9653,X -- and at 02:9653 (file offset 0x9663) some of that data controls where it gets his tiles from. Changed the first byte of that to a 0x0c as a test.

After that there's a 0c and 88 so i think maybe that's stop values for x and y to determine the bounds.

Bugs Bunny Crazy Castle Compression

 Uses a rudimentary RLE compression.

 FF xx yy  Output tile xx yy times.
 00-FE     Copy input to output.
 FF FF 00  End of data.  The second byte can be anything, but FF is used.
https://drive.google.com/file/d/1tdqTHNzz5Hp_XvGB204rR3706il9VtXL/view?usp=sharing

Select Screen data:
03:d7d6 (file offset 0xd7e6)
0x33d bytes

The blinking word or thought bubble from the title screen is in bank 2 bra_8124_loop
Try changing the cmp #$3d to cmp #$50 or higher to affect its blinking.
Also that 1e is how many times to blink before exiting title screen.

You can get about 5 bytes from removing useless stuff around here too
The JMP loc_811E a short bit above is useless as noted in comments, and then it has
loc_811E:
C D 0 - - - 0x00812E 02:811E: A0 00     LDY #$00
bra_8120_loop:
C - - - - - 0x008130 02:8120: A9 00     LDA #$00
C - - - - - 0x008132 02:8122: 85 71     STA ram_0071
 which could just use sty instead of even loading to the A register

I think I fixed the use of duplicate blank tiles using Cadeditor. I've Xed out all the duplicate blank tiles and I don't see any Xes during play. In theory this would allow for more design work on the selection screen and in the levels, since it frees up 40 tiles.

All of this could be useful for future hackers.


EDIT: I've replaced the forty duplicate or blank tiles with an image of Bugs' head for the menu screen, and corrected the result in CADEditor to actually free up the tiles.

Arguably the levels themselves could use more tiles instead, but I don't know if there's block space for that, since some blocks have properties like being a door.

I have also experimented a bit with the color scheme.  There's a few different directions I could go with that, and it's tempting to do different things with different level packs.

The animation of the characters is too fast, I think. It's why the characters aren't overly animated, and any animations imported from later Crazy Castle games look very odd here, and had to be toned down. Not sure how to fix that.

tygerbug

https://www.romhacking.net/hacks/7201/

The ReadMe explains the technical details of the hack and what I'm still hoping to accomplish with the ending at some point.

Adding the two extra cutscenes to Birthday Blowout would also be an accomplishment for the future.