mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-09-01 03:01:59 +02:00
Update to 20180729 release.
byuu wrote: Sigh ... asio.hpp needs #include <nall/windows/registry.hpp> [Since the last WIP, byuu also posted the following message. -Ed.] ruby drivers have all been updated (but not tested outside of BSD), and I redesigned the settings window. The driver functionality all exists on a new "Drivers" panel, the emulator/hack settings go to a "Configuration" panel, and the video/audio panels lose driver settings. As does the settings menu and its synchronize options. I want to start pushing toward a v107 release. Critically, I will need DirectSound and ALSA to support dynamic rate control. I'd also like to eliminate the other system manifest.bml files. I need to update the cheat code database format, and bundle at least a few quark shaders -- although I still need to default to Direct3D on Windows. Turbo keys would be nice, if it's not too much effort. Aside from netplay, it's the last significant feature I'm missing. I think for v107, higan is going to be a bit rough around the edges compared to bsnes. And I don't think it's practical to finish the bsnes localization support. I'm thinking we probably want another WIP to iron out any critical issues, but this time there should be a feature freeze with the next WIP.
This commit is contained in:
@@ -10,25 +10,23 @@ namespace nall { namespace Encode {
|
||||
struct ZIP {
|
||||
ZIP(const string& filename) {
|
||||
fp.open(filename, file::mode::write);
|
||||
time_t currentTime = time(nullptr);
|
||||
tm* info = localtime(¤tTime);
|
||||
dosTime = (info->tm_hour << 11) | (info->tm_min << 5) | (info->tm_sec >> 1);
|
||||
dosDate = ((info->tm_year - 80) << 9) | ((1 + info->tm_mon) << 5) + (info->tm_mday);
|
||||
timestamp = time(nullptr);
|
||||
}
|
||||
|
||||
//append path: append("path/");
|
||||
//append file: append("path/file", data, size);
|
||||
auto append(string filename, const uint8_t* data = nullptr, unsigned size = 0u) -> void {
|
||||
auto append(string filename, const uint8_t* data = nullptr, uint size = 0u, time_t timestamp = 0) -> void {
|
||||
filename.transform("\\", "/");
|
||||
if(!timestamp) timestamp = this->timestamp;
|
||||
uint32_t checksum = Hash::CRC32(data, size).digest().hex();
|
||||
directory.append({filename, checksum, size, fp.offset()});
|
||||
directory.append({filename, timestamp, checksum, size, fp.offset()});
|
||||
|
||||
fp.writel(0x04034b50, 4); //signature
|
||||
fp.writel(0x0014, 2); //minimum version (2.0)
|
||||
fp.writel(0x0000, 2); //general purpose bit flags
|
||||
fp.writel(0x0000, 2); //compression method (0 = uncompressed)
|
||||
fp.writel(dosTime, 2);
|
||||
fp.writel(dosDate, 2);
|
||||
fp.writel(makeTime(timestamp), 2);
|
||||
fp.writel(makeDate(timestamp), 2);
|
||||
fp.writel(checksum, 4);
|
||||
fp.writel(size, 4); //compressed size
|
||||
fp.writel(size, 4); //uncompressed size
|
||||
@@ -41,15 +39,15 @@ struct ZIP {
|
||||
|
||||
~ZIP() {
|
||||
//central directory
|
||||
unsigned baseOffset = fp.offset();
|
||||
uint baseOffset = fp.offset();
|
||||
for(auto& entry : directory) {
|
||||
fp.writel(0x02014b50, 4); //signature
|
||||
fp.writel(0x0014, 2); //version made by (2.0)
|
||||
fp.writel(0x0014, 2); //version needed to extract (2.0)
|
||||
fp.writel(0x0000, 2); //general purpose bit flags
|
||||
fp.writel(0x0000, 2); //compression method (0 = uncompressed)
|
||||
fp.writel(dosTime, 2);
|
||||
fp.writel(dosDate, 2);
|
||||
fp.writel(makeTime(entry.timestamp), 2);
|
||||
fp.writel(makeDate(entry.timestamp), 2);
|
||||
fp.writel(entry.checksum, 4);
|
||||
fp.writel(entry.size, 4); //compressed size
|
||||
fp.writel(entry.size, 4); //uncompressed size
|
||||
@@ -62,7 +60,7 @@ struct ZIP {
|
||||
fp.writel(entry.offset, 4); //relative offset of file header
|
||||
fp.print(entry.filename);
|
||||
}
|
||||
unsigned finishOffset = fp.offset();
|
||||
uint finishOffset = fp.offset();
|
||||
|
||||
//end of central directory
|
||||
fp.writel(0x06054b50, 4); //signature
|
||||
@@ -78,10 +76,21 @@ struct ZIP {
|
||||
}
|
||||
|
||||
protected:
|
||||
auto makeTime(time_t timestamp) -> uint16_t {
|
||||
tm* info = localtime(×tamp);
|
||||
return (info->tm_hour << 11) | (info->tm_min << 5) | (info->tm_sec >> 1);
|
||||
}
|
||||
|
||||
auto makeDate(time_t timestamp) -> uint16_t {
|
||||
tm* info = localtime(×tamp);
|
||||
return ((info->tm_year - 80) << 9) | ((1 + info->tm_mon) << 5) + (info->tm_mday);
|
||||
}
|
||||
|
||||
file fp;
|
||||
uint16_t dosTime, dosDate;
|
||||
time_t timestamp;
|
||||
struct entry_t {
|
||||
string filename;
|
||||
time_t timestamp;
|
||||
uint32_t checksum;
|
||||
uint32_t size;
|
||||
uint32_t offset;
|
||||
|
Reference in New Issue
Block a user