Files
bsnes/ui/general/main-window.cpp
Tim Allen da7d9f2662 Initial commit of bgameboy v000.
The source tarball also included empty obj/ and out/ directories which
git does not support.

byuu says:

Project started, so basically everything is new.

It's basically a rough skeleton that mimics bsnes project structure.
Eventually the src/gameboy folder will be copied into bsnes-official and
used by the chip/supergameboy core.
The middleware layer (supergameboy/interface) will be merged into a new
chip/icd2 folder that will represent direct Super Game Boy emulation in
the future.
At least, if all goes according to plan.

There is a simple GUI that can load ROMs, but do nothing after it. It's
not hooked up to ruby yet.
There is a basic system class and interface to expose the
video/audio/input functions.
There is a basic memory bus that doesn't support any MBCs yet.
There is a CPU skeleton that only handles easy read/write access to the
CPU registers (AF is a really fucked up register.)
The core is not hooked up to libco yet, but I intend for it to be, so
that I can run the CPU + LCD how I like.
If it turns out the LCD+audio is easily enslavable, then I'll probably
drop libco and just run it like a regular emulator, using a thread
wrapper around it in bsnes only. We'll see.

The CPU doesn't actually support any opcodes, and loading a ROM won't
actually execute anything.
2010-12-28 12:53:15 +11:00

47 lines
1.2 KiB
C++
Executable File

MainWindow mainWindow;
void MainWindow::create() {
Window::create(128, 128, 160 * 3, 144 * 3, { GameBoy::Info::Name, " v", GameBoy::Info::Version });
system.create(*this, "System");
systemLoadCartridge.create(system, "Load Cartridge ...");
systemSeparator1.create(system);
systemPower.create(system, "Power Cycle");
systemPower.setEnabled(false);
systemReset.create(system, "Reset");
systemReset.setEnabled(false);
settings.create(*this, "Settings");
settings.setEnabled(false);
tools.create(*this, "Tools");
tools.setEnabled(false);
help.create(*this, "Help");
helpAbout.create(help, "About ...");
viewport.create(*this, 0, 0, 160 * 3, 144 * 3);
setMenuVisible(true);
setStatusVisible(true);
onClose = []() {
application.quit = true;
return false;
};
systemLoadCartridge.onTick = []() {
string filename = OS::fileOpen(mainWindow, "Game Boy cartridges\t*.gb", "/media/sdb1/root/gameboy_images/");
if(filename != "") utility.loadCartridge(filename);
};
helpAbout.onTick = []() {
MessageWindow::information(mainWindow, {
"bgameboy\n\n",
"Version: ", GameBoy::Info::Version, "\n",
"Author: byuu\n",
"Homepage: http://byuu.org/"
});
};
}