Fix the mouse interrupt based VBL for the //c and //c+. This used to work under cc65 v2.13.3 but when I moved the codebase to cc65 v2.17, the mouse driver interrupt handler changed. It used to call the "show" callback routine when handling the interrupt. In v2.17, it stopped calling "show" from the interrupt handler and instead called a new "draw" callback. Because the "show" callback was not being called, the game would wait forever for a VBL interval on the //c and //c+. This fixes the problem by setting the "draw" hook to my VBL callback on the //c and //c+.

Bumped the version number to v2.3.
This commit is contained in:
Jeremy Rand 2020-02-26 22:36:42 -05:00
parent 2c981b6f1d
commit 72fc265e5a
4 changed files with 4 additions and 10 deletions

View File

@ -5,6 +5,6 @@ This is an implementation of Bejeweled written for the Apple //. It is my HackF
![A2Bejwld Screenshot](/a2bejwld.png "A2Bejwld Screenshot")
[Download a disk image](https://github.com/jeremysrand/a2bejwld/releases/download/2.2/a2bejwld.dsk)
[Download a disk image](https://github.com/jeremysrand/a2bejwld/releases/download/2.3/a2bejwld.dsk)
[Watch the YouTube video](https://youtu.be/yseAGBzREik)

View File

@ -32,19 +32,13 @@ bool initMouse(tMouseCallbacks *callbacks)
if (!gMouseInstalled) {
memcpy(&gMouseDrvCallbacks, &mouse_def_callbacks, sizeof(gMouseDrvCallbacks));
// This callback is here for the //c VBL which is only detectable
// through the mouse interrupt. By registering this as our "show"
// through the mouse interrupt. By registering this as our "draw"
// function, we can ensure that we get called on our VBL interrupt
// and can unblock our VBL wait function.
gMouseDrvCallbacks.show = vblIRQCallback;
gMouseDrvCallbacks.draw = vblIRQCallback;
if (mouse_install(&gMouseDrvCallbacks, &a2_mouse_drv) == 0) {
gMouseInstalled = true;
// This is required to ensure that the show callback is called
// by the interrupt handler. This whole thing is a bit of a
// hack to get the default mouse interrupt handler to do what
// we want on the //c to detect the VBL but it works for now.
mouse_show();
}
}

View File

@ -26,7 +26,7 @@
// Defines
#define SAVE_OPTIONS_FILE "A2BEJWLD.OPTS"
#define BASE_VERSION "v2.2"
#define BASE_VERSION "v2.3"
#ifdef TOTAL_REPLAY_BUILD
#define VERSION BASE_VERSION ".tr"