2011-01-29 09:48:44 +00:00
|
|
|
struct Cartridge : MMIO, property<Cartridge> {
|
2011-01-02 04:46:54 +00:00
|
|
|
#include "mbc0/mbc0.hpp"
|
|
|
|
#include "mbc1/mbc1.hpp"
|
2011-01-03 04:28:36 +00:00
|
|
|
#include "mbc2/mbc2.hpp"
|
2011-01-04 10:42:27 +00:00
|
|
|
#include "mbc3/mbc3.hpp"
|
2011-01-03 04:28:36 +00:00
|
|
|
#include "mbc5/mbc5.hpp"
|
2011-01-05 09:59:22 +00:00
|
|
|
#include "mmm01/mmm01.hpp"
|
|
|
|
#include "huc1/huc1.hpp"
|
|
|
|
#include "huc3/huc3.hpp"
|
2011-01-02 04:46:54 +00:00
|
|
|
|
|
|
|
enum Mapper : unsigned {
|
|
|
|
MBC0,
|
|
|
|
MBC1,
|
2011-01-03 04:28:36 +00:00
|
|
|
MBC2,
|
2011-01-04 10:42:27 +00:00
|
|
|
MBC3,
|
2011-01-03 04:28:36 +00:00
|
|
|
MBC5,
|
2011-01-05 09:59:22 +00:00
|
|
|
MMM01,
|
|
|
|
HuC1,
|
|
|
|
HuC3,
|
2011-01-02 04:46:54 +00:00
|
|
|
Unknown,
|
|
|
|
};
|
2010-12-29 11:03:42 +00:00
|
|
|
|
2010-12-28 01:53:15 +00:00
|
|
|
struct Information {
|
Update to v087r30 release.
byuu says:
Changelog:
- DMA channel masks added (some are 27-bit source/target and some are
14-bit length -- hooray, varuint_t class.)
- No more state.pending flags. Instead, we set dma.pending flag when we
want a transfer (fixes GBA Video - Pokemon audio) [Cydrak]
- fixed OBJ Vmosaic [Cydrak, krom]
- OBJ cannot read <=0x13fff in BG modes 3-5 (fixes the garbled tile at
the top-left of some games)
- DMA timing should be much closer to hardware now, but probably not
perfect
- PPU frame blending uses blargg's bit-perfect, rounded method (slower,
but what can you do?)
- GBA carts really unload now
- added nall/gba/cartridge.hpp: used when there is no manifest. Scans
ROMs for library tags, and selects the first valid one found
- added EEPROM auto-detection when EEPROM size=0. Forces disk/save state
size to 8192 (otherwise states could crash between pre and post
detect.)
- detects first read after a set read address command when the size
is zero, and sets all subsequent bit-lengths to that value, prints
detected size to terminal
- added nall/nes/cartridge.hpp: moves iNES detection out of emulation
core.
Important to note: long-term goal is to remove all
nall/(system)/cartridge.hpp detections from the core and replace with
databases. All in good time.
Anyway, the GBA workarounds should work for ~98.5% of the library, if my
pre-scanning was correct (~40 games with odd tags. I reject ones without
numeric versions now, too.)
I think we're basically at a point where we can release a new version
now. Compatibility should be relatively high (at least for a first
release), and fixes are only going to affect one or two games at a time.
I'd like to start doing some major cleaning house internally (rename
NES->Famicom, SNES->SuperFamicom and such.) Would be much wiser to do
that on a .01 WIP to minimize regressions.
The main problems with a release now:
- speed is pretty bad, haven't really optimized much yet (not sure how
much we can improve it yet, this usually isn't easy)
- sound isn't -great-, but the GBA audio sucks anyway :P
- couple of known bugs (Sonic X video, etc.)
2012-04-22 10:49:19 +00:00
|
|
|
string markup;
|
2011-01-02 04:46:54 +00:00
|
|
|
|
2011-01-03 04:28:36 +00:00
|
|
|
Mapper mapper;
|
|
|
|
bool ram;
|
|
|
|
bool battery;
|
|
|
|
bool rtc;
|
|
|
|
bool rumble;
|
2011-01-02 04:46:54 +00:00
|
|
|
|
2010-12-28 01:53:15 +00:00
|
|
|
unsigned romsize;
|
|
|
|
unsigned ramsize;
|
Update to v087r30 release.
byuu says:
Changelog:
- DMA channel masks added (some are 27-bit source/target and some are
14-bit length -- hooray, varuint_t class.)
- No more state.pending flags. Instead, we set dma.pending flag when we
want a transfer (fixes GBA Video - Pokemon audio) [Cydrak]
- fixed OBJ Vmosaic [Cydrak, krom]
- OBJ cannot read <=0x13fff in BG modes 3-5 (fixes the garbled tile at
the top-left of some games)
- DMA timing should be much closer to hardware now, but probably not
perfect
- PPU frame blending uses blargg's bit-perfect, rounded method (slower,
but what can you do?)
- GBA carts really unload now
- added nall/gba/cartridge.hpp: used when there is no manifest. Scans
ROMs for library tags, and selects the first valid one found
- added EEPROM auto-detection when EEPROM size=0. Forces disk/save state
size to 8192 (otherwise states could crash between pre and post
detect.)
- detects first read after a set read address command when the size
is zero, and sets all subsequent bit-lengths to that value, prints
detected size to terminal
- added nall/nes/cartridge.hpp: moves iNES detection out of emulation
core.
Important to note: long-term goal is to remove all
nall/(system)/cartridge.hpp detections from the core and replace with
databases. All in good time.
Anyway, the GBA workarounds should work for ~98.5% of the library, if my
pre-scanning was correct (~40 games with odd tags. I reject ones without
numeric versions now, too.)
I think we're basically at a point where we can release a new version
now. Compatibility should be relatively high (at least for a first
release), and fixes are only going to affect one or two games at a time.
I'd like to start doing some major cleaning house internally (rename
NES->Famicom, SNES->SuperFamicom and such.) Would be much wiser to do
that on a .01 WIP to minimize regressions.
The main problems with a release now:
- speed is pretty bad, haven't really optimized much yet (not sure how
much we can improve it yet, this usually isn't easy)
- sound isn't -great-, but the GBA audio sucks anyway :P
- couple of known bugs (Sonic X video, etc.)
2012-04-22 10:49:19 +00:00
|
|
|
} information;
|
2010-12-28 01:53:15 +00:00
|
|
|
|
2012-05-26 08:18:42 +00:00
|
|
|
struct Memory {
|
|
|
|
unsigned id;
|
|
|
|
string name;
|
|
|
|
};
|
|
|
|
vector<Memory> memory;
|
|
|
|
|
2010-12-28 01:53:15 +00:00
|
|
|
readonly<bool> loaded;
|
2011-09-22 00:00:21 +00:00
|
|
|
readonly<string> sha256;
|
2010-12-28 01:53:15 +00:00
|
|
|
|
2010-12-29 11:03:42 +00:00
|
|
|
uint8_t *romdata;
|
|
|
|
unsigned romsize;
|
|
|
|
|
|
|
|
uint8_t *ramdata;
|
|
|
|
unsigned ramsize;
|
|
|
|
|
2011-01-29 09:48:44 +00:00
|
|
|
MMIO *mapper;
|
|
|
|
bool bootrom_enable;
|
|
|
|
|
Update to v089r08 release.
byuu says:
Changelog:
- Super Game Boy, BS-X Satellaview and Sufami Turbo cartridges all load
manifests that specify their file names, and they all work
- Sufami Turbo can now properly handle carts without RAM, or empty slots
entirely
- Emulator::Interface structures no longer specify any file names, ever
- exposed "capability.(cheats,states)" now. So far, this just means the
GBA doesn't show the cheat editor, since it doesn't support cheat
codes yet
- as such, state manager and cheat editor windows auto-hide (may be
a tiny bit inconvenient, but it makes not having to sync them or deal
with input when no cart is loaded easier)
- added "AbsoluteInput" type, which returns mouse coordinates from
-32767,-32767 (top left) to +32767,+32767 (bottom right) or
-32768,-32768 (offscreen)
AbsoluteInput is just something I'm toying with. Idea is to support eg
Super Scope or Justifier, or possibly some future Famicom controllers
that are absolute-indexed. The coordinates are scaled, so the bigger
your window, the more precise they are. But obviously you can't get more
precise than the emulated system, so 1x scale will behave the same
anyway. I haven't hooked it up yet, need to mess with the idea of custom
cursors via phoenix for that first. Also not sure if it will feel
smoother or not ... if you resize the window, your mouse will seem to
move slower. Still, not having to capture the mouse for SS/JS may be
nicer yet. But we'll see ... just experimenting for now.
2012-05-27 23:50:50 +00:00
|
|
|
void load(System::Revision revision, const string &manifest);
|
2010-12-28 01:53:15 +00:00
|
|
|
void unload();
|
2010-12-29 11:03:42 +00:00
|
|
|
|
2011-01-02 04:46:54 +00:00
|
|
|
uint8 rom_read(unsigned addr);
|
|
|
|
void rom_write(unsigned addr, uint8 data);
|
|
|
|
uint8 ram_read(unsigned addr);
|
|
|
|
void ram_write(unsigned addr, uint8 data);
|
|
|
|
|
2011-01-29 09:48:44 +00:00
|
|
|
uint8 mmio_read(uint16 addr);
|
|
|
|
void mmio_write(uint16 addr, uint8 data);
|
|
|
|
|
2010-12-29 11:03:42 +00:00
|
|
|
void power();
|
|
|
|
|
2011-01-07 11:11:56 +00:00
|
|
|
void serialize(serializer&);
|
2010-12-28 01:53:15 +00:00
|
|
|
Cartridge();
|
2010-12-29 11:03:42 +00:00
|
|
|
~Cartridge();
|
2010-12-28 01:53:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern Cartridge cartridge;
|