oscar64(1)

πŸ“¦
version 1.32.273 Β· 2 versions
, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay bestie, this is oscar64(1) from the User Commands manual, and the NAME line is literally: oscar64 β€” optimizing C/C++ cross-compiler for 6502 systems. That’s the whole vibe. ✨

🌈 SYNOPSIS 🌈

oscar64 [-h] [-v[1|2|3]] {-i=includePath} [-ii=includePath]
       [-o=output.prg] [-rt=runtime.c] [-tf=format] [-tm=machine] [-pp]
       [-strict] [-psci] [-n|-bc] [-e[p|t|b|a|i]] [-g[p]] [-O(0|1|2|3|s)]
       [-O(i|ii|a|z|p|o|x|g|m)] [-dSYMBOL[=value]] [-DSYMBOL[=value]] [-xz]
       [-rmp] [-d64=diskname] [-f=file] [-fz=file] [-fi=n] [-cid=n] [-csub=n]
       [-cname=name] {source.c} {source.cpp}

πŸŽ€ DESCRIPTION πŸŽ€

oscar64 is a C/C++ compiler for the 6502 processor family. It is designed to generate high-performance 8-bit code targeting platforms such as the Commodore 64, VIC-20, PET, Commander X16, NES, Atari 8-bit, and Mega65. High-performance 8-bit code, bestie β€” that’s the whole point. πŸ’…

✨ OPTIONS ✨

🫢 General Options

  • -h β€” Print help text and exit. Like a little β€œwhat do I do now?” button. πŸ’–
  • -i=includePath β€” Set the include file search path.
  • -ii=includePath β€” Set the default include path (overrides built-in path).
  • -o=output.prg β€” Specify output file name.
  • -rt=runtime.c β€” Use a custom runtime startup source (or empty for none).
  • -pp β€” Compile in C++ mode (automatically enabled for .cpp files).
  • -strict β€” Use strict ANSI C parsing (no C++ extensions).
  • -psci β€” Use PETSCII encoding for all string literals without prefix.
  • -xz β€” Extended zero page usage. Provides more zero page space but disables return to BASIC. More space, but no cozy return-to-BASIC moment β€” noted.
  • -rmp β€” Generate error files (.error.map and .error.asm) when the linker fails.

🧚 Symbol Definitions

  • -dSYMBOL[=value] β€” Define a preprocessor symbol (like -D in other compilers).
  • -DSYMBOL[=value] β€” Define a symbol in a gcc-compatible way (e.g., -D NAME=VALUE as a separate argument).

πŸ”₯ Code Generation

  • -n β€” Create pure native code for all functions (now the default).
  • -bc β€” Create byte code for all functions (disables native code generation).
  • -e β€” Execute the result in the integrated emulator after compilation.
  • -ep β€” Execute and profile the result in the integrated emulator.
  • -et β€” Execute with trace output in the integrated emulator.
  • -eb β€” Execute with break trace in the integrated emulator.
  • -ea β€” Execute with asserts enabled in the integrated emulator.
  • -ei β€” Execute with I/O range checking in the integrated emulator.

πŸ‘‘ Optimization

  • -O0 β€” Disable all optimizations.
  • -O1 or -O β€” Default optimizations.
  • -O2 β€” Aggressive speed optimizations (includes auto-inline of small functions).
  • -O3 β€” Aggressive optimization for speed (includes all sub-optimizations).
  • -Os β€” Optimize for code size.
  • -Oi β€” Enable auto-inline of small functions (part of O2/O3).
  • -Oii β€” Enable aggressive auto-inline of all suitable functions.
  • -Oa β€” Optimize inline assembler (part of O2/O3).
  • -Oz β€” Enable auto-placement of global variables in zero page (part of O3).
  • -Op β€” Optimize constant parameters.
  • -Oo β€” Optimize size using "outliner" (extract repeated code sequences into functions).
  • -Ox β€” Optimize pointer arithmetic by blocking shorter arrays from crossing page boundaries.
  • -Og β€” Enable global optimization.
  • -Om β€” Enable merge calls optimization.

🌸 Debug and Diagnostics

  • -v β€” Enable verbose output for diagnostics.
  • -v2 β€” More verbose output.
  • -v3 β€” Even more verbose output (implies v2).
  • -g β€” Create source-level debug info and add source line numbers to .asm listing.
  • -gp β€” Create source-level debug info and static profile data.

πŸ¦‹ Target Format

  • -tf=format β€” Set the output target format.
    • prg β€” Standard Commodore PRG format (default).
    • crt β€” EasyFlash cartridge format.
    • crt8 β€” Generic 8KB cartridge (0x8000-0xa000).
    • crt16 β€” Generic 16KB cartridge (0x8000-0xc000).
    • bin β€” Raw binary format.
    • lzo β€” LZO-compressed PRG output.

πŸ’œ Target Machine

  • -tm=machine β€” Specify the target machine.
    • c64 β€” Commodore C64 (0x0800..0xa000, default).
    • c128 β€” Commodore C128 (0x1c00..0xfc00).
    • c128b β€” C128 first 16KB only (0x1c00..0x4000).
    • c128e β€” C128 first 48KB only (0x1c00..0xc000).
    • plus4 β€” Commodore Plus/4 (0x1000..0xfc00).
    • vic20 β€” VIC-20, no expansion (0x1000..0x1e00).
    • vic20+3 β€” VIC-20 +3K RAM (0x0400..0x1e00).
    • vic20+8 β€” VIC-20 +8K RAM (0x1200..0x4000).
    • vic20+16 β€” VIC-20 +16K RAM (0x1200..0x6000).
    • vic20+24 β€” VIC-20 +24K RAM (0x1200..0x8000).
    • pet β€” Commodore PET, 8K RAM (0x0400..0x2000).
    • pet16 β€” Commodore PET, 16K RAM (0x0400..0x4000).
    • pet32 β€” Commodore PET, 32K RAM (0x0400..0x8000).
    • nes β€” NES NROM, 32K ROM, no mirror.
    • nes_nrom_h β€” NES NROM, 32K ROM, horizontal mirror.
    • nes_nrom_v β€” NES NROM, 32K ROM, vertical mirror.
    • nes_mmc1 β€” NES MMC1 mapper, 256K PROM, 128K CROM.
    • nes_mmc3 β€” NES MMC3 mapper, 512K PROM, 256K CROM.
    • atari β€” Atari 8-bit systems (0x2000..0xbc00).
    • x16 β€” Commander X16 (0x0800..0x9f00).
    • mega65 β€” Mega65 (0x2000..0xc000).

πŸ“ Disk Image

  • -d64=diskname β€” Create a .d64 disk image with the specified name.
  • -f=file.xxx β€” Add a binary file to the disk image.
  • -fz=file.xxx β€” Add a compressed binary file to the disk image.
  • -fi=n β€” Set sector interleave for data files on disk image (default: 10).

πŸŽ€ Cartridge Options

  • -cid=n β€” Set cartridge type ID (used by VICE emulator).
  • -csub=n β€” Set cartridge sub-type.
  • -cname=name β€” Set cartridge name string.

πŸ’– RUNTIME LIBRARY DEFINES πŸ’–

  • -dNOLONG β€” Disable support for long integers in printf.
  • -dNOFLOAT β€” Disable floating-point support in printf.
  • -dHEAPCHECK β€” Enable heap allocation/free checking; jam if heap is full or free out of range.
  • -dNOBSSCLEAR β€” Do not clear BSS segment on startup.
  • -dNOZPCLEAR β€” Do not clear zero-page BSS segment on startup.

🌟 EXAMPLES 🌟

Compile a program with optimizations:

oscar64 -i=include -O2 -o=demo.prg demo.c

Compile with emulator execution and custom runtime:

oscar64 -e -rt=startup.c -f=assets.dat game.c

Create a disk image with compiled output:

oscar64 -d64=mydisk.d64 -f=demo.prg demo.c

Compile in C++ mode with maximum optimization:

oscar64 -pp -O3 -o=demo.prg demo.cpp

🧚 FILES 🧚

  • /nix/store/3ja2prlv2pld7z2khswfy7lpwaq4riwx-oscar64-1.32.273/bin/oscar64 β€” Main compiler executable.
  • /nix/store/3ja2prlv2pld7z2khswfy7lpwaq4riwx-oscar64-1.32.273/include/oscar64 β€” Headers and startup runtime source.

πŸ‘€ SEE ALSO πŸ‘€

llvm-mos(1)


mwah πŸ’‹ that’s the whole page, bestie. This was oscar64(1), Version 1.32, dated June 2026 β€” version 1.32, June 2026, oscar64(1), periodt. πŸ«Άβœ¨πŸŽ€

πŸ“¦ where this page comes from