Advertisement
NovaYoshi

adventure memory.s

Aug 10th, 2015
412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .segment "ZEROPAGE"
  2.   MaxNumPlayers = 1
  3.  
  4.   retraces:        .res 1
  5.   keydown:         .res MaxNumPlayers
  6.   keylast:         .res MaxNumPlayers
  7.  
  8.   random1:         .res 2
  9.   random2:         .res 2
  10.  
  11.   psg_sfx_state:    .res 32 ; don't need since I changed music engines but maybe I should keep it here
  12.  
  13.   ScrollX:          .res 2
  14.   ScrollY:          .res 2
  15.   ScrollSpeed:      .res 2
  16.  
  17.   LevelBlockPtr: .res 2
  18.  
  19.   ; 16-bit X and Y positions:
  20.   ; HHHHHHHH LLLLLLLL
  21.   ; |||||||| ||||++++ - subpixels
  22.   ; ++++++++ ++++------ actual pixels
  23.  
  24.   PlayerEnabled:    .res 1
  25.   PlayerPXL:        .res 1
  26.   PlayerPXH:        .res 1
  27.   PlayerPYH:        .res 1
  28.   PlayerPYL:        .res 1
  29.   PlayerVXH:        .res 1
  30.   PlayerVXL:        .res 1
  31.   PlayerVYH:        .res 1
  32.   PlayerVYL:        .res 1
  33.   PlayerInvincible: .res 1
  34.   PlayerDropLock:   .res 1
  35.   PlayerWasRunning: .res 1 ; was the player running when they jumped?
  36.   PlayerDir:        .res 1; 0 or 1
  37.   PlayerDirForScroll: .res 1; 0 or 1
  38.   PlayerJumping:    .res 1
  39.   PlayerOnGround:   .res 1
  40.   PlayerJumpCancelLock: .res 1
  41.   PlayerWalkLock:   .res 1
  42.   PlayerDownTimer:  .res 1
  43.   PlayerLives:      .res 1
  44.   PlayerHealth:     .res 1
  45.   PlayerTailAttack: .res 1
  46.   PlayerAnimationFrame: .res 1
  47.   PlayerAbility:    .res 1
  48.   PlayerTiles:      .res 7
  49.  
  50.   IsScrollUpdate:     .res 1 ; nonzero = yes
  51.   ScrollUpdateChunk:  .res 1 ; current 32 pixel chunk we're updating
  52.  
  53.   MaxNumBlockUpdates = 3
  54.   MaxNumTileUpdates  = 4
  55.   BlockUpdateA1:   .res MaxNumBlockUpdates
  56.   BlockUpdateA2:   .res MaxNumBlockUpdates
  57.   BlockUpdateB1:   .res MaxNumBlockUpdates
  58.   BlockUpdateB2:   .res MaxNumBlockUpdates
  59.   BlockUpdateT1:   .res MaxNumBlockUpdates
  60.   BlockUpdateT2:   .res MaxNumBlockUpdates
  61.   BlockUpdateT3:   .res MaxNumBlockUpdates
  62.   BlockUpdateT4:   .res MaxNumBlockUpdates
  63.  
  64.   TileUpdateA1:    .res MaxNumTileUpdates
  65.   TileUpdateA2:    .res MaxNumTileUpdates
  66.   TileUpdateT:     .res MaxNumTileUpdates
  67.  
  68.   ThirtyUpdateAddr: .res 2
  69.   TempSpace = ThirtyUpdateTile       ; used by various non-game stuff
  70.   ThirtyUpdateTile: .res 30
  71.   ScrollLevelPointer: .res 2
  72.  
  73.   DecodeObjectType   = TempSpace+0
  74.   DecodeObjectXY     = TempSpace+1
  75.   DecodeObjectBlock  = TempSpace+2
  76.   DecodeObjectWidth  = TempSpace+3
  77.   DecodeObjectHeight = TempSpace+4
  78.  
  79.   LevelNumber:     .res 1
  80.  
  81.   OamPtr:          .res 1
  82.   TempVal:         .res 4
  83.   TempX: .res 1
  84.   TempY: .res 1
  85.  
  86.   TouchTemp:       .res 1
  87.   TouchTopA:       .res 1
  88.   TouchTopB:       .res 1
  89.   TouchLeftA:      .res 1
  90.   TouchLeftB:      .res 1
  91.   TouchWidthA:     .res 1
  92.   TouchWidthB:     .res 1
  93.   TouchHeightA:    .res 1
  94.   TouchHeightB:    .res 1
  95.  
  96.   EnemyWidth:      .res 1
  97.  
  98. ; level decode stuff
  99.   LevelHeaderPointer: .res 2
  100.  
  101.   SpriteTileOffset: .res 1
  102.   SpriteTileSlots:  .res 4     ; \ keep together
  103.   LevelDecodePointer: .res 2   ;  \ in this order
  104.   LevelSpritePointer: .res 2   ;  /
  105.   LevelBackgroundColor: .res 1 ; /
  106.   LevelDecodeXPos:    .res 1
  107.   CollectedBitsIndex: .res 1 ; 0 or 128, for alternate or current collectedbits
  108.  
  109. .segment "BSS"
  110.   UploadTileAddress: .res 2
  111.   UploadTileSpace:
  112.   StringBuffer:
  113.   Attributes:      .res 64 ; scratch space for whatever
  114.                    .res 64 ; more
  115.   PRGBank: .res 1
  116.   Coins:   .res 2  ; 2 digits, BCD
  117.   CoinShowTimer: .res 1
  118.   PlayerOnLadder: .res 1
  119.   LevelUploadList: .res 20
  120.  
  121.   AttributeWriteA1: .res 1
  122.   AttributeWriteA2: .res 4
  123.   AttributeWriteD:  .res 8
  124.   NeedSFX: .res 4
  125.  
  126.   MaxDelayedMetaEdits = 10
  127.   DelayedMetaEditIndexHi: .res MaxDelayedMetaEdits
  128.   DelayedMetaEditIndexLo: .res MaxDelayedMetaEdits
  129.   DelayedMetaEditTime: .res MaxDelayedMetaEdits
  130.   DelayedMetaEditType: .res MaxDelayedMetaEdits
  131.  
  132.   MaxExplosions = 5
  133.   ExplosionPosX: .res MaxExplosions
  134.   ExplosionPosY: .res MaxExplosions
  135.   ExplosionSize: .res MaxExplosions
  136.   ExplosionTime: .res MaxExplosions
  137.  
  138.   BulletLen   = 12
  139.   ObjectLen   = 8
  140.   BulletPX:    .res BulletLen
  141.   BulletPXL:   .res BulletLen
  142.   BulletPY:    .res BulletLen
  143.   BulletPYL:   .res BulletLen
  144.   BulletVX:    .res BulletLen
  145.   BulletVXL:   .res BulletLen
  146.   BulletVY:    .res BulletLen
  147.   BulletVYL:   .res BulletLen
  148.   BulletLife:  .res BulletLen
  149.   BulletF:     .res BulletLen  ;flags
  150.   ; EP--TTTT
  151.   ;  E - enabled
  152.   ;  P - player bullet, if 1 can damage enemies
  153.   ;  T - type
  154.  
  155.   ObjectPXH:   .res ObjectLen
  156.   ObjectPXL:   .res ObjectLen
  157.   ObjectPYH:   .res ObjectLen
  158.   ObjectPYL:   .res ObjectLen
  159.   ObjectVXH:   .res ObjectLen
  160.   ObjectVXL:   .res ObjectLen
  161.   ObjectVYH:   .res ObjectLen
  162.   ObjectVYL:   .res ObjectLen
  163.  
  164.   ObjectF1:    .res ObjectLen ; TTTTTTTD, Type, Direction
  165.   ObjectF2:    .res ObjectLen ; ----SSSS, State
  166.   ObjectF3:    .res ObjectLen ; --------
  167.   ObjectF4:    .res ObjectLen ; --------
  168.   ObjectIndexInLevel: .res ObjectLen ; object's index in level list, prevents object from being respawned until it's despawned
  169.   ObjectTimer: .res ObjectLen ; when timer reaches 0, reset state
  170.  
  171.   LevelMap = $6000            ; lasts until $6fff
  172.  
  173. .segment "BSS2"  ; SRAM
  174.   CollectedBits:      .res 128
  175.   CollectedAlternate: .res 128
  176.   ColumnBytes:        .res 128
  177.   ScriptFlags:        .res 64
  178.   ScriptFlagsSaved:   .res 64
  179.   LevelLinkUp:        .res 16 ; \
  180.   LevelLinkDown:      .res 16 ; | cleared together
  181.   ScreenFlags:        .res 16 ; /
  182.   ScreenFlagsDummy:   .res 1
  183. SCREEN_BOUNDARY = 1
  184.   LevelSize:          .res 1  ; last screen number in the level
  185.   CurSpriteIndex:     .res 1
  186.   LastSpriteIndex:    .res 1
  187.   LevelMusic:         .res 1
  188.   PlayerDrawX:        .res 1
  189.   PlayerDrawY:        .res 1
  190. .align 256
  191.   FamitoneRAM:     .res 256
  192.   SpriteListRAM:   .res 256
  193. .code
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement