Banner
Views: 993,022,568
Time:
9 users online:  Alex_X8, BabaYegha, Everest, George, LaserShark360, Luxari0n, ocked, SilentSnake20, wulv257 - Guests: 103 - Bots: 123 Users: 54,459 (2,081 active)
Latest: sanskieth
Tip: Make a backup of your hack before using any external tools on it so you can revert to a previous version should anything go wrong.
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
Type:
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).

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

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

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

You can simply do DEY : BPL .loopstart.
----------------
Code
   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:
Code
   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.
----------------
Code
   BMI .superloopend
   BRA .superloopstart
   .superloopend:

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


Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

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