Jump to content
IGNORED

Astroblast 100k bug


cwieland

Recommended Posts

Hi.  I was playing the HSC NTSC version of Astroblast and encountered the bug that incorrectly gives you extra lives when you go over a 100k then fall below 100k.  Every object you shoot while below 100k turns into an extra life.  I think there is a version of the game where this bug has been fixed.  If so, it would nice if we could incorporate this fix into the HSC version.

 

 

Edited by cwieland
  • Like 1
Link to comment
Share on other sites

I think this would fix it.  But since it's like that in the original game, I wonder if we should or not.

.incrementScoreLoop
   ...
   lda playerScore + 1              ; get player hundreds value
   beq CheckToIncrementNumberOfBases
   cmp peakScore+1
   beq .checkToSetNewPeakScore
   bcc .checkToSetNewPeakScore
   
   ; 100k points bug fix
   ; This bug occurs when the score has gone past a 100k mark (e.g. 100000, 200000, etc.) and subsequently drops
   ; below the 100k mark.  An extra base is awarded until the 100k mark is reached again or the player has 99 bases.
   
   ; At this point in the logic we know that the player hundreds value is greater than the peak hundreds value.
   ; This additional logic ensures that the player thousands value is also equal to or greater the peak thousands value.

   lda playerScore                  ; get player thousands value
   cmp peakScore                    
   bcc .checkToSetNewPeakScore      ; Prevent running extra man logic if player thousands score is less than peak score thousands

.incrementNumberOfBases
   ...

 

Edited by cwieland
My grammar sucks
  • Like 1
Link to comment
Share on other sites

On 11/19/2021 at 3:51 AM, cwieland said:

I think this would fix it.  But since it's like that in the original game, I wonder if we should or not.


.incrementScoreLoop
   ...
   lda playerScore + 1              ; get player hundreds value
   beq CheckToIncrementNumberOfBases
   cmp peakScore+1
   beq .checkToSetNewPeakScore
   bcc .checkToSetNewPeakScore
   
   ; 100k points bug fix
   ; This bug occurs when the score has gone past a 100k mark (e.g. 100000, 200000, etc.) and subsequently drops
   ; below the 100k mark.  An extra base is awarded until the 100k mark is reached again or the player has 99 bases.
   
   ; At this point in the logic we know that the player hundreds value is greater than the peak hundreds value.
   ; This additional logic ensures that the player thousands value is also equal to or greater the peak thousands value.

   lda playerScore                  ; get player thousands value
   cmp peakScore                    
   bcc .checkToSetNewPeakScore      ; Prevent running extra man logic if player thousands score is less than peak score thousands

.incrementNumberOfBases
   ...

 

Many thanks for the code. I have build a "fixed" version of the HSC ROM, which was a bit of work because I had to split up the PlusROM send function to fit all in.

 

The fixed version is uploaded to the PlusStore folder: /Public ROMs/PlusROMs/High Score Club

 

The code can be found at : https://github.com/Al-Nafuur/PlusROM-Hacks/blob/main/High Score Club hacks/Astroblast HSC/Astroblast HSC.asm

 

Unfortunately I am not very good at Astroblast, so I can not test the fix.

 

Link to comment
Share on other sites

21 hours ago, cwieland said:

It looks like there may be a bug in the logic that sends the score.  I had the difficulty switches set to B/B when I got the scores below.  I think that those should have come in as "Amateur" instead of "Expert".

 

image.thumb.png.a1a837d4b8690af85d999178d0242a2e.png

Looks like I have done a mistake in the ROM and send the gameLevel variable, but for the "Amateur" setting this variable increases with the scores..

 

Link to comment
Share on other sites

I looked at this bit yesterday too.  Perhaps you could just send a fake level for Expert instead of having to retool everything.  Just an idea.

SendPlusROMScore:
   ldx #2
   bit SWCHB                        ; Get the value of the right difficulty switch
   bpl .sendGameLevelForAmateur
   lda #$FF                         ; Use level "FF" when right difficulty switch is set to A (expert)
   sta gameLevel

.sendGameLevelForAmateur
   lda gameLevel
   sta WriteToBuffer
   ...

Never mind, too many bytes...

Edited by cwieland
Link to comment
Share on other sites

35 minutes ago, cwieland said:

I looked at this bit yesterday too.  Perhaps you could just send a fake level for Expert instead of having to retool everything.  Just an idea.


SendPlusROMScore:
   ldx #2
   bit SWCHB                        ; Get the value of the right difficulty switch
   bpl .sendGameLevelForAmateur
   lda #$FF                         ; Use level "FF" when right difficulty switch is set to A (expert)
   sta gameLevel

.sendGameLevelForAmateur
   lda gameLevel
   sta WriteToBuffer
   ...

Never mind, too many bytes...

 

 

instead of :

SendPlusROMScore:
   lda gameLevel
   sta WriteToBuffer

we could send SWCHB:

SendPlusROMScore:
   lda SWCHB                        ; Get the value of the right difficulty switch
   sta WriteToBuffer

the rest can be done at the HSC backend.

 

Currently gameLevel is 4 for "Expert" and 0 for "Amateur". The value sent is right shifted at the backend 2 times, so we have 0 = Amateur and 1 = Expert in the database. For this new version we would have to do a right shift 7 times in the backend transformation.

 

But changing the transformation in the backend and the data sent by the ROM also means we have to change the game-id, so old versions of the ROM, that have been downloaded by users and are still used locally, will not sent wrong data to the new transformation.

 

To avoid this we might try something like this:

SendPlusROMScore:
   lda SWCHB                        ; Get the value of the right difficulty switch
   lsr
   lsr
   lsr
   lsr
   lsr
   sta WriteToBuffer
   ...

 

 

  • Like 1
Link to comment
Share on other sites

I have build a new version of the HSC ROM.

 

After thinking about it a bit, I came to the conclusion to use the variant with the new transformation in the backend. If we would have right shifted SWCHB in the new ROM version and leave the Transformation as is, then users of the old ROM version would have an advantage, because some of their "Amateur" games would have been listed as "Expert" games in the HSC. Using a new Transformation instead means that users of the old version would have no advantage (only the disadvantage that all their games will be listed as "Amateur")

 

On 11/26/2021 at 8:41 PM, cwieland said:

It looks like there may be a bug in the logic that sends the score.  I had the difficulty switches set to B/B when I got the scores below.  I think that those should have come in as "Amateur" instead of "Expert".

 

image.thumb.png.a1a837d4b8690af85d999178d0242a2e.png

?

I switched these scores to "Amateur" in the HSC database.

  • Thanks 1
Link to comment
Share on other sites

  • 3 weeks later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...