Change the prompt when the stereo channels are swapped so the user gets some feedback. Display the high score list. Still need to add the code to update the high score list.

This commit is contained in:
Jeremy Rand 2020-12-30 23:10:22 -05:00
parent 6947d8762c
commit 4d6f8d39f1
7 changed files with 426 additions and 162 deletions

View File

@ -96,6 +96,7 @@
9D62AF402499CD3A00348F45 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; }; 9D62AF402499CD3A00348F45 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
9D6DB0AE2591A67700CDBF05 /* flea.raw */ = {isa = PBXFileReference; lastKnownFileType = file; path = flea.raw; sourceTree = "<group>"; }; 9D6DB0AE2591A67700CDBF05 /* flea.raw */ = {isa = PBXFileReference; lastKnownFileType = file; path = flea.raw; sourceTree = "<group>"; };
9D6DB0B825932CA600CDBF05 /* scorpion.raw */ = {isa = PBXFileReference; lastKnownFileType = text; path = scorpion.raw; sourceTree = "<group>"; }; 9D6DB0B825932CA600CDBF05 /* scorpion.raw */ = {isa = PBXFileReference; lastKnownFileType = text; path = scorpion.raw; sourceTree = "<group>"; };
9D6DB164259D759C00CDBF05 /* tileConvert.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = tileConvert.s; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.asm.orcam; };
9D8AF0B72535542400C10E3C /* level.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = level.s; sourceTree = "<group>"; }; 9D8AF0B72535542400C10E3C /* level.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = level.s; sourceTree = "<group>"; };
9D8AF0B82535543000C10E3C /* score.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = score.s; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.asm.orcam; }; 9D8AF0B82535543000C10E3C /* score.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = score.s; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.asm.orcam; };
9D8FFC602491CA28005C9327 /* game.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = game.s; sourceTree = "<group>"; }; 9D8FFC602491CA28005C9327 /* game.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = game.s; sourceTree = "<group>"; };
@ -176,6 +177,7 @@
9D47CC14254A698900CDA5CB /* gamePlayer.s */, 9D47CC14254A698900CDA5CB /* gamePlayer.s */,
9D53E5B32562320300E10169 /* gameShot.s */, 9D53E5B32562320300E10169 /* gameShot.s */,
9D159805258A6BCB00BA42DF /* gameSound.s */, 9D159805258A6BCB00BA42DF /* gameSound.s */,
9D6DB164259D759C00CDBF05 /* tileConvert.s */,
9D8AF0B72535542400C10E3C /* level.s */, 9D8AF0B72535542400C10E3C /* level.s */,
9D8AF0B82535543000C10E3C /* score.s */, 9D8AF0B82535543000C10E3C /* score.s */,
9D62AF3B249871A300348F45 /* colour.s */, 9D62AF3B249871A300348F45 /* colour.s */,

View File

@ -398,8 +398,11 @@ gameOver entry
jsl fleaInitLevel jsl fleaInitLevel
jsl checkHighScore jsl checkHighScore
jsl addRandomMushrooms jsl addRandomMushrooms
jmp staticGameBoard
staticGameBoard entry
lda #TILE_PLAYER lda #TILE_PLAYER
sta tileType+RHS_FIRST_TILE_OFFSET-GAME_NUM_TILES_WIDE-1 sta tileType+RHS_FIRST_TILE_OFFSET-GAME_NUM_TILES_WIDE-1
lda #TILE_STATE_DIRTY lda #TILE_STATE_DIRTY
@ -430,20 +433,7 @@ gameOver entry
ldx #GAME_NUM_TILES_WIDE*10+2 ldx #GAME_NUM_TILES_WIDE*10+2
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _highScoreRow 0
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
@ -453,20 +443,7 @@ gameOver entry
ldx #GAME_NUM_TILES_WIDE*12+2 ldx #GAME_NUM_TILES_WIDE*12+2
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _highScoreRow 1
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
@ -476,20 +453,7 @@ gameOver entry
ldx #GAME_NUM_TILES_WIDE*14+2 ldx #GAME_NUM_TILES_WIDE*14+2
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _highScoreRow 2
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
@ -499,20 +463,7 @@ gameOver entry
ldx #GAME_NUM_TILES_WIDE*16+2 ldx #GAME_NUM_TILES_WIDE*16+2
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _highScoreRow 3
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
@ -522,20 +473,7 @@ gameOver entry
ldx #GAME_NUM_TILES_WIDE*18+2 ldx #GAME_NUM_TILES_WIDE*18+2
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _highScoreRow 4
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
@ -545,20 +483,7 @@ gameOver entry
ldx #GAME_NUM_TILES_WIDE*20+2 ldx #GAME_NUM_TILES_WIDE*20+2
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _highScoreRow 5
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
@ -568,20 +493,7 @@ gameOver entry
ldx #GAME_NUM_TILES_WIDE*22+2 ldx #GAME_NUM_TILES_WIDE*22+2
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _highScoreRow 6
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
@ -591,20 +503,7 @@ gameOver entry
ldx #GAME_NUM_TILES_WIDE*24+2 ldx #GAME_NUM_TILES_WIDE*24+2
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _highScoreRow 7
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
@ -614,20 +513,7 @@ gameOver entry
ldx #GAME_NUM_TILES_WIDE*26+2 ldx #GAME_NUM_TILES_WIDE*26+2
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _highScoreRow 8
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
@ -637,20 +523,7 @@ gameOver entry
ldx #GAME_NUM_TILES_WIDE*28+2 ldx #GAME_NUM_TILES_WIDE*28+2
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _highScoreRow 9
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
@ -707,7 +580,6 @@ gameOver entry
ldx #GAME_NUM_TILES_WIDE*34+2 ldx #GAME_NUM_TILES_WIDE*34+2
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_NUMBER_1 _setGameTile TILE_NUMBER_1
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_LETTER_F _setGameTile TILE_LETTER_F
@ -726,11 +598,11 @@ gameOver entry
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
ldx #GAME_NUM_TILES_WIDE*36+2 ldx #GAME_NUM_TILES_WIDE*36+2
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_NUMBER_2 _setGameTile TILE_NUMBER_2
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_LETTER_F _setGameTile TILE_LETTER_F
@ -749,16 +621,13 @@ gameOver entry
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
ldx #GAME_NUM_TILES_WIDE*38+2 ldx #GAME_NUM_TILES_WIDE*38+2
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_LETTER_S _setGameTile TILE_LETTER_S
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_LETTER_T
_setGameTile TILE_LETTER_O
_setGameTile TILE_EMPTY
_setGameTile TILE_LETTER_S _setGameTile TILE_LETTER_S
_setGameTile TILE_LETTER_W _setGameTile TILE_LETTER_W
_setGameTile TILE_LETTER_A _setGameTile TILE_LETTER_A
@ -771,12 +640,24 @@ gameOver entry
_setGameTile TILE_LETTER_E _setGameTile TILE_LETTER_E
_setGameTile TILE_LETTER_O _setGameTile TILE_LETTER_O
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
lda settings+SETTINGS_SWAP_STEREO_OFFSET
bne staticGameBoard_swapped
_setGameTile TILE_LETTER_L
_setGameTile TILE_SYMBOL_COLON
_setGameTile TILE_LETTER_R
bra staticGameBoard_cont
staticGameBoard_swapped anop
_setGameTile TILE_LETTER_R
_setGameTile TILE_SYMBOL_COLON
_setGameTile TILE_LETTER_L
staticGameBoard_cont anop
_setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
ldx #GAME_NUM_TILES_WIDE*40+2 ldx #GAME_NUM_TILES_WIDE*40+2
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
_setGameTile TILE_LETTER_Q _setGameTile TILE_LETTER_Q
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_LETTER_T _setGameTile TILE_LETTER_T
@ -795,6 +676,7 @@ gameOver entry
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY _setGameTile TILE_EMPTY
_setGameTile TILE_EMPTY
rtl rtl
@ -844,7 +726,8 @@ checkKey_game anop
jmp startGame jmp startGame
checkKey_swapStereo anop checkKey_swapStereo anop
jmp swapStereoSettings jsl swapStereoSettings
jmp staticGameBoard
waitForKey entry waitForKey entry

View File

@ -143,6 +143,78 @@ _dirtyNonGameTile_skip&SYSCNT anop
mend mend
macro
_highScoreRow &nthScore
ldy #SETTINGS_HIGH_SCORE_OFFSET+HIGH_SCORE_SCORE_TEXT_OFFSET+&nthScore*SETTINGS_HIGH_SCORE_SIZE
lda settings,y
jsl asciiToTileType
jsr setGameTile
iny
lda settings,y
jsl asciiToTileType
jsr setGameTile
iny
lda settings,y
jsl asciiToTileType
jsr setGameTile
iny
lda settings,y
jsl asciiToTileType
jsr setGameTile
iny
lda settings,y
jsl asciiToTileType
jsr setGameTile
iny
lda settings,y
jsl asciiToTileType
jsr setGameTile
iny
lda settings,y
jsl asciiToTileType
jsr setGameTile
iny
lda settings,y
jsl asciiToTileType
jsr setGameTile
iny
lda settings,y
jsl asciiToTileType
jsr setGameTile
iny
lda settings,y
jsl asciiToTileType
jsr setGameTile
lda #TILE_EMPTY
jsr setGameTile
iny
lda settings,y
jsl asciiToTileType
jsr setGameTile
iny
lda settings,y
jsl asciiToTileType
jsr setGameTile
iny
lda settings,y
jsl asciiToTileType
jsr setGameTile
mend
; Update the score ; Update the score
macro macro
_incrementScore &increment _incrementScore &increment

View File

@ -39,6 +39,7 @@ INVALID_TILE_NUM gequ $ffff
TILE_STATE_CLEAN gequ 0 TILE_STATE_CLEAN gequ 0
TILE_STATE_DIRTY gequ 1 TILE_STATE_DIRTY gequ 1
; This must be kept consistent with the table in tileConvert.s
TILE_EMPTY gequ 0 TILE_EMPTY gequ 0
TILE_MUSHROOM1 gequ 1*4 TILE_MUSHROOM1 gequ 1*4
TILE_MUSHROOM2 gequ 2*4 TILE_MUSHROOM2 gequ 2*4
@ -106,6 +107,14 @@ TILE_POISON_A_MUSHROOM gequ TILE_POISON_MUSHROOM4-TILE_MUSHROOM4
NUM_COLOUR_PALETTES gequ 14 NUM_COLOUR_PALETTES gequ 14
SETTINGS_SWAP_STEREO_OFFSET gequ 6
SETTINGS_HIGH_SCORE_OFFSET gequ 8
SETTINGS_HIGH_SCORE_SIZE gequ 18
HIGH_SCORE_SCORE_TEXT_OFFSET gequ 0
HIGH_SCORE_WHO_OFFSET gequ 10
HIGH_SCORE_SCORE_OFFSET gequ 14
SPRITE_SPEED_SLOW gequ 0 SPRITE_SPEED_SLOW gequ 0
SPRITE_SPEED_FAST gequ 1 SPRITE_SPEED_FAST gequ 1

View File

@ -35,8 +35,9 @@
typedef struct tHighScore typedef struct tHighScore
{ {
long score; char scoreText[10];
char who[3]; char who[4];
unsigned long score;
} tHighScore; } tHighScore;
typedef struct tSettingsData typedef struct tSettingsData
@ -57,16 +58,16 @@ tSettingsData settings = {
0, 0,
FALSE, FALSE,
{ {
{ 0, { ' ', ' ', ' '}}, { { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '0'}, { 'A', 'A', 'A' }, 0},
{ 0, { ' ', ' ', ' '}}, { { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '0'}, { 'A', 'A', 'A' }, 0},
{ 0, { ' ', ' ', ' '}}, { { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '0'}, { 'A', 'A', 'A' }, 0},
{ 0, { ' ', ' ', ' '}}, { { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '0'}, { 'A', 'A', 'A' }, 0},
{ 0, { ' ', ' ', ' '}}, { { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '0'}, { 'A', 'A', 'A' }, 0},
{ 0, { ' ', ' ', ' '}}, { { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '0'}, { 'A', 'A', 'A' }, 0},
{ 0, { ' ', ' ', ' '}}, { { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '0'}, { 'A', 'A', 'A' }, 0},
{ 0, { ' ', ' ', ' '}}, { { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '0'}, { 'A', 'A', 'A' }, 0},
{ 0, { ' ', ' ', ' '}}, { { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '0'}, { 'A', 'A', 'A' }, 0},
{ 0, { ' ', ' ', ' '}} { { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '0'}, { 'A', 'A', 'A' }, 0}
} }
}; };
RefNumRecGS closeRec; RefNumRecGS closeRec;

View File

@ -16,6 +16,78 @@ score start
using tileData using tileData
updateHighScore entry
ldx #HIGH_SCORE_ONES_OFFSET
lda settings+SETTINGS_HIGH_SCORE_OFFSET+HIGH_SCORE_SCORE_TEXT_OFFSET+9
jsl asciiToTileType
sta tileType,x
_dirtyNonGameTile
dex
dex
lda settings+SETTINGS_HIGH_SCORE_OFFSET+HIGH_SCORE_SCORE_TEXT_OFFSET+8
jsl asciiToTileType
sta tileType,x
_dirtyNonGameTile
dex
dex
lda settings+SETTINGS_HIGH_SCORE_OFFSET+HIGH_SCORE_SCORE_TEXT_OFFSET+7
jsl asciiToTileType
sta tileType,x
_dirtyNonGameTile
dex
dex
lda settings+SETTINGS_HIGH_SCORE_OFFSET+HIGH_SCORE_SCORE_TEXT_OFFSET+6
jsl asciiToTileType
sta tileType,x
_dirtyNonGameTile
dex
dex
lda settings+SETTINGS_HIGH_SCORE_OFFSET+HIGH_SCORE_SCORE_TEXT_OFFSET+5
jsl asciiToTileType
sta tileType,x
_dirtyNonGameTile
dex
dex
lda settings+SETTINGS_HIGH_SCORE_OFFSET+HIGH_SCORE_SCORE_TEXT_OFFSET+4
jsl asciiToTileType
sta tileType,x
_dirtyNonGameTile
dex
dex
lda settings+SETTINGS_HIGH_SCORE_OFFSET+HIGH_SCORE_SCORE_TEXT_OFFSET+3
jsl asciiToTileType
sta tileType,x
_dirtyNonGameTile
dex
dex
lda settings+SETTINGS_HIGH_SCORE_OFFSET+HIGH_SCORE_SCORE_TEXT_OFFSET+2
jsl asciiToTileType
sta tileType,x
_dirtyNonGameTile
dex
dex
lda settings+SETTINGS_HIGH_SCORE_OFFSET+HIGH_SCORE_SCORE_TEXT_OFFSET+1
jsl asciiToTileType
sta tileType,x
_dirtyNonGameTile
dex
dex
lda settings+SETTINGS_HIGH_SCORE_OFFSET+HIGH_SCORE_SCORE_TEXT_OFFSET
jsl asciiToTileType
sta tileType,x
_dirtyNonGameTile
rtl
scoreStartGame entry scoreStartGame entry
stz gameScore stz gameScore
stz gameScore+2 stz gameScore+2
@ -290,7 +362,7 @@ checkHighScore_loop anop
bne checkHighScore_loop bne checkHighScore_loop
checkHighScore_done anop checkHighScore_done anop
rtl jmp updateHighScore
highScore dc i4'0' highScore dc i4'0'

225
BuGS/tileConvert.s Normal file
View File

@ -0,0 +1,225 @@
;
; tileConvert.s
; BuGS
;
; Created by Jeremy Rand on 2020-12-30.
;Copyright © 2020 Jeremy Rand. All rights reserved.
;
case on
mcopy tileConvert.macros
keep tileConvert
tileConvert start
using globalData
asciiToTileType entry
and #$7f
asl a
phy
tay
lda asciiToTileTypeTable,y
ply
rtl
tileTypeToAscii entry
lsr a
lsr a
phy
tay
lda tileTypeToAsciiTable,y
ply
and #$7f
rtl
asciiToTileTypeTable anop
dc i2'TILE_EMPTY' ; 0
dc i2'TILE_EMPTY' ; 1
dc i2'TILE_EMPTY' ; 2
dc i2'TILE_EMPTY' ; 3
dc i2'TILE_EMPTY' ; 4
dc i2'TILE_EMPTY' ; 5
dc i2'TILE_EMPTY' ; 6
dc i2'TILE_EMPTY' ; 7
dc i2'TILE_EMPTY' ; 8
dc i2'TILE_EMPTY' ; 9
dc i2'TILE_EMPTY' ; 10
dc i2'TILE_EMPTY' ; 11
dc i2'TILE_EMPTY' ; 12
dc i2'TILE_EMPTY' ; 13
dc i2'TILE_EMPTY' ; 14
dc i2'TILE_EMPTY' ; 15
dc i2'TILE_EMPTY' ; 16
dc i2'TILE_EMPTY' ; 17
dc i2'TILE_EMPTY' ; 18
dc i2'TILE_EMPTY' ; 19
dc i2'TILE_EMPTY' ; 20
dc i2'TILE_EMPTY' ; 21
dc i2'TILE_EMPTY' ; 22
dc i2'TILE_EMPTY' ; 23
dc i2'TILE_EMPTY' ; 24
dc i2'TILE_EMPTY' ; 25
dc i2'TILE_EMPTY' ; 26
dc i2'TILE_EMPTY' ; 27
dc i2'TILE_EMPTY' ; 28
dc i2'TILE_EMPTY' ; 29
dc i2'TILE_EMPTY' ; 30
dc i2'TILE_EMPTY' ; 31
dc i2'TILE_EMPTY' ; 32
dc i2'TILE_EMPTY' ; 33
dc i2'TILE_EMPTY' ; 34
dc i2'TILE_EMPTY' ; 35
dc i2'TILE_EMPTY' ; 36
dc i2'TILE_EMPTY' ; 37
dc i2'TILE_EMPTY' ; 38
dc i2'TILE_EMPTY' ; 39
dc i2'TILE_EMPTY' ; 40
dc i2'TILE_EMPTY' ; 41
dc i2'TILE_EMPTY' ; 42
dc i2'TILE_EMPTY' ; 43
dc i2'TILE_EMPTY' ; 44
dc i2'TILE_EMPTY' ; 45
dc i2'TILE_SYMBOL_DOT' ; 46
dc i2'TILE_EMPTY' ; 47
dc i2'TILE_NUMBER_0' ; 48
dc i2'TILE_NUMBER_1' ; 49
dc i2'TILE_NUMBER_2' ; 50
dc i2'TILE_NUMBER_3' ; 51
dc i2'TILE_NUMBER_4' ; 52
dc i2'TILE_NUMBER_5' ; 53
dc i2'TILE_NUMBER_6' ; 54
dc i2'TILE_NUMBER_7' ; 55
dc i2'TILE_NUMBER_8' ; 56
dc i2'TILE_NUMBER_9' ; 57
dc i2'TILE_SYMBOL_COLON' ; 58
dc i2'TILE_EMPTY' ; 59
dc i2'TILE_EMPTY' ; 60
dc i2'TILE_EMPTY' ; 61
dc i2'TILE_EMPTY' ; 62
dc i2'TILE_EMPTY' ; 63
dc i2'TILE_EMPTY' ; 64
dc i2'TILE_LETTER_A' ; 65
dc i2'TILE_LETTER_B' ; 66
dc i2'TILE_LETTER_C' ; 67
dc i2'TILE_LETTER_D' ; 68
dc i2'TILE_LETTER_E' ; 69
dc i2'TILE_LETTER_F' ; 70
dc i2'TILE_LETTER_G' ; 71
dc i2'TILE_LETTER_H' ; 72
dc i2'TILE_LETTER_I' ; 73
dc i2'TILE_LETTER_J' ; 74
dc i2'TILE_LETTER_K' ; 75
dc i2'TILE_LETTER_L' ; 76
dc i2'TILE_LETTER_M' ; 77
dc i2'TILE_LETTER_N' ; 78
dc i2'TILE_LETTER_O' ; 79
dc i2'TILE_LETTER_P' ; 80
dc i2'TILE_LETTER_Q' ; 81
dc i2'TILE_LETTER_R' ; 82
dc i2'TILE_LETTER_S' ; 83
dc i2'TILE_LETTER_T' ; 84
dc i2'TILE_LETTER_U' ; 85
dc i2'TILE_LETTER_V' ; 86
dc i2'TILE_LETTER_W' ; 87
dc i2'TILE_LETTER_X' ; 88
dc i2'TILE_LETTER_Y' ; 89
dc i2'TILE_LETTER_Z' ; 90
dc i2'TILE_EMPTY' ; 91
dc i2'TILE_EMPTY' ; 92
dc i2'TILE_EMPTY' ; 93
dc i2'TILE_EMPTY' ; 94
dc i2'TILE_EMPTY' ; 95
dc i2'TILE_EMPTY' ; 96
dc i2'TILE_LETTER_A' ; 97
dc i2'TILE_LETTER_B' ; 98
dc i2'TILE_LETTER_C' ; 99
dc i2'TILE_LETTER_D' ; 100
dc i2'TILE_LETTER_E' ; 101
dc i2'TILE_LETTER_F' ; 102
dc i2'TILE_LETTER_G' ; 103
dc i2'TILE_LETTER_H' ; 104
dc i2'TILE_LETTER_I' ; 105
dc i2'TILE_LETTER_J' ; 106
dc i2'TILE_LETTER_K' ; 107
dc i2'TILE_LETTER_L' ; 108
dc i2'TILE_LETTER_M' ; 109
dc i2'TILE_LETTER_N' ; 110
dc i2'TILE_LETTER_O' ; 111
dc i2'TILE_LETTER_P' ; 112
dc i2'TILE_LETTER_Q' ; 113
dc i2'TILE_LETTER_R' ; 114
dc i2'TILE_LETTER_S' ; 115
dc i2'TILE_LETTER_T' ; 116
dc i2'TILE_LETTER_U' ; 117
dc i2'TILE_LETTER_V' ; 118
dc i2'TILE_LETTER_W' ; 119
dc i2'TILE_LETTER_X' ; 120
dc i2'TILE_LETTER_Y' ; 121
dc i2'TILE_LETTER_Z' ; 122
dc i2'TILE_EMPTY' ; 123
dc i2'TILE_EMPTY' ; 124
dc i2'TILE_EMPTY' ; 125
dc i2'TILE_EMPTY' ; 126
dc i2'TILE_EMPTY' ; 127
tileTypeToAsciiTable anop
dc c' ' ; TILE_EMPTY
dc c' ' ; TILE_MUSHROOM1
dc c' ' ; TILE_MUSHROOM2
dc c' ' ; TILE_MUSHROOM3
dc c' ' ; TILE_MUSHROOM4
dc c' ' ; TILE_SYMBOL_C
dc c' ' ; TILE_SYMBOL_P
dc c'.' ; TILE_SYMBOL_DOT
dc c':' ; TILE_SYMBOL_COLON
dc c' ' ; TILE_POISON_MUSHROOM1
dc c' ' ; TILE_POISON_MUSHROOM2
dc c' ' ; TILE_POISON_MUSHROOM3
dc c' ' ; TILE_POISON_MUSHROOM4
dc c'A' ; TILE_LETTER_A
dc c'B' ; TILE_LETTER_B
dc c'C' ; TILE_LETTER_C
dc c'D' ; TILE_LETTER_D
dc c'E' ; TILE_LETTER_E
dc c'F' ; TILE_LETTER_F
dc c'G' ; TILE_LETTER_G
dc c'H' ; TILE_LETTER_H
dc c'I' ; TILE_LETTER_I
dc c'J' ; TILE_LETTER_J
dc c'K' ; TILE_LETTER_K
dc c'L' ; TILE_LETTER_L
dc c'M' ; TILE_LETTER_M
dc c'N' ; TILE_LETTER_N
dc c'O' ; TILE_LETTER_O
dc c'P' ; TILE_LETTER_P
dc c'Q' ; TILE_LETTER_Q
dc c'R' ; TILE_LETTER_R
dc c'S' ; TILE_LETTER_S
dc c'T' ; TILE_LETTER_T
dc c'U' ; TILE_LETTER_U
dc c'V' ; TILE_LETTER_V
dc c'W' ; TILE_LETTER_W
dc c'X' ; TILE_LETTER_X
dc c'Y' ; TILE_LETTER_Y
dc c'Z' ; TILE_LETTER_Z
dc c'0' ; TILE_NUMBER_0
dc c'1' ; TILE_NUMBER_1
dc c'2' ; TILE_NUMBER_2
dc c'3' ; TILE_NUMBER_3
dc c'4' ; TILE_NUMBER_4
dc c'5' ; TILE_NUMBER_5
dc c'6' ; TILE_NUMBER_6
dc c'7' ; TILE_NUMBER_7
dc c'8' ; TILE_NUMBER_8
dc c'9' ; TILE_NUMBER_9
dc c' ' ; TILE_SOLID1
dc c' ' ; TILE_SOLID2
dc c' ' ; TILE_SOLID3
dc c' ' ; TILE_PLAYER
dc c'u' ; TILE_LETTER_WHITE_U
dc c'G' ; TILE_LETTER_GREEN_G
dc c'S' ; TILE_LETTER_GREEN S
end