2011-01-29 09:48:44 +00:00
|
|
|
struct Cartridge : MMIO, property<Cartridge> {
|
2015-11-21 07:36:48 +00:00
|
|
|
Cartridge();
|
|
|
|
~Cartridge();
|
|
|
|
|
|
|
|
auto load_empty(System::Revision revision) -> void;
|
|
|
|
auto load(System::Revision revision) -> void;
|
|
|
|
auto unload() -> void;
|
|
|
|
|
|
|
|
auto rom_read(uint addr) -> uint8;
|
|
|
|
auto rom_write(uint addr, uint8 data) -> void;
|
|
|
|
auto ram_read(uint addr) -> uint8;
|
|
|
|
auto ram_write(uint addr, uint8 data) -> void;
|
|
|
|
|
|
|
|
auto mmio_read(uint16 addr) -> uint8;
|
|
|
|
auto mmio_write(uint16 addr, uint8 data) -> void;
|
|
|
|
|
|
|
|
auto power() -> void;
|
|
|
|
|
|
|
|
auto serialize(serializer&) -> void;
|
|
|
|
|
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
|
|
|
|
2015-11-21 07:36:48 +00:00
|
|
|
enum Mapper : uint {
|
2011-01-02 04:46:54 +00:00
|
|
|
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;
|
Update to higan v091r14 and ananke v00r03 releases.
byuu says:
higan changelog:
- generates title displayed in emulator window by asking the core
- core builds title solely from "information/title" ... if it's not
there, you don't get a title at all
- sub-system load menu is gone ... since there are multiple revisions of
the SGB, this never really worked well anyway
- to load an SGB, BS-X or ST cartridge, load the base cartridge first
- "File->Load Game" moved to "Load->Import Game" ... may cause a bit of
confusion to new users, but I don't like having a single-item menu,
we'll just have to explain it to new users
- browser window redone to look like ananke
- home button here goes to ~/Emulation rather than just ~ like ananke,
since this is the home of game folders
- game folder icon is now the executable icon for the Tango theme
(orange diamond), meant to represent a complete game rather than
a game file or archive
ananke changelog:
- outputs GBC games to "Game Boy Color/" instead of "Game Boy/"
- adds the file basename to "information/title"
Known issues:
- using ananke to load a GB game trips the Super Famicom SGB mode and
fails (need to make the full-path auto-detection ignore non-bootable
systems)
- need to dump and test some BS-X media before releasing
- ananke lacks BS-X Satellaview cartridge support
- v092 isn't going to let you retarget the ananke/higan game folder path
of ~/Emulation, you will have to wait for a future version if that
bothers you so greatly
[Later, after the v092 release, byuu posted this additional changelog:
- kill laevateinn
- add title()
- add bootable, remove load
- combine file, library
- combine [][][] paths
- fix SFC subtype handling XML->BML
- update file browser to use buttons
- update file browser keyboard handling
- update system XML->BML
- fix sufami turbo hashing
- remove Cartridge::manifest
]
2012-12-25 05:31:55 +00:00
|
|
|
string title;
|
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
|
|
|
|
2015-11-21 07:36:48 +00:00
|
|
|
uint romsize;
|
|
|
|
uint 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
|
|
|
|
Update to higan v091r14 and ananke v00r03 releases.
byuu says:
higan changelog:
- generates title displayed in emulator window by asking the core
- core builds title solely from "information/title" ... if it's not
there, you don't get a title at all
- sub-system load menu is gone ... since there are multiple revisions of
the SGB, this never really worked well anyway
- to load an SGB, BS-X or ST cartridge, load the base cartridge first
- "File->Load Game" moved to "Load->Import Game" ... may cause a bit of
confusion to new users, but I don't like having a single-item menu,
we'll just have to explain it to new users
- browser window redone to look like ananke
- home button here goes to ~/Emulation rather than just ~ like ananke,
since this is the home of game folders
- game folder icon is now the executable icon for the Tango theme
(orange diamond), meant to represent a complete game rather than
a game file or archive
ananke changelog:
- outputs GBC games to "Game Boy Color/" instead of "Game Boy/"
- adds the file basename to "information/title"
Known issues:
- using ananke to load a GB game trips the Super Famicom SGB mode and
fails (need to make the full-path auto-detection ignore non-bootable
systems)
- need to dump and test some BS-X media before releasing
- ananke lacks BS-X Satellaview cartridge support
- v092 isn't going to let you retarget the ananke/higan game folder path
of ~/Emulation, you will have to wait for a future version if that
bothers you so greatly
[Later, after the v092 release, byuu posted this additional changelog:
- kill laevateinn
- add title()
- add bootable, remove load
- combine file, library
- combine [][][] paths
- fix SFC subtype handling XML->BML
- update file browser to use buttons
- update file browser keyboard handling
- update system XML->BML
- fix sufami turbo hashing
- remove Cartridge::manifest
]
2012-12-25 05:31:55 +00:00
|
|
|
string title();
|
|
|
|
|
2012-05-26 08:18:42 +00:00
|
|
|
struct Memory {
|
2015-11-21 07:36:48 +00:00
|
|
|
uint id;
|
2012-05-26 08:18:42 +00:00
|
|
|
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
|
|
|
|
2015-11-21 07:36:48 +00:00
|
|
|
uint8* romdata = nullptr;
|
|
|
|
uint romsize = 0;
|
2010-12-29 11:03:42 +00:00
|
|
|
|
2015-11-21 07:36:48 +00:00
|
|
|
uint8* ramdata = nullptr;
|
|
|
|
uint ramsize = 0;
|
2010-12-29 11:03:42 +00:00
|
|
|
|
2013-12-07 09:12:37 +00:00
|
|
|
MMIO* mapper = nullptr;
|
|
|
|
bool bootrom_enable = true;
|
2010-12-28 01:53:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern Cartridge cartridge;
|