Fix double lo-res colour problem. Improvements to instructions and get open apple key working. Fix a problem where the blue gem was not being generated from the random gem routine.

This commit is contained in:
Jeremy Rand 2016-07-26 01:26:24 -04:00
parent 6d4a189205
commit 27d1e1c314
4 changed files with 72 additions and 45 deletions

View File

@ -180,6 +180,8 @@ gemmask := $8A
tax
lda bgColor,X
sta color
lda bgAuxColor,X
sta colorAux
txa
sta square
@ -213,14 +215,15 @@ gemmask := $8A
asl
asl
tay
lda color
ldx #4
@L1:
lda color
sta LOWSCR
sta (line1addr),Y
sta (line2addr),Y
sta (line3addr),Y
lda colorAux
sta HISCR
sta (line1addr),Y
sta (line2addr),Y
@ -237,6 +240,7 @@ gemmask := $8A
xPos: .BYTE $0
square: .BYTE $0
color: .BYTE $0
colorAux: .BYTE $0
.endproc
@ -1103,6 +1107,17 @@ bgColor:
.BYTE $0, $55, $0, $55, $0, $55, $0, $55
.BYTE $55, $0, $55, $0, $55, $0, $55, $0
; Index this with (xPos << 3) + yPos
bgAuxColor:
.BYTE $0, $aa, $0, $aa, $0, $aa, $0, $aa
.BYTE $aa, $0, $aa, $0, $aa, $0, $aa, $0
.BYTE $0, $aa, $0, $aa, $0, $aa, $0, $aa
.BYTE $aa, $0, $aa, $0, $aa, $0, $aa, $0
.BYTE $0, $aa, $0, $aa, $0, $aa, $0, $aa
.BYTE $aa, $0, $aa, $0, $aa, $0, $aa, $0
.BYTE $0, $aa, $0, $aa, $0, $aa, $0, $aa
.BYTE $aa, $0, $aa, $0, $aa, $0, $aa, $0
bgLoLines1:
.LOBYTES LINE1, LINE4, LINE7, LINE10, LINE13, LINE16, LINE19, LINE22
bgLoLines2:
@ -1121,11 +1136,11 @@ bgHiLines3:
greenGem:
.BYTE $00, $00, $00
.BYTE $00, $cc, $00
.BYTE $60, $66, $06
.BYTE $c0, $cc, $0c
.BYTE $60, $66, $06
.BYTE $c0, $cc, $0c
.BYTE $c0, $cc, $0c
.BYTE $c0, $cc, $0c
.BYTE $00, $cc, $00
.BYTE $00, $66, $00
.BYTE $00, $00, $00
greenMask:
.BYTE $ff, $ff, $ff
@ -1141,11 +1156,11 @@ greenMask:
purpleGem:
.BYTE $00, $00, $00
.BYTE $00, $30, $03
.BYTE $00, $33, $03
.BYTE $30, $33, $03
.BYTE $00, $99, $09
.BYTE $30, $33, $03
.BYTE $90, $99, $09
.BYTE $00, $33, $03
.BYTE $00, $30, $03
.BYTE $00, $90, $09
.BYTE $00, $00, $00
purpleMask:
.BYTE $ff, $ff, $ff
@ -1161,9 +1176,9 @@ purpleMask:
yellowGem:
.BYTE $00, $00, $00
.BYTE $00, $00, $00
.BYTE $00, $dd, $00
.BYTE $d0, $dd, $0d
.BYTE $00, $ee, $00
.BYTE $d0, $dd, $0d
.BYTE $e0, $ee, $0e
.BYTE $00, $dd, $00
.BYTE $00, $00, $00
.BYTE $00, $00, $00
@ -1181,11 +1196,11 @@ yellowMask:
blueGem:
.BYTE $00, $00, $00
.BYTE $00, $06, $00
.BYTE $60, $66, $00
.BYTE $60, $66, $06
.BYTE $30, $33, $00
.BYTE $60, $66, $06
.BYTE $30, $33, $03
.BYTE $60, $66, $00
.BYTE $00, $06, $00
.BYTE $00, $03, $00
.BYTE $00, $00, $00
blueMask:
.BYTE $ff, $ff, $ff
@ -1201,11 +1216,11 @@ blueMask:
redGem:
.BYTE $00, $00, $00
.BYTE $10, $11, $01
.BYTE $80, $88, $08
.BYTE $10, $11, $01
.BYTE $80, $88, $08
.BYTE $10, $11, $01
.BYTE $10, $11, $01
.BYTE $10, $11, $01
.BYTE $10, $11, $01
.BYTE $80, $88, $08
.BYTE $00, $00, $00
redMask:
.BYTE $ff, $ff, $ff
@ -1220,32 +1235,32 @@ redMask:
greyGem:
.BYTE $00, $00, $00
.BYTE $00, $aa, $00
.BYTE $a0, $aa, $0a
.BYTE $a0, $aa, $0a
.BYTE $a0, $aa, $0a
.BYTE $a0, $aa, $0a
.BYTE $00, $aa, $00
.BYTE $00, $20, $02
.BYTE $00, $11, $01
.BYTE $20, $22, $02
.BYTE $10, $11, $01
.BYTE $00, $22, $02
.BYTE $00, $10, $01
.BYTE $00, $00, $00
greyMask:
.BYTE $ff, $ff, $ff
.BYTE $ff, $00, $ff
.BYTE $ff, $0f, $f0
.BYTE $ff, $00, $f0
.BYTE $0f, $00, $f0
.BYTE $0f, $00, $f0
.BYTE $0f, $00, $f0
.BYTE $0f, $00, $f0
.BYTE $ff, $00, $ff
.BYTE $ff, $00, $f0
.BYTE $ff, $0f, $f0
.BYTE $ff, $ff, $ff
orangeGem:
.BYTE $00, $00, $00
.BYTE $00, $99, $00
.BYTE $c0, $cc, $0c
.BYTE $90, $99, $09
.BYTE $c0, $cc, $0c
.BYTE $90, $99, $09
.BYTE $90, $99, $09
.BYTE $90, $99, $09
.BYTE $00, $99, $00
.BYTE $00, $cc, $00
.BYTE $00, $00, $00
orangeMask:
.BYTE $ff, $ff, $ff

View File

@ -77,7 +77,7 @@ static void incrementScore(void)
static tGemType randomGem(void)
{
return (rand() % (GEM_MAX_NORMAL - GEM_MIN_NORMAL)) + GEM_MIN_NORMAL;
return (rand() % (GEM_MAX_NORMAL - GEM_MIN_NORMAL + 1)) + GEM_MIN_NORMAL;
}

Binary file not shown.

View File

@ -83,10 +83,10 @@ void printInstructions(void)
" Apple Jeweled\n"
" by Jeremy Rand\n"
"\n"
" Use I-J-K-M or the arrow keys to move your selection. Hold the either\n"
" apple key and move your selection to swap two jewels and match 3 or\n"
" more jewels. When you match three jewels, they disappear and new\n"
" jewels will drop from the top.\n"
" Use I-J-K-M, the arrow keys or the joystick to move your selection.\n"
" Hold either apple key or joystick button and move your selection to\n"
" swap two jewels and match 3 or more jewels. When you match three\n"
" jewels, they disappear and new jewels will drop from the top.\n"
"\n"
" If you match four jewels or three jewels in two directions, then the\n"
" jewel does not disappear. Match it again and it explodes taking more\n"
@ -588,37 +588,49 @@ static bool pollKeyboard(void)
case 'i':
case 'I':
case CH_CURS_UP:
if (isAppleButtonPressed())
result = swapUp();
else
if (!isAppleButtonPressed()) {
moveUp();
break;
}
// Fallthrough...
case 139:
result = swapUp();
break;
case 'j':
case 'J':
case CH_CURS_LEFT:
if (isAppleButtonPressed())
result = swapLeft();
else
if (!isAppleButtonPressed()) {
moveLeft();
break;
}
// Fallthrough...
case 136:
result = swapLeft();
break;
case 'k':
case 'K':
case CH_CURS_RIGHT:
if (isAppleButtonPressed())
result = swapRight();
else
if (!isAppleButtonPressed()) {
moveRight();
break;
}
// Fallthrough...
case 149:
result = swapRight();
break;
case 'm':
case 'M':
case CH_CURS_DOWN:
if (isAppleButtonPressed())
result = swapDown();
else
if (!isAppleButtonPressed()) {
moveDown();
break;
}
// Fallthrough...
case 138:
result = swapDown();
break;
case CH_ESC: