Jump to content
  • entries
    40
  • comments
    0
  • views
    2,267

Assembler


I used defines with IFCONST to optionally include code into the ROM.  I added a DEFINE_DEMO which results in reduced features and a different title screen in the output ROM.  If I comment out DEFINE_DEMO the output ROM is the full game.  This is very convenient for debugging and being able to easily enable and disable game features.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Define constants A
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
DEFINE_TITLEFIRST
DEFINE_PLAYAUDIO
DEFINE_SCREENFLIPS
DEFINE_RUMBLE
DEFINE_WAVES
DEFINE_COLLISIONDETECTION
DEFINE_SHIPCOLLISIONS
;===========================
DEFINE_DEMO
;DEFINE_BLACKSELECTSCREEN
;DEFINE_DISPLAYMETRICS
;DEFINE_MAXMISSILEDODGE

 

I recommend not just learning 6502 assembly, but also reading the dasm manual.  That's how I learned about using aliases with SET.  This allowed me to set aliases for my variables that are only in effect for a subroutine.  Some of the algorithms could get a bit complex and with variables like TEMP, TEMP2, TEMP3, and TEMP4 it can be very difficult to understand and debug.  Appropriate variable names makes things much easier to understand.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Partition Screen
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;This function needs some cleanup
VerticalPartitionScreen_BANK0 subroutine
.StartRow SET Temp
.TempRow SET Temp2
.TopRow SET Temp3
.BottomRow SET Temp4

0 Comments


Recommended Comments

There are no comments to display.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

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