Human-in-the-Loop extension for pi coding agent
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Matteo Benedetto 8c1aab93aa Add Game Boy Hello World example with GBDK-2020 and PyBoy test 3 days ago
..
Makefile Add Game Boy Hello World example with GBDK-2020 and PyBoy test 3 days ago
README.md Add Game Boy Hello World example with GBDK-2020 and PyBoy test 3 days ago
hello.gb Add Game Boy Hello World example with GBDK-2020 and PyBoy test 3 days ago
main.c Add Game Boy Hello World example with GBDK-2020 and PyBoy test 3 days ago

README.md

Game Boy Hello World

Questa sottocartella contiene un minimo esempio di "Hello World" per Game Boy originale, compilato con GBDK-2020 in C.

Struttura

  • main.c — sorgente C.
  • Makefile — regola per compilare con lcc (GBDK-2020).
  • hello.gb — ROM Game Boy risultante (32 KB).

Requisiti

GBDK-2020 e installato in /home/enne2/.local/gbdk. Se vuoi spostarlo altrove, aggiorna il CC nel Makefile.

Build

cd gameboy-hello
make

Test con emulatore

PyBoy (senza finestra, screenshot)

python3 - <<'PY'
from pyboy import PyBoy
rom = 'hello.gb'
pyboy = PyBoy(rom, window='null')
for _ in range(60*5):
    pyboy.tick()
pyboy.screen.image.save('/tmp/hello_gb.png')
pyboy.stop()
print('Screenshot salvato in /tmp/hello_gb.png')
PY

PyBoy (con finestra SDL2)

python3 - <<'PY'
from pyboy import PyBoy
pyboy = PyBoy('hello.gb', window='SDL2')
for _ in range(60*30):
    pyboy.tick()
pyboy.stop()
PY

Note

  • La ROM usa il logo Nintendo corretto e il checksum di header e valido.
  • Il testo viene visualizzato con printf sulla console testuale del Game Boy.
  • Il loop principale chiama wait_vbl_done() per sincronizzarsi con il VBlank.

Prossimi passi

Da qui si puo partire per un vero gioco Game Boy (ad esempio Tetris), aggiungendo:

  • gestione di input tramite joypad();
  • sprite OAM per i pezzi;
  • tilemap per il campo di gioco;
  • musica/effetti sonori con i 4 canali audio del Game Boy.