Views: 993,053,598
10 users online: BeaverTom, Bluremii, Children's Digest 1950-2009, Exodust, FrozenQuills, GlitchyR-01, Jordan, NewPointless, Serge, WIKIDNEZ - Guests: 87 - Bots: 150 Users: 54,459 (2,080 active)
Latest: sanskieth
Tip: Using the retry system in your Kaizo hacks can help improve the pace of your gameplay between player deaths.
Not logged in.
1UP Every Certain Score by Mathos
Forum Index - Valley of Bowser - Moderation Questions - UberASM - 1UP Every Certain Score by Mathos
Pages: « 1 » Link
File Name: 1UP Every Certain Score
Submitted: 2017-01-23T18:47:22+01:00 by Mathos
Authors: Mathos
Includes GFX: No
Includes Hijack: No
Featured: No
Description: This simple code grants the player an extra life at certain checkpoints in the score. Use with game mode 14 (regular level gameplay).

Details in .asm file.

Requested by LucasRCD.
- It's a cool concept, but the code is simply a really inefficient way to put it. I'm not even sure why you are doing a bitmasking and two loops, when you can do it all simply in one loop (see below).

   LDA !Tracker   ; \ make sure we don't go overboard
   CMP !Entries   ; |
   BCC .nah       ; |
   LDA !Entries   ; |
   STA !Tracker   ; /

can be shortened to:
   LDA !Entries
   CMP !Tracker
   BCC .nah
   STA !Tracker

   DEY      ; \ continue if needed
   TYA            ; |
   BMI .loopend   ; |
   BRA .loopstart ; /

You can simply do DEY : BPL .loopstart.
   LDA ScoreTable,x   ; \ get check in $01
   AND $00                  ; |
   STA $02                  ; /
   LDA $01                  ; \ compare
   CMP $02		    ; /
   BEQ .loopnext            ; if same, gotta check further

Can be shortened to:
   LDA ScoreTable,x
   AND $00
   CMP $01
   BEQ .loopnext

There is no need to store the maskbits to $00 then compare, as you can just do AND AndTable,y.
   BMI .superloopend
   BRA .superloopstart

BPL .superloopstart
Here is an improved code with serves the same function.

- Also not a removal reason, but you forgot the sa-1 tag while the code seems fully compatible.
Pages: « 1 » Link
Forum Index - Valley of Bowser - Moderation Questions - UberASM - 1UP Every Certain Score by Mathos

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2022 - SMW Central
Legal Information - Privacy Policy - Link To Us


Follow Us On

  • YouTube
  • Twitch
  • Twitter


  • Super Mario Bros. X Community
  • Mario Fan Games Galaxy
  • sm64romhacks