User Tag List

Results 1 to 6 of 6

Thread: Zasm: Blown Away

  1. #1
    Lynel Revfan9's Avatar
    Join Date
    Jun 2005
    Location
    In front of a screen. I never leave.
    Age
    31
    Posts
    1,160
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    3,390
    Level
    18
    vBActivity - Bars
    Lv. Percent
    71.05%

    Zasm: Blown Away

    Well, here is a script for a potential boss attack: Blown Away. If Link touches the FFC, Link will be sent at to a random spot on the edge of the room. 3 things that you need to know about this script before you use it...

    1. It assumes that the room is a rectangle where the walls are 2 tiles in on every side. I tried to allow for the user to set registers for the walls... But we don't have enough FFC registers to do so (it uses all of them in the script as is).

    2. All of the registers set themselves within the script except d7, which the user must set themselves as the "wind strength". The higher this is set, the weaker the "wind" (this is because it is much easier to set the strength from the edges of the screen rather than from the FFC's position), although anything set lower than 1 will get the player stuck in the walls around the edge of the screen, so be warned.

    3. The scripts doesn't give the FFC any movement of it's own, although it does record the FFC's position. So you can use traditional FFC speed+Changers to make it move around. Do some experimenting with this.

    Sorry if it seems unprofessional being a Zasm script, and that it was written and tested within a half-hour. I don't understand Zscript all too well yet... So I wrote it in Zasm. I'm also pretty sure that this is the largest Zasm script ever written... (released, anyway).

    Have fun. ;P

    Code:
     SETR d0,x
     SETR d1,y
     SETR d2,linkx
     SETR d3,linky
    WAIT WAITFRAME
    POS1 COMPARER d0,d2
     GOTOTRUE POS2
     GOTOFALSE POS3
    POS2 COMPARER d1,d3
     GOTOTRUE POS4
     GOTOFALSE POS3
    POS3 SETR d0,x
     SETR d1,y
     SETR d2,linkx
     SETR d3,linky
     GOTO WAIT
    POS4 RNDV d4,1 
     MULTV d4,10
     COMPAREV d4,5
     GOTOLESS POS5
     GOTOMORE POS6
    POS5 SETV d4,1
     GOTO POS7
    POS6 SETV d4,0
     GOTO POS7
    POS7 RNDR d5,d7
     MULTV d5,32
     ADDV d5,48
     COMPAREV d4,1
     GOTOTRUE POS8
     GOTOFALSE POS9
    POS8 SETR linkx,d5
     GOTO POS10
    POS9 SETV d0,256
     SUBR d0,d5
     SETR linkx,d0
     GOTO POS10
    POS10 RNDV d4,1 
     MULTV d4,10
     COMPAREV d4,5
     GOTOLESS POS11
     GOTOMORE POS12
    POS11 SETV d4,1
     GOTO POS13
    POS12 SETV d4,0
     GOTO POS13
    POS13 RNDR d5,d7
     MULTV d5,32
     ADDV d5,48
     COMPAREV d4,1
     GOTOTRUE POS14
     GOTOFALSE POS15
    POS14 SETR linky,d5
     GOTO POS16
    POS15 SETV d0,174
     SUBR d0,d5
     SETR linky,d0
     GOTO POS16
    POS16 GOTO POS3
     QUIT

  2. #2
    Developer
    ZC Developer
    jman2050's Avatar
    Join Date
    Jun 2001
    Location
    Do you really need to know
    Age
    37
    Posts
    3,883
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    5,709
    Level
    23
    vBActivity - Bars
    Lv. Percent
    46.18%

    Re: Zasm: Blown Away

    You know, you can use the stack even in ZAsm to store variables beyond the 8 registers provided. use POPR and PUSHR.

    Also, don't worry about it being in ZAsm. It's usually more efficient than DD's ZScript implementation anyway
    AGN's Resident Zelda Classic Developer and Sonic the Hedgehog Fanboy

  3. #3
    Wizrobe C-Dawg's Avatar
    Join Date
    Jan 2002
    Posts
    4,205
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    6,611
    Level
    24
    vBActivity - Bars
    Lv. Percent
    99.9%

    Re: Zasm: Blown Away

    Harder to read, though.

  4. #4
    Lynel Revfan9's Avatar
    Join Date
    Jun 2005
    Location
    In front of a screen. I never leave.
    Age
    31
    Posts
    1,160
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    3,390
    Level
    18
    vBActivity - Bars
    Lv. Percent
    71.05%

    Re: Zasm: Blown Away

    Quote Originally Posted by Jman
    You know, you can use the stack even in ZAsm to store variables beyond the 8 registers provided. use POPR and PUSHR.
    Really? Could I get some more explanation on how these functions work exactly? Does PUSHR d0 push d0 "aside" in the stack, and POPR d0 returns it to it's previous value in the stack? Or does it work in some other way?

    Quote Originally Posted by C-Dawg
    Harder to read,though.
    Perhaps it's just me and my weird thought patterns, but I've always found Assembly easier to read than High-Level languages such as C/++.

  5. #5
    Wizrobe C-Dawg's Avatar
    Join Date
    Jan 2002
    Posts
    4,205
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    6,611
    Level
    24
    vBActivity - Bars
    Lv. Percent
    99.9%

    Re: Zasm: Blown Away

    I understand the basics of how ASM works (command, parameter, parameter; working with registers more or less directly) but I find it hard to follow because it's doing such simple little things each step. I think the BIG thing is that object-oriented programming languages are just naturally WAY easier to follow than procedural languages.

    So this code pushes Link towards the edges, or just "warps" him there?

  6. #6
    Lynel Revfan9's Avatar
    Join Date
    Jun 2005
    Location
    In front of a screen. I never leave.
    Age
    31
    Posts
    1,160
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    3,390
    Level
    18
    vBActivity - Bars
    Lv. Percent
    71.05%

    Re: Zasm: Blown Away

    It just warps him there. Unfortunately, I don't understand enough about Zasm to push Link to the edge of the wall...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social