diff --git a/Atari/textproc.asm b/Atari/textproc.asm index 2beb1f6..84f9726 100644 --- a/Atari/textproc.asm +++ b/Atari/textproc.asm @@ -2098,6 +2098,10 @@ AngleDisplay .proc RoundOverSprites ; fill sprites with bytes ldy numberOfPlayers + bit TeamGame + bvc NoTeamSprites + ldy #2 ; 2 teams +NoTeamSprites dey lda gameOverSpritesTop,y sta temp diff --git a/game.asm b/game.asm index a33b240..658963b 100644 --- a/game.asm +++ b/game.asm @@ -173,9 +173,45 @@ esubstractlose sbc loseH,x sta EarnedMoneyH,x eskipzeroing - dex jpl CalculateGainsLoop + ; Team game calculations + ; set initial values + inx ; now X=0 + txa + inx ; now X=1 +initialTeamsVal + sta ResultsTable+MaxPlayers,x + sta DirectHits+MaxPlayers,x + sta EarnedMoneyH+MaxPlayers,x + sta EarnedMoneyL+MaxPlayers,x + dex + bpl initialTeamsVal + ; and now Team scores calculations + tax ; now X=0 + tay +CalculateTeamsResults + clc + lda ResultsTable+MaxPlayers,y + adc ResultsTable,x + sta ResultsTable+MaxPlayers,y + clc + lda DirectHits+MaxPlayers,y + adc DirectHits,x + sta DirectHits+MaxPlayers,y + clc + lda EarnedMoneyL+MaxPlayers,y + adc EarnedMoneyL,x + sta EarnedMoneyL+MaxPlayers,y + lda EarnedMoneyH+MaxPlayers,y + adc EarnedMoneyH,x + sta EarnedMoneyH+MaxPlayers,y + tya + eor #$01 ; swap team + tay + inx + cpx NumberOfPlayers + bne CalculateTeamsResults rts .endp ;-------------------------------------------------- @@ -978,6 +1014,11 @@ UsageLoop cpx NumberOfPlayers bcc GetRandomAgainX + ; and "sequence" for teans + ldx #MaxPlayers + stx TankSequence+MaxPlayers+1 ; B-Team + inx + stx TankSequence+MaxPlayers ; A-Team rts .endp ;---------------------------------------------- @@ -1353,6 +1394,10 @@ GameOver4x4 sbb ResultY #2 ;next line (was empty) ldx NumberOfPlayers ;we start from the highest (best) tank + bit TeamGame + bvc NoTeamsResults + ldx #MaxPlayers+2 ; set pointer to teams results +NoTeamsResults dex ;and it is the last one stx ResultOfTankNr ;in TankSequence table @@ -1419,7 +1464,10 @@ TankNameCopyLoop jsr TL4x4_empty dec ResultOfTankNr - bmi FinishResultDisplay + bmi FinishResultDisplay ; check for last player + lda ResultOfTankNr + cmp #MaxPlayers-1 ; check for last team + beq FinishResultDisplay sbb ResultY #2 ;distance between lines is smaller diff --git a/scorch.xex b/scorch.xex index ebfdaff..20566fb 100644 Binary files a/scorch.xex and b/scorch.xex differ diff --git a/variables.asm b/variables.asm index df48cc5..a8d3450 100644 --- a/variables.asm +++ b/variables.asm @@ -67,7 +67,7 @@ OptionsY .ds 1 ;vertical position of cursor on Options screen flyDelay .ds 1 ;-------------- ;NumberOfPlayers .DS 1 ;current number of players (counted from 1) -TankSequence .DS MaxPlayers ;sequence of shooting during the Round +TankSequence .DS MaxPlayers+2 ;sequence of shooting during the Round (+2 for teams) GameIsOver .DS 1 ; 1 means it was the last round in the game ;---------------------------------------------------- moneyH ;we place zero at the end of prices and money