The zxodus engine

edited September 2011 in Sinclair Basic
I've been playing around with this for a couple of days now. Its one of the best things I've seen for sinclair basic, and I've seen nothing about it in the forums.
It is a tile mapper running in interrupts, that allows control from basic, and also gives the user a 6x8 'AT pixel' print driver. What makes this something I feel worth evangelising in the forums about, is the fact that the tile display is in 8x1 attribute 'rainbow' mode. Just seeing it displaying the tiles, while carrying on with basic editing, is one of the most impressive things I've seen over 30 years with spectrums.
The engine is obviously not restricted to use with basic, and I think a few basic and asm speccy guys might be really interested to try this out. One thing to note, is that the engine doesn't leave all that much space for coding. But its enough to make something simple with it, and with the addition of Spectranet or something like a Divide for data storage - its not hard to imagine creating an epic dungeon crawler in glorious ( for 1982 ) 8x1 attribute colour. :smile:
It can be found here:
http://www.worldofspectrum.org/infoseekid.cgi?id=0026639
Along with a text file which explains it all a lot better than I can. Great documentation as we have come to expect from Chev.
I'm definitely going to be writing a couple of things using this, and hopefully I'll be able to report back here in the not-too-distant future with something to show for myself.
Post edited by p13z on

Comments

  • edited September 2011
    Like your post. Been looking at this myself recently but I have yet to run it on a real spectrum. Hope to do that very soon.
  • edited September 2011
    ...and it'll look even nicer with ULAplus or ZxPrism paletted colour :)
  • edited September 2011
    I was surprised to see this run flawlessly on my +3. And can confirm that it also plays happily with my spectranet :)
  • edited September 2011
    I'm currently writing something using ZXodus... Not sure what it is yet, but I'm sure I'll find out soon, :D
    So far, so meh :)
  • edited September 2011
    p13z wrote: »
    I was surprised to see this run flawlessly on my +3. And can confirm that it also plays happily with my spectranet :)

    I'm not convinced it does run flawlessly on the +3. At least it doesn't in an emulator, the 18th column is out of sync
  • edited September 2011
    guesser wrote: »
    I'm not convinced it does run flawlessly on the +3. At least it doesn't in an emulator.

    Is that an emulator you made?? If so, then that explains it, :p
    So far, so meh :)
  • edited September 2011
    Hmmm this is a really interesting thing to try to make work with Boriel's ZX Basic compiler.
  • edited September 2011
    I downloaded that TAP and ran it. The border went a bit crazy and then nothing happened. Is it supposed to be a demo?
    Joefish
    - IONIAN-GAMES.com -
  • edited September 2011
    It worked for me. You have to load the BASIC and then rewind the tape and load the CODE. It shows the tilemap with the already included tileset.

    file.php?id=1913

    By the way, I was wondering if this could be easily modified so it left room for less different tiles, making it more compact. Currently, 256 tiles would take 16Kb. I think I could do with just 64 tiles (including character and enemies), for example, which would give me extra 12Kb RAM.
  • edited September 2011
    Well, just for the record, it's incredibly easy to modify the source, so I've created a binary which is set to have room only for 64 different tiles. That makes the binary 12Kb shorter (loaded at 52036), which leaves a good 27Kb + free for your game.

    I've also created a program which would make a png file into a bin file with the tile data ready to be imported. If anybody is interested, just give me a shout. You create your graphics in your favourite painting program using RGB components of 200 for BRIGHT 0 or 255 for BRIGHT 1 (for example, bright yellow would be RGB = 255, 255, 0), save it as a png, and then use my proggie to generate a valid bin file.

    By the way, I've found some timing issues when used from pure BASIC. As not the whole screen is updated at once, I've found that animation can be a bit tricky.
  • edited September 2011
    I've just had a very short look at it, and I'm wondering if I should use this engine instead for my dungeon crawler.

    Looks promising, although I wonder how much the memory consumption and timing problems are.
  • edited September 2011
    Hey!.. If you've got conversion tools that make using this engine easier, then yes, we're interested!!!.. :-)
  • edited September 2011
    Everytime I'm running this program in Spin I have to fix line 80 in BASIC afterwards.

    Am I doing something wrong?
  • edited September 2011
    I don't know, what does line 80? It has worked for me, at least the modified, smaller version.

    Well, here are some things to download.

    First of all, the modified version to use just 64 characters and so free up 12Kb of RAM.

    - Load this version at 52036
    - Once loaded, RANDOMIZE USR 52363
    - To enable it, RANDOMIZE USR 52036
    - To disable it, RANDOMIZE USR 52039
    - Tilemap is at 52363 (81 bytes)
    - Tileset is at 53212 (4096 bytes)
    - Font is at 52444 (768 bytes)

    Here's the conversion tool. It's very, very, very basic. All it does is converting your tileset to a binary you can load at 53212 (or re-assemble alongside the code binary using pasmo). The input must be a png24 file with some restrictions:

    - Width of 256 pixels. Height of 64 pixels (for 64 tiles tilesets) or 256 pixels (for full, 256 tiles tilesets).
    - Colours MUST be right. I've chosen colours with RGB values of whether 0 or 200 for BRIGHT 0 colours and values of whether 0 or 255 for BRIGHT 1 colour. For example, if you want bright blue to be detected, paint with RGB = 0, 0, 255. If you want dark cyan to be detected, use RGB = 0, 200, 200.
    Correct colours for conversion
    
    #   Colour          RGB
    ------------------------------------
    0   black           0, 0, 0
    1   blue            0, 0, 200
    2   red             200, 0, 0
    3   magenta         200, 0, 200
    4   green           0, 200, 0
    5   cyan            0, 200, 200
    6   yellow          200, 200, 0
    7   gray            200, 200, 200
    ------------------------------------
    1   bright blue     0, 0, 255
    2   bright red      255, 0, 0
    3   bright magenta  255, 0, 255
    4   bright green    0, 255, 0
    5   bright cyan     0, 255, 255
    6   bright yellow   255, 255, 0
    7   white           255, 255, 255
    

    Usage:
    zxodus-conv.exe in.png out.bin 64
    

    Where in.png is your 256x64 or 256x256 png file containing your tileset, out.bin is your desired output filename. Then specify 64 for 64 tiles conversion (will generate a 4096 bytes binary), or nothing for full 256 tiles conversion (will generate a 16384 bytes binary).

    I hope these come handy for somebody :)

    http://www.mojontwins.com/warehouse/zxodus-mod64.rar
    http://www.mojontwins.com/warehouse/zxodus-conv-0.1.rar
  • edited September 2011
    Wow!... thats really handy there na_th_an, and much appreciated!... Thanks!... Im going to have to spend some quality time playing with this soon... thanks for sharing that!
  • edited September 2011
    You're welcome :) And here's the tiny tileset I created just to test the conversion tool (just 3 tiles, I know :D). If anybody finds a use for those, feel free...

    set-test.png
  • edited September 2011
    na_th_an wrote: »
    I don't know, what does line 80? It has worked for me, at least the modified, smaller version.

    Yeah, that was something stupid of me. Not really important.

    The thing was, after the program has run, I immediately LIST the program. And whenever I do that some memory get corrupted.

    Just don't immediately list your program and you're okay.

    (I could say that perhaps some system variables have been changed and therefore LIST will corrupt the 48K memory, but no one cares about that, right?)


    tldr: User Error :p
  • edited September 2011
    Well, all I can say is that I don't know :D

    Anyways, I have found the routines to be rock solid even BREAKing the execution and doing some BASIC editing which worked flawlessly (albeit very slowly, of course).

    Well, let's see what comes out of this :) The tool is dull, but hopefully will make people easier to use their own tilesets.

    And I always like to remind you all that we have a fabulous ongoing crap games compo, if you feel inspired ;)
  • edited September 2011
    Timmy wrote: »
    The thing was, after the program has run, I immediately LIST the program. And whenever I do that some memory get corrupted.

    I get this problem too but I can't understand why LIST should go corrupt.
    The program works on a IM2 interrupt and shouldn't pose a problem if all registers are correctly PUSHed and POPed.

    Maybe Andrew can provdie some insight. I've not looked at the code (yet) but maybe the interrupt return is hard setting the IY register to NR_ERR rather than push/popping it AND LIST is making use of it (although I can't believe that has it will have to DI in order to do so).
  • edited September 2011
    He posted something on FB about it, I think.
  • edited September 2011
    zxbruno wrote: »
    He posted something on FB about it, I think.

    Oh yes, so he did... "It seems that the code to switch off the engine (IM 1; RET) can corrupt BASIC unless you ENTER a blank line first. Probably should have made it DI; IM 1; EI; RET;,. Oh well."

    ..although that leads me to another question.. why DI when returing to IM1? Is it to do with those IFF1 and IFF2 flip-flop thangs?
  • LCDLCD
    edited September 2011
    BloodBaz wrote: »
    ..although that leads me to another question.. why DI when returing to IM1? Is it to do with those IFF1 and IFF2 flip-flop thangs?
    Maybe switching to IM1 while IM2 task is running PUSH/POP stack is not a good idea as the stack could then be messed up.
    Disabling interrupts first is allways a clean way.
Sign In or Register to comment.