bsnes/higan/nall/varint.hpp

169 lines
7.5 KiB
C++
Raw Normal View History

#ifndef NALL_VARINT_HPP
#define NALL_VARINT_HPP
#include <nall/bit.hpp>
#include <nall/traits.hpp>
namespace nall {
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
template<unsigned bits> struct uint_t {
private:
typedef typename type_if<bits <= 8 * sizeof(unsigned), unsigned, uintmax_t>::type type_t;
type_t data;
public:
inline operator type_t() const { return data; }
Update to v087 release. byuu says: This release adds ST018 emulation. As this was the final unsupported SNES coprocessor, this means that bsnes v087 is the first SNES emulator to be able to claim 100% known compatibility with all officially released games. And it does this with absolutely no hacks. Again, I really have to stress the word known. No emulator is perfect. No emulator ever really can be perfect for a system of this complexity. The concept doesn't even really exist, since every SNES behaves subtly different. What I mean by this, is that every single game ever officially sold has been tested, and zero bugs (of any severity level) are currently known. It is of course extremely likely that bugs will be found in this release, as well as in future releases. But this will always be a problem for every emulator ever made: there is no way to test every possible codepath of every single game to guarantee perfection. I will, of course, continue to do my best to fix newfound bugs so long as I'm around. I'd really like to thank Cydrak and LostTemplar for their assistance in emulating the ST018. I could not have done it without their help. The ST018 ROM, like the other coprocessor ROMs, is copyrighted. This means I am unable to distribute the image. Changelog (since v086): - emulated the 21.47MHz ST018 (ARMv3) coprocessor used by Hayazashi Nidan Morita Shougi 2 - fixed PPU TM/TS edge case; fixes bottom scanline of text boxes in Moryo Senki Madara 2 - fixed saving and loading of Super Game Boy save RAM - NEC uPD7725,96050 ROMs now stored in little-endian format for consistency - cartridge folder concept has been reworked to use fixed file names - added emulation of serial USART interface (replaces asynchronous UART support previously)
2012-03-07 13:29:38 +00:00
inline type_t operator ++(int) { type_t r = data; data = uclip<bits>(data + 1); return r; }
inline type_t operator --(int) { type_t r = data; data = uclip<bits>(data - 1); return r; }
inline type_t operator ++() { return data = uclip<bits>(data + 1); }
inline type_t operator --() { return data = uclip<bits>(data - 1); }
inline type_t operator =(const type_t i) { return data = uclip<bits>(i); }
inline type_t operator |=(const type_t i) { return data = uclip<bits>(data | i); }
inline type_t operator ^=(const type_t i) { return data = uclip<bits>(data ^ i); }
inline type_t operator &=(const type_t i) { return data = uclip<bits>(data & i); }
inline type_t operator<<=(const type_t i) { return data = uclip<bits>(data << i); }
inline type_t operator>>=(const type_t i) { return data = uclip<bits>(data >> i); }
inline type_t operator +=(const type_t i) { return data = uclip<bits>(data + i); }
inline type_t operator -=(const type_t i) { return data = uclip<bits>(data - i); }
inline type_t operator *=(const type_t i) { return data = uclip<bits>(data * i); }
inline type_t operator /=(const type_t i) { return data = uclip<bits>(data / i); }
inline type_t operator %=(const type_t i) { return data = uclip<bits>(data % i); }
inline uint_t() : data(0) {}
Update to v087 release. byuu says: This release adds ST018 emulation. As this was the final unsupported SNES coprocessor, this means that bsnes v087 is the first SNES emulator to be able to claim 100% known compatibility with all officially released games. And it does this with absolutely no hacks. Again, I really have to stress the word known. No emulator is perfect. No emulator ever really can be perfect for a system of this complexity. The concept doesn't even really exist, since every SNES behaves subtly different. What I mean by this, is that every single game ever officially sold has been tested, and zero bugs (of any severity level) are currently known. It is of course extremely likely that bugs will be found in this release, as well as in future releases. But this will always be a problem for every emulator ever made: there is no way to test every possible codepath of every single game to guarantee perfection. I will, of course, continue to do my best to fix newfound bugs so long as I'm around. I'd really like to thank Cydrak and LostTemplar for their assistance in emulating the ST018. I could not have done it without their help. The ST018 ROM, like the other coprocessor ROMs, is copyrighted. This means I am unable to distribute the image. Changelog (since v086): - emulated the 21.47MHz ST018 (ARMv3) coprocessor used by Hayazashi Nidan Morita Shougi 2 - fixed PPU TM/TS edge case; fixes bottom scanline of text boxes in Moryo Senki Madara 2 - fixed saving and loading of Super Game Boy save RAM - NEC uPD7725,96050 ROMs now stored in little-endian format for consistency - cartridge folder concept has been reworked to use fixed file names - added emulation of serial USART interface (replaces asynchronous UART support previously)
2012-03-07 13:29:38 +00:00
inline uint_t(const type_t i) : data(uclip<bits>(i)) {}
Update to v087 release. byuu says: This release adds ST018 emulation. As this was the final unsupported SNES coprocessor, this means that bsnes v087 is the first SNES emulator to be able to claim 100% known compatibility with all officially released games. And it does this with absolutely no hacks. Again, I really have to stress the word known. No emulator is perfect. No emulator ever really can be perfect for a system of this complexity. The concept doesn't even really exist, since every SNES behaves subtly different. What I mean by this, is that every single game ever officially sold has been tested, and zero bugs (of any severity level) are currently known. It is of course extremely likely that bugs will be found in this release, as well as in future releases. But this will always be a problem for every emulator ever made: there is no way to test every possible codepath of every single game to guarantee perfection. I will, of course, continue to do my best to fix newfound bugs so long as I'm around. I'd really like to thank Cydrak and LostTemplar for their assistance in emulating the ST018. I could not have done it without their help. The ST018 ROM, like the other coprocessor ROMs, is copyrighted. This means I am unable to distribute the image. Changelog (since v086): - emulated the 21.47MHz ST018 (ARMv3) coprocessor used by Hayazashi Nidan Morita Shougi 2 - fixed PPU TM/TS edge case; fixes bottom scanline of text boxes in Moryo Senki Madara 2 - fixed saving and loading of Super Game Boy save RAM - NEC uPD7725,96050 ROMs now stored in little-endian format for consistency - cartridge folder concept has been reworked to use fixed file names - added emulation of serial USART interface (replaces asynchronous UART support previously)
2012-03-07 13:29:38 +00:00
template<unsigned s> inline type_t operator=(const uint_t<s> &i) { return data = uclip<bits>((type_t)i); }
template<unsigned s> inline uint_t(const uint_t<s> &i) : data(uclip<bits>(i)) {}
};
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
template<unsigned bits> struct int_t {
private:
typedef typename type_if<bits <= 8 * sizeof(signed), signed, intmax_t>::type type_t;
type_t data;
public:
inline operator type_t() const { return data; }
Update to v087 release. byuu says: This release adds ST018 emulation. As this was the final unsupported SNES coprocessor, this means that bsnes v087 is the first SNES emulator to be able to claim 100% known compatibility with all officially released games. And it does this with absolutely no hacks. Again, I really have to stress the word known. No emulator is perfect. No emulator ever really can be perfect for a system of this complexity. The concept doesn't even really exist, since every SNES behaves subtly different. What I mean by this, is that every single game ever officially sold has been tested, and zero bugs (of any severity level) are currently known. It is of course extremely likely that bugs will be found in this release, as well as in future releases. But this will always be a problem for every emulator ever made: there is no way to test every possible codepath of every single game to guarantee perfection. I will, of course, continue to do my best to fix newfound bugs so long as I'm around. I'd really like to thank Cydrak and LostTemplar for their assistance in emulating the ST018. I could not have done it without their help. The ST018 ROM, like the other coprocessor ROMs, is copyrighted. This means I am unable to distribute the image. Changelog (since v086): - emulated the 21.47MHz ST018 (ARMv3) coprocessor used by Hayazashi Nidan Morita Shougi 2 - fixed PPU TM/TS edge case; fixes bottom scanline of text boxes in Moryo Senki Madara 2 - fixed saving and loading of Super Game Boy save RAM - NEC uPD7725,96050 ROMs now stored in little-endian format for consistency - cartridge folder concept has been reworked to use fixed file names - added emulation of serial USART interface (replaces asynchronous UART support previously)
2012-03-07 13:29:38 +00:00
inline type_t operator ++(int) { type_t r = data; data = sclip<bits>(data + 1); return r; }
inline type_t operator --(int) { type_t r = data; data = sclip<bits>(data - 1); return r; }
inline type_t operator ++() { return data = sclip<bits>(data + 1); }
inline type_t operator --() { return data = sclip<bits>(data - 1); }
inline type_t operator =(const type_t i) { return data = sclip<bits>(i); }
inline type_t operator |=(const type_t i) { return data = sclip<bits>(data | i); }
inline type_t operator ^=(const type_t i) { return data = sclip<bits>(data ^ i); }
inline type_t operator &=(const type_t i) { return data = sclip<bits>(data & i); }
inline type_t operator<<=(const type_t i) { return data = sclip<bits>(data << i); }
inline type_t operator>>=(const type_t i) { return data = sclip<bits>(data >> i); }
inline type_t operator +=(const type_t i) { return data = sclip<bits>(data + i); }
inline type_t operator -=(const type_t i) { return data = sclip<bits>(data - i); }
inline type_t operator *=(const type_t i) { return data = sclip<bits>(data * i); }
inline type_t operator /=(const type_t i) { return data = sclip<bits>(data / i); }
inline type_t operator %=(const type_t i) { return data = sclip<bits>(data % i); }
inline int_t() : data(0) {}
Update to v087 release. byuu says: This release adds ST018 emulation. As this was the final unsupported SNES coprocessor, this means that bsnes v087 is the first SNES emulator to be able to claim 100% known compatibility with all officially released games. And it does this with absolutely no hacks. Again, I really have to stress the word known. No emulator is perfect. No emulator ever really can be perfect for a system of this complexity. The concept doesn't even really exist, since every SNES behaves subtly different. What I mean by this, is that every single game ever officially sold has been tested, and zero bugs (of any severity level) are currently known. It is of course extremely likely that bugs will be found in this release, as well as in future releases. But this will always be a problem for every emulator ever made: there is no way to test every possible codepath of every single game to guarantee perfection. I will, of course, continue to do my best to fix newfound bugs so long as I'm around. I'd really like to thank Cydrak and LostTemplar for their assistance in emulating the ST018. I could not have done it without their help. The ST018 ROM, like the other coprocessor ROMs, is copyrighted. This means I am unable to distribute the image. Changelog (since v086): - emulated the 21.47MHz ST018 (ARMv3) coprocessor used by Hayazashi Nidan Morita Shougi 2 - fixed PPU TM/TS edge case; fixes bottom scanline of text boxes in Moryo Senki Madara 2 - fixed saving and loading of Super Game Boy save RAM - NEC uPD7725,96050 ROMs now stored in little-endian format for consistency - cartridge folder concept has been reworked to use fixed file names - added emulation of serial USART interface (replaces asynchronous UART support previously)
2012-03-07 13:29:38 +00:00
inline int_t(const type_t i) : data(sclip<bits>(i)) {}
Update to v087 release. byuu says: This release adds ST018 emulation. As this was the final unsupported SNES coprocessor, this means that bsnes v087 is the first SNES emulator to be able to claim 100% known compatibility with all officially released games. And it does this with absolutely no hacks. Again, I really have to stress the word known. No emulator is perfect. No emulator ever really can be perfect for a system of this complexity. The concept doesn't even really exist, since every SNES behaves subtly different. What I mean by this, is that every single game ever officially sold has been tested, and zero bugs (of any severity level) are currently known. It is of course extremely likely that bugs will be found in this release, as well as in future releases. But this will always be a problem for every emulator ever made: there is no way to test every possible codepath of every single game to guarantee perfection. I will, of course, continue to do my best to fix newfound bugs so long as I'm around. I'd really like to thank Cydrak and LostTemplar for their assistance in emulating the ST018. I could not have done it without their help. The ST018 ROM, like the other coprocessor ROMs, is copyrighted. This means I am unable to distribute the image. Changelog (since v086): - emulated the 21.47MHz ST018 (ARMv3) coprocessor used by Hayazashi Nidan Morita Shougi 2 - fixed PPU TM/TS edge case; fixes bottom scanline of text boxes in Moryo Senki Madara 2 - fixed saving and loading of Super Game Boy save RAM - NEC uPD7725,96050 ROMs now stored in little-endian format for consistency - cartridge folder concept has been reworked to use fixed file names - added emulation of serial USART interface (replaces asynchronous UART support previously)
2012-03-07 13:29:38 +00:00
template<unsigned s> inline type_t operator=(const int_t<s> &i) { return data = sclip<bits>((type_t)i); }
template<unsigned s> inline int_t(const int_t<s> &i) : data(sclip<bits>(i)) {}
};
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
template<typename type_t> struct varuint_t {
private:
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
type_t data;
type_t mask;
public:
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
inline operator type_t() const { return data; }
inline type_t operator ++(int) { type_t r = data; data = (data + 1) & mask; return r; }
inline type_t operator --(int) { type_t r = data; data = (data - 1) & mask; return r; }
inline type_t operator ++() { return data = (data + 1) & mask; }
inline type_t operator --() { return data = (data - 1) & mask; }
inline type_t operator =(const type_t i) { return data = (i) & mask; }
inline type_t operator |=(const type_t i) { return data = (data | i) & mask; }
inline type_t operator ^=(const type_t i) { return data = (data ^ i) & mask; }
inline type_t operator &=(const type_t i) { return data = (data & i) & mask; }
inline type_t operator<<=(const type_t i) { return data = (data << i) & mask; }
inline type_t operator>>=(const type_t i) { return data = (data >> i) & mask; }
inline type_t operator +=(const type_t i) { return data = (data + i) & mask; }
inline type_t operator -=(const type_t i) { return data = (data - i) & mask; }
inline type_t operator *=(const type_t i) { return data = (data * i) & mask; }
inline type_t operator /=(const type_t i) { return data = (data / i) & mask; }
inline type_t operator %=(const type_t i) { return data = (data % i) & mask; }
inline void bits(type_t bits) { mask = (1ull << (bits - 1)) + ((1ull << (bits - 1)) - 1); data &= mask; }
inline varuint_t() : data(0ull), mask((type_t)~0ull) {}
inline varuint_t(const type_t i) : data(i), mask((type_t)~0ull) {}
};
}
Update to v085r08 release. byuu says: Changelog: - follow the Laevateinn topic to get most of it - also added NMI, IRQ step buttons to CPU debugger - also added trace masking + trace mask reset - also added memory export - cartridge loading is entirely folder-based now FitzRoy, I'll go ahead and make a second compromise with you for v086: I'll match the following: /path/to/SNES.sfc/*.sfc /path/to/NES.fc/*.prg, *.chr (split format) /path/to/NES.fc/*.fc (merged format) /path/to/GB.gb/*.gb /path/to/GBC.gbc/*.gbc Condition will be that there can only be one of each file. If there's more than one, it'll abort. That lets me name my ROMs as "Game.fc/Game.fc", and you can name yours as "Game.fc/cartridge.prg, cartridge.chr". Or whatever you want. We'll just go with that, see what fares out as the most popular, and then restrict it back to that method. The folder must have the .fc, etc extension though. That will be how we avoid false-positive folder matches. [Editor's note - the Laevateinn topic mentions these changes for v085r08: Added SMP/PPU breakpoints, SMP debugger, SMP stepping / tracing, memory editing on APU-bus / VRAM / OAM / CGRAM, save state menu, WRAM mirroring on breakpoints, protected MMIO memory regions (otherwise, viewing $002100 could crash your game.) Major missing components: - trace mask - trace mask clear / usage map clear - window geometry caching / sizing improvements - VRAM viewer - properties viewer - working memory export button The rest will most likely appear after v086 is released. ]
2012-02-12 05:35:40 +00:00
//typedefs
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
typedef nall::uint_t< 1> uint1_t;
typedef nall::uint_t< 2> uint2_t;
typedef nall::uint_t< 3> uint3_t;
typedef nall::uint_t< 4> uint4_t;
typedef nall::uint_t< 5> uint5_t;
typedef nall::uint_t< 6> uint6_t;
typedef nall::uint_t< 7> uint7_t;
//typedef nall::uint_t< 8> uint8_t;
typedef nall::uint_t< 9> uint9_t;
Update to v085r08 release. byuu says: Changelog: - follow the Laevateinn topic to get most of it - also added NMI, IRQ step buttons to CPU debugger - also added trace masking + trace mask reset - also added memory export - cartridge loading is entirely folder-based now FitzRoy, I'll go ahead and make a second compromise with you for v086: I'll match the following: /path/to/SNES.sfc/*.sfc /path/to/NES.fc/*.prg, *.chr (split format) /path/to/NES.fc/*.fc (merged format) /path/to/GB.gb/*.gb /path/to/GBC.gbc/*.gbc Condition will be that there can only be one of each file. If there's more than one, it'll abort. That lets me name my ROMs as "Game.fc/Game.fc", and you can name yours as "Game.fc/cartridge.prg, cartridge.chr". Or whatever you want. We'll just go with that, see what fares out as the most popular, and then restrict it back to that method. The folder must have the .fc, etc extension though. That will be how we avoid false-positive folder matches. [Editor's note - the Laevateinn topic mentions these changes for v085r08: Added SMP/PPU breakpoints, SMP debugger, SMP stepping / tracing, memory editing on APU-bus / VRAM / OAM / CGRAM, save state menu, WRAM mirroring on breakpoints, protected MMIO memory regions (otherwise, viewing $002100 could crash your game.) Major missing components: - trace mask - trace mask clear / usage map clear - window geometry caching / sizing improvements - VRAM viewer - properties viewer - working memory export button The rest will most likely appear after v086 is released. ]
2012-02-12 05:35:40 +00:00
typedef nall::uint_t<10> uint10_t;
typedef nall::uint_t<11> uint11_t;
typedef nall::uint_t<12> uint12_t;
typedef nall::uint_t<13> uint13_t;
typedef nall::uint_t<14> uint14_t;
typedef nall::uint_t<15> uint15_t;
//typedef nall::uint_t<16> uint16_t;
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
Update to v085r08 release. byuu says: Changelog: - follow the Laevateinn topic to get most of it - also added NMI, IRQ step buttons to CPU debugger - also added trace masking + trace mask reset - also added memory export - cartridge loading is entirely folder-based now FitzRoy, I'll go ahead and make a second compromise with you for v086: I'll match the following: /path/to/SNES.sfc/*.sfc /path/to/NES.fc/*.prg, *.chr (split format) /path/to/NES.fc/*.fc (merged format) /path/to/GB.gb/*.gb /path/to/GBC.gbc/*.gbc Condition will be that there can only be one of each file. If there's more than one, it'll abort. That lets me name my ROMs as "Game.fc/Game.fc", and you can name yours as "Game.fc/cartridge.prg, cartridge.chr". Or whatever you want. We'll just go with that, see what fares out as the most popular, and then restrict it back to that method. The folder must have the .fc, etc extension though. That will be how we avoid false-positive folder matches. [Editor's note - the Laevateinn topic mentions these changes for v085r08: Added SMP/PPU breakpoints, SMP debugger, SMP stepping / tracing, memory editing on APU-bus / VRAM / OAM / CGRAM, save state menu, WRAM mirroring on breakpoints, protected MMIO memory regions (otherwise, viewing $002100 could crash your game.) Major missing components: - trace mask - trace mask clear / usage map clear - window geometry caching / sizing improvements - VRAM viewer - properties viewer - working memory export button The rest will most likely appear after v086 is released. ]
2012-02-12 05:35:40 +00:00
typedef nall::uint_t<17> uint17_t;
typedef nall::uint_t<18> uint18_t;
typedef nall::uint_t<19> uint19_t;
typedef nall::uint_t<20> uint20_t;
typedef nall::uint_t<21> uint21_t;
typedef nall::uint_t<22> uint22_t;
typedef nall::uint_t<23> uint23_t;
typedef nall::uint_t<24> uint24_t;
typedef nall::uint_t<25> uint25_t;
typedef nall::uint_t<26> uint26_t;
typedef nall::uint_t<27> uint27_t;
typedef nall::uint_t<28> uint28_t;
typedef nall::uint_t<29> uint29_t;
typedef nall::uint_t<30> uint30_t;
typedef nall::uint_t<31> uint31_t;
//typedef nall::uint_t<32> uint32_t;
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
typedef nall::int_t< 1> int1_t;
typedef nall::int_t< 2> int2_t;
typedef nall::int_t< 3> int3_t;
typedef nall::int_t< 4> int4_t;
typedef nall::int_t< 5> int5_t;
typedef nall::int_t< 6> int6_t;
typedef nall::int_t< 7> int7_t;
//typedef nall::int_t< 8> int8_t;
typedef nall::int_t< 9> int9_t;
Update to v085r08 release. byuu says: Changelog: - follow the Laevateinn topic to get most of it - also added NMI, IRQ step buttons to CPU debugger - also added trace masking + trace mask reset - also added memory export - cartridge loading is entirely folder-based now FitzRoy, I'll go ahead and make a second compromise with you for v086: I'll match the following: /path/to/SNES.sfc/*.sfc /path/to/NES.fc/*.prg, *.chr (split format) /path/to/NES.fc/*.fc (merged format) /path/to/GB.gb/*.gb /path/to/GBC.gbc/*.gbc Condition will be that there can only be one of each file. If there's more than one, it'll abort. That lets me name my ROMs as "Game.fc/Game.fc", and you can name yours as "Game.fc/cartridge.prg, cartridge.chr". Or whatever you want. We'll just go with that, see what fares out as the most popular, and then restrict it back to that method. The folder must have the .fc, etc extension though. That will be how we avoid false-positive folder matches. [Editor's note - the Laevateinn topic mentions these changes for v085r08: Added SMP/PPU breakpoints, SMP debugger, SMP stepping / tracing, memory editing on APU-bus / VRAM / OAM / CGRAM, save state menu, WRAM mirroring on breakpoints, protected MMIO memory regions (otherwise, viewing $002100 could crash your game.) Major missing components: - trace mask - trace mask clear / usage map clear - window geometry caching / sizing improvements - VRAM viewer - properties viewer - working memory export button The rest will most likely appear after v086 is released. ]
2012-02-12 05:35:40 +00:00
typedef nall::int_t<10> int10_t;
typedef nall::int_t<11> int11_t;
typedef nall::int_t<12> int12_t;
typedef nall::int_t<13> int13_t;
typedef nall::int_t<14> int14_t;
typedef nall::int_t<15> int15_t;
//typedef nall::int_t<16> int16_t;
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
Update to v085r08 release. byuu says: Changelog: - follow the Laevateinn topic to get most of it - also added NMI, IRQ step buttons to CPU debugger - also added trace masking + trace mask reset - also added memory export - cartridge loading is entirely folder-based now FitzRoy, I'll go ahead and make a second compromise with you for v086: I'll match the following: /path/to/SNES.sfc/*.sfc /path/to/NES.fc/*.prg, *.chr (split format) /path/to/NES.fc/*.fc (merged format) /path/to/GB.gb/*.gb /path/to/GBC.gbc/*.gbc Condition will be that there can only be one of each file. If there's more than one, it'll abort. That lets me name my ROMs as "Game.fc/Game.fc", and you can name yours as "Game.fc/cartridge.prg, cartridge.chr". Or whatever you want. We'll just go with that, see what fares out as the most popular, and then restrict it back to that method. The folder must have the .fc, etc extension though. That will be how we avoid false-positive folder matches. [Editor's note - the Laevateinn topic mentions these changes for v085r08: Added SMP/PPU breakpoints, SMP debugger, SMP stepping / tracing, memory editing on APU-bus / VRAM / OAM / CGRAM, save state menu, WRAM mirroring on breakpoints, protected MMIO memory regions (otherwise, viewing $002100 could crash your game.) Major missing components: - trace mask - trace mask clear / usage map clear - window geometry caching / sizing improvements - VRAM viewer - properties viewer - working memory export button The rest will most likely appear after v086 is released. ]
2012-02-12 05:35:40 +00:00
typedef nall::int_t<17> int17_t;
typedef nall::int_t<18> int18_t;
typedef nall::int_t<19> int19_t;
typedef nall::int_t<20> int20_t;
typedef nall::int_t<21> int21_t;
typedef nall::int_t<22> int22_t;
typedef nall::int_t<23> int23_t;
typedef nall::int_t<24> int24_t;
typedef nall::int_t<25> int25_t;
typedef nall::int_t<26> int26_t;
typedef nall::int_t<27> int27_t;
typedef nall::int_t<28> int28_t;
typedef nall::int_t<29> int29_t;
typedef nall::int_t<30> int30_t;
typedef nall::int_t<31> int31_t;
//typedef nall::int_t<32> int32_t;
#endif