mirror of
https://github.com/jeremysrand/a2bejwld.git
synced 2024-06-18 03:29:31 +00:00
Fix a problem on the GS where the messages on the bottom four lines in mixed text/graphics mode ended up being displayed over the graphics because the text window was setup incorrectly. Move the mouse to the square if the user jumps to another square using keyboard arrow keys or jumping to a hint.
This commit is contained in:
parent
4ecae7ea50
commit
fae32b84f9
|
@ -66,6 +66,15 @@ gemmask := $8A
|
|||
|
||||
|
||||
.proc _showDblLoRes
|
||||
lda #0
|
||||
sta WNDLFT
|
||||
lda #80
|
||||
sta WNDWDTH
|
||||
lda #0
|
||||
sta WNDTOP
|
||||
lda #24
|
||||
sta WNDBTM
|
||||
|
||||
lda TXTCLR
|
||||
lda MIXCLR
|
||||
lda SETAN3
|
||||
|
@ -106,6 +115,15 @@ gemmask := $8A
|
|||
cpx #0
|
||||
bne @L2
|
||||
|
||||
lda #0
|
||||
sta WNDLFT
|
||||
lda #80
|
||||
sta WNDWDTH
|
||||
lda #20
|
||||
sta WNDTOP
|
||||
lda #24
|
||||
sta WNDBTM
|
||||
|
||||
rts
|
||||
.endproc
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ extern char a2e_stdmou_mou;
|
|||
|
||||
static tMouseCallbacks *gMouseCallbacks = NULL;
|
||||
static bool gMouseInstalled = false;
|
||||
static bool gMouseInPoll = false;
|
||||
|
||||
|
||||
bool initMouse(tMouseCallbacks *callbacks)
|
||||
|
@ -65,6 +66,8 @@ bool pollMouse(void)
|
|||
return result;
|
||||
}
|
||||
|
||||
gMouseInPoll = true;
|
||||
|
||||
mouse_info(&mouseInfo);
|
||||
|
||||
newMouseDown = (mouseInfo.buttons != 0);
|
||||
|
@ -120,6 +123,25 @@ bool pollMouse(void)
|
|||
}
|
||||
}
|
||||
oldMouseDown = newMouseDown;
|
||||
gMouseInPoll = false;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
void moveMouseToSquare(tSquare square)
|
||||
{
|
||||
uint16_t newX;
|
||||
uint16_t newY;
|
||||
|
||||
if (!gMouseInstalled)
|
||||
return;
|
||||
|
||||
if (gMouseInPoll)
|
||||
return;
|
||||
|
||||
newX = (SQUARE_TO_X(square) * 35) + 18;
|
||||
newY = (SQUARE_TO_Y(square) * 8) + 4;
|
||||
|
||||
mouse_move(newX, newY);
|
||||
}
|
|
@ -28,6 +28,7 @@ typedef struct tMouseCallbacks {
|
|||
extern bool initMouse(tMouseCallbacks *callbacks);
|
||||
extern void shutdownMouse(void);
|
||||
extern bool pollMouse(void);
|
||||
extern void moveMouseToSquare(tSquare square);
|
||||
|
||||
|
||||
#endif /* defined(__a2bejwld__mouseWrapper__) */
|
||||
|
|
|
@ -321,6 +321,7 @@ static void drawBoard(void)
|
|||
}
|
||||
|
||||
selectSquare(gSelectedSquare);
|
||||
moveMouseToSquare(gSelectedSquare);
|
||||
drawScore(gScoreBar);
|
||||
}
|
||||
|
||||
|
@ -378,6 +379,7 @@ static void moveDir(tDirection dir)
|
|||
|
||||
refreshSquare(oldSquare);
|
||||
selectSquare(gSelectedSquare);
|
||||
moveMouseToSquare(gSelectedSquare);
|
||||
}
|
||||
|
||||
|
||||
|
@ -423,6 +425,7 @@ static void moveTwoDirs(tDirection dir1, tDirection dir2)
|
|||
|
||||
refreshSquare(oldSquare);
|
||||
selectSquare(gSelectedSquare);
|
||||
moveMouseToSquare(gSelectedSquare);
|
||||
}
|
||||
|
||||
|
||||
|
@ -481,13 +484,13 @@ static bool isAppleButtonPressed(void)
|
|||
|
||||
static void endGame(void)
|
||||
{
|
||||
mixedTextMode();
|
||||
videomode(VIDEOMODE_80x24);
|
||||
mixedTextMode();
|
||||
|
||||
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
|
||||
printf(" No more moves - GAME OVER!!\n");
|
||||
printf(" You made it to level %u\n\n", getLevel());
|
||||
printf(" Play again (Y/N)?");
|
||||
cputsxy(0, 0, " No more moves - GAME OVER!!");
|
||||
gotoxy(0,1);
|
||||
cprintf( " You made it to level %u", getLevel());
|
||||
cputsxy(0, 3, " Play again (Y/N)?");
|
||||
|
||||
while (true) {
|
||||
switch (cgetc()) {
|
||||
|
@ -525,12 +528,12 @@ static void refreshLevel(tLevel level)
|
|||
{
|
||||
bool waiting = true;
|
||||
|
||||
mixedTextMode();
|
||||
videomode(VIDEOMODE_80x24);
|
||||
mixedTextMode();
|
||||
|
||||
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
|
||||
printf(" Completed level %u!!\n", level);
|
||||
printf(" Press space to continue to the next level...");
|
||||
gotoxy(0, 0);
|
||||
cprintf( " Completed level %u!!", level);
|
||||
cputsxy(0, 2, " Press space to continue to the next level...");
|
||||
|
||||
while (waiting) {
|
||||
switch (cgetc()) {
|
||||
|
@ -554,6 +557,7 @@ static void getHint(void)
|
|||
|
||||
gSelectedSquare = getHintSquare();
|
||||
selectSquare(gSelectedSquare);
|
||||
moveMouseToSquare(gSelectedSquare);
|
||||
}
|
||||
|
||||
|
||||
|
@ -750,10 +754,10 @@ static bool pollKeyboard(void)
|
|||
case 'q':
|
||||
case 'Q':
|
||||
if (gShouldSave) {
|
||||
mixedTextMode();
|
||||
videomode(VIDEOMODE_80x24);
|
||||
gotoxy(0, 20);
|
||||
cprintf("\n\nSaving your game so you can continue\r\n later...");
|
||||
mixedTextMode();
|
||||
gotoxy(0, 0);
|
||||
cprintf("Saving your game so you can continue\r\n later...");
|
||||
saveGame();
|
||||
}
|
||||
quitGame();
|
||||
|
|
Loading…
Reference in New Issue
Block a user