Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Script system outline:
- Internal notes:
- Warning: Do not use the following for names of a script system command
- "db", "dw", "end", "org", "byte", "word", "fill", "block", "addinstr",
- "echo", "error", "list", "nolist", "equ", "show", "option", "seek"
- These are reserved by SPASM
- (*) In the command name box means that the function was personally tested and
- verfied to work (after much work was done). These ought not be messed with and
- yeah. Something like that.
- Naming conventions:
- rx = virtual register 0-7
- nn = 1 byte value
- ww = 2 byte value
- b = Some value between 0-7
- s = Some value between 0-15
- Some names will have a more descriptive label for its use. If one is used,
- read the description to determine the data's size.
- VERY IMPORTANT NOTE: ALL SCRIPT NAMES HAVE A PERIOD (.) PRECEDING THE NAMES
- EVEN THOUGH THEY DO NOT SHOW IN THIS LIST. ALWAYS REMEMBER.
- COMMANDSET AND NAME
- ==============================================================================
- ------------------------------------------------------------------------------
- - NORMAL EVERYDAY USE --------------------------------------------------------
- ------------------------------------------------------------------------------
- 000 | No operation. The script system halts on encountering this.
- NOP | Used for filler or something.
- ------------------------------------------------------------------------------
- 001-008 *| LOAD(rx,nn)
- LOAD | Stores a constant (1 byte) into a register.
- 2 bytes |
- ------------------------------------------------------------------------------
- 009-016 *| ADD(rx,nn)
- ADD | Adds a constant (1 byte) with a register, then stores the
- 2 bytes | results back to the register. Affects zero and carry flags.
- | There's no subtract operand for this mode. Use a negative
- | constant for doing that. There is no add with carry.
- ------------------------------------------------------------------------------
- 017-024 *| CLEAR(rx)
- CLEAR | Sets a register to zero.
- 1 byte |
- ------------------------------------------------------------------------------
- 025-032 *| AND(rx,nn)
- AND | Do a bitwise AND operation between a register and a constant
- 2 bytes | and store the result back into the register.
- | Affects the zero flag. Does not affect the carry flag.
- ------------------------------------------------------------------------------
- 033-040 *| XOR(rx,nn)
- XOR | Do a bitwise XOR operation between a register and a constant
- 2 bytes | and store the result back into the register.
- | Affects the zero flag. Does not affect the carry flag.
- ------------------------------------------------------------------------------
- 041-048 *| OR(rx,nn)
- OR | Do a bitwise OR operation between a register and a constant
- 2 bytes | and store the result back into the register.
- | Affects the zero flag. Does not affect the carry flag.
- ------------------------------------------------------------------------------
- 049-056 *| CPL(rx)
- CPL | Inverts all bits in a register.
- 1 byte | Affects the zero flag.
- | If you want to do NEG instead, just CPL, then INC it.
- ------------------------------------------------------------------------------
- 057-064 *| WAIT(rx)
- WAIT | Makes the script system wait for the number of game cycles
- 1 byte | that is stored in a register. Remember that 24 cycles is
- | about one second's worth of time in normal gameplay mode.
- | You should be setting that register to some known value
- | before using this instruction. Feeding in 0 is using 256.
- ------------------------------------------------------------------------------
- 065-072 *| CMP(rx,nn)
- CMP | Performs subtraction between a register and a constant in
- 2 bytes | the form: register-constant. The result is NOT stored back,
- | but instead, used to affect the zero and carry flags.
- | Good for use with conditional jumps.
- ------------------------------------------------------------------------------
- 073-080 *| TEST(rx,nn)
- TEST | Performs a bitwise AND operation between a register and a
- 2 bytes | constant, but does NOT store the results back to the
- | register. Instead, it's used to affect the zero flag.
- | Used when you need to figure out which bits are set in a
- | register, perhaps for conditional jumps?
- ------------------------------------------------------------------------------
- 081-088 *| TRACK(rx)
- TRACK | Output-only. Sets the given register to an angle that would,
- 1 byte | when used with the SHOOT command, fire a bullet directly
- | toward the player.
- ------------------------------------------------------------------------------
- 089-096 *| SHOOT(rx)
- SHOOT | Fires a shot at the angle given in a register. 'nuff said.
- 1 byte |
- ------------------------------------------------------------------------------
- 097-104 *| SETSTATS(rx,nn)
- SETSTATS | Stores rx to an external variable. If you need to define
- 2 bytes | your own variables, look in the code developer's guide for
- | more information.
- ------------------------------------------------------------------------------
- 105-112 *| GETSTATS(rx,nn)
- GETSTATS | Retrieves rx from an external variable. Again, if you need
- 2 bytes | to define your own variables, look in the code developer's
- | guide for more information.
- ------------------------------------------------------------------------------
- 113-120 *| MULT(rx,nn)
- MULT | Multiplies a register by a constant, then stores the least
- 2 bytes | significant byte (LSB) of the result back into the register.
- | NOTE: If it's possible, try to use the rotate/shift
- | commands if you're dividing or multiplying by
- | multiples of 2. It's much friendlier that way.
- | The most significant byte (MSB) is stored in "sta.overflow"
- | be accessed by the getstats command. Flags are affected as
- | follows: Carry is set if the MSB is not zero. Zero is set if
- | the result in the LSB was zero (even if the whole isn't)
- ------------------------------------------------------------------------------
- 121-128 | DIVIDE(rx,nn)
- DIVIDE | Dividend (rx) / Divisor (nn) -> Quotient to (rx)
- 2 bytes | This is a slow operation. See if you can't use right shifts
- | instead.
- BROKEN. | The remainder is stored in "sta.overflow", which is accessed
- FIX LATER. | via getstats command. Flags are affected as follows:
- | Carry is set if there is a remainder. Zero is set if the
- | quotient is zero (does not check remainder).
- |
- ------------------------------------------------------------------------------
- 129-136 *| INC(rx)
- INC | Increments rx by one. Same as ADD(rx,1) but much faster and
- 1 byte | uses less memory. Affects only the zero flag, to remain
- | consistent with how the Z80 does things.
- ------------------------------------------------------------------------------
- 137-144 *| DEC(rx)
- DEC | Decrements rx by one. Same as ADD(rx,-1) but much faster and
- 1 byte | uses less memory. Affects only the zero flag, to remain
- | consistent with how the Z80 does things.
- ------------------------------------------------------------------------------
- 145-152 *| DJNZ(rx,label)
- DJNZ | Automatically decrements the given register and takes the
- 2 bytes | specified relative jump while the register does not become
- | zero that cycle. Just like Z80's djnz instruction, except
- | you can use any register.
- ------------------------------------------------------------------------------
- ------------------------------------------------------------------------------
- 153 *| MOVE(rxa,rxb)
- MOVE | Copies the contents of register B over to register A.
- 2 bytes | Register A is overwritten with B and B stays the same.
- ------------------------------------------------------------------------------
- 154 *| SWAP(rxa,rxb)
- SWAP | The values in register A and register B are swapped.
- 2 bytes | Nothing is destroyed in this operation.
- ------------------------------------------------------------------------------
- 155 *| ADDRX(rxa,rxb)
- ADDRX | Adds register A and register B, then stores the result
- 2 bytes | back into register A. Affects both the zero and carry flags.
- ------------------------------------------------------------------------------
- 156 *| SUBRX(rxa,rxb)
- SUBRX | Subtracts register B from register A in the form of
- 2 bytes | rxa-rxb, then stores the result back into register A.
- | Affects both the zero and the carry flags.
- |
- ------------------------------------------------------------------------------
- 157 *| ROTR(rx,b) / ROTL(rx,b)
- ROTR/ROTL | Rotates a given register a number of bits right or left
- 2 bytes | (respectively). All bits that leave one side of the register
- | Immediately appears on the other side of the register.
- | Flags are NOT affected.
- | INTERNAL NOTE: Distinguishing between ROTR and ROTL is done
- | with bit 7 of the data byte. (1=ROTL)
- ------------------------------------------------------------------------------
- 158 *| SHIFTR(rx,b) / SHIFTL(rx,b)
- SHIFTR/SHIFTL | Shifts a given register a number of bits right or left
- 2 bytes | (respectively. All bits that leave are gone forever. Bits
- | shifted in will always be zero.
- | Flags are NOT affected.
- | INTERNAL NOTE: Distinguishing between ROTR and ROTL is done
- | with bit 7 of the data byte. (1=SHIFTL)
- ------------------------------------------------------------------------------
- 159 *| MULTRX(rxa,rxb)
- MULTRX | Multiplies register A with register B, then stores the
- 2 bytes | LSB of the result back to register A. Both registers are
- | assumed to be unsigned.
- ------------------------------------------------------------------------------
- 160 | DIVIDERX(rxa,rxb)
- DIVIDERX | Divides register A with register B in the form of rxa/rxb,
- 2 bytes | then stores the quotient to register A. Both registers are
- (AVOID. BROKEN.)| assumed to be unsigned.
- ------------------------------------------------------------------------------
- 161 *| ANDRX(rxa,rxb)
- ANDRX | Performs the bitwise AND function between register A and
- 2 bytes | register B, then stores the result to register A. Affects
- | the zero flag.
- ------------------------------------------------------------------------------
- 162 *| ORRX(rxa,rxb)
- ORRX | Performs the bitwise OR function between register A and
- 2 bytes | register B, then stores the result to register A. Affects
- | the zero flag.
- ------------------------------------------------------------------------------
- 163 *| XORX(rxa,rxb)
- XORRX | Performs the bitwise XOR function between register A and
- 2 bytes | register B, then stores the result to register A. Affects
- | the zero flag.
- ------------------------------------------------------------------------------
- 164 | CMPRX(rxa,rxb)
- CMPRX | Performs virtual subtraction between register A and register
- 2 bytes | B. Does NOT store the result anywhere, but the carry and
- | zero flags are affected as though subtraction took place.
- | Useful for testing conditions.
- ------------------------------------------------------------------------------
- 165 | TEXTRX(rxa,rxb)
- TESTRX | Performs a virtual AND function between register A and
- 2 bytes | register B. Does NOT store the result anywhere, but the
- | zero flag is affected as though an AND function was done.
- | Useful for testing bits to see if they're set.
- ------------------------------------------------------------------------------
- 166 | JUMPNC(label) [+ or - 127 bytes in either direction]
- JUMPNC | Sets the script's execution pointer to wherever you defined
- 2 bytes | the label only if the result of flag altering command prior
- | to this instruction stayed between 0 and 255 (carry flag
- | reset)
- ------------------------------------------------------------------------------
- 167 | JUMPC(label) [+ or - 127 bytes in either direction]
- JUMPC | Sets the script's execution pointer to wherever you defined
- 2 bytes | the label only if the result of flag altering command prior
- | to this instruction crossed zero. (Carry flag set)
- ------------------------------------------------------------------------------
- 168 *| JUMPNZ(label) [+ or - 127 bytes in either direction]
- JUMPNZ | Sets the script's execution pointer to wherever you defined
- 2 bytes | the label only if the result of flag altering command prior
- | to this instruction was NOT zero. (Zero flag reset)
- ------------------------------------------------------------------------------
- 169 | JUMPZ(label) [+ or - 127 bytes in either direction]
- JUMPZ | Sets the script's execution pointer to wherever you defined
- 2 bytes | the label only if the result of flag altering command prior
- | to this instruction was zero. (Zero flag set)
- ------------------------------------------------------------------------------
- 170 *| JUMP(label) [+ or - 127 bytes in either direction]
- JUMP | Unconditionally sets the script's execution pointer to
- 2 bytes | wherever the label is defined. Just like Z80's JR.
- ------------------------------------------------------------------------------
- 171 *| NEWPOSRT(rx_angle,rx_radius)
- NEWPOSRT | Changes the firing position from the center of the enemy to
- 3 bytes | radius away from that center at some angle, both of which
- | are stored in registers. ANGLE is between 0 and 255, and
- | RADIUS can be anything, just note that 90 is the length of
- | the longest possible line on the screen. Keep that in mind
- | so you don't clip.
- | NOTE: Position is reset to center after a pause, or another
- | use of the NEWPOSRT command.
- ------------------------------------------------------------------------------
- 172 *| NEWPOSXY(rx_x,rx_y)
- NEWPOSXY | Changes the firing position from the center of the enemy to
- 3 bytes | some offset X,Y away from the enemy. You MUST understand
- | that Y is reversed (positive values move down, negative
- | moves upward). To obtain negative values of a certain number
- | you should CPL/INC it. Or store a negative number to the
- | register to begin with. The screen is 64 by 64 pixels.
- | NOTE: Position is reset to center after a pause, or another
- | use of the NEWPOSRT command.
- ------------------------------------------------------------------------------
- 173 | USESPRITE(rx_resourceID,rx_locationID)
- SETSPRITE | Sets a sprite found in resourceID to an active enemy sprite
- 3 bytes | found in locationID. resourceID refers to a place on the
- | current script's resource table, which should be set at
- | "codegen"-time. locationID refers to a number 0-3, which
- | refers to which sprite slot to use (there are four).
- ------------------------------------------------------------------------------
- 174 | JUMPTABLE(rx_offset,s_table_length) \ JUMPDATA(LabelX)...
- JUMPTABLE | Allows you branch to different routines depending on what
- 2+n bytes | is in a register. You MUST put the table immediately after
- | this instruction. Example:
- |
- | LOAD(r1,0) ;sets r1 to zero
- | JUMPTABLE(r1,4) ;r1 is the offset, 4 is the number of labels
- | JUMPDATA(Label_0) ;<--0th one. Will be taken.
- | JUMPDATA(Label_1) ;If r1=1, then this is taken.
- | JUMPDATA(Label_2) ;If r1=2...
- | JUMPDATA(Label_3) ;If r1=3...
- |
- | Note: If r1 is a value outside the bounds, the table is
- | skipped over and code beneath is will run.
- | Note: The labels are relative addresses, + or - 127 bytes
- | in either direction. This makes it prohibitive to use
- | very large tables. If you need to make tables that
- | large, use jump nodes as intermediaries.
- | IMPORTANT NOTE: THE TABLE CANNOT BE LARGER THAN 16 LABELS!
- | If you try to make it larger anyway, garden
- | gnomes will (likely) invade your home.
- | A typical use for this routine is retrieving the built-in
- | difficulty level, and then branching to different attacks
- | based on the difficulty, so one script does many things.
- | See how *you* can abuse this sucker. I won't be stopping you
- ------------------------------------------------------------------------------
- 175 *| CALL(ww_relativelabel)
- CALL | Lets you run a subroutine so you can save precious space by
- 3 bytes | not having to replicate redudnant code. The spacing for this
- | label is double-wide, so it can reach anywhere you need it
- | to. DO NOT TRY TO CALL ANYTHING WHILE IN A SUBROUTINE.
- | Endless loops and never getting back to the main code will
- | result. It's safe this time around to do a PAUSE or a WAIT
- | while you're in a subroutine, however. It's safe this time
- | around to do a PAUSE/WAIT combination while in a subroutine.
- | Note: If you are foolish enough to try to use CALL while in
- | a subroutine, the instruction will be ignored
- ------------------------------------------------------------------------------
- 176 *| RETURN
- RETURN | Exits a subroutine. Don't try to use this if you're not in
- 1 byte | a subroutine. Main script code all have exit points, and
- | using this command is NOT one of them. You might end up
- | crashing your calc or something.
- | Note: If you try to use RETURN if you aren't in a subroutine
- | then this command will be ignored.
- ------------------------------------------------------------------------------
- 177 | XYTORT(rxa_x,rxb_y,rxc_r,rxd_t)
- XYTORT | Takes of the x,y coordinates found in registers A and B
- 3 bytes | (respectively), then uses the position given by the center
- | of the enemy in use (or whereever newposxy/newposrt has
- | changed it to) to output a distance and an angle in
- | registers C and D, respectively.
- ------------------------------------------------------------------------------
- 178 | RTTOXY(rxa_r,rxb_t,rxc_x,rxd_y)
- RTTOXY | Similar to above, except it takes a distance and an angle,
- 3 bytes | then converts it to its corresponding x,y coordinates,
- | outputting to registers C and D, respectively.
- | The starting position is the center of the enemy in use or
- | wherever you changed it to via newposxy/newposrt.
- |
- ------------------------------------------------------------------------------
- 179 | GETPLAYERXY(rxa_x,rxb_y)
- GETPLAYERXY | Outputs the player's X,Y coordinates to registers A and B,
- 2 bytes | respectively. If you only need an angle, you should be using
- | the TRACK command instead. Much faster that way.
- ------------------------------------------------------------------------------
- 180 *| PAUSE() [NO ARGUMENTS]
- PAUSE | Same as WAIT except it is set for exactly one game cycle.
- | Does not destroy or alter any registers.
- ------------------------------------------------------------------------------
- |
- |
- |
- ------------------------------------------------------------------------------
- - BOSS-SPECIFIC COMMANDS -----------------------------------------------------
- ------------------------------------------------------------------------------
- 000 | INITBOSS(nn_HP,nn_TIME,nn_Shld,nn_Shll,ww_JID)
- INITBOSS | Used in two ways:
- | (1) Initialize the boss for starting it up
- | (2) Reset statistics after the boss dies. Gotta use it then.
- | Explanation of constants:
- | nn_HP: 32*nn=HP. If nn_HP=4, boss will have 4*32= 52 HP
- | nn_HP may be up to 255 (HP=8160)
- | nn_TIME: Length of action/spellcard in seconds. The boss
- | dies after this expires, either removing the boss
- | or continuing on to the next attack.
- | nn_Shld: Set shield value. Will reduce the damage a bullet
- | inflicts by this value. Starter bullets do 1 damage
- | Set to 255 to make boss immune to bullets.
- | nn_Shll: Set shell value. Will reduce damage from bombs by
- | this value. Set to 255 to make boss immune to bombs
- | NOTE: Setting both shield and shell values to 255 will
- | enable transparency mode, which turns that boss's
- | cycle into a "survival" spell, which the only way
- | to win is to timeout the boss (let TIME run to 0)
- | ww_JID: Jump If Dead. Use a LABEL here so the script knows
- | where to jump the instant the boss dies, be it to
- | the boss's next life, or to the boss termination
- | sequence.
- ------------------------------------------------------------------------------
- 000 | LOADPAT(nn_patternID)
- LOADPAT | Loads a bullet script (pattern) given its resource ID. You
- | *have* been checking on how to set up resources for a given
- | script, haven't you?
- ------------------------------------------------------------------------------
- 000 | FIREPAT(s_patternNum,rxa,[rxb],[rxc])
- FIREPAT | Uses a specified pattern from the loaded pattern table to
- | shoot a bullet given a variety of inputs. The number of
- | inputs will vary depending on the bullet pattern that is
- | used. If it doesn't need that many inputs, just set the
- | unused registers to zero. Or something, just so SPASM
- | won't complain.
- ------------------------------------------------------------------------------
- 000 | SPELLINTRO(nn_SpellTitleID,nn_BonusMultiple,
- SPELLINTRO | nn_NewBackgroundID)
- | Starts up a spellcard's fancy background and pictures and
- | whatnot. Also starts the spellcard bonus. The bonus drain
- | will reflect whatever mode the boss is in (no drain for
- | survival cards). Boss portraits are implied in the general
- | game resource area.
- | nn_SpellTitleID : Resource ID for spellcard title
- | nn_BonusMultiple : nn * 1,000,000 is the bonus multiple.
- | nn_NewBackgroundID: Resource for new spellcard background
- |
- | It's just fancy and flashy stuff going on.
- ------------------------------------------------------------------------------
- 000 | PROCD(nn_EffectCode)
- PROCD | Don't bother with this one right now. It's designed to make
- | the boss go 'splodey when it dies. You run this little
- | sucker and off it goes!
- | Always use the example code given for each instance. Don't
- | try using this command on your own unless you can read
- | source, since I guarantee you. You will likely destabilize
- | (hehe. de stab il ize. lol.) THE GAME.
- |
- | And like the boss, you just lost.
- ------------------------------------------------------------------------------
- 000 | MAKEOPTION(rxa_x,rxy_y,nn_hp,nn_expires,nn_scriptID)
- MAKEOPTION | Allows the boss to create enemies. The X,Y coordinates used
- | differ from the coordinates used by the bullet system in
- | that the top-left of the screen is 64,64, and the bottom-
- | right of the screen is 128,128. This is to allow off-screen
- | generation of enemies so they can fly on/offscreen.
- |
- | nn_hp: Some value between 0 and 255. If set to zero, then
- | the enemy is invincible. It dies only when its time
- | runs out. Speaking of time...
- | nn_expires: Number of game cycles the enemy has to live.
- | There's about 24 game cycles in a second, so an
- | enemy will live for a bit longer than 10 seconds
- | If they need to last longer than that, then you
- | should be making better bosses. Or get creative.
- | nn_scriptID: The ID for the script that the newly-created
- | enemy should be using. These IDs are defined
- | with the stage, and you shouldn't be worrying
- | about what resources these scripts are taking.
- | Unless you are tight on resources and you have
- | a level pack larger than CaDan itself.
- ------------------------------------------------------------------------------
- - STAGE SCRIPTING ------------------------------------------------------------
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 000 |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- 252 | INITENEMY(nn_rxbase)
- INITENEMY | Complicated. You'd better be paying CLOSE attention now, as
- 2 bytes | this command is among the most important in CaDan.
- | nn_rxbase should be a number between 0 and 8, indicating
- | which register to start reading input arguments from. The
- | input arguments are as follows:
- |
- | rx+0: Enemy script resourceID - Dictates which CaDan script
- | to use for a given enemy. Affects enemy actions.
- | rx+1: Enemy path resourceID - Dictates which MovePath script
- | to use for a given enemy. Affects enemy movements.
- | rx+2: Enemy Y position. Coordinates may start offscreen and
- | be a negative number.
- | rx+3: Enemy X position. Coordinates may start offscreen and
- | be a negative number.
- | rx+4: Enemy HP. Set to zero for an invincible enemy.
- | rx+5: Enemy TTL (Time To Live). Set to 255 (max) for about
- | 10 seconds of enemy life. Internal enemy scripts may
- | modify this value, though.
- |
- | Enemies are given the following values automatically:
- | SpriteID=1, zeroed out condition/return/registers.
- |
- | If there are no more slots left to create an enemy with,
- | this command silently fails. Up to 10 enemies simultaneously
- | existing is planned. Make good use of that and ensure that
- | TTL is set high enough to give good challenge but low enough
- | to not clog up the enemy tables.
- ------------------------------------------------------------------------------
- 253 | FILLBANK(nn0,nn1,nn2,nn3,nn4,nn5,nn6,nn7)
- FILLBANK | Fills r0 through r7 with one byte immediates as defined
- 9 bytes | above. This command may be safely called by enemiy scripts
- | as well as boss and stage scripts, but its use was found to
- | be much better as a stage type command for mass
- | register initializations.
- ------------------------------------------------------------------------------
- 254 | SWAPBANK
- SWAPBANK | Swaps the r0-r7 bank with the r8-r15 bank. Allows for
- 1 byte | extended register use beyond the original 8 registers. Only
- | the stage and boss scripts may be able to use this command.
- | You can try it for normal enemies but you'll more than
- | likely get horrible results. Unless you're hackish.
- ------------------------------------------------------------------------------
- 255 | RUNASM(EndLabel)
- RUNASM | Executes a stretch of Z80 ASM code between the command and
- 1+n bytes | wherever the "EndLabel" happens to be. Special care needs to
- | be taken from within the Z80 assembly routine that you are
- | writing.
- | While HL,BC,DE,and AF may be destroyed, you CANNOT mess with
- | IX, nor the RAM area (itemp1) since DE is kept safe in that
- | location. The stack is fully available so you can do your
- | normal push and pops, but you've got to exit the routine at
- | the same stack level as you entered.
- |
- | To exit the Z80 ASM routine, you must jump to the following
- | label: r.runasm.ret
- |
- | The size of the ASM stub must be no larger than 255 bytes.
- | The total size of this command is 1 plus the ASM stub size.
- ------------------------------------------------------------------------------
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- ------------------------------------------------------------------------------
- In the deepest, darkest portions of the house, where mold grows and the
- programmers, likewise, there sits one curious nearly balded, pasty-faced
- person. Not quite a man, not quite a child, but full of the sort of energy
- that you'd only find when chatting it up on IRC or some odd obscure chat
- medium like that. A total IRC junkie and a programmer all rolled into one. a
- disasterous combination, if you were to ask anyone. Just give the wretch some
- Mountain Dew (since we all know they love the stuff), and watch the fingers
- rap away on the keyboard, working on the next big thing. The next graping
- calculator game. Except today is different for this person, for today,
- something gets added into his beautiful, yet incomplete game.
- "Compile... compile dammit! Compile!" the programmer screams at the monitor.
- The black box of a command prompt flicker in and out of the desktop as he
- repeatedly hits the batch script's icon, hoping for a good, error-free
- compile. No word yet on whether or not there's a success, but that red text
- on the screen screaming "ERROR" ought to be a heads-up on how "well" things
- are going.
- A few more edits into the vast number of lines in the file, a few more sips
- of that cool elixier known as Mtn Dew. A few more curse words screeched at the
- computer shortly before something appears to go right. And out on the screen
- flows the beautiful words and numbers of a successful compile job. The sort
- that tells its own little tale of all the bits and bytes that pass through its
- scrupulous, ever-gazing eyes. The statistics of the compile job, the little
- echoes that remind the programmer of those little quirks in the source, all
- of which are found on that black screen, just shortly before it disappears
- into nothingness, leaving only a newly-minted file containing the fruits of
- all the hard work over the past years.
- "YES! And now... to test this program out..."
- Meanwhile, on another timeline, on another galaxy, far far away from the alien
- homeworld this coder belonged to, here on Earth at around god-knows-what-year,
- the Vikings Berk celebrated in full Hiccup and Toothless' victory over the
- Red Death. There won't be any real description, since we've all seen the movie
- but as Toothless flew straight up with Hiccup with his friends, something odd,
- something completely out of the blue happened.
- Everywhere around the teens and their dragons, small fairy-like creatures
- popped out of nowhere. Everyone stopped what they were doing and hovered in
- mid-air, completely stunned from the sudden appearance of these... things.
- Time seemed to stand still as they hovered right above Berk, trying to
- identify these foriegn things. And then, one by one, they started shooting
- slow-moving glowing orbs at the dragons in an eerily syncrhonized patter,
- filling the area around them in these energy-filled spheres, floating, if not
- flying straight at them!
- It just wasn't their day, was it? Snotlout and Fishlegs got shot right out of
- the sky the second the gang was attacked. The twins made a move to try to
- save the two but they also got shot out. All that's left now is Hiccup riding
- his Night Fury.
- Toothless and Hiccup, working as one, weaved in and out and between the
- patterns of incoming lights, almost expertly, almost... almost like someone
- else was watching above them and controlling their exact movements. There was
- just no way in hell they could know where everything was simultaneously...
- until they too got hit from the neverending torrent of lights.
- The pair fell sharply, like a rock, to ... well. A bigger rock. The Earth. To
- their doom. "Toothless! Hang on buddy! We're gonna make it!" Hiccup tried to
- reassure his best bud, but he knows they aren't going to make it. They were
- all going to die... right about... now? Whoa! Wait a second. They're back up
- in the clouds...
- And now, back on the alien planet, the crazy-mad overlord... erh. Programmer.
- Has decided to give that game of his a nice run-through.
- "Mwahaha! I've done it! I've finally made a game that combines my favorite
- movie with my favorite type of game! I've finally made a HTTYD Danmaku!"
- Swiftly, he raps the keys on his calculator, trying to get his little avatar
- of what was supposed to be Toothless to dodge the ever-increasing patterns
- of bullets on the screen. For a moment, things were going well. Side step,
- side step, back, forward, side step, back, side... aww, crap. He saw his
- favorite character eat a bullet and die. "Nooooooooo! Toooooothleeeees!"
- The crazed coder straightens his face and puts on a mask of false seriousness.
- "Oh, well. Two lives left."
Advertisement
Add Comment
Please, Sign In to add comment