PDA

View Full Version : Zasm questions.



Revfan9
10-21-2006, 05:24 PM
1. What are the Zasm equivilants of +=,-=,*=,/=,^=,&=, etc.?

2. How do you set a warp to trigger in Zasm?

Saffith
10-21-2006, 06:06 PM
1. What are the Zasm equivilants of +=,-=,*=,/=,^=,&=, etc.?SETR
SETV
ADDR
ADDV
SUBR
SUBV
MULTR
MULTV
DIVR
DIVV
ANDR
ANDV
ORR
ORV
XORR
XORV

Each takes two arguments, of which the first must be a register or property. The second argument must be a register or property for the instructions ending in R, or a numeric literal for those ending in V. The result of each operation is stored into the first argument.
So, for example:

ADDV x, 5 ; this->X+=5
XORR d0, d1 ; d0 ^= d1
SETV d6, 3 ; d6 = 3



2. How do you set a warp to trigger in Zasm?Use the WARPR and PITWARPR instructions (WARPV and PITWARPV don't exist). They each take two arguments, which must both be registers. I'm not entirely certain, but I believe the first argument is the DMap and the second is the screen.

Revfan9
10-21-2006, 07:10 PM
Okay, so counting down to 0 from value d0, then warping to 0,0 would be:

LOOP WAITFRAME
SUBV d0,1
COMPAREV d0,0
GOTOMORE LOOP
WARPR 0,00

Correct? I'm sortof new to Zasm...

EDIT: I tried compiling the above script, but it says the first argument is incorrect for WARPR. Is it the Dmap number or the Dmap name?

Saffith
10-21-2006, 07:24 PM
Almost. Two problems.

First, COMPAREV sets the MORE flag if the first argument is equal to or greater than the second, not just greater than. That means your GOTOMORE won't execute until d0 hits -1. Use COMPAREV d0, 1 instead.

Second, you can't use literals with WARPR. You'll have to load the arguments into registers:
SETV d0, 0
SETV d1, 0
WARPR d0, d1Actually, since both arguments are 0, you should be able to use the same register for each. And d0 is already 0, so you don't even have to set it. Just change that line to WARPR d0, d0.

Revfan9
10-22-2006, 04:55 AM
thank you Saffith! Those were really the only 2 things about Zasm that I didn't really know already.

Okay... Another question. Is it possible to play a sound in Zasm?

And one last question: Is there a list somewhere of all of the Zasm commands? This would make all of this so much easier...

Snarwin
10-22-2006, 02:32 PM
Okay... Another question. Is it possible to play a sound in Zasm?Yes; in fact, it's the only way. Use PLAYSOUNDV and PLAYSOUNDR.


And one last question: Is there a list somewhere of all of the Zasm commands? This would make all of this so much easier...Couldn't find the thread, but here's what I have saved:


Commands:

SETV, //0x0000
SETR, //0x0001
ADDR, //0x0002
ADDV, //0x0003
SUBR, //0x0004
SUBV, //0x0005
MULTR, //0x0006
MULTV, //0x0007
DIVR, //0x0008
DIVV, //0x0009
WAITFRAME, //0x000A
GOTO, //0x000B
CHECKTRIG, //0x000C
WARP, //0x000D
COMPARER, //0x000E
COMPAREV, //0x000F
GOTOTRUE, //0x0010
GOTOFALSE, //0x0011
GOTOLESS, //0x0012
GOTOMORE, //0x0013
LOAD1, //0x0014
LOAD2, //0x0015
SETA1, //0x0016
SETA2, //0x0017
QUIT, //0x0018
SINR, //0x0019
SINV, //0x001A
COSR, //0x001B
COSV, //0x001C
TANR, //0x001D
TANV, //0x001E
MODR, //0x001F
MODV, //0x0020
ABSR, //0x0021
MINR, //0x0022
MINV, //0x0023
MAXR, //0x0024
MAXV, //0x0025
RNDR, //0x0026
RNDV, //0x0027
FACTORIAL, //0x0028
POWERR, //0x0029
POWERV, //0x002A
IPOWERR, //0x002B
IPOWERV, //0x002C
ANDR, //0x002D
ANDV, //0x002E
ORR, //0x002F
ORV, //0x0030
XORR, //0x0031
XORV, //0x0032
NANDR, //0x0033
NANDV, //0x0034
NORR, //0x0035
NORV, //0x0036
XNORR, //0x0037
XNORV, //0x0038
NOT, //0x0039
LSHIFTR, //0x003A
LSHIFTV, //0x003B
RSHIFTR, //0x003C
RSHIFTV, //0x003D
TRACER, //0x003E
TRACEV, //0x003F
TRACENL, //0x0040
DUMMYCOMMAND4, //0x0041
PUSHR, //0x0042
PUSHV, //0x0043
POP, //0x0044
ENQUEUER, //0x0045
ENQUEUEV, //0x0046
DEQUEUE, //0x0047
PLAYSOUNDR, //0x0048
PLAYSOUNDV, //0x0049
LOADWEAPONR, //0x004A
LOADWEAPONV, //0x004B
LOADITEMR, //0x004C
LOADITEMV, //0x004D
LOADNPCR, //0x004E
LOADNPCV, //0x004F
CREATEWEAPONR, //0x0050
CREATEWEAPONV, //0x0051
CREATEITEMR, //0x0052
CREATEITEMV, //0x0053
CREATENPCR, //0x0054
CREATENPCV, //0x0055
ignore everything after the commas

Variables...
{ "D", D(0), 8, 0 },
{ "A", A(0), 2, 0 },
{ "DATA", DATA, 0, 0 },
{ "FCSET", FCSET, 0, 0 },
{ "DELAY", DELAY, 0, 0 },
{ "FX", FX, 0, 0 },
{ "FY", FY, 0, 0 },
{ "XD", XD, 0, 0 },
{ "YD", YD, 0, 0 },
{ "XD2", XD2, 0, 0 },
{ "YD2", YD2, 0, 0 },
{ "FLAG", FLAG, 0, 0 },
{ "WIDTH", WIDTH, 0, 0 },
{ "HEIGHT", HEIGHT, 0, 0 },
{ "LINK", LINK, 0, 0 },
{ "COMBOD", COMBOD(0), 176, 3 },
{ "COMBOC", COMBOC(0), 176, 3 },
{ "COMBOF", COMBOF(0), 176, 3 },



{ "INPUTSENABLED", INPUTSENABLED, 0, 0 },
{ "FORCEDUP", FORCEDUP, 0, 0 },
{ "FORCEDDOWN", FORCEDDOWN, 0, 0 },
{ "FORCEDLEFT", FORCEDLEFT, 0, 0 },
{ "FORCEDRIGHT", FORCEDRIGHT, 0, 0 },
{ "FORCEDA", FORCEDA, 0, 0 },
{ "FORCEDB", FORCEDB, 0, 0 },
{ "FORCEDL", FORCEDL, 0, 0 },
{ "FORCEDR", FORCEDR, 0, 0 },
{ "LINKX", LINKX, 0, 0 },
{ "LINKY", LINKY, 0, 0 },
{ "LINKDIR", LINKDIR, 0, 0 },
{ "LINKHP", LINKHP, 0, 0 },
{ "LINKMP", LINKMP, 0, 0 },
{ "LINKMAXHP", LINKMAXHP, 0, 0 },
{ "LINKMAXMP", LINKMAXMP, 0, 0 },
{ "LINKACTION", LINKACTION, 0, 0 },


{ "WPNX", WPNX, 0, 0 },
{ "WPNY", WPNY, 0, 0 },
{ "WPNDIR", WPNDIR, 0, 0 },
{ "WPNSTEP", WPNSTEP, 0, 0 },
{ "WPNANGULAR", WPNANGULAR, 0, 0 },
{ "WPNANGLE", WPNANGLE, 0, 0 },
{ "WPNDRAWTYPE", WPNDRAWTYPE, 0, 0 },
{ "WPNPOWER", WPNPOWER, 0, 0 },
{ "WPNDEAD", WPNDEAD, 0, 0 },
{ "WPNID", WPNID, 0, 0 },
{ "WPNTILE", WPNTILE, 0, 0 },
{ "WPNCSET", WPNCSET, 0, 0 },
{ "WPNFLASHCSET", WPNFLASHCSET, 0, 0 },
{ "WPNFRAMES", WPNFRAMES, 0, 0 },
{ "WPNFRAME", WPNFRAME, 0, 0 },
{ "WPNASPEED", WPNASPEED, 0, 0 },
{ "WPNFLASH", WPNFLASH, 0, 0 },
{ "WPNFLIP", WPNFLIP, 0, 0 },
{ "WPNCOUNT", WPNCOUNT, 0, 0 },

{ "ITEMX", ITEMX, 0, 0 },
{ "ITEMY", ITEMY, 0, 0 },
{ "ITEMDRAWTYPE", ITEMDRAWTYPE, 0, 0 },
{ "ITEMID", ITEMID, 0, 0 },
{ "ITEMTILE", ITEMTILE, 0, 0 },
{ "ITEMCSET", ITEMCSET, 0, 0 },
{ "ITEMFLASHCSET", ITEMFLASHCSET, 0, 0 },
{ "ITEMFRAMES", ITEMFRAMES, 0, 0 },
{ "ITEMFRAME", ITEMFRAME, 0, 0 },
{ "ITEMASPEED", ITEMASPEED, 0, 0 },
{ "ITEMDELAY", ITEMDELAY, 0, 0 },
{ "ITEMFLASH", ITEMFLASH, 0, 0 },
{ "ITEMFLIP", ITEMFLIP, 0, 0 },
{ "ITEMCOUNT", ITEMCOUNT, 0, 0 },

{ "NPCX", NPCX, 0, 0 },
{ "NPCY", NPCY, 0, 0 },
{ "NPCDIR", NPCDIR, 0, 0 },
{ "NPCRATE", NPCRATE, 0, 0 },
{ "NPCFRAMERATE", NPCFRAMERATE, 0, 0 },
{ "NPCHALTRATE", NPCHALTRATE, 0, 0 },
{ "NPCDRAWTYPE", NPCDRAWTYPE, 0, 0 },
{ "NPCHP", NPCHP, 0, 0 },
{ "NPCID", NPCID, 0, 0 },
{ "NPCDP", NPCDP, 0, 0 },
{ "NPCWDP", NPCWDP, 0, 0 },
{ "NPCTILE", NPCTILE, 0, 0 },
{ "NPCENEMY", NPCENEMY, 0, 0 },
{ "NPCWEAPON", NPCWEAPON, 0, 0 },
{ "NPCITEMSET", NPCITEMSET, 0, 0 },
{ "NPCCSET", NPCCSET, 0, 0 },
{ "NPCBOSSPAL", NPCBOSSPAL, 0, 0 },
{ "NPCBGSFX", NPCBGSFX, 0, 0 },
{ "NPCCOUNT", NPCCOUNT, 0, 0 },
{ "SD", SD(0), 8, 0 },
{ "GD", GD(0), 256, 0 },
Some of these may not be implemented yet.

Revfan9
10-22-2006, 02:44 PM
Thank you. Now I just have to figure out what they all do...

DarkDragon
10-23-2006, 07:35 AM
That list, and the variable list especially, has changed A LOT. Bug jman to post the latest.