Compare commits

..

No commits in common. "master" and "0.9.1" have entirely different histories.

17 changed files with 21 additions and 145 deletions

6
.gitattributes vendored
View file

@ -1,5 +1,5 @@
# Exclude test-roms from GitHub language statistics
roms/** linguist-vendored
roms/* linguist-documentation
# Exclude research too
research/** linguist-vendored
# Explore research too
research/* linguist-documentation

View file

@ -1,113 +0,0 @@
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

View file

@ -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 -Wno-class-memaccess -std=c++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -fno-exceptions -fno-rtti -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)

View file

@ -5,10 +5,6 @@
</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">

View file

@ -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((char*)&this->chan, 0, sizeof this->chan);
memset(&this->chan, 0, sizeof this->chan);
// https://wiki.nesdev.com/w/index.php/APU_Noise
this->chan.noise.sr = 1;

View file

@ -150,7 +150,7 @@ void Mapper_001::power_cycle() {
}
void Mapper_001::reset() {
memset((char*)&this->reg, 0, sizeof this->reg);
memset(&this->reg, 0, sizeof this->reg);
this->reg.sr = 0x10;
// This isn't documented anywhere, but seems to be needed...

View file

@ -183,5 +183,5 @@ void Mapper_004::power_cycle() {
}
void Mapper_004::reset() {
memset((char*)&this->reg, 0, sizeof this->reg);
memset(&this->reg, 0, sizeof this->reg);
}

View file

@ -52,5 +52,5 @@ void Mapper_007::update_banks() {
}
void Mapper_007::reset() {
memset((char*)&this->reg, 0, sizeof this->reg);
memset(&this->reg, 0, sizeof this->reg);
}

View file

@ -86,7 +86,7 @@ Mirroring::Type Mapper_009::mirroring() const {
}
void Mapper_009::reset() {
memset((char*)&this->reg, 0, sizeof this->reg);
memset(&this->reg, 0, sizeof this->reg);
this->reg.latch[0] = 1;
this->reg.latch[1] = 1;
}

View file

@ -60,11 +60,8 @@ 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;
@ -427,7 +424,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) |

View file

@ -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: {

View file

@ -18,9 +18,8 @@ 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)_;
(void)realpath(path, abs_path);
#endif
}

View file

@ -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)
: event.key.keysym.mod & (KMOD_LCTRL | KMOD_RCTRL);
: mod_ctrl = event.key.keysym.mod & (KMOD_LCTRL | KMOD_RCTRL);
// Regular 'ol keys
switch (event.key.keysym.sym) {

View file

@ -110,11 +110,14 @@ 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);
cf_dir_next(&dir);
skip_first = false;
}
cf_dir_close(&dir);

View file

@ -716,7 +716,7 @@ void WideNESModule::ppu_frame_end_handler() {
this->phash.max = INT_MIN;
// reset heuristics
memset((char*)&this->h, 0, sizeof this->h);
memset(&this->h, 0, sizeof this->h);
// check if scene already exists
// not that slow tbh, basically linear wrt #scenes (since unordered_map is

View file

@ -6338,7 +6338,6 @@ 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;
@ -6563,7 +6562,6 @@ 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));

View file

@ -8,8 +8,7 @@ That's a lot of work.
Wouldn't it be cool to automate that?
Enter [**wideNES**](http://prilik.com/blog/wideNES), a novel method to map-out
NES games automatically.
Enter **wideNES**, a novel method to map-out NES games automatically.
<p align="center">
<img src="resources/web/wideNES_metroid.gif" alt="wideNES on Metroid">
@ -79,9 +78,6 @@ 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