-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5e8cf74
commit e2048a1
Showing
4 changed files
with
130 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule libretro-common
added at
44c1cd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// | ||
// ZEPTO-8 — Fantasy console emulator | ||
// | ||
// Copyright © 2016—2020 Sam Hocevar <sam@hocevar.net> | ||
// | ||
// This program is free software. It comes without any warranty, to | ||
// the extent permitted by applicable law. You can redistribute it | ||
// and/or modify it under the terms of the Do What the Fuck You Want | ||
// to Public License, Version 2, as published by the WTFPL Task Force. | ||
// See http://www.wtfpl.net/ for more details. | ||
// | ||
|
||
#if HAVE_CONFIG_H | ||
# include "config.h" | ||
#endif | ||
|
||
#include <lol/engine.h> // lol::input | ||
#include <lol/transform> // lol::mat4 | ||
#include <lol/color> // lol::color | ||
|
||
#include "player.h" | ||
|
||
#include "zepto8.h" | ||
#include "pico8/vm.h" | ||
#include "pico8/pico8.h" | ||
#include "raccoon/vm.h" | ||
|
||
extern "C" | ||
{ | ||
#include "libretro.h" | ||
} | ||
|
||
namespace z8 | ||
{ | ||
|
||
extern "C" void retro_get_system_info(struct retro_system_info *info) | ||
{ | ||
memset(info, 0, sizeof(*info)); | ||
info->library_name = "zepto8"; | ||
info->library_version = "0.0.0"; | ||
info->valid_extensions = "p8|p8.png"; | ||
info->need_fullpath = true; // we load our own carts for now | ||
} | ||
|
||
extern "C" void retro_get_system_av_info(struct retro_system_av_info *info) | ||
{ | ||
memset(info, 0, sizeof(*info)); | ||
info->geometry.base_width = info->geometry.max_width = 128; | ||
info->geometry.base_height = info->geometry.max_height = 128; | ||
info->geometry.aspect_ratio = 1.f; | ||
info->timing.fps = 60.f; | ||
info->timing.sample_rate = 44100.f; | ||
} | ||
|
||
extern "C" void retro_set_environment(retro_environment_t cb) | ||
{ | ||
// We can run without a cartridge | ||
bool no_rom = true; | ||
cb(RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME, &no_rom); | ||
} | ||
|
||
extern "C" bool retro_load_game(const struct retro_game_info *info) | ||
{ | ||
// TODO: load cart | ||
(void)info; | ||
return true; | ||
} | ||
|
||
extern "C" void retro_unload_game() | ||
{ | ||
} | ||
|
||
extern "C" void retro_run(void) | ||
{ | ||
// TODO: vm->step(), audio_cb(), video_cb() | ||
} | ||
|
||
|
||
} // namespace z8 | ||
|