Arcade games 


· Programmer’s initials, such as “DFT” (for David Theurer) appear on high score table (see picture).

· BUG: Free cities – At about 810,000 points you’re awarded exactly 176 bonus cities. You can’t earn any more until you roll the score. 

Once a player reaches screen 255 the following code is executed to calculate the point values* bonus multiplier. When the screen number ($A7) is 255,the addition of 1 gives a value of 0 in Reg A. When this is compared to 6 it is less so 0 will be used as the multiplier. In the code after label LBL295 0 is used as a counter to sum up the bonus, but when the counter is decremented the first time 0 goes to 255 causing the code to do (25*256) instead of the wanted (25*6). On screen 256 this same problem will occur. The screen number will be 0; adding 1 to this then do a LSR will give a value of 0 in Reg A. 

As for why there is no attack on screen 256 the following code explains it. On screen 256 the screen number value is 0 which is used as an index in a lookup table to get the number of missiles and smart bombs for that screen. However the games programmer never expected a player to get to screen 256 so the lookup in the table is not valid. Luckily the values read are both 0, this tells the game that there are no missiles or smart bombs to launch, so the screen is over and the game just adds up the 30 missiles and the remaining cities. After this the screen number increments to 1 which is the value at the start of the game so that's why it looks like the game starts over. Hopefully that explains why Missile Command does what it does at screen 255 and 256. 

In the code below, entering subroutine 170 the dip switches are read and used to get the number of points for a bonus city. If the game is set to no bonus cities then the code is not run which is why the bug is not seen in TGTS. The upper 4 digits of the player score are read and stored in $98 and $99. The 6502 is put in Binary Coded Decimal mode to do the actual calculation. The bonus city value is then subtracted from the users score and if the result is not negative then the temp bonus city counter is incremented. If the players score is still positive after the subtraction then it is done again. The bug occurs when the upper 2 digits are 81. When the bonus city value of 1 is subtracted the result is 80 letting the N flag be set causing the BMI branch to be taken in error. When the bonus city calculation is done after LBL357 the temp city count is 0 because of the error, the previous bonus city value is 0x50 because of the city awarded at 800K. When we do 0 - 0x50 we get 0xb0 which is 176 added to the bonus city count. The previous city count is then updated to 0. As long as the score stays over 810K the BMI branch will be taken in error and no more bonus cities will be given until the score roles over.


     LDA    #$00        ;Load A with 0x00
     STA    $BA         ;Clear out $BA
     STA    $BB         ;Clear out $BB
     LDA    $A7         ;Load screen number
     CLC                ;Get ready for add
     ADC    #$01        ;INC screen number
     LSR                ;Do div 2 so bonus increases 2 screens
     CMP    #$06        ;See if we are at 6X
     BCC    LBL295      ;If it's less than 6
     LDA    #$06        ;Else set to 6
     STA    $DD         ;Save to bonus multiplier
     TAX                ;Move multiplier to X to be used as a counter
LBL296:                 ;Calc 25*bonus and save in $BB,$BA in BCD
     SED                ;Set BCD mode
     LDA    $BA         ;Get lower byte
     CLC                ;Get ready for add
     ADC    #$25        ;Add 25 to it
     STA    $BA         ;Save 
     LDA    $BB         ;Get upper byte
     ADC    #$00        ;Add carry if any
     STA    $BB         ;Save upper byte
     CLD                ;Clear BCD mode
     DEX                ;Dec bonus count
     BNE    LBL296      ;If we are not at 0


Go to Digital Press HQ
Return to Digital Press Home