mirror of
https://github.com/jeremysrand/BuGS.git
synced 2024-05-28 16:41:35 +00:00
Add code to keep track of two separate screens of mushrooms for player 1 and player 2.
This commit is contained in:
parent
230d1f344c
commit
678a9ee104
|
@ -100,7 +100,7 @@
|
||||||
9D6DB18625A411DA00CDBF05 /* BuGS.2mg */ = {isa = PBXFileReference; lastKnownFileType = file; path = BuGS.2mg; sourceTree = "<group>"; };
|
9D6DB18625A411DA00CDBF05 /* BuGS.2mg */ = {isa = PBXFileReference; lastKnownFileType = file; path = BuGS.2mg; sourceTree = "<group>"; };
|
||||||
9D8AF0B72535542400C10E3C /* level.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = level.s; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.asm.orcam; };
|
9D8AF0B72535542400C10E3C /* level.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = level.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; };
|
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>"; xcLanguageSpecificationIdentifier = xcode.lang.asm.orcam; };
|
||||||
9D8FFC612491CAF0005C9327 /* game.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = game.h; sourceTree = "<group>"; };
|
9D8FFC612491CAF0005C9327 /* game.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = game.h; sourceTree = "<group>"; };
|
||||||
9D9F07F92553AB3800875B29 /* TODO.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = TODO.md; sourceTree = "<group>"; };
|
9D9F07F92553AB3800875B29 /* TODO.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = TODO.md; sourceTree = "<group>"; };
|
||||||
9DB1505024C3801100558B87 /* gameFlea.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = gameFlea.s; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.asm.orcam; };
|
9DB1505024C3801100558B87 /* gameFlea.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = gameFlea.s; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.asm.orcam; };
|
||||||
|
|
|
@ -124,5 +124,7 @@ $(GENDIR)/tileData.s: genData.pl Makefile
|
||||||
genclean:
|
genclean:
|
||||||
$(RM) $(GENDIR)/tileData.s $(GENDIR)/screenData.s $(GENDIR)/tileData.h
|
$(RM) $(GENDIR)/tileData.s $(GENDIR)/screenData.s $(GENDIR)/tileData.h
|
||||||
|
|
||||||
|
main.rez: $(wildcard sound/*.raw)
|
||||||
|
|
||||||
# Do not change anything else below here...
|
# Do not change anything else below here...
|
||||||
include make/tail.mk
|
include make/tail.mk
|
||||||
|
|
70
BuGS/game.s
70
BuGS/game.s
|
@ -24,6 +24,7 @@
|
||||||
game start
|
game start
|
||||||
using globalData
|
using globalData
|
||||||
using tileData
|
using tileData
|
||||||
|
using playerData
|
||||||
|
|
||||||
jsl setupScreen
|
jsl setupScreen
|
||||||
|
|
||||||
|
@ -190,6 +191,15 @@ startGame_notRunning anop
|
||||||
stz gameRunning
|
stz gameRunning
|
||||||
jsl initPlayer
|
jsl initPlayer
|
||||||
jsl scoreStartGame
|
jsl scoreStartGame
|
||||||
|
lda isSinglePlayer
|
||||||
|
beq startGame_singlePlayer
|
||||||
|
lda #PLAYER_TWO
|
||||||
|
sta playerNum
|
||||||
|
jsl addRandomMushrooms
|
||||||
|
jsl copyToPlayer2Tiles
|
||||||
|
lda #PLAYER_ONE
|
||||||
|
sta playerNum
|
||||||
|
startGame_singlePlayer anop
|
||||||
jsl addRandomMushrooms
|
jsl addRandomMushrooms
|
||||||
jsl spiderInitGame
|
jsl spiderInitGame
|
||||||
jsl levelInit
|
jsl levelInit
|
||||||
|
@ -204,7 +214,65 @@ startLevel entry
|
||||||
jsl playerLevelStart
|
jsl playerLevelStart
|
||||||
jmp levelStart
|
jmp levelStart
|
||||||
|
|
||||||
|
|
||||||
|
copyToPlayer1Tiles entry
|
||||||
|
ldx #0
|
||||||
|
copyToPlayer1Tiles_loop anop
|
||||||
|
lda tileData,x
|
||||||
|
sta >player1Tiles,x
|
||||||
|
inx
|
||||||
|
inx
|
||||||
|
cpx #RHS_FIRST_TILE_OFFSET
|
||||||
|
blt copyToPlayer1Tiles_loop
|
||||||
|
rtl
|
||||||
|
|
||||||
|
|
||||||
|
copyToPlayer2Tiles entry
|
||||||
|
ldx #0
|
||||||
|
copyToPlayer2Tiles_loop anop
|
||||||
|
lda tileData,x
|
||||||
|
sta >player2Tiles,x
|
||||||
|
inx
|
||||||
|
inx
|
||||||
|
cpx #RHS_FIRST_TILE_OFFSET
|
||||||
|
blt copyToPlayer2Tiles_loop
|
||||||
|
rtl
|
||||||
|
|
||||||
|
|
||||||
|
copyFromPlayer1Tiles entry
|
||||||
|
ldx #0
|
||||||
|
copyFromPlayer1Tiles_loop anop
|
||||||
|
lda >player1Tiles,x
|
||||||
|
cmp tileData,x
|
||||||
|
beq copyFromPlayer1Tiles_skip
|
||||||
|
sta tileData,x
|
||||||
|
lda TILE_STATE_DIRTY
|
||||||
|
sta tileDirty,x
|
||||||
|
copyFromPlayer1Tiles_skip anop
|
||||||
|
inx
|
||||||
|
inx
|
||||||
|
cpx #RHS_FIRST_TILE_OFFSET
|
||||||
|
blt copyFromPlayer1Tiles_loop
|
||||||
|
rtl
|
||||||
|
|
||||||
|
|
||||||
|
copyFromPlayer2Tiles entry
|
||||||
|
ldx #0
|
||||||
|
copyFromPlayer2Tiles_loop anop
|
||||||
|
lda >player2Tiles,x
|
||||||
|
cmp tileData,x
|
||||||
|
beq copyFromPlayer2Tiles_skip
|
||||||
|
sta tileData,x
|
||||||
|
lda TILE_STATE_DIRTY
|
||||||
|
sta tileDirty,x
|
||||||
|
copyFromPlayer2Tiles_skip anop
|
||||||
|
inx
|
||||||
|
inx
|
||||||
|
cpx #RHS_FIRST_TILE_OFFSET
|
||||||
|
blt copyFromPlayer2Tiles_loop
|
||||||
|
rtl
|
||||||
|
|
||||||
|
|
||||||
overwriteGameTile entry
|
overwriteGameTile entry
|
||||||
phy
|
phy
|
||||||
tay
|
tay
|
||||||
|
|
|
@ -555,6 +555,24 @@ EOF
|
||||||
print $fh $text;
|
print $fh $text;
|
||||||
close($fh);
|
close($fh);
|
||||||
|
|
||||||
|
# Generate the playerData.s file
|
||||||
|
open $fh, ">", "$gGenDir/playerData.s" or die "$0: Unable to open $gGenDir/playerData.s for writing, $!";
|
||||||
|
my $dataSize = 2 * $gEquates{"NUM_GAME_TILES"};
|
||||||
|
$text = << "EOF";
|
||||||
|
case on
|
||||||
|
mcopy playerData.macros
|
||||||
|
keep playerData
|
||||||
|
|
||||||
|
playerData data playerDataSeg
|
||||||
|
|
||||||
|
player1Tiles ds $dataSize
|
||||||
|
player2Tiles ds $dataSize
|
||||||
|
|
||||||
|
end
|
||||||
|
EOF
|
||||||
|
print $fh $text;
|
||||||
|
close($fh);
|
||||||
|
|
||||||
# Generate the tileData.h file
|
# Generate the tileData.h file
|
||||||
|
|
||||||
open $fh, ">", "$gGenDir/tileData.h" or die "$0: Unable to open $gGenDir/tileData.h for writing, $!";
|
open $fh, ">", "$gGenDir/tileData.h" or die "$0: Unable to open $gGenDir/tileData.h for writing, $!";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user