Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 12/22/20 in Files

  1. 5 points

    Version 1.0.2b

    1 download

    This program is written using kickc of Jesper Gravgaard. I'm helping him to create a framework encapsulating the CX16 vera in order to be able to quickly create graphical effects for games. This is a short demo and I hope you like it. This program uses the keyboard to progress through the program! So be sure to run this from the desktop, since the emulator on mobile phones do not have a keyboard!
  2. 4 points

    Version 0.1

    3 downloads

    ux16vt is a UTF-8 and somewhat ANSI compatible terminal emulator for Commander X16. Currently the only useable "serial" port uses LOAD & SAVE to communicate between the X16 emulator and a glue process that moves data in and out of a POSIX pseudo-terminal. In the emulator LOAD "UX16VT.PRG" & RUN. On the host, compile and run emulator_glue.c. ## Unicode Support ux16vt supports up to 4096 1-bit 8x16 pixel glyphs selected at compile time from the Unicode Basic Multilingual Plane. Unknown characters are displayed as blank. Currently 672 of these glyphs are used covering 862 different code points. The following blocks are mapped: - Basic Latin (00-7f) - Latin-1 Supplement (80-ff) - Greek & Coptic (370-3ff) - Cyrillic (400-4ff) - Box Drawing (2500-257f) - Block Elements (2580-259f) Limitations: - no support for right-to-left text - characters are represented internally as 16-bit values, making any characters outside the basic multilingual plane complete inaccessible - completely mono-spaced text. full-width glyphs are not available ## ANSI Support Only sequences beginning with ^[[ are supported (Control Sequence Introducer). Only numeric parameters are read. A control sequence with more than four parameters will cause an unchecked buffer overflow. The following functions are available: A CUU Cursor Up B CUD Cursor Down C CUF Cursor Forward D CUB Cursor Back E CNL Cursor Next Line F CPL Cursor Previous Line G CHA Cursor Character Absolute [column] H CUP Cursor Position J ED Erase in Display K EL Erase in Line S SU Scroll Up T SD Scroll Down d VPA Vertical Position Absolute [row] f HVP Horizontal Vertical Position m SGR Select Graphics Rendition The only available modes for SGR are 31 to set foreground colour to red and 30,32-39 set the foreground colour to black.
  3. 4 points

    Version 1.0.0

    16 downloads

    A small intro/demo type thingy as the result of me trying to "dust off" and re-learn some 30 year old assembly. This took most of my Christmas break. Starting out I was really stumped by some of the VERA stuff: The registers, the layers, loading data, 4bpp colors, high bit addressing. But, eventually it started to make sense a bit. All this would have been impossible for me without the very helpful blogs at https://www.8bitcoding.com/ and https://justinbaldock.wordpress.com/category/retrocomputing/commander-x16/. The Vera Graphics Convertor was also very useful. I used KickAssembler for the code. I've uploaded the .asm file as well, just in case it's useful for anyone else learning this stuff. dust.asm
  4. 3 points

    Version 3.0.0

    8 downloads

    I was missing Bach's "Invention 13", and so here's my first attempt. Naturally, this will need to be debugged... I think I heard a couple bad notes in there. Then, naturally, this will need some sprite graphics... the X16 butterfly in shifting colors or something. But for now, here's the first 13 bars that Commodore Business Machines used in the early 80s.
  5. 3 points

    Version 1.0.0

    34 downloads

    CX16 port of the "MAD-COMPUTER" program published in the October 1985 issues of Mad Magazine https://archive.org/details/mad-258
  6. 3 points

    Version 1.0.1

    20 downloads

    I learned about the various screen modes of the Vera chip. As long as you reduce the number of colors to fit it all in the available video memory, high res 640x480 bitmap images are perfectly possible. 256 colors requires way too much memory though, so for simplicity sake, I reduced it all the way back to 2 colors black and white.
  7. 2 points

    Version 0.1

    5 downloads

    Here is the Mandelbrot version of my Julia Set program, coded in assembly. Again, many thanks to the forum users here for their guidance, as well as the many YouTubers with their excellent tutorials on 6502 assembly language. It's a lot faster than the BASIC version, but nevertheless, benefits from being run in warp mode. This is an uninteractive demo for the moment, but with some tweaks, I'm hoping a zoom feature will be available. Now in colour, with thanks to: VERA Overview (8bitcoding.com) NB: new version is higher res, so a bit slower! Recommend running in the desktop emulator in -warp mode. Poke around! Try copying and pasting the following groups of POKEs to explore further (not all at once, just each paragraph in turn!): POKE $D6B,$19:POKE $D6A,$64:REM FX=6500 POKE $D6D,$13:POKE $D6C,$54:REM FY=4948 POKE $D6E,$00:POKE $D6F,$FF:REM FX=POS,FY=NEG POKE $D7B,$00:POKE $D7A,$01:REM STEP=1 POKE $D7C,$FF:REM ITERATIONS=255 SYS2061 POKE $D6B,$0F:POKE $D6A,$A0:REM FX=4000 POKE $D6D,$00:POKE $D6C,$00:REM FY=0 POKE $D6E,$FF:POKE $D6F,$FF:REM FX=NEG,FY=NEG POKE $D7B,$01:POKE $D7A,$F4:REM STEP=500 POKE $D7C,$FF:REM ITERATIONS=255 SYS2061 POKE $D6B,$0F:POKE $D6A,$878:REM FX=3960 POKE $D6D,$03:POKE $D6C,$E8:REM FY=1000 POKE $D6E,$FF:POKE $D6F,$FF:REM FX=NEG,FY=NEG POKE $D7B,$00:POKE $D7A,$32:REM STEP=50 POKE $D7C,$FF:REM ITERATIONS=255 SYS2061 To use the POKES above in the web emulator, first click the X in the top right corner of the web emulator. Paste the POKES above that you want to use in to the text field to the left, replacing what's already in there, then click the Run button. Individual addresses that can be poked: $D6A 30 75 .word 30000 ; FX $D6C A8 61 .word 25000 ; FY $D6E FF .byte $ff ; FX SIGN ff = negative $D6F FF .byte $ff ; FY SIGN ff = negative $D7A A8 61 .word 25000 ; STEP (lower=higher zoom) $D7C 10 .byte $10 ; ITERATIONS Old poke codes for the colour PETSCII version: step: POKE $0D3D e.g. 50 for a step of 0.05 (smaller number, higher zoom) iterations: POKE $0D3F e.g. 30 iterations about right, higher = slower start x: POKE $0D2F, normally 8 (for -0.8) - nicely centred at low zoom start y: POKE $0D31, normally 12 (for -1.2) - again centred at low zoom Old poke codes for the PETSCII version: step: POKE $0cff e.g. 50 for a step of 0.05 (smaller number, higher zoom) iterations: POKE $0d01 e.g. 30 iterations about right, higher = slower start x: POKE $0cf1, normally 8 (for -0.8) - nicely centred at low zoom start y: POKE $0cf3, normally 12 (for -1.2) - again centred at low zoom You Tube video of this in action: Commander X16 - 6502 assembly demo - Mandelbrot set - YouTube
  8. 2 points

    Version 0.8.0.1

    14 downloads

    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. Released under the 3 clause BSD license.
  9. 2 points

    Version 1.0.0

    3 downloads

    An attempt at creating the classic raster bar effect for the CX16. This is implemented by timing the delay between changing border color exactly right to change the color on each line (in the r38 emulator). The timing may be off on the real hardware - depending on whether the emulator is exact. The source code is written in KickC, and included as an example when you download the compiler. https://gitlab.com/camelot/kickc/-/releases
  10. 2 points

    Version 0.1.0-alpha

    10 downloads

    If you have problems with the audio quality in the "Try it now", download and run in the offline emulator with the command line option "-abufs 12" or more. The CONCERTO synthesizer is what I intend to be the sound generating side of a music making software for the Commander X16. It uses the 16 voices of the PSG and aims to get the very maximum out of them. It is not quite there yet but has a lot of strengths already. The main features: 32 synth patches 16 monophonic channels, each playing a dynamically assigned synth patch up to 6 oscillators per voice up to 3 envelopes and 1 LFO per voice pitch, volume and pulse width modulation volume control per voice ("velocity") save and load presets (currently 1 slot - yee!) Features that are planned (for the sound engine): wavetables (à la MSSIAH) pitch bend dynamically assignable modulation (e.g. for influencing vibrato depth while playback) snappier envelope option somehow include the YM2151 multi step envelope generator (MSEG) I wanted to put this out here so that people can work with it, even though it is still far from finished. The reason is simple: I don't know if I will finish it and even if yes, I don't know when. What can you do with it right now? You can use the sound engine independently from the GUI, e.g. for playing music and/or sound effects in your game. You need to provide your own player at the moment, but the sounds are ready to be used by it. You could also use the GUI and reprogram it to do something completely different, i.e. use it as a template for your own application. For more information, look into the README and the source files and/or send me a PM. If you find bugs, please let me know, or post an issue on GitHub. https://github.com/biermanncarl/cx16-concerto
  11. 2 points

    Version 1.1.0

    17 downloads

    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:
  12. 2 points

    Version 0.3.3

    139 downloads

    X16 Edit is a text editor for the Commander X16 platform. Design goals: Use plain text files Store text buffer in banked RAM (512KB to 2 MB) Handle large texts efficiently Simple modeless user interface inspired by GNU Nano Implement basic editing functions well - refrain from making the program too feature-rich Support both ISO and PETSCII modes Tested with emulator version r38. Run with the following command: x16emu -sdcard sdcard.img -prg X16EDIT-x.x.x.PRG -run where x.x.x is the program version. You can also run the program with the "Try it now" button. There is, however, no attached disk in the online emulator, and consequently you cannot save or open files. Also, some of the Ctrl+key sequences are not working in the online emulator. To fully test the program you still need to download and run it locally. Please read the attached file romnotes.pdf if you want to try the ROM version. Source files available at https://github.com/stefan-b-jakobsson/x16-edit Released under GNU General Public License v 3 or later. romnotes.pdf manual.pdf
  13. 2 points

    Version 1.0.0

    29 downloads

    I wrote a library to enable BASIC programs play music in the background. It is compatible with Simplest Effects Sound library I released a while ago. To demo the library I included two BASIC programs: PLAY.BAS - Playing Twinkle Twinkle Little Star - it demonstrates the BASIC program doing other stuff including calling simple Effects HOUSE.BAS - Playing House of the Rising Sun - it demonstrates a bit more complex music Full Tutorial and source code is available from my blog: https://www.8bitcoding.com/p/music-player-library-for-basic-programs.html
  14. 2 points

    Version 1.0.0

    21 downloads

    Play a game of pool on your commander X16. Click inside the light green circle to hit the white ball around the table.
  15. 1 point

    Version 1.0.2

    2 downloads

    A simple game fully in Basic. NOTE: If you just want to run the latest version of this game on the Web based emulator do like this. 1. Copy the code from: https://raw.githubusercontent.com/JoystickAndCursorKeys/x16basic/main/fallingsnake.v2.bas.txt (CTRL-C) 2. Go here: https://www.commanderx16.com/emulator/x16emu.html and paste the code. (CTRL-V) 3. Press "Run" This (version 0 of the game) is a very little game I wrote on the commodore 64 ages ago, I changed it a little to work with vpeek, vpoke, the new color command, and the new screen resolution. To me starting with a simple game in basic is how I learned about the c64, and now the X16, before jumping in machine language. In the code for this game you can see practical examples, on how to set characters on the screen, read characters from the screen, change colors for characters, listen to the keyboard, set a screen mode. What surprised me was that I needed a delay in the code in order to have it not run too fast. This was not the case on the c64. I really like the way you can use the emulator in the browser, as it allows you to type in basic inside the browser, using "regular key mappings", and the run it. When I wanted to save it, I copy-pasted it into the installed emulator (hats off for who added he paste function there), and types the save command. This was done, because in the browser you cannot save it, and see it on disk (as far as I know) I added many REMs in the code, in order so it can be understood, and it is more of a tutorial, then a "real" game. Below I will go through the code. From line 5, the program initializes From line 9, the title screen is drawn From line 49, the game is initialized From line 199, the game loop starts From line 300, the game over screen is drawn Some miscelanious notes: The SCREEN command is used to set the screen in text mode (Petscii) 40x30 The color command is used to set character fore and background colors. Unlike the c64 each char has its own background color. There is no "global" background color CHR$(113) is used to draw the Petscii circle character, used on the title screen. Adding the actual character into the code listing, makes it hard to edit outside the emulator. CHR$(119) is another Petscii character VPOKE 0,0,x, pokes a character on the top level corner of the screen. So the text screen address = 0 (not like on the C64) On line 52 the bottom of the screen offset is calulated. NOTE: Even though the screen is 40 chars long, to get to VPOKE address of the next line, you need to add 256 bytes. SI and PI (StoneImage and PlayerImage) are Petsci chars, that are used in the game. NOTE: Petscii chars have different values in the PRINT or the VPOKE commands. Reminder: In C64/Microsoft basic a variable name is only two characters long max. Reminder: Lines in Basic should not be longer then 80 chars. When you make them longer, the emulator ignores them. A good place to see all PETSCII character codes is here: https://www.commanderx16.com/forum/index.php?/files/file/23-vera-chars/ Have fun! And the code itself: (it is easier to copy paste it in the browsers emulator and be able to modify it more easy here: https://www.commanderx16.com/emulator/x16emu.html ----- code below for copy & pasting, also you can get it by downloading FALLSNAKE.PRG or checked out at: https://github.com/JoystickAndCursorKeys/x16basic/blob/main/fallingsnake.v0.bas.txt----- 5 REM SET TO 40X30 CHARS SCREEN 6 SCREEN 0 7 HM$=CHR$(19) 9 REM TITLE SCREEN ----------------- 10 REM SET COLORS TO BLACK AND WHITE, CLEAR SCREEN 11 COLOR 1,0: CLS 12 PRINT:PRINT:PRINT:PRINT : REM PRINT TITLE 13 PRINT " FALLING SNAKE": PRINT: COLOR 15 14 PRINT " YOU ARE FALLING DOWN A HOLE" 15 PRINT " AVOID ALL OBSTACLES" 16 COLOR 7: PRINT " PRESS SPACE TO START" 17 BA$=CHR$(113):BB$=CHR$(119) : REM BALL SYMBOLS 18 COLOR 2,0 : PRINT " "+BA$ 19 PRINT " "+BA$:PRINT " "+BA$ 20 PRINT " "+BA$+BA$+BA$+BA$+BA$+BA$+BA$+BA$+BA$;:COLOR 8:PRINT BB$ 25 GET A$: IF A$="" GOTO 25 : REM WAIT FOR KEY 35 TS=0 : REM SET TOP SCORE 49 REM START GAME ----------------- 50 COLOR 1,0: CLS 51 FOR T=1TO29:PRINT:NEXT 52 BO=29*256:SI=42: : REM BOTTOMSCREENOFFSET, STONEIMAGE 53 PO=15*256:PI=81:PC=2:PX=20 : REM PLAYEROFFSET, PLAYERIMAGE, PLAYERCOLOR 54 DE=1000 : REM DELAY VALUE 55 S=0 : REM SET SCORE 199 REM GAME LOOP ----------------- 200 GET A$ 201 IF A$=CHR$(29) AND PX<40 THEN PX=PX+1 : REM GO RIGHT 202 IF A$=CHR$(157) AND PX>0 THEN PX=PX-1: REM GO LEFT 210 X=INT(RND(1)*40)*2: C=INT(RND(1)*15)+1 : REM GET RANDOM STONE POSITION 211 PE=VPEEK( 0, PO+(PX*2)) 212 IF PE=SI THEN GOTO 400 220 VPOKE 0, BO+X, SI: VPOKE 0, BO+X+1, C 221 VPOKE 0, PO+(PX*2), PI: VPOKE 0, PO+(PX*2)+1, PC 296 FOR W=1 TO DE: NEXT : REM DELAY, SLOW DOWN CODE 297 PRINT : S=S+1 : DE=DE-1 : IF DE<0 THEN DE=0 298 GOTO 200 399 REM GAME OVER ----------------- 400 IF S>TS THEN TS=S 401 PRINT HM$:PRINT:PRINT:PRINT " GAME OVER": PRINT 402 PRINT " SCORE: "+STR$(S); 405 PRINT " TOP SCORE="+STR$(TS) 410 COLOR 7: PRINT: PRINT " PRESS SPACE TRY AGAIN" : PRINT:PRINT 420 GET A$ 421 IF A$ = "" OR A$=CHR$(29) OR A$=CHR$(157) THEN GOTO 420 422 GOTO 50 ---------------------------------------------------------- End of Code First Version ---------------------------------------------------------- The way I normally work when creating a game, I create first the skeleton, and then add more and more niceties, like effects, and game play elements. Above, we have the skeleton, we have a minimal game. We have a title screen, we have a playable section, we have a score, a game over section, and a high score. Below I will show the improvements I made so far, and are saved in FALLSNAKE2. In the init section of the program, I rearranged the line numbers, so I would not overlap with the rest of the program, when adding two more lines. The added lines are in Bold/Underline. Line 3, I allocate an array called EX to store the "petscii picture" of an "explosion". It is 9 chars. The "picture" is 3x3 chars. No colors. 3x3=9, which is how much we need to allocate with the DIM command. Line 4, reads data from the DATA statements at the end of the program into the array called "EX". 0 REM SET TO 40X30 CHARS SCREEN 1 SCREEN 0 2 HM$=CHR$(19) : REM HOME CHARACTER 3 DIM EX(9) 4 FOR T=0TO8: READ C : EX(T)=C: NEXT : REM READ PETSCII EXPLOSION In the "Game over" section of the game, I added the drawing of the explosion picture, and a flashing color effect to go with it. Again, I renumbered the code around it a bit. We iterate through the characters in the EX array, by looping x and y from 0 to 2, and calculating the offset to EX (called DO, data offset). We use VPOKE to put the bytes on the screen memory, at address SO (screen offset). SO is calculated by using the xx + the player y coordinate, minus 1 (this will be XS). Similar will be done for y, but to calculate SO, we add XS*2 (each char takes two bytes) + YS*256 (from one row to the next the distance offset is 256 chars) 401 REM DRAW EXPLOSION 402 FOR XX=0TO2:FOR YY=0TO2 403 XS=XX+PX-1: YS=YY+15-1 : REM SCREEN X,Y 404 IF PX<1 THEN XS=XX+1 : REM CHECK PLAYER X TO BE ON SCREEN 405 IF PX>38 THEN XS=XX+38 406 DO=XX+(YY*3):SO=(XS*2)+(YS*256) : REM CALC DATA OFFSET, SCREEN OFFSET 407 VPOKE 0,SO,EX(DO) : REM WRITE TO SCREEN 408 NEXT:NEXT Below there is a simple color cycling effect for the background, this is done by adding random values into palette register for color 0. The register is stored in two addresses, $FA00 and $FA01. Actually some bytes are not used, but for a random effect we ignore that. If we want to have for example a red explosion flicker, we need to be more careful on the values we put into the register. 410 REM EXPLOSION COLOR EFFECT 411 FOR T=1 TO 50 412 C0=INT(RND(1)*255) 413 C1=INT(RND(1)*255) 414 VPOKE 1,$FA00,C0: VPOKE 1,$FA01,C1 415 NEXT: VPOKE 1,$FA00,0: VPOKE 1,$FA01,0 and the last part (after renumbering even more lines of code), we added the data for the explosion petscii "picture". 2000 REM PETSCI EXPLOSION 2001 DATA $4D, $20 , $4E, $20, $D6, $20, $4E, $20, $4D The complete code can be found in FALLSNAKE1.PRG, or checked out at: https://github.com/JoystickAndCursorKeys/x16basic/blob/main/fallingsnake.v1.bas.txt One thing that keeps me going when creating a game, is but adding sessions where I make the game look nicer, without adding functionality. The changes below (1.0.2 version, FALLSNAKE2.PRG), is all about this. Just Renumber it To start off, we have been renumbering again the lines of the source code. For those that are not used to using old school type basic, it is very easy to add extra code and run out of numbers. And it is important to "reserve" numbers. So for example if you make a program like this. 1 PRINT "HELLO WORLD" 2 GOTO 1 And you want to add something between line 1 and 2, you cannot do it, unless you renumber the existing lines. For that reason it is a better idea to start coding like this: 10 PRINT "HELLO WORLD" 20 GOTO 10 This way you have some space in between, and you could easily add a line 15 to print something else, if you want to. Nevertheless it can still happen even when you have reserve ranges, and they get to be "full". This is especially the case when you add new sections of verbose code between other code. And this is exactly why I am once more renumbering. -- -- -- To add sprites, you need to have the images stored some where. The old school way of doing it, is to add "DATA" commands to the code, like below. I will not write it completely here, since it becomes very verbose, but it looks something like this: 11000 DATA $00, $00, $22, $22, $22, $22, $00, $00 11001 DATA $00, $22, $82, $82, $82, $82, $22, $00 11002 DATA $02, $88, $88, $28, $28, $28, $28, $20 11003 DATA $28, $08, $08, $22, $22, $22, $82, $8b 11004 DATA $28, $88, $88, $20, $00, $28, $28, $b0 11005 DATA $02, $82, $82, $00, $02, $82, $8b, $00 11006 DATA $00, $22, $20, $00, $28, $22, $b0, $00 ..... Many more lines of this NOTE: Only in the 80s would you type in lines and lines of DATA like this. Now there are easier ways, for example a sprite editor with an export function. There is many options, below is one of them. The important thing is to export to a sprite data that the X16 understands. In this case 16x16 dimensions, 16 colors, so 4bpp (4 bits per pixel for color info), and basic support HEX numbers. And to use them, you write something like this. 1000 REM READ SPRITE DATA 1001 FOR I=O TO 255 1011 READ PX : REM READ ONE NUMBER FROM THE DATA. 1012 VPOKE $0,$4000+I,PX: REM USE VPOKE TO MOVE THE DATA IN VIDEO MEMORY 1013 NEXT I 1014 RETURN At the end of these lines of code, you see the command RETURN. What is this about? Well, with basic we can simulate calling a function/subrouting, with GOSUB. RETURN returns back to where it was called. The code is being called in the beginning, something like this: 10 GOSUB 1000 : REM READ SPRITE DATA After the call to the subroutine at line 1000, it continues to the next line. This is one way to organize the code inside Commodore/Micro$oft basic. I will not mention all the details of setting up the sprite here, you can check the code yourself, if you want to. Later I will go deep into this topic, but not here. However to get the sprite in the right position we have another subroutine. 1070 REM SET SPRITE 0,X0,Y0 1171 VPOKE $1,$FC12,X0 AND $FF 1172 VPOKE $1,$FC13,(X0 AND $0300)/$100 : REM MAGIC TO GET HI BYTE OF THE X COORDINATE 1173 VPOKE $1,$FC14,Y0 : REM YPOS 128 1174 VPOKE $1,$FC15,$00 : REM WE DON'T CALCULATE THE HI BYTE OF THE Y COORDINATE 1175 RETURN Which I call in the title screen build up like this. 75 X0=150: Y0=68: GOSUB 1070 : REM SET SPRITE X,Y Note that for calling the subroutine with parameters, we simply assign global variables. To keep from clashing with other global variables, use a naming convention. Here I used 0 (zero) as the second 'letter' in the name as the naming convention. In the game, the position changes all the time, so instead we do like this: 295 X0=PX*8: Y0=122: GOSUB 1070 : REM SET SPRITE X,Y X0 is calculated. Y0 is static, but X0 is PlayerX (PX) times 8 (the width of a character on screen in bits) Color effect Now for the colour effect, we chose one color to be the one that has the effect, and we draw our blinking characters with this color. Like below. 60 PRINT "FALLING SNAKE";: COLOR 14: PRINT "**": PRINT: COLOR 15 And we cycle / blink, by doing something like this. 80 C0=C0+1: IF C0>2 THEN C0=0: C1=C1+1: IF C1>255 THEN C1=0: 82 VPOKE 1,$FA1C,C1: VPOKE 1,$FA1D,C1 Offset $FA1C and $FA1D in the VERA video ram, control the palette registers for color 14. Each color has two bytes, so if you want to find the color register for color 0, you just substract 28 decimal (2*14) from hex $FA1C. (Convert 28 to hex first) Feel free to check out the code or the PRG file, at this stage. Code: https://github.com/JoystickAndCursorKeys/x16basic/blob/main/fallingsnake.v2.bas.txt PRG file: FALLSNAKE2.PRG -- In the next session we will concentrate a bit more on gameplay. It is no use to pimp up the graphics, if the gameplay is boring. Since this is really a simple game, we easily can do a few things to spice it up. more coming soon..
  16. 1 point

    Version R37

    35 downloads

    BASIC demo for using a sprite (now using R37 ROM) to haunt all the text it goes over. As seen on YouTube:
  17. 1 point

    Version 1.1

    359 downloads

    This is a Breakout/Blockout/Arkanoid inspired game. . It is my very first try on the X16. You have to use a mouse or a joystick (cursor keys + enter on the emulator) It's only tested it on the emulator (R37, R38), so if anyone of the few with real hardware can give it a go, I'm eager to know the result. Available power ups (no keycodes, you have to catch the dropping badges): [L]: adds one live to player [M]: paddle is magnetic for 30 seconds. Can only hold one ball at a time. [C]: twin laser cannon for 15 seconds, 16 rounds in a row (if you are quick). [D]: Duplicates ball, so now you can have fun with 2... Keyboard commands: 's': sound on/off. 'q': quit game. How to use with the local emulator: Unpack ZIP file into the same directory as the emulator. Start the emulator, then enter LOAD"BRIXX.PRG" RUN Or use the "Try now" button. Let me know what you think...
  18. 1 point

    Version 1.0.0

    2 downloads

    IRClock shows a digital clock in the upper right corner of the screen. This way it is possible to keep an eye on the clock even while being productive on the Commander X16. The program copies it self into golden RAM, starting at $0400 and takes up a total of 195 bytes. After initialization, the program does not need any of the memory usually used for BASIC and can be overwritten. When the program is running, the current hour, minute and second can be poked into addresses $400, $401 and $402 respectively. The values must be BCD encoded which essentially means, just poke them in as hexadecimal values i.e. 11:04 would be poke'd in like this: Result is immediately visible.
  19. 1 point

    Version 1.0.1

    83 downloads

    This is a minesweeper clone for the Commander X16. It allows custom minefield sizes up to 38x24, with almost any amount of mines. To start, load and run MINEX16.PRG. Controls: Main Game Left click to reveal a tile Right click to flag a tile Click on the face to reset Press space to open the configuration screen (will reset the minefield) To exit, reset the machine (Ctrl-R on the emulator) Configuration Space to open and close Use the + and - buttons next to each digit to change the width, height, and number of mines Numbers are capped to a specific range; attempting to select an invalid value will set the number to its maximum or minimum value Click any of the presets to set all of the numbers at once Note: The game uses kernal functions to handle the mouse, so any weirdness is most likely caused by the emulator.
  20. 1 point

    Version 0.0.4

    3 downloads

    *** THIS FILE IS ALSO NOW IN THE DEMO SECTION TO ENABLE THE "TRY IT NOW" FEATURE *** This may be of interest to absolute 6502 assembly beginners like me, although advanced 6502 programmers may cringe at the way I've done things here! This program does very little, but it is a repository of useful assembly routines for things like printing different bytes of memory (useful for debugging) as well as some basic math operations. I will keep adding to this as I progress through my assembly journey (I'm aiming to write my fractal BASIC programs in assembly). Thanks to the following YouTubers for their excellent tutorials on all things 6502: Ben Eater - YouTube Matt Heffernan - YouTube ChibiAkumas - YouTube (and also his excellent website: Assembly Tutorials: Learn 6502 Assembly Programming... With ChibiAkumas!) Function usage: (notation for cc65 assembler) jsr print .byte (list of PETSCII character codes to print, ending in a $0 byte) jsr println .byte (list of PETSCII character codes to print, ending in a $0 byte) jsr print_mem .word (start address of memory dump) Set MEMDUMPLEN to the number of addresses you wish print_mem to display.
  21. 1 point

    Version 0.0.2

    17 downloads

    This is a quick and dirty Mandelbrot set demo written in Commander X16 BASIC. I strongly suggest using the emulator's -warp option to speed things up a bit! I plan to make this a bit more user friendly, and include more options for zooming, changing colours etc. But for now, enjoy the fractal action!
  22. 1 point

    Version 1.0.0

    28 downloads

    LIFE.PRG is an implementation of Conway's Game of Life compatible with the Commander X16 Emulator R38 (see https://en.wikipedia.org/wiki/Conway's_Game_of_Life). Configuring the Grid Dimensions: D - Toggles the grid dimensions between 29x29 (which is the default), 30x30, 59x59, and 60x60 options. The cell grid is always configured as a perfect square to permit more degrees of symmetry. Odd and even dimensions are both supported since they have different symmetry. The dimension of the length and width is illustrated in the upper right corner of the display. The 29x29 and 30x30 grid dimensions utilize 40x30 text mode, whereas the 59x59 and 60x60 grid dimensions utilize 80x60 text mode. The grid is cleared when the cell grid dimensions are changed. Initializing the Cell Grid: C - Clears all of the grid cells. E - Enters edit mode to manually configure the grid cells. The cursor keys are used to move the cursor pointer, the space bar toggles the state of the cell at the current cursor position, and E key is used to exit edit mode. In edit mode the row and column coordinates of the cursor are displayed in the upper left corner in the format "row,column". The mouse cursor is reused as a cursor pointer but the mouse is not currently supported. R - Randomizes the grid cells. H - Randomizes the grid with horizontal symmetry. V - Randomizes the grid with vertical symmetry. B - Randomizes the grid with both horizontal and vertical symmetry. F - Randomizes the grid with full symmetry (horizontal, vertical, and both diagonals). The edit mode entered by pressing the E key can be used to configure different patterns such as still-lifes, oscillators, and space ships (some of which are described at https://en.wikipedia.org/wiki/Conway's_Game_of_Life#Examples_of_patterns). The H, V, B, and F symmetrical configuration options generally result in more visually appealing patterns than the R configuration option. Iterating the Grid: U - Updates the grid a single time. S - Starts repetitive update of the grid, press S a second time to stop. The number of iterations performed on the cell grid is displayed in the upper left corner except in cell grid edit mode described above. The iteration count is initialized to zero at startup and reset to zero when the grid dimensions are changed via the D key or any of the grid initialization commands are executed (via the C, E, R, H, V, B, or F keys). When iterating the grid the left and right sides of the cell grid are considered to be adjacent as well as the top and bottom resulting in a toroidal array. Potential Future Enhancements: There are several potential future enhancements under consideration such as optimization to speed up the iteration of the cell grid, context-sensitive help, support for user-configurable grid sizes, support for multiple colors (e.g. based on state of a cell and the number of live neighbors), and support for other life-like cellular automaton (see https://en.wikipedia.org/wiki/Life-like_cellular_automaton). Life Video
  23. 1 point

    Version 0.4

    183 downloads

    A game where you have to visit all fields in a maze with your "block". For the latest version and to see the source, go to https://github.com/JimmyDansbo/cx16-maze
×
×
  • Create New...

Important Information

Please review our Terms of Use