It is a memo to operate ROM created by GBDK with PyBoy. This implementation is published in the following repository. https://github.com/Kazuhito00/pyboy-gbdk-examples
A Game Boy emulator written in Python. It seems that it is developing not just an emulator but also a platform for reinforcement learning. https://github.com/Baekalfen/PyBoy
Abbreviation for GameBoy Developers Kit, freeware that allows you to develop Game Boy software in C or assembly language. http://gbdk.sourceforge.net/
Installation GBDK
PyBoy
Hello World You can create Hello Work with printf ().
hello_world.c
#include <stdio.h>
#include <gb/gb.h>
#include <gb/console.h>
int main(void)
{
gotoxy(0, 0); //Specify drawing coordinates
printf("Hello World\n");
}
Compiled with GBDK's LCC compiler.
c:\gbdk\bin\lcc -Wa-l -Wl-m -Wl-j -DUSE_SFR_FOR_REG -c -o hello_world.o hello_world.c
c:\gbdk\bin\lcc -Wa-l -Wl-m -Wl-j -DUSE_SFR_FOR_REG -Wl-yt2 -Wl-yo4 -Wl-ya4 -o hello_world.gb hello_world.o
from pyboy import PyBoy
#Start PyBoy
color_palette = [0xd6e895, 0xacc04c, 0x527d3e, 0x264a2e] #Game Boy-like color palette specification
pyboy = PyBoy('hello_world.gb', color_palette=color_palette)
while not pyboy.tick():
pass
Success if the following window appears.
that's all.
Recommended Posts