T-State | Area | Latch | Write |
---|---|---|---|
0 | left border | mask 1 (border) | latch 0 bits 7 and 6 |
1 | left border | attr 1 (border) | latch 0 bits 5 and 4 |
2 | left border | latch 0 bits 3 and 2 | |
3 | left border | latch 0 bits 1 and 0 | |
4 | left border | latch 1 bits 7 and 6 | |
5 | left border | latch 1 bits 5 and 4 | |
6 | left border | mask 0 (border) | latch 1 bits 3 and 2 |
7 | left border | attr 0 (border) | latch 1 bits 1 and 0 |
#pragma once | |
/*# | |
# ula.h | |
A ZX Spectrum ULA emulator in a C header. | |
Do this: | |
~~~C | |
#define CHIPS_IMPL | |
~~~ |
#pragma description ZX Spectrum TAP | |
#pragma endian little | |
import std.mem; | |
enum Flag: u8 { | |
Header = 0, | |
Body = 255 | |
}; |
#include <inttypes.h> | |
#include <vector> | |
class Resumable { | |
public: | |
void resume(unsigned const continuationToken) { (void)continuationToken; } | |
}; | |
template<typename T> | |
class Bus { |
local hc = require 'hc' | |
hc.control:addConsole('ZX Spectrum (Chips)', { | |
onConsoleLoaded = function() | |
local path = hc.config:getCoresPath() .. 'zx48k_libretro.' .. hc.soExtension | |
hc.control:loadCore(path) | |
end, | |
onGameLoaded = function() | |
local map = hc.config:getMemoryMap() |
local hc = require 'hc' | |
local lfs = require 'lfs' | |
local logger, config = hc.logger, hc.config | |
local coresPath = config:getCoresPath() | |
logger:info('Looking for Lua scripts in "%s"', coresPath) | |
for file in lfs.dir(coresPath) do | |
if file:sub(-4, -1) == '.lua' then |
Despite having an API that creates save state data into an user-provided buffer, some Libretro cores still create additional data as files. Additionally, Libretro save states don't feature a screenshot of the video frame buffer at the time the save state is created, making it impossible to preview the save state or restore the frame buffer when the save state is loaded back.
We also want to save data to completely restore the emulation state, like the core name and version, core options values, and any other data needed by the application.
To make it easier to put all this data into a single file, we'll use the RIFF format. RIFF is a chunked format, allowing us to save everything we need in an organized way.
All integers and float-point numbers are written in little-endian, and strings are null-terminated.
#ifndef LRCPP_COMPONENTS_H__ | |
#define LRCPP_COMPONENTS_H__ | |
#include "libretro.h" | |
namespace lrcpp { | |
/** | |
* A logger component for Core instances. | |
*/ | |
class Logger { |
header { | |
#include "Core.h" | |
#include <string> | |
typedef const std::string const_string; | |
} | |
fsm CoreFsm { | |
class lrcpp::Core as ctx; |
#include <stddef.h> | |
#include <string.h> | |
#include <lua.h> | |
#include <lauxlib.h> | |
#include "luasocket/src/ftp.lua.h" | |
#include "luasocket/src/headers.lua.h" | |
#include "luasocket/src/http.lua.h" | |
#include "luasocket/src/ltn12.lua.h" |