Export & Code Generation

Generate production-ready C and assembly code for your Amiga toolchain.

C Compilers

Miggy Draw generates C code compatible with all major Amiga C compilers. Each toolchain has slightly different syntax for chip memory qualification and data types.

VBCC

The Volker Barthelmann C Compiler is a popular modern choice for Amiga development.

// VBCC chip memory syntax
__chip UWORD sprite_player[] = {
    /* sprite data */
};

Compile with:

vc +kick13 -c99 -O2 -o game game.c graphics.c

GCC (m68k-amigaos)

The GNU Compiler Collection cross-compiled for Amiga targets.

// GCC chip memory syntax
UWORD __chip sprite_player[] = {
    /* sprite data */
};

Compile with:

m68k-amigaos-gcc -noixemul -O2 -o game game.c graphics.c

SAS/C (Lattice C)

The classic commercial Amiga C compiler, still used for compatibility with vintage projects.

// SAS/C chip memory syntax
__chip UWORD sprite_player[] = {
    /* sprite data */
};

Compile with:

sc link game.c graphics.c

Assemblers

For assembly projects, Miggy Draw exports data as dc.w directives with appropriate section declarations.

vasm

The versatile assembler supports multiple syntax flavors. Miggy Draw uses Motorola syntax.

    section data_c,data_c

    xdef _sprite_player
_sprite_player:
    dc.w $6060,$0000  ; control words
    dc.w $0180,$0180  ; pixel data
    ; ...

Assemble with:

vasmm68k_mot -Fhunk -o graphics.o graphics.s

PhxAss

The Phoenix Assembler, popular for demos and games.

    SECTION graphics,DATA_C

    XDEF _sprite_player
_sprite_player
    DC.W $6060,$0000
    DC.W $0180,$0180

AsmOne

The classic Amiga assembler with its own syntax conventions.

    SECTION graphics,DATA_C

sprite_player:
    dc.w $6060,$0000
    dc.w $0180,$0180

Export Options

Customize code generation from the Export dialog:

Option Description
Include Sprites Export hardware sprite data
Include BOBs Export BOBs with bitplane separation and masks
Include Bitmaps Export bitmap graphics
Include Fonts Export bitmap font data
Include Animations Export animation structures
ASCII Art Comments Add visual preview of graphics in comments
Size Optimization Remove redundant data, compact output
Data Alignment Align data to word/longword boundaries
Tip

Enable ASCII Art Comments during development to see your graphics in the source code, then disable for release builds to reduce file size.

Code Reference

Understanding the generated code structures:

Sprite Structure

// Header macros
#define SPRITE_PLAYER_WIDTH 16
#define SPRITE_PLAYER_HEIGHT 21

// Sprite data with control words
extern UWORD sprite_player[];

BOB Structure

// Separate bitplane arrays
extern UWORD __chip bob_enemy_plane0[];
extern UWORD __chip bob_enemy_plane1[];
extern UWORD __chip bob_enemy_mask[];

#define BOB_ENEMY_WIDTH 32
#define BOB_ENEMY_HEIGHT 24
#define BOB_ENEMY_DEPTH 2

Animation Structure

typedef struct {
    UWORD frameCount;
    UWORD *frameDurations;
    void **frames;
    BOOL looping;
} AnimationAsset;

extern AnimationAsset anim_walk;

Continue to Advanced Features to learn about Lua scripting and automation.