Banner
Views: 827,709,918
Time:
26 users online: algae5, AntiDuck, blackhart, BootaNoBijuu, callmedoor, CapriSun64,  Deeke, Far, Green Jerry, i make mario smw hacks, JamesD28, Katrina, killerofkings07, Knight of Time, Koopster, LOLRyan2006 Mario Fan, Magmatic, MarioriaM, MilkyMooer,  Nameless, NicoTheKaizoer, qantuum, Shingo, Sokobansolver, Sonck,  Tahixham - Guests: 90 - Bots: 60 Users: 44,284 (2,527 active)
Latest: super duper ultra channel yt
Tip: Don't replace the first two Map 16 FG Pages with ExGFX.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: 14

Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

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