Dead Hackers Society
 
 
 

68k Inside

Sommarhack 2024

Silly Venture 2024 SE

 

VBCC/VASM for Mac OS X with lowlevel libs for Atari cross development


News

2012-10-13: Upgraded Falcon demosystem to v18
2009-02-04: Initial release (v0.1) of our VBCC/VASM package
2009-02-02: Initial release (v0.1) of the lowlevel screen access library

 

About

This is a Mac OS X devkit for developing lowlevel Atari TOS applications using the excellent portable and retargetable ISO/ANSI C compiler VBCC. We have compiled the vbcc-0.9 package for the Motorola 68k CPU target with the vasm assembler and vlink linker configured for Atari TOS targets. This SDK also features a simple lowlevel library for opening a non system friendly screen and setting up some useful interrupts for screen handling.
 

Install

To install VBCC/VASM for Atari cross development you need to know a little about using the terminal tools.
It's not too hard and the package can in fact be installed quite easily.
When we write "username" in the paths, please replace that with your real username.
sudo might also ask you for your password.
  1. Download the VBCC/VASM cross development package below.
  2. Unpack the package (we assume you depack it at the Desktop).
  3. Open a shell (terminal window).
  4. Change to the root directory
    cd /
  5. Copy the configuration file
    sudo cp /Users/username/Desktop/vbcc_ataritos_osx/etc/vc.config /etc/
  6. Check if we have an "opt" directory
    ls -l
  7. If there is an "opt" directory, skip the next step.
  8. Create the opt directory
    sudo mkdir opt
  9. Copy VBCC/VASM and it's libs
    sudo cp -R /Users/username/Desktop/vbcc_ataritos_osx/opt/vbcc /opt/
  10. Start the nano editor with your .profile loaded
    nano /Users/username/.profile
  11. Add these two lines and save the file
    export PATH=/opt/vbcc/bin:$PATH
    export VBCC=/opt/vbcc
You are now finished, if you want to try if VBCC/VASM is working you need to reload the .profile (source /Users/username/.profile) or close the terminal window and reopen a new console.
 

Video of installing and building the assembler SDK

You can download the video if you don't have a recent Flash player installed.
 

 

Using VBCC/VASM with Xcode

This is fairly simple, you just need to create the project in Xcode in a certain way and then add a couple of lines to your Makefile.
We assume that your project is compiling/assembling fine from commandline with a regular Makefile.
  1. First we create a new project in Xcode, select "External build system" as project type.
  2. Give the project a name that fits in 8+3 characters if you want TOS to be able to read the directory.
  3. Now that the project is created, rightclick it's name in the menu pane and select info. Change build path to the same path as your project, to avoid that Xcode creates additional directories that TOS will have problems to read.
  4. Copy your code and Makefile to the Xcode project directory.
  5. Edit your Makefile and add these two lines at the top
    PATH := ${PATH}:/opt/vbcc/bin
    VBCC := /opt/vbcc
You are now finished. Pressing the "build" button in Xcode should create an Atari executable. For obvious reasons, the "Build and go" command will not work.
 

C SDK

The low level SDK for screen access recognizes the following calls:
 
int screen_init(); /* Shut off the system */
void screen_restore(); /* Restore the system */
void screen_swap(); /* Swap the triple buffered screen */
void video_320_200_4(); /* Open a 320x200x4 screen */
void video_320_240_8(); /* Open a 320x240x8 screen */
void c2p_6pl(); /* Perform a 6 plane chunky to planar conversion */
void setpalette(char *); /* Set the palette from palette_256[] */
void screen_clear_8bit(); /* Clear the screen */
short int * malloc_stram(); /* Malloc 320x240 bytes st ram */
void set_timerB(); /* Initialize the timer B */
void restore_timerB(); /* Restore the timer B */
char chk_space(); /* Returns !=0 if if the user has pressed space. */

See the sources below for additional calls and an example of how to use the library. An executable is also provided in the archive.
 

Assembler SDK (Falcon Demosystem v18)

  • This is simply an updated version of our Falcon demosystem that have been available for several years. This version brings support for parameters to main/timer/vbl routines to ease up variations in effects.
  • The sourcecode has been cleaned up a bit (main.s is fairly clutter free) and a main demosystem parameter to make sure init parts are only run once have been added as well. To end with the music players are updated to work with 68060 and ACE Tracker have been added.
  • At the beginning of main.s is an equ switch for switching between VASM and Devpac modes.
  • Makefile included ready to be used from commandline or directly from Xcode.

Downloads


 

Updated: October 13, 2012
»  gizmo(at)dhs.nu
»  ae(at)dhs.nu
© 1994-2024 Dead Hackers Society Contact: Anders Eriksson