New targets: help (default) — show usage (was the -help/--help equivalent) compile — compile main.c → build/nyuller.prg run — compile + run in oscar64 built-in emulator run-vice — compile + run in VICE x64 (foreground) run-vice-cycle — compile + run in VICE x64sc (cycle-exact) play — compile + launch VICE x64 detached play-cycle — compile + launch VICE x64sc detached kill — kill any detached VICE clean — remove build/ artifacts build/nyuller.d64 — build the .d64 disk image from the .prg Optimization: override with 'make OPT=O3' (or O0/O1/O2/Os/g). Default is -O1 (oscar64 default). The Makefile builds oscar64 automatically if missing, uses c1541 to create the .d64 with verification, and passes -drive8type 1541 to VICE (required for autostart). Removed src/build.sh and updated all docs (README, tasks.md, AGENT_CONTEXT.md, GAME.md, helloworld.c) to reference make.
23 lines
629 B
C
23 lines
629 B
C
// helloworld.c — minimal C64 program in C with Oscar64
|
|
//
|
|
// Builds a .prg that prints "Hello World" on the C64 text screen and exits.
|
|
//
|
|
// Build: make compile
|
|
// Run: make run
|
|
|
|
#include <stdio.h>
|
|
|
|
int main(void)
|
|
{
|
|
// CHR$(147) is PETSCII "clear screen" — same as printf("\f") in C but
|
|
// emitted as the right byte for the C64's PETSCII character set.
|
|
putchar(147);
|
|
|
|
// The p"" prefix tells Oscar64 to emit the string as PETSCII, not ASCII.
|
|
// Without it the C64's character ROM would render garbage because the
|
|
// character generator maps 'H' to PETSCII 8, not ASCII 72.
|
|
printf(p"Hello World\n");
|
|
|
|
return 0;
|
|
}
|