Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;Starting point for CaDan
- ;
- ;
- ;
- ;VARIABLE EQUATES STARTING AT APPBACKUPSCREEN ($9872)
- stack = appbackupscreen ;2b Saved location of the stack
- saveiy = stack+2 ;2b Saved contents of IY
- islotcount = saveiy+2 ;1b Number of interrupt slots
- islotbank = islotcount+1 ;36b 3*12 interrupt slot data available.
- scorefilebase = islotbank+36 ;2b Start of scoring file data
- myflags = scorefilebase+2 ;8b Flags. Defined far below.
- itemp1 = myflags+8 ;2 bytes, temporary memory 1
- itemp2 = itemp1+2 ;2 bytes, temporary memory 2
- itemp3 = itemp2+2 ;2 bytes, temporary memory 3
- itemp4 = itemp3+2 ;2 bytes, temporary memory 4
- gametimer1 = itemp4+2 ;1 byte, running game timer for each
- intcount = gametimer1+1 ;1 byte, interrupt cycle count
- keyread = intcount+1 ;1 byte, key that was immediately read
- keywait = keyread+1 ;1 byte, waiting until held key hits again
- keyoutput = keywait+1 ;1 byte, value that keywaited routines read.
- texty = keyoutput+1 ;1 byte, current y position of text
- textx = texty+1 ;1 byte, current x position of text
- textxbase = textx+1 ;1 byte, starting x on new line
- textxlim = textxbase+1 ;1 byte, right edge limiter of text
- prevchar = textxlim+1 ;1 byte, previous character used
- screenbuf = prevchar+1 ;2 byte, moveable screen buffer for menusys
- lineheight = screenbuf+2 ;1 byte, distance between tops of two strings
- curmenu = lineheight+1 ;2 byte, address of currently running menu
- curscore = curmenu+2 ;4 byte, current score
- tempscore = curscore+4 ;4 byte, pool for score adding to curscore
- scorediv = tempscore+4 ;1 byte, bit to start with div by 8 (cycle ud)
- scoretime = scorediv+1 ;1 byte, timeframe until score done updating
- characterID = scoretime+1 ;1 byte, given character ID
- charbombs = characterID+1 ;1 byte, number of bombs the character has
- charcurbombs = charbombs+1 ;1 byte, number of bombs character has now
- charpower = charcurbombs+1 ;1 byte, power behind each shot
- charweapon1 = charpower+1 ;1 byte, unfocused weapon for character
- charweapon2 = charweapon1+1 ;1 byte, focused weapon for character
- charweapondat = charweapon2+1 ;1 byte, temporary variable for player state
- charbolad = charweapondat+1 ;1 byte, character max BoLaD
- charcurbolad = charbolad+1 ;1 byte, character current BoLaD counter
- chardu = charcurbolad+1 ;1 byte, character movement delta for unfocus
- chardf = chardu+1 ;1 byte, character movement delta for focused
- curstage = chardf+1 ;1 byte, current stage number. 1=first, 7=ext
- curdiff = curstage+1 ;1 byte, current difficulty setting.
- menuchoice = curdiff+1 ;2 byte, menu item chosen ($FF=none). 1b slack
- chary = menuchoice+2 ;1 byte, current character y position
- charx = chary+1 ;1 byte, current character x position
- charlives = charx+1 ;1 byte, number of lives character has.
- rectimer = charlives+1 ;1 byte, timer dedicated for player recovery
- curkills = rectimer+1 ;1 byte, # of kills achieved. Used as money
- saveix = curkills+1 ;2 bytes, used in script system for data ptr
- overflow = saveix+2 ;1 byte, stores MSB of mult, or remainder.
- curpos = overflow+2 ;2 bytes, current Y,X of script obj selected
- freebullet1 = curpos+2 ;1 byte, half pointer to FBT. (MSB is $8C)
- freebullet2 = freebullet1+1 ;1 byte, points to other half of FBT (b7 set)
- pbtfreebullet = freebullet2+1 ;1 byte, pointer to PBT's FBT (0-63)
- firedelay = pbtfreebullet+1 ;1 byte, delay in firing, by creator routines
- bossHP = firedelay+1 ;2 bytes, boss HP value
- bossArmor = bossHP+2 ;1 byte, resistance to normal fire
- bossShell = bossArmor+1 ;1 byte, resistance to spellcards
- bossTimer = bossShell+1 ;1 byte, multipurpose boss timer
- initseed = bossTimer+1 ;2 bytes, initial seed for... well... seeding
- lfsrseed1 = initseed+2 ;1 byte, seed for the 1 byte LFSR routine
- lfsrseed2 = lfsrseed1+1 ;2 bytes, seed for the 2 byte LFSR routine
- ramfree = lfsrseed2+2 ;2 bytes, amount of memory free for resources
- endofdefs1 = ramfree+2
- #ifdef main_build
- .echo "ABS varspace left: ",(appbackupscreen+(767-(564-6)))-endofdefs1
- #endif
- ;VARIABLE EQUATES STARTING AT APPBACKUPSCREEN ($9340)
- endvars equ plotsscreen ;do not use this area for anything else in project!
- itemp5 = plotsscreen ;long temporary variable. Used for buffering text
- escPu = plotsscreen
- OutPtr = escPu+1
- lzpos = OutPtr+2
- EscBits = lzpos+2
- Esc8Bits = EscBits+1
- MaxGamma = Esc8Bits+1
- Max1Gamma = MaxGamma+1
- Max2Gamma = Max1Gamma+1
- Max8Gamma = Max2Gamma+1
- ExtraBits = Max8Gamma+1
- tablePu = ExtraBits+1
- regy = tablePu+31
- decompstack = regy+1
- decompinadr = decompstack+2
- decompinpage = decompinadr+2
- decompoutadr = decompinpage+1
- decompcount = decompoutadr+2
- decompreturn = decompcount+2 ;return address on resume (set at suspend)
- dstackstart = (plotsscreen+(767-691))
- #ifdef main_build
- .echo "PSR varspace left: ",(plotsscreen+(767-691))-decompreturn
- #endif
- ;VARIABLE EQUATES FOR ROUTINES LOCATED AT $9D95
- ;Yes, we know they are not in order. No, we are not changing it back.
- ramseg1 = $9D95 ;0107b Common routines for multipage app management
- ramseg2 = $9E00 ;0256b Common data resource tables
- ramseg9 = $9F00 ;0256b Spillover data area
- ramseg8 = $A000 ;0256b | Menu system text data | Decompression buffer |
- ramseg5 = $A100 ;0512b | Menu system text data | Spellcard background |
- ramseg7 = $A300 ;0256b | Menu system text data | Bullet script data |
- ramseg4 = $A400 ;1024b | Menu system text data | Second bullet table |
- ramseg3 = $A800 ;2048b | Menu system text data | Stg background buffer |
- ramseg6 = $B000 ;4096b |Menu system img buffer |Script resource buffer |
- ramsegend = $C000 ;8811t No more memory may be allocated.
- ;Note: ramseg4 MUST NOT be moved from $A400, unless it is to any address
- ;satisfying $x4xx or $xCxx
- ;VARIABLE EQUATES FOR RAM SEGMENT STARTING AT RAMSTART ($8000)
- ;Formatted for informational purposes only. Magic numbers are used.
- ;-----------------------------------------------------------------------------
- ;AD-ST | Usage during menu system run | Usage during danmaku engine run
- ;------+----------------------------------+-----------------------------------
- ;$8000 | Black screen buffer (1/3) | * Black screen buffer (1/2)
- ;$8100 | Black screen buffer (2/3) | * Black screen buffer (2/2)
- ;$8200 | Black screen buffer (3/3) | * 8-bit sine/cosine table
- ;$8300 | Unused | Player portrait buffer
- ;$8400 | Gray screen buffer (1/3) | * Gray screen buffer (1/2)
- ;$8500 | Gray screen buffer (2/3) | * Gray screen buffer (2/2)
- ;$8600 | Gray screen buffer (3/3) | * Enemy portrait buffer
- ;$8700 | Unused | 8x8 sprite rotation buffer
- ;$8800 | Unused | Primary bullet data table (1/4)
- ;$8900 | Unused | Primary bullet data table (2/4)
- ;$8A00 | Unused | Primary bullet data table (3/4)
- ;$8B00 | Unused | Primary bullet data table (4/4)
- ;$8C00 | Unused | Bullet allocation table
- ;$8D00 | Unused | Player bullet table
- ;$8E00 | Menu system recordkeeping | Enemy script data area
- ;-----------------------------------------------------------------------------
- ;EQUATES FOR CADAN SCRIPTS
- enemyscript0 = $8E00
- enemyscript1 = $8E14
- enemyscript2 = $8E28
- enemyscript3 = $8E3C
- enemyscript4 = $8E50
- enemyscript5 = $8E64
- enemyscript6 = $8E78
- enemyscript7 = $8E8C
- enemyscript8 = $8EA0
- enemyscript9 = $8EB4
- bossscript0 = $8EC8
- stagescript0 = $8EE4
- ;GAME FLAGS FOR APPLICATION USE
- sysflags equ 0
- immtemp = 0 ;temporary variable for immediate use
- keyprimed = 1 ;set if first time using the keyreading system
- menureturn = 2 ;set to enable return function for menu
- smalltext = 3 ;set to enable small text rendering
- ;========================
- gamesettings equ 1
- practicemode = 0 ;set to enable practice mode (255 lives/bombs)
- setexternals = 1 ;set to enable external level choice
- setdebugmode = 2 ;set to enable debug mode. Wheeee~!
- hexscoremode = 4 ;set to enable hexadecimal scoreboard mode
- binscoremode = 5 ;set to enable binary scoring. Used with hex scoring
- ;========================
- danmakuflags equ 2
- gotomenu = 0 ;set to go to minimenu mode (from danmaku mode)
- isfocused = 1 ;set if the character is in focused mode
- isrecovering = 2 ;set to make char sprite flash. Also invincible.
- isdying = 3 ;set to block movement and run the BoLaD timer
- isbombing = 4 ;set to indicate bombing mode. Invincible. Timer run
- isspellcard = 5 ;set to indicate enemy spellcard mode. Timer 4 init
- isbossrunning = 6 ;set to run boss mode. Timer for init.
- slowmode = 7 ;set to enable slowmode (and all that it entails)
- ;========================
- stateflags equ 3
- fbt1full = 0 ;set if the first bullet table is full
- fbt2full = 1 ;set if the second bullet table is full
- noreplay = 2 ;set if replay save disabled. Only temporary.
- isdecomp = 3 ;set if decompressor is running
- isdecompdone = 4 ;set when decompressor is finished
- iswriting = 5 ;set while decompressor writing to a buffer
- decompsuspend = 6 ;reset to undo suspend state for loader routine
- ;FLAGS DIRECT ACCESS SHORTHAND:
- msysflg equ myflags+sysflags
- mgameset equ myflags+gamesettings
- mdanmaku equ myflags+danmakuflags
- ;VARIABLES FOR EXTERNAL USE. ALL POINTERS REFER TO APP PAGE OFFSET ZERO.
- startBattleField = $4082
- ;EQUATES FOR KEYPRESSES
- KEY_DEL = 7
- KEY_MODE = 6
- KEY_2ND = 5
- KEY_YEQU = 4
- KEY_UP = 3
- KEY_RIGHT = 2
- KEY_LEFT = 1
- KEY_DOWN = 0
- .echo "Curscore location: ",curscore
Advertisement
Add Comment
Please, Sign In to add comment