Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Posts posted by DusanStrakl

  1. I pulled the trigger too but was also late so will be in the next year's batch. I am just starting to look into it more deeply though and haven't had much time with emulator so far but looking forward to it and hopefully have it side by side with Commander X16 and write some software for both platforms.


    • Like 2
  2. Welcome to the X16 and I myself have spent quite a lot of time working on squeezing much out of the BASIC and I am very impressed with capabilities Commander X16 offers without having to resort to Assembly.

    I wrote number of tutorials and games written in BASIC and those might be good way for you to start, copy & paste some snippets or whole programs, experiment and post your progress. This community is great and very helpful if one gets stuck.

    Link to the blog (Under BASIC tab):


    And on this forum:


    I personally write most of BASIC programs right inside Emulator just occasionally copy source code to Visual Studio Code for quick lookup or cleaning.

    And most importantly, have fun!


    • Like 1
    • Thanks 1
  3. On 11/14/2021 at 2:12 AM, kliepatsch said:

    Hey Dusan, this looks very cool from what you wrote. But I cannot get it running, neither in the "Try it now" section, nor after downloading all the files (individually) locally. In both scenarios, the program gets stuck at the splash screen with blue lines going from top to bottom.

    I noticed the same thing with the "Try it now". Will try to troubleshoot in coming days. I am using R38 and just tried downloading files into clean directory and it works fine for me.

    I haven't tried it in R39.

  4. Crazy Lander

    View File

    Crazy Lander is another (mostly) BASIC game for Commander X16. We will introduce some new technologies not used before in our projects. It is a variation of Lander type games where we have to guide and land the space capsule to dedicated platforms using thrusters and navigating through natural and man-made obstacles. To make the game more challenging we have to be mindful of the fuel used and land gently. Few highlights:

    • Running in bitmap mode
    • It is a game of precision so we have to assure pixel perfect collision control
    • Animated obstacles unique to each level
    • Music and sound effects

    Project Specs

    • Emulator Version R.38
    • Low resolution bitmap mode 320 x 240 in 16 colors on Layer 0
    • Use the menu system to choose difficulty, turn music on and off, display instructions, quit and of course start the game
    • Animated sprites for displaying capsule as well as thruster exhaust and explosion animation
    • Tile layer 1 is used for HUD and for messages and menus
    • Assembly subroutine for pixel perfect collision detection
    • 4 distinct levels with flexibility to add more
    • Scoring is based on the landing platform multiplier times the remaining fuel
    • Keyboard/Joystick controls
      • Left Arrow / Joystick Left fire left thruster pushing lander right
      • Right Arrow / Joystick Right fire right thruster pushing lander left
      • Space / Fire button main thruster pushing lander up
    • Music in the background using Music Library for BASIC programs
    • Sound effects using direct programming PSG from BASIC using VPOKE
    • 256 color splash screen


  5. I am late to the party, the question was already answered but since the documentation is a bit unclear I elaborated a bit more on my blog, especially because the Palette Offset works differently on 8bpp Sprites.

    • Color 0 is again transparent, so binary value of %0000 0000 will simply show the color of the layer below (if there is one)
    • Colors 1-15 will be affected by Palette Offset in Map data in the same way as in above example for 4bpp mode which makes sense because they only use 4 lower bits anyway and are simply complemented by top 4 bits from the offset. If Offset is 0 then Palette is unchanged.
    • Colors 16-255 are not affected by the Palette Offset and are taken directly from the palette. Note that this is different from the behavior for the 8bpp sprites.



  6. 4 minutes ago, Wertzui said:

    @DusanStrakl So that's what I was doing wrong. When I first tried VPOKEs, I didn't write it in the proper format, and wondered why it gives me "illegal quantity error"-s.

    Yeah, I am playing with X16 Emulator for more than a year and still mix them up occasionally 🙂

    Actually I saw so many questions about this I just started writing another post for my blog to explain how to use PSG in BASIC.

  7. I think you are overcomplicating a bit. You don't need to program VERA registers when using BASIC, you can use VPOKE to write data to VRAM directly and let BASIC interpreter deal with VERA registers.

    A simple program to turn on square wave (pulse) and increases frequency can be written as below:

    10 VPOKE 1,$F9C3,%00111111:REM     SET WAVEFORM FOR VOICE 0
    30 FOR N=200 TO 2000 STEP 5
    60 FOR I=1 TO 200:NEXT I:REM       DELAY
    70 NEXT N
    80 VPOKE 1,$F9C0,0:VPOKE 1,$F9C1,0




    • Like 1
  8. Agree with Matt, VERA PSG is way to get started. I implemented very simple, rudimentary sounds in my version of Tetris in BASIC:


    If you don't want to deal with programming you can also just import and call four basic sounds in my Simplest Sound Effects Library for BASIC:



    Later if you want to add music that plays independently in the background of BASIC program you can opt to a bit more complex Music Library:


    • Like 1
  9. 12 hours ago, Lucky Phil said:

    Terrific stuff... very nicely done! From a novice point of view, it's great to see what can still be achieved in BASIC - without diving head-first into assembly language. I guess that the relatively fast clock rate and sophisticated code (as opposed to what were on offer in the beloved, original Commodore 64) negate many of the arguments against developing in BASIC, after all?

    Thanks Lucky Phil. I agree, Commodore BASIC is not ideal language but then again there is no such thing anyway. I find it very convenient to tinker with, prototype and with some effort and clever coding a lot of fun results can be achieved.

    • Like 1
  10. 12 hours ago, Jakebullet70 said:

    This is real good stuff. Sometimes I think people forget this is still a BASIC machine.


    Thanks Jake. I agree and with powerful hardware supported graphics and 8Mhz clock speed a lot can be done in BASIC. I am working mostly on my Assembly tutorials now but I am sure I will add some more BASIC tutorials and games soon.

    • Thanks 1
  11. This has been a common question for a while now and Stefan explained it perfectly. There are several other keys that can't be detected by standard Kernal routine at this time and I was assured that all the keys on the keyboard will have function in the future. I expect they will also fix some discrepancies like for example not use F4 to switch between 40/80 display when there is a dedicated button for it etc.

  12. When I was working on something reusable for my needs I was always struggling with really how generic such a library can and should be. I can think of few dilemmas from the top of my head:

    Do I support default screen size only or make it generic, specifically Map width is tricky one because if you want to support anything else than 128 tile width the VERA MID parameter is no longer Y dimension and require more checks and bit shifting.

    How to handle colors, do I go for standard predefined colors for different objects/widgets or should they always be passed as parameters. If second what happens if you want to draw e.g. frame parts in different colors to represent highlights etc.

    Do I allow different variations e.g. can frame be with rounded corners or square corners or perhaps the whole frame can be built with full or half blocks or even custom characters.

    Support for Lower case / Upper case PETSCI / ISO and then translations to screen codes

    Before mentioned number to text translations



    This can lead to a real rabbit hole of options so I suggest not to overthink and to really simplify the first version and only support default screen and very basic functionality and then see where it leads.

    • Like 1
    • Thanks 1
  13. 18 hours ago, kelli217 said:

    Ctrl and Alt are arranged horizontally on my keyboard, so playing the left side took a bit of adjustment. 🙂

    Yeah it is not ideal but it is compromise that works reasonably well.. I don't think anybody uses real joysticks with emulator and we still don't have proper access to keyboard to programmatically detect key presses and not rely on kernal. Of course for this type of game analog input would be the best.

    • Like 1
  14. Crazy Pong

    View File

    After three tutorials on how to use Sprites on Commander X16 using Assembly, I wrote a game to demonstrate all we learned there plus of course some necessary techniques like reading controls, using interrupts and utilizing Fixed Point Notation.

    Full tutorial with source code walkthrough is available on my blog:




    • Like 3
  15. 1 hour ago, Ed Minchau said:

    The original Quake was 320x200 pixels.  I've been looking into the math behind representing the range [-1..1] as 1+7 bit numbers; it's a two's complement notation divided by 127.  So far using ~8kb of lookup tables I've got fixed-point multiplication, division, sin/cos/arcsin/arctan, and a very fast 1/sqrt(x^2+y^2+z^2) normalization function, just four lookups and two additions then three multiplications or divisions, faster than the normalization function Quake used, albeit 8 bit instead of floating point.  I'm giving serious thought to making an 8bit 3D game engine.

    Go for it, it would be very interesting to see what kind of performance you could get out of it.

  • Create New...

Important Information

Please review our Terms of Use