Jump to content

Dev Tools

Share Programming Libraries & Development Tools here

35 files

  1. BASIC Line Number tool in Python

    This is a simple Python utility to add line numbers to BASIC programs.
    GOTO and GOSUB use labels instead of line numbers, like this:

    GOTO @HELLO 
    END
    @HELLO 
    PRINT "HELLO WORLD"
    In addition, the special @@ label resolves to "current line", like this:

    GET A$:IF A$="" THEN @@ 
    This will resolve to something like
    100 GET A$:IF A$="" THEN 100
    I have included a little Morse Code translator as a proof of concept and simple test program.
    This program and the Morse demo are open source, distributed under CC-BY license. 
     

    2 downloads

       (0 reviews)

    Submitted

  2. VTUI Library

    VTUI (Vera Text User Interface) library
    Can be used to create text user interfaces using VERA instead of relying on the KERNAL functions for writing to screen.
    The library is less than 1KB which means it can be loaded into Golden RAM at $400. As an alternative, include files are provided for Acme and CA65 assemblers.
    See https://github.com/JimmyDansbo/VTUIlib for documentation, examples and include files. 

     

    623 downloads

       (2 reviews)

    Updated

  3. Character Editor

    This is a character editor written in BASIC. Both layers are being used so all 256 characters in a font can be modified without affecting the program. The start-up of the program is slow due to character rom being written into layer 0 so it can be edited. Also had to clear layer 0 ram. Unable to use Try-In as program requires the the CHAR-EDIT-IF file.  Once the program is loaded you can press L to load the EXAMPLE1 file so see an alternative character tile set.
    Download the SD image to use. I've made an assumption about where the required interface data file is located and where the user data files will be. Unzip the sdcard-pal-edit.zip file and start the X16 emulator x16emu -sdcard sdcard-pal-edit , once it starts load"*",8 and run it. 
     
    CHAR-EDIT-IF EXAMPLE1.CHAR
    CHAR-EDIT.PRG
    char-edit.bas
    sdcard-pal-edit.zip

    68 downloads

       (1 review)

    Updated

  4. PRG Load Address Fix

    I wrote this to let you transfer BASIC programs between the Commander X16 and the Commodore PET (and MINI PET). 
    If the program's load address is NOT $801, PRG Fix adjusts it to 801 and saves a copy of the file. 
    If the file has the load address set to $801 (Commander X16, Commodore 64), it will change the load address to $401 for the Commodore PET.
    This does not change any of the program's code, so any commands in the program must be compatible across both systems. ie: don't use BASIC 4 keywords like "CATALOG" or CXBASIC keywords like "DOS". 

    5 downloads

       (0 reviews)

    Submitted

  5. Basic Label Compiler for Windows

    Writing BASIC programs longer than 10 rows on the X16 is a tedious experience. The text editor is very limited, much is about struggling with row numbers. This is an extremely simple compiler (sort of at least) for Windows that lets you write your BASIC programs in your favourite text editor with labels. The compiler outputs a new text file with the extension ".bas". It adds row numbers and fills in the right row number after the commands "GOTO", "GOSUB" and "THEN".
    No installation is needed, just copy the only file to the directory of your choice. 
    Usage: x16LabelCompiler <filename> [first row number] [step between row numbers]
    Labels must end with a colon (":"). Labels must not be reserved keywords in BASIC. Labels are preserved in the generated code by inserting "REM" before them. Empty rows are removed. All letters are converted to uppercase. A sample program called "guess_the_number.txt" is included.
    To compile the program:  x16LabelCompiler guess_the_number.txt
    To start the emulator, load the generated file and run it immediately: x16emu -bas guess_the_number.bas -run

    35 downloads

       (1 review)

    Updated

  6. VERA VRAM Helper

    An excel spreadsheet to help manage VERA VRAM usage. Has chart to display usage and location of Layer 0,1 and sprites. Available via GitHub, https://github.com/JustinBaldock/X16-VERA-VRAM-Helper
     

    10 downloads

       (0 reviews)

    Submitted

  7. KERNAL Test

    This is a small, proof-of-concept C program which tests KERNAL functions on the X16.  
    Routines currently tested:
    chrout memtop, both read and write membot, both read and write setnam setlfs load to RAM load to VERA (well, sort of) set time and read time It uses CC65's library to set registers and invoke routines. 
    The source code is here: https://github.com/bobbyjim/x16-kernal-test

    30 downloads

       (0 reviews)

    Updated

  8. cc64 X16

    cc64 is a small-C compiler, written in Forth, targeting the 6502 CPU.
    It's hosted on the C64, on the C16 with 64k RAM, and now on the X16.
    Runtime targets are available for all 3 platforms, on each host, allowing cross-compilation.
    The code lives at https://github.com/pzembrod/cc64.
    It's licensed under the 2-clause BSD license: https://github.com/pzembrod/cc64/blob/master/COPYING
    See https://github.com/pzembrod/cc64/blob/master/Usage.md for usage.
    See https://github.com/pzembrod/cc64/blob/master/C-lang-subset.md for details about the supported subset of C.
    See https://github.com/pzembrod/cc64/blob/master/Lib-reference.md for the the LibC subset that comes with cc64, plus the lib's deviations from the standard.

    333 downloads

       (2 reviews)

    Updated

  9. BASLOAD

    BASLOAD lets you write BASIC programs without line numbers in the editor of your choosing.
    BASLOAD runs natively on the X16. As it's name implies, BASLOAD loads BASIC programs stored on the SD card into RAM. While loading a file, it's tokenized so that it can be run by the X16's built-in BASIC interpreter.
    Source files are stored as plain text that can be edited in almost any editor on the X16 or on a modern computer. There are, however, special bindings for the text editor X16 Edit making the programming workflow more convenient.
    Instructions on how to use BASLOAD and source code may be found here:
    https://github.com/stefan-b-jakobsson/basload
    BASLOAD workflow.mov

    70 downloads

       (0 reviews)

    Updated

  10. X16PngConverter - convert png images to sprites, tiles or bitmap images

    This is a console  application for Windows that will convert png images to a format that the video controller (VERA) of the Commander X16 can read.
    Both indexed images (which contain a palette) and full-color images are supported.
    The original file can contain an image or a number of tiles or sprites with max 256 colors.
    For conversion of images, the width of the image must be 320 or 640 pixels. Height has no restrictrions.
    For conversion to tiles or sprites, the width and height of each tile/sprite must be specified.
    COLORS
    Bits per pixel (BPP) in the generated file will depend on how many colors the conversion results in.
    The number of colors might be reduced because the color depth of VERA is limited to 12 bits.
    In other words several 32-bit colors in the original image might be converted to the same 12-bit color.
    Semitransparent colors (0 < alpha < 255) will be treated as solid colors.
    For conversions of images with 16 colors or less, up to 13 colors will be displayed in the console window.
    Due to limitations of the console itself this is the maximum number that can be displayed correctly.
    TRANSPARENCY
    The first color of the palette might be transparent when rendered by VERA.
    This is for example the case when a sprite is rendered in front of a layer.
    Therefore it can be absolutely crucial which color in the original image that will receive index 0 in the generated palette.
    The selection is made in the following way:
    1. If the original image is indexed (has a palette), the color with index 0 in the original will also receive index 0 in the converted image.
    2. If the user has explicitly stated which color should be the first, this color will receive index 0.
    3. If nothing above applies, the color of the top left pixel will receive index 0.
    OUTPUT
    At least two files will be generated: a binary file with image data and the palette in binary format or in the format of assembly source code or BASIC.
    As an extra bonus a BASIC program that displays the image/tiles/sprites can be generated.
    INSTALLATION
    The application is for Windows and depends on .NET 6.0.
    No installation is needed, there is just one executable file.
    SYNTAX
     X16PngConverter [-help] [FILENAME] {-image|-tiles|-sprites} [-height] [-width] [-palette] [-transparent] [-demo].
    OPTIONS
    (No arguments)          : Displays this text.
    -help/-h                         : Same as above if it is the first argument.
    FILENAME                   : If the name of the file is the only argument, the original image will be analyzed
                                            to see if conversion is possible and in that case which options that are possible.
    -image|-tiles|-sprites  : Set conversion mode (mandatory). When image mode is used the original image must be either 320 or 640 pixels wide.
    -height/-h                     : Set height of tiles or sprites (not used when converting to a bitmap image).
                                            Valid values for tile mode are 8 and 16, for sprites 8, 16, 32 and 64.
    -width/-w                     : Set width of tiles or sprites, (not used when converting to a bitmap image).
                                            Valid values are the same as for height.
    -palette/-p                   : Set file format for the destination file that contains the palette.
                                           Valid values are:
                                           bin - a binary file
                                           asm - text file containing assembly source code)
                                           bas - text file containing BASIC DATA statements).
                                           If this option is omitted, all three files will be created.
    -transparent/-t           : Set which color that will have index 0 in the generated palette.
                                          The value must be a 32-bit hexadecimal value in the following format:
                                          $aarrggbb where a = alpha, r = red, g = green and b = blue.
    -demo/-d                    : Generate a demo program in BASIC. This can be loaded to the emulator by using the -bas option.
                                          For example: x16emu -bas mysprites_demo.txt. To run it immediately add the option -run.
                                          Using this option will cause a binary palette file to be created.
    EXAMPLES
    X16PngConverter                                                          : Display help text.
    X16PngConverter image.png                                      : Analyse image and see if it is possible to convert.
    X16PngConverter image.png -image                         : Convert to a bitmap image (width must be 320 or 640 pixels).
    X16PngConverter image.png -tiles -h 16 -w 16        : Convert to tiles with a widht and height of 16 pixels.
    X16PngConverter image.png -image -p asm            : Convert to sprites and output palette only as a file with assembly source code.
    X16PngConverter image.png -image -t $ff88aacc  : Convert image with the specified (potentially transparent) color as the first in the generated palette.
    X16PngConverter image.png -image -demo            : Convert image and generate a BASIC demo program named image_demo.txt.

    36 downloads

       (0 reviews)

    Updated

  11. Proof of Concept sprite, PSG, etc tools

    This file demonstrates a grab-bag of utility code I wrote recently.  The library includes two versions of Burtle's small noncryptographic PRNG, PSG code, sprite code, a timer, and a a Z-text decoder, among other things.  
    Largely, this is code that I kept writing for several projects -- or code that I wanted to write but hadn't gotten around to, yet.  I consolidated these little odds and ends because I tend to use them a lot but want them all in one place.
    The repo is https://github.com/bobbyjim/x16-c-tools

    31 downloads

       (0 reviews)

    Submitted

  12. Palette Editor

    This is a little tool written in BASIC to display the VERA palette and let you edit the colours. A palette file can be saved or loaded. A palette file is simply all 256 colours saved out of memory. The interface was drawn using PetDraw16. The program and files are on a SD card image. Simply attach and load pal-edit then run. 
    Code available from https://github.com/JustinBaldock/X16-SpriteEdit

    25 downloads

       (0 reviews)

    Submitted

  13. PET Upper/Lowercase char file

    This is the upper+lowercase non-C64 "PET" or "VIC-20" font. 
    In cc65, it can be loaded like so:
    cbm_k_setnam("pet-case.bin"); cbm_k_setlfs(0,8,0); cbm_k_load(2, 0x0f800); Warning -- changing the case (e.g. cbm_k_bsout(14)) will reset to the default font.

    16 downloads

       (0 reviews)

    Updated

  14. BASIC PREPROCESSOR

    BASIC PREPROCESSOR allows one to create Commodore BASIC programs with a normal text editor without line numbers. Features:
    Much as strings begin and end with a quotation mark ("), macro constructs begin and end with a commercial at sign (@). This means that you cannot include @ in a macro, but otherwise any character may be used. A label can be defined on a line by itself as @+LABEL@. A label can be referenced after a GOTO or GOSUB as @-LABEL@ (including ON statements). A long variable name can be used as @!NAME@. A preprocessed comment can be used as @' whatever text you want @. These comments are not written to the PRG file. Any leading whitespace on a line is removed before writing the code to the PRG file. The preprocessor (probably) requires an emulator built from the master github branch. The program is written almost completely in BASIC. The one exception has to do with tokenization. Normally as you enter lines of BASIC the computer will translate them into a compressed tokenized form, and this is necessary for the programs to be usable. In order for BPP.PRG to create tokenized BASIC programs, it has a small machine language routine in golden RAM that converts from plain text to tokenized form. The tokenized form is written to the output PRG file.
    Here is a super simple example called SIMPLE.BPP.
    An animated GIF demonstrates the process of using the program.

    129 downloads

       (0 reviews)

    Updated

  15. ROM template

    This is a template for ROM based assembly programs that you are free to use or continue upon.
    It's made for the CA65 assembler.
    Usage:
    Create your program code as normal. Of coarse, you need to place all variables in RAM and avoid any self modifying code. Include the file kernal.inc. This will: Create jump vectors for all "public" KERNAL function, and Set the IRQ vector in $fffe-ffff, so that the KERNAL interrupt handler is called. The file example.s is a small hello world test.
    The project is built with build.sh.
    The file example.cfg contains the memory segment settings needed by the assembler/linker.
    The source code is also available on Github:
    https://github.com/stefan-b-jakobsson/x16-romtemplate

    38 downloads

       (0 reviews)

    Submitted

  16. VolksForth X16

    VolksForth Readme
    VolksForth is a 16bit Forth System produced by the German Forth Gesellschaft e.V.
    The main repository lives here: https://github.com/forth-ev/VolksForth
    Major development of this system was done between 1985 until 1989. The VolksForth Project was revived in 2005 with the goal to produce a managable Forthsystem for computer systems with restricted system resources.
    Some modern Forth Systems were influenced by or were derived from VolksForth (GNU-Forth, bigForth).
    The current Version of VolksForth is 3.81. Version 3.9.x will be interim versions on the way to sync all VolksForth targets and move towards compliance with the 2012 Forth standard.
    Version 3.8.x is based on the Forth 83 standard, Version 4.00 will be based on the current 2012 Standard (https://forth-standard.org).
    At this time VolksForth is available for this Systems:
    VolksForth MS-DOS (Intel x86 architecture i8086/i186/i286/i386/i486 etc) VolksForth 6502 (Commodore 64, Commodore Plus 4, Commander X16, Apple 1, Apple ][, Atari XL/XE) VolksForth Z80 (CP/M, Schneider CPC) VolksForth 68000 (Atari ST, Amiga with EmuTOS)  
    Copyright
    The VolksForth Sources are made available under the terms of the BSD Lizenz - http://www.opensource.org/licenses/bsd-license.php
    The Handbook is Copyright (c) 1985 - 2020 Forth Gesellschaft e.V. ( Klaus Schleisiek, Ulrich Hoffmann, Bernd Pennemann, Georg Rehfeld, Dietrich Weineck, Carsten Strotmann).
    (most of the Information is still in german. We are planning to provide future versions with englisch documentation)
    Have fun with VolksForth the VolksForth Team

    95 downloads

       (1 review)

    Updated

  17. BASIC Pre-processor in Perl

    Scott's dev tool prompted me to post this one.

    This is a dev tool for people who write things in BASIC, but write it off-board, and like to have some more modern features. 

    This script runs best on a UNIX or (perhaps) a Windows environment.
    It supports
    (1) Labels.
    (2) Long variables.
    (3) Multiple source files.
    (4) "Ephemeral" comments.

    Your source files must not use line numbers.  This script will create them for you.
    Labels look like C64 LIST's:
     
    {:this is a label} goto {:this is a label} Long variables are actually namespaces that work for strings, floats, or ints.  They can have periods in them, so they can even vaguely resemble object field accessors. Declare and use them like this:
    longvar \thing.entry \thing.entry$ = "the thing!" \thing.entry = 5.0  

    Ephemeral comments start a line with a semicolon.  Their entire content is ignored and thrown away when the output BASIC source is built.  I think it's useful for development documentation that's not needed in the target BASIC 2.0 code.
    ; ;   This comment will never show up in the target code. ; This invokes the script, passes in files 1...n  (however many you have), and redirects STDOUT to a target file (here, output-file.bas).  That output file is ASCII source, and is directly loadable into the emulator via the -bas flag.  
     
    perl basic-labelmaster.pl file1.list file2.list ... filen.list > output-file.bas  
     
     

    11 downloads

       (0 reviews)

    Updated

  18. 8sh

    https://github.com/bobbyjim/x16-8sh
    This is the early early stage of an attempted "shell" for the X16.
    By definition, a command shell is an interpreter that exposes the system.  In practice, the shell exposes the system through an immediate-mode scripting language, which can also be executed from a file.  The Commodore computers' boot mode is a kind of "BASIC shell".
    This shell currently does almost nothing.  I am slowly working out a set of mid-level operations for it, and plan to add the shell's command inventory on top of that. Then, I'll add the ability to run full scripts from file.  Then, I'll add the ability to "pipe" the output of one script into another.  In this manner, I hope to build up a small inventory of useful utilities.
     
     
     
     

    70 downloads

       (1 review)

    Updated

  19. Hex dumper

    A hex dumper I wrote, because I wanted one like the one I've got on my UNIX machines.
    It should be able to handle "proper" address 0 RAM banking, as well as r38 RAM banking (it checks the KERNAL version).
    Set the color with the number keys.
    Change the view by $100 with left/right cursor, by $300 with up/down, and by $1000 by enter/left arrow.
     

    111 downloads

       (0 reviews)

    Updated

  20. x16tial renumber

    Version 0.1.1: renumber your BASIC programs! 
    BUT, for now, GOTOs, GOSUBs, THENs, and ONs will have to be manually fixed with the aid of the cross reference that prints when you execute the renumber.
    (Copy the cross reference list from the shell window and paste it somewhere handy.  Make sure you have -echo on when you start your emulator!)
    To activate:
    LOAD "XREN.PRG",8,1
    SYS 1300
    NEW (this resets BASIC's memory pointers)
    and load your basic program, then type:
    REN <starting line number>, <increment>
    The old line number, an arrow, and the new line number will then print, giving you a cross reference for fixing gotos and such.
    Currently, <increment> needs to be 1-255
    HIGHLY RECOMMENDED: Download and activate XMA (x16tial mouse aid) from the Dev Tools area as well, which is very handy for getting around your program to make those changes.
    FUTURE VERSION(s) will incorporate making the changes to the references, but for now, this should save some work in renumbering your program(s).
    This is good for R38, future revisions of ROMs will probably break this.  But I will try to supply updates as quickly as possible.
    Note: It *is* possible to get illegal line numbers (> 63999).  What you do after this, you do so at your own risk!

    31 downloads

       (0 reviews)

    Updated

  21. x16tial Page Examiner

    Here's a utility that will display the contents of any memory page at the top of the screen, actively and persistently.
    Helps to see what's going on in different areas of memory, like zero page, the stack, page $02, page $03, page $9f, page $a0 (bank 0).
    I found it useful to track down memory locations for the mouse aid program, specifically quote mode and insert mode flag locations.
    LOAD"XPAGEX",8,1
    SYS 1024
    (NEW to reset BASIC memory pointers, if need)
    Just POKE 99,<page number> to change pages.  There's a "ruler" to help you determine what location you're looking at.  The 4 lines are 64 bytes each.

    19 downloads

       (0 reviews)

    Updated

  22. x16tial mouse aid

    The X16's default text screen is HUGE!  480% percent bigger than the C64's! Or is it 380%?  Whatever, it's nice!
    This small utility is designed to help navigate this awesome space, primarily when developing in BASIC.
    It turns the mouse on and enables:
    Left Click:  Locate cursor where clicked.
    Right Click: Clear screen and execute LIST.
    load with:
    LOAD"XMA",8,1   (or use XMA.PRG if you like typing, also LOAD can be abbreviated with L-Shift-O)
    SYS 1024
    The idea is that it really improves getting around large basic programs.  One hand on mouse, other on the stop key, right click to start listing, stop when need, click where you want to edit, boom. 🙂
    ** BUG **:  To prevent a lockup, after loading and activating XMA, just type a quick NEW.
    If not, if you try to enter a basic program line (with a line number, not immediate) the emulator will hang.  Or you can just load an existing BASIC file.
    This is probably a holdover bug from the C64 (or BASIC V2), where BASIC's memory pointers get set strangely when loading a program that doesn't sit in BASIC's memory area.
    With 1.1.0, you can now SYS 1024 after doing a reset to reactivate XMA.

    91 downloads

       (1 review)

    Updated

  23. Simplest Sound Effects Library for BASIC programs

    Usage
    Because of its simplicity the library can be stored in a 1K space below basic programs, starting at $0400. Save the EFFECTS.PRG program in the directory where your BASIC program is stored, which would typically be in the same directory from where you are running the emulator.   Load library with LOAD command:   LOAD”EFFECTS.PRG”,8,1,$0400   Since this routine after the first run adds a new interrupt handler it is good practice to only load it once. It is therefore recommended to do a simple check:   IF PEEK($400)=0 THEN LOAD”EFFECTS.PRG”,8,1,$0400     And that is it. Now you only need to call the needed sound effect from the BASIC program with a simple SYS command. We have four different effects so four different addresses can be called:   SYS $400 PING Is designed for events like picking coins or rewards. SYS $403 SHOOT Effect that can be used for shooting the gun or other weapon. SYS $406 ZAP Electricity zapping or perhaps a laser gun sound. SYS $409 EXPLODE Long explosion for when we successfully blow something up   Alternative binary named EFFECTSHI.PRG that loads into memory at $9000 can be downloaded. Of course calls are then $9000 for PING, $9003 for SHOOT, $9006 for ZAP and $9009 for EXPLODE.   Full source code and walk through is available at my blog: https://www.8bitcoding.com/p/simplest-sound-effects-library-for.html   Demo video:      

    65 downloads

       (0 reviews)

    Updated

  24. mkcard

    Someone asked for help creating new sdcard images to be used with the emulator, so I banged around in vim for a while and dug around in DDG until I found enough hints around using sfdisk and mtools to create a suitable file w/o needing any root permissions.  Due to limits of the FAT32 filesystem, the smallest image you can format with FAT32 is 32 MB.

    $ mkcard -f scratch.img -s 32 Checking that no-one is using this disk right now ... OK Disk scratch.img: 34 MiB, 35651584 bytes, 69632 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes >>> Created a new DOS disklabel with disk identifier 0x9983f409. scratch.img1: Created a new partition 1 of type 'W95 FAT32 (LBA)' and of size 33 MiB. scratch.img2: Done. New situation: Disklabel type: dos Disk identifier: 0x9983f409 Device       Boot Start   End Sectors Size Id Type scratch.img1       2048 69631   67584  33M  c W95 FAT32 (LBA) The partition table has been altered. Syncing disks.
    You'll need the mtools and util-linux packages installed to use the script.  Unfortunately, this limits this to be only be usable by Linux users (maybe Windows 10 users with WSL as well, don't know, don't have a Win10 setup to try with), I don't see sfdisk in the macOS ported versions of util-linux packages.
    To make things even easier to use these files with mtools, create a ~/.mtoolsrc file with something like:

    mtools_skip_check=1 drive s: file="~/scratch.img" exclusive partition=1 drive x: file="~/basic-progs.img"    exclusive partition=1 drive y: file="~/demos.img"    exclusive partition=1
    And now you can use mcopy to copy files to your s:, x: or y: drives.  Just make sure you UPPERCASE the filenames so x16emu will display the filenames as you expect them to look.

    39 downloads

       (0 reviews)

    Updated

  25. Tilemap Converter for Pyxel Edit

    This is a tool for converting tilemaps made in Pyxel Edit to the binary format that X16 uses in tile mode 2/4/8 bpp. A two byte header set to 0 will be added. It is a simple Console Application made in .NET core. If I understand things right it should be executable on macOS and Linux beside WIndows.
    Instructions:
    1. Export your tilemap from Pyxel Edit , select JSON as format (NOT xml or text).
    2. Run the application (PyxelTilemapConverter.exe) with two arguments: filename and which palette offset your tiles should be using.
    Pyxel Edit is very handy because you can design both tilesets and tilemaps in the same application. It helps to cut development time. But if you're looking for a better tilemap editor I strongly reccommend Tiled Map Editor which is very powerful. And the good news is that I have made two extensions for exporting maps from Tiled as well : ) ).

    34 downloads

       (0 reviews)

    Updated

×
×
  • Create New...

Important Information

Please review our Terms of Use