Banner
Views: 808,231,905
Time:
19 users online: algae5, AnasMario130, bandicoot,  Deeke, Dippy, edgar, Enderdavid_HD,  FPzero, Hiro-sofT, Mega,  Nameless, Nint3ndoleggend, Puduhge, SquidMan_Raps, StayAtHomeStegosaurus, Teows, TheNooseMan87, Vhack, VLSkoot - Guests: 100 - Bots: 224 Users: 42,442 (2,000 active)
Latest: 00_marvelouschester_00
Tip: Try not to use the exact same background more than once or twice in a row.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 »
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 »
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 - 2020 - SMW Central
Legal Information - Privacy Policy - Link To Us


Total queries: 7

Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

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