CPCWiki forum

General Category => Games => Topic started by: 40Crisis on 20:38, 13 March 22

Title: Bug display fix for Ping Pong (Imagine Software)
Post by: 40Crisis on 20:38, 13 March 22
              Hi,

Ping Pong is for me, one of the best cpc game, very simple but with a great playability.
One of the most addictive game on cpc.
Sadly it has a graphical bug that doesn't affect gameplay, but has always annoyed me because it remains
on screen visible after occurring.
Part of the ping pong ball / shadow of the ball are displayed at a wrong position in Y and not erased.
Sometimes part of ping pong racket also appears and remains.

It occurs quite frequently when the human player (down) shoot the ball outside of the ping pong table (left or right side).
Here are some screen captures to show the problem.

You can see the problem on this video around 01:13



First, I wrote a patch triggered by a key to refresh the whole display.
But after passing countless hours hunting for the bug and narrowing code areas, the root cause seems to have its origin
in an overflow in add a,b instruction at $4fad when calculating the difference in height to be added
to the ball and its shadow later at $5003 and $5016.

Proposed patch to fix bug:

At $4FAB memory location put $CD $00 $20
at $2000 memory location put $87 $83 $80 $D0 $FE $7F $D0 $3E $FF $C9

For information, the game uses cpc firmware calls for example to read keyboard, joystick, set colors, wait flyback, etc...
For this reason it doesn't make use of z80 alternate register set.


The manual says Amstrad version by  "Arcana Software Design", produced by D.C. Ward.
They are also credited for Donkey Kong by Ocean Software.

Anybody has more information about the author(s) ?


Enjoy.
Title: Re: Bug display fix for Ping Pong (Imagine Software)
Post by: Devlin on 22:43, 13 March 22
Quote from: 40Crisis on 20:38, 13 March 22First, I wrote a patch triggered by a key to refresh the whole display.
But after passing countless hours hunting for the bug and narrowing code areas, the root cause seems to have its origin
in an overflow in add a,b instruction at $4fad when calculating the difference in height to be added
to the ball and its shadow later at $5003 and $5016.

Proposed patch to fix bug:

At $4FAB memory location put $CD $00 $20
at $2000 memory location put $87 $83 $80 $D0 $FE $7F $D0 $3E $FF $C9

This has excited me in two ways:
First, is that I now know that it's a game bug and not my 464 being a dick, the second is that it can be fixed.

Could the game code itself be changed to fix this?
Title: Re: Bug display fix for Ping Pong (Imagine Software)
Post by: TotO on 14:33, 14 March 22
On of the best CPC game at its time. Thank you for the fix! 8)
Title: Re: Bug display fix for Ping Pong (Imagine Software)
Post by: eto on 23:10, 26 April 22
Is there a fully patched version for download? Or if not, for which exact DSK will this patch work?
Title: Re: Bug display fix for Ping Pong (Imagine Software)
Post by: MaV on 01:25, 27 April 22
There you are.

I used the "UK 1985" disk version from cpc-power (not the original and not the trainer) and added a new BASIC loader that patches the game.
Powered by SMFPacks Menu Editor Mod