mirror of
https://github.com/daniel5151/ANESE.git
synced 2025-04-02 10:32:00 -04:00
Compare commits
18 commits
Author | SHA1 | Date | |
---|---|---|---|
|
8ae814d615 | ||
|
cbc4160fe9 | ||
|
9f0c11c6e3 | ||
|
f19d1d0304 | ||
|
42d33b1e08 | ||
|
0995f9a86f | ||
|
1d903e2615 | ||
|
99ae2a99fa | ||
|
35290b5296 | ||
|
8c23e981f0 | ||
|
6f27b38d83 | ||
|
9e16eb1d13 | ||
|
af086ebfa6 | ||
|
772656ed71 | ||
|
050bb8b193 | ||
|
88a571ac30 | ||
|
cd756d0a2d | ||
|
0081371aa4 |
17 changed files with 145 additions and 21 deletions
6
.gitattributes
vendored
6
.gitattributes
vendored
|
@ -1,5 +1,5 @@
|
|||
# Exclude test-roms from GitHub language statistics
|
||||
roms/* linguist-documentation
|
||||
roms/** linguist-vendored
|
||||
|
||||
# Explore research too
|
||||
research/* linguist-documentation
|
||||
# Exclude research too
|
||||
research/** linguist-vendored
|
||||
|
|
113
.github/workflows/CI.yml
vendored
Normal file
113
.github/workflows/CI.yml
vendored
Normal file
|
@ -0,0 +1,113 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- '*.yml'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '*.yml'
|
||||
|
||||
jobs:
|
||||
build-windows:
|
||||
name: build-windows (${{ matrix.configuration }}, ${{ matrix.arch }})
|
||||
env:
|
||||
SDL2: SDL2-${{ matrix.SDL2_ver }}
|
||||
POWERSHELL_TELEMETRY_OPTOUT: 1
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
configuration: [Release, Debug]
|
||||
arch: [x86, x64]
|
||||
SDL2_ver: [2.0.12]
|
||||
include:
|
||||
- arch: x86
|
||||
platform: Win32
|
||||
- arch: x64
|
||||
platform: x64
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
#- uses: actions/cache@v2
|
||||
# id: cache
|
||||
# with:
|
||||
# path: |
|
||||
# SDL2-devel-${{ matrix.SDL2_ver }}-VC.zip
|
||||
# SDL2-${{ env.SDL2_ver }}-win32-${{ matrix.arch }}.zip
|
||||
# key: ${{ env.SDL2_ver }}_1
|
||||
- name: Download SDL2
|
||||
#if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
curl -LJO https://www.libsdl.org/release/SDL2-devel-${{ matrix.SDL2_ver }}-VC.zip -LJO https://www.libsdl.org/release/SDL2-${{ matrix.SDL2_ver }}-win32-${{ matrix.arch }}.zip
|
||||
7z x -r -y SDL2-devel-${{ matrix.SDL2_ver }}-VC.zip
|
||||
- name: CMake generate
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
cmake .. -A ${{ matrix.platform }}
|
||||
- name: Build
|
||||
working-directory: build
|
||||
run: cmake --build . --config ${{ matrix.configuration }} -j $env:NUMBER_OF_PROCESSORS
|
||||
- if: matrix.configuration == 'Release'
|
||||
name: Prepare artifacts
|
||||
run: |
|
||||
7z x -r -y SDL2-${{ matrix.SDL2_ver }}-win32-${{ matrix.arch }}.zip -oartifacts
|
||||
mv build\${{ matrix.configuration }}\anese.exe, roms\demos\* artifacts
|
||||
- if: matrix.configuration == 'Release'
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: ANESE-${{ runner.os }}-${{ matrix.arch }}
|
||||
path: artifacts
|
||||
|
||||
build-linux:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
compiler: ${{ matrix.compiler }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
compiler: [gcc, clang]
|
||||
configuration: [Release, RelWithDebInfo, MinSizeRel, Debug]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install SDL2
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install libsdl2-dev
|
||||
- name: CMake generate
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
cmake ..
|
||||
- name: Build
|
||||
working-directory: build
|
||||
run: cmake --build . --config ${{ matrix.configuration }} -j$(nproc)
|
||||
|
||||
build-macos:
|
||||
runs-on: macos-latest
|
||||
env:
|
||||
compiler: ${{ matrix.compiler }}
|
||||
HOMEBREW_NO_ANALYTICS: 1
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
compiler: [gcc, clang]
|
||||
configuration: [Release, RelWithDebInfo, MinSizeRel, Debug]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install SDL2
|
||||
run: brew install SDL2
|
||||
- name: CMake generate
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
cmake ..
|
||||
- name: Build
|
||||
working-directory: build
|
||||
run: cmake --build . --config ${{ matrix.configuration }} -j$(sysctl -n hw.ncpu)
|
||||
- if: matrix.configuration == 'Release'
|
||||
name: Prepare artifacts
|
||||
working-directory: build
|
||||
run: cmake --build . --config ${{ matrix.configuration }} --target install -j$(sysctl -n hw.ncpu)
|
||||
- if: matrix.configuration == 'Release'
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: ANESE-${{ runner.os }}-${{ matrix.compiler }}
|
||||
path: bin
|
|
@ -32,7 +32,7 @@ endif(NOT CMAKE_BUILD_TYPE)
|
|||
|
||||
# Setup compiler flags for different platforms
|
||||
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -fno-exceptions -fno-rtti -std=c++11")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -fno-exceptions -fno-rtti -Wno-class-memaccess -std=c++11")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -g -fsanitize=undefined -fsanitize=address")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3 -g")
|
||||
elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
</a>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://github.com/daniel5151/ANESE/actions?query=branch%3Amaster">
|
||||
<img src="https://github.com/daniel5151/ANESE/workflows/CI/badge.svg?branch=master"
|
||||
alt="Build Status GitHub Actions">
|
||||
</a>
|
||||
<a href="https://ci.appveyor.com/project/daniel5151/anese">
|
||||
<img src="https://ci.appveyor.com/api/projects/status/qgy19m8us3ss6ilt?svg=true"
|
||||
alt="Build Status Windows">
|
||||
|
|
|
@ -71,7 +71,7 @@ APU::APU(const NES_Params& params, Memory& mem, InterruptLines& interrupt)
|
|||
|
||||
// https://wiki.nesdev.com/w/index.php/CPU_power_up_state
|
||||
void APU::power_cycle() {
|
||||
memset(&this->chan, 0, sizeof this->chan);
|
||||
memset((char*)&this->chan, 0, sizeof this->chan);
|
||||
|
||||
// https://wiki.nesdev.com/w/index.php/APU_Noise
|
||||
this->chan.noise.sr = 1;
|
||||
|
|
|
@ -150,7 +150,7 @@ void Mapper_001::power_cycle() {
|
|||
}
|
||||
|
||||
void Mapper_001::reset() {
|
||||
memset(&this->reg, 0, sizeof this->reg);
|
||||
memset((char*)&this->reg, 0, sizeof this->reg);
|
||||
this->reg.sr = 0x10;
|
||||
|
||||
// This isn't documented anywhere, but seems to be needed...
|
||||
|
|
|
@ -183,5 +183,5 @@ void Mapper_004::power_cycle() {
|
|||
}
|
||||
|
||||
void Mapper_004::reset() {
|
||||
memset(&this->reg, 0, sizeof this->reg);
|
||||
memset((char*)&this->reg, 0, sizeof this->reg);
|
||||
}
|
||||
|
|
|
@ -52,5 +52,5 @@ void Mapper_007::update_banks() {
|
|||
}
|
||||
|
||||
void Mapper_007::reset() {
|
||||
memset(&this->reg, 0, sizeof this->reg);
|
||||
memset((char*)&this->reg, 0, sizeof this->reg);
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ Mirroring::Type Mapper_009::mirroring() const {
|
|||
}
|
||||
|
||||
void Mapper_009::reset() {
|
||||
memset(&this->reg, 0, sizeof this->reg);
|
||||
memset((char*)&this->reg, 0, sizeof this->reg);
|
||||
this->reg.latch[0] = 1;
|
||||
this->reg.latch[1] = 1;
|
||||
}
|
||||
|
|
|
@ -60,8 +60,11 @@ void CPU::service_interrupt(Interrupts::Type interrupt, bool brk /* = false */)
|
|||
this->cycles += 7;
|
||||
|
||||
switch (interrupt) {
|
||||
case Interrupts::IRQ: if (brk || !this->reg.p.i)
|
||||
this->reg.pc = this->read16(0xFFFE); break;
|
||||
case Interrupts::IRQ:
|
||||
if (brk || !this->reg.p.i) {
|
||||
this->reg.pc = this->read16(0xFFFE);
|
||||
}
|
||||
break;
|
||||
case Interrupts::RESET: this->reg.pc = this->read16(0xFFFC); break;
|
||||
case Interrupts::NMI: this->reg.pc = this->read16(0xFFFA); break;
|
||||
default: break;
|
||||
|
@ -424,7 +427,7 @@ u16 CPU::peek16(u16 addr) const {
|
|||
u16 CPU::read16(u16 addr) {
|
||||
return this->mem.read(addr + 0) |
|
||||
(this->mem.read(addr + 1) << 8);
|
||||
};
|
||||
}
|
||||
|
||||
u16 CPU::peek16_zpg(u16 addr) const {
|
||||
return this->mem.peek(addr + 0) |
|
||||
|
|
|
@ -442,7 +442,7 @@ void PPU::bgr_fetch() {
|
|||
|
||||
this->bgr.shift.at_latch[0] = this->bgr.at_byte & 1;
|
||||
this->bgr.shift.at_latch[1] = this->bgr.at_byte & 2;
|
||||
}
|
||||
} break;
|
||||
// 1) Fetch Nametable Byte
|
||||
// https://wiki.nesdev.com/w/index.php/PPU_scrolling#Tile_and_attribute_fetching
|
||||
case 2: {
|
||||
|
|
|
@ -18,8 +18,9 @@ void get_abs_path(char* abs_path, const char* path, unsigned int n) {
|
|||
#ifdef WIN32
|
||||
GetFullPathName(path, n, abs_path, nullptr);
|
||||
#else
|
||||
const char* _ = realpath(path, abs_path);
|
||||
(void)n;
|
||||
(void)realpath(path, abs_path);
|
||||
(void)_;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -204,7 +204,7 @@ void EmuModule::input(const SDL_Event& event) {
|
|||
// Use CMD on macOS, and CTRL on windows / linux
|
||||
bool mod_ctrl = strcmp(SDL_GetPlatform(), "Mac OS X") == 0
|
||||
? event.key.keysym.mod & (KMOD_LGUI | KMOD_RGUI)
|
||||
: mod_ctrl = event.key.keysym.mod & (KMOD_LCTRL | KMOD_RCTRL);
|
||||
: event.key.keysym.mod & (KMOD_LCTRL | KMOD_RCTRL);
|
||||
|
||||
// Regular 'ol keys
|
||||
switch (event.key.keysym.sym) {
|
||||
|
|
|
@ -110,14 +110,11 @@ void MenuSubModule::update() {
|
|||
// Get file-listing
|
||||
cf_dir_t dir;
|
||||
cf_dir_open(&dir, this->nav.directory);
|
||||
bool skip_first = true;
|
||||
while (dir.has_next) {
|
||||
cf_file_t file;
|
||||
cf_read_file(&dir, &file);
|
||||
if (!skip_first)
|
||||
files.push_back(file);
|
||||
files.push_back(file);
|
||||
cf_dir_next(&dir);
|
||||
skip_first = false;
|
||||
}
|
||||
cf_dir_close(&dir);
|
||||
|
||||
|
|
|
@ -716,7 +716,7 @@ void WideNESModule::ppu_frame_end_handler() {
|
|||
this->phash.max = INT_MIN;
|
||||
|
||||
// reset heuristics
|
||||
memset(&this->h, 0, sizeof this->h);
|
||||
memset((char*)&this->h, 0, sizeof this->h);
|
||||
|
||||
// check if scene already exists
|
||||
// not that slow tbh, basically linear wrt #scenes (since unordered_map is
|
||||
|
|
2
thirdparty/headeronly/stb_image.h
vendored
2
thirdparty/headeronly/stb_image.h
vendored
|
@ -6338,6 +6338,7 @@ static stbi_uc *stbi__process_gif_raster(stbi__context *s, stbi__gif *g)
|
|||
// two back is the image from two frames ago, used for a very specific disposal format
|
||||
static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, int req_comp, stbi_uc *two_back)
|
||||
{
|
||||
(void) req_comp;
|
||||
int dispose;
|
||||
int first_frame;
|
||||
int pi;
|
||||
|
@ -6562,6 +6563,7 @@ static void *stbi__load_gif_main(stbi__context *s, int **delays, int *x, int *y,
|
|||
|
||||
static void *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri)
|
||||
{
|
||||
(void)ri;
|
||||
stbi_uc *u = 0;
|
||||
stbi__gif g;
|
||||
memset(&g, 0, sizeof(g));
|
||||
|
|
|
@ -8,7 +8,8 @@ That's a lot of work.
|
|||
|
||||
Wouldn't it be cool to automate that?
|
||||
|
||||
Enter **wideNES**, a novel method to map-out NES games automatically.
|
||||
Enter [**wideNES**](http://prilik.com/blog/wideNES), a novel method to map-out
|
||||
NES games automatically.
|
||||
|
||||
<p align="center">
|
||||
<img src="resources/web/wideNES_metroid.gif" alt="wideNES on Metroid">
|
||||
|
@ -78,6 +79,9 @@ recorded.
|
|||
It's not quite _that_ simple, since there are lots of additional heuritics that
|
||||
are used to smooth out edge-cases, but at a high level, that's the gist of it!
|
||||
|
||||
If you're really interested in the gory details, check out the writeup on
|
||||
[my blog!](http://prilik.com/blog/wideNES)
|
||||
|
||||
## Caveats
|
||||
|
||||
wideNES works surprisingly well with many games out of the box, but it's no
|
||||
|
|
Loading…
Add table
Reference in a new issue