MEGA65 / mega65-user-guide

MEGA65 User Guide
75 stars 51 forks source link

BASIC example COLLISION #210

Closed MauriceMEGA65 closed 2 years ago

MauriceMEGA65 commented 3 years ago

I do not know what to expect from this example program. A red sprite is moving downward, a white sprite upwards, but I never see line 80 'PRINT "BUMP RETURNS"' in action.

gurcei commented 3 years ago

I also couldn't get the example to work.

I had a look in the unofficial c65manual.txt file (from the original c65 team). For the 'COLLISION' command, the noted " [ THIS MIGHT CHANGE ]", which gives me the impression that this command was a 'work-in-progress' and may have not been completed.

The example in our docs looks very similar to one in c65manual, so I tried typing the latter example, it also failed to work.

I tried using original 911001.BIN rom, again neither worked. So it all adds to my gut feeling that this was a 'work-in-progress' command, and probably something we can look into repairing as time rolls on.

Given that, I don't mind the docs staying as they are, with the hope that we will aim to fix the implementation later. Happy to keep the card open till that day comes.

gurcei commented 3 years ago

Oh, in addition to this, I noticed that the BUMP(1) command doesn't perform as expected either (for outputting a bitfield of the sprite-to-sprite collisions), even on original 911001.BIN rom, so perhaps the problems with BUMP and COLLISION are intertwined

gurcei commented 3 years ago

Also, I tried running the example on the VICE C128 emulator, to see how it would have behaved back then, and yep, it works fine there: image

So I can only assume that somewhere along the way, as the C128 code evolved into the original C65 rom code, there were breakages in these BUMP and COLLISION commands, so we can look into them in future.

Edilbert commented 3 years ago

We need to determine, whether this is an issue of the VIC, the BASIC ROM or the example. I never tested the sprite collision stuff. Let's postpone this until we've finished the print manual.

MauriceMEGA65 commented 3 years ago

Clear, so it's save to leave the BASIC program as it is in the manual?

gurcei commented 3 years ago

It was asked on Discord whether the issue occurred on hardware. I can confirm that this issue occurs on hardware. I made a few video captures in this discord thread:

There, I shared: 1) A vid of the COLLISION program running on my devkit 2) A vid of me running a small loop to assess if the sprite-sprite collision flag is triggering (written to the border colour)

5 POKE 53280,PEEK(53278)
7 GOTO 5

3) A vid of the same program running on the VICE C128 emulator, for comparison.

MauriceMEGA65 commented 2 years ago

Any idea yet where the issue might be?

lydon42 commented 2 years ago

Newest development bitstream does fix this problem on hardware (not xemu). Tested with test program here and with C64 Space Invaders. http://gamebase64.com/game.php?id=10100&d=18&h=0 (and I would label this issue as "not an user guide issue")

MauriceMEGA65 commented 2 years ago

Great work, thanks a lot!!