Jump to content

Space Flight 1.0.2

   (1 review)

1 Screenshot

About This File

This is a game in progress. Gradually I'll update this game as it progresses, but currently this is a non-playable game.

You can find the complete code of this game here: X16_Code/cx16-spaceship at main · FlightControl-User/X16_Code (github.com)

You can try this game out in two ways:

  • Download all files in a folder, and run the space.prg from that folder running x16emu -prg space.c -run.
  • Download the X16.VHD into a folder, and run x16emu -sdcard x16.vhd. run the game by loading space.prg and run it.


What's New in Version 1.0.2   See changelog


Optimized the logic to:

  • Load graphics with own graphics loading code, calling CBM kernal routines in the CX16.
void cbm_k_setlfs(char channelchar devicechar secondary);
void cbm_k_setnam(charfilename);
char cbm_k_open();
char cbm_k_close(char channel);
char cbm_k_chkin(char channel);
void cbm_k_clrchn();
char cbm_k_chrin();
char cbm_k_readst();
  • Created functions as part of the veralib.h to set the attributes of the vera sprites.
void create_sprites_enemy2() {
    dword enemy2_sprite_address = VRAM_ENEMY2;
    byte const base = 12;
    for(byte s=0;s<NUM_ENEMY2;s++) {
        Enemy2Sprites[s] = enemy2_sprite_address;
        vera_sprite_xy(s+base40+((word)(s&03)<<6), 340+((word)(s>>2)<<6));
        enemy2_sprite_address += 32*32/2;
  • Optimized the zeropage addressing to reduce the amount of zeropage used.
  • Optimized the way the address is calculate from the dword address to set sprite addresses.
  • Created cx16_load_ram_banked routine, that can load sprites directly into the banked ram of the CX16!
char status = cx16_load_ram_banked(180FILE_SPRITES, (dword)BANK_PLAYER);
    if(status!=$ff) printf("error file_sprites: %x\n",status);
  • Created cx16_ram_bank to select the bank of banked ram from A000 to BFFF.
  • Created bnkcpy_vram_address function, to copy from CX16 banked ram (A000 to BFFF) directly into the vera VRAM.
// Copy graphics to the VERA VRAM.
    bnkcpy_vram_address(VRAM_PLAYERBANK_PLAYER, (dword)32*32*NUM_PLAYER/2);





Space.prg -sdcard x16.vhd
  • Like 5

User Feedback

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.


Jesper Gravgaard


That looks really smooth!

It also looks like the beginning of an interesting game.


Share this review

Link to review
  • Create New...

Important Information

Please review our Terms of Use