Exploding routine

edited January 2014 in Development
I've been mucking about with 'Explode' from YS Program Pitstop, but I can not get it to work independently of the basic program.

LET L=USR 61456 doesn't seem to work unless its from the basic program

I am basically wanting a 16 x 16 pixel object to explode full screen, but it just wont have it!

http://www.worldofspectrum.org/showmag.cgi?mag=YourSinclair/Issue39/Pages/YourSinclair3900074.jpg
Post edited by daveysludge on

Comments

  • edited January 2014
    Have you read the part of the instructions where it says it cannot explode full screen?
    It's outer edges must not touch the edge of the screen in any direction...
  • edited January 2014
    It explodes from the centre outwards; if there are no pixels set in the centre of the explodey area then it thinks it's finished and won't do anything. Try exploding something in the demo, break out, print 'Xs' all over the screen, and then USR 61456 - but if USR 61456 is run twice in succession it won't do anything the second time as the explodey area has been exploded.
  • edited January 2014
    It explodes from the centre outwards; if there are no pixels set in the centre of the explodey area then it thinks it's finished and won't do anything. Try exploding something in the demo, break out, print 'Xs' all over the screen, and then USR 61456.

    Ah gotcha!

    Cheers BB!
  • edited January 2014
    I am basically wanting a 16 x 16 pixel object to explode full screen

    Are we going to see some 'exploding turds' in the near future then..? ;)
  • edited January 2014
    Morkin wrote: »
    Are we going to see some 'exploding turds' in the near future then..? ;)

    LOL! Yeah something along those lines!
  • edited January 2014
    Thats such a nice exploding routine, Iv often admired it... I never did get around to reverse engineering it to make it fully portable and pasmo compilable... I vaguely remember asking for guidance on that awhile back... It would be nice to have a routine like this that could be used anywhere...

    Does anyone know of any other routines knocking around these forums that do anything similar (pixelated explosions)...???

    :-)
  • LCDLCD
    edited January 2014
    kgmcneil wrote: »
    Thats such a nice exploding routine, Iv often admired it... I never did get around to reverse engineering it to make it fully portable and pasmo compilable... I vaguely remember asking for guidance on that awhile back... It would be nice to have a routine like this that could be used anywhere...

    Does anyone know of any other routines knocking around these forums that do anything similar (pixelated explosions)...???

    :-)
    I admired the explosion effect in "Hyperactive". I think, this is the most sexy explosion effect I ever saw on the Spectrum.
  • edited January 2014
    There's an explode routine in Stainless Steel (Mikro-Gen).
  • edited January 2014
    It seems this routine wont work in 128 mode, is there any way of re-working it so its compatible in 128 mode?
  • edited January 2014
    To which routine are you referring? The demo of the one from YS works OK on the +128k & +3.
  • edited January 2014
    This reminds me of a exploding routine I wrote two years ago. I thought I had showed it here, but now I see the demo I made for that, it seems that it was only featured at spanish forums.

    Anyway, this is it, in case anyone needs such routine:
    http://www.atc.us.es/~rodriguj/exploding_effect_zxspectrum.zip

    Source code and a demo in BASIC featuring some nice explossions. The exploding effect can be constrained to a rectangular area, so multiple explossions are possible. See demo for details.

    The interface to the routine is defined at line 10. It's function FN e(), which is defined as:
    10 DEF FN e(a,b,c,d,e,f,g,h,i,j,k)=USR 60000
    
    Where:
    a,b: x and y coordinates of the top left corner of the pixel block we want to explode.
    c,d: width and height (minus 1) of the above block.
    e,f: x and y coordinates of the center of the explossion (which should be inside the above mentioned pixel block)
    g,h,i,j: define a rectangle with top left corner at (g,h) and bottom right corner at (i,j). The explossion will be constrained to this area
    k: delay factor. Greater values produces slower explossions. Keep low for explossions with many pixels.

    Coordinates are reffered to the top left corner, which is position (0,0). Range is to 255 and 191

    Be careful. c and d must be so that: (c+1)*(d+1)<=1024

    For example: to explode a capital "A", printed at the center of the screen, you can do this:
    10 DEF FN e(a,b,c,d,e,f,g,h,i,j,k)=USR 60000
    20 PRINT AT 11,4;"A"
    30 PAUSE 0
    40 RANDOMIZE FN e(112,88,7,7,116,92,50,50,150,150,3)
    
  • edited January 2014
    To which routine are you referring? The demo of the one from YS works OK on the +128k & +3.

    On ZX Spin the demo works until the routine is called, then it just resets...
  • edited January 2014
    I've just tried it with ZXSpin v0.666 in +2A mode and all three explodey options work (the 4th being just a non-exploding advert). I'm using my original file rather than the one from WoS, but they should be the same as the one on WoS is a copy of my original file. The CODE block is 920 bytes and sums to 76085.
  • edited January 2014
    I've just tried it with ZXSpin v0.666 in +2A mode and all three explodey options work (the 4th being just a non-exploding advert). I'm using my original file rather than the one from WoS, but they should be the same as the one on WoS is a copy of my original file. The CODE block is 920 bytes and sums to 76085.

    Yeah, I have the demo working on 128 now, seems I omitted RUNning the TAP from start when loaded as it LOADs the code into memory.
  • edited January 2014
    I've just tried it with ZXSpin v0.666 in +2A mode and all three explodey options work (the 4th being just a non-exploding advert). I'm using my original file rather than the one from WoS, but they should be the same as the one on WoS is a copy of my original file. The CODE block is 920 bytes and sums to 76085.

    I'm a bit puzzled by this routine, it says its 920 bytes long. Starts at 61440 yet it seemingly ends at 61780 (340 bytes), then something incoherrent starts again at 61953 and goes on to 63163 (1210 bytes!!!)...

    In total 1723 bytes used on something!

    Is there a way of re-locating the incoherent stuff (61953 on) as I cant find anything in the routine that points to that...
  • edited January 2014
    The last subroutine ends at 61779. The remainder would appear to be data or workspace. The IX register references addresses beyond the end of the CODE block at 62360, so at least some of the intervening space/data is used for one reason or another, although I haven't followed the program through in detail to see exactly what it's doing up there. When doing the bomb, for example, IX goes up as far as 63148; for the planet, it finishes at 64028.
  • edited January 2014
    The last subroutine ends at 61779. The remainder would appear to be data or workspace. The IX register references addresses beyond the end of the CODE block at 62360, so at least some of the intervening space/data is used for one reason or another, although I haven't followed the program through in detail to see exactly what it's doing up there. When doing the bomb, for example, IX goes up as far as 63148; for the planet, it finishes at 64028.

    So its the IX register that controls that stuff?

    I'm not well acquainted with the IX stuff... :???:
  • edited January 2014
    Big thanks there McLeod!!!! Thats a GREAT routine!!!.. Im at work now but couldn't resist trying it here... I look forward to examining the source and playing with it in pasmo when I get off shift - thats exactly the kind of pixalated explosion routine that I was on about, and its seems a lot smaller than the YS one too!!!... Impressive!!!! :-) Ill add that to my software library!!! - Just gotta add some sound effects!!!! :grin:
  • edited January 2014
    kgmcneil wrote: »
    Big thanks there McLeod!!!! Thats a GREAT routine!!!.. Im at work now but couldn't resist trying it here... I look forward to examining the source and playing with it in pasmo when I get off shift - thats exactly the kind of pixalated explosion routine that I was on about, and its seems a lot smaller than the YS one too!!!... Impressive!!!! :-) Ill add that to my software library!!! - Just gotta add some sound effects!!!! :grin:

    Yeah, the lack of sound is its only problem, I'd be interested in a version with sound if possible...
Sign In or Register to comment.