Jump to content

Search the Community

Showing results for tags 'basic'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Commander X16 Forums
    • Introductions
    • X16 Discussion Lounge
    • X16 Help & Support Lounge
    • Off-topic Lounge

Categories

  • Official Software
  • Official Docs
  • Community Downloads
    • Games
    • Productivity Apps
    • Graphics Apps
    • Audio Apps
    • Demos
    • Networking Apps
    • Dev Tools
    • Tutorial Apps
    • Misc Apps

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me

  1. Version 1.0.0

    30 downloads

    The Commodore Labyrinth demo written entirely in BASIC from the early 80s. I've updated it a little bit and I'm trying to understand and untangle some of the spaghetti code. LABYRINTH.PRG labyrinth.bas
  2. Version 1.0.0

    14 downloads

    Akalabeth: World of Doom (1979) by Richard Garriott, AppleSoft basic ported to the Commander X16 by Justin Baldock. When starting I recommend you buy some food. This game is very unforgiving. This game was a little tricky to port, it leaves about 124 bytes free of Basic memory. I've added some colour to a few of the enemies. https://github.com/JustinBaldock/X16-Akalabeth Keyboard commands in play. N = Move North / Foward W = Move West / Turn Left E = Move East / Turn Right S = Move South / Turn Around X = Statistics A = NA / Attack - = Pass / Pass P = Toggle Pause D = Climb Ladder / Enter Town/ Enter Castle / Climb Down Q = Quit AKALABETH.PRG akalabeth.bas
  3. Akalabeth View File Akalabeth: World of Doom (1979) by Richard Garriott, AppleSoft basic ported to the Commander X16 by Justin Baldock. When starting I recommend you buy some food. This game is very unforgiving. This game was a little tricky to port, it leaves about 124 bytes free of Basic memory. I've added some colour to a few of the enemies. Keyboard commands in play. N = Move North / Foward W = Move West / Turn Left E = Move East / Turn Right S = Move South / Turn Around X = Statistics A = NA / Attack - = Pass / Pass P = Toggle Pause D = Climb Ladder / Enter Town/ Enter Castle / Climb Down Q = Quit AKALABETH.PRG akalabeth.bas Submitter Justin Baldock Submitted 11/24/21 Category Games  
  4. Hi, When using basic v2 on R38 ROM. I want to check what is the current cursor line number. On the C64 I can peek at $D6 and it returns the current line the cursor is on. When I try this on the X16 I get the value 8 back... no matter where the cursor is. I've had a look at the repo and found, x16-rom/kernal/cbm/editor.s, which appears to have, "tblx .res 1 ;$D6" Checking to find where tblx is explained I found kernal/open-roms/screen/e566.cursor_home.s, which appears to explain it as the cursor_home, current row. So $00D6 should be returning what I am looking for, my question is, am I misunderstanding or have I found a bug? (I'm leaning towards not understanding)
  5. I wrote a series of blog posts/articles on Commander X16 architecture and coding. I have started with focus on beginners and then slowly moved to more advanced topics and techniques. First I tackle smaller chunks and use simple examples to show the topic in practice. After enough new knowledge is covered I write a complete game to utilize several of the techniques to illustrate how it all comes together so each new complete project is more complex than the one before. I do cover only Commander X16 specific so I recommend reading Commodore C64 BASIC tutorials and guides. Please note that the games and most examples are written with a goal to be as clearly readable and understandable so there is very little source code optimizations. Snake Game This game is written in very clean BASIC with very little trickery so not much special Commander X16 knowledge is required. We do VPOKE directly into video memory so only understanding of fundamentals is required. Recommended reading VERA Overview Topics Covered in Game Analyzing the game itself is a great way to learn basics like: How to structure source code (outer loops, game loop) What is Game loop Use of Data structure like multiple Arrays How to read Joystick, Keyboard How to use VPOKE to “talk to” VERA Video RAM organization and using colors Writing to certain location on the screen Using PETSCII control characters to display messages and title screen GOTO Crazy Snake Tutorial GOTO Download Tetris Clone This game introduces some more advanced features of Commander X16 and we have to take a bit more care of how to use data structures and optimize some parts of the game to make it playable. Recommended reading VERA Overview Tiles in Basic I - Video Modes 0 and 1 Colors and Palettes Topics Covered in Game Tetris clone requires us to improve on pretty much all parts of the snake game structure: We have additional loops outside and inside game loop Advanced game collisions based on screen state Pre-calculate relative positions of four segments of each tetromino Customize color palette Customize tiles (characters) Speed increase per level Adding sound to the game GOTO Crazy Tetrominoes Tutorial GOTO Download Boulder Dash style game With this game we are using most of the Commander X16 hardware capabilities and we are getting close to squeezing most out of it for BASIC games. We have to pay close attention to timings, synchronizing scrolling and animation, take care of different types of collisions, etc. Recommended reading VERA Overview Tiles in Basic I - Video Modes 0 and 1 Sprites in Basic I - Setup Sprites in Basic II - Animation Scrolling and Layers in BASIC Colors and Palettes Simplest Sound Effects Library for BASIC Font Library for Commander X16 Topics Covered in Game This game is taking advantage of hardware features of Commander X16 to the level it almost looks like 16bit game or something written in Assembly for 8 bit computer like: Two phase approach to development Full color mode Full screen scrolling Two layer graphics Scrollable playfield Static HUD Animated full color sprites 256 color title screen in graphics mode Advanced physics and game mechanics Loading assets to memory from binary files for: Tileset Sprite Sheet Fonts Sound effects library Title screen GOTO Crazy Boulders Tutorial GOTO Download Lunar Lander style game With this game we are using most of the Commander X16 hardware capabilities and we are getting close to squeezing most out of it for BASIC games. Due to pixel perfect collision detection requirement we had to use small machine code routine. Recommended reading VERA Overview Tiles in Basic I - Video Modes 0 and 1 Sprites in Basic I - Setup Sprites in Basic II - Animation Scrolling and Layers in BASIC Colors and Palettes Music Player Library for BASIC Programs Font Library for Commander X16 Topics Covered in Game This game is taking advantage of hardware features of Commander X16 to the level it almost looks like 16bit game or something written in Assembly for 8 bit computer like: Integration of machine code, Assembly source code is available Full color mode 256 Color Title screen Two layer graphics Bitmap background Tile based HUD Full color sprites Advanced physics and game mechanics Loading assets to memory from binary files for: Tileset - fonts Sprite Sheet Background music Title screen GOTO Crazy Lander Tutorial GOTO Download
  6. Version 1.0.0

    7 downloads

    This is my first "proper" program written for the Commander X16, and it is written entirely in BASIC. I wrote it mostly so that I could get a feel for how logic and moving between sections of code works, as well as to help with understanding how to draw pixels to the screen using the PSET command. At the moment, I know there are ways I could optimize my code, but at the same time I'm not sure quite how much faster I could get the program to really run. If I make any real, tangible changes to the code, I'll update the file on here with what I changed. Currently, the program offers four possible modes of drawing color to the screen: MODE 1 - 2-COLOR (draws a random black-and-white static pattern to the screen) MODE 2 - 4-COLOR (draws a random 4-color "3d goggles" static pattern to the screen) MODE 3 - 16-COLOR (draws a random 16-color static pattern to the screen) MODE 4 - 256-COLOR (draws the default 256-color pallete to the screen) I know this really isn't much and there are far better demos for the Commander X16 out there at the moment, but I still feel proud of what I wrote, considering how inexperienced I am at writing for the system.
  7. COLORGEN: A simple color generator written in BASIC. View File This is my first "proper" program written for the Commander X16, and it is written entirely in BASIC. I wrote it mostly so that I could get a feel for how logic and moving between sections of code works, as well as to help with understanding how to draw pixels to the screen using the PSET command. At the moment, I know there are ways I could optimize my code, but at the same time I'm not sure quite how much faster I could get the program to really run. If I make any real, tangible changes to the code, I'll update the file on here with what I changed. Currently, the program offers four possible modes of drawing color to the screen: MODE 1 - 2-COLOR (draws a random black-and-white static pattern to the screen) MODE 2 - 4-COLOR (draws a random 4-color "3d goggles" static pattern to the screen) MODE 3 - 16-COLOR (draws a random 16-color static pattern to the screen) MODE 4 - 256-COLOR (draws the default 256-color pallete to the screen) I know this really isn't much and there are far better demos for the Commander X16 out there at the moment, but I still feel proud of what I wrote, considering how inexperienced I am at writing for the system. Submitter path2whatevrr Submitted 11/14/21 Category Demos  
  8. On the C64 we could clear line X on the screen using a poke and sys to a kernal function. POKE 781,X: SYS 59903 Is there something like this for the X16? If I try it, it simply clears the entire screen. What I am doing is printing a game "shopping list" using CHR$(!13) CHR$($11) CHR$($11) so in the middle of the screen is a table of items. Then I'm using CHR$($13) to send the cursor back to home and prompt what the player would like to buy. The 2nd line would say if they purchased it, didn't have enough money, etc. Then I was hoping to clear just the 2nd line on the screen and re-prompt them until they leave the store. Any pointers would be cool.
  9. Basic Label Compiler for Windows View File 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 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 Submitter Johan Kårlin Submitted 11/08/21 Category Dev Tools  
  10. Version 1.0.0

    10 downloads

    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
  11. Palette Editor View File 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 Submitter Justin Baldock Submitted 11/04/21 Category Dev Tools  
  12. Version 1.0.0

    21 downloads

    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
  13. Version 1.0.0

    19 downloads

    A simple demo creating a random road and the player moves the car sprite around.
  14. Grand Prix View File A simple demo creating a random road and the player moves the car sprite around. Submitter Justin Baldock Submitted 10/29/21 Category Demos  
  15. Labyrinth View File The Commodore Labyrinth demo written entirely in BASIC from the early 80s. I've updated it a little bit and I'm trying to understand and untangle some of the spaghetti code. LABYRINTH.PRG labyrinth.bas Submitter Justin Baldock Submitted 10/28/21 Category Demos  
  16. Version 1.1.0

    72 downloads

    This reads the disk directory in BASIC. This is a super simple example and doesn't actually parse the files... it's just smart enough to read "$" and print it to the screen.
  17. Version 2.1; 1.0; 0.2

    22 downloads

    This is a single program listing that contains three different versions of the Proteus Demo from my thread in HOWTOs on converting and optimizing BASIC programs. Version .02 was from very early in the conversion/optimization process from that thread and, consequently, is quite slow. Its also got the original author's bad scaling coefficients, which make the output look a little gnarly. Version 1.0 was originally what I thought would be the 'fully optimized' version, with all sorts of things (documented in the thread) done to squeeze out better performance. And of course the scaling is fixed so the output looks better. This was supposed to be the end of the thread, except that... Version 2.0 takes advantage of something I noticed about the calculations, which led to the idea to have the program start off by precomputing a table that allows us to avoid having BASIC redundantly performing a bunch of the most expensive operations in the program. Even considering (and counting) the over minute-and-a-half it takes to initially compute the lookup table, the trick resulted in nearly halving the time to complete plotting the output compared to what was the previous fastest version. (Of course, I now wonder if some of the better math and coding gurus have been rolling their eyes all along, just wondering when, if ever, I might figure this part out...). Just RUN it and pick A, B or C from the menu. When its done plotting and puts up the elapsed time (its in HHMMSS format) you can press any key, and it will 'LIST' the program lines that correspond to the version that just completed plotting. I hope folks find it helpful having the three versions (and the howto thread) in terms of seeing how the thing evolved. You will notice that the more tweaking you do for speed, the more opaque and confusing the program becomes in terms of ever expecting someone with fresh eyes to try and see what the heck is going on. That 'early' version is included, in part, because its much easier to follow than the others. More info at the thread here:
  18. Proteus View File This is a single program listing that contains three different versions of the Proteus Demo from my thread in HOWTOs on converting and optimizing BASIC programs. Version .02 was from very early in the conversion/optimization process from that thread and, consequently, is quite slow. Its also got the original author's bad scaling coefficients, which make the output look a little gnarly. Version 1.0 was originally what I thought would be the 'fully optimized' version, with all sorts of things (documented in the thread) done to squeeze out better performance. And of course the scaling is fixed so the output looks better. This was supposed to be the end of the thread, except that... Version 2.0 takes advantage of something I noticed about the calculations, which led to the idea to have the program start off by precomputing a table that allows us to avoid having BASIC redundantly performing a bunch of the most expensive operations in the program. Even considering (and counting) the over minute-and-a-half it takes to initially compute the lookup table, the trick resulted in nearly halving the time to complete plotting the output compared to what was the previous fastest version. (Of course, I now wonder if some of the better math and coding gurus have been rolling their eyes all along, just wondering when, if ever, I might figure this part out...). Just RUN it and pick A, B or C from the menu. When its done plotting and puts up the elapsed time (its in HHMMSS format) you can press any key, and it will 'LIST' the program lines that correspond to the version that just completed plotting. I hope folks find it helpful having the three versions (and the howto thread) in terms of seeing how the thing evolved. You will notice that the more tweaking you do for speed, the more opaque and confusing the program becomes in terms of ever expecting someone with fresh eyes to try and see what the heck is going on. That 'early' version is included, in part, because its much easier to follow than the others. More info at the thread here: Submitter Snickers11001001 Submitted 08/27/21 Category Demos  
  19. Hi! I am working on a little project in screen mode 0. I can set the screen mode in basic. I can also set it in c. But when I set it in c, I get incorrect scrolling. It seems the scroll routing still thinks the screen is 60 characters high. I can't find it in the manual. (I probably put my blind glasses on :)) Scrolling is done like this. Print lots of character until the lower end of screen is reached, will trigger scrolling. It's rough, but it works. The screen setting is basically like this: *vera_video = 0x20 | 0x10 | *vera_video; *vera_hscale = 0x40; *vera_vscale = 0x40; *vl1_cfg = 96; *vl1_map = 0x00; What am I missing? I tried checking vera registers after doing a "manual" screen command, and the only thing I came to is the patter 0110 in the mapwidth, map heigh sections of the L1_CONFIG register. (hence *vl1_cfg = 96; ) Thanks CC
  20. I found an interesting listing on eBay, so I thought I'd share. Plus, maybe someone here can tell us more about it. Over in this thread @Cyber introduced us to the Dendy, a Famicom/NES clone from Russia or perhaps one of the other former Soviet states. The pic they showed in that thread looked like a typical console: top-loading slot, two controllers, etc. But, this eBay listing I found shows what appears to be that same Dendy Famicom clone, but built into a keyboard case, labeled "Russian-English Computer Learning Set", and packed with a cartridge that apparently also has (two flavors? of) BASIC. RETRO Dendy SUBOR KEYBOARD (Famicom) Console + full set | eBay (I should point out, I'm not the seller nor am I encouraging anyone to buy; I'm just sharing because it's interesting.) An easily programmable NES (clone) is kind of exciting. (I know Japan released a keyboard for the Famicom, but they're rare.) I wonder if the BASIC on this system can access the sound capabilities, that would actually be useful for chiptune creation. I wonder if anyone can translate the contents of the cartridge (there's a close-up picture of it, but most of it is in Cyrillic script except the word BASIC, heheh.) I assume the language education is for Russian-speakers to learn English - and not the other way? Another pic shows what appears to be a 25-pin port on the back, maybe a parallel port. I wonder what that might have been for.
  21. Version 1.0.003

    61 downloads

    A simple Morse code program. Written in QBASIC as a learning process, ported to various CBM machines, and now on Commander X16, because why not! It can translate from text to Morse, or from Morse to text. The input can be typed in, or loaded from a file. It has different modes of operation, in how it uses the signal marks. I have implemented 3 modes based on what I saw in different programs. The characters of the signal marks can be specified by the user. Sound output can be configured too. The character output can be saved to disk. It will work even if the output is longer than 255 characters (and also can be loaded back). Note: it only processes files up until it encounters a Carriage Return (PETSCII 13) character. Settings are saved too, but are not processed, as of yet. (Using the proper settings is vital for Morse->text translation to work.) (This is the first piece of program code I release anywhere )
  22. Scrubbly Morse Code Translator View File A simple Morse code program. Written in QBASIC as a learning process, ported to various CBM machines, and now on Commander X16, because why not! It can translate from text to Morse, or from Morse to text. The input can be typed in, or loaded from a file. It has different modes of operation, in how it uses the signal marks. I have implemented 3 modes based on what I saw in different programs. The characters of the signal marks can be specified by the user. Sound output can be configured too. The character output can be saved to disk. It will work even if the output is longer than 255 characters (and also can be loaded back). Note: it only processes files up until it encounters a Carriage Return (PETSCII 13) character. Settings are saved too, but are not processed, as of yet. (Using the proper settings is vital for Morse->text translation to work.) (This is the first piece of program code I release anywhere ) Submitter Wertzui Submitted 03/06/21 Category Misc Apps  
  23. Hi, just a quick query if people are seeing same as me. 10 GET A 20 PRINT A 30 GOTO 10 RUN -48 -48 -48 .... If I do the same on a C64 I get "0" instead of "-48". So I think this value is wrong... but I am wondering if I am missing something? I've had a poke around the ROM source. I think basic/code7.s line 50 has the start of it but my assembly is rubbish. Should I log an issue in GitHub for it?
  24. I saw this basic cross-compiler on YouTube "8-bit Show and Tell 2". This is a cool project and I was curious what others thought about it, especially regarding the possibility of getting it to work with the X16. It looks like some of the memory locations are configurable but not all based on what I was reading. There is a github page with source and they are looking for contributors. It looks like some of the code is written in D (https://dlang.org/) and some in Assembly. It may also be possible to use this project as a guide for developing a similar branch/offshoot for something a little more tailored to the X16. The cross compiler is using a grammar parsing library that could be helpful for that: https://github.com/PhilippeSigaud/Pegged https://xc-basic.net/doku.php https://github.com/neilsf/XC-BASIC Compiler Options: https://xc-basic.net/doku.php?id=compiler_options Memory Layout: https://xc-basic.net/doku.php?id=memory_layout Examples: https://xc-basic.net/doku.php?id=examples
  25. I've created a blog post about using tiles in BASIC. Going over the fundamentals of getting a Tiled map and graphics in to the X16 and displayed. https://justinbaldock.wordpress.com/2020/10/09/commander-x16-basic-tiles/ Feel free to comment here when providing feedback.
×
×
  • Create New...

Important Information

Please review our Terms of Use