Modernizing

This commit is contained in:
Sergio Martin 2024-01-19 19:55:54 +01:00
parent 9d941ede99
commit 99d32a4301
50 changed files with 85 additions and 117 deletions

View File

@ -1,3 +1,4 @@
#pragma once
// NES cartridge data (PRG, CHR, mapper)
@ -14,10 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
// Nes_Emu 0.7.0. http://www.slack.net/~ant/
#ifndef NES_CART_H
#define NES_CART_H
#include <cstring>
#include <cstdint>
#include <cstdlib>
@ -103,4 +100,3 @@ private:
};
#endif

View File

@ -1,11 +1,9 @@
// Nes_Emu 0.7.0. http://www.slack.net/~ant/nes-emu/
#include "Nes_Cpu.h"
#include <string.h>
#include <limits.h>
#include "blargg_endian.h"
#include <stdio.h>
#include <cstring>
#include <climits>
#include <cstdio>
#include <Nes_Cpu.h>
#include <Nes_Core.h>
/**

View File

@ -1,11 +1,9 @@
#pragma once
// NES video game console emulator with snapshot support
// Nes_Emu 0.7.0
#ifndef NES_EMU_H
#define NES_EMU_H
#include "audio/Multi_Buffer.h"
#include "Nes_Cart.h"
#include "Nes_Core.h"
@ -262,4 +260,3 @@ inline long Nes_Emu::chr_size() const
return cart()->chr_size() ? cart()->chr_size() : emu.ppu.chr_addr_size;
}
#endif

View File

@ -1,14 +1,12 @@
#pragma once
// NES mapper interface
// Nes_Emu 0.7.0
#ifndef NES_MAPPER
#define NES_MAPPER
#include <climits>
#include "Nes_Cart.h"
#include "Nes_Cpu.h"
#include <climits>
class Blip_Buffer;
class blip_eq_t;
@ -201,7 +199,3 @@ inline void Nes_Mapper::register_state( void* p, unsigned s )
inline bool Nes_Mapper::write_intercepted( nes_time_t, nes_addr_t, int ) { return false; }
inline int Nes_Mapper::read( nes_time_t, nes_addr_t ) { return -1; } // signal to caller
#endif

View File

@ -3,9 +3,8 @@
// Nes_Emu 0.7.0. http://www.slack.net/~ant/
#include <cstring>
#include "Nes_Ppu.h"
#include <string.h>
#include "Nes_Mapper.h"
#include "Nes_Core.h"

View File

@ -1,11 +1,9 @@
#pragma once
// NES PPU emulator
// Nes_Emu 0.7.0
#ifndef NES_PPU_H
#define NES_PPU_H
#include "Nes_Ppu_Rendering.h"
#include <climits>
@ -138,5 +136,3 @@ inline void Nes_Ppu::update_open_bus( nes_time_t time )
if ( time >= decay_low ) open_bus &= ~0x1F;
if ( time >= decay_high ) open_bus &= ~0xE0;
}
#endif

View File

@ -1,12 +1,9 @@
// Nes_Emu 0.7.0. http://www.slack.net/~ant/
#include "Nes_Ppu_Impl.h"
#include <cstring>
#include <cstdint>
#include <cstdio>
#include <string.h>
#include "blargg_endian.h"
#include <stdint.h>
#include "Nes_Ppu_Impl.h"
/* Copyright (C) 2004-2006 Shay Green. This module is free software; you
can redistribute it and/or modify it under the terms of the GNU Lesser

View File

@ -5,7 +5,6 @@
#include <cstdint>
class Nes_State_;
struct ppu_state_t
{
@ -38,8 +37,6 @@ public:
const char * open_chr( const uint8_t*, long size );
void rebuild_chr( unsigned long begin, unsigned long end );
void close_chr();
void save_state( Nes_State_* out ) const;
void load_state( Nes_State_ const& );
static const uint16_t image_width = 256;
static const uint16_t image_height = 240;

View File

@ -1,11 +1,9 @@
#pragma once
// NES PPU emulator graphics rendering
// Nes_Emu 0.7.0
#ifndef NES_PPU_RENDERING_H
#define NES_PPU_RENDERING_H
#include "Nes_Ppu_Impl.h"
class Nes_Ppu_Rendering : public Nes_Ppu_Impl {
@ -58,4 +56,3 @@ inline void Nes_Ppu_Rendering::draw_sprites( int start, int count )
draw_scanlines( start, count, host_pixels + host_row_bytes * start, host_row_bytes, 2 );
}
#endif

View File

@ -1,4 +1,3 @@
int sprite_2 = sprite [2];
// pixels

View File

@ -7,7 +7,6 @@
#include <cstdint>
#include <cstdint>
#include <climits>
#include "blargg_endian.h"
#include "Nes_Oscs.h"
class Nes_Apu {

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright (C) 2018.
* This module is free software; you
* can redistribute it and/or modify it under the terms of the GNU Lesser
@ -15,8 +17,6 @@
* 100-in-1 Contra Function 16
*/
#pragma once
#include "Nes_Mapper.h"
struct Mapper015_state_t

View File

@ -5,7 +5,6 @@
// Nes_Emu 0.7.0. http://www.slack.net/~ant/
#include "Nes_Mapper.h"
#include "blargg_endian.h"
#include "audio/namco/apu.h"
/* Copyright (C) 2004-2006 Shay Green. This module is free software; you

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2004-2006 Shay Green
* Copyright (C) 2007 CaH4e3
@ -24,7 +26,6 @@
* VRC-2/VRC-4 Konami
*/
#pragma once
#include "Nes_Mapper.h"
struct vrc2_state_t

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2004-2006 Shay Green
* Copyright (C) 2007 CaH4e3
@ -24,7 +26,6 @@
* VRC-2/VRC-4 Konami
*/
#pragma once
#include "Nes_Mapper.h"
#include "mappers/mapper021.hpp"

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2004-2006 Shay Green
* Copyright (C) 2007 CaH4e3
@ -24,7 +26,6 @@
* VRC-2/VRC-4 Konami
*/
#pragma once
#include "Nes_Mapper.h"
typedef Mapper_VRC2_4<false, false> Mapper023;

View File

@ -1,13 +1,12 @@
#pragma once
// Konami VRC6 mapper
// Nes_Emu 0.7.0. http://www.slack.net/~ant/
#include "Nes_Mapper.h"
#include <string.h>
#include "audio/vrc6/apu.h"
#include "blargg_endian.h"
/* Copyright (C) 2004-2006 Shay Green. This module is free software; you
can redistribute it and/or modify it under the terms of the GNU Lesser

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2004-2006 Shay Green
* Copyright (C) 2007 CaH4e3
@ -24,7 +26,6 @@
* VRC-2/VRC-4 Konami
*/
#pragma once
#include "Nes_Mapper.h"
typedef Mapper_VRC2_4<true,false> Mapper025;

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2018
*
@ -25,8 +27,6 @@
* Tested only on Troll Burner and Mystic Origins demo.
*/
#pragma once
#include "Nes_Mapper.h"
// Unrom512

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2018
*
@ -21,8 +23,6 @@
*
*/
#pragma once
#include "Nes_Mapper.h"
struct mapper32_state_t

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2018
*
@ -21,8 +23,6 @@
*
*/
#pragma once
#include "Nes_Mapper.h"
struct tc0190_state_t

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright (C) 2018.
* This module is free software; you
* can redistribute it and/or modify it under the terms of the GNU Lesser
@ -15,8 +17,6 @@
* 4-in-1 Multicart ( Reset-based )
*/
#pragma once
#include "Nes_Mapper.h"
// NROM-128 4-in-1 multicart

View File

@ -5,7 +5,6 @@
// Nes_Emu 0.7.0. http://www.slack.net/~ant/libs/
#include "Nes_Mapper.h"
#include "blargg_endian.h"
#include "audio/fme7/apu.h"
/* Copyright (C) 2005 Chris Moeller */

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2018
*
@ -21,8 +23,6 @@
*
*/
#pragma once
#include "Nes_Mapper.h"
// Mapper_74x161x162x32

View File

@ -1,9 +1,9 @@
#pragma once
// Optional less-common simple mappers
// Nes_Emu 0.7.0. http://www.slack.net/~ant/
#pragma once
#include "Nes_Mapper.h"
/* Copyright (C) 2004-2006 Shay Green. This module is free software; you

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2018
*
@ -21,8 +23,6 @@
* VRC-3 Konami, Salamander
*/
#pragma once
#include "Nes_Mapper.h"
struct vrc3_state_t

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright (C) 2018.
* This module is free software; you
* can redistribute it and/or modify it under the terms of the GNU Lesser
@ -15,8 +17,6 @@
* VRC-1 Konami
*/
#pragma once
#include "Nes_Mapper.h"
struct vrc1_state_t

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2018
*
@ -25,8 +27,6 @@
#include "Nes_Mapper.h"
#pragma once
template < bool multicart >
class Mapper_AveNina : public Nes_Mapper {
public:

View File

@ -2,10 +2,9 @@
// Nes_Emu 0.5.4. http://www.slack.net/~ant/
#include <cstring>
#include "Nes_Mapper.h"
#include "audio/vrc7/apu.h"
#include "blargg_endian.h"
#include <cstring>
/* Copyright (C) 2004-2005 Shay Green. This module is free software; you
can redistribute it and/or modify it under the terms of the GNU Lesser

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2018
*
@ -19,6 +21,4 @@
*
*/
#pragma once
typedef Mapper_74x161x162x32<86> Mapper086;

View File

@ -1,10 +1,8 @@
#pragma once
// Optional less-common simple mappers
// Nes_Emu 0.7.0. http://www.slack.net/~ant/
#pragma once
#include "Nes_Mapper.h"
/* Copyright (C) 2004-2006 Shay Green. This module is free software; you

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2018
*
@ -23,8 +25,6 @@
* Mapper 206
*/
#pragma once
#include "Nes_Mapper.h"
struct namco_34x3_state_t

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2018
*
@ -20,8 +22,6 @@
* Mapper 93 - Sunsoft-2
*/
#pragma once
#include "Nes_Mapper.h"
// Sunsoft2b

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2018
*
@ -20,8 +22,6 @@
* Mapper 93 - Sunsoft-2
*/
#pragma once
#include "Nes_Mapper.h"
// Sunsoft2a

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2018
*
@ -22,8 +24,6 @@
*
*/
#pragma once
#include "Nes_Mapper.h"
// Un1rom

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2018
*
@ -21,8 +23,6 @@
*
*/
#pragma once
#include "Nes_Mapper.h"
// Irem_Tam_S1

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2018
*
@ -23,6 +25,4 @@
* Nina-03 / Nina-06
*/
#pragma once
typedef Mapper_AveNina<true> Mapper113;

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2018
*
@ -22,8 +24,6 @@
*
*/
#pragma once
#include "Nes_Mapper.h"
// Jaleco_JF11

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2018
*
@ -19,6 +21,4 @@
*
*/
#pragma once
typedef Mapper_74x161x162x32<152> Mapper152;

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2018
*
@ -23,6 +25,4 @@
* Mapper 206
*/
#pragma once
typedef Mapper_Namco_34x3<true> Mapper154;

View File

@ -1,6 +1,7 @@
#include "Nes_Mapper.h"
#pragma once
#include "Nes_Mapper.h"
// DIS23C01 DAOU ROM CONTROLLER
struct m156_state_t

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2018
*
@ -20,8 +22,6 @@
* Mapper 180 Crazy Climber
*
*/
#pragma once
#include "Nes_Mapper.h"

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2018
*
@ -20,8 +22,6 @@
* Mapper 184 - Sunsoft-1
*/
#pragma once
#include "Nes_Mapper.h"
// Sunsoft1

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2018
*
@ -23,8 +25,6 @@
*
*/
#pragma once
#include "Nes_Mapper.h"
// NTDEC's TC-112 mapper IC.

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2018
*
@ -23,8 +25,6 @@
* Mapper 206
*/
#pragma once
#include "Nes_Mapper.h"
struct namco_34xx_state_t

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2018
*
@ -21,8 +23,6 @@
*
*/
#pragma once
#include "Nes_Mapper.h"
struct taito_x1005_state_t

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2018
*
@ -19,8 +21,6 @@
*
*/
#pragma once
#include "Nes_Mapper.h"
// https://www.nesdev.org/wiki/INES_Mapper240

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2018
*
@ -19,8 +21,6 @@
*
*/
#pragma once
#include "Nes_Mapper.h"
// https://www.nesdev.org/wiki/INES_Mapper241

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2018
*
@ -21,8 +23,6 @@
*
*/
#pragma once
#include "Nes_Mapper.h"
// https://www.nesdev.org/wiki/INES_Mapper244

View File

@ -1,3 +1,5 @@
#pragma once
/* Copyright notice for this file:
* Copyright (C) 2018
*
@ -21,8 +23,6 @@
*
*/
#pragma once
#include "Nes_Mapper.h"
// https://www.nesdev.org/wiki/INES_Mapper246