mirror of
https://github.com/jeremysrand/a2bejwld.git
synced 2024-06-01 14:41:38 +00:00
Add the ability to see the star state of a gem.
This commit is contained in:
parent
2b92b2684a
commit
3573f8e9d4
|
@ -26,6 +26,8 @@ void __fastcall__ drawOrangeGem(tSquare square);
|
|||
void __fastcall__ drawGreyGem(tSquare square);
|
||||
void __fastcall__ drawPurpleGem(tSquare square);
|
||||
|
||||
void __fastcall__ starGem(tSquare square);
|
||||
|
||||
void __fastcall__ selectSquare(tSquare square);
|
||||
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
.export _drawGreenGem, _drawPurpleGem, _drawYellowGem
|
||||
.export _drawBlueGem, _drawRedGem, _drawGreyGem
|
||||
.export _drawOrangeGem, _drawBgSquare, _selectSquare
|
||||
.export _starGem
|
||||
|
||||
.include "apple2.inc"
|
||||
|
||||
|
@ -415,6 +416,42 @@ square: .BYTE $0
|
|||
jmp _drawGem
|
||||
.endproc
|
||||
|
||||
.proc _starGem
|
||||
; A is the square position (from 0 to 63)
|
||||
; 0 through 7 are on the top row
|
||||
sta square
|
||||
|
||||
and #7
|
||||
asl
|
||||
asl
|
||||
inc A
|
||||
inc A
|
||||
sta xPos
|
||||
lda square
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
|
||||
; Get line addrs
|
||||
tax
|
||||
lda bgLoLines2,X
|
||||
clc
|
||||
adc xPos
|
||||
sta line2addr
|
||||
lda bgHiLines2,X
|
||||
sta line2addr+1
|
||||
|
||||
sta HISCR
|
||||
lda #$ff
|
||||
sta (line2addr)
|
||||
rts
|
||||
|
||||
; Locals
|
||||
|
||||
xPos: .BYTE $0
|
||||
square: .BYTE $0
|
||||
.endproc
|
||||
|
||||
|
||||
.DATA
|
||||
lineAddrs:
|
||||
|
|
|
@ -362,6 +362,9 @@ static bool dropGems(void)
|
|||
GEM_TYPE_AT_SQUARE(destSquare) = gemType;
|
||||
GEM_STARRED_AT_SQUARE(destSquare) = GEM_STARRED_AT_SQUARE(square);
|
||||
gSquareRefresh(destSquare);
|
||||
GEM_TYPE_AT_SQUARE(square) = GEM_NONE;
|
||||
GEM_STARRED_AT_SQUARE(square) = false;
|
||||
gSquareRefresh(square);
|
||||
destY--;
|
||||
destSquare = XY_TO_SQUARE(x, destY);
|
||||
}
|
||||
|
@ -369,18 +372,16 @@ static bool dropGems(void)
|
|||
}
|
||||
if (destSquare != NUM_SQUARES) {
|
||||
// DEBUG
|
||||
if (result)
|
||||
cgetc();
|
||||
cgetc();
|
||||
// DBEUG
|
||||
for (y = destY; y >= 0; y--) {
|
||||
square = XY_TO_SQUARE(x, y);
|
||||
GEM_TYPE_AT_SQUARE(square) = randomGem();
|
||||
GEM_STARRED_AT_SQUARE(square) = false;
|
||||
gSquareRefresh(destSquare);
|
||||
gSquareRefresh(square);
|
||||
}
|
||||
// DEBUG
|
||||
if (result)
|
||||
cgetc();
|
||||
cgetc();
|
||||
// DBEUG
|
||||
}
|
||||
}
|
||||
|
|
|
@ -120,6 +120,9 @@ static void refreshSquare(tSquare square)
|
|||
{
|
||||
drawBgSquare(square);
|
||||
drawGemAtSquare(square);
|
||||
|
||||
if (gemIsStarredAtSquare(square))
|
||||
starGem(square);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user