Chuckie Egg... with more colour!

reminisce about bbc micro & electron games like chuckie egg, repton, elite & exileRelated forum: adventures


Post Reply
User avatar
Rich Talbot-Watkins
Posts: 1430
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca
Contact:

Chuckie Egg... with more colour!

Post by Rich Talbot-Watkins » Fri Apr 29, 2005 11:31 am

I decided to take a look at Chuckie Egg the other day and figure out why it used so little colour for a Mode 2 game. It turns out that it can be persuaded to display as much colour as the Speccy version...

Image

...with a little prodding.

From the disc image on this site, load it with this Basic program instead of the regular one:

Code: Select all

   edit: new patch below
Hopefully this now makes the Beeb version a contender for the Best Version Ever.

(The reason Chuckie Egg is so stingy on colour is that it defines lots of the palette to be the same colour (yellow or cyan) so that the places where sprites overprint using EOR (e.g. birds on ladders) look OK. However it's easy enough to get the eggs in white, and then the status is made red by a good old-fashioned raster interrupt.)

Of course, this has just reminded me how addictive Chuckie Egg is...
Last edited by Rich Talbot-Watkins on Tue Dec 20, 2005 11:01 am, edited 1 time in total.

User avatar
CMcDougall
Posts: 6515
Joined: Wed Feb 02, 2005 3:13 pm
Location: Shadow in a Valley of Scotland
Contact:

Speccy

Post by CMcDougall » Fri Apr 29, 2005 3:54 pm

Dont see the diff with beeb version and crap speccy version, apart from red background 4 score, and the ladders change colour when u/geese go past them. So it really worse, and ive played it on the speccy MESS emulator, what a lot of crap! Cant even get up ladders properly, and also jumping! :evil:

Anyway, might give that wee proggy a go 2night 4 tha beeb. Cheers :!:

User avatar
Rich Talbot-Watkins
Posts: 1430
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca
Contact:

Post by Rich Talbot-Watkins » Sat Apr 30, 2005 8:09 am

(post deleted - refers to old version of patch!)
Last edited by Rich Talbot-Watkins on Mon Aug 07, 2006 8:52 pm, edited 1 time in total.

User avatar
Samwise
Site Admin
Posts: 1823
Joined: Mon Mar 14, 2005 9:13 pm
Contact:

Re: Chuckie Egg... with more colour!

Post by Samwise » Sat May 07, 2005 10:26 pm

Rich Talbot-Watkins wrote:Hopefully this now makes the Beeb version a contender for the Best Version Ever.
Well, I think it's safe to say that the majority of people reading this forum probably had the beeb version pegged as that already, even before your enhancement .. :)

I've added your loader to my site, Rich - it is definitely, most awesome.

For anyone wondering what the effect of the patch is:

Image

To save typing, there's a .SSD image of the latest patch provided with the Resource Kit from my site and I'll send it on to Dave for inclusion in the STH archives as well - probably under the Cheats/Ready Trained section I'd imagine.

Check this out Chuckie fans, it's the most colourful upgrade of all the hacks & upgrades I've detailed on the site ...

Sam.
The Chuckie Egg Professional's Resource Kit
http://www.bagshot-row.org/chuckie-egg/

garfield
Posts: 400
Joined: Mon Jan 03, 2005 1:38 am
Contact:

Post by garfield » Mon May 09, 2005 9:34 am

Rich Talbot-Watkins wrote:Cheers!
Nice one RTW!

User avatar
Rich Talbot-Watkins
Posts: 1430
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca
Contact:

NEW patch

Post by Rich Talbot-Watkins » Mon May 09, 2005 12:59 pm

Hi all,

I have a better patch than the one above, which doesn't require the raster interrupt as before, but actually sneaks an extra colour into the palette. This new patch is the version on the Chuckie Egg site.

Scrap the old one above, and try this:

Code: Select all

  10 HIMEM=&3100
  20 P%=&380:[OPT2
  30 LDA&7F:PHA:LDA#136:STA&7F
  40 JSR&1902:PLA:STA&7F:RTS:]
  50 *L.CH_EGG 3100
  55 IF !&49AB=&202AD720 A%=&4B7D:B%=&4CE6
ELSE A%=&4B73:B%=&4CDC
  60 A%?1=7:A%?11=1
  70 ?B%=32
  80 ?&3CC4=138:?&3D01=138
  90 ?&3DFD=136
 100 ?&3B0D=128:?&3B0E=3
 110 ?&3D23=128:?&3D24=3
 120 P%=&900:[OPT2
 130 LDX#&27:LDY#0:.q
 140 LDA&3100,Y:STA&1100,Y:INY:BNEq
 150 INCq+2:INCq+5:DEX:BNEq:JMP&29AB
 160 ]
 170 CALL&900
Enjoy.

User avatar
Rich Talbot-Watkins
Posts: 1430
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca
Contact:

How it works...

Post by Rich Talbot-Watkins » Mon May 09, 2005 1:18 pm

For those interested in how the patch works, and how I went about figuring it all out, here's a copy of a post I made recently to the BBC Micro mailing list...

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

We load the executable &2000 bytes higher than its load address to allow room for that Basic loader. All the code at lines 110-160 is concerned with is relocating the executable down to the right place (quickly) and running it.


Line 60:
These poke new colours into the palette used by the game.

We deduce that the palette is stored at &2B7D from the following code in the game:

Code: Select all

2B5B:  LDX #&0F         ; start at index 15
2B5D:  STX &88
2B5F:  LDX &88          ; loop start: get index
2B61:  STX &2B78        ; store colour index
2B64:  LDA &2B7D,X      ; lookup physical colour
2B67:  STA &2B79        ; store physical colour
2B6A:  LDX #&76
2B6C:  LDY #&2B
2B6E:  JSR &1A26        ; print string pointed to by &YYXX
2B71:  DEC &88          ; dec loop index
2B73:  BPL &2B5F        ; re-loop
2B75:  RTS
2B76:  <06>             ; length of string to print
2B77:  <13>             ; VDU 19
2B78:  <00>             ; poked with colour index
2B79:  <00>             ; poked with physical colour
2B7A:  <00> <00> <00>
As standard, the game makes special use of the following colours:

0 black (background)
1 yellow (eggs + lift)
2 magenta (grain + ladders + score)
3 green (platforms)
4 yellow (you + big bird+cage)
8 cyan (enemy birds)

The other palette entries echo these colours in appropriate ways. Since all sprites are EORed on the screen, other colours will arise, e.g. when a cyan bird climbs a ladder, we will get pixels in colour (8 EOR 2)=10. Hence the game sets colour 10 to cyan so we don't notice these artifacts (birds appear in front of ladders).

Now, it turns out that eggs have an independent palette entry (colour 1) to the main character and the big bird. This is so the big bird doesn't overprint eggs and leave a black egg-shaped hole (4 EOR 4 = 0). But this means we can trivially set this palette entry to colour 7 instead of 3 (?&4B7E=7). Voila, white eggs.

It also turns out there's an overprint which is never possible - cyan birds over green platforms (I think this is true anyway?). This corresponds to colour 11 (8 EOR 3), so we'll define this as red (?&4B88=1) and print our status sprites in this new colour.


Line 70:
This is a cosmetic change. We have changed colour 1 to white from yellow.

The main title 'CHUCKIE EGG' is printed in colour 1, so in order to make sure it stays in yellow, we now explicitly change its print colour to colour 4 (which is still yellow). Here's where this appears in the executable:

Code: Select all

2CE5:  LDA #&02   ; select physical colour 1 (PATCHED)
2CE7:  STA &7F    ; store in 'colour' variable used by sprite plotter
2CE9:  LDA #&30   ; select sprite &30 ('C' in 'CHUCKIE EGG')
2CEB:  LDX #&02   ; X position 2
2CED:  LDY #&F0   ; Y position &F0 (0=bottom, &FF=top)
2CEF:  JSR &2DBE  ; plot sprite
2DBE is a generic routine which takes a colour in ?&7F, a sprite number in A, and coordinates in X,Y, and draws a sprite. By changing LDA#&02 to LDA#&20, we plot the sprite in colour 4. (The value used is the one which would set the leftmost pixel of the byte to the desired colour in MODE 2).


Line 80:
these are involved with changing the colour the status sprites ('score', 'level', 'time', 'player', 'bonus') are printed in, from magenta (colour 2) to red (colour 11). In each case, there is code setting ?&7F to 8 (colour 2: magenta). We just want to change it to 138 (colour 11: red). ?&3CC4=138 deals with the 'score' sprite:

Code: Select all

1CC3:  LDA #&08   ; select colour 2 (PATCHED)
1CC5:  STA &7F
1CC7:  LDX #&00
1CC9:  LDY #&F8
1CCB:  JSR &1987  ; set up screen address from X/Y
1CCE:  LDA #&29   ; select sprite 'SCORE'
1CD0:  JSR &19DB  ; set up sprite address in A
1CD3:  JSR &1902  ; print sprite (screen+sprite addrs
                  ; must already be set up)
?&3D01=138 deals with the other status sprites:

Code: Select all

1D00:  LDA #&08   ; (PATCHED)
1D02:  STA &7F
1D04:  LDX #&00
1D06:  LDY #&E8
1D08:  JSR &1987
etc

Line 90:
This pokes a routine which appears to print the score for the first time. We want white scores, so we need to overprint the red background in colour (11 (red) EOR 1 (white)) = 10. This corresponds to a screen byte value of 136. This does mean that scores not on a red background (i.e. other players') will appear cyan (colour 10), but hey-ho, it's all a bit of extra colour isn't it?

Lines 20-40, 100, 110:
This is all to do with plotting digits. We already know that we need to print them in colour 10. The game used to plot them in colour 2 (which, overprinted on a background of colour 2 yields colour 0 - black). In these cases, colour 2 is already set up, so these pokes patch the call to the sprite routine (JSR &1902) and replace it with a call to my own assembler routine in lines 20-40:

Code: Select all

; generic number printing code (A = digit to print)
1B01:  PHA        ; save A
1B02:  JSR &1987  ; set up scrn address from X/Y
1B05:  PLA        ; restore A
1B06:  CLC
1B07:  ADC #&1F   ; add 31 (digits are sprites 31-40)
1B09:  JSR &19DB  ; set up sprite address in A
1B0C:  JSR &1902  ; print sprite (PATCHED)
1B0F:  RTS

; print player number
1D1A:  LDA &5D    ; player number
1D1C:  CLC
1D1D:  ADC #&20   ; digit 1 base
1D1F:  JSR &19DB  ; set up sprite address in A
1D22:  JSR &1902  ; print sprite (PATCHED)
My assembler routine just saves the colour at ?&7F, sets it to colour 10, calls the original routine, and then restores the old value of ?&7F. This seems to work very nicely because Chuckie Egg never touches the memory at &380..&3E0, so we're free to fill it with any patch code we need.

snark
Posts: 2
Joined: Wed Jun 08, 2005 7:32 pm
Contact:

Post by snark » Wed Jun 08, 2005 7:39 pm

It also turns out there's an overprint which is never possible - cyan birds over green platforms (I think this is true anyway?).
Found one :wink:
Level Three
Bird in the bottom right hand corner.

When it climbs the ladder it (slightly) intersects the block above it giving a slightly red head. Hardly significant - but it is there...

Chris.

User avatar
Samwise
Site Admin
Posts: 1823
Joined: Mon Mar 14, 2005 9:13 pm
Contact:

Post by Samwise » Mon Aug 07, 2006 1:27 pm

The disk image I submitted has finally made it into the STH archive:

http://www.stairwaytohell.com/bbc/archi ... olours.zip
Jul 10 2006 23:56:17 10042 bytes

I added a !BOOT loader and modified Rich's patch so that it includes the other cheat patches he posted to the BBC Micro Mailing List. On loading, it provides the options to toggle the various extra cheats/features, including the extra colours, all without modifying the original source files. It can be used with either of the two known variants of BBC micro Chuckie Egg doing the rounds on the internet ...

Well worth upgrading your original CE disk to this ... !

Sam.

Moist_Mog
Posts: 75
Joined: Sun Dec 11, 2005 7:46 am
Contact:

Post by Moist_Mog » Mon Aug 07, 2006 5:05 pm

Going a wee bit off topic... did anyone ever get past the third set of eight levels (i.e. past the set with the chickens only, then the set with the crazy duck only, then the set with both)...?

Cue a stream of 'yes' responses making me feel a bit inadequate... ;)

User avatar
sorvad
Posts: 2184
Joined: Wed Aug 24, 2005 12:13 pm
Location: Back of beyond
Contact:

Post by sorvad » Mon Aug 07, 2006 6:59 pm

I could get on to those levels but not sure how far into them I got, probably same as you. However I'm sure my nephew got a fair way into them.

User avatar
Samwise
Site Admin
Posts: 1823
Joined: Mon Mar 14, 2005 9:13 pm
Contact:

Post by Samwise » Tue Aug 08, 2006 9:06 am

Certainly did ... stealing from my own CE fansite, in relation to the BBC version:

Levels 1-8: First time round, there were two or three hens per level.
Levels 9-16: The second time around the duck came out of the cage, and would dive-bomb you all the time.
Levels 17-24: On the third time round, Harry has to avoid both the initial hens and the duck.
Levels 25-32: The fourth time round introduced the full compliment of five hens per level, making it even harder to avoid the duck.
Levels 33-40: Finally, the last set through had all five hens walking at top-speed, as well as the duck.

This last set was repeated all the way through until the final level (255, displayed as Level 0) - the only thing that changed from here was that the time available was reduced until it reached 100, which made it ridiculously hard to complete a level without losing a life.

When you complete level 255, it loops right back to level 1 and it all starts all over again ...

You can see screenshots with the initial placement of all five hens on each of the eight level layouts here:

http://www.bagshot-row.org/chuckie-egg/levels.html

HTH,

Sam.
--
The Chuckie Egg Professional's Resource Kit
http://www.bagshot-row.org/chuckie-egg/

P.S. I got past level 40 on my own, but getting to level 255 required the use of a level select - like the one built into the modified version of CE described in this thread! :)

User avatar
Samwise
Site Admin
Posts: 1823
Joined: Mon Mar 14, 2005 9:13 pm
Contact:

Post by Samwise » Sat Aug 18, 2007 1:15 pm

Just in case anyone's interested - Rich's Chuckie Egg colour hack was pictured in Retro Gamer's Issue 40 The Making Of... Chuckie Egg article, tho he wasn't actually namechecked.

Sam.

frankoid
Posts: 53
Joined: Wed Jan 10, 2007 9:18 am
Location: London
Contact:

CPC version

Post by frankoid » Thu Aug 23, 2007 9:04 pm

I tried the CPC version of Chuckie Egg recently and it is very similar to the BBC version but with more colours. The levels are squashed slightly to fit into 320x200 and if you jump and bang your head on the platform above you bounce off it downwards.

Image

Not quite as good as Rich's extra colours version, but definitely better than the Speccy one!

User avatar
Rich Talbot-Watkins
Posts: 1430
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca
Contact:

Re: Chuckie Egg... with more colour!

Post by Rich Talbot-Watkins » Sun Nov 14, 2010 10:27 am

Mega-BUMP!
snark wrote:Found one :wink:
Level Three
Bird in the bottom right hand corner.

When it climbs the ladder it (slightly) intersects the block above it giving a slightly red head. Hardly significant - but it is there...
I just noticed that the CPC version has exactly the same problem (the screenshot above, by some complete fluke, demonstrates exactly the scenario described above!).

I'm sure when they wrote the CPC version, they decided to make exactly the same improvements as I aimed to with my patch!

I'm just wondering why I didn't change the grain to red. I can't see any particularly reason why it shouldn't have been possible. Maybe I'll take a look at that one rainy day.

User avatar
guddler
Posts: 528
Joined: Sat Apr 04, 2009 9:43 am
Location: W.Somerset
Contact:

Re: Chuckie Egg... with more colour!

Post by guddler » Sun Nov 14, 2010 1:01 pm

Nice! Sadly, every time I play CEgg it just reminds me how much I can't! (if you see what I mean)

User avatar
Samwise
Site Admin
Posts: 1823
Joined: Mon Mar 14, 2005 9:13 pm
Contact:

Re: Chuckie Egg... with more colour!

Post by Samwise » Sun Nov 14, 2010 1:57 pm

Rich,

I think I can answer that. The reason you didn't make the seeds red at the time, was probably because you were imitating the original Spectrum colours, rather than the later Amstrad CPC version. In both the original BBC / Spectrum versions the bird seed was purple.

You can see below the Spectrum version colours.
spectrumlevel3.png
Spectrum Level 3 multi-player screenshot
spectrumlevel3.png (4.36 KiB) Viewed 4684 times
There were three differences remaining that I picked up on, that we discussed on the BBC Micro Mailing List five years ago.

1) Spectrum has white text on blue background for non-active players' scores
2) Spectrum's labels (like the word "score") are white
3) Spectrum lifts are yellow

I think we agreed it would have been cool to have blue on the palette, but you couldn't see a way to add it to the palette at the time. I also asked about switching the lift colours to yellow, but you didn't think that was feasible in a patch then, either.

Sam.

Fraser
Posts: 544
Joined: Tue May 20, 2003 7:21 pm
Contact:

Re: Chuckie Egg... with more colour!

Post by Fraser » Sun Nov 14, 2010 6:45 pm

The Spectrum version had to have the lifts and the bird cage yellow to avoid colour attribute clashes. White lifts were probably seen as an improvement. If the cage was another colour the bird would have to be behind the wires.

MatthewThompson
Posts: 1243
Joined: Tue Apr 22, 2008 3:44 pm
Location: Oxford
Contact:

Re: Chuckie Egg... with more colour!

Post by MatthewThompson » Tue Nov 16, 2010 1:12 pm

This looks brilliant, will have to download this, looks every bit as colourful as the Spectrum version now.

Many thanks for doing this.

MatthewThompson
Posts: 1243
Joined: Tue Apr 22, 2008 3:44 pm
Location: Oxford
Contact:

Re:

Post by MatthewThompson » Tue Nov 16, 2010 1:14 pm

Samwise wrote:Just in case anyone's interested - Rich's Chuckie Egg colour hack was pictured in Retro Gamer's Issue 40 The Making Of... Chuckie Egg article, tho he wasn't actually namechecked.

Sam.

Are you sure? i'm surprised Retro Gamer would even know that Chuckie Egg was released on the BBC given there incompetence and ignorance of BBC Micro (and Archimedes) versions of games.

User avatar
Samwise
Site Admin
Posts: 1823
Joined: Mon Mar 14, 2005 9:13 pm
Contact:

Re: Chuckie Egg... with more colour!

Post by Samwise » Tue Nov 16, 2010 2:19 pm

I'm sure. One of their credited sources was my site. ;)

If you like this, you might want to check out Chuckie Egg 2009 (Electron) and Chuckie Egg Professional Edition (BBC). The latter includes this extra colours patch along with a load of other stuff.

Sam.

User avatar
Samwise
Site Admin
Posts: 1823
Joined: Mon Mar 14, 2005 9:13 pm
Contact:

Re: Chuckie Egg... with more colour!

Post by Samwise » Tue Nov 16, 2010 3:02 pm

ceredseed.png
Chuckie Egg with Rich's Extra Colours Patch, including the red seeds
ceredseed.png (8.09 KiB) Viewed 4575 times
The seed can be changed to red, with the following additional code snippet to Rich's patch.

Code: Select all

115 ?&3C52=138:?&4319=138
Ta, Rich. An excellent piece of work. =D>

Sam.
Last edited by Samwise on Tue Nov 16, 2010 3:46 pm, edited 1 time in total.
Reason: Fixed patch (insufficient testing!)

BeebInC
Posts: 107
Joined: Sun Mar 19, 2006 11:58 am
Contact:

Re: Chuckie Egg... with more colour!

Post by BeebInC » Tue Nov 16, 2010 3:03 pm

It's about time you did something with those disassemblies I gave you :)

User avatar
Rich Talbot-Watkins
Posts: 1430
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca
Contact:

Re: Chuckie Egg... with more colour!

Post by Rich Talbot-Watkins » Tue Nov 16, 2010 3:14 pm

Nice work! You beat me to it =D>

I'm surprised it only needs one change - I expected that maybe it'd need two: one where the seed is plotted when the screen is drawn at the start, and one where the seed is erased when it's picked up!

Anyway, great hacking Sam - and it looks great with red seed. Now there's literally no use for a CPC at all :lol:

User avatar
Samwise
Site Admin
Posts: 1823
Joined: Mon Mar 14, 2005 9:13 pm
Contact:

Re: Chuckie Egg... with more colour!

Post by Samwise » Tue Nov 16, 2010 3:51 pm

@BeebInC, haha. Yeah, they have been a god-send. It's the only way I've been able to keep up with Rich when he's been patiently explaining the code to me.

@Rich Talbot-Watkins, yeah I beat you to it - with an insufficiently tested patch. Yes, you're entirely right that it needs two statements. Duly modified above. Sorry, I'm at work and didn't have time to test properly! :)

Hopefully, this one will do the job properly.

Sam.

User avatar
Samwise
Site Admin
Posts: 1823
Joined: Mon Mar 14, 2005 9:13 pm
Contact:

Re: Chuckie Egg... with more colour!

Post by Samwise » Sat Nov 20, 2010 11:58 pm

I figured if we were going to mimic the Amstrad seed colouring, then I might as well have a play to see if we could match the mixed colouring of the status bars in the Amstrad version.

Without any Rich-like mad coding skillz, I couldn't match it identically - but I did come up with a couple of alternatives that bear similarities.

Dunno if either could be considered an improvement on Rich's original patch or not, tho! Probably not. ;)

Sam.
nochangetodigitsorbottomstatusline.png
Chuckie Egg with Rich's Extra Colours Patch, but with no change to digits or the bottom status line
nochangetodigitsorbottomstatusline.png (4.06 KiB) Viewed 4467 times
nochangetobottomstatusline.png
Chuckie Egg with Rich's Extra Colours Patch, but with no change to the bottom status line
nochangetobottomstatusline.png (4.22 KiB) Viewed 4467 times

User avatar
CharlesMouse
Posts: 116
Joined: Sat Jul 24, 2010 10:59 am
Location: Nowhere
Contact:

Re: Chuckie Egg... with more colour!

Post by CharlesMouse » Wed Nov 24, 2010 6:10 pm

Such a marvellous thread...

Even back in the day I wasn't 'happy' that C-E on the Beeb was less colourful than other systems...
...I should probably be shamed to say I preferred the CPC version as a result.

Thanks for this chaps. :)

A question from a lazy so-and-so if you don't mind:
I downloaded the 'ChuckieEggProEditionbeta.zip' - all patches in one - lots of fun, thanks!
No red seed...
...no probs, I see how to do that further up the thread but haven't worked out where to add that to the ProEdition. Would someone let me know?
Thanks.
Charlie.

Are you pondering what I'm pondering? The Qube RiscOS Server

User avatar
Samwise
Site Admin
Posts: 1823
Joined: Mon Mar 14, 2005 9:13 pm
Contact:

Re: Chuckie Egg... with more colour!

Post by Samwise » Wed Nov 24, 2010 9:18 pm

The CPC version was one of the best official releases, but the squashed levels really do grate after a while. :/

The Chuckie Egg Professional Edition beta doesn't quite have all the possible patches in one. It's still in beta. :) I'll get the finished version out one day.

Meantime, I've updated the CE Pro Edition beta disc image to include the red seeds, so just re-download it and you should be good to go!

Sam.

User avatar
CharlesMouse
Posts: 116
Joined: Sat Jul 24, 2010 10:59 am
Location: Nowhere
Contact:

Re: Chuckie Egg... with more colour!

Post by CharlesMouse » Wed Nov 24, 2010 10:39 pm

Wonderful!

Thank you. :D
Charlie.

Are you pondering what I'm pondering? The Qube RiscOS Server

Post Reply