Quellcode durchsuchen

Add Power C hello example, update AGENTS index, powerc-build and graphics skill

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
main
Daniel Covington vor 1 Woche
Ursprung
Commit
22716e21d8
5 geänderte Dateien mit 70 neuen und 9 gelöschten Zeilen
  1. +19
    -2
      AGENTS.md
  2. +3
    -1
      examples/powerc-build.bat
  3. +42
    -0
      examples/powerc-hello.c
  4. BIN
      examples/powerc-hello.d81
  5. +6
    -6
      skills/graphics-vic2/SKILL.md

+ 19
- 2
AGENTS.md Datei anzeigen

@@ -3,7 +3,7 @@
> **Assembled by a collective of 150 expert Commodore 64 developers.**
> This file is the primary reference for AI agents assisting with Commodore 64 application development.
> Core C64 platform knowledge is sourced from canonical reference books (see Sources below).
> Supplemental modern emulator workflow guidance is included for **VICE 3.10** from `C:\Program Files\GTK3VICE-3.10-win64\doc\vice.txt`.
> Supplemental modern emulator workflow guidance is included for **VICE 3.10** from the manual installed as `C:\Program Files\GTK3VICE-3.10-win64\doc\vice.pdf` (copy kept at `reference/vice.pdf`).

---

@@ -39,17 +39,34 @@ This repository contains structured skills and reference material for developing
| `reference/cia-registers.md` | CIA 6526 register map |
| `reference/disk-dos-commands.md` | 1541 DOS command reference |
| `reference/vice-usage.md` | VICE 3.10 emulator, monitor, autostart, and automation reference |
| `reference/vice.pdf` | VICE 3.10 manual as shipped with the emulator |
| `reference/POWERc.d81` | Power C compiler, libraries, and headers (copy before writing to it) |
| `reference/Power_C_Instruction_Manual.pdf` | Power C Instruction Manual (Spinnaker, 1986) |

### Example Programs

| File | Description |
|------|-------------|
| `examples/hello-world.asm` | Minimal 6510 assembly hello world |
| `examples/bitmap-demo.asm` | Hi-res 320×200 bitmap mode: draws a diagonal line, key returns to text mode |
| `examples/sprite-demo.bas` | BASIC sprite programming demo |
| `examples/sprite-music-demo.bas` | Multicolor sprite moving to a SID bass line |
| `examples/sound-demo.bas` | SID chip sound demo in BASIC |
| `examples/disk-access.bas` | Sequential and relative file access |
| `examples/irq-handler.asm` | Custom IRQ handler skeleton |
| `examples/kernal-io.asm` | Using Kernal routines for I/O |
| `examples/moonlander.c` | Lunar Lander game in C (cc65), joystick control |
| `examples/moonlander.prg` | Built `moonlander.c` binary |
| `examples/moonlander-build.bat` | Build `moonlander.c` with `cl65`; `-run` also launches it |
| `examples/run.bat` | Rebuild if needed, then autostart `moonlander.prg` in VICE |
| `examples/linked-list-test.c` | `malloc`-backed linked list tests plus a heap capacity probe (cc65) |
| `examples/linked-list-test.prg` | Built `linked-list-test.c` binary |
| `examples/linked-list-test-build.bat` | Build `linked-list-test.c` with `cl65`; `-run` also launches it |
| `examples/powerc-hello.c` | Minimal Power C program; ASCII source converted to PETSCII for the disk |
| `examples/powerc-hello.d81` | Power C work disk with `hello.c` compiled, linked, and ready to run |
| `examples/powerc-work.d81` | Writable working copy of the Power C system disk |
| `examples/powerc-build.bat` | Run a Power C Shell command sequence on a work disk via `-keybuf` |
| `examples/powerc-ced.bat` | Boot the Power C system disk and enter the `ced` editor |
| `examples/vice-autostart-c64os.bat` | Launch `c64os.prg` directly in `x64sc` |
| `examples/vice-monitor-c64os.txt` | VICE monitor playback script for debugging `c64os.prg` |
| `examples/vice-debug-c64os.bat` | Launch `c64os.prg` with VICE native monitor and debug-friendly options |
@@ -194,7 +211,7 @@ This knowledge base was compiled from these canonical references:

### Supplemental Emulator Source

12. **VICE 3.10 Manual** — `C:\Program Files\GTK3VICE-3.10-win64\doc\vice.txt`
12. **VICE 3.10 Manual** — `C:\Program Files\GTK3VICE-3.10-win64\doc\vice.pdf` (copy: `reference/vice.pdf`)
- Use for emulator operation, autostart behavior, monitor commands, snapshots, and automation interfaces

---


+ 3
- 1
examples/powerc-build.bat Datei anzeigen

@@ -1,8 +1,10 @@
@echo off
setlocal
REM Usage: powerc-build.bat "shell commands" (use \n for RETURN)
REM Usage: powerc-build.bat "shell commands" [disk.d81] (use \n for RETURN)
set "VICE_EXE=C:\Program Files\GTK3VICE-3.10-win64\bin\x64sc.exe"
set "D81=%~dp0powerc-work.d81"
REM Optional second argument selects another work disk image
if not "%~2"=="" set "D81=%~2"
set "CMDS=%~1"
if "%CMDS%"=="" set "CMDS=cc squares\n"
"%VICE_EXE%" -8 "%D81%" -autostart "%D81%:shell" -autostart-warp -warp -keybuf "%CMDS%"

+ 42
- 0
examples/powerc-hello.c Datei anzeigen

@@ -0,0 +1,42 @@
/* powerc-hello.c - first program for Power C on the C64
*
* Prints a small table and demonstrates 16-bit int wrap-around,
* so it exercises printf(), a counting loop and int arithmetic.
*
* Build on the Power C disk (examples/powerc-hello.d81 already holds
* the compiled result):
*
* cc hello.c
* link -s
* > hello.o
* > ^ (pull in stdlib.l + syslib.l)
* > (empty RETURN)
* output file name: hello
*
* This file is plain ASCII; Power C needs PETSCII source with CR line
* endings, so convert it before writing it to the image:
*
* c1541 powerc-hello.d81 -write hello.pet "hello.c,s"
*
* Then run it with -autostart "powerc-hello.d81:hello", or from BASIC:
* LOAD"HELLO",8 : RUN
*/

#include <stdio.h>

main()
{
int i, v;

printf("power c on the c64\n");
printf("==================\n\n");

for (i = 1; i <= 5; i++) {
v = i * i;
printf("%d squared is %d\n", i, v);
}

v = 32767;
v = v + 1;
printf("\nint is 16-bit: 32767 + 1 = %d\n", v);
}

BIN
examples/powerc-hello.d81 Datei anzeigen


+ 6
- 6
skills/graphics-vic2/SKILL.md Datei anzeigen

@@ -119,14 +119,14 @@ Bit 0 (unused)
```

Video matrix address = bits[7:4] × $0400 within the VIC-II bank
Character base = bits[3:1] × $0800 within the VIC-II bank
Character base = bits[3:1] × $0800 within the VIC-II bank (bit 0 is unused)

| $D018 Value | Screen RAM | Character Set |
|-------------|------------|---------------|
| $10 (default) | $0400 | $1000 (ROM chars via mirror) |
| $14 | $0400 | $1800 (ROM chars, inverted) |
| $18 | $0400 | $2000 (user char at $2000) |
| $15 | $0400 | $1400 (user chars at $1400 in Bank 0) |
| $15 (default) | $0400 | $1000 (character ROM via mirror) |
| $17 | $0400 | $1800 (upper half of character ROM, reversed chars) |
| $18 | $0400 | $2000 (user charset at $2000) |
| $10 | $0400 | $0000 (RAM, not the character ROM) |

---

@@ -153,7 +153,7 @@ Character base = bits[3:1] × $0800 within the VIC-II bank
- Each 8×8 cell has its own 2-color pair stored in screen RAM
- Bitmap data location: bit 3 of $D018 × $2000 within VIC-II bank
- $D018 = $18 → bitmap at $2000 (if screen at $0400)
- $D018 = $1A → bitmap at $4000 in Bank 0? No — bitmap bit is bit3 of high nybble
- $D018 = $08 → bitmap at $0000; in bitmap mode only bit 3 matters, so $1A and $3A also give $2000
- Screen RAM holds color pairs: high nybble = "0" pixel color, low nybble = "1" pixel color

### 5. Multicolor Bitmap Mode ($D011 bit 5 = 1, $D016 bit 4 = 1)


Laden…
Abbrechen
Speichern

Powered by TurnKey Linux.