+mksmith Posted June 26, 2019 Share Posted June 26, 2019 (edited) Currently i'm trying to add additional lives once you reach a stated number (in this case first 20,000 then every 60,000 points). I'm trying to do the following: sc0=score0 sc1=score0+1 sc2=score0+2 scoreLifeBenchmark = 0 validateExtraLife rem check 20,000 if sc0 >= $02 && scoreLifeBenchmark = 0 then playerLives = playerLives + 1 : scoreLifeBenchmark = scoreLifeBenchmark + 1 : goto _exitValidateExtaLife rem check every 60,000 value = 6*scoreLifeBenchmark if sc0 >= value then playerLives = playerLives + 1 : scoreLifeBenchmark = scoreLifeBenchmark + 1 : goto _exitValidateExtaLife _exitValidateExtaLife return thisbank So essentially what happens as you reach a benchmark it increases that value by one thus you can then check 6*1=6 (60,000), 6*2=12 (120,000), 6*3=18 (180,000) etc against the first 2 digits in the score. Can anyone shed some light - the score stuff does my head in regularly! Edited June 26, 2019 by mksmith Quote Link to comment Share on other sites More sharing options...
RevEng Posted June 26, 2019 Share Posted June 26, 2019 You're close. The thing is, the score is stored in BCD format, and stuff like "value = 6*scoreLifeBenchmark" isn't BCD compatible - the 6502 can only add and subtract in BCD format. I haven't tested it out, but something like the following should work... sc0=score0 sc1=score0+1 sc2=score0+2 scoreLifeBenchmark = 0 validateExtraLife rem check 20,000 if sc0 >= $02 && scoreLifeBenchmark = 0 then playerLives = playerLives + 1 : dec scoreLifeBenchmark = scoreLifeBenchmark + 6 : goto _exitValidateExtaLife rem check every 60,000 if sc0 >= scoreLifeBenchmark then playerLives = playerLives + 1 : dec scoreLifeBenchmark = scoreLifeBenchmark + 6 : goto _exitValidateExtaLife _exitValidateExtaLife return thisbank 1 Quote Link to comment Share on other sites More sharing options...
+mksmith Posted June 26, 2019 Author Share Posted June 26, 2019 Ah yes can't multiply - did read that thinking back now ? ? ? I'll try that out shortly thank you ? Quote Link to comment Share on other sites More sharing options...
+mksmith Posted June 26, 2019 Author Share Posted June 26, 2019 That fixed it - thanks Mike ? 1 Quote Link to comment Share on other sites More sharing options...
RevEng Posted June 27, 2019 Share Posted June 27, 2019 You're welcome. One step closer... ? 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.