Was Bird Strike ever fixed?

reminisce about classic bbc micro and acorn electron games here
Related forum: adventures


iainfm
Posts: 101
Joined: Thu Jan 02, 2020 8:31 pm
Contact:

Re: Was Bird Strike ever fixed?

Post by iainfm »

billcarr2005 wrote:
Thu Jan 07, 2021 11:33 am
Only problem is that 83 + 82 are &25D4 and 85 + 84 are &284C, both code areas, which clears 284C and causes a crash next time that code is hit.
I'll try putting a breakpoint at 29E0 and seeing what the values are when things are working correctly!
I'm not seeing the same values as you, but they do appear to change during gameplay. Seems like a likely culprit is them getting set wrong, which is overwriting something somewhere though.

I'm struggling a bit with the beebem debugger. Even with it open and not doing anything the game slows to about 1fps (or less). Is that normal? I've got an oldish but decent (i7/16gb) laptop I'm running it on...
chrisn
Posts: 680
Joined: Sat Apr 19, 2014 12:31 pm
Location: UK
Contact:

Re: Was Bird Strike ever fixed?

Post by chrisn »

iainfm wrote:
Thu Jan 07, 2021 4:03 pm
I'm struggling a bit with the beebem debugger. Even with it open and not doing anything the game slows to about 1fps (or less). Is that normal? I've got an oldish but decent (i7/16gb) laptop I'm running it on...
That doesn't sound normal. The only time I see slowdown is if lots of messages are being written to the debug window - for example, if you switch on the Trace options. I'm interested to understand what's causing the slowdown, the only thing I can suggest is to try running BeebEm with default preferences (delete your Preferences.cfg file).
iainfm
Posts: 101
Joined: Thu Jan 02, 2020 8:31 pm
Contact:

Re: Was Bird Strike ever fixed?

Post by iainfm »

chrisn wrote:
Thu Jan 07, 2021 5:32 pm
That doesn't sound normal. The only time I see slowdown is if lots of messages are being written to the debug window - for example, if you switch on the Trace options. I'm interested to understand what's causing the slowdown, the only thing I can suggest is to try running BeebEm with default preferences (delete your Preferences.cfg file).
I'll give that a go thanks! Edit: Nah, that didn't make a difference :(

I've uploaded a few more memory comparisons to my repo this evening, which are quite interesting. Comparing &1200-&3FFF of a newly-started game with the birdsk2 file shows 40 differences (including 2 bytes for the score and the enabled cheat)

By level 20 (lots of glitches) there are 54, including trampled code and data areas (the level 20 spreadsheet has the most detail as to what these are)

By the game crash on level 23 there are 87 differences, so whatever the problem is grows kinda exponentially, or at least a huge amount as it keels over.

Quite interestingly, if I load my level 20 save state I can fix the clouds by restoring the following memory data locations (in handy beebem debugger format):

Code: Select all

c 2D47 2
c 2D48 D6
c 2D49 0
c 2D4A 0
c 2D4C 0
c 2D5F 80
c 2D60 40
c 2D61 40
c 2D63 80
c 2D64 0
c 2D65 40
I've not found anything that fixes the pigeons yet.
User avatar
billcarr2005
Posts: 1620
Joined: Fri Sep 09, 2005 4:01 pm
Location: UK
Contact:

Re: Was Bird Strike ever fixed?

Post by billcarr2005 »

Traced the "stray bullet" above the clouds on Level 13, which is caused by the data at &4040 becoming 01 04 04 01 01 01

Code: Select all

2CA8 INY
2CA9 LDA (8C),Y ; STA 80 - 2D47,19 = 2D60 = 40
2CAD INY
2CAE LDA (8C),Y ; STA 81 - 2D47,1A = 2D61 = 40
2CB2 BNE 2CBD
2CBD JSR 29C3

29C3 TYA ; PHA
29C5 LDY #05
29C7 CLC
29C8 LDA 80 ; ADC #78 ; STA 84
29CE LDA 81 ; ADC #02 ; STA 85
29D4 LDA 80 ; AND #07 ; EOR #07 ; STA 74
29DC CMP #05 ; BPL 29EB

29EB LDA (82),Y - 2350,5 = 2355 = 01
29ED EOR (80),Y - 4040,5 = 4045 = 00
29EF STA (80),Y - 4040,5 = 4045 = 01
29F1 DEY
29F2 BPL 29EB

29F4 PLA ; TAY
29F6 RTS
iainfm
Posts: 101
Joined: Thu Jan 02, 2020 8:31 pm
Contact:

Re: Was Bird Strike ever fixed?

Post by iainfm »

billcarr2005 wrote:
Thu Jan 07, 2021 8:07 pm
Traced the "stray bullet" above the clouds on Level 13, which is caused by the data at &4040 becoming 01 04 04 01 01 01
Cool, thanks! All that code is exactly as per the source, so that section of code hasn't been corrupted in itself (yet). Those two addresses (2D60, 2D61) seem to be a memory location within the code. Not sure what their purpose is though.

The stray bomb is interesting. It's not just the bomb getting copied into screen memory. It actually starts at &4040 just after the level loads, but before the enemies start swooping. It leaves a copy of itself behind, but does begin to fall, getting approximately half way down the screen before the first plane leaves its position. Edit: I've just noticed a stray bomb drops at the start of level 22, but at from different position (approx. a quarter of the way across the screen).

I've added a save state to github that has one plane remaining on level 12. Kill it (or the remaining pigeons) and the bomb glitch will appear.
Last edited by iainfm on Thu Jan 07, 2021 9:59 pm, edited 1 time in total.
iainfm
Posts: 101
Joined: Thu Jan 02, 2020 8:31 pm
Contact:

Re: Was Bird Strike ever fixed?

Post by iainfm »

I was working through some of the data locations tonight, and was playing around with &2D76 as it is referenced in quite a lot of places in the code. (So much easier now I've got BeebEm's debugger working a bit better).

This memory location seems to be used to control a few events. Some values (probably a specific bit; I've not worked it out yet) release a pigeon (or is a pigeon-in-flight flag) and setting it to &10 (bit 5) adds a note to the stave. Do this 12 times and you get the bonus.

Here's the interesting part though. Set it to &80 (bit 8) and the level ends as though it was completed. Do this 12 times (from a new game) and the glitches start to occur, and proceed to get worse as though you're playing though the game.

So, we've got a quick way to start and test the glitches, and something to work backwards from, ie see what happens when &2D76 is &80 and follow the code from there...but that's tomorrow's task. :mrgreen:
iainfm
Posts: 101
Joined: Thu Jan 02, 2020 8:31 pm
Contact:

Re: Was Bird Strike ever fixed?

Post by iainfm »

Bit more progress today - various start-of-level subroutines and memory locations identified. Quite a lot of them ruled out as being the culprit...I think.

My hunch at the moment is it's something to do with memory address &2D79. I don't know what its purpose is, but it starts at &20 (32) and gets decremented by two every two levels.

It's value gets loaded into the accumulator by .L20DA (called from L20D0) if &7D is positive (<128), but then &80 immediately gets loaded into A, EOR'd with &C0 and stored back at &80 (I'm really just thinking aloud here :lol:)

Next chance to play with it I get I'm going to try watching one of the memory locations that changes and see if I can get a trace of what changed it. :D
iainfm
Posts: 101
Joined: Thu Jan 02, 2020 8:31 pm
Contact:

Re: Was Bird Strike ever fixed?

Post by iainfm »

I... I... I think I've fixed it. Or at least had a breakthrough.


NOPping out the two INC &1A09 statements at &1F03 stops the corruption from happening. I've not worked out why, or what effect not incrementing this has. But, with invincibility enabled it's got well past the point of crash in BeebEm running at 100x with return held down :D

For those playing along, here's the beebem debugger codes to do the NOPping.

Code: Select all

c 1F03 EA
c 1F04 EA
c 1F05 EA
c 1F06 EA
c 1F07 EA
c 1F08 EA
fuzzel
Posts: 718
Joined: Sun Jan 02, 2005 1:16 pm
Location: Cullercoats, North Tyneside
Contact:

Re: Was Bird Strike ever fixed?

Post by fuzzel »

Brilliant work iainfm, your dogged perseverance has finally paid off! I've been following this thread with interest because Bird Strike was one of my favourite games as a kid, not in terms of playing for hours and hours racking up huge scores (like Chuckie Egg), more along the lines of going back frequently to it along with Arcadians when I fancied a quick shoot-em up to while away half an hour or so. It's hard to pin down what the appeal was, I suppose I liked the novelty of the tune that gets composed as you kill the birds and the gravestones that appear in the churchyard as you shoot down the airplanes. There's also a hard to define precision in the way you move and shoot that appeals (is tight the right word?) I've been trying to work my way up to the bug level but I'm only about half-way at the moment. Incidentally I've lost track of what level I've made it up to and I can't see from the screen what level I'm on. Am I missing something? I never encountered any bugs as a kid but maybe I got killed or got bored before I reached that level. It's a bit disappointing that Firebird didn't spot the bug before releasing it, they must have played the first few levels, liked it then said yes to publishing it. Would you expect the author to have spotted it when writing it or do games developers never like playing their own games?
iainfm
Posts: 101
Joined: Thu Jan 02, 2020 8:31 pm
Contact:

Re: Was Bird Strike ever fixed?

Post by iainfm »

fuzzel wrote:
Fri Jan 08, 2021 6:49 pm
Brilliant work iainfm, your dogged perseverance has finally paid off! I've been following this thread with interest because Bird Strike was one of my favourite games as a kid, not in terms of playing for hours and hours racking up huge scores (like Chuckie Egg), more along the lines of going back frequently to it along with Arcadians when I fancied a quick shoot-em up to while away half an hour or so. It's hard to pin down what the appeal was, I suppose I liked the novelty of the tune that gets composed as you kill the birds and the gravestones that appear in the churchyard as you shoot down the airplanes. There's also a hard to define precision in the way you move and shoot that appeals (is tight the right word?) I've been trying to work my way up to the bug level but I'm only about half-way at the moment. Incidentally I've lost track of what level I've made it up to and I can't see from the screen what level I'm on. Am I missing something? I never encountered any bugs as a kid but maybe I got killed or got bored before I reached that level. It's a bit disappointing that Firebird didn't spot the bug before releasing it, they must have played the first few levels, liked it then said yes to publishing it. Would you expect the author to have spotted it when writing it or do games developers never like playing their own games?
Thanks very much! Yeah, I liked it for all those reasons too!

No, there's no level indicator on the screen anywhere. If you're running in an emulator that has a debugger you can query memory address 1D5C, which stores the level in hex. There's not a whole lot of point in storing it (it could easily have been stored as 0, 1, 2, 3 repeating) as there's no change to the difficulty or anything as the levels progress. Working through the code, there do appear to be a few indications that other features were planned (or removed), so maybe this was one of them. It probably wouldn't be too hard to add a level indicator, either on screen or a pop-up when levels start.

Software testing...probably wasn't (as) much of a thing back then. As for the programmer, I can only imagine how much harder it would have been doing this without a proper editor or debugger. Having said that, setting a key to increase the level (or other things) when it was pressed would have been straightforward enough to implement. He could have done that and seen how his game behaved as the levels went up.

I think it's more that programmers should never test their own code, but as I alluded to, software testing has progressed a bit since 1984!
iainfm
Posts: 101
Joined: Thu Jan 02, 2020 8:31 pm
Contact:

Re: Was Bird Strike ever fixed?

Post by iainfm »

I'm struggling a bit to explain why this is the problem/fix...maybe needs someone with better 6502 skills than me (so that's pretty much anyone) to provide a full analysis.

From what I can fathom:

&1A09 is defined in code as &FF and gets set to zero when a new game starts.
&1A09 gets copied to &2D47 after &2D0A to &2D5E gets zeroed by the code at .L1F2E
So far so not very interesting.

When an new game starts (NOT every level), a load of zero page values get set up, including:
&008C to &47 and
&008B to &2D

I think some zero page addressing is going on that references &2D47, but I can't figure out why that would lead to the wrong areas of memory being written to...
User avatar
billcarr2005
Posts: 1620
Joined: Fri Sep 09, 2005 4:01 pm
Location: UK
Contact:

Re: Was Bird Strike ever fixed?

Post by billcarr2005 »

Tangentially sounds like I stumbled on something similar, although didn't realise it...
I was resetting 1A09 to 1 at the start of levels, since I'd mistakenly(?) thought it made the planes a lot easier to destroy, from my notes

Code: Select all

1a09 number of hits to kill plane? (sta 2d47 @ 1f34)
This must have been why my crash only occurred on level 35 #-o
iainfm
Posts: 101
Joined: Thu Jan 02, 2020 8:31 pm
Contact:

Re: Was Bird Strike ever fixed?

Post by iainfm »

billcarr2005 wrote:
Fri Jan 08, 2021 9:41 pm
Tangentially sounds like I stumbled on something similar, although didn't realise it...
I was resetting 1A09 to 1 at the start of levels, since I'd mistakenly(?) thought it made the planes a lot easier to destroy, from my notes

Code: Select all

1a09 number of hits to kill plane? (sta 2d47 @ 1f34)
This must have been why my crash only occurred on level 35 #-o
Haha, yep!

I don't think there's a hit counter on enemy planes. The instructions say (something like) 'hit them dead centre to destroy them, or wing them to release a carrier pigeon'.

Sometimes the planes seem a lot easier to hit than others. I think it's where they start from. Even when firing continuously from the centre position (at 100x speed and invincibility enabled) you'll sometimes finish a level with the pigeon bonus instead of killing all the aircraft.

It's a neat idea for an 'enhancement' though - enemies are tougher (and faster?) as levels advance.
iainfm
Posts: 101
Joined: Thu Jan 02, 2020 8:31 pm
Contact:

Re: Was Bird Strike ever fixed?

Post by iainfm »

I've built a fixed version and put it in my github repo for anyone that wants to try it out!

It's as close to the original as possible, so requires BirdSk1 to be loaded first (!BOOT take care of all of this, of course).

Either replace $.BirdSk2 on your floppy/image with the one in my repo (.INF file included for BeebEm users) or download the full .ssd file containing the patched game here

All memory locations (apart from the patch and a little credit for myself) are the same as the original, so set &2238 to &60 for invincibility etc. :D
iainfm
Posts: 101
Joined: Thu Jan 02, 2020 8:31 pm
Contact:

Re: Was Bird Strike ever fixed?

Post by iainfm »

For info, that's probably not going to be the final build/fix... I'm continuing to home in on the actual point of failure.

I've started a thread in the programming section that gets into the nitty-gritty of it :)
User avatar
BigEd
Posts: 3751
Joined: Sun Jan 24, 2010 10:24 am
Location: West Country
Contact:

Re: Was Bird Strike ever fixed?

Post by BigEd »

iainfm wrote:
Sun Jan 10, 2021 11:00 am
I've started a thread in the programming section that gets into the nitty-gritty of it :)
For reference: 6502 Debugging Challenge
iainfm
Posts: 101
Joined: Thu Jan 02, 2020 8:31 pm
Contact:

Re: Was Bird Strike ever fixed?

Post by iainfm »

I discovered my original fix had an unwanted side-effect - double-shooting wasn't possible any more, so it looks like &1A09 has something to do with that.

So, my favoured fix now is instead of LDA-ing &1A09 at &1F34 (before storing it to &2D47) I'm LDA-ing #&02 (the value that's initially set at &2D47) and NOPping once to keep the addresses aligned with the original afterwards.

I've updated the repo with a new .asm file, binary ($.BirdSk2) and disk image.
User avatar
lurkio
Posts: 3155
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Was Bird Strike ever fixed?

Post by lurkio »

My understanding of the current state of affairs is that the bug appears to have been fixed, but we're not sure exactly how!

Is that a fair summation?

:?:
iainfm
Posts: 101
Joined: Thu Jan 02, 2020 8:31 pm
Contact:

Re: Was Bird Strike ever fixed?

Post by iainfm »

lurkio wrote:
Wed Jan 13, 2021 4:10 pm
My understanding of the current state of affairs is that the bug appears to have been fixed, but we're not sure exactly how!

Is that a fair summation?

:?:
Yeah, well, I know how (sort of) but I can't quite pin down the precise chain of events, or why the value/memory location that gets incremented leads to various other addresses going haywire :lol:
Post Reply

Return to “8-bit acorn software: classic games”