ccz80

Would you like to react to this message? Create an account in a few clicks or log in to continue.
ccz80

ccz80 programming language


2 posters

    [sprites Alives]

    avatar
    jbaudrand


    Posts : 9
    Join date : 2012-01-14

    [sprites Alives] Empty [sprites Alives]

    Post  jbaudrand Wed Feb 01, 2012 5:04 am

    Hello,
    I'm planning to use Sprites alives for making a game, I read the included manual with ccz80 and I have this question:
    If I code with ccz80 and sprites library will the compiled code will be faster than coding under basic using sprites alives?
    avatar
    poppichicken


    Posts : 37
    Join date : 2009-10-09

    [sprites Alives] Empty Re: [sprites Alives]

    Post  poppichicken Wed Feb 01, 2012 11:09 am

    Hi there.

    After reading your message I thought I'd give Sprites Alive a try.
    It's a pretty impressive program actually!

    Anyway, I've compiled the 6 example programs from the SpritesAlive.pdf included with the ccz80 installation (example 4 needed a "const" changed to "define" to compile, as "const" has been replaced by "define" in ccz80).

    The answer to your question is: yes, the ccz80 versions do run faster. How much faster though depends on the program.
    The spritesAlive routines probably run at the same speed in either case, in much the same way that the ROM drawing routines run at the same speed whether run from BASIC or from a compiled binary such as that produced by ccz80.

    The difference comes from the fact that the surrounding code will run MUCH faster when compiled, than when run straight from BASIC. For example, there was a 3D Maze game published in Amstrad Computer User in 1985 or so. I converted it to ccz80 about 2 years ago, so I could learn how to use ccz80. Even though the conversion used the same ROM routines for drawing the lines, it ran much, much faster than the BASIC version, as there was a lot of logic being performed each frame, and of course in BASIC that logic runs very slowly. In ccz80 it was compiled to machine code and so was very fast.

    Ok, the 6 demos:
    demo1 - this seems to run a lot faster under ccz80 (perhaps 50%)
    demo2 - the balls appear much more quickly (probably due to the setup logic being much faster) in ccz80, but the program only seems to run a bit faster after that (perhaps 20%)
    demo3 - perhaps 25% faster in ccz80.
    demo4 - the difference in this one is amazing. In ccz80 it seems to be more than twice as fast, and so the game is unplayable due to the speed. This is probably because there is a lot more logic being processed in each frame.
    demo5 - perhaps 20% faster in ccz80.
    demo6 - perhaps 20% faster in ccz80.

    So as you can see, it depends entirely on the complexity of the logic in your game.
    I hope that helps.

    [EDIT] Another great thing - the 6 binary files produced by the ccz80 compiler for these demos are all very small, which is a nice bonus. Very Happy
    avatar
    jbaudrand


    Posts : 9
    Join date : 2012-01-14

    [sprites Alives] Empty Re: [sprites Alives]

    Post  jbaudrand Wed Feb 01, 2012 5:54 pm

    you enlight my day.
    Very Happy
    avatar
    poppichicken


    Posts : 37
    Join date : 2009-10-09

    [sprites Alives] Empty Re: [sprites Alives]

    Post  poppichicken Wed Feb 01, 2012 6:23 pm

    My pleasure. Very Happy

    Sponsored content


    [sprites Alives] Empty Re: [sprites Alives]

    Post  Sponsored content


      Current date/time is Fri Mar 29, 2024 9:21 pm