bsnes by byuu ________________________________________________________________________________ Compiled using infos found on byuu's homepage and forums (http://byuu.org), on bsnes Dev Talk (http://board.zsnes.com/phpBB3/viewforum.php?f=22) and on the old bsnes thread (http://snesemu.black-ship.net/misc/archives/bsnes_thread.zip) ________________________________________________________________________________ 2012-08-10 - bsnes_v091-source.tar.xz A few issues crept up in the last release, this should take care of them. First, it seems that the 32-bit runtime on 64-bit versions of Windows have 64-bit time functions; whereas true 32-bit Windows does not. This was causing a DLL error when attempting to load bsnes v090. Second, when there were more than 2,000 files in the same folder on Windows, it was lagging the file browser. With OV2's help, I've fixed that and it'll now load the list instantly. Lastly, I've included the missing video shaders this time. ________________________________________________________________________________ 2012-08-07 - bsnes_v090-source.tar.xz Most notably, this release adds Nintendo DS emulation. The Nintendo DS module was written entirely by Cydrak, so please give him all of the credit for it. I for one am extremely grateful to be allowed to use his module in bsnes. The Nintendo DS emulator's standalone name is dasShiny. You will need the Nintendo DS firmware, which I cannot provide, in order to use it. It also cannot (currently?) detect the save type used by NDS games. As such, manifest.xml files must be created manually for this purpose. The long-term plan is to create a database of save types for each game. Also, you will need an analog input device for the touch screen for now (joypad axes work well.) There have also been a lot of changes from my end: a unified manifest.xml format across all systems, major improvements to SPC7110 emulation, enhancements to RTC emulation, MSU1 enhancements, icons in the file browser list, improvements to SNES coprocessor memory mapping, cleanups and improvements in the libraries used to build bsnes, etc. I've also included kaijuu (which allows launching game folders directly with bsnes) and purify (which allows opening images that are compressed, have copier headers, and have wrong extensions); both of which are fully GUI-based. This release only loads game folders, not files. Use purify to load ROM files in bsnes. Note that this will likely be the last release for a long time, and that I will probably rename the emulator for the next release, due to how many additional systems it now supports. ________________________________________________________________________________ 2012-08-06 - bsnes_v089r18.tar.bz2 Changelog: * fixed bsnes to let config files and system folders to be in the same folder as the executable * fixed RawInput driver to compile again without linear_vector * fixed phoenix/Windows to compile again without linear_vector * fixed old vs new name warnings on MinGW w64 (technically the warnings were erroneous, but I worked around them anyway) * added memory export hotkey (SNES driver only; mainly for FEoEZ translation) * restored WRAM randomization for v090 stability (we can discuss that idea for v091+) * fixed SuperFX / SA-1 "0x" prefix in the header generation (drop it into the latest purify if you want) * added nall/Makefile uname support for UnxUtils (was breaking compilation with full UnxUtils in your path otherwise) Won't fix issues: * Windows doesn't like too many files in the same folder? * something about input?, I don't know Please test as thoroughly as you can. I'd like to release v090 soon. ________________________________________________________________________________ 2012-07-15 - bsnes_v089r17.tar.bz2 purify_v00r06.tar.xz (no Windows binary, you have to compile it yourself) This implements the spec from the XML part 3 thread (http://board.byuu.org/viewtopic.php?f=16&t=2998) It's also propagated the changes to nall and purify, so you can test this one. This is basically it, after years of effort I feel I finally have a fully consistent and logical XML board format. The only things left to change will be: modifications if emulation turns out to be incorrect (eg we missed some MMIO mirrors, or mirrored too much), and new additions. And of course, I'm giving it a bit of time for good arguments against the format. Other than that, this release removes linear_vector and pointer_vector, as vector is better than linear_vector and I've never used pointer_vector. vector also gets move(), which is a way to use move-semantics across types. It lets you steal the underlying memory pool, effectively destroying the vector without a copy. This works really nicely with the move for read() functions to return vector instead of taking (uint8_t*&, unsigned&) parameters. ________________________________________________________________________________ 2012-07-10 - bsnes_v089r16.tar.bz2 Changelog: * eliminated , tags [they are merged to their parent nodes now] * added tag to EpsonRTC, SharpRTC * added tag to DSP-n, ST-01n, ST-018, Cx4 * interface->path(0) now returns the system folder, which can be used for storage now * as a fun proof-of-concept, I've simulated SNES warm power cycles by saving and loading work RAM (same effect if you instantly swapped carts) *** long-term, I'm not sure how I want to do this. The power menu option makes no sense with warm RAM *** I like the idea of decaying RAM based on timestamp from last play; and power can just force the timestamp to 0 (which will corrupt all RAM) * Interface::firmware is gone. The cores now load firmware inside their boot up routines * you now get a message on the screen if the emulator can't find firmware, should help with "I just get a black screen" messages I'd like to start preparing for a v090 release. I think we're almost there now. Have to update nall/cartridge and purify to handle XML changes first. ________________________________________________________________________________ 2012-07-09 - bsnes_v089r15.tar.bz2 Changelog: * SuperFX has its own ROM and RAM * Cx4 has its own ROM * SPC7110 has its own ProgramROM, DataROM and RAM * OBC1 has its own RAM * BsxCartridge has its own ROM, RAM and PSRAM * mapping changes to accommodate the above ________________________________________________________________________________ 2012-07-08 - bsnes_v089r14.tar.bz2 Changelog: * NSS emulation improvement (DIP is 8-bits, not 16-bits; can be remapped via XML now like all the other chips) * SA-1 memory map improvements (IRAM and BWRAM can be saved; ROM, IRAM and BWRAM are separate from Cartridge::ROM, RAM; no MCU) * S-DD1 memory map improvements (ROM, RAM inside mapping; no MCU) * SPC7110 memory map improvements (ROM, RAM inside mapping; no MCU; not finished yet [have to handle 8mbit expansion somehow now) ActRaiser (NSS): Code: Star Ocean (SDD1): Code: (The S-DD1 is the memory mapper; so even though RAM is mapped constantly, it is still behind the S-DD1 on the board.) Kirby's Dreamland 3 (SA1): Code: Far East of Eden Zero (SPC7110): [incomplete] Code: I have tried multiple times now to get the SuperFX core to use internal ROM and RAM (separate from Cartridge::ROM, RAM) to no avail. Not sure what the hell is going on there. Trace logs of 430MB are not enticing ... So right now: SuperFX, SPC7110 and BS-X cheat by mapping stuff to Cartridge::ROM, RAM still. They need to not do that. ________________________________________________________________________________ 2012-06-25 - bsnes_v089r13.tar.bz2 Fixes up loading issues with recent purify changes, and purify also works on BS/ST file types now and should be a bit more crash-resistant. ________________________________________________________________________________ 2012-06-17 - bsnes_v089r12.tar.bz2 Changelog: * Game Boy XML uses instead of * if you run bsnes with a filename argument, it will invoke "purify filename" and exit immediately *** this chains: purify will turn the file into a game folder, and then invoke bsnes with the game folder name ***** net result: you can drag a ZIP file onto bsnes or associate SMC headered ROMs with bsnes and they'll just work * new nall: unified usage of - vs _ vs nothing on filenames; fancier lstring; fancier image (constructor for creating from filename or from memory); etc * new phoenix: images in ListView, GTK+ merges the check box into the first column like the other targets do, etc * browser list now uses icons to differentiate system folders from game folders (the game folder icon sucks, I'm open to suggestions though, as long as it's available on Debian Squeeze in /usr/share/icons, no custom stuff please) ________________________________________________________________________________ 2012-06-05 - bsnes_v089r11.tar.bz2 Changelog: * SPC7110 $480b (and its settings in $4805-6 + $4807) is now fully emulated * decompressor restructured and commented accordingly The final parts remaining for the SPC7110 core, all within the decompression engine: * need to detect when 15+ input bytes are read for one output byte and simulate a crash somehow (don't have to perfectly simulate corrupted data stream) * need to emulate time required to decompress data (doesn't have to be perfect, just something other than instantaneous) * need to determine what $480c status flags d6-d0 are for, as best we can anyway ________________________________________________________________________________ 2012-05-30 - bsnes_v089r10.tar.bz2 Changelog: * Cydrak merged all three SPC7110 decompression routines into one, cuts the size in half * fixed masking of $4803.d7 and $4813.d7 * data port out of bounds accesses emulated correctly for app SPC7110 boards * all(?) data port $4810 reload cases now supported * basic timing for $4805-6 seeking; reworked delay timing to work better as well * fixed $480c.d7 flag (1 = ready, not busy) * AbsoluteInput returns -32768 if presentation window lacks focus and you don't always allow input I need to rethink how to emulate $4805-6 + $4807 at the same time. I understand how they both work in isolation, but combined it's going to be really tricky. Then we need to detect the edge case that crashes the real SPC7110 and stop feeding output. Not a perfect simulation but at least catches bad compressed data. Finally, I need to try and figure out what d6-d0 flags are for in $480c (decompression status register.) And then we'll call SPC7110 + RTC4513 emulation good enough until after the FEoEZ translation. We also need to go ahead and finalize the SNES XML markups before v090 as well. This one's not going to be fun at all. ________________________________________________________________________________ 2012-05-28 - bsnes_v089r09.tar.bz2 Changelog: * SPC7110 data port emulation greatly improved * SPC7110 $480b.d1 emulated (but $4805-4806 does not work right for mode 2 decompression yet) * MSU1 will read filenames from manifest now (defaults to msu1.rom and track-#.pcm if missing ... for now) * bugfixes with MSU1 load state and track seek (and $4804 was wrapping into $4805 to change the track#) * Link coprocessor removed (it was meant for ST018 HLE, which never happened) ________________________________________________________________________________ 2012-05-27 - bsnes_v089r08.tar.bz2 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-25 - bsnes_v089r07.tar.bz2 Not even purify makes compatible images for this WIP. Unless you want to figure it out yourself, I'd suggest waiting for an updated tool before using subsequent WIPs. Changelog: * MSU1 initializes data port + audio track to 0 * MSU1 implements audio track error flag on $2000.d3 * manifest.xml now controls file names for cartridge folders ... mostly Regressions: * Super Game Boy support is broken * Sufami Turbo support is broken So, basically Emulator::Interface() now has: void load(const string &manifest); void save(); The first one will analyze the manifest, and call all the ROM + RAM loadRequest() commands necessary to run the game. The second one will call saveRequest() commands on all writable and non-volatile storage (basically if it's a RAM type and has a filename specified, it gets saved to disk.) save() shrinks the size of Emulator::Interface() by hiding information one is unlikely to care about. It also makes it much easier to save. The core auto-calls this when you unload a game as well. So the only time you ever have to worry about it is if you want to save RAM files mid-game (in case you want to do periodic backups in case of a crash.) BSX only seems to work by some odd fluke, but all of the sub-carts have to be rethought. So that's going to be a pain in the ass for sure. We also may as well address MSU1 file naming as well. This change also makes a lot of manifest.xml markup more interesting. Do we claim BWRAM is the same thing as cartridge RAM? What about SA-1 ROM? Is that the same as cartridge ROM? Or how about the SPC7110? Do we have a tag, or do we put the ROM names inside +? I like the idea of having separate files for each tag. But right now, some things end up mapped both inside and outside of special chips, so a lot of work needs to be done to harmonize everything. ________________________________________________________________________________ 2012-05-24 - bsnes_v089r06.tar.bz2 I had some bugs in r07 that I couldn't track down, DKJM2's clock was getting all out of sync. So I just reverted to r05, blew away both RTCs entirely, and wrote them cleanly from scratch (obviously looking off the old code.) A bit extreme, but it worked. I believe I found the error in the process, day and month were resetting the counter to 0 instead of 1, it wasn't handling leap year, etc. While I was at it, I fixed the day-of-week calculation. The SharpRTC epoch is actually 1000-01-01, and not 1900-01-01. I'm sure you guys will be really happy that if it ever becomes 1000AD again and you're playing a ROM hack that uses the SharpRTC and relies on its weekday value that it will show the correct day now ... Kind of a pain to compute, but nothing compared to the seventh circle of hell that was my IBM dBase III Julian<>Gregorian conversion functions :/ Also found a few bugs in the Epson code this way. And I moved the round seconds actions and flag clear to +125us after flag set. So, if you had the old r06 or r07, please delete those. Unfortunately, this took all of my energy today, so the file names inside manifest changes will have to be in the next WIP. EDIT: ran a diff against old r07 and new r06. * added if(days == 31) case twice in EpsonRTC::tick_day() * forgot weekday = 0; in SharpRTC::load() * need to move the cartridge+cheat objects up in sfc/Makefile again * System::init() needs assert(interface != nullptr /* not 0 */) ________________________________________________________________________________ 2012-05-22 - bsnes_v089r07.tar.bz2 Changelog: * EpsonRTC emulation improved further (stop/pause blocks IRQs, verified secondhi >= 3 triggers 30-second adjust (even on invalid BCD), second-changed flag is mirrored to minute+hour+day+month+weekday, improved busy timing, etc.) * SharpRTC rewritten, works like EpsonRTC now in that it has its own timing thread and ticks with the emulation * won't attempt to read from an unopen file stream now (I think this is what was crashing Sufami Turbo without SRAM?) * added Tools -> Synchronize Time option below load/save state options. Only appears when you play a game with an emulated RTC chip Just realized that I used 125ms for the 30-second adjust instead of 125us, so I'll fix that in the next WIP. Aside from that, this is as good as the emulation is going to get. There's still a couple of absolutely psychopathic edge cases that are just too damn difficult to simulate. So that leaves us with data port control + decompression status registers to investigate before SPC7110 will be finished. I also still need to redo the BS-X RTC ... I'm not even sure if there is a time-set for it, right now I just return the current system time because of that And then lastly, there's the Game Boy RTC used by one of the memory mappers. Not sure if there are NES/GBA RTCs or not. ________________________________________________________________________________ 2012-05-21 - bsnes_v089r06.tar.bz2 Changelog: * renamed SRTC -> SharpRTC * renamed RTC4513 -> EpsonRTC (consistent with DSP naming schema) * full emulation of invalid BCD values for EpsonRTC * fixed EpsonRTC IRQ mask Remaining SPC7110 tasks: * RTC: test 30-second adjust with all values from 00-7f * RTC: hold is supposed to tick the clock one second after being released? * RTC: wait times are too long (need to use >32KHz oscillation to simulate it properly) * Data Port: test $4818 more thoroughly (not too important) * Decompression: test $480c more thoroughly (very important) * Decompression: perform some tests on DMA transferring data, especially with $4807 set Write-offs, at least for now: * Decompression: emulation of the crash/glitch behavior seen on the real chip when fed invalid data * Decompression: I can find no use of $4808 * ALU: Booth cycles for MUL/DIV (this could actually be rather important if the game reads simpler values quickly [some shoddy games did this with the CPU ALU]) * RTC: delay after hold release for $4841 accesses * RTC: 125uS delay after 30-second adjust that will screw with registers in odd ways if your read or write too soon * RTC: psychotic behavior of reading too early returning port address - 1 ________________________________________________________________________________ 2012-05-20 - bsnes_v089r05.tar.bz2 I split the RTC-4513 code from the SPC7110 code (and obviously in the XML mapping as well), since they are separate chips on the FEoEZ PCB. In this way, you can use just the RTC-4513 in homebrew now if you want. It's a bit nicer than the Sharp RTC from Dai Kaijuu Monogatari II. This was needed anyway, it has an internal oscillator that's not divisible by the SNES clock used by the SPC7110; and both the RTC and decompression code need to be running their own threads anyway. In the process, I rewrote the way variables are stored to use named integers rather than a block of memory. Makes the code a lot easier on the eyes, and more importantly, will make emulating bad BCD values a whole lot easier. ________________________________________________________________________________ 2012-05-18 - bsnes_v089r04.tar.bz2 Changelog: (SPC7110) * emulated $480b.d0 + $4807 deinterleave mode * cleaned up decompression core (I'd still like to wipe out those static variables, those are bad for save states.) * improved emulation of data port ($481a only increments, never reads) * improved emulation of RTC (block appropriate bits in the hour register based on 12/24h mode select; $4840 modes != 1 all disable the chip; added MDR; etc.) ________________________________________________________________________________ 2012-05-15 - bsnes_v089r03.tar.bz2 Substantial improvements to SPC7110 emulation. Added all of the findings from http://byuu.org/temp/spc7110-mmio.txt that I understood. I also completely rewrote the RTC. We only had about ~40% of the chip emulated before. Turns out there's cool stuff like spare RAM, calendar disable, 12-hour mode, IRQs, IRQ masking, duty cycles, etc. So I went ahead and emulated all of it. The upper bits on hour+ don't work as nocash described though, not sure what doc he was reading. The Epson RTC-4513 manual I have doesn't explain any of the registers. The new RTC core also ticks seconds based on the emulated clock, and not on the system clock. This is going to suck for people wanting to keep the in-game clock synced with their computer, who also abuse fast forward and save states. Fast forward makes the clock run faster, and save states will jump the clock to the time it was at when you took the save state. (It will keep track of the number of seconds between unloading the game and loading it again, so time passes normally there.) This is required, however, and how I'm going to rearrange all of the RTCs for all systems. Any other method can be detected by the game, and is thus not faithful emulation. To help with this, I'll probably make an RTC time tool so that you can adjust the time when the emulator isn't running, but I don't intend to bundle that into bsnes. New state format bit-packs the RTCRAM values, and it also uses a 64-bit timestamp. So it's 16 bytes now instead of 20 bytes. S-RTC will drop from 16 to 12 when it's done. The RTC busy flag timing needs to be refined with more hardware tests, there's a slim chance of the game hanging on save at the moment. The SPC7110 ALU delays are emulated now, too. They may not be perfectly accurate, but they get the basic gist down. The only hack that needs to be removed now is the decompression busy flag. That's ... not going to be fun. I also redid the mouse emulation. I was polling the mouse position multiple times per latch. So it should be a bit more precise now, I hope. I read it regardless of latch state, dunno if that's good or not. ________________________________________________________________________________ 2012-05-13 - bsnes_v089r02.tar.bz2 r02 changelog: * quick fix: SRAM is mapped to 00-3f|80-bf:6000-7fff * quick fix: $4830.d7 is SRAM chip enable, not SRAM write enable. Reads return 0x00 when this bit is clear ________________________________________________________________________________ 2012-05-13 - bsnes_v089r01.tar.bz2 r01 changelog: * major improvements to SPC7110 MCU (memory controller unit) * revised SPC7110 memory map to reflect aforementioned improvements * added "Toggle Tracer" hotkey to target-ethos (only works for SFC so far, I plan to use this as a lightweight laevateinn for FEoEZ) ________________________________________________________________________________ 2012-05-11 - bsnes_v089.tar.xz This release is going to be unique from previous releases. I am only recommending that developers use this version. As such, only the source archive has been posted. I strongly recommend against Linux package maintainers updating to this build. Casual users should wait for the next release. This release introduces a brand new user interface. It looks and functions exactly like the previous release, but it is built entirely on a declarative model: the GUI does not know about any individual systems that it supports. It pulls all of this information from a vector of emulated system objects instead. With the same amount of functionality, the new GUI is 66% smaller than the old GUI, code-wise. In fact, it actually does more. You can now easily add (and remove) entire systems from bsnes with only three lines of code. Input mapping is now more advanced and allows multiple bindings per input. But there is one critical thing it no longer does: the new GUI does not load individual ROM files. It requires the cartridge-folder concept that is still in development. It further requires a manifest to describe the PCB functionality. The code to handle both modes is cumbersome, and I did not wish to write it again. Right now, the problem is that we don't have user-friendly tools to make using cartridge folders easy. As such, this is why I've chosen not to release binaries this time. It's my hope that in the interim between v089 and v090, we can bring in developers willing to make the process completely transparent. And now is a perfect stopping point. Tom has just finished the English script translation for Far East of Eden Zero, so my efforts need to focus on reprogramming this game. This will require my absense from emulator programming for a while. Hopefully during that time, appropriate tools can be made for the next release. My hope is for v090 to be as easy to use as the old Qt releases were, with direct loading of compressed archives and headered images. That said, this release also fixes some reported emulation bugs. Mini Yonku Shining Scorpion was broken for a bit due to incorrect SA-1 register initialization. Air Strike Patrol surprises us with a second mid-scanline raster effect, which disproved an older theory of mine on the BG scroll registers, and is now emulated correctly as well. There is also a world of internal code restructuring. All processor instruction sets are separated from the functionality built on top of them (for instance, the ST018 and GBA can share core ARM instructions.) Now that libsnes has been superceded by libretro, I've moved to a complete emulator abstraction in C++ that works with all of my emulators. And last but not least, there's a new cheats.xml from mightymo bundled in this release as well. Changelog to v089: * fix SA-1 Mini Yonku Shining Scorpion * load from command-line * remove SNES::Cartridge::NVRAM * fix SGB save RAM * update cheats.xml * already mapped inputs cancel input assign BS-X wasn't broken after all. I forgot that I ran purify on my BS-X images, and that the BS Zelda ZIP I have has the disable ROM bit set. Whoops. ________________________________________________________________________________ 2012-05-08 - bsnes_v088r16.tar.bz2 Changelog: * fixed BGnxOFS to not cache when MOSAIC is not in effect [fixes Air Strike Patrol "Good Luck" text] * added GameBoy::Interface::Hook for SGB bindings [SGB works again] * do not create bsnes/ folder unless it is absolutely needed (eg you create a save state or state manager archive) * SuperFX works [needed to call system.init() in Interface::Interface()] Last chance for any bug reports, at this point I pretty much consider ethos to be finished. It's shipping without BS-X BIOS game loading support. Sorry, I can't figure that one out. So what's left at this point is refinement of purify. ________________________________________________________________________________ 2012-05-07 - bsnes_v088r15.tar.bz2 Changelog: * default placement of presentation window optimized for 1024x768 displays or larger (sorry if yours is smaller, move the window yourself.) * Direct3D waits until a previous Vblank ends before waiting for the next Vblank to begin (fixes video timing analysis, and ---really--- fast computers.) * Window::setVisible(false) clears modality, but also fixed in Browser code as well (fixes loading images on Windows hanging) * Browser won't consume full CPU resources (but timing analysis will, I don't want stalls to affect the results.) * closing settings window while analyzing stops analysis * you can load the SGB BIOS without a game (why the hell you would want to ...) * escape closes the Browser window (it won't close other dialogs, it has to be hooked up per-window) * just for fun, joypad hat up/down moves in Browser file list, any joypad button loads selected game [not very useful, lacks repeat, and there aren't GUI load file open buttons] * Super Scope and Justifier crosshairs render correctly (probably doesn't belong in the core, but it's not something I suspect people want to do themselves ...) * you can load GB, SGB, GB, SGB ... without problems (not happy with how I did this, but I don't want to add an Interface::setInterface() function yet) * PAL timing works as I want now (if you want 50fps on a 60hz monitor, you must not use sync video) [needed to update the DSP frequency when toggling video/audio sync] * not going to save input port selection for now (lot of work), but it will properly keep your port setting across cartridge loads at least [just goes to controller on emulator restart] * SFC overscan on and off both work as expected now (off centers image, on shows entire image) * laevateinn compiles properly now * ethos goes to ~/.config/bsnes now that target-ui is dead [honestly, I recommend deleting the old folder and starting over] * Emulator::Interface callbacks converted to virtual binding structure that GUI inherits from (simplifies binding callbacks) *** this breaks Super Game Boy for a bit, I need to rethink system-specific bindings without direct inheritance Timing analysis works spectacularly well on Windows, too. You won't get your 100% perfect rate (unless maybe you leave the analysis running overnight?), but it'll get really freaking close this way. ________________________________________________________________________________ 2012-05-06 - bsnes_v088r14.tar.bz2 Changelog: * added NSS DIP switch settings window (when loading NSS carts with appropriate manifest.xml file) * added video shader selection (they go in ~/.config/bsnes/Video Shaders/ now) * added driver selection * added timing settings (not only allows video/audio settings, also has code to dynamically compute the values for you ... and it actually works pretty good!) * moved "None" controller device to bottom of list (it is the least likely to be used, after all) * added Interface::path() to support MSU1, USART, Link * input and hotkey mappings remember list position after assignment * and more! target-ethos now has all of the functionality of target-ui, and more. Final code size for the port is 101.2KB (ethos) vs 167.6KB (ui). A ~67% reduction in code size, yet it does even more! And you can add or remove an entire system with only three lines of code (Makefile include, header include, interface append.) The only problem left is that the BS-X BIOS won't load the BS Zelda no Densetsu file. I can't figure out why it's not working, would appreciate any assistance, but otherwise I'm probably just going to leave it broken for v089, sorry. So the show stoppers for a new release at this point are: * fix laevateinn to compile with the new interface changes (shouldn't be too hard, it'll still use the old, direct interface.) * clean up Emulator::Interface as much as possible (trim down Information, mediaRequest should use an alternate struct designed to load firmware / slots separately) * enhance purify to strip SNES ROM headers, and it really needs a GUI interface * it would be highly desirable to make a launcher that can create a cartridge folder from an existing ROM set (* ethos will need to accept command-line arguments for this.) * probably need to remember which controller was selected in each port for each system across runs * need to fix the cursor for Super Scope / Justifier games (move from 19-bit to 32-bit colors broke it) * have to refactor that cache.(hv)offset thing to fix ASP ________________________________________________________________________________ 2012-05-06 - bsnes_v088r13.tar.bz2 Changelog: * fixed Super Game Boy input * Sufami Turbo prompts to load second slot now (you can cancel to leave it empty) * NEC/Hitachi/ARM DSP firmware is loaded; NEC RAM is saved * folders are grouped properly: Sufami Turbo save RAM saves to its slot folder, etc. * title shows properly (SGB shows GB game name only, BS-X slotted shows game name and optional slot name, etc.) *** above extends to saving cheats and such in their correct folders as well * added cheat editor and cheat database *** and hooked up the requisite SGB mode loads and can use GB cheats, because that's kinda cool * added state manager * input settings, cheat editor and state manager all have erase (one) and reset (all) buttons now * lots of cleanup and restructuring on Emulator::Interface; *almost* finished with it now Remaining: * BS-X BIOS won't show the data pack * need XML mapping information window * need NSS DIP switch settings window * need video shaders * need driver selection * need to hide controllers that have no inputs from the input mapping list (tempted to just remove "None" as a controller option ...) ethos is currently 88KB of code, ui is 167KB. We're missing about 5-10KB of code in ethos to complete it, so the rewrite nearly cut the GUI code size in half, while support all of the same functionality and allowing the easy addition and removal of entire systems. ________________________________________________________________________________ 2012-05-02 - bsnes_v088r11.tar.bz2 Changelog: * phoenix has added Window::setModal(bool modal = true); * file dialog is now modal. This allows emulation cores to request data and get it immediately before continuing the loading process * save data is hooked up for most systems, still need to handle subsystem slot saves (Sufami Turbo, basically.) * toggle fullscreen key binding added (Alt+Enter for now. I think F11 is probably better though, Enter is often mapped to game start button.) * video scaling is in (center, scale, stretch), works the same in windowed and fullscreen mode (stretch hides resize window option), all in the settings menu now * enough structure to map all saved paths for the browser and to load BS-X slotted carts, BS-X carts, single Sufami Turbo carts Caveats / Missing: * Super Game Boy input doesn't work yet (due to change in callback binding) * doesn't load secondary Sufami Turbo slot yet * BS-X BIOS isn't show the data pack games to load for some reason (ugh, I hate the shit out of debugging BS-X stuff ...) * need mute audio, sync audio+video toggle, save/load state menu and quick keys, XML mapping information window * need cheat editor and cheat database * need state manager * need to sort subsystems below main systems in load menu (basically just see if media.slot.size() > 0) * need video shaders (will probably leave off filters for the time being ... due to that 24/30-bit thing) * need video adjustments (contrast etc, overscan masks) * need audio adjustments (frequency, latency, resampler, volume, per-system frequency) * need driver selection and input focus policy (driver crash detection would be nice too) * need NSS DIP switch settings (that one will be really fun) * need to save and load window geometry settings * need to hook up controller selection (won't be fun), create a map to hide controllers with no inputs to reassign ________________________________________________________________________________ 2012-04-30 - bsnes_v088r10.tar.bz2 ethos is going to be absolutely amazing. You guys are in for a treat :D I'm impressing the hell out of myself with how well-structured this code is, it's allowing me to do amazing new things. Just a small sampling of what's in store (and already implemented): The file browser will display folders as "[ folder name ]", and cartridge folders as "Game Name" (no extension, no /) [icons would be nicer, but well ... phoenix.] Folders are sorted above cartridge folders. Cartridge folders for other systems do not show up in the list. Not only are unique paths stored for each image type, your position in the list is saved across runs. Some voodoo was added to GTK+ so that all targets even scroll directly to that item when you open the list. Load->System->Enter restarts your last game. That sounds really simple and obvious, but it makes an -incredible- difference. Didn't realize it until I tried an implementation of it, wow. The input mapping list now lets you bind as many hotkeys as you want to any given input. So SFC::Port1::Joypad::B = Keyboard::Z or Joypad::Button1 ... no need to remap everything to switch between keyboard and joypad. Either one activates the key. There is a separate Hotkeys tab now. This should hopefully end the confusion about how to remap hotkeys that users experience. Hotkeys are different, too. Instead of OR logic, they use AND logic. So Fullscreen = Keyboard::Alt and Keyboard::Enter. Both must be pressed to enter the key. This lets you easily implement "super" modifier keys. The actual codebase has new features the old UI never had, and has about ~50% of the old functionality (so far, of course), yet is only ~25% as much code. The entire GUI no longer needs to pull in all the headers for each emulated system. It just needs a small interface header file. Then bind the entire system with exactly **two** lines of code. Everything is dynamically generated for you after that. ________________________________________________________________________________ 2012-04-29 - bsnes_v088r09.tar.bz2 Lots of work on ethos, nothing more. Settings window is in, InputManager pulls all the inputs from all cores and binds them to ruby inputs, main window adds menu and dynamically maps in all systems and cartridge slots and options and such, file browser's back in, RAM is loaded and saved, etc. It's barely usable, but you have to set up your inputs from the config file by hand for now. ________________________________________________________________________________ 2012-04-28 - bsnes_v088r08.tar.bz2 From this WIP, I'm starting on the impossible task of a declarative-based GUI, which I'm calling Ethos. base/ becomes emulator/, and we add emulator/interface.hpp, which is a base API that all emulation cores must implement in full. (Right now, it's kind of a hybrid to work with the old GUI and the new GUI at the same time, of course.) Unlike the old interfaces, the new base class also provides all general usability hooks: loading and saving files and states, cheat codes, etc. The new interface also contains information and vector structs to describe all possible loading methods, controller bindings, etc; and gives names for them all. The actual GUI in fact should not include eg anymore. Should speed up GUI compilation. So the idea going forward is that ethos will build a list of emulators right when the application starts up. Once you've appended an emulator to that list, you're done. No more GUI changes are needed to support that system. The GUI will have code to parse the emulator interfaces list, and build all the requisite GUI options dynamically, declarative style. Ultimately, once the project is finished, the new GUI should look ~99% identical to the current GUI. But it'll probably be a whole lot smaller. Themaister should enjoy the new interface, since only a single wrapper will be needed for libretro to support all my emulation cores. ________________________________________________________________________________ 2012-04-28 - bsnes_v088r07.tar.bz2 (r05 and r06 were save points between large core modifications) I would really appreciate extensive regression testing (especially around SuperFX, Cx4, ST018, DSP-n, ST-01n, NES, GB) at this point. The most critical core changes should be completed now. And it was an unbelievable amount of restructuring. Changelog: * SuperFX core moved to Processor::GSU * SNES::CPU core moved to Processor::R65816 * SNES::SMP core moved to Processor::SPC700 * NES::CPU core renamed to Processor::R6502 * use filestream to load RAM files from interface * save states store SHA256 instead of CRC32 (CRC32 usage removed entirely from bsnes) * nes/ -> fc/ and NES -> FC * snes/ -> sfc/ and SNES -> SFC * SuperFamicom::MappedRAM::copy uses stream instead of data+size * Linux port uses gcc-4.7 (still using only gcc-4.6 subset, so you can make a gcc-4.6 symlink for now if you like.) * all profiles and all targets compile and work properly All eight instruction set cores have been moved to processor/ now. Consistency's a wonderful thing. The last remnants of NES/SNES are now limited to target-ui code; and the nall/(system) folder names. I'm building with gcc-4.7 on my Linux box now because the resultant binaries are up to 20% faster (seriously) than gcc-4.6. ... This is probably an impossible task, but I'd really like it if the GUI could have absolutely no concept of individuals systems. When it starts up, we attach "systems" to it from data files (eg those profile/manifest files ... easy to embed them right inside the emulator.) It would then build the input mapping lists, the frequency controls, the cartridge loaders, and the interfaces to the cores. Given the goal of exposing complete C++ interfaces for Themaister to wrap with libretro though, it would be wonderful to kill two birds with one stone. ________________________________________________________________________________ 2012-04-27 - bsnes_v088r04.tar.bz2 This will hopefully be a short-lived WIP, I just want to save a breakpoint before I attempt something else. NES, GB, GBC and GBA all load via const stream& now. NES CPU core moved to Processor::RP2A03. EDIT: yeah, that failed. Was a wise idea to do a save point after all. Trying to split SuperFX instructions to GSU core opcodes, but that chip is -much- more entangled than any other core. Eg the PLOT instruction calls into the screen drawing stuff that handles the pixel buffer caches. The CACHE instruction needs memory caching access. There's no separation between MMIO registers and internal processing registers (if such a distinction even exists ...), so all MMIO regs need to go into the struct Regs {} for the CPU core. And ... blech. Not good at all. The other two remaining cores, SNES::CPU and SNES::SMP, are already split between core opcodes and functionality on top. The CPU was done for SA-1 long ago, and the SMP was split for consistency with it long ago as well. All I really have to do is move those folders and rename the classes. It's going to bug me to have seven of eight CPU cores split up, and have one glaring inconsistency ... ________________________________________________________________________________ 2012-04-27 - bsnes_v088r03.tar.bz2 static vector file::read(const string &filename); replaces: static bool file::read(const string &filename, uint8_t *&data, unsigned &size); This allows automatic deletion of the underlying data. Added vectorstream, which is obviously a vector wrapper for a data stream. Plan is for all data accesses inside my emulation cores to take stream objects, especially MSU1. This lets you feed the core anything: memorystream, filestream, zipstream, gzipstream, httpstream, etc. There will still be exceptions for link and serial, those need actual library files on disk. But those aren't official hardware devices anyway. So to help with speed a bit, I'm rethinking the video rendering path. Previous system: * core outputs system-native samples (SNES = 19-bit LRGB, NES = 9-bit emphasis+palette, DMG = 2-bit grayscale, etc.) * interfaceSystem transforms samples to 30-bit via lookup table inside the emulation core * interfaceSystem masks off overscan areas, if enabled * interfaceUI runs filter to produce new target buffer, if enabled * interfaceUI transforms 30-bit video to native display depth (24-bit or 30-bit), and applies color-adjustments (gamma, etc) at the same time New system: * all cores now generate an internal palette, and call Interface::videoColor(uint32_t source, uint16_t red, uint16_t green, uint16_t blue) to get native display color post-adjusted (gamma, etc applied already.) * all cores output to uint32_t* buffer now (output video.palette[color] instead of just color) * interfaceUI runs filter to produce new target buffer, if enabled * interfaceUI memcpy()'s buffer to the video card videoColor() is pretty neat. source is the raw pixel (as per the old-format, 19-bit SNES, 9-bit NES, etc), and you can create a color from that if you really want to. Or return that value to get a buffer just like v088 and below. red, green, blue are 16-bits per channel, because why the hell not, right? Just lop off all the bits you don't want. If you have more bits on your display than that, fuck you :P The last step is extremely difficult to avoid. Video cards can and do have pitches that differ from the width of the texture. Trying to make the core account for this would be really awful. And even if we did that, the emulation routine would need to write directly to a video card RAM buffer. Some APIs require you to lock the video buffer while writing, so this would leave the video buffer locked for a long time. Probably not catastrophic, but still awful. And lastly, if the emulation core tried writing directly to the display texture, software filters would no longer be possible (unless you -really- jump through hooks and divert to a memory buffer when a filter is enabled, but ... fuck.) Anyway, the point of all that work was to eliminate an extra video copy, and the need for a really painful 30-bit to 24-bit conversion (three shifts, three masks, three array indexes.) So this basically reverts us, performance-wise, to where we were pre-30 bit support. Framerate difference (results will likely vary wildly): Zelda 3 SFC = 105.5 to 109.0 (will be more for compatibility profile, where the video copying was a bigger bottleneck) Mega Man 2 FC = 239.5 to 243.5 Mega Man 2 GB = 420.0 to 444.5 Mr. Driller 2 = 231.0 to 237.5 The downside to this is that we're going to need a filter for each output depth. Since the array type is uint32_t*, and I don't intend to support higher or lower depths, we really only need 24+30-bit versions of each filter. Kinda shitty, but oh well. ________________________________________________________________________________ 2012-04-26 - bsnes_v088r02.tar.bz2 Really no reason to download this one unless you want to stay on the absolute bleeding edge of phoenix development. Basically, the current implementation of nall/array is deprecated now. The old method was for non-reference types, it acted like a vector for POD types (raw memory allocation instead of placement new construction.) And for reference types, it acted like an unordered set. Yeah, not good. As of right now, nall/array is no longer used. The vector type usage was replaced with actual vectors. I've created nall/set, which now contains the specialization for reference types. nall/set basically acts much like std::unordered_set. No auto-sort, only one of each type is allowed, automatic growth. This will be the same both for reference and non-reference types ... however, the non-reference type wasn't implemented just yet. Future plans for nall/array are for it to be a statically allocated block of memory, ala array, which is meant for RAII memory usage. Have to work on the specifics, eg the size as a template parameter may be problematic. I'd like to return allocated chunks of memory (eg file::read) in this container so that I don't have to manually free the data anymore. I also removed nall/moduloarray, and moved that into the SNES DSP class, since that's the only thing that uses it. ________________________________________________________________________________ 2012-04-25 - bsnes_v088r01.tar.bz2 Code: * GB::CPU::Core -> Processor::LR35902 * Processor::LR35902 -> jump table to switch table * GB::LCD -> GB::PPU * static frequency for DMG (no multiplication on clock ticks) * GB::PPU::interface->videoRefresh() moved outside scheduler (use host thread) * namespace NES -> Famicom * namespace SNES -> SuperFamicom * namespace GB -> GameBoy * namespace GBA -> GameBoyAdvance * removed boot.rom writeout in GB::System Wishlist for v089: * libsnes++ (basically, cleaner C++ library interface to core for libretro to use) * internal filtering for matching hardware output effects (GB/GBA LCD blur, SNES pseudo-hires blending, possibly NES NTSC encoding, etc.) * internalize color conversion to -possibly- save an extra transformation ? * emulation improvements for NES, GB, GBC, GBA * speedups for GBA * complete GBA memory type database * GBA cheat codes * GBA cheat database ? * move NES::CPU (6502) to processor/ * move SNES::CPU (65816) to processor/ * move SNES::SMP (SPC700) to processor/ * move SNES::SuperFX::Core (GSU) to processor/ * all threads should be declared Class::Enter() { class.main(); } * nes -> fc, snes -> sfc ? * rewrite nall/array to be a static byte array rather than a POD-based vector class (get away from raw new / delete, where possible) ________________________________________________________________________________ 2012-04-24 - bsnes_v088-source.tar.xz As promised from the last news update, this release adds preliminary Game Boy Advance emulation. It's not perfect by any means, but it's one of the better first releases I've put out. It emulates all GBA functionality with the exception of the link cable and ROM prefetch buffer, although being a first release, there are bound to be plenty of bugs lurking in the core. I'd of course love some help with bugfixes, if anyone is interested =) It's important to note that the GBA emulation has not been optimized yet. The GBA is a more demanding system than the SNES, by way of a much faster CPU core and higher frequency audio. You can expect about ~150fps on average with a Core i7-class CPU for now, but please note that I do intend to improve upon this performance in future releases. For a bit of backstory: this is basically a byproduct of SNES ST018 emulation. This processor ended up using an ARMv3 CPU core. And since the GBA uses an ARMv4 CPU core, it seemed like a good choice: we could improve the ARM emulation for the ST018, and emulate the final 2D-based Nintendo system. In the end, it turned out to be harder than expected: it took about a month to complete the emulation core, and it was only this quick due to extensive help from Cydrak; who fixed numerous CPU bugs, emulated the affine and bitmap rendering modes, and also implemented the new GBA FIFO audio channel, among other things. On a side note, thanks to Cydrak and krom's hardware testing, we do have a nice milestone right out of the gate: proper OBJ mosaic emulation, which seems to be a first. At the very least, hopefully this will be helpful to other emulators. Note that you will need the GBA BIOS image to use this. There will not be any high-level emulation of the BIOS functions for obvious reasons. Name the file "bios.rom", and place it inside the "Game Boy Advance.sys" folder. Changes to v088: * OBJ mosaic Y fix * Laevateinn compilation * Remove filebrowser extra code * Fix -march=native on Windows * Fix purify mkdir * GBA sound volume * Add .gbb * free firmware memory after file load * Add GBA game to profile list (Yoshi's Island should work) Already noticed one miss: my GB core still writes out the SGB BIOS on startup (I was dumping my C struct to a file for the system folders.) Won't matter unless you happen to have write access to /home/byuu when you run bsnes. If you do, consider this my way of suggesting you choose a different name :P Didn't add a warning on BIOS missing, but let's be honest, we'd get a dozen posts about it even if I did. ________________________________________________________________________________ 2012-04-22 - bsnes_v087r30.tar.bz2 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-20 - bsnes_v087r29.tar.bz2 Changelog: * revised NES XML tag nesting * program.rom is going to refer to PRG+CHR combined. Split is going to have to use different file names * slot loader is gone (good riddance!) * "Cartridge -> Load Game Boy Advance Cartridge ..." has become "Load -> Game Boy Advance ..." * Load Satellaview Slotted Cartridge is gone. If you load an SNES cartridge and it sees , it asks if you want to load a BS-X data pack * If you load a Sufami Turbo cartridge with , it asks if you want to link in another Sufami Turbo cartridge * if you try and load the same exact Sufami Turbo cartridge in both slots, it yells at you for being an idiot :P ________________________________________________________________________________ 2012-04-18 - bsnes_v087r28.tar.bz2 Be sure to run make install, and move required images to their appropriate system profile folders. I still have no warnings in place if those images aren't present. Changelog: * OBJ mosaic should hopefully be emulated correctly now (thanks to krom and Cydrak for testing the hardware behavior) * emulated dummy serial registers, fixes Sonic Advance (you may still need to specify 512KB FlashROM with an appropriate ID, I used Panaonic's) * GBA core exits scheduler (PPU thread) and calls interface->videoRefresh() from main thread (not required, just nice) * SRAM, FRAM, EEPROM and FlashROM initialized to 0xFF if it does not exist (probably not needed, but FlashROM likes to reset to 0xFF anyway) * GBA manifest.xml for file-mode will now use "gamename.xml" instead of "gamename.gba.xml" * started renaming "NES" to "Famicom" and "SNES" to "Super Famicom" in the GUI (may or may not change source code in the long-term) * removed target-libsnes/ * added profile/ Profiles are the major new feature. So far we have: Code: Famicom.sys/{nothing (yet?)} Super Famicom.sys/{ipl.rom} Game Boy.sys/{boot.rom} Game Boy Color.sys/{boot.rom} Game Boy Advance.sys/{bios.rom[not included]} Super Game Boy.sfc/{boot.rom,program.rom[not included]} BS-X Satellaview.sfc/{program.rom,bsx.ram,bsx.pram} Sufami Turbo.sfc/{program.rom} The SGB, BSX and ST cartridges ask you to load GB, BS or ST cartridges directly now. No slot loader for them. So the obvious downsides: you can't quickly pick between different SGB BIOSes, but why would you want to? Just use SGB2/JP. It's still possible, so I'll sacrifice a little complexity for a rare case to make it a lot easier for the more common case. ST cartridges currently won't let you load the secondary slot. BS-X Town cart is the only useful game to load with nothing in the slot, but only barely, since games are all seeded on flash and not on PSRAM images. We can revisit a way to boot the BIOS directly if and when we get the satellite uplink emulated and data can be downloaded onto the PSRAM :P BS-X slotted cartridges still require the secondary slot. My plan for BS-X slotted cartridges is to require a manifest.xml to specify that it has the BS-X slot present. Otherwise, we have to load the ROM into the SNES cartridge class, and parse its header before we can find out if it has one. Screw that. If it's in the XML, I can tell before loading the ROM if I need to present you with an optional slot loading dialog. I will probably do something similar for Sufami Turbo. Not all games even work with a secondary slot, so why ask you to load a second slot for them? Let the XML request a second slot. A complete Sufami Turbo ROM set will be trivial anyway. Not sure how I want to do the sub dialog yet. We want basic file loading, but we don't want it to look like the dialog 'didn't do anything' if it pops back open immediately again. Maybe change the background color of the dialog to a darker gray? Tacky, but it'd give you the visual cue without the need for some subtle text changes. ________________________________________________________________________________ 2012-04-17 - bsnes_v087r27.tar.bz2 Changelog: * serialize processor.pc.data, not processor.pc * call CPU processor.setMode() in ARM serialize * serialize BIOS.mdr * support SRAM > 32KB * EEPROM, FlashROM serialize * EEPROM lose nall/bitarray.hpp * noise line feed after envelope * space out PSR read * ST018 needs byte reads fixed (don't align) [fixes HNMS2] * flush sram/eeprom/flashrom to 0 on cartridge load * APU/PPU dont sync back to CPU if syncing for state * fixed APU sync problems in GB/GBC core that could possibly wreck save states as well Quite a lot of little problems there. I believe GBA save states are fixed now. ________________________________________________________________________________ 2012-04-16 - bsnes_v087r26.tar.bz2 Changelog: * fixed FIFO[1] reset behavior (fixes audio in Sword of Mana) * added FlashROM emulation (both sizes) * GBA parses RAM settings from manifest.xml now * save RAM is written to disk now * added save state support (it's currently broken, though) * fixed ROM/RAM access timings * open bus should mostly work (we don't do the PC+12 stuff yet) * emulated the undocumented memory control register (mirror IWRAM, disable I+EWRAM, EWRAM wait state count) * emulated keypad interrupts * emulated STOP (freezes video, audio, DMA and timers; only breaks on keypad IRQs) * probably a lot more, it was a long night ... Show stoppers, missing things, broken things, etc: * ST018 is still completely broken * GBC audio sequencer apparently needs work * GBA audio FIFO buffer seems too quiet * PHI / ROM prefetch needs to be emulated (no idea on how to do this, especially PHI) * SOUNDBIAS 64/128/256khz modes should output at that resolution (really, we need to simulate PWM properly, no idea on how to do this) * object mosaic top-left coordinates are wrong (minor, fixing will actually make the effect look worse) * need to emulate PPU greenswap and color palette distortion (no idea on how do this) * need GBA save type database (I would also LIKE to blacklist / patch-out trainers, but that's a discussion for another day.) * some ARM ops advance the prefetch buffer, so you can read PC+12 in some cases Okay, major points. First, the save RAM type is now specified in the manifest.xml file. If you don't have one, you have no save RAM. To run games that need it, you're going to have to make a manifest.xml (or gamename.xml if you don't want to use cartridge folders.) Here are some examples: Code: Castlevania - Circle of the Moon (US) Super Mario Advance (US) Super Mario Advance 3 (US) Super Mario Advance 4 (US) We desperately need a database here. I want all No-Intro set game hashes in a big database along with their memory type before we can release this. Save states are currently broken. They work when you're on the same screen, but when a lot has changed and you try and load, things explode. This is typical to see when implementing states. It basically means I'm missing serializing some important data somewhere. I'd really appreciate if anyone wanted to look the code over to see if they can find any missing variables not being serialized. It's easy for me to overlook. Looks like GBA states are ~400-500KB uncompressed, FWIW. EDIT: my guess is that we probably need to call some functions to restored cached states, eg processor.setMode(m) inside the ARM serialization. ________________________________________________________________________________ 2012-04-15 - bsnes_v087r25.tar.bz2 (r24 was a point release during merging of changes.) This release is almost entirely Cydrak's direct work: * Added ARM::sequential() and some WAITCNT timings * Added Bus::io(uint32 pc), intended for prefetch timing * Added ARM::load() with data rotation (fixed Mother 3 graphics) * Added ARM::store() for data mirroring * LDM, STM, and instruction fetch still use read/write() * ARM::vector() no longer unmasks FIQs * Set THUMB shifter flags via bit(), consistent with ARM * Replace shifter loops with conditional tests My changes: * fixed sprite clipping on left-edge of screen * added first system folder, GBA.system * sudo make install is now make install * make install will create GBA.system for you in your home folder Windows users, take data/GBA.system and put it in the same folder as bsnes.exe, and give it a BIOS named bios.rom Or place it in your home folder (%APPDATA%/bsnes) Also note that this is highly experimental, I'll probably be changing things a lot before release. ... and thank you krom for the info, much appreciated :D Will merge that in when I figure out a good way to do object mosaic at screen (0,0) with my renderer. EDIT: I botched the cartridge timing change. Will fix in r26. It'll still run a bit too fast for now, unfortunately. ________________________________________________________________________________ 2012-04-14 - bsnes_v087r23.tar.bz2 Changelog: * fixed cascading timers and readouts (speed hit from 320fps to 240fps; would be 155fps with r20 timers) (fixes Spyro) * OBJ mode 3 acts like OBJ mode 2 now (may not be correct, but nobody has info on it) * added background + object vertical+horizontal mosaic in all modes (linear+affine+bitmap) * object mosaic uses sprite (0,0) for start coordinates, not screen (0,0) (again, nobody seems to have info on it) * BIOS cannot be read by r(15)>=0x02000000; returns last BIOS read instead (I can't believe games rely on this to work ... fixes SMA Mario Bros.) Mosaic is what concerns me the most, I've no idea if I'm doing it correctly. But anything is probably better than nothing, so there's that. I don't really notice the effect in Metroid Fusion. So either it's broken, or it's really subtle. ________________________________________________________________________________ 2012-04-13 - bsnes_v087r22.tar.bz2 Changelog: * fixed below pixel green channel on color blending * added semi-transparent objects [Exophase's method] * added full support for windows (both inputs, OBJ windows, and output, with optional color effect disable) * EEPROM uses nall::bitarray now to be friendlier to saving memory to disk * removed incomplete mosaic support for now (too broken, untested) * improved sprite priority. Hopefully it's right now. Just about everything should look great now. It took 25 days, but we finally have the BIOS rendering correctly. In order to do OBJ windows, I had to drop my above/below buffers entirely. I went with the nuclear option. There's separate layers for all BGs and objects. I build the OBJ window table during object rendering. So as a result, after rendering I go back and apply windows (and the object window that now exists.) After that, I have to do a painful Z-buffer select of the top two most important pixels. Since I now know the layers, the blending enable tests are a lot nicer, at least. But this obviously has quite a speed hit: 390fps to 325fps for Mr. Driller 2 title screen. TONC says that "bad" window coordinates do really insane things. GBAtek says it's a simple y2 < y1 || y2 > 160 ? 160 : y2; x2 < x1 || x2 > 240 ? 240 : x2; I like the GBAtek version more, so I went with that. I sure hope it's right ... but my guess is the hardware does this with a counter that wraps around or something. Also, say you have two OBJ mode 2 sprites that overlap each other, but with different priorities. The lower (more important) priority sprite has a clear pixel, but the higher priority sprite has a set pixel. Do we set the "inside OBJ window" flag to true here? Eg does the value OR, or does it hold the most important sprite's pixel value? Cydrak suspects it's OR-based, I concur from what I can see. Mosaic, I am at a loss. I really need a lot more information in order to implement it. For backgrounds, does it apply to the Vcounter of the entire screen? Or does it apply post-scroll? Or does it even apply after every adjust in affine/bitmap modes? I'm betting the hcounter background mosaic starts at the leftmost edge of the screen, and repeats previous pixels to apply the effect. Like SNES, very simple. For sprites, the SNES didn't have this. Does the mosaic grid start at (0,0) of the screen, or at (0,0) of each sprite? The latter will look a lot nicer, but be a lot more complex. Is mosaic on affine objects any different than mosaic of linear(tiled) objects? With that out of the way, we still have to fix the CPU memory access timing, add the rest of the CPU penalty cycles, the memory rotation / alignment / extend behavior needs to be fixed, the shifter desperately needs to be moved from loops to single shift operations, and I need to add flash memory support. Exophase, I appreciate your assistance with the semi-transparent objects. ________________________________________________________________________________ 2012-04-10 - bsnes_v087r21.tar.bz2 EDIT: below green channel shift in PPU::blend() [gba/ppu/screen.cpp at the bottom] is >> 6, should be >> 5. That would probably break most alpha blending effects. Timer speedup added. Boosts Mr. Driller 2 title from 170fps to 400fps. Other games still benefit, but not as amazingly. I don't dip below 160fps ever here. Reverted the memory speed to 2 for everything for now, to fix Castlevania slowdown. We obviously need to add the N/S stuff before we do that. Added linear BG and linear OBJ mosaic-Y. Did not add mosaic-X, or any mosaic to the affine/bitmap modes, because I'm not sure when to apply the compensation. Rewrote layer stuff. It now has two layers (above and below), and it performs the four blending modes as needed. Didn't add semi-transparent sprites because the docs are too confusing. Added a blur filter directly into the PPU for now. This obviously violates my interface, but F-Zero needed it for HUD display. We can remove it when we have an official release with a blur filter available. The filter still doesn't warp colors like a real GBA, because I don't know the formula. So, major priorities now are CPU speed, CPU rotation, windowing, semi-transparent sprites, rest of mosaic, low audio volume (and center GB channels.) Probably in that order? ________________________________________________________________________________ 2012-04-09 - bsnes_v087r20.tar.bz2 Changelog: * HALT waits 16 cycles before testing IRQs instead of 1 (probably less precise, but provides a massive speedup) [we will need to work on this later] * MMIO regs for CPU/PPU simplified by combining array accesses * custom VRAM/PRAM/OAM read/write functions that emulate 8->16-bit writes * 16-bit PRAM data (decent speedup) * emulated memory access speed (but don't handle non-sequential penalties or PPU access penalties yet) [amazingly, doesn't help speed at all] * misc. code cleanups For this WIP, FPS for Mr. Driller 2 went from 88fps to 172fps. Compatibility should be unchanged. Timers are still an interesting avenue to increase performance, but will be very tough to handle the 16MHz timers with eg a period of 65535 (overflow every single tick.) And that's basically the last major speed boost we'll be able to get. Blending and windowing is going to hurt performance, but it remains to be seen how much. ________________________________________________________________________________ 2012-04-09 - bsnes_v087r19.tar.bz2 Changelog: * added FIFO buffer emulation (with DMA and all that jazz) [Cydrak] * fixed timers and vcounter assign [Cydrak] * emulated EEPROM (you have to change size manually for 14-bit mode, we need a database badly now) [SMA runs now] * removed OAM array, now decoding directly to struct Object {} [128] and ObjectParam {} [32] (faster this way) * check forceblank (still doesn't remove all garble between transitions, though??) * lots of other stuff Delete your settings.cfg, or manually change frequencyGBA to 32768, or bad things will happen (this may change back to 256KHz-4MHz later.) 15 of 16 games are fully playable now, and look and sound great. The major missing detail right now is PPU blending support, and we really need to optimize the hell out of the code. ________________________________________________________________________________ 2012-04-07 - bsnes_v087r18.tar.bz2 Merged Cydrak's r17c changes: * BG affine mode added * BG bitmap mode added * OBJ affine mode added * fixed IRQ bug in THUMB mode (fixed almost every game) * timers added (broke almost every game, whee.) Cydrak is absolutely amazingly awesome and patient. This really wouldn't be happening without him. Also fixed some things from my end, including greatly improved sprite priorities, and a much better priority sorter. Mr. Driller looks a lot better now. Direct Sound / FIFO DMA stuff is completely kicking my ass right now. The explanations are unbelievably spartan. DMA FIFO A/B have 32 byte buffers each. They also have that MMIO register that supposedly accesses the first four(?) samples. The docs say you can write the first 8-bits to it. So why is the register 32-bits wide with four samples exposed? What happens if I keep writing to the FIFO anyway? Will it keep filling up? Does it only advance when I wrote to xa0? Or on xa0,a1,a2,a3? It says DMA sound requests a FIFO DMA when the FIFO buffer is at 16 bytes. When you start, it'll be at 0 bytes. So is it really <= 16 bytes? What happens if the FIFO buffer runs out, but it keeps playing? Will the read wrap around, or start returning zeroes, or stall something? What happens if you write too much data in the FIFO? Does it wrap around, or does it just get rejected, or stall something? What is this nonsense about 6-9 bit width for these samples? The samples input are 8-bit. I can't "make" 9-bit out of that in any useful sense. I can extend it, but that's kind of stupid and useless. Does FIFO DMA secretly write to xa0-a3 (or FIFO B registers)? Or does it just go directly to the APU? And that's just off the top of my head. ________________________________________________________________________________ 2012-04-05 - bsnes_v087r17.tar.bz2 Emulated GBC sound plus the new extensions to it. I am kind of surprised by how little developers utilized the GBC audio portion. Mr. Driller now has sound effects, and Pinobee no Daibouken has BGM. I still have yet to emulate the GBA extra sound channels and PWM. Need to emulate timers and DMA 2 refresh mode before I can do that. Also, I moved both GBC and GBA audio to use length = data; if(++length == 0); rather than length = 64 - data; if(--length == 0); so that I could return literal values for register reads. I thought there was a good reason we used the latter version, but I can't hear any audible difference even in GBC games, so oh well. Lastly, I think the pattern[++offset] in the wave channel was a bug in the DMG/GBC only. I really, really hope it doesn't apply to the GBA, because that will make bank selection a serious pain in the ass. I've no idea how the audio actually works, so I'm running the GBC audio at 4MHz. It sounds good, but obviously that's a bitch on speed. Down to about 130fps now (30% faster than SNES/accuracy), and there's more pain to come. But there's an entire world of speedups available to us, so we'll be profiling and optimizing once we have a decent compatibility rate. Hopefully before first public release, for first impressions and all, but we'll see. ________________________________________________________________________________ 2012-04-03 - bsnes_v087r16.tar.bz2 ixed the r15 mask per Cydrak. Added DMA support (immediate + Vblank + Hblank + HDMA) with IRQ support. Basically only missing FIFO reload mode for the APU on channel 2. Added background linear renderer (tilemap mode.) Added really inefficient pixel priority selector, so that all BGs+OBJ could be visible onscreen at the same time. As a result of the above: * Mr. Driller is our first fully playable game * Bakunetsu Dodge Ball Fighters is also fully playable * Pinobee no Daibouken is also fully playable Most games (15 of 16 tested) are now showing *something*, many things look really really good in fact. Absolutely essential missing components: * APU * CPU timers and their interrupts * DMA FIFO mode * OBJ affine mode * BG affine mode * BG bitmap mode * PPU windows (BG and OBJ) * PPU mosaic * PPU blending modes * SRAM / EEPROM (going to rely on a database, not heuristics. Homebrew will require a manifest file.) ________________________________________________________________________________ 2012-04-03 - bsnes_v087r15.tar.bz2 Added linear (eg non-affine) sprite rendering, 4bpp and 8bpp with hflip and vflip. Nothing else. You can now see the Nintendo logo and Gameboy text at the end of the BIOS. It's a start =) The BIOS doesn't use BGs, so I can't really test any BG implementation there. Need to find some good test ROMs to implement the tilemap and bitmap BG modes. ________________________________________________________________________________ 2012-03-31 - bsnes_v087r14.tar.bz2 Fixed aforementioned issues. All CPU+PPU registers are now hooked up (not that they do anything.) SOUNDBIAS for APU was hooked up, got tired of working on it for the rest :P I recall from the GB APU that you can't just assign values for the APU MMIO regs. They do odd reload things as well. Also, was using MMIO read code like this: Code: return ( (flaga << 0) || (flagb << 1) || (flagc << 2) ); Logical or doesn't work so well with building flags :P Bad habit from how I split multiple conditionals across several lines. So ... r14 is basically what r13 should have been yesterday, delaying my schedule by yet another day :( ________________________________________________________________________________ 2012-03-30 - bsnes_v087r13.tar.bz2 Contains all of Cydrak's fixes, sans PPU. On the PPU front, I've hooked up 100% of read and write registers. All three DISPSTAT IRQs (Vblank, Hblank, Vcoincidence) are connected now as well. Super Mario Advance now runs without *appearing* to crash, although it's hard to tell since I have no video or sound :P ARM Wrestler is known to run, as is the BIOS. APU can wait. I believe I'm capable of at least getting that started. Basically a copy/paste job from the GB/C audio core, followed by a few simple extensions, hopefully. We'll see. So ... now it's on to the PPU. Honestly, it looks a lot more complicated than the SNES PPU, but I suppose a lot of that is because I understand the SNES PPU so well. Certainly nothing like the NES and GB where I can just cobble together something that works in ten minutes. Have Cydrak's awesome code, so I can start with that and build upon it, and see what happens. But I definitely need to understand how it works, so copy/paste here is out. I won't be able to add the more advanced features if I don't understand the basics. ________________________________________________________________________________ 2012-03-29 - bsnes_v087r12.tar.bz2 Enough to get through the BIOS and into cartridge ROM. I am a bit annoyed that I was basically told that the GBA PPU wasn't that bad. Sprites are a clusterfuck, easily worse than Mode7, docs don't even begin to explain them in enough detail. This is going to be fun. ________________________________________________________________________________ 2012-03-28 - bsnes_v087r11.tar.bz2 Added all of the above fixes and changes. Also new is pipeline_decode() to fetch data, and IME/IE/IF support, and an ARM::processor.irqline flag that triggers IRQs at 0x18. Only Vblank is hooked up, which is what SWI 4 was waiting on previously. I'm sure my interrupt support is horribly broken and wrong. I was never able to really figure out IE/IF on the Game Boy, so there's no question this is even worse. It's now going crazy and writing 0 to IE forever now after the Vblank IRQ triggers. ________________________________________________________________________________ 2012-03-26 - bsnes_v087r10.tar.bz2 Changelog: * fixed THUMB hi immediate reads (immediate * 4) * cartridge is properly mirrored to 32MB (eg 12mbit repeats as lo8+hi4+hi4+lo8+hi4+hi4) [so it's a bit slower than a standard memcpy fill] * added ARM - load/store halfword register offset * added ARM - load/store halfword immediate offset * added ARM - load signed halfword/byte register offset * added ARM - load signed halfword/byte immediate offset * added decode() function to make opcode bit testing a lot clearer (didn't apply it to the debugger yet) All ARMv4M and all THUMBv4 instructions should now be implemented. Although I'm not sure if my implementations of the new instructions are correct. I'm still stuck in the aforementioned loop. It's obviously a CPU bug, because that loop is not polling any I/O registers. Much nicer: Code: decode("???? 0000 00?? ???? ???? ???? 1001 ????", multiply); decode("???? 0001 0?00 ???? ???? ---- 1001 ????", memory_swap); decode("???? 000? ?0?? ???? ???? ---- 1011 ????", move_half_register); decode("???? 000? ?1?? ???? ???? ???? 1011 ????", move_half_immediate); decode("???? 000? ?0?1 ???? ???? ---- 11?1 ????", load_register); decode("???? 000? ?1?1 ???? ???? ???? 11?1 ????", load_immediate); decode("???? 0001 0?00 ++++ ???? ---- 0000 ----", move_to_register_from_status); decode("???? 0001 0?10 ???? ++++ ---- 0000 ????", move_to_status_from_register); decode("???? 0001 0010 ++++ ++++ ++++ 0001 ????", branch_exchange_register); decode("???? 000? ???? ???? ???? ???? ???0 ????", data_immediate_shift); decode("???? 000? ???? ???? ???? ???? 0??1 ????", data_register_shift); decode("???? 001? ???? ???? ???? ???? ???? ????", data_immediate); decode("???? 0011 0?10 ???? ++++ ???? ???? ????", move_to_status_from_immediate); decode("???? 010? ???? ???? ???? ???? ???? ????", move_immediate_offset); decode("???? 011? ???? ???? ???? ???? ???0 ????", move_register_offset); decode("???? 100? ???? ???? ???? ???? ???? ????", move_multiple); decode("???? 101? ???? ???? ???? ???? ???? ????", branch); decode("???? 1111 ???? ???? ???? ???? ???? ????", software_interrupt); Code: decode("0001 10?? ???? ????", adjust_register); decode("0001 11?? ???? ????", adjust_immediate); decode("000? ???? ???? ????", shift_immediate); decode("001? ???? ???? ????", immediate); decode("0100 00?? ???? ????", alu); decode("0100 0111 0??? ?---", branch_exchange); decode("0100 01?? ???? ????", alu_hi); decode("0100 1??? ???? ????", load_literal); decode("0101 ???? ???? ????", move_register_offset); decode("0110 ???? ???? ????", move_word_immediate); decode("0111 ???? ???? ????", move_byte_immediate); decode("1000 ???? ???? ????", move_half_immediate); decode("1001 ???? ???? ????", move_stack); decode("1010 ???? ???? ????", add_register_hi); decode("1011 0000 ???? ????", adjust_stack); decode("1011 ?10? ???? ????", stack_multiple); decode("1100 ???? ???? ????", move_multiple); decode("1101 1111 ???? ????", software_interrupt); decode("1101 ???? ???? ????", branch_conditional); decode("1110 0??? ???? ????", branch_short); decode("1111 0??? ???? ????", branch_long_prefix); decode("1111 1??? ???? ????", branch_long_suffix); ________________________________________________________________________________ 2012-03-25 - bsnes_v087r09.tar.bz2 Split apart necdsp: core is now in processor/upd96050 (wish I had a better name for it, but there's no family name that is maskable.) I would like to support the uPD7720 in the core as well, just for completeness' sake, but I'll have to modify the decoder to drop one bit from each mode. So ... I'll do that later. Worst part is even if I do, I won't be able to test it :( Added all of Cydrak's changes. I also simplified LDMIA/STMIA and PUSH/POP by merging the outer loops. Probably infinitesimally slower, but less code is nicer. Maybe GCC optimization will expand it, who knows. We were getting stuck polling SOUNDBIAS: Code: 00000800 2102 mov r1,#0x02 00000802 0209 lsl r1,r1,#8 00000804 468c mov r12,r1 00000806 4bb3 ldr r3,[pc,#0xad4] =0x04000088 00000808 881a ldrh r2,[r3,#0x00] 0000080a 4bb2 ldr r3,[pc,#0xad4] =0x04000088 0000080c 0591 lsl r1,r2,#22 0000080e 0d89 lsr r1,r1,#22 00000810 2800 cmp r0,#0x00 00000812 d003 beq 0x0000081c 00000814 4561 sub r1,r12 00000816 da09 bge 0x0000082c 00000818 1c92 add r2,r2,#2 0000081a e002 b 0x00000822 00000822 801a strh r2,[r3,#0x00] 00000824 2208 mov r2,#0x08 00000826 1e52 sub r2,r2,#1 00000828 d5fd bpl 0x00000826 00000826 1e52 sub r2,r2,#1 00000828 d5fd bpl 0x00000826 0000082a e7e9 b 0x00000800 So I hooked the APU up to it and return 0x200 now (per gbatek.) Now we're getting stuck in an infinite loop here: Code: 00000ba0 4718 bx r3 ;switch to ARM mode (per Exophase's disassembly) (supposed to switch to ARM mode, just repeats forever) (r3 == 0xba1 here ...) Hit after 38,112 opcodes. Exophase, don't suppose you'd know how many (ARM+THUMB) instructions are executed before cartridge entry point? That should be a nice measurement of how close I am. My cycle counter is basically (ARM*2)+(THUMB*1)*instructions, which is horribly inaccurate. Need to talk with Cydrak about how to do the SNI cycles in a way that's compatible with non-sequential accesses to different memory regions of the GBA. ________________________________________________________________________________ 2012-03-22 - bsnes_v087r08.tar.bz2 Added some more ARM opcodes, hooked up MMIO. Bind it with mmio[(addr 000-3ff)] = this; inside CPU/PPU/APU, goes to read(), write(). Also moved the Hitachi HG51B core to processor/, and split it apart from the snes/chip/hitachidsp implementation. This one actually worked really well. Very clean split between MMIO/DMA and the processor core. I may move a more generic DMA function inside the core, not sure yet. I still believe the HG51B169 to be a variant of the HG51BS family, but given they're meant to be incredibly flexible microcontrollers, it's possible that each variant gets its own instruction set. So, who knows. We'll worry about it if we ever find another HG51B DSP, I guess. Notes while working on Cydrak's updated ST018 code: Code: lsl/lsr/etc perform masking, but so do opcodes? Would like to get ARMwrestler working before optimizing these for performance. arithmetic() reloads cpsr?? if(isprivileged() && cpsr.m != 0x1f || source == 0) if(a && (b || c)) or if((a && b) || c) ? I went off the docs instead, and do the transfer if SPSR or CPSR.mode != USR Added modified booth encoding (awesome stuff!) t = (int2)n; Testing -2, -1, +1, +2 ... int2 should have a range of {-2, -1, 0, +1} only though ... bug? Added memory_swap() Added move_to_status_from_immediate() Added software_interrupt() GBA BIOS is constantly reading from 04000300, but it never writes. If I return prng()&1, I can get it to proceed until it hits a bad opcode (stc opcode, which the GBA lacks a coprocessor so ... bad codepath.) Without it, it just reads that register forever and keeps resetting the system, or something ... I guess we're going to have to try and get ARMwrestler working, because the BIOS seems to need too much emulation code to do anything at all. ________________________________________________________________________________ 2012-03-22 - bsnes_v087r07.tar.bz2 Both snes/chip/armdsp and gba/cpu use processor/arm now. Fixed THUMB to execute the BL prefix and suffix separately. I can now get the GBA BIOS stuck in some kind of infinite loop. Hooray ... I guess? ________________________________________________________________________________ 2012-03-22 - bsnes_v087r07pre.tar.bz2 And now for something a bit different: Creates the bsnes/processor folder. This has a shared ARM core there which both the GBA and ST018 inherit. There are going to be separate decoders, and revision-specific checks, to support the differences between v3+. In the future, I also want to move the other processor cores here: * GBZ80 (GB, GBC) * 65816 (SNES CPU, SA-1) * NEC uPD (7725, 96050, maybe 7720 just for fun) * Hitachi HG51B169 * SuperFX * SPC700 * 65(C?)02 Basically, the GBA/ST018 forces my hand to start coding a bit more like a multi-system emulator. Right now, the ST018 is broken. Hence the pre. Apparently the GBA core being used now has some bugs. So this'll be a nice way to stress-test the GBA core a bit before we make it to ARMwrestler. ________________________________________________________________________________ 2012-03-21 - bsnes_v087r06.tar.bz2 I believe I've implemented every THUMB instruction now, although I'm sure there are dozens of bugs in the implementation. Here is a run-log: http://byuu.org/temp/armtrace.txt (instructions below current register values) It seems that the last jump taken is ending up being off-by-two. It's probably due to not masking/adjusting PC correctly at certain points. I don't know if any other bugs are being hit prior to this or not. I don't implement any I/O registers yet, and the BIOS seems to be poking at a few of them along the way, so ... who knows. I could also be reading the log wrong, but it looks to me like there's some PSR setting the mode flag register to 0, which is supposed to be an undefined behavior mode ... perhaps mrs has no effect on the m/t bits, and it just affects the i/f bits? It'd be nice if we could get a trace log like mine from a good emulator running the BIOS to compare for issues. ________________________________________________________________________________ 2012-03-20 - bsnes_v087r05.tar.bz2 Implemented all of the ARMv3 instructions, and the bx rm instruction as well. Already hit THUMB mode right at the start of the BIOS, sigh. Implemented the first THUMB instruction to get that rolling. Also tried to support the S flag to LDM/STM, but not sure how successful I was. Code: 00000000 ea000018 b 0x00000068 00000068 e35e0000 cmp lr,#0x00000000 0000006c 03a0e004 moveq lr,#0x00000004 00000070 e3a0c301 mov r12,#0x04000000 00000074 e5dcc300 ldrb r12,[r12,+0x300] 00000078 e33c0001 teq r12,#0x00000001 0000007c 010fc000 mrseq r12,cpsr 00000080 038cc0c0 orreq r12,r12,#0x000000c0 00000084 0129f00c msreq cpsr:cf,r12 00000088 0affffe3 beq 0x0000001c 0000008c e3a000df mov r0,#0x000000df 00000090 e129f000 msr cpsr:cf,r0 00000094 e3a04301 mov r4,#0x04000000 00000098 e5c44208 strb r4,[r4,+0x208] 0000009c eb00000f bl 0x000000e0 000000e0 e3a000d3 mov r0,#0x000000d3 000000e4 e129f000 msr cpsr:cf,r0 000000e8 e59fd0d0 ldr sp,[pc,+0x0d0] =0x03007fe0 000000ec e3a0e000 mov lr,#0x00000000 000000f0 e169f00e msr spsr:cf,lr 000000f4 e3a000d2 mov r0,#0x000000d2 000000f8 e129f000 msr cpsr:cf,r0 000000fc e59fd0b8 ldr sp,[pc,+0x0b8] =0x03007fa0 00000100 e3a0e000 mov lr,#0x00000000 00000104 e169f00e msr spsr:cf,lr 00000108 e3a0005f mov r0,#0x0000005f 0000010c e129f000 msr cpsr:cf,r0 00000110 e59fd0a0 ldr sp,[pc,+0x0a0] =0x03007f00 00000114 e28f0001 add r0,pc,#0x00000001 00000118 e12fff10 bx r0 0000011c 2000 mov r0,#0x00 0000011e 4958 ??? r0:00000000 r1:00000000 r2:00000000 r3:00000000 r4:04000000 r5:00000000 r6:00000000 r7:00000000 cpsr:nZcv r8:00000000 r9:00000000 r10:00000000 r11:00000000 r12:00000000 sp:03007f00 lr:000000a0 pc:00000122 spsr:---- ________________________________________________________________________________ 2012-03-19 - bsnes_v087r04.tar.bz2 GBA stuff re-added. Only thing missing that was there before is the ARM branch opcode. Since we're going to be staring at it for a very long time, I added a more interesting test video pattern. Went from 6fps to 912fps. Amazing what being able to divide can do for a frame rate. ________________________________________________________________________________ 2012-03-19 - bsnes_v087r03.tar.bz2 Fixing the PPU stepping increased FPS to 250. Promising, at least, since the ARM core is still severely overclocked. However, I reverted back to r02. This one patches gameboy/ and GameBoy:: to gb/ and GB:: and that's it. Sorry, I just couldn't shake this bad feeling about the code. There were some poorly hacked-together constructs. I'd rather just redo two days of work than feel bad about the codebase for the next several years. Going to attempt the GBA bridge again. Third time's a charm, I suppose (there was a pre-r03 WIP I abandoned as well.) This isn't unprecedented, GB core took a few attempts like this as well. ________________________________________________________________________________ 2012-03-18 - 2zb.rat.40r780v_sensb Changelog: * gameboy/ -> gb/ * GameBoy -> GB * basic memory map for GBA * enough code to execute the first BIOS instruction (b 0x68) I have the code resetting r(15) to 0 on an exception just as a test. Since that flushes the pipeline, that means we're basically executing "b 0x68" at 8MHz, and nothing else. ... and I am getting __6 motherfucking FPS__ at 4.4GHz on an i7. Something is seriously, horribly, unfuckingbelievably wrong here, and I can't figure out what it is. My *fully complete* ARM core on the ST018 is even less efficient and runs at 21.47MHz, and yet I get 60fps even after emulating the SNES CPU+PPU @ 10+MHz each as well. ... I'm stuck. I can't proceed until we figure out what in the holy fuck is going on here. So ... if anyone can help, please do. If we can't fix this, the GBA emulation is dead. I was able to profile on Windows, and I've included that in this WIP under out/log.txt. But it looks normal to me. But yeah, there's NO. FUCKING. WAY. This code should be running this slowly. ________________________________________________________________________________ 2012-03-12 - 2zb.rat.30r780v_sensb I wanted to keep this a secret, but unlike other recent additions, this will easily take several weeks, maybe months, to show anything. Assuming I can even pull it off. Nothing technically overwhelming here, I'm more worried about the near-impossibility of debugging the CPU. So that would kill all WIPs until then, which would kind of suck. Well, that's open source for you I guess. Let's at least try and keep it a secret, please. No 'hinting', etc. There's a good chance I'll give up on this, so we'll see. If anyone is interested in co-developing this with me, I'd love the help. A lot of stuff is unclear already. So is the current CPU mode always stored in CPSR::M? Then what is stored in the various SPSR::M values? Current batshit insanity: in cpu.cpp, there is a line "apu.clock -= clocks;". If I uncomment that, the framerate drops from 720fps to 140fps. Running -pg binaries is hanging on me, so I can't tell what the holy fuck is going on there. But 4M subtractions a second should not cause a 500% speed hit. Would also appreciate any help in tracking down what is going on there. ________________________________________________________________________________ 2012-03-10 - bsnes_v087r02.tar.bz2 Changelog: * extended USART with quit(), readable(), writable() [both emulation and hardware] ** quit() returns true on hardware when Ctrl+C (SIGINT) is generated (breaks main loop); no effect under emulation yet (hard to simulate) ** readable() returns true when data is ready to be read (non-blocking support for read()) ** writable() returns true when data can be written (non-blocking support for write()) [always true under emulation, since we have no buffer size limit] They really don't make it easy to determine if a file descriptor has data ready to be read ... took me a long while to figure out how to use select() for that. ________________________________________________________________________________ 2012-03-10 - bsnes_v087r01.tar.bz2 Changelog: * fixes ARM core unaligned memory reads (fixes HNMS2 AI, hopefully completely, we'll see though) [Cydrak] * ARM 40000010 writes are now connected to d2 rather than the timer * ARM bus_readbyte() removed (would love to do the same for writebyte if we can ... then we can drop back to bus_read + bus_write only) * USART with IObit set acts as a regular gamepad now (don't have this hooked up with real hardware, but oh well, it's technically possible so there's that) * OpenGL/GLX will use 30-bit when you have a 30-bit display; no need for config file video.depth anymore ________________________________________________________________________________ 2012-03-06 - bsnes_v087-source.tar.bz2 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: 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-06 - bsnes_v086r16.tar.bz2 Cydrak, I moved the step from the opcode decoder and opcodes themselves into bus_(read,write)(byte,word), to minimize code. If that's not feasible for some reason, please let me know and I'll change it back to your latest WIP. This has your carry flag fix, the timer skeleton (doesn't really work yet), the Booth two-bit steps, and the carry flag clear thing inside multiply ops. Also added the aforementioned reset delay and reset bit stuff, and fixed the steps to 21MHz for instructions and 64KHz for reset pulse. I wasn't sure about the shifter extra cycles. I only saw it inside one of the four (or was it three?) opcodes that have shifter functions. Shouldn't it be in all of them? he game does indeed appear to be fully playable now, but the AI doesn't exactly match my real cartridge. This could be for any number of reasons: ARM CPU bug, timer behavior bug, oscillator differences between my real hardware and the emulator, etc. However ... the AI is 100% predictable every time, both under emulation and on real hardware. ________________________________________________________________________________ 2012-03-01 - bsnes_v086r15.tar.bz2 Most importantly ... I'm now using "st018.rom" which is the program ROM + data ROM in one "firmware" file. You'll need to get the second archive and put it in the same folder as your HNMS2 ROM. Since all three Seta DSPs have the ST01N stamp, unlike some of the arcade variants, I'm just going to go with ST01N from now on instead of ST-001N. I was using the latter as that's what Overload called them. Moving on ... The memory map should match real hardware now, and I even match the open bus read results. I also return the funky 0x40404001 for 60000000-7fffffff, for whatever that's worth. The CPU-side registers are also mirrored correctly, as they were in the last WIP, so we should be good there. I also simulate the reset pulse now, and a 0->!0 transition of $3804 will destroy the ARM CPU thread. It will wait until the value is set back to zero to resume execution. At startup, the ARM CPU will sleep for a while, thus simulating the reset delay behavior. Still need to figure out the exact cycle length, but that's really not important for emulation. Note in registers.hpp, the |4 in status() is basically what allows the CPU program to keep going, and hit the checkmate condition. If we remove that, the CPU deadlocks. Still need to figure out how and when d4 is set on $3804 reads. I can run any test program on both real hardware and in my emulator and compare results, so by all means ... if you can come up with a test, I'll run it. > or has anything to do with the "random" looking data ROM I would suspect this may be protected, but the data ROM checksum matches the value inside the program ROM. What are the chances it literally is just randomly generated data? I guess I'll run some tests on it and see. 0000-7fff: Code: [00: 2987] [01: 197] [02: 139] [03: 168] [04: 137] [05: 134] [06: 129] [07: 108] [08: 127] [09: 119] [0a: 126] [0b: 129] [0c: 130] [0d: 123] [0e: 126] [0f: 125] [10: 146] [11: 117] [12: 134] [13: 111] [14: 140] [15: 108] [16: 120] [17: 127] [18: 120] [19: 123] [1a: 109] [1b: 123] [1c: 108] [1d: 117] [1e: 128] [1f: 123] [20: 152] [21: 162] [22: 160] [23: 142] [24: 139] [25: 128] [26: 140] [27: 121] [28: 132] [29: 120] [2a: 114] [2b: 126] [2c: 122] [2d: 121] [2e: 129] [2f: 102] [30: 127] [31: 131] [32: 116] [33: 119] [34: 119] [35: 123] [36: 134] [37: 130] [38: 126] [39: 131] [3a: 125] [3b: 124] [3c: 105] [3d: 102] [3e: 102] [3f: 99] [40: 122] [41: 125] [42: 149] [43: 125] [44: 135] [45: 112] [46: 99] [47: 106] [48: 104] [49: 115] [4a: 97] [4b: 107] [4c: 121] [4d: 118] [4e: 121] [4f: 110] [50: 150] [51: 139] [52: 110] [53: 104] [54: 107] [55: 115] [56: 110] [57: 96] [58: 109] [59: 112] [5a: 104] [5b: 107] [5c: 100] [5d: 120] [5e: 119] [5f: 91] [60: 148] [61: 142] [62: 138] [63: 124] [64: 122] [65: 108] [66: 106] [67: 111] [68: 116] [69: 114] [6a: 112] [6b: 113] [6c: 113] [6d: 97] [6e: 112] [6f: 116] [70: 117] [71: 135] [72: 108] [73: 100] [74: 131] [75: 123] [76: 105] [77: 101] [78: 101] [79: 98] [7a: 99] [7b: 99] [7c: 94] [7d: 117] [7e: 100] [7f: 96] [80: 143] [81: 114] [82: 126] [83: 129] [84: 114] [85: 111] [86: 119] [87: 104] [88: 139] [89: 127] [8a: 120] [8b: 107] [8c: 109] [8d: 108] [8e: 106] [8f: 124] [90: 161] [91: 129] [92: 105] [93: 112] [94: 113] [95: 98] [96: 112] [97: 102] [98: 119] [99: 108] [9a: 106] [9b: 98] [9c: 109] [9d: 109] [9e: 96] [9f: 108] [a0: 128] [a1: 98] [a2: 142] [a3: 108] [a4: 127] [a5: 105] [a6: 123] [a7: 105] [a8: 119] [a9: 110] [aa: 122] [ab: 122] [ac: 112] [ad: 111] [ae: 118] [af: 98] [b0: 115] [b1: 121] [b2: 128] [b3: 118] [b4: 98] [b5: 108] [b6: 98] [b7: 87] [b8: 112] [b9: 115] [ba: 127] [bb: 107] [bc: 127] [bd: 93] [be: 98] [bf: 93] [c0: 126] [c1: 127] [c2: 136] [c3: 133] [c4: 122] [c5: 106] [c6: 126] [c7: 115] [c8: 127] [c9: 99] [ca: 128] [cb: 108] [cc: 122] [cd: 114] [ce: 111] [cf: 118] [d0: 110] [d1: 116] [d2: 107] [d3: 116] [d4: 126] [d5: 79] [d6: 109] [d7: 101] [d8: 117] [d9: 100] [da: 89] [db: 113] [dc: 95] [dd: 90] [de: 96] [df: 105] [e0: 114] [e1: 119] [e2: 125] [e3: 106] [e4: 117] [e5: 130] [e6: 108] [e7: 101] [e8: 109] [e9: 117] [ea: 107] [eb: 112] [ec: 122] [ed: 118] [ee: 117] [ef: 104] [f0: 118] [f1: 120] [f2: 129] [f3: 109] [f4: 102] [f5: 127] [f6: 122] [f7: 106] [f8: 108] [f9: 85] [fa: 94] [fb: 96] [fc: 104] [fd: 103] [fe: 129] [ff: 169] Well, 0x00 seems to appear a lot. But otherwise yeah, it's pretty random. 0000-50ff: Code: [00: 99] [01: 81] [02: 70] [03: 86] [04: 78] [05: 83] [06: 66] [07: 63] [08: 74] [09: 80] [0a: 74] [0b: 91] [0c: 81] [0d: 83] [0e: 71] [0f: 74] [10: 80] [11: 61] [12: 79] [13: 71] [14: 99] [15: 78] [16: 79] [17: 85] [18: 81] [19: 93] [1a: 66] [1b: 91] [1c: 64] [1d: 76] [1e: 75] [1f: 89] [20: 82] [21: 90] [22: 91] [23: 96] [24: 83] [25: 93] [26: 87] [27: 75] [28: 79] [29: 76] [2a: 81] [2b: 91] [2c: 73] [2d: 84] [2e: 90] [2f: 66] [30: 78] [31: 83] [32: 78] [33: 80] [34: 76] [35: 103] [36: 100] [37: 88] [38: 86] [39: 101] [3a: 83] [3b: 87] [3c: 71] [3d: 81] [3e: 77] [3f: 80] [40: 71] [41: 73] [42: 91] [43: 86] [44: 77] [45: 79] [46: 65] [47: 73] [48: 66] [49: 80] [4a: 71] [4b: 79] [4c: 77] [4d: 82] [4e: 86] [4f: 80] [50: 97] [51: 99] [52: 71] [53: 79] [54: 76] [55: 89] [56: 81] [57: 75] [58: 69] [59: 85] [5a: 73] [5b: 86] [5c: 81] [5d: 93] [5e: 90] [5f: 73] [60: 98] [61: 106] [62: 92] [63: 87] [64: 81] [65: 79] [66: 69] [67: 82] [68: 70] [69: 79] [6a: 79] [6b: 76] [6c: 80] [6d: 71] [6e: 78] [6f: 91] [70: 71] [71: 94] [72: 71] [73: 74] [74: 81] [75: 95] [76: 66] [77: 74] [78: 68] [79: 81] [7a: 66] [7b: 85] [7c: 82] [7d: 103] [7e: 72] [7f: 81] [80: 81] [81: 81] [82: 74] [83: 82] [84: 69] [85: 71] [86: 83] [87: 79] [88: 81] [89: 93] [8a: 75] [8b: 77] [8c: 79] [8d: 76] [8e: 77] [8f: 86] [90: 86] [91: 82] [92: 71] [93: 82] [94: 81] [95: 78] [96: 87] [97: 79] [98: 86] [99: 89] [9a: 75] [9b: 66] [9c: 82] [9d: 91] [9e: 77] [9f: 89] [a0: 74] [a1: 62] [a2: 92] [a3: 73] [a4: 85] [a5: 80] [a6: 89] [a7: 86] [a8: 83] [a9: 90] [aa: 89] [ab: 92] [ac: 87] [ad: 83] [ae: 84] [af: 72] [b0: 79] [b1: 80] [b2: 82] [b3: 89] [b4: 69] [b5: 90] [b6: 70] [b7: 70] [b8: 78] [b9: 86] [ba: 96] [bb: 87] [bc: 96] [bd: 77] [be: 74] [bf: 76] [c0: 83] [c1: 78] [c2: 82] [c3: 97] [c4: 77] [c5: 80] [c6: 84] [c7: 87] [c8: 95] [c9: 72] [ca: 93] [cb: 82] [cc: 84] [cd: 87] [ce: 71] [cf: 75] [d0: 73] [d1: 79] [d2: 79] [d3: 80] [d4: 91] [d5: 63] [d6: 86] [d7: 80] [d8: 78] [d9: 74] [da: 65] [db: 95] [dc: 80] [dd: 73] [de: 63] [df: 86] [e0: 66] [e1: 95] [e2: 81] [e3: 77] [e4: 82] [e5: 101] [e6: 74] [e7: 73] [e8: 72] [e9: 87] [ea: 75] [eb: 87] [ec: 87] [ed: 81] [ee: 84] [ef: 85] [f0: 75] [f1: 87] [f2: 93] [f3: 93] [f4: 74] [f5: 98] [f6: 99] [f7: 85] [f8: 78] [f9: 59] [fa: 74] [fb: 76] [fc: 85] [fd: 91] [fe: 91] [ff: 69] And there we go. Yep, it's random data. Unbelievable. $10 if anyone can generate the data ROM algorithmically :P The data after 0x5100 may not be, but they intentionally don't checksum it, making me think that's just remnant ... junk? It doesn't appear random upon first inspection. ________________________________________________________________________________ 2012-03-01 - bsnes_v086r14.tar.bz2 Attempted to fix the bugs pointed out by Cydrak for the shifter carry and subtraction flags. No way to know if I was successful. The memory map should exactly match real hardware now. Also simplified bus reading/writing: we can get fancy when it works, I suppose. Reduced some of the code repetition to try and minimize the chances for bugs. I hopefully fixed up register-based ror shifting to what the docs were saying. And lastly, the disassembler should handle every opcode in every mode now. ldr rn,[pc,n] adds (pc,n) [absolute address] after opcode. I didn't want to actually read from ROM here (in case it ever touches I/O or something), but I suppose we could try anyway. At startup, it will write out "disassembly.txt" which is a disassembly of the entire program ROM. If anyone wants to look for disassembly errors, I'll go ahead and fix them. Just note that I won't do common substitutions like mov pc,lr == ret. At this point, we can make two moves and then the game tells us that we've won. So ... I'm back to thinking the problem is with bugs in the ARM core, and that our bidirectional communication is strong enough to play the game. Although that's not perfect. The game definitely looks at d4 (and possibly others later), but my hardware tests can't get anything but d0/d3 set. ________________________________________________________________________________ 2012-02-28 - bsnes_v086r13.tar.bz2 That's my best implementation of the shifter carry. It's horribly inefficient and possibly wrong (especially on ROR by register, but that doesn't ever appear to be used in this program), but oh well. It's the best I can do. Game is basically getting stuck after a board upload and issuing another command. It's sitting in a loop waiting on $3804.d0 to be set, meaning the ARM is never writing anything for the CPU to read. There's some chance that my $3804/r40000000 flags are wrong. Short of guessing though, I'm not sure how we can get more info on how those work. ... I really can't debug this any better than I have. If no one else sees anything, then we're going to have to give up and wait for MESS to create opcode logs for us to compare against. ARM is stuck in the below code, it looks like ... although it's really hard to tell since it fucking logs 200+MB of instructions per second. The command is 0xad, for whatever that's worth. Code: r0:00000000 r1:00000000 r2:0001d890 r3:00000000 r4:00000226 r5:00000158 r6:e0001640 r7:0001e090 r8:e000168c r9:00000000 r10:00000016 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000d6e8 cpsr:nZCv 0000d6e0 e3100040 tst r0,#0x00000040 r0:00000000 r1:00000000 r2:0001d890 r3:00000000 r4:00000226 r5:00000158 r6:e0001640 r7:0001e090 r8:e000168c r9:00000000 r10:00000016 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000d6ec cpsr:nZCv 0000d6e4 1a000000 bne 0x0000d6ec r0:00000000 r1:00000000 r2:0001d890 r3:00000000 r4:00000226 r5:00000158 r6:e0001640 r7:0001e090 r8:e000168c r9:00000000 r10:00000016 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000d6f0 cpsr:nZCv 0000d6e8 e2833078 add r3,r3,#0x00000078 r0:00000000 r1:00000000 r2:0001d890 r3:00000078 r4:00000226 r5:00000158 r6:e0001640 r7:0001e090 r8:e000168c r9:00000000 r10:00000016 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000d6f4 cpsr:nZCv 0000d6ec e5561027 ldrb r1,[r6-0x027] r0:00000000 r1:00000016 r2:0001d890 r3:00000078 r4:00000226 r5:00000158 r6:e0001640 r7:0001e090 r8:e000168c r9:00000000 r10:00000016 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000d6f8 cpsr:nZCv 0000d6f0 e3a00018 mov r0,#0x00000018 r0:00000018 r1:00000016 r2:0001d890 r3:00000078 r4:00000226 r5:00000158 r6:e0001640 r7:0001e090 r8:e000168c r9:00000000 r10:00000016 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000d6fc cpsr:nZCv 0000d6f4 e00a0190 mul r10,r0,r1 r0:00000018 r1:00000016 r2:0001d890 r3:00000078 r4:00000226 r5:00000158 r6:e0001640 r7:0001e090 r8:e000168c r9:00000000 r10:00000210 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000d700 cpsr:nZCv 0000d6f8 e084400a add r4,r4,r10 r0:00000018 r1:00000016 r2:0001d890 r3:00000078 r4:00000436 r5:00000158 r6:e0001640 r7:0001e090 r8:e000168c r9:00000000 r10:00000210 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000d704 cpsr:nZCv 0000d6fc ea00061b b 0x0000ef70 r0:00000018 r1:00000016 r2:0001d890 r3:00000078 r4:00000436 r5:00000158 r6:e0001640 r7:0001e090 r8:e000168c r9:00000000 r10:00000210 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000ef78 cpsr:nZCv 0000ef70 e08330a4 add r3,r3,r4 lsr #1 r0:00000018 r1:00000016 r2:0001d890 r3:00000293 r4:00000436 r5:00000158 r6:e0001640 r7:0001e090 r8:e000168c r9:00000000 r10:00000210 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000ef7c cpsr:nZCv 0000ef74 e1a031a3 mov r3,r3 lsr #3 r0:00000018 r1:00000016 r2:0001d890 r3:00000052 r4:00000436 r5:00000158 r6:e0001640 r7:0001e090 r8:e000168c r9:00000000 r10:00000210 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000ef80 cpsr:nZCv 0000ef78 e51271b4 ldr r7,[r2-0x1b4] r0:00000018 r1:00000016 r2:0001d890 r3:00000052 r4:00000436 r5:00000158 r6:e0001640 r7:0001e090 r8:e000168c r9:00000000 r10:00000210 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000ef84 cpsr:nZCv 0000ef7c e2450054 sub r0,r5,#0x00000054 r0:00000104 r1:00000016 r2:0001d890 r3:00000052 r4:00000436 r5:00000158 r6:e0001640 r7:0001e090 r8:e000168c r9:00000000 r10:00000210 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000ef88 cpsr:nZCv 0000ef80 e7970000 ??? r0:00000042 r1:00000016 r2:0001d890 r3:00000052 r4:00000436 r5:00000158 r6:e0001640 r7:0001e090 r8:e000168c r9:00000000 r10:00000210 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000ef8c cpsr:nZCv 0000ef84 e0833000 add r3,r3,r0 r0:00000042 r1:00000016 r2:0001d890 r3:00000094 r4:00000436 r5:00000158 r6:e0001640 r7:0001e090 r8:e000168c r9:00000000 r10:00000210 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000ef90 cpsr:nZCv 0000ef88 e51201f4 ldr r0,[r2-0x1f4] r0:00000140 r1:00000016 r2:0001d890 r3:00000094 r4:00000436 r5:00000158 r6:e0001640 r7:0001e090 r8:e000168c r9:00000000 r10:00000210 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000ef94 cpsr:nZCv 0000ef8c e1530000 cmp r3,r0 r0:00000140 r1:00000016 r2:0001d890 r3:00000094 r4:00000436 r5:00000158 r6:e0001640 r7:0001e090 r8:e000168c r9:00000000 r10:00000210 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000ef98 cpsr:NzCv 0000ef90 21a03000 movcs r3,r0 r0:00000140 r1:00000016 r2:0001d890 r3:00000140 r4:00000436 r5:00000158 r6:e0001640 r7:0001e090 r8:e000168c r9:00000000 r10:00000210 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000ef9c cpsr:NzCv 0000ef94 e5120274 ldr r0,[r2-0x274] r0:00000004 r1:00000016 r2:0001d890 r3:00000140 r4:00000436 r5:00000158 r6:e0001640 r7:0001e090 r8:e000168c r9:00000000 r10:00000210 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000efa0 cpsr:NzCv 0000ef98 e08032a3 add r3,r0,r3 lsr #5 r0:00000004 r1:00000016 r2:0001d890 r3:0000000e r4:00000436 r5:00000158 r6:e0001640 r7:0001e090 r8:e000168c r9:00000000 r10:00000210 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000efa4 cpsr:NzCv 0000ef9c e5c63002 strb r3,[r6+0x002] r0:00000004 r1:00000016 r2:0001d890 r3:0000000e r4:00000436 r5:00000158 r6:e0001640 r7:0001e090 r8:e000168c r9:00000000 r10:00000210 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000efa8 cpsr:NzCv 0000efa0 e5165f98 ldr r5,[r6-0xf98] r0:00000004 r1:00000016 r2:0001d890 r3:0000000e r4:00000436 r5:00000154 r6:e0001640 r7:0001e090 r8:e000168c r9:00000000 r10:00000210 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000efac cpsr:NzCv 0000efa4 e3550054 cmp r5,#0x00000054 r0:00000004 r1:00000016 r2:0001d890 r3:0000000e r4:00000436 r5:00000154 r6:e0001640 r7:0001e090 r8:e000168c r9:00000000 r10:00000210 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000efb0 cpsr:nzCv 0000efa8 2affffe4 bcs 0x0000ef40 r0:00000004 r1:00000016 r2:0001d890 r3:0000000e r4:00000436 r5:00000154 r6:e0001640 r7:0001e090 r8:e000168c r9:00000000 r10:00000210 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000ef48 cpsr:nzCv 0000ef40 e08c6005 add r6,r12,r5 r0:00000004 r1:00000016 r2:0001d890 r3:0000000e r4:00000436 r5:00000154 r6:e000163c r7:0001e090 r8:e000168c r9:00000000 r10:00000210 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000ef4c cpsr:nzCv 0000ef44 e5561000 ldrb r1,[r6] r0:00000004 r1:00000040 r2:0001d890 r3:0000000e r4:00000436 r5:00000154 r6:e000163c r7:0001e090 r8:e000168c r9:00000000 r10:00000210 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000ef50 cpsr:nzCv 0000ef48 e201101e and r1,r1,#0x0000001e r0:00000004 r1:00000000 r2:0001d890 r3:0000000e r4:00000436 r5:00000154 r6:e000163c r7:0001e090 r8:e000168c r9:00000000 r10:00000210 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000ef54 cpsr:nzCv 0000ef4c e08b2081 add r2,r11,r1 lsl #1 r0:00000004 r1:00000000 r2:0001d890 r3:0000000e r4:00000436 r5:00000154 r6:e000163c r7:0001e090 r8:e000168c r9:00000000 r10:00000210 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000ef58 cpsr:nzCv 0000ef50 e3a03000 mov r3,#0x00000000 r0:00000004 r1:00000000 r2:0001d890 r3:00000000 r4:00000436 r5:00000154 r6:e000163c r7:0001e090 r8:e000168c r9:00000000 r10:00000210 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000ef5c cpsr:nzCv 0000ef54 e5d60001 ldrb r0,[r6+0x001] r0:00000019 r1:00000000 r2:0001d890 r3:00000000 r4:00000436 r5:00000154 r6:e000163c r7:0001e090 r8:e000168c r9:00000000 r10:00000210 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000ef60 cpsr:nzCv 0000ef58 e512a234 ldr r10,[r2-0x234] r0:00000019 r1:00000000 r2:0001d890 r3:00000000 r4:00000436 r5:00000154 r6:e000163c r7:0001e090 r8:e000168c r9:00000000 r10:00000016 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000ef64 cpsr:nzCv 0000ef5c e0040a90 mul r4,r0,r10 r0:00000019 r1:00000000 r2:0001d890 r3:00000000 r4:00000226 r5:00000154 r6:e000163c r7:0001e090 r8:e000168c r9:00000000 r10:00000016 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000ef68 cpsr:nzCv 0000ef60 e5d6020d ldrb r0,[r6+0x20d] r0:00000000 r1:00000000 r2:0001d890 r3:00000000 r4:00000226 r5:00000154 r6:e000163c r7:0001e090 r8:e000168c r9:00000000 r10:00000016 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000ef6c cpsr:nzCv 0000ef64 e1811000 orr r1,r1,r0 r0:00000000 r1:00000000 r2:0001d890 r3:00000000 r4:00000226 r5:00000154 r6:e000163c r7:0001e090 r8:e000168c r9:00000000 r10:00000016 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000ef70 cpsr:nzCv 0000ef68 e08f0081 add r0,pc,r1 lsl #1 r0:0000ef70 r1:00000000 r2:0001d890 r3:00000000 r4:00000226 r5:00000154 r6:e000163c r7:0001e090 r8:e000168c r9:00000000 r10:00000016 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000ef74 cpsr:nzCv 0000ef6c e590f0b0 ldr pc,[r0+0x0b0] r0:0000ef70 r1:00000000 r2:0001d890 r3:00000000 r4:00000226 r5:00000154 r6:e000163c r7:0001e090 r8:e000168c r9:00000000 r10:00000016 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000d6dc cpsr:nzCv 0000d6d4 e5560028 ldrb r0,[r6-0x028] r0:00000000 r1:00000000 r2:0001d890 r3:00000000 r4:00000226 r5:00000154 r6:e000163c r7:0001e090 r8:e000168c r9:00000000 r10:00000016 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000d6e0 cpsr:nzCv 0000d6d8 e3100080 tst r0,#0x00000080 r0:00000000 r1:00000000 r2:0001d890 r3:00000000 r4:00000226 r5:00000154 r6:e000163c r7:0001e090 r8:e000168c r9:00000000 r10:00000016 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000d6e4 cpsr:nZCv 0000d6dc 1a000006 bne 0x0000d6fc r0:00000000 r1:00000000 r2:0001d890 r3:00000000 r4:00000226 r5:00000154 r6:e000163c r7:0001e090 r8:e000168c r9:00000000 r10:00000016 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000d6e8 cpsr:nZCv 0000d6e0 e3100040 tst r0,#0x00000040 r0:00000000 r1:00000000 r2:0001d890 r3:00000000 r4:00000226 r5:00000154 r6:e000163c r7:0001e090 r8:e000168c r9:00000000 r10:00000016 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000d6ec cpsr:nZCv 0000d6e4 1a000000 bne 0x0000d6ec r0:00000000 r1:00000000 r2:0001d890 r3:00000000 r4:00000226 r5:00000154 r6:e000163c r7:0001e090 r8:e000168c r9:00000000 r10:00000016 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000d6f0 cpsr:nZCv 0000d6e8 e2833078 add r3,r3,#0x00000078 r0:00000000 r1:00000000 r2:0001d890 r3:00000078 r4:00000226 r5:00000154 r6:e000163c r7:0001e090 r8:e000168c r9:00000000 r10:00000016 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000d6f4 cpsr:nZCv 0000d6ec e5561027 ldrb r1,[r6-0x027] r0:00000000 r1:00000016 r2:0001d890 r3:00000078 r4:00000226 r5:00000154 r6:e000163c r7:0001e090 r8:e000168c r9:00000000 r10:00000016 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000d6f8 cpsr:nZCv 0000d6f0 e3a00018 mov r0,#0x00000018 r0:00000018 r1:00000016 r2:0001d890 r3:00000078 r4:00000226 r5:00000154 r6:e000163c r7:0001e090 r8:e000168c r9:00000000 r10:00000016 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000d6fc cpsr:nZCv 0000d6f4 e00a0190 mul r10,r0,r1 r0:00000018 r1:00000016 r2:0001d890 r3:00000078 r4:00000226 r5:00000154 r6:e000163c r7:0001e090 r8:e000168c r9:00000000 r10:00000210 r11:0001d890 r12:e00014e8 r13:e0003fdc r14:00007b5c r15:0000d700^C cpsr:nZCv ________________________________________________________________________________ 2012-02-28 - bsnes_v086r12.tar.bz2 Attract demonstration game is fully playable. --- Bingo. The F3 and F4 dumps are both valid. Code: #include #include //basically just add 32-bit words together. simple stuff. void checksum(const char *filename, unsigned size) { FILE *fp = fopen(filename, "rb"); unsigned r0 = 0, r4, r9; while(ftell(fp) < size) { r4 = fgetc(fp); r9 = fgetc(fp); r4 |= r9 << 8; r9 = fgetc(fp); r4 |= r9 << 16; r9 = fgetc(fp); r4 |= r9 << 24; r0 += r4; } fclose(fp); printf("%s[0:%.5x] = %.8x\n", filename, size, r0); } int main() { checksum("0xf3.bin", 0x1f440); checksum("0xf4.bin", 0x05100); checksum("0xf3.bin", 0x20000); checksum("0xf4.bin", 0x08000); return 0; } Code: 0xf3.bin[0:1f440] = ecf28ee0 0xf4.bin[0:05100] = bd8a23a5 0xf3.bin[0:20000] = ecf28ee0 0xf4.bin[0:08000] = a75e50f8 F3 has null data at the end of the file, thus its checksum is ecf28ee0 @ 1f440 and ecf28ee0 @ 20000. F4 does not have null data at the end, thus its checksum is bd8a23a5 @ 5100 and a75e50f8 @ 8000. So yes, random as it may appear ... both dumps are perfectly valid. So I guess F4 is also ROM ... I'll rename it to dataROM for now. For v087, I'm going to seed st0018.rom as the two ROMs appended together, like I do for the uPD chips and FEoEZ ROM. It'll be a 160KB file. But until then, we'll leave it as st0018.rom and st0018d.rom, as we have it now. And now with MUL/MLA supported, we're back to no invalid ops (that we know of) being executed ... so it's just some CPU bugs preventing the game from running fully. ________________________________________________________________________________ 2012-02-28 - bsnes_v086r11.tar.bz2 I'm ... really not following this at all >_< I've uploaded a new WIP. It completes F1 (test), F2 (test), and AA (9x9+16 board upload.) It runs B3 (checkmate), but is telling the CPU that checkmate has occurred as soon as you start a new game. It's not hitting any missing opcodes, so I can only guess there are CPU bugs. Also, my implementation of the status register isn't exactly right. It seems for the board upload, it waits for $3804.d4 (&#$10) = 0. If I set that to !armtocpu.ready, the game dies with ST0018 fail right at power-on. So I'm not really sure how all the flags work right now. It does seem to be properly handshaking, though. You can see the ST0018 telling the CPU how many bytes are remaining in the upload after each write. Also ... if you put the 32K file in the same folder as st0018.rom, and name it st0018d.rom, it will load that into a000:0000-7fff. The game seems to read from it at power-on, but never writes to it. I'm not sure what's up with that right now. And I'm going to sleep. I'm pretty much stuck here, so I could realllllly use some help :/ ________________________________________________________________________________ 2012-02-27 - bsnes_v086r10.tar.bz2 More ARM work. ARM core now begins to act upon initial 0xf1 command, but hangs. ________________________________________________________________________________ 2012-02-26 - bsnes_v086r09.tar.bz2 A lot more work on the ARMv3 core. ________________________________________________________________________________ 2012-02-26 - bsnes_v086r08.tar.bz2 Contains the fledgling beginnings of an ARM CPU core, which can execute the first three and a half instructions of the ST-0018. It's a start, I guess. ________________________________________________________________________________ 2012-02-23 - bsnes_v086r07.tar.bz2 USART improvements. The clock pulse from reading data() drives both reading and writing. Also added a usart_init() to bind the initializer functions, so all you need now is: extern "C" usartproc void usart_main() { ... } And inside, you use usart_read(), usart_write(), etc. So we can add all the new functions we want (eg I'd like to have usart_readable() to check if data is available) without changing the entry point signature. blargg enhanced his Teensy driver to ignore frame error reads, as well. ________________________________________________________________________________ 2012-02-22 - bsnes_v086r06.tar.bz2 It is done. bsnes can now emulate sending and receiving data via USART. As such, the UART code has been removed. The final UART code can be downloaded here: http://byuu.org/snes/uart/ I won't maintain it going forward, because nobody ever used it, and USART is superior in every way. I've also verified both sending and receiving on the real SNES now :D It's so easy ... a caveman with electrical engineering and computer programming experience can do it. ________________________________________________________________________________ 2012-02-22 - bsnes_v086r05.tar.bz2 USART implements reading and writing, but I don't yet have code to test SNES reading yet. So ... obviously I need to do that next. Went ahead and required nall::function, so the modules will have to be C++11. I don't see anyone else making these, and it avoids the annoyance of deducing the correct controller port based on dynamic casting the active thread. Apparently a library can have a main() function to no ill effect, so there's no need for USART_HARDWARE. Same exact code with different flags will make the binary and the library. ________________________________________________________________________________ 2012-02-21 - bsnes_v086r04.tar.bz2 There will probably be a series of small WIPs as I experiment here. snes/controller/serial is now snes/controller/uart. Asynchronous serial communications, typically capped at 57,600 baud. snes/controller/usart is new. It aims to emulate the SNES connected to a Teensy++ board, and can easily handle 524,288 baud. And much more importantly, it's synchronous, so there are no timing issues anymore. Just bit-bang as fast as you can. Right now, the USART code is just enough for SNES->PC to transfer data to ... well, nothing yet. Unless anyone is actually using the UART stuff, I'll be removing it once the USART is totally up and running. No sense maintaining code that is 10x slower, more error prone, and used by nobody. Note: this is all thanks to blargg being absolutely amazing. ________________________________________________________________________________ 2012-02-17 - bsnes_v086r03.tar.bz2 Cart unload save path was using the new game rather than the old game. Caused by trying to allow a failed cartridge load to not unload the current game. But that's so uncommon that it's not worth worrying about. It'll always unload before trying to load a new game now. Removed the TM/TS disable speedup, to fix Madara 2's text boxes. This actually did cause a slight performance penalty on games that disable layers via TM/TS. Zelda 3 inside Link's house is a good example. It knocked the FPS from 98.5 to 94.5. So to counter that, I removed conditionals from tiledata loading and decoding, and used fall through switches. This boosted us back to 97.0. The -march=native flag apparently works better with SB now, so that was added, putting us up to 99.0fps. So it should be the same speed in the worst case, and slightly faster in the best case. Bumped the pre-render time to 68 clocks from 60 clocks. Adjusted sprite tile fetch time from 22 to 14 to compensate. This should give us perfectly stable Dai Kaijuu Monogatari 2 battles. ________________________________________________________________________________ 2012-02-15 - bsnes_v086r02.tar.bz2 Fixed Super Game Boy RAM saving and loading. It plainly wasn't hooked up at all. Was apparently hard-coded before it became a multi-emulator. I also fixed a crashing issue when loading Satellaview-slotted or Satellaview games without specifying the sub-cart, wasn't setting has_bsx_slot = true, so the raw memory wasn't being allocated internally when it wasn't mapped in. Of course a better fix would be to just not physically map the ranges if the things aren't present. Kind of a lazy hack to map blank cartridges there, but oh well. Oh, fixed title displays as well; and did the best I could for now with regards to multi-file path saving. Basically, Satellaview-slotted and Sufami Turbo modes need special handling for cheats.xml and states.bsa. Your cheat codes may apply to where the two different ST games are mapped in currently, or your save state may be dependent upon the Tengai Makyou pack being loaded into Same Game. Storing the cheats.xml in either the base or one of the slot folders isn't enough. The base can have different slotted carts, and the slotted carts can be put in different configurations or into different cartridges. We need something like this: Code: Base (US).sfc/ Slot 1 (US).bs + Slot 2 (US).bs/ cheats.xml state-1.bsa Slot 1 (US).st/ Slot 2 (US).st/ ... but I really don't want to jump through a million hoops to make that happen. So for now, these two modes are rare enough that I'll just have them store to the first child slot. Use cheats and states on them at your own risk. Once we enforce folder loading across the board, I can simplify things and do the above, no problem. Aside: the complexity really has to stop here. bsnes is starting to get overwhelming for just me alone. The abstractions needed to support multiple systems at a time (and I want that very much, fuck having five different GUIs) is really starting to get hard to keep in order in my head. ________________________________________________________________________________ 2012-02-15 - bsnes_v086r01.tar.bz2 The goals for v087 are to have a unified cartridge-folder concept, as well as a more functional SNES debugger. Starting with the cartridge folders. What I have so far: Code: NES: * program.rom * character.rom * program.ram * … SNES: * program.rom * program.rtc * data.rom (SPC7110) * { dsp1.rom, dsp1b.rom, cx4.rom, … } * msu1.rom * track-#.pcm Game Boy, Game Boy Color: * program.rom * program.ram * program.rtc Sub-cartridges (BS-X, Sufami Turbo, …) are stored as separate folders Folder names must be UTF-8 based, with all-lowercase extensions File names must be all-lowercase SNES: * "program.ram" (.srm, .sts) * "msu1.rom" (name.msu) * "track-#.pcm" (name-#.pcm) * "upd96050.ram" -> "name.ram" * "bsx.ram" (.bss) * "bsx.psram" (.bsp) * "serial.so" -> "libserial.so" (broken) Need: * Super Game Boy (not even sure how this loads and saves memory, it's obviously broken) And I need to think of some way of handling multi-cart loaded games. Eg Satellaview-slotted and Sufami Turbo. It was { base + slot ( + slot ... } }, but this gets trickier with folders and fixed names. Actual markup for the NES needs to change as well. ________________________________________________________________________________ 2012-02-13 - bsnes_v086-source.tar.bz2 The main focus of this release is Laevateinn, which is the new bsnes debugger. Unlike previous debuggers, Laevateinn is a standalone application with its own GUI entirely focused on debugging. Changelog: created ui-debugger target (Laevateinn) fixed multitap ports 2-4 [quequotion] fixed ui-libsnes target compilation fixed a crashing issue with NSS XML markup improved cartridge-folder loading support NES can now load .fc (headerless NES) or .prg+.chr (split NES) images fixed cursor being visible in fullscreen mode when using Linux/Metacity window manager [ncbncb] show normal cursor when using Linux/SDL video driver [ncbncb] added menu accelerators fixed a bug in performance profile SMP incw/decw instructions SNES core can now optionally be built without Game Boy emulation core added 2012-02-04 cheats.xml database [mightymo] ________________________________________________________________________________ 2012-02-12 - bsnes_v085r09.tar.bz2 See debugger thread for changes. -- ../emus/bsnes/laevateinn_v085r09.tar.bz2 Includes Windows 64-bit binary (in the out/ folder) and source code. You'll have to patch phoenix to compile on 32-bit mode. Finally figured it out: TDM/GCC 32-bit lacks updated Win32 Platform API headers, whereas the 64-bit version does not. Isn't that fun? ./sshots/laevateinn_v085r09.png Added VRAM viewer (mouse over to get tile# and VRAM address), CPU+SMP register editors, settings.cfg to cache path+sync audio+mute audio settings (Windows Vista+ ignore my request for the default folder because they are fucking stupid, so they always default to your home folder. I'm going to have to recommend using a batch file to start laevateinn there. Sorry, blame Microsoft for being fuck-ups), geometry.cfg to remember where you placed windows and what size you made them (a bug in Qt prevents me from making some windows fixed-size for now, but that'll change when I can work around the Qt issue), usage map invalidation if the ROM was modified after the usage files, that empty line insertion thing creaothceann wanted on emulation resume, all chips now synchronize immediately rather than just-in-time, which is important for a debugger. Going to postpone the properties viewer until after v086. ________________________________________________________________________________ 2012-02-11 - bsnes_v085r08.tar.bz2 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 -- Test binary - Windows amd64 accuracy profile: (you need 64-bit Windows!!) ../emus/bsnes/laevateinn_v085r08.7z You'll have to resize the windows a bit, based on your font. I'm still doing manual sizing that's optimal for Linux right now. ./sshots/laevateinn_v085r08.png 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. EDIT: Forgot to connect the PPU events to the core. So PPU breakpoints won't work on this binary, sorry. Added NMI and IRQ buttons to the CPU debugger. Clicking them seeks you to the respective interrupt entry points. Added trace masking and trace mask reset. Added memory export for all memory modes. Cartridge loading is now folder-based. ________________________________________________________________________________ 2012-02-10 - bsnes_v085r07.tar.bz2 Changelog: * stuff -- ./sshots/laevateinn_v085r07.png Breakpoints now work on CPU { Read, Write, Exec }. They have next-to-zero overhead now. Rather than testing all possible breakpoints in linear fashion, I build vector lists for all possible combinations. So if you only have one CPU read breakpoint, CPU writes won't bother testing anything. The whole thing is honestly designed for speed. I can easily run the accuracy core at >60fps here. But of course, the fact that I won't support the debugger in compatibility mode will be problematic for people without i7's. Maybe someone here can patch PPU-compatibility or something. The usage maps are back. They are necessary for proper forward+backward disassembly. They're saved across runs. I will probably get fancier at some point and do a timestamp check to invalidate the usage maps if the ROM was modified. Decided against having gamename-bla.ext for every debugger file. Enforcing my folder-style, sorry. Say you have /path/to/Zelda (U).sfc/{ SFC, SRM, etc. } It will make: /path/to/Zelda (U).sfc/debug/ { usage.cpu, usage.apu, trace-NNN.log, etc. } Again, this is what I meant by personal project. Doing things my way. If you guys don't like these types of choices, I'll welcome a fork that changes things up to be more mainstream. Now, for the CPU debugger ... "Step Into" will run until the next CPU opcode edge and then break. Whereas the console "Step" will run until the next enabled chip under the debug menu hits an instruction. The other commands are more problematic, and disabled for now. See, bsnes is a sub-cycle-accurate emulator. That means that you can be in the middle of an opcode when the emulator is paused. You obviously cannot skip a half-executed opcode. Worst case, you will have to hit "Step Into" once to align it to an opcode edge, and then you can use the other commands. Once they're implemented. Not sure if they'll make it to the first official release. So ... major things missing: * SMP/PPU breakpoints * SMP debugger * SMP stepping / tracing * memory editor on APU-bus / VRAM / OAM / CGRAM * save state menu * window geometry memorization * trace mask * WRAM mirroring on breakpoints Nice things missing: * global hotkeys * key configuration * properties viewer for each processor * trace mask / usage map flush * tilemap / spritemap / tiledata viewers Nice to dream things missing: * register editors * mosaic integration * bass integration * symbol integration into disassemblers * step (over, out); skip * trace for N opcodes ________________________________________________________________________________ 2012-02-08 - bsnes_v085r06.tar.bz2 Lots of debugger enhancements. Memory editor works for CPU-bus only, breakpoint editor does nothing yet. Tracing works, writes to 001-999 files sequentially. Stepping works, too. But only on the CPU. Added "privileged", which becomes "public" if DEBUGGER is defined, "private" otherwise. Meant so the debugger can stab deeply into the cores for state manipulation. Interface is guaranteed to be unstable and dependent upon the accuracy core. The about screen logo adds 100KB onto the source download (won't affect regular bsnes binaries), but too bad. I want some visual flair this time. Debugger so far is looking incredibly awesome, at least to me: http://i.imgur.com/rEpr6.png ________________________________________________________________________________ 2012-02-06 - bsnes_v085r04.tar.bz2 Changelog: * added base/ folder * base/base.hpp defines the version number for all UI targets, all the varint-types, and a hook() class for debugger functions (see below) * fixed compatibility profile compilation * removed within<> template from the SNES target * the SNES core can be built without Game Boy support now, if you so choose (my SNES debugger is not going to support debugging the GBZ80, sorry.) * added ui-debugger; not at all useful right now, will be a long while to get something usable ready So hook is a class wrapper around nall::function. It allows you to invoke potentially empty functions (and as such, the return type must have a trivial constructor.) It also doesn't actually perform the test+invocation when DEBUGGER (options=debugger) is not defined. So you should have no overhead in regular builds. The core classes now have a subclass with all the debugging hooks, so you'll see eg: Code: void CPU::op_step() { debugger.op_exec(regs.pc); (this->*opcode_table[op_read()])(); } Clear what it's doing, clear what it's for. A whole lot less work than inheriting the whole CPU core and virtualizing the functions we want to hook. All the logic for what to do inside these callbacks will be handled by individual debuggers, so they can have all the functionality they want. I may also add a debugonly #define that becomes "public" for the debugger, and "private" otherwise. That way the debugger can really prod into internal state at will, with the obvious caveat that the interface is subject to change. ________________________________________________________________________________ 2012-02-04 - bsnes_v085r03.tar.bz2 Changelog: * fixed cursor being visible under Metacity window manager (hopefully doesn't cause regression with other WMs) * show normal cursor when using SDL video driver * added menu accelerators (meh, why not?) * removed debugvirtual, ChipDebugger and chip/debugger functionality entirely * alt/smp disassembler moved up * fixed alt/smp incw/decw instructions (unsigned->uint16 for internal variables) My plan going forward for a debugger is not to hardcode functionality that causes the 10-15% slowdown right into the emulator itself. Instead, I'm going to make a callback class, which will be a specialized version of nall::function: * can call function even if not assigned (results in no-op, return type must have a trivial default constructor) * if compiled without #define DEBUGGER, the entire thing turns into a huge no-op; and will be eliminated entirely when compiled * strategically place the functions: cb_step, cb_read, cb_write, etc. From here, the ui-debugger GUI will bind the callbacks, implement breakpoint checking, usage table generation, etc itself. I'll probably have to add some breakout commands to exit the emulation core prior to a frame event in some cases as well. I didn't initially want any debugger-related stuff in the base cores, but the #if debugger sCPUDebugger #else sCPU #endif stuff was already more of a burden than this will be. ________________________________________________________________________________ 2012-01-25 - bsnes_v085r02.tar.bz2 Fixed NSS XML crashing issue. Improved folder-loading support. NES can now load game.fc/game.fc, or game.fc/game.prg+game.chr. Both types should have no iNES header at all. And both types require an XML file (until we have a built-in database.) Windows users: if you compile your own build with the options := console enabled, it will print any iNES mapping string to the terminal for you, so you can see how to generate your own XML. ________________________________________________________________________________ 2012-01-14 - bsnes_v085r01.tar.bz2 Changelog: * updated bsnes to use the newest versions of nall and phoenix * fixed ui-libsnes compilation (testing would be a good idea, especially the cheat codes. I just copy-pasted that from the regular UI.) * fixed multitap controllers 2-4 [quequotion] ________________________________________________________________________________ 2012-01-02 - bsnes_v085-source.tar.bz2 A new release for the new year. Changelog: fixed auto joypad polling edge case; fixes Ys 5 controls fixed Justifier polling code; Lethal Enforcers should be fully responsive once again rewrote SNES S-SMP processor core (~20% code reduction) fixed Game Boy 8x16 sprite mode; fixed some sprites in Zelda: Link's Awakening treat Game Boy HuC1 RAM enable flag as writable flag instead; fixes Pokemon Card GB created far faster XML parser; bsnes can now load XML files once again updated to mightymo's most recent cheat code database internal color calculations now performed at 30-bits per pixel gamma slider now acts as fine-tuned gamma ramp option Linux OpenGL driver will output at 30bpp on capable displays Linux port defaults to GTK+ now instead of Qt (both are still available) ________________________________________________________________________________ 2011-12-31 - bsnes_v084r08.tar.bz2 (Windows binary included.) Okay, everything can now load XML again, including board layouts for all three systems. New is the ability to load external Game Boy layouts (not really that useful, but it's there.) I'd like to aim for a v085 release soon. I've included a binary, so I'd appreciate testing. I had to redo all of the XML mappings for every system (I like consistency), so basically the following things need to be tested: * load one of every type of game for every system (every NES board type, every Game Boy MBC type, every SNES chip and layout type.) * test cheat codes and the cheat database * test pixel shaders for OpenGL and Direct3D (sepia for the win) * test anything else for v085 release ________________________________________________________________________________ 2011-12-30 - bsnes_v084r07.tar.bz2 Added the new super-fast XML parser. So far, the shaders, cheat files, and cheat database have been updated to allow XML mode once again. Which is sure to please Screwtape =) So it's down to just the cartridge mapping files now, which are always a major pain. I still think BML is better for parsing simplicity, memory usage, disk size, lack of red tape and speed (but horrendously bad for ease of creating files manually), but since the base API is identical, there's no reason not to support both. Especially since the pixel shaders have kind of taken on a life of their own. ________________________________________________________________________________ 2011-12-26 - bsnes_v084r06.tar.bz2 Changelog: * fixed sprite tile masking for 8x16 mode (fixes Zelda: DX sprites) * HuC1 flag sets RAM writable, not RAM enable (fixes Pokemon Card) * removed within<> template, didn't turn out to be all that useful I would be almost certain no games would break by allowing reads when it is disabled, no game would rely on that behavior. I prefer to be overly restrictive. Better to not allow valid behavior than to allow invalid behavior. The latter is what gives us a dozen broken SNES translations. ________________________________________________________________________________ 2011-12-17 - bsnes_v084r05.tar.bz2 Spent a good two hours trying things to no avail. I was trying to allow the CPU to run ahead, and sync on accesses to $4016/4017/4201/4213, but that doesn't work because the controllers have access to strobe IObit at will. The codebase is really starting to get difficult to work with. I am guessing because the days of massive development are long over, and the code is starting to age. Jonas' fix works 98% of the time, but there's still a few missed shots here and there. So that's not going to work either. So ... I give up. I've disabled the speed hack, so that it works 100% of the time. Did the same for the Super Scope: it may not have the same problem, but I like consistency and don't feel like taking the chance. This doesn't affect the mouse, since the mouse does not latch the counters to indicate its X/Y position. Speed hit is 92->82fps (accuracy profile), but only for Super Scope and Justifier games. But ... at least it works now. Slow and working is better than fast and broken. I appreciate the help in researching the issue, Jonas and krom. Also pulled in phoenix/Makefile, which simplifies ui/Makefile. Linux port defaults to GTK+ now. I can't get QGtkStyle to look good on Debian. ________________________________________________________________________________ 2011-12-11 - bsnes_v084r04.tar.bz2 Fixed the Ys 5 input bug in the auto joypad polling code. Can't guarantee it's hardware-accurate (I have no way to extensively test it), but I can guarantee it is closer to being correct now. Also uses updated version of phoenix. The justifier input is indeed all fucked up now. Seems like it stops updating input after firing for a few frames. I really don't want to debug that code anymore ... anyone want to make $10 by fixing it? :P ________________________________________________________________________________ 2011-12-03 - bsnes_v084r03.tar.bz2 snesfilter_20111202.tar.bz2 Internally, all color is processed with 30-bit precision. The filters also operate at 30-bit depth. There's a new config file setting, video.depth, which defaults to 24. This causes the final output to downsample to 24-bit, as most will require. If you set it to 30-bit, the downsampling will not occur, and bsnes will ask ruby for a 30-bit surface. If you don't have one available, you're going to get bad colors. Or maybe even a crash with OpenGL. I don't yet have detection code to make sure you have an appropriate visual in place. 30-bit mode will really only work if you are running Linux, running Xorg at Depth 30, use the OpenGL or XShm driver, have an nVidia Quadro or AMD FireGL card with the official drivers, and have a 30-bit capable monitor. Lots of planning and work for very little gain here, but it's nice that it's finally finished. Oh, I had to change the contrast/brightness formulas a tiny bit, but they still work and look nice. ________________________________________________________________________________ 2011-11-16 - bsnes_v084r01.tar.bz2 I rewrote the S-SMP processor core (implementation of the 256 opcodes), utilizing my new 6502-like syntax. It matches what bass v05r01 uses. Took 10 hours. Due to being able to group the "mov reg,mem" opcodes together with "adc/sbc/ora/and/eor/cmp" sets, the total code size was reduced from 55.7KB to 42.5KB for identical accuracy and speed. I also dropped the trick I was using to pass register variables as template arguments, and instead just use a switch table to pass them as function arguments. Makes the table a lot easier to read. Passes all of my S-SMP tests, and all of blargg's arithmetic/cycle-timing S-SMP tests. Runs Zelda 3 great as well. Didn't test further. This does have the potential to cause some regressions if I've messed anything up, and none of the above tests caught it, so as always, testing would be appreciated. Anyway, yeah. By writing the actual processor with this new mnemonic set, it confirms the parallels I've made. My guess is that Sony really did clone the 6502, but was worried about legal implications or something and changed the mnemonics last-minute. (Note to self: need to re-enable snes.random before v085 official.) ________________________________________________________________________________ 2011-11-07 - bsnes_v084-source.tar.bz2 This release adds preliminary Game Boy Color emulation. Due to lack of technical information, this is undoubtedly the least stable module I provide at this time; but improvements should continue as it is developed. This release also polishes the NES emulation and user interface code. Changelog: added preliminary Game Boy Color emulation NES: added MMC6, VRC1, VRC2, VRC3 emulation NES: fixed MMC5 banking and added split-screen support [Cydrak] NES: pass all of blargg's ppu_vbl_nmi tests, pass more sprite tests NES: palette is now generated algorithmically [Bisqwit] SNES: fixed SA-1 IRQ regression caused by code refactoring Game Boy: rewrote audio channel mixing code; sound output is greatly improved as a result Game Boy: uses DMG boot ROM instead of SGB boot ROM Game Boy: fixed potential bug when loading save states phoenix: fixed ListView focus issue [X-Fi6] phoenix: fixed dialog message parsing [X-Fi6] ui: video output is truly 24-bit now; SNES luma=0 edge case emulated ui: audio frequency, latency, resampler are now user configurable ui: gamma ramp is dynamically adjustable ui: all filters ported to 24-bit mode (speed hit to HQ2x) ui: added turbo button mappings for all generic controllers ui: fixed audio volume on unmute via menu [Ver Greeneyes] ui: shrink window option does nothing when no cartridge is loaded ui: re-added compositor disable, driver verification from v082 ________________________________________________________________________________ 2011-11-03 - bsnes_v083r10.tar.bz2 Changelog: * NES: added VRC1, VRC2, VRC3, MMC6 emulation * shrink window doesn't do anything when no cartridge is loaded * phoenix Horizontal,VerticalLayout use const Size& instead of unsigned width,height [for consistency] So, all official NES ASICs are supported now. Just need sound output for MMC5+VRC7 to complete them; and then some board re-arrangement stuff for VRC2+MMC3. Note that MMC6 uses the same mapper ID as MMC3, and VRC2 uses the same ID as VRC4, so you have to make a BML board mapping or toggle which type is chosen in the source file to use these two chips. ________________________________________________________________________________ 2011-10-31 - bsnes_v083r09.tar.bz2 Specifically asked not to be bugged about L/R turbo, sigh :( Added frequency, latency, resampler selection to the audio settings panel (I really only wanted it there for resampler selection ... having three options matches the driver selection style though, so whatever.) The linear/hermite sampler will double the framerate when running Game Boy games, and sounds the same. Same framerate and sound quality on SNES. But it will cause buzzing in many NES titles. Also re-added the composition { never, fullscreen, always } modes. I think that option is clutter, but it's just impossible to get good audio+video on Windows 7 without it ... Lastly, HQ2x was ported over, but not very well. I just convert source pixels from RGB888 to RGB555, and output pixels in the opposite direction. Need someone good to port the diff() and blend functions over to RGB888 in a way that's not terribly slow. ________________________________________________________________________________ 2011-10-29 - bsnes_v083r08.tar.bz2 Fixed SA-1 IRQ regression for Super Mario RPG Added turbo B,A to NES+GB; B,A,X,Y to SNES (please don't ask for turbo L,R; you never use those keys rapidly.) Re-added video color adjustments, which are now done in full 8-bit colorspace for more precision Gamma ramp option is gone. It's now the gamma option, which now only affects the lower-half of the colors. A value of 1.0 gives you the original, washed out colors. 1.75 is what the gamma ramp checkbox used to do (roughly). The new default is 1.5, which still prevents color washout, but isn't as overly dark as before. I wanted to make the core/interface stuff abstract the complexity of setting up a new C++ class, but it really didn't make anything easier. It was all one-line stubs to internal functions, and there was just too many platform-specific things that needed to be captured, so I did away with that. Made a base class for the ui/interface stuff to get rid of a lot of switch(mode()) stuff, still a work in progress. ________________________________________________________________________________ 2011-10-28 - bsnes_v083r07.tar.bz2 Game Boy: audio should sound a lot better, eg Zelda: DX first opening scene Game Boy Color: now uses cothread Processor::frequency to dynamically clock GB-CPU to 8MHz. Proper OAM DMA and timer speed. Fixes SMT: DC - WB audio. Added the break; statements to phoenix/windows/platform message loop Added audio latency/frequency to config file only ________________________________________________________________________________ 2011-10-27 - bsnes_v083r06.tar.bz2 All cores: Video classes have internal->{RGB30,24,16,15} palette generation support All cores: video output is now RGB24, all filters except HQ2x were updated to reflect this (HQ2x will be very hard) NES: MMC5 CHR mapping fixes (Bandit Kings, RTK2, Uchuu Keibitai SDF) [Cydrak] NES: MMC5 vertical split screen support (Uchuu Keibitai SDF) [Cydrak] Game Boy + Game Boy Color: fixed a potential freezing bug when loading save states (re-create cothreads on state load; was implied when using SGB mode.) Game Boy Color: fixed freezing bug with Zelda: DX opening (SVBK is readable.) SNES: luminance of zero is no longer pure black, as on real hardware. This is possible thanks to using RGB888 output now. ________________________________________________________________________________ 2011-10-25 - bsnes_v083r05.tar.bz2 NES: passes ppu_sprite_overflow tests 01, 02, 05. Game Boy: uses DMG BIOS (the one with the slow title scroll) or SGB BIOS, based upon how you load the game Game Boy Color: http://byuu.org/images/bsnes_20111025a.png http://byuu.org/images/bsnes_20111025b.png http://byuu.org/images/bsnes_20111025c.png http://byuu.org/images/bsnes_20111025d.png Everything except the IR port is emulated. I don't have any plans to allow linking two instances of bsnes. And that's frankly never going to happen over netplay anyway, due to latency requirements of the serial/IR ports. The new DMA stuff is possibly incorrect, my test games don't seem to use it. Zelda: DX usually resets or crashes on the intro right before the beach scene. I'm not sure why. Skip the intro and the game plays fine. This is the best I can do when the most up-to-date GB/C reference document is over ten years old and half-assed (pandocs.) I could really use some help from anyone who understands the system. Probably the worst part of my emulation at the moment is the interrupt system. Lots of things real hardware doesn't allow (DMA outside HRAM, CGB DMA to invalid addresses, etc) isn't blocked yet. LCD renderer is still scanline-based, which is just terrible. Doesn't seem to be any good docs on cycle-level operation. I only know that it's incredibly pathological and variable. ________________________________________________________________________________ 2011-10-24 - bsnes_v083r03.tar.bz2 Lots of phoenix issues fixed, especially for Windows and GTK+. NES emulation passes all ten ppu_vbl_nmi tests from blargg. Sprite timing is nowhere near accurate yet (always consumes four clocks per sprite), but oh well. ________________________________________________________________________________ 2011-10-17 - bsnes_v083r02.tar.bz2 It seems impossible to pass blargg's NES ppu_vbl_nmi test 03 and 07 at the same time. Wrote up a description of the problem here: http://nesdev.parodius.com/bbs/viewtopi ... 5156#85156 ________________________________________________________________________________ 2011-10-16 - bsnes_v083r01.tar.bz2 This adds Bisqwit's NES palette generation code: http://nesdev.parodius.com/bbs/viewtopi ... 5060#85060 I set the saturation to 2.0 to closer match the existing "bright" palette, although it still has a greater contrast range (some colors are darker.) The gamma ramp option works now. Like SNES, best to also set gamma to 0.8 afterward. Once I think of a good way to expose the saturation/hue settings, I'll do so. I've also merged in the updated nall. Adds Cygwin uname check, and replaces linear_vector with vector in lstring and the GUI. ________________________________________________________________________________ 2011-10-14 - bsnes_v083-source.tar.bz2 This release adds preliminary Nintendo / Famicom emulation. It's only a week or two old, so a lot of work still needs to be done before it can compete with the most popular NES emulators. It's important to clarify: bsnes is primarily an SNES emulator. That will always be its forte and my core focus. I have added Game Boy support previously for Super Game Boy emulation, and I've added NES support mostly for something fun to work on to break up the monotony of working on one system for seven years now. Obviously, I'd like the emulation to be accurate and highly compatible, but I simply cannot afford to invest the same amount of time and money into any other systems. Still, either way the NES and GB emulation serve as fun side-diversions, and allow for a unified emulator interface with all of bsnes' unique features applied to all systems. My personal favorite feature is mightymo's extended built-in cheat code database that now also includes NES and Game Boy codes. And it even works in Super Game Boy mode now, too! I'm also not worried about speed at all: so long as NES/GB are faster than SNES/compatibility, it's fine by me. Note that due to the NES audio running at 1.78MHz, and Game Boy audio at 4MHz stereo, a more sophisticated audio resampler was needed: Ryphecha (Mednafen author) has graciously written a first-rate resampler: it is a band-limited Kaiser-windowed polyphase sinc resampler. It is combined with two highpass filters to remove DC bias. The filter itself is SSE optimized, but even still, approximately 50% of CPU usage for NES/GB emulation goes to the audio filtering alone. However, you now have the best sound possible for NES and Game Boy emulation as a result. The GUI has also been heavily re-structured to accommodate multiple emulators from the same interface. As such, it's quite likely a few bugs are still lurking here and there. Please report them and I'll iron them out for the next release. Changelog: * license is now GPLv3 * re-structured GUI as a multi-system emulator * added NES emulation [byuu, Ryphecha] * added NES ICs: MMC1, MMC2, MMC3, MMC4, MMC5, VRC4, VRC6+audio, VRC7, Sunsoft-5B+audio, Bandai-LZ93D50 * added NES boards: AxROM, BNROM, CNROM, ExROM, FxROM, GxROM, NROM, PxROM, SxROM, TxROM, UxROM * Game Boy emulation improvements [Jonas Quinn] * SNES core outputs full 19-bit color (4-bit luma included) for more accurate color reproduction (~5% speed hit) * audio resampler is now a band-limited polyphase resampler [Ryphecha] * cheat database includes NES+GB codes as well [mightymo, tukuyomi] * lots of other changes ________________________________________________________________________________ 2011-10-11 - bsnes_v082r34.tar.bz2 (source only) Added MMC2, MMC4, VRC4, VRC7 (no audio.) Split NES audio code up into individual modules. Fixed libsnes to compile: Themaister, can you please test to make sure it works? I don't have a libsnes client on my work PC to test it. Added about / license information to bottom of advanced settings screen for now (better than nothing, I guess.) Blocked PPU reads/writes while rendering for now, easier than coming up with a bus address locking thing :/ I can't seem to fix MMC5 graphics during the intro to Uchuu Keibitai. Without that, trying to implement vertical-split screen mode doesn't make sense. So as far as special audio chips go ... * VRC6 is completed * Sunsoft 5B has everything the only game to use it uses, but there are more unused channels I'd like to support anyway (they aren't documented, though.) * MMC5 audio unsupported for now * VRC7 audio unsupported, probably for a long time (hardest audio driver of all. More complex than core NES APU.) * audio PCM games (Moero Pro Yakyuu!) I probably won't ever support (they require external WAV packs.) Three days to release, so whatever's missing / broken then will be staying that way for a while. ________________________________________________________________________________ 2011-10-07 - bsnes_v082r32.tar.bz2 (source only) Added delay to MMC1 register writes, to fix Bill & Ted's Godawful Adventure. Fixed up MMC5 RAM+fill mode, and added EXRAM mode support (8x8 tiles/attributes.) Just Breed is fully playable now. MMC5 is a total pain in the ass, the documentation on it is just terrible. I basically just tried seven hundred variations until something worked. I still need to add MMC5 vertical split screen (for one single game's attract screen, ugh), and the extra sound channels. Would like to rework the NES APU first. Since the pulse channels are identical sans sweep, it'd be nice to just inherit those and mask out the sweep register bit writes. So that probably won't make it into the first release, at least. Still, overall I think it'll be an impressive showing of complex mappers for a first release: MMC3, MMC5, VRC6 and 5B. The latter two with full audio. The only other really, really hard bit is the VRC7 audio, supposedly. ________________________________________________________________________________ 2011-10-05 - bsnes_v082r31.tar.bz2 (source only) Enable Overscan->Mask Overscan [best I'm doing] Video settings -> Overscan mask: (horizontal, vertical: 0-16 on each side) [only works on NES+SNES] BPS patching works for NES+SNES+GB; note that long-term I want BPS to only patch headerless PRG+CHR files, but we'll need a database / completed board mapping system first. MMC1 splits the board/chip markups a bit better. My attempts to emulate the extra CHR bits per hardware fail repeatedly. Docs do not explain how it works at all. Emulated enough of the MMC5 to play Castlevania 3. The MMC5 is easily the most complicated mapper the NES has to offer, and of course, has the most pitifully vague and difficult documentation of any mapper around. It seems the only way anyone is able to emulate this chip is empirically. Everyone else apparently hooks the MMC5 right into the PPU core, which I of course cannot do. So I had to come up with my own (probably wrong) way to synchronize the PPU simply by observing CHR bus accesses. I must say, I over-estimated how well fleshed out the NES hardware documentation was. Shit hits the fan right after MMC3. It's miles beyond the GB scene, but I find myself wanting for someone with the technical writing ability of anomie. I can't find anything at all on how we're supposed to support the $2007 port reads/writes without it extra-clocking the PPU's bus, which could throw off mapper timing. Absolutely nothing at all on the subject anywhere, something everybody is required to do for all cycle-based emulators and ... nada. Anyway, I'd like to refine the MMC5 a bit, getting Just Breed playable even without sound would be really nice (it's a fun game.) Then we need to get libsnes building again (ugh, getting worn out in backporting changes to it.) Once v083 is public, we can start discussing a new API for multiple emulators. ________________________________________________________________________________ 2011-10-04 - bsnes_v082r30.tar.bz2 (source only) cheats.xml -> cheats.bml, includes NES+SNES+GB codes now. Absolutely awesome, thanks to mightymo and tukuyomi. I also added Sunsoft-FME7/5B (with sound) emulation. Really only useful for playing the Japanese release of Gimmick! Fun game, but balls to the wall hard. Been a while since a WIP-release thread made it into the 30s. Anyway, you guys can probably guess when I'm hoping to release. So ... test accordingly please =) ________________________________________________________________________________ 2011-10-03 - bsnes_v082r29.tar.bz2 (source only) I doubt anyone is going to like these changes, but oh well. The base height output for NES+SNES is now always 256x240. The Enable Overscan option blanks out borders around the screen. This eliminates the need for an overscan software filter. For NES, it's 16px from the top and bottom, and 8px from the left and right. Anything less and you get scrolling artifacts in countless games. For the SNES, it's only 16px from the top and bottom. Main point is that most NTSC SNES games are 224-height games, so you'll have black borders. Oh well, hack the source if you want. Game Boy overscan option does nothing. Everything except for the cheats.xml file now uses BML markup. I need to write a converter for cheats.xml still. Cut the SNES board parsing code in half, 30KB->16KB. Much cleaner now. Took the opportunity to fix a mistake I made back with the XML spec: all numbers are integers, but can be prefixed with 0x to become hexadecimal. Before, offset/size values defaulted to hex-mode even without a prefix, unlike frequency/etc values. The XML shaders have gone in their own direction anyway, with most being multi-pass and incompatible with bsnes. So that said, please don't extend the BML functionality from your end. But f eel free to add to the XML spec, since other emulators now use that as well. And don't misunderstand, I love the work that's being done there. It's pretty awesome to see multi-pass shader capabilities, and the RAM watching stuff is just amazing. If there are any really awesome single-pass shaders that people would like, I can convert it from XML and include it with future releases. On that topic, I removed the watercolor/hdr-tv ones from the binary packages (still in the source archive) ... they are neat, but not very useful for actual gaming. If we had more than one, I'd remove the Direct3D sepia one. Not going to use shaders from a certain bipolar manic, because I'd never hear the end of it if I did :/ Oh, one change I think people will like: MSU1 no longer requires a memory map specification, so MSU1 authors won't have to keep updating to my newer revisions of board markups. Basically, if there's not a board with an msu1 section, it'll check if "gamename.msu" exists. If it does, MSU1 gets mapped to 00-3f,80-bf:2000-2007. If all you want is music, make a blank, zero-byte gamename.msu file. ________________________________________________________________________________ 2011-10-01 - bsnes_v082r28.tar.bz2 (source only) Was mostly working on BML. Still working on the spec. Added NES-BNROM, NES-GNROM/NES-MHROM boards. I don't even know why. The latter games do not work very well without Zapper support. ________________________________________________________________________________ 2011-09-30 - bsnes_v082r27.tar.bz2 (source only) Finished porting over all mappers to board/chip disambiguations. Had to nearly rewrite the MMC1 code to do it, but all variants should be supported. iNES1 is too stupid to express them all, so you'll need a board markup if you want to play the >8KB PRG RAM games. For whatever reason, they call VRC6's memory WRAM, and MMC1's PRG RAM. I am calling them all PRG RAM, since it's the same damn thing. Board spec is not going to be stable until I have a hell of a lot more mappers implemented, so be wary of that. Anyway, at this time, all games can be loaded sans iNES header, if you have the board markup. I'd also like to have a board database for all commercial titles. I'm treating *.fc as PRG-ROM(+CHR-ROM). Will work on loading the split files later possibly. ________________________________________________________________________________ 2011-09-28 - bsnes_v082r25.tar.bz2 (source only) Ryphecha fixed Gun Nac, it was some sort of problem with blank sprite address fetching messing with the MMC3 I've started on an XML parser for iNES-free loading, but it's pretty barebones right now. Only NROM-256 loads, and you have to make it a compile-time thing (so other games work for now.) Updated nall with nullptr stuff. nall/detect is now nall/intrinsic and has both #defines + static constants that can be used to detect the platform (allows for run-time platform checks where practical.) ruby has a Makefile now, that makes using it in other projects a lot easier I need to rework my XML parser, it's not really all that suitable for this, and NES is going to need probably 50x the XML parsing code of the SNES. I want to be able to quickly test if a required element exists or not, and grab its data. I also want to design it around start/end offset pairs, so that there's not so much malloc overhead. ________________________________________________________________________________ 2011-09-27 - bsnes_v082r24.tar.bz2 (source + Windows 64-bit binary) Upgraded to GCC 4.6.1. Removed nall/foreach and nall/concept, upgraded iterator support on all of my containers, and replaced everything with range-for. Fixed up Qt geometry a good bit, should at least create windows now without bouncing around. Added some initial nullptr / constexpr changes. Some other minor cleanups ... removing foreach() took about 6-8 hours alone. Turns out GCC has a 0bNNN extension for binary. I'm not big on being locked to specific compilers, but the syntax is so much more elegant than binary("100101010"); so we will see. ________________________________________________________________________________ 2011-09-26 - bsnes_v082r23.tar.bz2 (source only) Ryphecha fixed the FF1 glitch, added two highpass filters to NES audio output (still working on a lowpass), and fixed VRC6 audio issues. I reduced the complexity of all eight supported mapping modes, and standardized them; and added in an overscan filter (not in archive) for chopping off all the NES edge garbage (8 pixels on the left and right, 16 on the top and bottom.) It's extreme, but anything less shows junk. I may make this part of the menu option, just clip ________________________________________________________________________________ 2011-09-25 - bsnes_v082r22.tar.bz2 (source only) Mappers are now optionally threaded. Fixed up MMC3 emulation, SMB3 and MM3-6 are all fully playable. However, many unusual variants of this chip are not supported still. Added UNROM+UOROM for Contra and MM1, allowing all six MM games to play now. Added VRC6 with sound emulation, because I wanted to get audio mixing in place. Chose VRC6 because it has Esper Dream 2, which is an absolutely amazing game that everyone should play :D The game didn't use sawtooth, and I didn't test any other VRC6 games, so hopefully that is emulated passably well enough. Anyway, I think we have enough of the mappers down now to start thinking about a stable API for them. iNES is basically right out, I have no intention of the core emulator supporting it. We can write an iNES->XML translator for compatibility from the UI, but the core is going to want cleaner information. It's really just a question of how low-level we want to get: describe only what is NEEDED for known configurations, or allow for more flexibility? A) VRC6 would have an attribute like "swap_address_lines=true/false" to swap A0/A1 wiring, as ED2 needs but AD does not. B) we would specify how the pins were connected: "A0->A1, A1->A0, A12-15->A2-5" ________________________________________________________________________________ bsnes_v082r21.tar.bz2 (source only) 2-6% speed hit in SNES core for outputting 19-bit (rounded to 32-bit ... sigh) video, so that luma non-linearity can eventually be emulated properly. Now using sinc audio resampler, massive speed hit of course to NES+GB only, but it's required to get rid of aliasing (buzzing) present in many, many games otherwise. Fixed fast forward and none/blur select. Finally fixed texture clearing for changing pixel shaders and video filters. Some realllly basic NES MMC3, extremely broken so don't bug me about it. Other stuff, probably. ________________________________________________________________________________ 2011-09-23 - bsnes_v082r20.tar.bz2 (source only) NES now has save state support. NES A/B buttons were indeed swapped, so that's fixed now. nall/dsp now puts resamplers into separate classes, so that each can have their own state information. opengl.hpp uses GL_RGBA internal format and doesn't regenerate textures on resize. No speedup, no fix to junk on resize, so I will be very unhappy if this breaks things for anyone. GLSL shaders use as you guys wanted. ui-snes was removed. ________________________________________________________________________________ 2011-09-21 - bsnes_v082r19.tar.bz2 (source only) This will be the last release with the ui-snes folder (it's broken now anyway.) Re-added cheat code database searching + add window. It hashes NES+SNES+GB images now and will look them up in the database. Re-added filter support, all filters now output at RGB555. Stacking is possible, but I don't currently allow it. Removed mouse capture + test options from tools menu. Removed smooth video output from settings menu. There are now two built-in "shaders": "None" (point filtering) and "Blur" (linear filtering). OpenGL shaders can now use (or "linear") to specify their filtering mode. Individual emulator versions are gone, and names are hidden from the GUI: you just see bsnes v082.19 now. A new release bumps all core versions. I cannot for the life of me get the video to clear properly when toggling the shaders. Say you set pixellate2x filter, then turn on curvature shader, then turn off the filter, you get junk at the bottom right. I have tried clearing and flipping the OpenGL surface 64x in a row ... I don't know where the hell it's getting the data from. If anyone can make a small patch to fix that, I'd greatly appreciate it. ________________________________________________________________________________ 2011-09-20 - bsnes_v082r18.tar.bz2 (source only) There we go, the GUI is nearly feature-complete once again. All cores now output their native video format (NES={emphasis}{palette}, SNES=BGR555, GameBoy={ bright, normal, darker, darkest }), and are transformed to RGB555 data that is passed to the video renderer. The video renderer then uses its internal palette to apply brightness/contrast/gamma/ramp adjustments and outputs in RGB888 color space. This does add in another rendering pass, unfortunately, but it's a necessary one for universal support. The plan is to adapt all filters to take RGB555 input, and output RGB555 data as well. By doing this, it will be possible to stack filters. However, it's a bit complicated: I need to plan how the stacking should occur (eg we never want to apply scanlines before HQ2x, etc.) Added input frequency adjustments for all three systems. I can easily get perfect video/audio sync on all three now, hooray. Long-term, it seems like we only really need one, and we can do a video/audio delta to get an adjusted value. But for now, this gets the job done. Added audio volume adjust. I left out the balance for now, since it's obviously impossible to balance the NES' single channel audio (I can duplicate the channel, and do twice the filtering work, but ... why?) I replaced NTSC/PAL TV mode selection with an "Enable Overscan" checkbox. On, you get 240 lines on NES+SNES. Off, you get 224 lines on NES+SNES. Also added aspect correction box back. I don't do that gross PAL distortion shit anymore, sorry PAL people. I just scale up the 54/47*(240/224) aspect correction for overscan off mode. All memory is loaded and saved now, for all three systems (hooray, now you can actually play Zelda 1&2.) Added all of the old bsnes hotkeys, with the exception of capture screenshot. May add again later. May come up with something a bit different for extra features. Re-added the NSS DIP switch setting window. Since geometry is saved, I didn't want to auto-hide rows, so now you'll see all eight possible DIPs, and the ones not used are grayed out. Ultimately, nobody will notice since we only have DIPs for ActRaiser NSS, and nobody's probably even using the XML file for that anyway. Whatever, it's nice to have anyway. Took FitzRoy's advice and single-item combo boxes on the input selection are disabled, so the user doesn't waste time checking them. I wanted to leave text so that you know there's not a problem. Qt disabled radio box items look almost exactly like enabled ones. Fixed lots of issues in phoenix and extended it a bit. But I was still having trouble with radio box grouping, so I said fuck it and made the panels show/hide based instead of append/remove based. That's all for stuff off the checklist, I did a bunch of other things I don't recall. So yeah, I'd say the GUI is 100% usable now. This is my opinion on how multi-platform GUIs should be done =) Oh, I figure I should mention, but the NES core is GPLv3, and all future SNES+GB releases will be as well. It's a move against Microsoft's Metro store. ________________________________________________________________________________ 2011-09-19 - bsnes_v082r17.tar.bz2 (source only) Adds BS-X/Slotted/SufamiTurbo/SGB cartridge loading. Calling it Satellaview as I'm more partial to that at the moment. FileBrowser now remembers your folders per filter type like before, and will keep your place in the list if you don't switch away. I wanted there to be ONE slot loader, so the loader will show a grayed out secondary slot on non-ST loading, but it's more consistent to only have one window instead of two for geometry placement. Removed help menu. Will try and work it in somewhere unobtrusive later on I suppose. Added timed messages and the usual "no cart loaded / paused" messages and such. Multi-cart loading stuff took ENTIRELY too long. ________________________________________________________________________________ 2011-09-18 - bsnes_v082r16.tar.bz2 (source only) Binary output is once again called bsnes. No versioning on the title without a system cartridge loaded. Still saving config files to .config/batch for now. Finally fixed NES APU frame IRQ clearing on $4015 reads. Added mouse button/axis binding through buttons on the input capture window. Added advanced settings window with driver selection and focus policy settings. Will show your default driver properly if none are selected now, unlike old bsnes. That exposed a small bug where phoenix isn't removing widgets on Layout::remove, worked around it for now by hiding the panels. Damn, sick of working on phoenix. Added all missing input controllers, which can all now be mapped, and bound them to the main menu, and added NES support for selecting "no connected controller." Added mouse capture and the requisite tools menu option for it. Added WindowManager class that keeps track of both position and size now (eg full geometry), so now you can resize your windows and save the settings, unlike old bsnes. WindowManager has more stringent geometry checks. The *client area* (not the window border) can't be below 0,0 or above the width/height of three 30" monitors. If you have 4+ 30" monitors, then fuck you :P settings.cfg is now also saved, captures all currently available settings. Right now, there's only one path for the file browser to remember. I will probably make this per-system later. FileBrowser has been made a bit more friendly. The bottom left tells you what type of files the list is filtered by (so you see "*.sfc" for SNES), and the bottom right has an open button that can enter folders or load files. Added video shader support. Fixed nall/dsp variadic-channel support, was only outputting the left channel. Things left to do: Add multi-cart loading { BSX, BSX slotted, ST, SGB } Add video filter support (very tricky, only SNES output 16-bit video for them.) Add video color adjustment support (same problem as above.) Add audio input frequency adjustments, volume adjustments, and balancing adjustments. Add video aspect correction and NTSC/PAL TV selection. Add preferred region selection (needed for NES (W) games, SGB BIOS.) [NES still needs to emulate PAL, period.] Add SNES expansion port device selection { BSX, None } Save and load emulated system memory (SRAM files, etc.) Add smart status bar text for main window (show messages on events, advise when paused, etc.) Add a whole lot more hotkeys (pause, state load/save, etc.) Add a proper about window. Tempted to just drop the whole about window entirely. A whole Help menu for one vanity item is pretty stupid. Add NSS DIP switch window (ugh.) ________________________________________________________________________________ 2011-09-17 - bsnes_v082r15.tar.bz2 (source only) 7.5 hours of power coding. Das Keyboard definitely helped (but didn't eliminate) RSI, neato. Okay, the NES resampler was using 315 / 88.8 by mistake, so the output rate was wrong, causing way more video/audio stuttering than necessary. STILL forgot the NES APU frame IRQ clear thing on $4015 reads, blah. Why do I always remember things right after uploading the WIPs? Recreated the input manager with a new design, works much nicer than the old one, a whole lot less duplicated code. Recreated the input settings window to work with the new multi-system emulation. All input settings are saved to their own configuration file, input.cfg. Going to batch folder for now. Okay, so the new input settings window ... basically there are now three drop-downs, and I'm not even trying to label them anymore. They are primary, secondary, tertiary selectors for the listed group below. Examples: "NES -> Controller Port 1 -> Gamepad" "SNES -> Controller Port 2 -> Super Scope" "User Interface -> Hotkeys -> Save States" I am aware that "Clear" gets disabled when assigning. I will work on that later, being lazy for now and disabling the entire window. Have to add the mouse binders back, too. Escape and modifiers are both mappable as individual keys now. If you want to clear, click the damn clear button :P Oh, and all input goes to all windows for now. That'll be fixed too when input focus stuff is re-added. ________________________________________________________________________________ 2011-09-16 - bsnes_v082r14.tar.bz2 (source only) Emulates DMC channel (sound effect when Link gets hit in Zelda 1, for instance), fixes up bugs in rectangle/sweep and triangle channels, adds DMC/frame APU IRQs, adds proper stalling for DMC ROM reads (should even be cycle accurate, but has one extra cycle when triggered during OAM DMA, I think), but forgets the frame IRQ acknowledge clear on $4015 read (will fix next WIP.) All sound courtesy of Ryphecha. Made template configuration settings window (empty for now.) Simplified SNES cheat.cpp code. Some other stuff. Further developed RSI. ________________________________________________________________________________ 2011-09-15 - bsnes_v082r13.tar.bz2 (source only) I've updated the {System}::Interface classes to encapsulate all common functionality, so they are C++ equivalents of libsnes now. The idea being, use the interface class and you'll never have to reach into core objects (unless you really want to.) Not guaranteeing as stable an API as I do with libsnes for that, though. C++ doesn't make for nice dynamic libraries, anyway. Added back the state manager, and it now works for both SNES and Game Boy. NES save states aren't in yet. Anyway, this should give you a pretty good feel for what the combined UI is going to be like: same as before, everything works the same. Only difference is the dynamic system menu and cartridge menu with more load options. The settings window will be mostly the same as well, but will obviously have options that only apply to some systems. ________________________________________________________________________________ 2011-09-14 - bsnes_v082r12.tar.bz2 (source only) Merged Ryphecha's APU emulation, so NES has sound output now. We are still missing the DMC memory fetch, so there will be missing sound effects here and there. ________________________________________________________________________________ 2011-09-14 - bsnes_v082r11.tar.bz2 (source only) Emulates grayscale and color emphasis modes, improves sprite timing and PPU bus fetching behavior with the PPU disabled. ________________________________________________________________________________ 2011-09-14 - bsnes_v082r10.tar.bz2 (source only) Emulated the Game Genie for the NES and Game Boy, and wrote a new cheat editor that doesn't reach into specific emulation cores so that it would work. Before you ask: yes, long-term I'd like Super Game Boy mode to accept Game Boy codes. But that's not high on the priority list. Renamed the mappers toward board names, LZ...->BandaiFCG, LS161...->AOROM, added CNROM emulation (Adventure Island, Gradius, etc.) Added the tools menu load/save state stuff, but note that the NES doesn't have save state support yet (waiting for the interface to stabilize a bit more first.) Note: this will be the last release to have the ui-gameboy folder, it's been deleted locally from my end, as the new multi-GUI does all that it does and more now. ________________________________________________________________________________ 2011-09-12 - bsnes_v082r09.tar.bz2 Skip this build if you can, it's CPU+PPU timing improvements that should not visibly affect anything. Cheat codes and save states are going to work 100% the same between every system. I'll leave the database for NES/GB up to mightymo, if he is interested. They can even be in the same cheats.xml file, it doesn't really matter. That's why XML is so nice, it can store any form of cheat code for any system, no problem. ________________________________________________________________________________ 2011-09-10 - bsnes_v082r07.tar.bz2 (source only) Wrote a cycle-based PPU renderer, ~95% hardware accurate for BGs, not so much for sprites yet. Mednafen has been helping out a lot. ________________________________________________________________________________ 2011-09-10 - bsnes_v082r06.tar.bz2 (source only) Emulated MMC1, currently defaults to B2 configuration. Fixed a whole bunch of timing things, render things, nametable mirroring things, etc. Zelda and Mega Man II are fully playable, but they have odd vertical scrolling issues that make it a not so fun experience. Not sure what the problem is there, yet. The Y scroll register writes seem to be wonky ... I don't know. Keeping the Cartridge menu always visible now, so it's faster to load carts, but I am still hiding the non-loaded system menus. ________________________________________________________________________________ 2011-09-09 - bsnes_v082r05.tar.bz2 (source + Windows binary) Okay, I fixed up many outstanding phoenix issues. * Windows/GTK+ fixed by using processEvents instead of main(); Windows can run unthrottled, and GTK+ shows the window contents now * fixed keyboard beeping once and for all on Windows: I now whitelist tabbable controls * fixed main menubar setVisible calls * Qt and GTK+ now allow you to resize windows smaller than they initially were Both Qt and GTK+ still fuck up the geometry a bit when toggling fullscreen mode. I have tried, and tried, and tried and tried and tried to fix it all. Nothing works. I give up. Easier to destroy and recreate the fucking window than figure out how to resize it on Linux (and no, I can't do that. ruby would not like the handle changing.) As for the GUI: * file browser is back in, still need remember place and open folder code; that needs to be extended to handle multiple systems now * shrink window command added to tools menu ________________________________________________________________________________ 2011-09-03 - bsnes_v082r02.tar.bz2 (source only) Has Jonas Quinn's many Game Boy APU fixes, and two more from blargg's notes that I added. It also has the new dynamic phoenix. So yeah, it'll crash on bsnes/Qt exit. If anyone can fix it *properly* and wants the money, I'll pay them $20 for the trouble =) As for auto-saving SRAM, last time I tried it was destroying the frame rate on solid state drives that would choke the whole program using synchronous writes. Even if I make it an option, which will be a bit of a hassle, most people won't know to turn it on until it's too late. ________________________________________________________________________________ 2011-08-22 - bsnes_v082r01.tar.bz2 (Windows binary + source) Changelog: * if config file window coordinates are >= 30000, it snaps them back to 128,128; should end the "why aren't windows visible?" posts * updated GUI code to match new phoenix changes * phoenix: Layout and Widget inherit from Sizable; directional layouts make no distinction between widgets and layouts * phoenix: individual widgets / layout can maintain visible/hidden status in spite of their parents' visibility ________________________________________________________________________________ 2011-08-20 - bsnes_v082 This release features many substantial Game Boy emulation improvements (all courtesy of Jonas Quinn), a new audio DSP class, and BPS patching support. Changelog: * added new DSP audio engine; supports sample-averaging for the Game Boy's high frequency rate * GB: MMM01 images with boot loader at bottom of ROM can now be loaded * GB: EI is delayed one cycle; fixes Bubble Bobble [Jonas Quinn] * GB: fixed window -7 offset behavior; fixes Contra 3 first boss [Jonas Quinn] * GB: disable LCD interrupts when rendering is off; fixes Super Mario Land 2 [Jonas Quinn] * GB: fixed noise channel LFSR; fixes Zelda: LA lightning sound [Jonas Quinn] * GB: square channels use initial_length like the noise channel [Jonas Quinn] * UI: added BPS patching support; removed UPS patching support * UI: when loading BS-X/Sufami Turbo/Game Boy games; display game title instead of BIOS title * UI: modified timestamps on screenshots for Windows/NTFS (which disallows use of ':') ________________________________________________________________________________ 2011-08-19 - bsnes_v081r04.tar.bz2 (source only) Changelog: * GB: square channels cache initial_length and invert the length value on writes [Jonas Quinn] * GB: updated LCD disable to just ignore interrupts and pixel writes, fixes Contra * BPS patch information and cartridge sections are now copied from the patch metadata, if it is present * fixed bpslinear out-of-bounds issue, which will be in snespurify v11 official [Danish] * simplified Makefile again since command-line trumps manual assignments ________________________________________________________________________________ 2011-08-17 - bsnes_v081r03.tar.bz2 (Windows binary + source) Changelog: * GameBoy: fixed window behavior for Contra 3 first boss [Jonas Quinn] * GameBoy: fixed noise channel for Zelda: LA intro [Jonas Quinn] * GameBoy: completely disable LCD when turned off, no interrupts; fixes Super Mario Land 2 [thanks to Jonas Quinn] * GameBoy: keep track of where pixels come from for OBJ priority mode [Jonas Quinn] * updated mode+slot-dependent name handling: simplifies Path class, allows SGB/BSX/ST games to show the slot title (instead of BIOS name) on the title bar * Makefile allows command-line definitions for ui and profile now (make profile=compatibility ui=ui-libsnes) * Makefile now allows (make pgo=instrument) and (make pgo=optimize) * added BPS patching support, removed UPS patching support Beta-testers, if you could please test the path stuff extensively, that'd be great. I do not use custom paths, so there's a chance I may have broken something there. I'd like to release a new build once snespurify and the standalone BPS patcher are finished. Would also be wise to play some more Game Boy games, as compatibility should have increased a good deal. ________________________________________________________________________________ 2011-08-14 - bsnes_v081r02.tar.bz2 (source only) This release adds nall/dsp, which is a new framework for audio DSP effects. It currently supports the usual fractional hermite resampling and volume adjustments from ruby; but it also adds balance, and arbitrary precision input and output (still limited to two channels, and still signed audio [just subtract 1<<(bits-1) from an unsigned value.]) Internally, all samples are converted to doubles in the range of -1.0 to +1.0, to allow for far greater precision with the hermite resampler and volume/balance/etc adjustments. As a result of this, all of the extra resampling/volume code from ruby::audio has been removed. bsnes pulls in a copy of nall::dsp to handle that stuff now. The overall framework is meant to be far more flexible in the future. I'd love to add more resampling algorithms (especially an averaging one for Game Boy emulation), and more special effects (echo, reverb, bass, treble, equalization, etc.) Thing is, I just don't know a damn thing about audio, so I'm not sure how to implement them. Would love some help here. I don't want to just plug in other peoples' libraries, I want to learn how to do these things and implement them into nall, so that I can learn about audio processing, and have my own neat little audio library. Finally fixed SNES::Interface::audio_sample to take int16_t parameters, since SNES audio is signed. libsnes stays the same for backward-compatibility. ________________________________________________________________________________ 2011-08-13 - bsnes_v081r01.tar.bz2 (source only) Changelog: * EI takes an extra cycle to raise IME; fixes Bubble Bobble, and likely many more games [Jonas Quinn] * nall/gameboy/cartridge.hpp descrambles MMM01 images (header can be at top or bottom of image now) * screenshot timestamps use filename-yyyy-mm-dd hh.mm.ss.bmp format; so that they can save on Windows * closing the emulator will switch to windowed mode first, so that geometry is preserved ________________________________________________________________________________ 2011-08-12 - bsnes_v081-source.tar.bz2 Changelog: * rewrote S-DD1 module to decompress individual bytes at a time * simplified SPC7110 deinterleaving code * OBC1 should not clear RAM on reset [Jonas Quinn] * fixed enum-cast compilation errors with the latest GCC 4.6.x releases * added bsnes logo to about screen * make phoenix=gtk will now build the GTK+ port on Linux * added settings.startFullScreen to the config file for front-end users * added advanced settings option to disable window compositor (only works on Windows and Xfce) * merged settings windows into the panel approach used by bsnes/Qt in the past * fixed a crashing bug on input settings window * fixed GTK+ auto-geometry sizing * added screenshot capture capability * added exit emulator hotkey (defaults to being unmapped) * Xorg keyboard polling now uses cached Display variable [Bisqwit] * cheat code database updated [mightymo] ________________________________________________________________________________ 2011-08-08 - bsnes_v080r08.tar.bz2 (Windows binary + source) Fixed all of the above phoenix issues, and improved the auto-disabling of buttons on the input setting and state manager windows. Also manually initiailized lastConfigure for Valgrind in GTK+. Windows and GTK+ ports look a lot nicer now. ________________________________________________________________________________ 2011-08-08 - bsnes_v080r07.tar.bz2 (Windows binary + source) Please test this one as much as you guys can, I'd like to release a new build soon. Changelog: * fixed a long-standing crash: when you have a device index above the range permitted by another port, the app would crash (eg Controller Port 2 -> Mouse, then switch to Hotkeys) * Qt bug workaround: have to use currentItemChanged signal instead of itemSelectionChanged signal for QTreeWidget, otherwise scrolling with mouse gives you the previous item with currentItem() ... * added support for toggling the Xfce compositor * added support for detecting if the compositor is enabled in the first place on Windows, so that it won't get turned on when you had it off permanently * added advanced setting to toggle behavior (never disable, disable only in fullscreen mode, disable whenever emulator is open) * worked around GTK+ ../... button height issue * worked around Windows slider position issue when attaching to a new window (need to research this one more) * fixed up input settings window more: closing window ends assignment, custom mapping buttons hidden by default Some of those bugs have been there since the phoenix port began, good times. ________________________________________________________________________________ 2011-08-07 - bsnes_v080r06.tar.bz2 (source only) Ran out of time, so this is incomplete, but ... Windows will disable the compositor in fullscreen mode, and enable it when switching back to windowed mode. Should help with Vsync issues, but of course only in fullscreen mode. I've also merged the four settings windows back into a panel with a list view (since I have no tab control widget.) The input settings window is a bit incomplete, need to break assignment on window close, hide the capture buttons on first showing, etc. Will probably try and finish that up tonight. ________________________________________________________________________________ 2011-08-06 - bsnes_v080r05.tar.bz2 (source only) Includes updated versions of nall and phoenix, which mostly improves the GTK+ version. However, it appears to be crashing at the moment after loading a game. Unfortunately it works when gdb is used, so I can't easily debug it :/ You can now build with make phoenix=gtk if you want the GTK+ version on Linux (the Qt version is leagues better even on Gnome, please use it if at all possible.) There's also settings.startFullScreen, config-file only, to allow for front-end use. Forgot to add the reset/power hotkeys. I also fixed compilation of ui-gameboy on GCC 4.6. I hope that's the last switch(enum) error, those are damn annoying. Can't wait to switch to GCC 4.6 on Windows. ________________________________________________________________________________ 2011-07-24 - bsnes_v080r04.tar.bz2 (source only) Adds nall/inflate.hpp and nall/unzip.hpp. Updates nall/resource.hpp to encode and decode using ZIP/deflate files, rather than a much simpler (and less powerful) LZSS implementation. Cuts the bsnes-logo.hpp file from 270KB to 130KB, and the binary overhead from 80KB to 35KB (better than PNG! Hah.) ________________________________________________________________________________ 2011-07-22 - bsnes_v080r03.tar.bz2 (Windows 32-bit accuracy binary included) Wow, nothing in 19 days. Anyway, I wanted to get Nick's logo back in on the about screen. Adds 80kb to both the binary and source archive, but eh. Gotta have some style. Nothing else new. Probably won't be much news until the ST-0018 ROM is extracted. ./sshots/bsnes_20110722.png Oh, and phoenix/Canvas sucks with GTK+, that'll be fixed eventually. Hopefully prior to v081. ________________________________________________________________________________ 2011-07-03 - bsnes_v080r02.tar.bz2 Changelog: * added qstrlower and qstrupper; mainly for the sake of others wanting to patch bass * added: string sha256(const uint8_t *data, unsigned size); for easier hash generation * cleaned up the NEC DSP and Hitachi DSP XML mapping code; they are consistent now as well * "necdsp" in paths.cfg is now "firmware", since it also affects the Hitachi DSP * XML mapping was using program= for DSP-n/ST-001n and data= for Cx4; they both use firmware= now instead * fixed icd2/interface casting issue for GCC 4.6.0 (thanks for the reminder, vEX) * removed the last parts of code that used string << foo; and removed that from nall/string entirely *** I need to do this for the debugger as well, I'll make sure that it compiles before v081 though * converted all string(...) syntax to { ... } syntax that I could (obviously it won't cast to a function that takes const char* instead of const string&) Probably some other tiny things. Just basic maintenance here. ________________________________________________________________________________ 2011-06-27 - bsnes_v080r01.tar.bz2 (source only) There was one unfortunate aspect of the S-DD1 module: you had to give it the DMA length and a target buffer, and it would do the entire decompression at once. Real hardware would work by streaming the data byte by byte. So with that, I went ahead and rewrote the code to handle byte-based streaming. This WIP is an important milestone for me personally. Up until now, bsnes has always had code that was directly copy-pasted from other authors. With all of the DSP and Cx4 chips rewritten in LLE, and the SPC7110 algorithm already ported over from C, and archive decompression code removed for a long time, the S-DD1 was the only module left like this. It's obviously not that big of a deal. The code is basically still a copy of the original. S-DD1 decomp from Andreas Naive, SPC7110 decomp from neviksti, and S-DSP from blargg. And the rest of the emulator is of course only possible because of code and research before it, although everything else has no resemblance at all to code before it. The main advantage, really, is absolute code consistency. I always use the same variant of K&R, for instance. I dunno, I guess I just never really liked the "Build-a-Bear Workshop" style of emulators, like is so prominent in the Genesis scene: "My new Genesis emu (uses Starscream/Musashi 68K core, Marat Fayzullin's Z80 core, YM2612 core from Game_Music_Emu, VDP core from Gens, SVP core from picodrive)", sorry, but you wrote a front-end, not an emulator :/ I also updated the SPC7110 decompression module: I merged the class inside the SPC7110 class (not sure why it was separate before), and replaced the morton lookup tables with for-loops. The morton tables were added to be a tiny bit faster when I was more interested in speed than code clarity. It may be a tiny bit slower (or faster due to less L2 cache usage), but you won't even notice an FPS drop, and it cuts out a good chunk of code and some tables. Lastly, I added pinput_poll() to video_refresh(). Forgot to remove Interface::input_poll() from the C++ side, will have to do that later. ________________________________________________________________________________ 2011-06-26 - bsnes_v080-source.tar.bz2 This release adds low-level emulation of the Hitachi HG51B169 DSP, which was used in Mega Man X2 and Mega Man X3 as the Cx4 chip. It also fixes a regression in both the sound core and cheat engine. You will now need the HG51B169 data ROM to play MMX2/MMX3. You can get that here. I will not be including it with bsnes. Once again, Cx4 LLE could not have been possible without the help of Dr. Decapitator, Jonas Quinn, Overload and Segher. Be sure to thank them, please! Changelog: * added Cx4 low-level emulation; removed Cx4 high-level emulation code * fixed S-SMP synchronization to S-CPU on CPUIO writes * controllers now have their own threads and classes * serial controller is now emulated as an actual controller, rather than as a coprocessor * added link coprocessor module for special chip research and homebrew * fixed cheat codes that target mask ROM addresses [Cydrak] * fixed compilation error with the latest GCC 4.6.0 beta releases * added flexibility to XML memory mapping file format * updated to mightymo's latest cheat pack (2011-06-20) ________________________________________________________________________________ 2011-06-24 - bsnes_v079r06.tar.bz2 (source only) Added threading support: each controller port gets its own thread now. If they don't need one, then it auto-generates one running at 1hz. It does add some more code to the CPU::step() function, so performance probably went down actually, by about 1%. Removing the input.tick() call didn't compensate as much as I'd hoped. Hooked up Super Scope and Justifier support. The good news is that the Justifier alignment doesn't get fucked up anymore when you go off-screen. Never could fix that in the old version. The bad news is that it takes a major speed hit for the time being. I need to figure out how to run the CPU and input threads out of order. Every time I try, the input gets thrown off by most of a scanline. Right now, I'm forced to sync constantly to get the latching position really accurate. But worst case, I can cut the syncs down by skipping large chunks around the cursor position, +/-40 clock cycles. So it's only temporarily slow. Lastly, killed the old Input class, merged Controllers class into it. I actually like Controllers as a name better, but it doesn't jive with video/audio/input, so oh well. ________________________________________________________________________________ 2011-06-24 - bsnes_v079r05.tar.bz2 (source only) Fixed GCC-4.6 casting errors in ui/input/input.cpp. Fixed some of the opcode mnemonics specified in the HG51B169 core (was unable to speed up the code) Started on a new core input system: snes/controller. More on that here: http://board.byuu.org/viewtopic.php?f=16&t=1761 Have not yet attempted to add threading support to the controllers, so serial is still there as a coprocessor. I'm going to move the Controllers {} class back to Input {} once all individual controllers have been ported over. Note: Super Scope and Justifier do not have counter latching support yet, so you can't really use them. The gamepad, multitap and mouse all work great; and the SS/Justifier cursors work at least. I also colored the SS cursor red, so that all three (SS, Justifier, chained secondary Justifier) all have unique R/G/B colors now. Should prevent confusion between the SS and one Justifier. ________________________________________________________________________________ 2011-06-20 - bsnes_v079r04.tar.bz2 Back from vacation. We were successful in emulating the Cx4 using LLE during my vacation. We finished on June 15th. And now that I'm back, I've rewritten the code and merged it into bsnes official. With that, the very last HLE emulation code in bsnes has now been purged. I still have some more plans for bsnes v080, so I'm not going to bump the version number just yet. Plus I would like it if we could thoroughly test the new Cx4 LLE support to ensure it is bug-free. To that aim, if you have some time and would like to help test: please download bsnes v079.04 and cx4.bin. Place cx4.bin in the same folder as "Mega Man X 2 (U).sfc" and "Mega Man X 3 (U).sfc", and then do your best to play through the entire games with no cheat codes, and uncover all of the secrets that you can. If you find any bugs, or if the console window prints "invalid opcode" at any time, please send me a note on my forums. Thanks in advance to anyone who can help test this. http://bsnes.googlecode.com/files/bsnes_v079r04.tar.bz2 http://byuu.org/snes/cx4/cx4.bin ----- The emulation is as minimal as possible. If I don't see an opcode or feature actually used, I don't implement it. The one exception being that I do support the vector override functionality. And there are also dummy handlers for ld ?,$2e + loop, so that the chip won't stall out. But things like "byte 4" on rdram/wrram, the two-bit destination selections for all but ld, etc are treated as invalid opcodes, since we aren't 100% sure if they are there and work as we hypothesize. I also only map in known registers into the 256-entry register list. This leaves 90% of the map empty. The chip runs at 20MHz, and it will disable the ROM while running. DMA does transfer one byte at a time against the clock and also locks out the ROM. rdbus won't fetch from IRAM, only from ROM. DMA transfer only reads from ROM, and only writes to RAM. Unless someone verifies that they can do more, I'll leave it that way. I don't yet actually buffer the program ROM into the internal program RAM just yet, but that is on the to-do list. We aren't entirely sure how that works either, but my plan is to just lock the Cx4 CPU and load in 512-bytes. There's still a few unknown registers in $7f40-5f that I don't do anything with yet. The secondary chip disable is going to be the weirdest one, since MMX3 only has one chip. I'd really rather not have to specify the ROM mapping as two separate chips on MMX2 and as one on MMX3 just to support this, so I don't know yet. Save state support is of course there already. Speed hit is 118fps HLE -> 109fps LLE in most scenes. Not bad, honestly. ________________________________________________________________________________ 2011-06-09 - bsnes_v079r03.tar.bz2 (source only) This fixes the S-SMP synchronization on CPUIO writes that was broken by improvements in v078.01. Terranigma will work now. Also adds the 'link' coprocessor module that was added in v079.01, and improved in v079.02. ________________________________________________________________________________ 2011-06-08 - bsnes_v079r02.tar.bz2 Added "unsigned link_run();" which acts as its own thread synchronized against the S-CPU. Specify the frequency in the configuration file. I intend to prototype the Cx4 LLE openly using the link module, and that required timing support, so there we go. It's very basic, and it synchronizes the CPU to the coprocessors and vice versa after every call to link_run(). Meaning performance won't be super exceptional at full 21MHz or higher, but then this is for prototyping only. I didn't want to expose cothreading, yielding, calls back into bsnes' core, calls to sync up the S-CPU, etc. ________________________________________________________________________________ 2011-06-06 - bsnes_v079r01.tar.bz2 This bundle includes source code, and a Windows 32-bit accuracy build with the console enabled. If you want profiling or a Linux binary, you'll have to build it yourself, sorry. Background information here. Here is an example of using the new SNES coprocessor research module. The example will use Hayazashi Nidan Morita Shougi 2 (J).sfc for ST-0018 research. XML mapping example: Code: Specifically, note the section. When you use the link edition binary above, it will print out the XML mapping for any game loaded to the console. You can copy this, and then add your own link section. Save it as .xml and bsnes will use it in the future. Verify this by looking at the console output on the next load. You can map any address you like, but internal MMIO will be overridden internally (eg don't hijack the DMA registers.) In other words, $00-3f|80-bf:0000-1fff,2100-2183,4016-4017,4200-421f,4300-437f and $7e-7f:0000-ffff are off-limits. Anything else is fair game. Source code example: Code: #if defined(_WIN32) #define dllexport __declspec(dllexport) #else #define dllexport #endif #include #include extern "C" { void link_power(); void link_reset(); unsigned link_run(); uint8_t link_read(unsigned addr); void link_write(unsigned addr, uint8_t data); } struct ST0018 { uint8_t r3800; uint8_t r3804; unsigned w3804; } st0018; dllexport void link_power() { link_reset(); } dllexport void link_reset() { st0018.r3800 = 0x00; st0018.r3804 = 0x85; st0018.w3804 = 0x000000; } dllexport unsigned link_run() { return 21477272u; } dllexport uint8_t link_read(unsigned addr) { printf("* Read %.6x\n", addr); addr &= 0xffff; if(addr == 0x3800) return st0018.r3800; if(addr == 0x3804) return st0018.r3804; return 0x00; } dllexport void link_write(unsigned addr, uint8_t data) { printf("* Write %.6x = %.2x\n", addr, data); addr &= 0xffff; if(addr == 0x3804) { st0018.w3804 = ((st0018.w3804 << 8) | data) & 0xffffff; } } Windows compilation example: Code: g++ -O3 -fomit-frame-pointer -I. -c st0018.cpp -o obj/st0018.o g++ -o st0018.dll -shared -Wl,--out-implib,libst0018.a obj/st0018.o Linux compilation example: Code: g++- -fPIC -O3 -fomit-frame-pointer -I. -c st0018.cpp -o obj/st0018.o g++ -s -o libst0018.so -shared -Wl,-soname,libst0018.so.1 obj/st0018.o Note that C++ is not required. ________________________________________________________________________________ 2011-06-04 - bsnes_v079-source.tar.bz2 This release includes Nintendo Super System DIP switch emulation and improved PPU rendering accuracy, among other things. Changelog: * added Nintendo Super System DIP switch emulation [requires XML setting maps] * emulated Super Game Boy $6001 VRAM offset selection port [ikari_01] * fixed randomness initialization of S-SMP port registers [fixes DBZ:Hyper Dimension and Ninja Warriors] * mosaic V-countdown caches BGOFS registers (fixes Super Turrican 2 effect) [reported by zal16] * non-mosaic BGOFS registers are always cached at H=60 (fixes NHL '94 and Super Mario World flickering) * fixed 2xSaI family of renderers on 64-bit systems * cleaned up SMP source code * phoenix: fixed a bug when closing bsnes while minimized Please note that the mosaic BGOFS fix is only for the accuracy profile. Unfortunately the older scanline-based compatibility renderer's code is nearly unmaintainable at this point, so I haven't yet been able to backport the fixes. Also, I have written a new cycle-accurate SMP core that does not use libco. The aim is to implement it into Snes9X v1.54. But it would of course be prudent to test the new core first. So if you'd like to test, you can download it here: bsnes_v079-smp.7z Note that the alternate SMP core uses the performance profile, so there may be slight issues caused by CPU timing. ________________________________________________________________________________ 2011-06-01 - bsnes_v078r07.tar.bz2 (Windows 32-bit accuracy binary included) ./sshots/turrican2.png Would appreciate testing on any games with mosaic, especially Mode7 mosaic. I have tested Super Turrican 2, Sim Earth, Contra III and SNES Test Program. This only applies to BG modes 0-6, and technically should not affect Mode7 at all. I am not sure if Mode7 needs the same change made or not, but given the way it fetches that could prove quite challenging. I also simplified the background renderer a good bit. See eg the pixel copy stuff in Background::run(). I've only fixed this in the accuracy renderer. I'm sorry, but the compatibility renderer is a fucking mess. I haven't really touched it in four or five years now. Will probably just revert to the accuracy/SMP in the performance profile for the next release since it's not being used otherwise. People can toggle it on if they want to try it out. ________________________________________________________________________________ 2011-05-08 - bsnes_v078r06.tar.bz2 (source only) This adds ikari_01's emulation of the ICD2 (Super Game Boy) $6001 register. It basically removes a really ugly hack where I was intercepting the DMA transfer destination address to determine while Game Boy tile row to transfer. This should make implementing SGB emulation in other emulators easier, as said hooks were very emulator-specific. ________________________________________________________________________________ 2011-05-06 - bsnes_v078r05.tar.bz2 (32-bit compatibility binary included.) This WIP adds Nintendo Super System emulation, at least of its DIP switches. ./sshots/bsnes_20110506.png This is done via XML mapping, like so: Code: ActRaiser The value field is a 16-bit value. All selected options are ORed together to produce the final DIP switch values. The number of options per setting is unlimited, but there are only sixteen settings allowed (you can't have more settings than you have switches, that's just stupid.) In the example above, d0-d1 controls difficulty, and d2-d3 controls # of lives. d4-d15 appear to be unused, as far as I can tell. Anyway! I could use some help with this. There's basically something like 10-15 or so NSS games, so we should be able to produce XML files for every NSS game, and distribute them all as a nice pack. I can host the XML pack on my downloads page. Basically, what I'd like is for someone to go through each game and try and figure out the valid DIPs for each game. Note! that some games don't use DIP switch values at all, we can ignore those games. Also note that I have no idea why ZSNES only allows six DIPs, the DIP register is 16-bits wide and is located at $4100,$4101. It may be that d6-d15 is never used though. Not a lot of info on this out there. You will of course need non-MAME-fucked ROMs to use on bsnes ;) GoodSNES seems to use Gamename (NSS) for these. Stay away from MAME ROM sites. As far as making the XML rom/ram maps, yeah, that'll be a bit annoying for some. Bleh. snes/cartridge/cartridge.cpp has a commented out line that'll print the XML map for the game if there isn't one. You can copy that, add the nss section, and have at it. Basically, the way to figure it out is to set one bit at a time, play the game, see what changes, name the settings and options, and continue for each game. Please post any XML maps you are able to make, or advise of games you know not to have any DIP settings. Thanks in advance to anyone that can help. ________________________________________________________________________________ 2011-05-05 - bsnes_v078r04.tar.bz2 (source only) Changelog: * file and slot load dialogs should now have perfectly square buttons that are based on the platform's default button height. * cleaned up bsnes/Accuracy SMP source code (removed old !! stuff, stage 3 timer is now uint4, memory access switch/case cleaned up, sSMPTimer->Timer, etc.) * cleaned up bsnes/Accuracy memory access functions (read/writestack -> read/writesp, read/writeaddr -> read/write) * minor optimization to bsnes/Performance SMP core in cycle-mode * fixed 2xSaI family, hopefully for good this time (not in bundle.) ________________________________________________________________________________ 2011-05-04 - bsnes_v078r03.tar.bz2 (32-bit performance binary included.) I would appreciate if you guys could test games and tell me if you notice any reductions in sound quality compared to a previous performance WIP. I apparently wasted two days writing that SMP core for nothing. I had a perfectly well-written and well-tested core in bsnes v045. The old opcode.b files that were a cycle-based markup language. So I took that core, and wrote new parsers to generate both opcode-based (one switch) and cycle-based (two switch) cores. Throw in a little #define magic around CYCLE_ACCURATE, and it is compile-time toggleable. EWJ2's bug was due to not resetting the timer variables, and Bahamut Lagoon's was due to dividing timer frequencies by 3, but failing to remove the 0->1 transition phase (should have done the latter and divided by two.) Anyway, all fixed up. The good news is the opcode-based SMP core is faster than bsnes'. The bad news is that the cycle switch table approach is slower than libco, which is not surprising. libco let the SMP run ahead of the CPU without having to enter and exit switch blocks repeatedly. But anyway, that gives three options for Snes9X. Cycle+libco, cycle w/o libco, and opcode. Or all three. ________________________________________________________________________________ 2011-05-03 - bsnes_v078r02.tar.bz2 (source only) New S-SMP core is feature-complete, but still buggy. It's good enough for perfect audio in Zelda 3 and Super Mario World, but there are plenty of issues. No audio in Bahamut Lagoon, deadlock in Earthworm Jim 2, etc. With this core, bsnes/Performance runs about 3-5% faster than with the old one. That won't seem like much, because the S-SMP is the least demanding portion of the SNES. blargg's SMP core netted me a 5-8% speedup the last time I tried it, so I'm sure there's still room to speed things up. The core is opcode-based, but has dummy op_io() calls (they compile to nothing), so it is trivial to make it cycle-based if desired. I'm not convinced that is necessary, but we shall see once we get the opcode bugs ironed out. If anyone wants to help, that'd be great. Just compare the snes/smp/core opcode semantics to the snes/alt/smp/core semantics and look for typos. I have already ran synthetic tests to validate all cycle counts for every opcode (sans conditional branches not taken), and to ensure that all 256 opcodes are defined. Probably best/fastest to rig up both SMP cores and perform some sort of random execution looking for any differences. ________________________________________________________________________________ 2011-05-02 - bsnes_v078r01.tar.bz2 (source only) No point in downloading this one, no differences to two profiles, and it actually breaks the third. Started on a new SMP core for bsnes/Performance. I wanted to start clean, and only copied over the debugger+disassembler portions from the existing version. I figured that if I took the existing one and tried trimming it down, that it'd end up with too much old baggage. But so far, the opcodes are looking mostly the same anyway, only I'm using #defines and a switch table in place of the template function trickery. I have enough written now that I can run Zelda 3 at least (although it gets stuck in a loop immediately after.) No real point in comparing speed yet, because it'll definitely go down as it becomes more complete. Not feeling it so far, but we'll see how things go. There's a few areas that a new SMP can speed things up: * cycle table steps the clock and synchronizes once per opcode * may be able to step the timers the same way, but for now I'm still doing that per cycle *** doing the above will make op_io() a no-op * can most likely get away with turning the dummy reads into no-ops, doubt anything relies on them * there are a few small areas where word-reads can help, but only on little-endian architectures * no need for TEST register support, will reduce a bit of overhead * no bus synchronization for read cycles (eg no need to split read cycles into two parts) Most of that can be set up for toggling via #defines, including most importantly the cycle-stepping. ________________________________________________________________________________ 2011-04-30 - bsnes_v078-source.tar.bz2 Finally, a new release. I have been very busy finishing up SNES box, cartridge and PCB scanning plus cataloguing the data, however this release still has some significant improvements. Most notably would be randomization on startup. This will help match the behavior of real hardware and uninitialized memory + registers. It should help catch homebrew software that forgets to initialize things properly. Of course, I was not able to test the complete library, so it is possible that if I've randomized anything that should be constant, that this could cause a regression. You can disable this randomization for netplay or to work around any incompatibilities by editing bsnes.cfg and setting snes.random to false. The GUI also received some updates. Widget sizes are now computed based on font sizes, giving it a perfectly native look (because it is native.) I've also added a hotkey remapping screen to the input settings. Not only can you remap inputs to controllers now, but those who did not know the hotkey bindings can now quickly see which ones exist and what they are mapped to. Please enjoy. Changelog: * memory and most registers are now randomly initialized on power-up * fixed auto joypad polling issue in Super Star Wars * fixed .nec and .rtc file extensions (they were missing the dot) [krom] * PPU/accuracy now clears overscan region on any frame when it is disabled * PPU/compatibility no longer auto-blends hires pixels (use NTSC filter for this) * added hotkey remapping dialog to input settings window * added a few new hotkeys, including quick-reset * phoenix API now auto-sizes widgets based on font sizes * file dialog once again remembers previously selected file when possible * updated mightymo's cheat code database to April 19th release ________________________________________________________________________________ 2011-04-27 - bsnes_v077r05.tar.bz2 (Windows 32-bit accuracy build included.) Please test this one as much as you guys can. Especially with toggling NTSC/PAL TV mode, and using various filters, and running all games that are known to be difficult to emulate. The randomization could very well cause issues in some games if I randomize anything that should be constant. I took an overly aggressive approach. We can verify it's a random issue by setting bsnes.cfg's snes.random to false and see if that fixes the issue. I want to leave snes.random enabled in v078, and I'd like to avoid any major breakage if possible. Changelog: * fixed .nec and both .rtc file extensions (thanks krom) * randomized most S-PPU registers, should trip up some broken homebrew that does not initialize all registers * randomization is now seeded with time(0) rather than 'byuu' * SNES::interface.video_refresh() now always receives {256,512}x{240,480} * PPU/accuracy scanline 0 does not render the screen back color anymore, fixes strange coloring look on first scanline in PAL TV mode in non-overscan games * disabled hires blending in PPU/compatibility; all three cores act the same now For seeding with time(0), this is basically to prevent any game from relying on any specific value. It will catch more uninitialized register access than a static seed. It has an added benefit of stopping people from 'fingerprinting' the RAM data to detect bsnes, although that's probably still possible because bsnes will have a lower SNR for WRAM. We need to study many SNES WRAM dumps and come up with a nicer random generator for it. At any rate, it will be substantially harder to detect now. For the video refresh, this is basically to simplify filters. It's a pain in the ass dealing with all kinds of different sizes and odd resolutions, and it just serves to complicate everything. Right now I'm not actually clearing lines 225-240 when overscan is off, but that should not be too difficult, and it makes a future TV-lite simulation filter much easier to write. There is one issue though, you can't detect overscan state anymore. Hires is true if width == 512, and interlace is true is height == 480, but overscan isn't exposed. Hires is line-based, and always true on the accuracy renderer anyway. Interlace and overscan are 'per-frame' things, you can toggle them but they don't take effect until the next frame anyway. So I think I need to extend video_refresh to expose overscan, interlace, and field values. But I am hesitant to break BC on libsnes. Maybe it's best to have snes_get_video_state() that returns a mask of those settings or something. What I really need to do is write up documentation on the internal video architecture of bsnes. ________________________________________________________________________________ 2011-03-24 - bsnes_v077r04.tar.bz2 (Windows binary included.) Changelog: * setGeometry is called after append(layout) now. This fixes the window sizing on Qt. * removed enum Style {} code, as it's no longer necessary. * removed Filter, Shader path selection code from the file load dialog, since that is menu-driven now. * improved the file load dialog to remember last selected file when mode doesn't change (had to split a switch statement into two switches.) * added Hotkeys port onto input settings window, allowing one to dynamically see and remap GUI shortcuts * added power cycle / reset shortcuts Still very minimal with the hotkeys, so I packed them all into one group for now. A few more I'd like to add, but I don't want to get ridiculous like with the Qt GUI. Is there any official documentation on the heights of controls on Windows? I don't mind making them all the same height if that's how they are supposed to be. ________________________________________________________________________________ 2011-03-23 - bsnes_v077r03.tar.bz2 (Windows binary included.) Fixed up the geometry calculation code. There is now minimumGeometry() [returns minimum size needed to display a layout, treats MaximumSize as MinimumSize], and minimumLayoutGeometry() [like minimumGeometry(), but it will return MaximumSize if a single container item has that attribute. Used mostly internally for layout sizing.] It looks great on Windows, but it looks visually off on Qt. Not exactly sure what's up there. When I make a test application, everything looks great. Going to have to clone a bsnes window that's having a problem (eg bsnes main debugger checkbox window), and see what's up. Anyway, yeah. It looks great on Windows. Please compare to v077 official and let me know what you think. I no longer have to force LineEdit and Button to equal heights, the layout code automatically Vcenters on HorizontalLayout containers (planning to make a setAlignment function later of course.) Also updated the phoenix documentation on the website to reflect new stuff. ________________________________________________________________________________ 2011-03-22 - bsnes_v077r02.tar.bz2 Wouldn't recommend using this, but it has bsnes ported to the new auto-size calculating phoenix API. Known issues: - minimumWidth/Height on layouts isn't working right, windows that use it are usually too small - Windows gives 0,0 size for empty text string sizes, which messes up a lot of default sizes for LineEdit controls ________________________________________________________________________________ 2011-03-20 - bsnes_v077r01.tar.bz2 Changelog: - fixed auto joypad polling bug (fixes Super Star Wars start button input) - added pseudo-random class; so far it is RAM only [WRAM, APURAM, VRAM, OAM, CGRAM] - added new system configuration options to bsnes.cfg The pseudo-random class is optional. For right now, I am defaulting it to enabled. bsnes.cfg::snes.random = true. You can of course turn it off if you want. This will break Death Brade and Unnamed Euro Racer, no questions about it. So I don't know if I want to leave this on or off by default. Leaving it on will thwart emulator detection code and help to keep code that relies on uninitialized memory from working, but leaving it off will increase compatibility. Interesting, huh? More accuracy typically increases compatibility, but it has the potential at a certain point to decrease it as well. Death Brade will, beyond a shadow of a doubt, break on certain SNES units in the wild. Matching its pattern better will of course help, but it's the same situation as Super Bonk. So yeah, we'll see how things go before deciding on what to do with v078 official. Anyway, the randomness is a basic LFSR based on CRC32 (courtesy of blargg), seed is 'byuu', set on power-on. I may also allow time(0) as a seed. The seed is saved in the save state information. So once you have a state, the randomness is predictable and repeatable. ________________________________________________________________________________ 2011-03-16 - bsnes_v077-source.tar.bz2 Changelog: * video filters and shaders now populate inside main menu; no longer have to select them as files * fixed 2xSaI, Super 2xSaI and Super Eagle on 32-bit platforms; still buggy on 64-bit Windows * fixed linear mirroring issues (fixes Mega Man X dash bug) * fixed RAM memory mapping bug in Sufami Turbo games * home folder is now %APPDATA%/bsnes or ~/.config/bsnes * added paths.cfg file, which will allow you to specify custom paths for any file types * save states and cheat files for multi-slot games are based on slot names instead of BIOS names * fixed compilation warning on OS X with nall::decimal * fixed calculation bug in nall::fp * Makefile now has options variable, example: make options=debugger * configuration files and cheat database can now reside in the same folder as the binary itself * updated to 2011-03-11 release of mightymo's cheat database ________________________________________________________________________________ 2011-03-15 - bsnes_v076r07.tar.bz2 This should be the final WIP, left r06 up since that one has a binary. Rather than make the libsnes API incompatible with previous versions, I just implemented path as return { basename, hint }; So you will still use the set basename function already there as before. So either DSP/MSU1/Serial all go in the ROM folder, or they all go somewhere else. You can be fancy and detect the gametype and override the basename as you like, if you really want. Bumped the API to 1.3, and added const char* snes_library_id(void); it will return "bsnes v076.07" at the moment. The internal string is static, but don't try caching it or modifying it anyway. You'll have to split the name and version yourself if you want them separately. API is backward-compatible to 1.0 still. Also improved string::assign and string::append to take a variadic number of arguments. To make this happen, I had to make to_string return const char* so that infinite recursion did not happen. I had a lot of code like this: Code: cheat.append(code); cheat.append("+"); cheat.append(desc); Ugly. I also hate std::string syntax: Code: cheat << code << "+" << desc; I may just remove that entirely, not sure yet. Left shift != string append. So now there is: Code: cheat.assign(code, "+", desc); //cheat = { code, "+", desc }; also works nicely cheat.append(code, "+", desc); ________________________________________________________________________________ 2011-03-15 - bsnes_v076r06.tar.bz2 (Windows 32-bit binary included.) Changelog: - path code finished for ui/, just need to expose for ui-libsnes/ now - filters and shaders use radio items now, so you know which is active - smooth video was placed inside video mode (list is getting too long) - .bsnes -> .config/bsnes in make install - pixelshaders -> snesshader, added Makefile with make install target - snesfilter, added Makefile with make install and make clean targets - maybe other stuff Testing would be good, planning to release v077 after I add the ui-libsnes extension for path deduction. Note that it's not strictly needed, unless you want NEC-DSP/MSU1/Serial to work. ________________________________________________________________________________ 2011-03-13 - bsnes_v076r05.tar.bz2 Changelog: - QMenu::setVisible() does nothing, have to use QMenu::menuAction::setVisible() - improved path system, especially for ST games (states will be /path/to/slotA+notdir(slotB).ext, saves are per-game and per-path) - paths are now valid when you load just the BS-X/ST/SGB BIOSes with no carts inserted; maybe useful for BS-X I guess - removed video filter and pixel shader code from video settings dialog - added Settings->Video Filter and Settings->Video Shader menu lists - fixed the SaI family of filters in lores-mode only; although I don't really know how or why the change fixed them, the code is too vague The menu list for the video filters and shaders are populated from either base/filters and base/shaders, or user/.config/bsnes/filters and user/.config/bsnes/shaders. It tries the first, and if it does not find anything it tries the second, just like the configuration files. That meant doing away with multiple folders for the shaders, so now the shaders have a suffix to indicate what driver uses them, eg "Curvature.OpenGL.shader" and "Sepia.Direct3D.shader" -- probably nicer to use GLSL/HLSL, but using the driver name lets me sub in the currently loaded video driver with no special casing. So the filter if you have eg OpenGL loaded is "*.OpenGL.shader"; and for SDL you get "*.SDL.shader", which will obviously not be there as the non-GL-based SDL driver doesn't support shaders. If there are no filters or no shaders available, the menu options do not show up. The lists are not radio items with active item ticked states just yet, but they will be. ________________________________________________________________________________ 2011-03-06 - bsnes_v076r04.tar.bz2 (source only.) Changelog: - fixed Sufami Turbo ROM and RAM mapping bugs - more paths work, definitely need to clean up parameter names and enum typenames now I had to cheat just a bit on the ST SRAM. For now, I am specifying the RAM size in the XML file. The base XML isn't supposed to know about the slots though. What I need to do is write an ST header parser to get actual RAM sizes, and then from there generate an ST-specific XML file (like I do for the Game Boy) to specify this info. Would also be nice for some BS-X info. Added NECDSP, MSU1 and Serial paths. This eliminates SNES::Cartridge::basename. The core now calls Interface::path() to get the appropriate file-system path. It's a minor but useful abstraction that allows each implementation to handle how it wants to resolve paths for these files. The bad news is this breaks the libsnes API, but only for these three types. Basically the next version will remove the set basename function, and add a get path function instead. You will get a numeric parameter to indicate the type (NECDSP, MSU1, Serial, ...), and possibly a string with some helper information (NECDSP gives you the full program name, MSU1 gives you ".msu" or "-track#.pcm", and Serial gives you nothing.) You can then use the SNES ROM basename, or your own information entirely, to make the path that you want. Whatever you return is whatever the core will end up trying to open. Ultimately, this allows people to put all their NEC DSP images in the same folder, if they so choose. I also changed Sufami Turbo saves from .srm to .sts, so that they are distinguishable from SNES saves. Just like BS-X and Game Boy saves already were. And with that, I've added separate paths for BSP/BSS/STS/SAV. I'll probably have to call Game Boy RTC files "gbrtc" or something, but leave the extension as ".rtc" on the file system. Technically I can do the same for .bss and .sts, not sure if I should or not. BS-X PSRAM is weird either way. No standard filename between emulators for that, as far as I know. I really need to clean up the path code. It's one giant function that handles four or five different path types. Need to break off functionality into smaller functions, and then make a sub-function for each type. Need better names, NECDSP isn't a cartridge slot. I need an ID to specify "I want a filename for both ST slots at the same time (game1+game2.extension)", etc. The string parameter isn't solely a type, and I need better handling of suffix. Probably should merge that in and prepend the "." character onto what is now type. Eg "srm" -> ".srm". ________________________________________________________________________________ 2011-03-03 - bsnes_v076r03.tar.bz2 (Windows 32-bit binary included.) Please test this one guys, I'd like to release an update this weekend :D I want to add a better message for when BIOS files do not exist. I also want to add manual paths for DSP/MSU1/BSS/BSP/SAV files. Also, the debugger is extremely slow on Windows, but I don't know why. Probably phoenix related, but the MinGW profiler crashes. So I don't really know how I'm going to fix that. Help would be appreciated. Changelog: - paths.cfg work completed - save states/archives and cheat files for multi-slot games are more intelligent now For paths.cfg, there are three types of entries. Each have different special prefixes. Folder paths: sfc, bs, st, gb, filter, shader By default, bsnes will remember the last path you loaded a file of said type from. It will be prefixed with "recent/" in the file. Specify an explicit hard-coded path to override this. BIOS paths: satellaviewBios, sufamiTurboBios, superGameBoyBios Remembers an explicit hard-coded path to the BIOS you selected last. I was thinking that a nice feature would be for the "Load Special" windows to pop open the slot A load dialog if a BIOS was selected. Select a game from this popup and it loads directly, cancel it to get the regular window to override the BIOS. Save paths: srm, rtc, bsa, bst, cht, log Paths to write various files that the emulator generates. Note: srm groups bsp, bss and sav for now. Was being lazy. There are four special prefixes for these: "base/" -- gets replaced with the executable path "user/" -- gets replaced with the same folder where bsnes.cfg goes (%APPDATA%/bsnes or ~/.config/bsnes) -- good for hiding files "./" -- gets replaced with the current ROM path "../" -- gets replaced with the folder above the current ROM path If you want to go up two folders or more, then use a hard-coded path. If that's not good enough, kill yourself because God hates you. If I'm forgetting any savable data files, please let me know. The save state/archive and cheat file path finding update works like this: most of the time, you want the states and cheats to be named after the SNES ROM. But for BS-X, Sufami Turbo and Game Boy, you want it to be named after the slot cart. For instance, playing Mega Man II and then Contra 3, you don't want both to use Super Game Boy (US).bst. The one edge case here is dual Sufami Turbo mode. I still default to saving cheats and states as slot A's filename. I'll probably have to create a concatenation of both names, but for now just be careful with that. ________________________________________________________________________________ 2011-03-01 - bsnes_v076r02.tar.bz2 Changelog: - fixed a crashing bug when you toggle a cheat code and then load a save state - added paths.cfg - bsnes now remembers the most recent path per file-type, like bsnes/Qt used to do - re-added -s to Linux linker flags - fixed crash with libsnes/SGB XML parsing Okay, so the way paths work is pretty cool, but still a work in progress. Every load type (SFC, BS, ST, GB, filter, shader) has its own path string. This string keeps track of the last path you've loaded a file from. The path is prefixed with a ":" to indicate that it is not a manual path, but rather a recent path, and that subsequent loads should update it with a new recent path. Specify a path without the ":" and it will always load from that path, and never update the path from subsequent path loads. The support is currently only there for initial load paths and remembering the BSX/ST/SGB BIOS file paths. A lot more work will be needed for the rest. Also, this is complicating my "don't reload the window if the path and type is the same" code, which is what's needed to remember the last selected file in the list. Man that's some annoying code to support :P ________________________________________________________________________________ 2011-02-27 - bsnes_v076r01.tar.bz2 (source only.) Changelog: - fixed linear mirroring issue in memory map (fixes dash in Mega Man X) - home path for Windows is now %APPDATA%/bsnes (not %APPDATA%/.bsnes) - home path for OS X and Linux is now ~/.config/bsnes (not ~/.bsnes) - bsnes-geometry.cfg is now geometry.cfg; and it stores width,height - I do not yet restore width, height; because the GTK+ and Qt APIs treat window resize as implying setMinimumSize - added bsnes/ui/path; which I have some significant plans for - fixed a bug in realpath (specified path is not always a folder, so we should not always append / as with userpath) - bsnes.cfg, geometry.cfg and cheats.xml may now optionally exist in the same folder as the binary itself - ruby only imports the nall namespace after including system headers (should fix OS X 'decimal' issue) - nall::fp now uses atof (fixes nall::fp("0.05")) - I split the CheatDatabase to a separate cheat-database.cpp file; it was pretty ugly packed into cheat-editor.cpp - Makefile now has "options := " line; where you can add "debugger" if you like, and in the future maybe more options --- also works via command-line: make options=debugger ________________________________________________________________________________ 2011-02-25 - bsnes_v076-source.tar.bz2 Most notable in this release is that sound support has been added to my own Super Game Boy emulation. The GUI toolkit, phoenix, has also received a complete rewrite; with the most visible change there being that windows are now resizable. Changelog: * added sound emulation to Game Boy core * fixed Super Game Boy save state support * added HexEdit widget to Windows and Qt targets; debugger can now be compiled on all platforms * entering fullscreen now auto-hides mouse; and mouse capture is toggled otherwise by F12 key * fullscreen command and geometry caching works much better on GTK+ and Qt targets * phoenix rewritten from scratch; now supports resizable layout containers * phoenix/Windows no longer relies on buggy SetParent API to reparent widgets ________________________________________________________________________________ 2011-02-24 - bsnes_v075r16.tar.bz2 (Windows 32-bit compatibility binary included) This has my latest API enhancements, but there are some known issues: - resize on Windows seems to not repaint the buttons properly in rare cases. I may just need to revert to flickering resize. - GTK+ reports the wrong menu height, off by two pixels, prior to the window being realized (made visible) --- this results in the main window moving up two pixels after each run of bsnes The menu height bug was actually there previously, it was just that Qt and GTK+ were computing the frame margins incorrectly (ignoring the menu bar) before. On the bright side, ui/settings/input.cpp has been improved by way of the new multi-layout support. The window is no longer forced to an awkward 640 pixels wide, as the mouse axes/buttons can overlap now. The code is also simpler since I am using the Layout::setVisible command to toggle groups on and off instead of doing it for each and every control. ________________________________________________________________________________ 2011-02-22 - bsnes_v075r15.tar.bz2 phoenix/GTK+ rewrite completed. All three targets should now be 100% operational with full resize support. ________________________________________________________________________________ 2011-02-19 - bsnes_v075r14.tar.bz2 (Windows binary is included.) Adds the new phoenix/Windows. Testing would once again be appreciated, as this is basically a rewrite of the entire core of the GUI. Double-clicking listbox items works, at least :D ________________________________________________________________________________ 2011-02-16 - bsnes_v075r13.tar.bz2 Found the source of lag on cartridge load. ListView::modify() was not locking Qt messages, so it was causing a CheatEditor::refresh (copies 16MB of memory each call) for all 128 cheat items. Final issue now is that nested submenus (menus inside of menus) are not applying Window::setMenuFont yet. ________________________________________________________________________________ 2011-02-15 - bsnes_v075r12.tar.bz2 phoenix has been completely rewritten from scratch, and bsnes/ui + bsnes/ui-gameboy have been updated to use the new API. Debugger works too. Currently, only phoenix/Qt is completed, and there are two known issues: 1: font sizes of menu items are wrong, I can fix this easily enough 2: there's some sort of multi-second lag when loading games, not sure what's happening there yet The new phoenix isn't exactly complete yet, still making some key changes, and then I'll start on phoenix/Windows and phoenix/GTK+. The most noticeable difference is that you don't have to give all of the header paths and PHOENIX_PLATFORM defines when compiling individual GUI object files. It's only needed for phoenix.cpp itself. The overall structure of the phoenix source folder is much saner as well for sync.sh. I'm really surprised things are working as well as they are for a two-day power rewrite of an entire phoenix target. The other targets won't be as bad insofar as the core stuff is completed this time. And thank god for that, I was about ready to kill myself after writing dozens of lines like this: Code: HorizontalSlider::HorizontalSlider() : state(*new State), base_from_member(*new pHorizontalSlider(*this)), Widget(base_from_member::value), p(base_from_member::value) {} But each platform does have some new, unique problems. phoenix/GTK+ was acting screwy prior to the rewrite, and will most likely still have issues. Even more important, one of the major points of this rewrite was having the new phoenix/core cache widget settings/data, so that I can destroy and recreate widgets rather than relying on SetParent. This means that simple copying of the old phoenix/Windows won't work, and this new method is significantly more involved. ________________________________________________________________________________ 2011-02-09 - bsnes_v075r11.tar.bz2 (Windows 32-bit compatibility binary included) Rewrote the way menus are attached, they act like layouts/widgets now. All three phoenix targets once again work with both radio menu items and radio widgets. Both GTK+ and Qt have built-in group controls right inside the widgets, so I don't have to keep my own groups around anymore. They do act screwy at widget creation though, have to jump through some hoops to get it to work right. All I can say is, definitely set all child widgets to the parent before trying to check any of them. My long-term goal for the main window is to honor the fullscreen video setting as a generic setting, and let the window scale auto-fit the best possible size that matches your scale preference into the output window, centered just like fullscreen. For now, I've just set it to a fixed window size until I finish working on phoenix. The scale X settings will just be to snap the window to an exact size in case you don't want any black borders, they won't be radio items and the bsnes-geometry.cfg file will save width/height information as well. Simplified the sizing requirements for creating layouts and updated all bsnes windows to support the new system. Layouts also expose their minimum width/height values, which I use to create perfectly sized windows on all three platforms. This will fix cut-off heights on the last Windows WIP. Qt is being annoying though and forcing a minimum window size of 300,100 despite me telling it to use a smaller window size. Always have to fight with Qt, I swear to god. To get the Windows debugger looking sharp, I will need to add a Geometry Font::geometry(const nall::string&) function. Easy to calculate on Windows with DrawTextEx, not so easy on other targets. But get that value, add +~10px margins for client edges, and then use layout.minimumWidth/Height() + text string geometry. ________________________________________________________________________________ 2011-02-07 - bsnes_v075r10.tar.bz2 (Windows 32-bit compatibility binary included) All targets can now handle dynamically changing the header text of listbox widgets, but I wouldn't recommend trying it with items in your list. phoenix/Windows and phoenix/Qt are mostly fully operational now. All platforms support dynamic layout resizing. I tried WM_GETMINMAXINFO (thanks, OV2), but it was acting kind of choppy on resize, and it would get confused and go crazy if you snapped one direction to the minimum height but not another, so for now I'm leaving it off. phoenix/GTK+ will be missing some functionality in regards to window geometry. The other two have a more coherent strategy now: geometry() is the client area, and setGeometry moves the client area to where you ask for. This makes truly centering your client area trivial. frameGeometry() includes the borders, menu and status. There is no setFrameGeometry(), not sure if I really even want that, but it could be useful so who knows. All targets also support non-resizable windows. X11 is of course horrendously poor with frame sizes, Qt and GTK+ don't even pretend to simulate them, so they say the frame is 0x0 pixels in size until your widget is fully realized and visible to the end user. So for now, to get window positioning right, I have to wait until the window appears and then reposition the window again, causing a slight jump. My plan is to build some persistent caching support directly into phoenix. From here, I can just have the window snap the very first time you run your very first phoenix app. I'll then determine the frame size information, and use that to create future windows. Once they spawn, I'll recheck and update the frame size info in case it has changed (eg user changed themes.) Saving settings into .config/phoenix will allow me to avoid having to snap the window every time on first startup. If the config file is missing or unwritable, too bad, happens every time then. I'm thinking about renaming onResize to onSize, and getting rid of Window::create(). Rather make it spawn like every other control in its constructor. ________________________________________________________________________________ 2011-02-06 - bsnes_v075r09.tar.bz2 Ported phoenix/Windows and phoenix/GTK+ over to the new system. There are some problems that need to be addressed: - Windows ComboBox height setting needs widget creation height to properly scale itself (make Widget::setGeometry virtual and override ComboBox::setGeometry) - Windows Canvas is completely broken - GTK+ Canvas is slow as shit compared to Qt Canvas, probably nothing I can do about it, have to do a very costly conversion because GTK+ is stupid and uses BGR like Nintendo - GTK+ listboxes are fucking insanely complicated to set up. Currently I just split the second-half of creation to the setHeaderText call, but when you don't call that, things explode --- I'm probably going to have to completely destroy and recreate listboxes when changing the header text / column count - Qt resize code is still impossible to get right, it's not letting me size a window > 2/3rds of the screen size (it's in their docs) --- I swear, Qt is the most painful API in the world to move/size windows with - now that Window is separate, it really needs geometry() and frameGeometry() as the two are quite different - I need a way to toggle window resizability for fixed layouts, Qt is once again going to be a nightmare as it lacks a way to do this other than fixed layouts - GTK+ currently explodes on bsnes, millions of console messages, wonderful - plenty more I'm forgetting One bit of really cool/good news though: I made Fixed/Horizontal/Vertical layouts external to phoenix itself. The code is included for all targets so that it's always there and compiled into one object, but the great news is that you can easily write your own layout widgets and they'll work on all toolkits instantly. That resize issue with bsnes was so simple it's annoying: my FixedLayout container was repositioning on geometry updates. Made it only do it once at creation like it should. bsnes now has a fancy resize, grow the window and get black borders, shrink it and the video shrinks with it. I plan to make it fancier with constraint settings (center, scale, stretch). Basically I want to turn the fullscreen setting into a general setting that also applies to windowed scaling. I will probably turn the video scale X sizes into regular items instead of radio boxes, so you can easily reset to a fixed size whenever you want. Update bsnes to remember width,height geometry as well and it should be quite nice. ________________________________________________________________________________ 2011-02-05 - bsnes_v075r08.tar.bz2 Eleven hours of work. Window is now a base type (inherits from Object, not Widget), same for Layout. FixedLayout still inherits from Layout. Added HorizontalLayout and VerticalLayout types, that can append each other to themselves to create box layouts. Layout margins are supported, spacing is specified inline (I find this a much better way to fine-grain spacing than Qt's single setSpacing function), and alignment is handled strictly via padding widgets (insert a zero-sized label and it will automatically grow to consume all extra space.) Overall, my box packing model is slightly less powerful than Qt's, but it is a good deal simpler and and easier to use in 90% of cases. The one limitation I hit was with my input settings window, I'm not currently able to embed two different layouts and toggle one on and the other off to show only either { mouse x-axis, y-axis } or { mouse left, middle, right }, so they instead just space out differently and I had to grow the input window width a bit to compensate. Resizing works great, pretty cool seeing that this is the first time I've ever written my own resizer. I had to fight with Qt for several hours to the point of potentially developing an aneurysm, but I finally got it to properly handle geometry and sizing stuff. Some weird issue with the bsnes viewport widget, I tell it to resize and for some reason it doesn't. Cheap hack, I just make it constantly resize every video refresh and it eventually takes. Wish I knew what was up with that. All of bsnes now uses dynamic layouts sans the main window, so you can resize them however you like. This is still all Qt-only, I'm afraid. The other two ports are in-progress. ________________________________________________________________________________ 2011-02-04 - bsnes_v075r07.tar.bz2 This has the phoenix changes applied. Instead of widgets attaching directly to windows, you now attach them to layouts, which can then be attached to windows. Layouts are widgets themselves, so adding layouts to layouts is trivial. It also allows for multi-widget show/hide, etc. Right now there is only FixedLayout, but of course the plan is to support a BoxLayout, that lets you add HorizontalLayout and VerticalLayout containers to it, thus enabling auto-resize and simpler form layout. So far only phoenix/Qt is 100% moved over. phoenix/GTK+ has about 1/3rd ported, and phoenix/Windows only has one control ported over as a proof-of-concept. On the user side, bsnes, bgameboy, snespurify and curse have been moved to this new layout system. All of bsnes works great with it, as far as I can tell. Fullscreen, debugger, etc are good. Testing for regressions would be nice. ________________________________________________________________________________ 2011-02-02 - bsnes_v075r06.tar.bz2 Removed the floating-point volume adjustments from the wave channel and the left/right speaker mixers. Also, against my better judgment I'm backing out of left/right computation when they are both turned off. This basically makes non-stereo games run faster, but will make stereo games appear to run slower. I don't like it when end-users experience mystery slowdowns. Anyway, it appears that the audio calculation is really fucking demanding. Knocks FPS from 800 down to 300. I thought it might be libco, so I took it out and it only went up to 305fps o.O There is also some sort of problem with bsnes/Super Game Boy audio. The latency is really great when you first start, but it seems to drift apart over time until it is well over 500ms, and then it either pops or fades back to very low, sub-50ms latency again. The way I handle mixing is that the coprocessor audio samples go into a resampler to the native SNES rate, and fed to an output buffer. SNES audio samples go there untouched. When there is a sample in each, I add them together and average the result (I still don't understand why we divide by two since these are signed integers), and output it immediately. It's just-in-time sampling, so as long as DSP v Coprocessor do not drift very far, it should have very low latency. And I make the CPU sync DSP and Coprocessor once per scanline, which is something like 15 samples or so. ________________________________________________________________________________ 2011-02-02 - bsnes_v075r05.tar.bz2 Added Game Boy sound emulation, all four channels. It's really, really, really bad. Plenty of bugs, I don't even know what the fuck a high-pass filter is so that isn't there. Hermite resampling from 4MHz down to 44KHz. But it's tolerable. I don't understand what sweep is for at all, and I'm sure I have that insane recursive reload behavior wrong. This is pretty much my own design. I referenced blargg's gb snd emu, blargg's older gb apu ref, Cydrak's APU core, that lousy gbdev wiki article, the completely and utterly worthless pandocs, and received nothing but bad and wrong information that just wasted my time from #gbdev. But I managed to pull it off. It's also painfully slow, like 250fps on my machine slow. Countless optimizations are possible. Anyway, I'd love some help with bug-fixing :D But I'm not really too concerned with absolute perfection anyway, so no big deal. I'm sure it'll get fixed up over time. ________________________________________________________________________________ 2011-02-01 - bsnes_v075r04.tar.bz2 Changelog: - hooked up everything necessary for Game Boy sound emulation ... - bgameboy and bsnes/SGB input 4MHz frequency, and output 44.1KHz frequency (produces soft static for now, to verify it is working) - rewrote all of gameboy/apu, it now has a 4MHz worker thread, and separate classes/folders for each channel+master, and serializes So it's basically all I can do without actual emulation code or human-readable documentation/example code. ________________________________________________________________________________ 2011-01-31 - bsnes_v075r03.tar.bz2 Changelog: - added full HexEditor widget to phoenix/Qt (has dynamic scrollbar like phoenix/GTK, but does not yet support page up/down scrolling) - optimized debugger to look great with either phoenix/GTK or phoenix/Qt - fixed phoenix/Qt fullscreen mode (had to allow resizing of the layout, and resize the container) - fixed phoenix/Qt Window::setBackgroundColor() bug that was making statusbar invisible - entering fullscreen now captures mouse, leaving fullscreen releases it - so by default, no cursor in fullscreen mode now - F12 key was assigned the task of toggling mouse capture, Tools->Capture Mouse was removed - above change allows toggling mouse capture in fullscreen if you like It wasn't my idea, but toggling the mouse capture in fullscreen also hiding the mouse cursor is what I call genius design. Two birds with one stone, and very intuitive. Also, the default GUI on Linux for bsnes and bgameboy is now Qt, instead of GTK+. I did this because Qt's fullscreen is far more stable, and I fixed up the remaining bugs anyway. Qt is also better overall at remembering window geometries on program exit, but it does have one quirk with the load cartridge dialog slowly shifting down. I would love some help with that. You can of course use whichever GUI toolkit you prefer, they are both first-class citizens now and will hopefully remain that way. I may not like Qt as a cross-platform API, but it really is quite effective on its home-turf, X11. ________________________________________________________________________________ 2011-01-30 - bsnes_v075r02.tar.bz2 Changelog: - added ui-libsnes directory back into source archive; make archive-all includes it now - added basic HexEditor widget to phoenix/Windows I still need a HexEditor class for phoenix/Qt, and the Windows one lacks a vertical scrollbar. But it does allow the bsnes/Windows debugger to be built now. You will need to use the goto text box to type in an address to edit on Windows. The scrollbar really isn't that useful here anyway, scrolling through 16MB using a 200-pixel-high scrollbar is pretty terrible. The bigger problem is that I don't have functions to determine the width/height of text strings, so the sizes are all screwed up. Since Windows fonts are so damn big, it is causing lots of ugly wrapping. And then there's the annoyance that read-only controls on Windows show up with a grayed out background ... ugh. It looks pretty terrible, so lots of work will need to go into refining it. ________________________________________________________________________________ 2011-01-28 - bsnes_v075r01.tar.bz2 Changelog: - fixed Super Game Boy save state support - both SNES and GameBoy only initialize serialize size on cartridge load once now, just like I've already done with memory mapping - added nall/public_cast.hpp for fun ... don't worry, I'm never actually going to use it in production code :D Game Boy remaining issues: - Contra 3: first boss graphics are messed up - Makai Toushi SaGa: title screen graphics are glitchy during scroll-in - Taito Variety Pack: Bubble Bobble locks up - Taito Variety Pack: Sagaia locks up - Game Boy: no sound emulation - Super Game Boy: save states crash the CPU upon load ________________________________________________________________________________ 2011-01-25 - bsnes_v075-source.tar.bz2 This release brings improved Super Game Boy emulation, the final SHA256 hashes for the DSP-(1,1B,2,3,4) and ST-(0010,0011) coprocessors, user interface improvements, and major internal code restructuring. Changelog: * completely rewrote memory sub-system to support 1-byte granularity in XML mapping * removed Memory inheritance and MMIO class completely, any address can be mapped to any function now * SuperFX: removed SuperFXBus : Bus, now implemented manually * SA-1: removed SA1Bus : Bus, now implemented manually * entire bus mapping is now static, happens once on cartridge load * as a result, read/write handlers now handle MMC mapping; slower average case, far faster worst case * namespace memory is no more, RAM arrays are stored inside the chips they are owned by now * GameBoy: improved CPU HALT emulation, fixes Zelda: Link's Awakening scrolling * GameBoy: added serial emulation (cannot connect to another GB yet), fixes Shin Megami Tensei - Devichil * GameBoy: improved LCD STAT emulation, fixes Sagaia * ui: added fullscreen support (F11 key), video settings allows for three scale settings * ui: fixed brightness, contrast, gamma, audio volume, input frequency values on program startup * ui: since Qt is dead, config file becomes bsnes.cfg once again * Super Game Boy: you can now load the BIOS without a game inserted to see a pretty white box * ui-gameboy: can be built without SNES components now * libsnes: now a UI target, compile with 'make ui=ui-libsnes' * libsnes: added WRAM, APURAM, VRAM, OAM, CGRAM access (cheat search, etc) * source: removed launcher/, as the Qt port is now gone * source: Makefile restructuring to better support new ui targets * source: lots of other internal code cleanup work Many thanks to those who helped beta test for this release, we were able to squash some important bugs. ________________________________________________________________________________ 2011-01-23 - bsnes_v074r11.tar.bz2 Changelog: - debugger compiles on all three profiles - libsnes compiles on all three platforms (no API changes to libsnes) - memory.cpp : namespace memory removed (wram -> cpu, apuram -> smp, vram, oam, cgram -> ppu) - sa1.cpp : namespace memory removed (SA-1 specific functions merged inline to SA1::bus_read,write) - GameBoy: added serial link support with interrupts and proper 8192hz timing, but obviously it acts as if no other GB is connected to it - GameBoy: added STAT OAM interrupt, and better STAT d1,d0 mode values - UI: since Qt is dead, I've renamed the config files back to bsnes.cfg and bsnes-geometry.cfg - SA1: IRAM was not syncing to CPU on SA-1 side - PPU/Accuracy and PPU/Performance needed Sprite oam renamed to Sprite sprite; so that I could add uint8 oam[544] --- makes more sense anyway, OAM = object attribute memory, obj or sprite are better names for Sprite rendering class - more cleanup I think I'm pretty much finished with the code cleanup now ... the big "would be really nice" thing for v075 would be Game Boy sound emulation, but I don't know how to do that so it probably won't happen. I suppose I'll spend a few hours testing games today or tomorrow and then post v075. ________________________________________________________________________________ 2011-01-23 - bsnes_v074r10.tar.bz2 Major WIP, countless changes. I really went to town on cleaning up the source today with all kinds of new ideas. I'll post the ones I remember, use diff -ru to get the rest. What I like the most is my new within template: Code: template alwaysinline bool within(unsigned addr) { static const unsigned mask = ~(hi ^ lo); return (addr & mask) == lo; } Before, you would see code like this: Code: if((addr & 0xe0e000) == 0x206000) { //$20-3f:6000-7fff The comment is basically necessary, and you have to trust that the mask is right, or do the math yourself. Now, it looks like this: Code: if(within<0x20, 0x3f, 0x6000, 0x7fff>(addr)) { That's the same as within<0x206000, 0x3f7fff>, I just made an SNES-variant to more closely simulate my XML mapping style: 20-3f:6000-7fff. Now obviously this has limitations, it only works in base-2 and it can't manage some tricky edge cases like (addr & 0x408000) == 0x008000 for 00-3f|80-bf:8000-ffff. But for the most part, I'll be using this where I can. The Game Boy is fully ported over to it (via the MBCs), but the SNES only has the BS-X town cartridge moved over so far. SuperFX and SA-1 at the very least could benefit. Next up, since the memory map is now static, there's really no reason to remap the entire thing at power-on and reset. So it is now set up at cartridge load and that's it. I moved the CPU/PPU/WRAM mapping out of memory.cpp and into their respective processors. A bit of duplication only because there are multiple processor cores for the different profiles, but I'm not worried about that. This is also going to be necessary to fix the debugger. Next, Coprocessor::enable() actually does what I initially intended it to now: it is called once to turn a chip on after cartridge load. It's not called on power cycle anymore. This should help fix power-cycle on my serial simulation code, and was needed to map the bus exactly one time. Although most stuff is mapped through XML, some chips still need some manual hooks for monitoring and such (eg S-DD1.) Next, I've started killing off memory::, it was initially an over-reaction to the question of where to put APURAM (in the SMP or DSP?) The idea was to have this namespace that contained all memory for everything. But it was very annoying and tedious, and various chips ignored the convention anyway like ST-0011 RAM, which couldn't work anyway since it is natively uint16 and not uint8. Cx4 will need 24-bit RAM eventually, too. There's 8->24-bit functions in there now, because the HLE code is hideous. So far, all the cartridge.cpp memory:: types have been destroyed. memory::cartrom, memory::cartram become cartridge.rom and cartridge.ram. memory::cartrtc was moved into the SRTC and SPC7110 classes directly. memory::bsxflash was moved into BSXFlash. memory::bsxram and memory::bsxpram were moved into BSXCartridge (the town cartridge). memory::st[AB](rom|ram) were moved into a new area, snes/chip/sufamiturbo. The snes/chip moniker really doesn't work so well, since it also has base units, and the serial communications stuff which is through the controller port, but oh well, now it also has the base structure for the Sufami Turbo cartridge too. So now we have sufamiturbo.slotA.rom, sufamiturbo.slotB.ram, etc. Next, the ST-0010/ST-0011 actually save the data RAM to disk. This wasn't at all compatible with my old system, and I didn't want to keep adding memory types to check inside the main UI cartridge RAM loading and saving routines. So I built a NonVolatileRAM vector inside SNES::Cartridge, and any chip that has memory it wants to save and load from disk can append onto it : data, size, id ("srm", "rtc", "nec", etc) and slot (0 = cartridge, 1 = slot A, 2 = slot B) To load and save memory, we just do a simple: foreach(memory, SNES::cartridge.nvram) load/saveMemory(memory). As a result, you can now keep your save games in F1 Race of Champions II and Hayazashi Nidan Morita Shougi. Technically I think Metal Combat should work this way as well, having the RAM being part of the chip itself, but for now that chip just writes directly into cartridge.ram, so it also technically saves to disk for now. To avoid a potential conflict with a manipulated memory map, BS-X SRAM and PSRAM are now .bss and .bsp, and not .srm and .psr. Honestly I don't like .srm as an extension either, but it doesn't bother me enough to break save RAM compatibility with other emulators, so don't worry about that changing. I finally killed off MappedRAM initializing size to ~0 (-1U). A size of zero means there is no memory there just the same. This was an old holdover for handling MMIO mapping, if I recall correctly. Something about a size of zero on MMIO-Memory objects causing it to wrap the address, so ~0 would let it map direct addresses ... or something. Whatever, that's not needed at all anymore. BSXBase becomes BSXSatellaview, and I've defaulted the device to being attached since it won't affect non-BSX games anyway. Eventually the GUI needs to make that an option. BSXCart becomes BSXCartridge. BSXFlash remains unchanged. I probably need to make Coprocessor::disable() functions now to free up memory on unload, but it shouldn't hurt anything the way it is. libsnes is most definitely broken to all hell and back now, and the debugger is still shot. I suppose we'll need some tricky code to work with the old ID system, and we'll need to add some more IDs for the new memory types. ________________________________________________________________________________ 2011-01-21 - bsnes_v074r09.tar.bz2 This WIP fixes up the last bit from the old memory mapping system, the BS-X Satellaview town cartridge now has a static memory mapper that is dynamically decoded based on register settings. Tested with BS Town + BS Zelda, and I can get in-game just fine. The mapping code is actually a lot more readable this way, too. ________________________________________________________________________________ 2011-01-21 - bsnes_v074r08.tar.bz2 The nall::function binding for the memory map apparently breaks when the debugger is enabled, as PPU:: becomes PPUdebugger::, etc; and C++ isn't smart enough to upconvert for us. Not sure how I am going to work around that yet ... Changelog: - improved GameBoy::CPU::Halt emulation, fixes Legend of Zelda intro water+world-map scrolling at the same time - added GameBoy::APU skeleton, and hooked up MMIO read/write for all registers - modified nall integer->string functions I really, really have absolutely no idea how to pull off Game Boy sound emulation. The documentation doesn't explain it at all, and blargg's GbSndEmu isn't anywhere near as easy to understand as his SNES DSP emulator was. It has so very many abstractions. The documents only tell you register names, which doesn't really help at all. As for nall::string changes: there's no more padding template parameter for any of these. Going more for sensible real-world uses rather than uniformity. hex(n) -> writes 0000nnnn binary(n) -> writes 0000nnnn decimal(n) -> writes nnnn ldecimal(n) -> writes 'nnnn ' (decimal value is left-aligned) rdecimal(n) -> writes ' nnnn' (decimal value is right-aligned) integer(n) -> writes +nnnn or -nnnn (adding + on positive to ensure length consistency) linteger(n) -> writes '-nnnn ' (sign is part of the length) rinteger(n) -> writes ' -nnnn' (sign is part of the length) fp(n) -> writes nn.nn This is mostly because decimal<3, ' '>(n) was unwieldy looking. Now we can do rdecimal<3>(n) to mean the same thing, and we can also left-align now too. The old integer was particularly ugly: integer<10>(-5) -> '-000000005' The integer and decimal functions also clamp now. With printf:%3u,1000, you would get 1000. While it's nice not to truncate, if you are trying to build a formatted output, it's very bad to let this happen. Unfortunately how to clamp is always a problem, drop the high or the low numbers? Right now it depends on whether you use the l or r forms. This isn't 100% finished yet, hex, binary and fp still do not clamp output lengths. ________________________________________________________________________________ 2011-01-18 - bsnes_v074r07.tar.bz2 (Windows 32-bit compatibility binary included.) Fullscreen works on all ports, but Qt is in general pretty wonky at the moment. Don't really care right now. F11 toggles fullscreen, there is no menu or status in fullscreen, and it auto-scales to the highest even multiple that it can. It copies all other settings (filter, shader, aspect correction, video region, vsync, async) from your windowed mode settings. You cannot enable the menu or status bars, because those are a major pain in the ass to support with both GTK+ and Qt returning nonsense geometries. Combine with each platform treating whether or not to handle menus and/or statuses as part of the geometry or not, and it's a recipe for pain. It is pseudo-fullscreen for now, but if we have some spiffy code in the future to set a true fullscreen that works on Linux (and hopefully OS X), I'll add a true-FS option to ruby later. I am not going to hide the mouse cursor at this time, because right now ruby is in charge of that for mouse capture and it's tricky to make phoenix also capable of controlling that. I am not supporting media center users who want to start in fullscreen, and I am not worrying about idiots who can't figure out how to exit fullscreen mode. I am not going out of my way to support multi-monitor setups, Qt had special handling for it that phoenix does not have. ________________________________________________________________________________ 2011-01-17 - bsnes_v074r06.tar.bz2 (Windows 32-bit compatibility binary included.) This WIP uses the 16MB+64MB memory tables for 1:1 mapping of the S-CPU bus. Minimum RAM requirement goes up to 128MB, dare I be bold here and recommend you have 256MB. I also hooked up the basic bindings for making pseudo-fullscreen windows in phoenix/Windows and phoenix/GTK+, but both have some serious issues. - GTK+ won't resize my form container, even though it's the same code I used successfully in bsnes v039 and prior with hiro - Windows scale selection breaks the faux-fullscreen effects - I am intending to write off the menu/status bars and just auto-size the video to fill the screen, nice and simple I really don't want to mess around with this for another two weeks like every other time I try and do this, if someone could lend a hand that'd be fantastic. ________________________________________________________________________________ 2011-01-16 - bsnes_v074r05.tar.bz2 Oh good, that turned out to be a lot easier than I expected. Almost all of the work was already done yesterday in porting the SA-1 over to a static map. New results: Code: CPU SFX SA1 v074.01 180 94 111 v074.03 168 81 93 v074.04 ... 91 ... v074.05 168 91 109 -6.5% -3% -2% 2-3% on special chips, although a shame, is almost a write-off. So now that there's only one bus, we can try some crazier ideas (16m-entry tables and such) to try and boost non-SFX/SA1 games. There's also some new room to boost SFX/SA1 speeds even more via heavier inlining. ________________________________________________________________________________ 2011-01-16 - bsnes_v074r04.tar.bz2 SuperFXBus was inheriting from Bus, in other words using a copy of the same memory mapping subsystem. I've removed that and made it a simple mask, since only ROM+RAM are mapped there. Result: Code: CPU SFX SA1 v074.01 180 94 111 v074.03 168 81 93 v074.04 ... 91 ... So the SuperFX speed loss has been mostly removed. I am going to attempt the same on the SA-1 now, but it's the SA-1 that took more than half of my time the other day. It's much, much more complex. There's also two Bus inheritors: the VBR bus and the main SA-1 CPU bus. By removing both, I am free to grow the size of the main CPU bus without increasing memory usage three-fold. ________________________________________________________________________________ 2011-01-15 - bsnes_v074r03.tar.bz2 You guys are going to hate the hell out of this one. It's twenty hours of non-stop work, no exaggeration at all. Started at 4AM, just wrapped up now at 8PM. I rewrote the entire memory subsystem. Old system: 65536 pages that map 256 bytes each Mapping a new page overwrites old page Granularity capped at 256 bytes minimum, requiring ST-001x to map 60:0000-00ff instead of 60:0000,0001 Classes inherit from MMIO and Memory, forcing only one mappable function per class, and fixed names MMIO sub-mapper inside memory: 00-3f:2000-5fff for one-byte granularity Can dynamically change the map at run-time, MMC register settings perform dynamic remapping New system: XML mapping is still based around banklo-bankhi:addrlo-addrhi, as that shapes almost everything on the SNES very well Internally, 2048 pages that map 8192 bytes each Pages are vectors, scans O(n) from last to first (O(log n) would not help, n is never > 3) Can multi-cast writes, but not reads [for the obvious reason of: which read do you return?] Can map reads and writes separately Granularity of one for entire 24-bit address range, no need for MMIO - whatever is in XML is exactly what you get Read/Write tables bind function callbacks, so I can have any number of functions with any names from any classes with no inheritance (no more uPD7725DR, uPD7725SR helpers, etc) Less memory usage overall due to less tables [ I tried 16 million tables and it used 2GB of RAM >_o ] Cannot dynamically change the map at run-time, MMC read/write functions perform address translation [worse average case speed, better worst case speed] Now the hate me part, functors can't beat virtual functions for speed. There are speed penalties involved: -4.5% on average games -11% on SuperFX games (SFX has its own bus) -15% on SA-1 games (SA-1 has two buses) Of course the two that need the speed the most get the biggest hits. I'm afraid there's really not a lot of wiggle room to boost speed back up. I suppose one bright spot is that we can much more easily try out entirely new mapping systems now, since the dynamic portions have been eliminated. Also, I am too tired. I hooked up every special chip but BSXCart. That one has cached MMC registers that I need to set up. ________________________________________________________________________________ 2011-01-13 - bsnes_v074r02.tar.bz2 Changelog: - updated/fixed st0011.bin SHA256 sum - removed launcher/ - building ui-gameboy only builds the Game Boy core, not the SNES core - binary name output is bgameboy for ui-gameboy - make install/make uninstall work as expected with the extra data files ________________________________________________________________________________ 2011-01-13 - bsnes_v074r01.tar.bz2 Changelog: - fixed libsnes to compile again, the GB RTC constant is there but doesn't do anything just yet (no serialize support in GameBoy core) - libsnes: added SNES_MEMORY_(WRAM,APURAM,VRAM,OAM,CGRAM) -- really only for the first one, it allows libsnes users to implement their own cheat search - you can now load the SGB BIOS without a game!! please be sure to enjoy the blinking cartridge icon emulation :D - necdsp (uPD7725,96050) - simplified code a bit: removed persistent regs.idb, simplified jumps, merged exec() with main loop, etc. - nall::function - fixed an initialization bug when copy-constructing objects - nall::vector - use calloc instead of malloc to help safeguard against uninitialized class data (potentially hides errors, but better than crashing in production) Forgot to nuke the launcher until upload finished, will do that next time. ________________________________________________________________________________ 2011-01-11 - bsnes_v074.tar.bz2 This release adds full low-level emulation of the NEC uPD96050 coprocessor, used by the ST-0010 (F1 Race of Champions II) and the ST-0011 (Hayazashi Nidan Morita Shougi). The former was already playable with HLE, but lacked timing emulation. The latter has never been playable through emulation before now. But as with SD Gundam GX before, you really weren't missing much. Please see my donations page, and send a small token of thanks to Dr. Decapitator's Paypal address if you don't mind. The NEC uPD96050 proved to be much more difficult than anticipated, and he had to dump the chips multiple times each, spending many days on this. He is currently working on extraction of the Cx4 (Mega Man X2, Mega Man X3), which initial scans have shown to be an Hitachi HG51B169. Also remaining is the ST-0018, which is used by the only remaining unplayable game: Hayazashi Nidan Morita Shougi 2. Also new in this release is my own Game Boy emulator. It is being used to provide native Super Game Boy support, built directly into bsnes. This core is released under the GPLv2, but I am willing to grant a more permissive license for other SNES emulators, if anyone is interested. Of course I cannot compete with the quality of gambatte, and certainly not from only a weeks' worth of work. Currently, there is no Game Boy-side sound output and there are quite a few bugs remaining in its emulation core. I would appreciate any help on this, the Game Boy is not my forte. So yes, we are taking a step back today, so that we may take two steps forward in the future. See my previous posts for more on the advantages my native Game Boy emulation core brings to the project. As I am in a very good mood, I have posted two pre-compiled binaries this time: the first is a 32-bit Windows binary built with the faster performance profile; and the second is a 64-bit Windows binary built with accuracy profile. Lastly, the debugger is still Linux-only, but it is now stable enough to be considered usable. Check it out if you like, compile with -DDEBUGGER to enable it. ________________________________________________________________________________ 2011-01-10 - bsnes_v073r07.tar.bz2 I give up for now. This WIP doesn't really improve uPD any, but it does have major fixes to the debugger. Debugger is still Linux-only for want of a HexEditor widget, but the Linux one is now usable. Before it'd trace and search for breakpoint at sub-1fps. Fixed it to not break out of core for simple things and it'll run at near-fullspeed for BPs, half-speed for tracing to file (lots of I/O.) EDIT: rather obvious, but: Code: 000f a = $00da; 0010 b += drnf; 0011 rp = a; 0012 sol = [rp]; 0013 pc.l = sol; pc.l = sol = datarom[a=00da] is static and unchanging, no matter what op is fed to DR. So JP BRCH=0 must be doing something other than just PC=SO. But even by using all variables and states at that opcode, I can find no way to make it jump where we want, $1c -> $c1. It's possible it jumps somewhere else first that then reads from the table to find out where to jump though. Doesn't look like the $96 it reads from ROM is right, that code there looks like line noise ... lots of useless, impossible to hit branch checks. As for the data ROM itself, $000-0ff (as 16-bit words) is a DIV table. Formula: value = 32767/offset (thanks Jonas Quinn) So A=$da, rp=A, ro=32767/$da or 218. 32767/218=150, or $96. I can't possibly imagine why the hell the game would perform a constant division here. ________________________________________________________________________________ 2011-01-10 - bsnes_v073r06.tar.bz2 Okay, I need help with Hayazashi Nidan Morita Shougi (J). Above WIP will automatically map in the ST-001x chips, no need for an XML file. F1 Race of Champions II (J) is fully playable, at least. It's forced to 15MHz like the ST-0011 for now. The core (snes/chip/necdsp/core) is somewhat unstable at the moment, some debugging hooks commented out and some hacks / ideas floating around in there. Disassembler can't handle long jumps yet. Code: a1728c31df22b93e4bdae73718ba27a2 st0010.bin 682241e1370c957af676332630177f71 st0011.bin a74594aff68fab966842414e199ac501 st0010-program.bin 5a604bb9a25e647a80d23d36520dd442 st0010-data.bin 370c36279a8510ad89965ae719366056 st0011-program.bin de8971c1b85b9f58364cfc02d7d1b1e4 st0011-data.bin Code: 55c697e864562445621cdf8a7bf6e84ae91361e393d382a3704e9aa55559041e st0010.bin 448e0deb0f580833ea878f4894a56124da18453d2d78e821388b6545909ba00a st0011.bin ________________________________________________________________________________ 2011-01-08 - bsnes_v073r04r.tar.bz2 Yeah, see? I repatched the upd7725 standalone module, and now it works just fine. F1 ROC II is fully playable now. The fuck is going on? ;_; ________________________________________________________________________________ 2011-01-08 - bsnes_v073r05.tar.bz2 Added uPD96050 emulation, but it's not working right now. I'm totally stumped. The ST-0010 player cars aren't moving right, and it crashes sometimes on exit like it's going out of bounds. I had decided to try and avoid duplicating the 20KB uPD7725 core, so I made a new folder: snes/chip/necdsp snes/chip/necdsp/upd7725 snes/chip/necdsp/upd96050 The latter two derive from the former, and they specify the PC, RP and DP sizes, which allocates appropriate memory. I use simple runtime-masked registers (to avoid template hell on every uPDcore function), and then I derive from that to complete each actual DSP. The uPD7725 seems to work great, but the uPD96050 is fucked and I don't know why :( Help would be appreciated, it must be something simple because I am certain the cars were working before. Kinda wish I didn't scrap the old code now :( I kept wip04 up, I'm going to try repeating my earlier changes with a separate core and see if I can get it working again. Okay, this WIP will do this for you automatically, but you can also use this XML: Code: The st0010.bin file is here: st0010.bin And obviously, you can only use this with F1 ROC II, probably any region. I'll hook up saving/loading the RAM when we get the chip working again. Damnit, so close too. I wanted to post about this tonight :( ________________________________________________________________________________ 2011-01-08 - bsnes_v073r04.tar.bz2 No uPD96050 emulation here just yet, be patient ;) Just something I wanted to do first ... I've merged the bgameboy GUI into the bsnes project, as it's only ~3KB and it means I don't have to keep manually editing and copying two projects around. You can set ui := ui-gameboy to build bgameboy as a standalone, and ui := ui to build the bsnes you are used to. I will be polishing it to allow changing the binary output name, not building the SNES portions when not needed, etc in time. So that'll end bgameboy standalone releases, at least for now. If it ever gets important enough to split back out again I can, but I prefer it this way. bgameboy was never meant to be mainstream anyway, just a component for bsnes. ________________________________________________________________________________ 2011-01-07 - bsnes_v073r03.tar.bz2 Changelog: - much tighter SGB integration, but this is still a work-in-progress --- memory::gb(rom,ram,rtc) is gone, uses GameBoy:: memory structures directly (a big gain, no need to copy memory to save and load) --- UI-based cartridge loading works with GameBoy:: directly as well - libsnes will need to be updated internally to reflect this --- games can save and load (even before bgameboy can, hah) --- save states hooked up, but they crash the DMG. I don't know why, as if it was hard enough saving states with libco, try doing it for an emulator inside an emulator >_< - last remnants of old SGB stuff removed, XML converted to - looks like the XML list idea is looking pretty useless for SNES::Cartridge now that bgameboy handles its own XML mapping ________________________________________________________________________________ 2011-01-06 - bsnes_v073r02.tar.bz2 (Windows 32-bit compatibility binary included.) Changelog: - removed bsnes/supergameboy (libgameboy -> libgambatte binding) - added direct ICD2-R coprocessor emulation - linked in bgameboy to the ICD2-R module - Makefile removes -Isnes, all files adjusted from to [relic from asnes split] You can now play Super Game Boy games with the core bsnes library. Remarkably, bsnes/gameboy compresses to a mere 15KB, so the source archive has barely grown at all. Similar results for the binary, it's maybe 100KB bigger at best. I don't know why the fuck libgambatte was producing 5MB DLLs on Windows 64-bit (I removed the filters), probably a bug in MinGW. ________________________________________________________________________________ 2010-12-26 - bsnes_v073r01.tar.bz2 (Windows 32-bit compatibility binary included) While perhaps not perfect, pretty good is better than nothing ... I've added emulation of auto-joypad poll timing. Going off ikari_01's confirmation of what we suspected, that the strobe happens every 256 clocks, I've set up emulation as follows: Upon reset, our clock counter is reset to zero. At the start of each frame, our poll counter is reset to zero. Every 256 clocks, we call the step_auto_joypad_poll() function. If we are at V=225/240+ (based on overscan setting), we check the poll counter. At zero, we poll the actual controller and set the joypad polling flag in $4212.d0 to 1. From zero through fifteen, we read in one bit for each controller and shift it into the register. At sixteen, we turn off the joypad polling flag. The 256-clock divider allows the start point of polling for each frame to fluctuate wildly like real hardware. I count regardless of auto joypad enable, as per $4212.d0's behavior; but only poll when it's actually enabled. I do not consume any actual time from this polling. I honestly don't know if I even should, or if it manages to do it in the background. If it should consume time, then this most likely happens between opcode edges and we'll have to adjust the code a good bit. All commercial games should continue to work fine, but this will likely break some hacks/translations not tested on hardware. Without the timing emulation, reading $4218-421f before V=~228 would basically give you the valid input controller values of the previous frame. Now, like hardware, it should give you a state that is part previous frame, part current frame shifted into it. Button positions won't be reliable and will shift every 256 clocks. I've also removed the Qt GUI, and renamed ui-phoenix to just ui. This removes 400kb of source code (phoenix is a lean 130kb), and drops the archive size from 564KB to 475KB. Combined with the DSP HLE, and we've knocked off ~570KB of source cruft from the entire project. I am looking forward to not having to specify which GUI is included anymore. ________________________________________________________________________________ 2010-12-24 - bsnes_v073.tar.bz2 This release marks a major step forward, offering full low-level emulation of all four DSP coprocessors based on the NEC uPD77C25 processor core. Many people were responsible for this milestone: Dr. Decapitator for the actual decapping and extraction; Lord Nightmare for the cartridges and some special analysis tools; myself, Jonas Quinn and Cydrak for the uPD77C25 emulation; and all of the donors who raised the necessary $1,000 for the necessary hardware and equipment needed to pull this all off. To say thanks to the donors, I am releasing the uPD77C25 emulation core to the public domain, so that everyone can benefit from it. All four DSP emulations will be improved by this by way of having realistic timing; the DSP-4 will benefit further as the high-level emulation was incomplete and somewhat buggy; and the DSP-3 will benefit the most as the high-levle emulation there was not complete enough to be playable. As a result, most notably, this means bsnes v073 is the first emulator to fully be able to play SD Gundam GX (J)! As bsnes' primary goal is accuracy, the LLE DSP support renders the old HLE DSP support obsolete. Ergo, I have removed the 166KB of HLE source code, and replaced it with the uPD77C25 core, which comprises a mere 20KB of source code. As this LLE module supports save states, this also means that for the first time, DSP-3 and DSP-4 games have save state support. On the other hand, this also means that to run any DSP game, you will need the appropriate program ROM. As these are copyrighted, I cannot distribute them nor tell you where to get them. All I can do is provide you with the necessary filenames and hashes. SHA256: Code: 5f2e5ed06b362be023b978b5978813ecb9a07c76592454b45c2a1ed17a0de349 dsp1.bin 4d42db0f36faef263d6b93f508e8c1c4ae8fc2605fd35e3390ecc02905cd420c dsp1b.bin 5efbdf96ed0652790855225964f3e90e6a4d466cfa64df25b110933c6cf94ea1 dsp2.bin 2e635f72e4d4681148bc35429421c9b946e4f407590e74e31b93b8987b63ba90 dsp3.bin 63ede17322541c191ed1fdf683872554a0a57306496afc43c59de7c01a6e764a dsp4.bin MD5SUM: Code: 4865ac61cd758b0f9383fe3d4d3b8694 dsp1.bin c8bfb983703a96e1c3d4683105112bc0 dsp1b.bin e500ec7f6005e78cb935eea5289c8cc4 dsp2.bin c037185c8bbef6313226200dbe5fd07f dsp3.bin fe85065a7023551b0d84941a094435ba dsp4.bin All of these files are exactly 8KB (8,192 bytes) in size. Changelog: * added NEC uPD77C25 emulation core * added low-level emulation of the DSP-1, DSP-1B, DSP-2, DSP-3, DSP-4 coprocessors * removed high-level emulation of the DSP-n coprocessors * added blargg's libco::ppc.c module, which is far more portable, even running on the PS3 * added software filter support via binary plugins * added debugger (currently Linux-only); but it is as yet unstable * added pause shortcut * updated mightymo's cheat code database ________________________________________________________________________________ 2010-12-23 - bsnes_v072r14.tar.bz2 (source code only.) Changelog: * added SNES::interface.message(const string&) so that the core can send messages for the GUI to display * failing to load a DSP-n ROM, or failing the DSP-n SHA256 hash (if there is one) will result in a warning message * all DSP-1 games by default once again use the DSP-1B program, now that it has been redumped and reverified * fixed bugs in uPD77C25 SHL2 and SHL4 opcodes; fixes DSP-2 and DSP-4 emulation * removed all DSP HLE (DSP-1, DSP-2, DSP-3, DSP-4) * as a result of LLE, DSP-3 and DSP-4 games can now load and save states DSP-1 HLE: 66.9KB (no timing) DSP-2 HLE: 9.7KB (no timing) DSP-3 HLE: 24.8KB (no timing, missing opcodes, not bit-perfect, not playable, no save state support, GPLv2 or non-commercial license only) DSP-4 HLE: 64.4KB (no timing, not bit-perfect, no save state support, GPLv2 or non-commercial license only) Total HLE: 165.9KB Versus: uPD77C25 LLE: 19.8KB ________________________________________________________________________________ 2010-12-22 - bsnes_v072r13.tar.bz2 (source code only.) The DSP-1 and DSP-3 emulation appears to be great. However, there are bugs in the other two. DSP-2, Dungeon Master: the graphics in-game appear corrupt. It looks like the first two pixels have the right color, the next six have the wrong color, resulting in vertical stripes. DSP-4, Top Gear 3000: the car sprites appear to be showing 8x8 tiles instead of 16x16 files, resulting in 3/4ths of the cars being invisible, but only up close. Dr. Decapitator and Lord Nightmare are supremely confident that our dumps are 100% accurate, there was no bus wavering at all this time. We believe they are bugs in the uPD77C25 emulation. I desperately need help! I have spent the past several hours trying to ascertain what the problem is, to no avail. I've tried messing with just about every flag, every register, checking for use of OV1, S1, custom opcodes, etc ... I am having no luck. I'm going to keep trying with even more sophisticated cross-analysis. But Cydrak, if you would please rework that magic of yours, I'd be eternally grateful :D ________________________________________________________________________________ 2010-12-21 - bsnes_v072r12.tar.bz2 (source code only.) This release defaults DSP-3 loading to use the uPD77C25 core. It also pre-emptively does the same for the DSP-2 and DSP-4. v072r11 did this for the DSP-1. I've also renamed my string<>integer conversion function names: strhex -> hex strsigned -> integer strunsigned -> decimal strbin -> binary strdouble -> fp (this one will no doubt be trouble since 'file fp' is a common idiom. floatingpoint is too long, float and double are already reserved.) The reason for this is so that string building is not so hideous. Pre-C++0x: Code: string output = string() << "A: " << strhex<4>(a) << " B: " << strhex<4>(b) << "\n"; Before: Code: string output = { "A: ", strhex<4>(a), " B: ", strhex<4>(b), "\n" }; After: Code: string output = { "A: ", hex<4>(a), " B: ", hex<4>(b), "\n" }; ________________________________________________________________________________ 2010-12-18 - bsnes_v072r11.tar.bz2 This release marks a major milestone: low-level emulation of the DSP-1B coprocessor, used by the following games: * Ace Wo Nerae * Armored Trooper Votoms * Ballz 3D * Battle Racers * Bike Daisuki! Hashiriya Kon * Final Stretch * Korean League * Lock On/Super Air Diver * Michael Andretti's Indy Car Challenge * Pilotwings * Super 3D Baseball * Super Air Diver 2 * Super Bases Loaded 2 * Super F1 Circus Gaiden * Super Mario Kart * Suzuka 8 Hours * Syutoko Battle Racing 2 * Syutoko Battle Racing 94 This represents a major advance in their accuracy. More specifically, this low-level emulation allows for absolutely perfect timings, whereas the DSP-1B had no timing whatsoever before with the previous high-level simulation code. You can download the new release under the source section of the bsnes page, or from my Google Code page. Please note that you will need the DSP-1B program ROM to play these games now, and I absolutely cannot provide you with this or tell you where to get it, as it is a copyrighted work. If you would like to read more on this feat, please see the latest article: The future of SNES coprocessor emulation. Donations needed to advance SNES emulation: Also, please see the bottom of that article: I need donations in order to have the DSP-2, DSP-3 and DSP-4 coprocessor program ROMs extracted. By helping with this, we will vastly improve the emulation accuracy of: Dungeon Master, SD Gundam GX and Top Gear 3000. SD Gundam GX is unplayable in any emulator as of yet, and Top Gear 3000 has various AI issues due to incomplete simulation. Or simply jump straight to the donation info page: donations needed. Thank you in advance to anyone who can help! ________________________________________________________________________________ 2010-12-18 - bsnes_v072r10.tar.bz2 Current code. ________________________________________________________________________________ 2010-12-16 - bsnes_v072r09.tar.bz2 Fixes OP/LD RQM=1 on DR modify, Mario Kart can get in-game, but the track is completely corrupted. Reorders order of operations for OP, in an attempt to mimic parallelism. Added support for OP KLM DST. Added S1 flag setting, probably not correct. I've updated the disassembly. It is now in: src,dest format, as that is what the official development tools use. Added $ to hex values for consistency with the S-CPU disassembly. Now, here is a list of issues that need to be addressed, as far as I know. Multiplication happens after each opcode, K*L is put into M,N. But it mentions the result is 30-bit with a sign bit. Isn't that the same thing as 31-bit? Or is it possible it is acting like the sign bit of the flag registers, and just mirroring the highest bit? What is the order of operations for OP/RT? Take this example: Code: 4eb inc a mov a,rp To dump the data ROM correctly, we have to do the mov first, and the inc second. The way I've implemented it was to do the inc read, then the mov read, then the inc write, then the mov write. Both have the ability to manipulate both the IDB register and any shared registers. It is at least somewhat clear from the documentation that the DPL, DPHM and RP adjustments happen at the end of the opcode. How in the hell do we calculate the OV1 flags? The documentation says it's set to 1 if there were an odd number of the three overflows. What three overflows? What about the S1 flag? Is it set to 1 on a positive overflow, or set to 1 on a negative overflow? What happens if there is no overflow, does it get set to zero always then? The SGN register may be a useful hint to figuring this one out. Am I even calculating OV0 correctly? CMP (one's complement) is just !Q, right? They would say NOT if they wanted ~Q. How exactly does XCHG work? The document says it's an 8-bit exchange. Which 8-bits, the top eight or the bottom eight? It updates the S0 flag which is suspicious for the bottom eight. What is up with KLM mode? The nicer doc says you read from RAM[DP | 0x40], while the uglier one says that you read from RAM[(DP & 0x3f) | 0x40]. They list it as HiRAM, yet it forces D6=1 rather than D7=1. And just out of curiosity, why the fuck does it force D6=1? What possible use is that? The stack has four levels, and it is LIFO. So what happens when you pull an address off the stack? Does the now empty slot at the end get set to zero, or keep the previous address, or does it act more like a ring buffer and move the old first value to the last value? When SR.DRC=0 (eg 16-bit DR transfer mode), does RQM get cleared for each 8-bit write, or only after two 8-bit writes (eg after a full 16-bit transfer)? What happens to the high 8-bits of the 16-bit DR register when you write to it from the S-CPU in 8-bit DR transfer mode? Does it keep whatever was there, or is it forced to zero ala 65816 index registers? ----- Sadly, I think the only way we are going to be able to improve from here is going to be to log S-CPU DR reads from both the HLE and LLE emulation, find differences, and then start trying to parse the uPD disassembly code directly to figure out where the wrong results in the LLE log are coming from. Eg basically what I did with the simplest case of analyzing the data ROM dumping function. ________________________________________________________________________________ 2010-12-16 - bsnes_v072r08.tar.bz2 mariokart.tar.bz2 This WIP adds NEC uPD77C25 emulation. Unfortunately it's not at all functional yet, there are way too many things I don't understand about the chip. I'm absolutely going to need help to complete this. What I have is 'functionally' complete, but obviously wrong in probably dozens of places. The biggest things I don't understand: - how does L decide whether to pull from data ROM or IDB? - how are OV1 and S1 calculated? - is my OV0 implementation correct? - how exactly is RQM set again from DR/IDB activity? - is RQM cleared after reading a full 16-bits of data or after each 8-bits in DRC=0 (16-bit) mode? - why is ALU op 15 called XCHG? The examples all move from P to Acc, so it's not really modifying P right? - what is the exact order of OP/RT opcode execution? Each instruction can do something like five different things. Stuff I don't understand that doesn't seem to matter for the SNES usage scenario (no serial hookups, as far as I can tell): - what the hell is all the SI/SO shit about? - what about DMA? - what about interrupts? (these seem simple enough, just jump to PC=100 and push the address, and modify SR.EI) Otherwise, we're definitely at a good starting point. For now, you need the included PCB XML to manually map the program/data ROM in, which are included with the archive. You'll have to rewrite the map yourself to run other DSP-1 games, unless they have the same layout as Mario Kart. I am using the US [!] version, name it mariokart.sfc and put all the archive files and the ROM together. From here, bsnes will load up the ROMs, and start executing instructions. Since the emulation is so incomplete, it just deadlocks on the "Nintendo" logo as if there were no DSP on the cart at all, but if you enable tracing, you'll see it actually starts doing a lot of stuff before getting stuck in a really long and confusing loop. ________________________________________________________________________________ 2010-11-02 - bsnes_v072r07.tar.bz2 I'm happy enough with the debugger now. Not 100% up to par with the old one, but it also does some new things the old one didn't. - step into / step over are disabled unless they can be done safely - this means step over is usually grayed unless you hit step into first, due to bsnes not being opcode-based (you can't skip an opcode that is half-executed) - you can now trace console output to disk - stepping the CPU will print stepped SMP opcodes if the checkbox for it is on and vice versa - button added to clear the console log The only things left are pretty minor: - add VRAM viewer - add OAM list viewer - add CGRAM viewer - add properties viewer - add "Proceed" support to CPU/SMP debuggers (glorified breakpoints, basically) And then long-term vision stuff to follow that: - add SA-1 debugger - add SuperFX debugger - add "Trace for n opcodes" functionality But yeah, overall good enough for now. So the next major undertaking is going to be gutting the bsnes/Qt debugger, which is required to port that GUI to libsnes. Once done, bsnes/Qt will be a totally separate program, with a separate source distribution. I'll merge snesreader and old snesfilter directly into it. No DLLs. And after all that is done, I'll spin the entire thing off. Maybe we can set up an SVN with a list of people who can commit patches to it and we can host binaries there. ________________________________________________________________________________ 2010-11-01 - bsnes_v072r06.tar.bz2 Updated libsnes to use new file and function names. Also added EditBox::setCursorPosition for GTK+ and Qt, only used by the debugger so far so that when text is added, it auto-scrolls to the bottom. ________________________________________________________________________________ 2010-10-29 - bsnes_v072r04.tar.bz2 I guess two days is a while. nall/snes/smp.hpp created, ~68 addressing modes compared to the CPU's ~27, ugh. All hooked up, you can step into / step over / trace the S-SMP now as well. Word of caution, not a good idea to try stepping over without stepping into at least once first. I'll make it a requirement later. Reason is you may not be on an opcode edge at the time, because of course bsnes isn't an opcode-based emulator. ________________________________________________________________________________ 2010-10-27 - bsnes_v072r02.tar.bz2 Just debugger work here. About three or four hours to write nall/snes/cpu.hpp, which is basically opcode encoding information for disassembly. The disassembler inside bsnes itself was kind of limited, it always spit out all register info, had no flexibility to insert custom symbols/labels for debugging information, and the disassembler was very limited because it relied on the current processor status register M/X flags, rather than what they were when the opcode was executed. That information is stored in my usage table. So after hours of making that table by hand, I hooked that in and got proper forward+backward disassembly working, along with "step over". Still have to add "proceed". Given what a pain in the ass that was, I'm probably going to put off the S-SMP debugger for a while :P ________________________________________________________________________________ 2010-10-26 - bsnes_v072r01.tar.bz2 - includes Windows 64-bit performance binary Changelog: - added pause shortcut ('P' key, as pause/break is too finicky) - pause and auto-pause show on status bar - added a debugger skeleton, very very primitive and completely unusable - don't try it yet - added software filter support Also included is the new snesfilter library. It has all of the filters the old one had, as well as scanline filters since that's not in my GUI anymore If you want scanlines and other software filters, then you can either make your own hybrid two-in-one software filter, or make a pixel shader (I don't have one of those yet.) To use a software filter, go to video settings and pick the appropriate .filter from snesfilter/out/windows/name.filter On Windows the pixel shader gets screwy when you change software filters, so just restart if you use both and see an issue. ________________________________________________________________________________ 2010-10-22 - bsnes_v072.tar.bz2 bsnes v072: there's no need to upgrade if you already have v071. This update just fixes some minor things and fixes Qt compilation on Windows. Changelog: * fixed a compilation issue with bsnes/Qt on Windows * fixed a minor bug with UPS patching * Windows/OpenGL driver was not restoring pixel shader when toggling video synchronization King of Chaos was nice enough to create Windows binaries of the Qt port, so if you want those, you can download those here. Check his signature for the links. ________________________________________________________________________________ 2010-10-22 - bsnes_v071.tar.bz2 It is very important to note if you choose to use my binaries, the phoenix port does not support ROM images with copier headers, ROM images that do not end in .sfc (for SNES cartridges), .st (for Sufami Turbo cartridges), .bs (for BS-X flash cartridges), or (.gb,.gbc,.sgb) for Game Boy cartridges, it does not support compressed images, it does not support software filters, rewind support, fullscreen mode, IPS patches, cheat searching, movie recording, native OS file dialog boxes, asciiPad simulation, video region cropping, layer/channel toggle, slowdown, etc. It is meant to be minimal, and if this is a problem for you, please stick with the Qt port. Undoubtedly, no matter how much I emphasize this, people are going to not read this, use the phoenix port, and be put off and not use bsnes anymore. That's very unfortunate, but I am releasing this GUI anyway for those who do share my design goals and aesthetics. So I will ask a favor of you all, if you see someone mentioning something of the phoenix port not working, please advise them that it is not the general use version, and that they should stick with the Qt port. Thanks in advance. Changelog: * fixed a regression in the accuracy/compatibility CPU core with IRQ masking; fixes World Heroes 2 * fixed OAM address reset on $2100 writes for performance PPU core; fixes Mahjongg 2 and others * DSP-1 always returns high 8-bits of status register; fixes Ace wo Nerae! freeze [Jonas Quinn] * performance core can now take advantage of serial support * pixel shaders now use a unified XML format; in the future they will support multi-pass shaders and textures * major code restructuring * first public release of phoenix GUI port * mightymo's cheat code pack is now an external file for the phoenix port * phoenix port stores cheat codes in XML format as well, unifying all file formats to the same markup language ________________________________________________________________________________ 2010-10-17 - bsnes_v070r17.tar.bz2 No binaries, basically the same as v070r16a on Google Code, only this one has source code Changelog: - fixes DSP-1 status register for "Ace wo Nerae!" - fixes IRQ masking for "World Heroes II" - fixes compilation for the Qt port's debugger I'm pretty much happy with the GUI at this point. So now I just need to add a debugger, and I'm calling it a day. I'm probably going to go back to overclocking my E8400 and only use the accuracy core myself. ________________________________________________________________________________ 2010-10-13 - bsnes_v070r16a.tar.bz2 ________________________________________________________________________________ 2010-10-11 - bsnes_v070r16.tar.bz2 Windows 64-bit non-PGO performance binary included. This mostly contains improvements for nall, like path unification. This should fix FitzRoy's issue with .. on Windows. ________________________________________________________________________________ 2010-10-09 - bsnes_v070r14.tar.bz2 Only source, I left v12 up if you want a Windows binary. Changelog: - nall/string: trim and split functions now take the limit as a template parameter for clarity, trim_once variants are removed -- quotable.trim<1>("\""); //remove quotes from string -- cheatcode.split<3>(","); //split up to three times, third one is a description that may have commas -- foobar.trim(" "); //remove any and all spaces - nall/string: added wildcard() and iwildcard() functions for pattern matching - nall/directory: accepts an optional pattern parameter to perform wildcard matching -- lstring cartridges = directory::contents(path, "*.sfc"); -- some people may prefer directory::contents("/path/to/files/*.sfc"), but I like not having to build a string when you have the path separated already - nall/qt: removed entirely, now resides in bsnes/ui-qt/template; I do intend to replace the check/radio actions with native Qt versions later - bsnes/data: new folder, share the parts that both UIs use; bsnes.ico, bsnes.png, bsnes.Desktop, cheats.xml; simplify Makefile install target - Makefile: install target now creates .bsnes folder and copies cheats.xml there for you - Makefile: gconftool hack removed, not needed for phoenix, will work around with Qt later - will probably make bsnes/Qt read the cheats.xml file externally as well, as that file makes each profile 1MB bigger when embedded -- as such, will probably make bsnes also look in the binary directory for that file, so Windows users don't have to copy it to their userdata folder ________________________________________________________________________________ 2010-10-08 - bsnes_v070r12.tar.bz2 Windows 64-bit non-PGO performance binary included. Changelog: - removed support for images with copier headers - phoenix/Windows: Label properly refreshes on text changes, fixes video settings sliders - alt/ppu-performance: fixed mosaic Voffset bug, fixes Super Bowling et al - alt/cpu: fixed CPU::joylatch() reporting, allows serial applications to work with performance profile - hooked up SNES::cartridge.basename, allows MSU1 and serial support with the phoenix UI - updated UPS patching code for bsnes/Qt, allowing it to compile again, hidden config option file.bypassPatchCrc32 was removed To automatically and recursively fix all SNES ROM extensions and remove all headers, use snespurify: snespurify_v01.tar.bz2 Basically, put it in your ROM folder and run it. I strongly suggest you do this from a command-line so you can see the output. You can also see what it will do PRIOR to it actually doing it by using this syntax: "snespurify /path/to/purify -analyzeonly" If you stick it in "C:" or "/" and run it, expect it to break your entire OS. Thanks to the dumbasses that thought it'd be a good idea to distribute SNES ROMs with .bin as an extension, it will probably end up renaming your non-SNES .bin files to .sfc, and if any of those are important, you'll be in trouble. When the preservation project finally happens, I'll be removing cartridge header parsing as well and requiring XML. I'll probably have an internal database for known commercial games, and allow snespurify to generate XML for the rest. It also won't extract compressed images yet, nor will it fix overdumps, and I can probably do a better job ignoring non-SNES .bin files. It's v01, give it time people. ________________________________________________________________________________ 2010-10-08 - bsnes_v070r11.tar.bz2 Windows 64-bit non-PGO performance binary included. Changelog: - phoenix/All: converted all instances of const char* to const nall::string& -- above used to require: label.setText(string("FPS: ", fps)); but can now use: label.setText({"FPS", fps}); -- also avoids the need for the internal implementations to have to check for null string pointers - phoenix/GTK+: no longer disabling double buffering on the viewport. Does not cause flickering, and fixes redraw issue on window resize - phoenix/Qt: like phoenix/GTK+, it will use the default font on the menubar as well, so child menu items are consistently sized now - Linux: file browser can list contents of / and won't let you go higher; Windows needs a similar guard for n:/ or \\ - UPS soft-patching support added - external XML memory map loading support added - cartridge folder support added: if folder ends in .sfc and there is ONE .sfc ROM inside it, it will load the folder as if it were a ROM - input assignment refreshes text instead of reloading the list, this saves your position -- auto-advance wasn't working very well, will try again later - input clear all button removed since it's pretty fast now to do clear+down:repeat Remaining: - need to hook up SNES::cartridge.basepath for MSU1/serial support, can't believe I forgot that tonight - need to repaint on Label::setText() on phoenix/Windows - maybe some GUI hotkeys - maybe fullscreen I'm probably going to put the last two off, and call it a day once MSU1/serial is hooked up. ________________________________________________________________________________ 2010-10-05 - bsnes_v070r10.tar.bz2 Windows 64-bit non-PGO performance binary included. Changelog: - added workaround to phoenix/Windows to prevent horizontal scrollbar always being visible on single-column ListBoxes - phoenix gains Window::geometry() - added code to save and restore window positions, as in bsnes/Qt. Positions are saved to bsnes-phoenix-geometry.cfg this time - resizing the main window will keep its position onscreen now There's one issue with GTK+, if you close a window and then call gtk_window_get_position(), it returns the previously set position rather than where you actually placed the window. My easy fix of calling gtk_window_get_position right before actually closing the window didn't work, so for now you'll have to live with it. Overall, just as Qt had bugs, all toolkits and APIs have bugs. But at least these are minor, cosmetic, and mostly fixable. ________________________________________________________________________________ 2010-10-05 - bsnes_v070r09.tar.bz2 No binaries included. Changelog: - removed native OS dialog option, I don't plan to add all the code required to make it optional everywhere - cheat database supported, although it's external now. Either in the .bsnes folder or with the binary, named cheats.xml - cheats.xml is external so that binaries can be much smaller, important for multiple profiles - added "find codes" button to cheat editor (need to gray it out permanently if cheats.xml isn't found) - added cheat database add window, works the same as bsnes/Qt, but it will also alert you if you run out of empty cheat slots upon import - note: I should rename that ok button to "Import" - hooked up callbacks for multitap/mouse/SS/justifier input - added mapping for mouse axes and buttons - used a simplified approach that only lets you map left/middle/right buttons, but doesn't need a separate popup window or fake controls - moved capture mouse command to tools menu - different from Qt where you'd click inside the main window, meant to be safer from accidental capture, escape still releases capture - made a skeleton for GUI hotkey support, but the only hotkey is escape Remaining work: - hook up UPS patching, XML mapping and ROM folders - add GUI hotkeys - work out something for fullscreen support - maybe add Hotkey Settings window to reassign them (otherwise config file editing will be needed) ________________________________________________________________________________ 2010-10-04 - bsnes_v070r08.tar.bz2 No binaries included. Changelog: - all three ports of phoenix gain the ability to use ListBox::setCheckable(), checked(row), setChecked(row, checked = true); - cheat editor updated to take advantage of this Some fun differences between the implementations. Windows was the least flexible, it only lets you have a check at the start of each item. Luckily that's all I need for my purposes so it'll work. It's also a lot easier, as now I don't need a ton of extra code to try and set per-column checkboxes. Now both Windows and Qt can put text into the first item with the checkbox, but GTK+ cannot. Further, Qt needs this because even if you hide the checkbox column, it still tries to search for typed text from the checkbox column. GTK+ does this too, but unlike GTK+, Qt lacks an API call to set the search column. Since my code basically has to change this in real-time since you have to call the setProperty functions after create(), this means I always set up the checkbox columns regardless of whether or not they are used. For Qt, I had to work around this and it'll be an annoying edge case if you try and use setCheckable(true) and then setCheckable(false), because Qt has no way to clear the checkboxes from an item once you've enabled them for the first time. But without doing it this way, there's no way for eg the ROM file loader to allow type-searching, so that's the way I do it. Windows works the same, and GTK+ has a separate column (hidden from the phoenix API standpoint) for the checkboxes, with no column header label text. All in all, a major hassle, but it was the only really major GUI hit from leaving Qt, aside from the horror that's going to be the debugger, which needs all kinds of highly specialized controls. ________________________________________________________________________________ 2010-10-03 - bsnes_v070r07.tar.bz2 No binary included. Changelog: - added menu options to select controller port devices, they do actually work too - however, input mapping can't map analog axes yet, and the mouse can't be captured yet, so it's of little use - added clear and clear all buttons to the input mapper window, mainly because there was no reason not to (escape clears active input too) - going to be adding a "special" button in the future that lets you map mouse axes and buttons - fixed phoenix/Qt port, both the video rendering and Window::focused() commands work now The way I've implemented mouse mapping has always been screwy. So the special button is going to pop open another window. For digital mapping, it'll let you choose a mouse button, and for analog mapping, it'll let you choose an axis. May add in some manual joypad assignment stuff in there for analog joypad buttons, those things are impossible to auto-detect. ________________________________________________________________________________ 2010-10-02 - bsnes_v070r06.tar.bz2 No binary included. Changelog: - bsnes/phoenix uses XML for per-game cheat codes, markup is identical to the main database - added clear and clear all buttons to the cheat code editor - phoenix/GTK+ sets all child menu elements to match the parent menu font - phoenix/Windows will draw a black canvas for the Viewport widget (phoenix/GTK+ still needs this) ________________________________________________________________________________ 2010-09-30 - bsnes_v070r04.tar.bz2 No binaries, sorry. Hopefully most of you can compile, especially now that Qt isn't required. Changelog: - fixed new config file input driver name (you'll have to delete your old config, or change to a different driver and back and restart) - fixed slot loader windows' OK button placement - fixed nall/directory.hpp when list size was zero - rewrote nall/function.hpp, no longer requires or union tricks - added state manager The state manager is a little bit different this time. It's functionally identical to bsnes/Qt, 100% of the way. But when you save slots, it stores them in RAM. It only writes the BSA archive upon ROM unload / program exit. Yes, this means that technically if the emulator crashes, you'll lose your states. But a) that very rarely happens, and b) the old way was thrashing the disk like crazy, every letter you typed dumped up to 8MB to disk. With this new method, I can simply store a boolean valid flag before each slot, and pack the file better. Before, a save on only slot 3 would be 3*state size (~1.2mb), it will now be 3bytes+state size (~400kb.) I have also added a proper signature because of this, so it will detect when you load an archive for a previous serializer version and ignore it. When you go to save (unload the game), if there are no valid slots, the BSA archive gets unlinked (deleted.) I am also planning a feature around the now-hidden "slot 0". My idea is for it to be a fallback slot. How many times have you loaded a state when you meant to save and said, "shit, now I lost some of my progress"? The idea is that whenever you load a state, right before loading, it will save to slot 0. When you unload the game, or exit the emulator, it will also save to slot 0. You will be able to load from slot 0 from the menu, but not save to it. It will appear at the bottom of the load list. And lastly, I'll add an advanced option to auto-load slot 0 if it exists, which will enable "close the emulator and restart where you left off." functionality. ________________________________________________________________________________ 2010-09-29 - bsnes_v070r03.tar.bz2 Changelog: - fixed a bug in xml_element::parse() with tags - merged FragmentShader and and VertexShader into Shader, which is an XML file that contains all relevant data - updated Qt port to reflect the above - added support for pixel shaders to the phoenix port - updated all pixel shaders to use the new format - ruby won't crash if you give an HLSL driver a GLSL shader or vice versa, but it will still crash on bad programs - phoenix::Viewport has its own window class, that paints a black brush background I'll handle questions and whatever later, I'm too busy coding. Example, Curvature.shader: Code: Example, Pixellate.shader: Code: Example, Sepia.shader: Code: ; }; float3 LightColor = { 1.0, 0.7, 0.5 }; float3 DarkColor = { 0.2, 0.05, 0.0 }; float4 DiffColorPass(in float2 Tex : TEXCOORD0) : COLOR0 { vec.x = 0.5; vec.y = 1.0; float3 scnColor = LightColor * tex2D(s0, Tex).xyz; float3 grayXfer = float3(0.3, 0.59, 0.11); float gray = dot(grayXfer, scnColor); float3 muted = lerp(scnColor, gray.xxx, vec.x); float3 sepia = lerp(DarkColor, LightColor, gray); float3 result = lerp(muted, sepia, vec.y); return float4(result, 1); } Technique T0 { pass p0 { PixelShader = compile ps_2_0 DiffColorPass(); } } ]]> Format is subject to change, more specifically I may change the tag from HLSL shaders. In the long-long term, it'd be nice to extend the format to allow multiple shaders to be chained together and to encode base64 texture files. But for now, this is good enough. ________________________________________________________________________________ 2010-09-28 - bsnes_v070r02.tar.bz2 Changelog: - added NTSC/PAL TV output mode selection - added loading support for BSX Slotted, BSX, Sufami Turbo and Super Game Boy games Super Game Boy requires libsupergameboy or the DLL. Man, it feels like I've done more. Ah well. What's left ... - analog controller input mapping (mice/SS/Justifier) - controller port selection - pixel shader selection - fullscreen mode - maybe paths - some GUI hotkeys, maybe remappable Don't know what to do about snesreader and snesfilter, which are Qt-dependent. I don't really mind them not being there myself, but nobody would ever consider using the phoenix port without them. Damn. ________________________________________________________________________________ 2010-09-27 - bsnes_v070r01.tar.bz2 Changelog: - phoenix supports onActivate, or return key pressed, on text boxes - phoenix supports setGeometry() on all widgets - input settings can now map analog axes and analog buttons - analog button support is simplified over bsnes/Qt, and it supports the trigger inversion you see between Xbox 360 and Thrustmaster controllers - load cartridge window lets you press enter in the path box to select the folder, but currently allows invalid folders (makes list empty) - load cartridge won't reset your view if the folder doesn't change --- this means the last ROM you loaded is highlighted the next time you go to load cartridge; you're welcome, FitzRoy :P - removed quit system menu option - added dummy controller port system menu options, there's no code behind them yet - added power/reset menu options, dropped the power checkbox in favor of a standard power cycle option, removes unnecessary complexity - added video mode scaling, 1x to 5x; and aspect ratio correction - added video mode smooth toggle - added audio settings panel with volume and input frequency adjustment --- config file is where you can control output frequency and latency, they are too niche for a GUI - fixed a realpath() crash on Linux when the bsnes binary was in /usr/bin ________________________________________________________________________________ 2010-09-25 - bsnes_v070.tar.bz2 This release represents the coup de grâce of bsnes/Qt. Changelog: * configuration file is now called bsnes-qt.cfg; the first run of this release will start with a clean state * MSU1 now supports audio looping via new PCM file format * disabled state load/save menu due to a serious bug in Qt 4.6.0 for Windows * RawInput: all keyboards merged to KB0, it should no longer be required to reconfigure the keyboard out-of-the-box * RawInput: fixed a bug where Xbox 360 controller states were being overwritten by DirectInput controllers * RawInput: fixed a device sorting bug caused by moving ruby to Unicode * Direct3D: fixed a pixel shader bug caused by moving ruby to Unicode * Linux port: fixed sudo make install target * Linux port: default to gcc/g++ instead of gcc-4.5/g++-4.5 for one last release * updated to mightymo's 2010-09-20 cheat pack ________________________________________________________________________________ 2010-09-25 - bsnes_v069.tar.bz2 This release adds some nifty new user interface features, and improves both performance and accuracy. The performance core is now fast enough to maintain a constant 60fps on a first-gen Intel Atom N270 in 98% of games. Changelog: * added new effect toggle tool window, which allows toggling of BG/OAM graphics layers and DSP audio channels * added an option to use the native OS file and folder open dialogs instead of my custom browser * added a new state selection window * added frame skipping support, which is only used during fast forwarding; as a result, fast forward is now ~80% faster * removed unnecessary icons, added workaround for checkbox/radiobox menu icons on Linux/GNOME * added RTS/CTS support to serial simulation * all cores: OAM high table even address writes should update OAM latch data register [blargg] * accuracy core: major improvements to mosaic emulation * accuracy core: added additional hardware-based caching, resulting in a ~15% speed boost * accuracy core: emulated CGRAM address invalidation for writes during active display * performance core: added new S-PPU renderer, resulting in a ~10% speed bost Also, I'm looking for someone who would be willing to backport bsnes v069 from C++0x to C++98. With this, it should be possible to create a PS3 port of bsnes that runs at full speed with all games. bsnes does not use C++0x very much, so it shouldn't be very hard, a weekend project at best. I just don't have the time to do this myself. Note that I wouldn't be merging these changes, I intend to keep using C++0x, this is needed only because the PS3 SDK uses a really old version of GCC. Please post on the message board if you are interested in helping. ________________________________________________________________________________ 2010-09-24 - bsnes_v068r25.tar.bz2 Windows Qt/performance/32-bit/non-PGO/non-debugger (yeah it's getting ridiculous how many variants are possible) binary included This is basically the v069 release candidate, heavy testing would really be appreciated. I'd like for v070 to be the first official phoenix release, but if a major bug slips past us that will ruin it. The big change is that save state support was added to the PPU-performance core. ________________________________________________________________________________ 2010-09-24 - bsnes_v068r24.tar.bz2 Fixes OAM latchdata for all 3 cores and CGRAM address invalidation for the accuracy core (the only one that really does it because it needs cycle PPU timing.) Also removes the OAM/CGRAM read/write functions to put them inside the actual MMIO functions. Easier to handle all the special cases that way. VRAM is a bit more annoying since there's two read and two write functions. This should fix battletech/mechwarrior 3050 palette at least. ________________________________________________________________________________ 2010-09-22 - bsnes_v068r22.tar.bz2 Includes 32-bit binary, with no profiling. Wanted to torture myself, so I implemented the hardest window of all, the cheat code editor. I had to sacrifice checkboxes inside lists, unfortunately, but it's a necessary evil. Maybe some day if we can port checkboxes inside list items to Windows and GTK+, we can add it back. It should be the only really apparent GUI sacrifice, though. You toggle cheats by double-clicking them in the list. Easy to do, but not apparent. I also added in the focus policy. ./sshots/bsnes_20100921b.png As you can see, phoenix is looking amazing compared to Qt. No consistency issues, no non-native look anywhere. It looks really great in classic mode, too. Way better than Qt does in Windows classic, that's for sure. And no, I can't use snesreader or snesfilter, because both create Qt GUI windows. I don't know what I am going to do about that yet. ________________________________________________________________________________ 2010-09-21 - bsnes_v068r21.tar.bz2 Has an unprofiled 64-bit Windows binary for some reason. I meant to make it 32-bit, but forgot to swap the PATH variable to MinGW32, oops. Changelog: - adds synchronize video - adds synchronize audio - adds mute audio - adds advanced settings window with driver selection only - adds the pretty section header thing I started going toward with Qt - adds a configuration file, saves to bsnes-phoenix.cfg (I don't make the .bsnes folder yet) - the status bar shows [A] for accuracy, [C] for compatibility and [P] for carburetor ./sshots/bsnes_20100921.png I've decided that the phoenix port is going to be strictly a no bullshit, no bloat port. No warnings for idiot users, no safeties for things like setting a 0% gamma or 0% audio output, no bloatey stuff like wide-zoom scaling, no fullscreen trickery, no 500kb input driver, no movies, no rewind, just the basics. I want a UI port that I actually enjoy working on. The Qt port is a nightmare to maintain, and it's not because of bad code but because of TOO MUCH code. The Qt port will fill the GUI-equivalent of the performance core, essentially. ________________________________________________________________________________ 2010-09-21 - bsnes_v068r20.tar.bz2 Changelog: - fixed window casting crash in phoenix - added perfect forwarding to nall::string variadic templates to fix file load dialog crash in phoenix - disabled copy constructors in utf8_t to prevent this problem from occurring again in the future - separated canvas window proc by creating a separate class for it (ironically it was a desktop window causing the first crash) - use processorArchitecture="*" to make compilation easier - fixed status bar font assignment in phoenix/Windows - added InitCommonControls + CoInitialize for XAudio2 on XP - had to use DirectSound for audio; XAudio2 is crashing on exit which breaks the profiling (only a problem because you can't change the drivers without recompiling, there's really no reason to profile XAudio2 anyway) Included with the above source archive is a 64-bit profile-guided binary. ./sshots/bsnes_20100920c.png As you can see, it's pretty fucking impressive. The PGO adds another 15-20% on top of things. This is the fastest binary I've ever released as a result. If I had fast forward (frameskip) support in phoenix, that framerate could reach 600fps, and if I overclocked my CPU again that would add another 20% on top of that. Note that I don't intend to fix the DirectSound sound looping problem in phoenix, as that required some hideous hacks in the old hiro. Either get the DX SDK for XAudio2 or use Qt. ________________________________________________________________________________ 2010-09-20 - bsnes_v068r19.tar.bz2 This adds proper manifest files to get the nice XP/Vista controls. Need to find a way to auto-detect MinGW 32 vs 64 since I can't use $shell or `` on gcc -v on Windows. For now you have to edit the ui-phoenix/Makefile by hand. I've implemented the video settings window. I am going to be using separate windows this time. As nice as having everything in one place was, I didn't like being forced to stretch things to fill out the one-size-fits-all tab window I was using before. That and I don't feel like implementing tab support with phoenix anyway. The menu gets a load cartridge command, and bsnes writes save RAM files now. Loading by file dialog crashes on 64-bit. Something's fucked up there, but I don't know what. Again, help would be great here :) For those worried about the GUI ending up like the old hiro, this should allay some concerns: ./sshots/bsnes_20100920a.png ./sshots/bsnes_20100920b.png You would not believe what a pain in the ass it was to vertically center text within labels. I had to create my own replacement STATIC control, and even then DrawText alone can't center multi-line text, so I have to calculate the text size, and then manually place it vertically centered. ________________________________________________________________________________ 2010-09-20 - bsnes_v068r18.tar.bz2 This WIP fixes the Mode7 repeat issue in the accuracy core. More importantly, it's the first build to include phoenix. There is a stub GUI that does basically nothing right now. It will give you a window, a command to close the emulator, and an FPS meter so you can tell how fast it is. To load a ROM, you have to drag the ROM on top of the binary. I don't know if it will work if the filename+path has spaces in it or not, so avoid that to be safe. The big news is that there's both a 32-bit and 64-bit binary included, although neither are profiled because I really don't have enough of a GUI up to profile anyway. Windows uses: Direct3D + XAudio2 + RawInput - get the latest DX SDK for XAudio2 to work Linux uses: OpenGL + ALSA + SDL You will have to compile yourself to change these driver settings. For some reason, the 64-bit binary sometimes crashes on start, maybe 1:6 times. So just keep trying. I don't know what's up with that, I'd appreciate if someone here wanted to debug that for me though :D One really good bit of news, there was that old hiro bug where keyboard input would cause the main window to beep. I spied on the main event loop and, as suspected, the status bar was getting focus and rejecting key presses. What. The. Fuck. Why would a status bar ever need focus? So I set WM_DISABLED on it, which luckily leaves the font color alone. I also had to use WM_DISABLED on the Viewport widget that I use for video output. These two combined let me have my main window with no keyboard beeping AND allow tab+shift-tab to work as you'd expect on other windows, so hooray. Now, at the moment there's no Manifest included, because Microsoft for some reason includes the processorArcitecture in the file. So I can't use the same manifest for 32-bit and 64-bit mode, or the binary will crash on one or the other. Fuck. So the status bar may look old-school or something, whatever, it's only temporary. Next up, my goal is to avoid the hiro icon corruption bullshit by making phoenix itself try and use an internal resource icon. So just compile your app with that resource icon and voila, perfect icon. Not in there yet so you get the white box. Input is hard-coded, up/down/left/right/z/x/a/s/d/c/apostrophe/return. Lastly, compilation is ... in a serious state of flux. The code is set to compile bsnes/phoenix-gtk right now. Try it at your own risk. Give me a few WIPs to get everything nice and refined. Ubuntu users will need gcc-4.5, which you can get by adding the Maverick Meerkat repository, updating apt, installing the gcc-4.5 + g++-4.5 packages, and then removing and re-updating your apt/sources.list file so you don't end up fucking your whole system when you run apt again in the future. For anyone who can work with all of that, great! Please post a framerate comparison between 32-bit and 64-bit builds. Any game, any screen, so long as the FPS is not fluctuating when you measure it (eg don't do it during an attract sequence.) If anyone complains about the 64-bit binary not working and it turns out they are on 32-bit Windows, they are going to be removed from this WIP forum :P ________________________________________________________________________________ 2010-09-09 - bsnes_v068r17.tar.bz2 This hopefully fixes vertical and horizontal mosaic with the accurate S-PPU core. It also adds frame-skipping support to the compatibility and performance S-PPU cores. This is not visible to the user interface, because I feel that virtually nobody is going to play with frame-skipping on when they could use a faster emulation with it off. However, I did use it to enhance the 'Fast Forward' key. When you press it, it will now turn off video and audio sync, and set a frameskip of 9. This allows you to speed things up an additional ~60% over your max theoretical speed without frameskipping. ~35% with the compatible core, because the PPU is less of a bottleneck for it. Slowdown was improved, it will turn on audio sync if it is off until you release the key to ensure you actually get 30fps. Eventually it'd probably be wise to set a cap on the fast forward speed, but I hardly think it's an issue on today's computers. Image Performance core, normal Image Performance core, fast forward key held down Now if only we can increase that speed by another ten times ... perhaps Der Langrisser will be tolerable :) ________________________________________________________________________________ 2010-09-08 - bsnes_v068r16.tar.bz2 Non-profiled Windows compatibility binary is included. Testing this one and all the new features would be appreciated. New features? Image ________________________________________________________________________________ 2010-09-06 - bsnes_v068r15.tar.bz2 This adds a new "Effect Toggle" window to the tools tab list. There's no menu entry for it yet, oversight, but you can go to another tool and tab to it. The effect toggle window lets you toggle background/OAM layers on a per-priority basis and DSP sound channels. This only works with the compatibility and performance cores, because I'm not going to allow accuracy-violating hacks like that into the core. Non-essential icons have been removed, there's six of them left at the moment. I am too much of a consistency guy to only have some scattered around. I know other apps do that, but I'm not going to do that, and I grow tired of trying to hammer in icons that don't really represent the actions. Anyway, it still looks pretty good I think. ________________________________________________________________________________ 2010-09-06 - bsnes_v068r14.tar.bz2 Holy hell, that was a total brain twister. After hours of crazy bit twiddling and debug printf's, I finally figured out how to allow both lores and hires scrolling in the accurate PPU renderer. In the process, I modified the main loop to run from -7 to 255, regardless of the hires setting, and perform X adjustment inside the tile fetching. This fixed a strange main/subscreen misalignment issue, so I was able to restore the proper sub-then-main rendering for the final screen output stage. Code looks a good bit cleaner this way overall. I also added load state and save state menus to the tools menu, so you can use the menubar to load and save to ten slots. I am thinking that I should nuke the icons. As pretty as they are, it's getting tiresome trying to find icons for everything, I have no pictures to represent loading or saving a slot, nor to represent individual slots. I'll just stick to radios and checkboxes. ________________________________________________________________________________ 2010-09-04 - bsnes_v068r13.tar.bz2 Bug-fix night for the new PPUs. Accuracy: Fixed BG palette clamping, which fixes Taz-Mania. Added blocking for CGRAM writes during active display, to match the compatibility core. It really should override to the last fetched palette color, I'll probably try that out soon enough. Performance: Mosaic should match the other renderers. Unfortunately, as suspected, it murders speed. 290->275fps. It's now only 11fps faster, hardly worth it at all. But the old rendering code is really awful, so maybe it's for the best it gets refreshed. It's really tough to understand why this is such a performance hit, it's just a decrement+compare check four times per pixel. But yeah, it hits it really, really hard. Fixed a missing check in Mode4 offset-per-tile, fixes vertical alignment of a test image in the SNES Test Program. ________________________________________________________________________________ 2010-09-04 - bsnes_v068r12.tar.bz2 This took ten hours of mind boggling insanity to pull off. It upgrades the S-PPU dot-based renderer to fetch one tile, and then output all of its pixels before fetching again. It sounds easy enough, but it's insanely difficult. I ended up taking one small shortcut, in that rather than fetch at -7, I fetch at the first instance where a tile is needed to plot to x=0. So if you have {-3 to +4 } as a tile, it fetches at -3. That won't work so well on hardware, if two BGs fetch at the same X offset, they won't have time. I have had no luck staggering the reads at BG1=-7, BG3=-5, etc. While I can shift and fetch just fine, what happens is that when a new tile is fetched in, that gives a new palette, priority, etc; and this ends up happening between two tiles which results in the right-most edges of the screen ending up with the wrong colors and such. Offset-per-tile is cheap as always. Although looking at it, I'm not sure how BG3 could pre-fetch, especially with the way one or two OPT modes can fetch two tiles. There's no magic in Hoffset caching yet, so the SMW1 pixel issue is still there. Mode 7 got a bugfix, it was off-by-one horizontally from the mosaic code. After re-designing the BG mosaic, I ended up needing a separate mosaic for Mode7, and in the process I fixed that bug. The obvious change is that the Chrono Trigger Mode7->Mode2 transition doesn't cause the pendulum to jump anymore. Windows were simplified just a tad. The range testing is shared for all modes now. Ironically, it's a bit slower, but I'll take less code over more speed for the accuracy core. Speaking of speed, because there's so much less calculations per pixel for BGs, performance for the entire emulator has gone up by 30% in the accuracy core. Pretty neat overall, I can maintain 60fps in all but, yeah you can guess can't you? ________________________________________________________________________________ 2010-09-02 - bsnes_v068r10.tar.bz2 It is feature-complete, but horizontal mosaic is less accurate. I have an idea for a mosaic color ring buffer to get it equally accurate, but I haven't implemented it yet. For now it's just a simple x & ~(mosaic >> 1) trick that is passable. Hires blending was left out, as it's more processor intensive and blargg's NTSC does a better job with that anyway. There's some OPT vertical positioning issues in the SNES Test Program's character test; Goodbye, Anthrox has some sort of fast CPU DMA issue; etc. Total speedup is a mere 13.5%. Not quite the 50% I wanted in the best case, but I'll take what I can get. 254->289fps in Zelda 3 on my E8400 now. There's another 15% hiding with blargg's SMP and 5-10% with blargg's fast DSP, but they lose too much accuracy. It'd put me at or below Snes9X accuracy, while still being 50% slower. SSE2 was performing worse this time, both on x86 and amd64, so I left that optimization off. So, barring a miracle, this is about the best it's going to get. ________________________________________________________________________________ 2010-09-02 - bsnes_v068r07 Added hires and interlace support, fixed a color bug with CGRAM high-byte writes, added offset-per-tile mode, and added support for OAM color exemptions. What I did to avoid overhead was store different source layer IDs for OAM pixels with palettes 128-191 and 192-255. Sadly that's still 256 computations a scanline, but it's not horrible and is absolutely needed. Really the only major things left are mosaic and Mode 7. One minor thing would be direct color mode. I have some crazy ideas for light-adjusted CGRAM table caching, etc. so I'm hoping I can make up the speed penalty of implementing the above. ________________________________________________________________________________ 2010-09-01 - bsnes_v068r08.tar.bz2 Windows performance binary included, uses PGO and SSE2 optimizations. This gets the basic new PPU skeleton up and running, still missing a lot: - Mode7 - direct color mode - OAM color exemption (this one will impact performance negatively) - vertical mosaic - horizontal mosaic (this one may impact performance negatively) - offset per tile - interlace - hires - pseudo-hires But it's correct enough to play most games okay. So far, the new PPU is about 11% faster on my Atom, and 17% faster on my E8400. I was hoping for more, but the window masking and sprite calculation is just kicking my ass. The 11/17 figure is total emulator overhead, so that means raw PPU vs PPU, the new one is at least 22-34% faster than the old one. I don't really have any ideas for additional optimizations. I'm even using little-endian word reads where applicable. But at any rate, I need to get all the above implemented correctly before trying to push optimizations even further. ________________________________________________________________________________ 2010-09-01 - bsnes_v068r07 New PPU renderer is coming along. Lots of new ideas, especially with regards to the way the background renders in tiles rather than in pixels. That skips the need for tile caching and compares, and it even gets scrolling right. The sprite item+tile lists are computing, but they are not rendering yet. It's a good deal faster for now, obviously, because 90% of the PPU features are missing. ________________________________________________________________________________ 2010-08-30 - bsnes_v068r05.tar.bz2 Started over again on the new S-PPU, heh. Three hours wasted last night I guess. I wanted to make the new one more like the accurate core in its structure: multiple class instances for each background. It makes the code easier to read, results in less structure insanity (regs.main_enabled[bg] -> main_enabled), and will probably make it a tad easier to parallelize if we want to go that route eg for the ARM. Still very incomplete. ________________________________________________________________________________ 2010-08-30 - bsnes_v068r04.tar.bz2 This should provide hardware-accurate mosaic support in the accurate renderer, with the exception that I'm still not sure what mid-frame vertical mosaic or mid-scanline horizontal mosaic writes do. Either the code I have is correct, or it bypasses the mosaic adjust and gives the exact H/V positions. I've also renamed the fast folder to alternative (thinking about naming it simply alt instead), and started on a brand new PPU renderer. So far it's just a barebones setup with some MMIO support and VRAM/OAM/CGRAM writing. I'm not even confident that I can get this to be faster than the current scanline renderer, but it's the only avenue that we have left for any kind of significant bsnes speedup, so I have to try. I'm going to finish up the MMIO stuff first, that way we have a clean slate with no actual rendering. And then from here we can try various different approaches. ________________________________________________________________________________ 2010-08-28 - bsnes_v068r02.tar.bz2 test_mode7.tar.bz2 This adds mosaic improvements to the S-PPU dot renderer. Specifically, it eliminates the mosaic_table entirely, and performs mosaic adjustment per pixel instead. It also moves from a mosaic countdown for mosaic Y to a mosaic counter (incrementing). In the process, I realized Sim Earth's map was broken, so I fixed that. In doing so, I also fixed my old Mode7 demo that was always off-by-one, causing different results on real hardware versus emulation. But then I broke both Final Fantasy 5 and Air Strike Patrol effects that use Mode7 but no mosaic. I'm not really sure what's going on, but I think I am close. This is the first time I can reproduce the Mode7 test ROM results without screwing with M7Y which was obviously wrong. I think that somehow a mosaic >= 1 is glitching the Ycounter for the BG layers to tick one extra time. There's a workaround that's not very nice to get everything going right now. It could very well be that the workaround is hardware accurate, but I can't help but feel there's a more eloquent way of doing this. ________________________________________________________________________________ 2010-08-20 - bsnes_v068r01.tar.bz2 This adds RTS/CTS support to the serial communications emulation. Okay, well the PC acts as if it is always ready, because it always is even on the real thing, but the PC-waiting-for-SNES side works. Source only, hardware communication only works on OS X and Linux (Windows serial communication is totally different, I don't feel like writing a Windows version), more documentation will come later. ________________________________________________________________________________ 2010-08-21 - bsnes_v068 This release officially introduces the accuracy and performance cores, alongside the previously-existing compatibility core. The accuracy core allows the most accurate SNES emulation ever seen, with every last processor running at the lowest possible clock synchronization level. The performance core allows slower computers the chance to finally use bsnes. It is capable of attaining 60fps in standard games even on an entry-level Intel Atom processor, commonly found in netbooks. The accuracy core is absolutely not meant for casual gaming at all. It is meant solely for getting as close to 100% perfection as possible, no matter the cost to speed. It should only be used for testing, development or debugging. The compatibility core is identical to bsnes v067 and earlier, but is now roughly 10% faster. This is the default and recommended core for casual gaming. The performance core contains an entirely new S-CPU core, with range-tested IRQs; and uses blargg's heavily-optimized S-DSP core directly. Although there are very minor accuracy tradeoffs to increase speed, I am confident that the performance core is still more accurate and compatible than any other SNES emulator. The S-CPU, S-SMP, S-DSP, SuperFX and SA-1 processors are all clock-based, just as in the accuracy and compatibility cores; and as always, there are zero game-specific hacks. Its compatibility is still well above 99%, running even the most challenging games flawlessly. If you have held off from using bsnes in the past due to its system requirements, please give the performance core a try. I think you will be impressed. I'm also not finished: I believe performance can be increased even further. I would also strongly suggest Windows Vista and Windows 7 users to take advantage of the new XAudio2 driver by OV2. Not only does it give you a performance boost, it also lowers latency and provides better sound by way of skipping an API emulation layer. Changelog: * Split core into three profiles: accuracy, compatibility and performance * Accuracy core now takes advantage of variable-bitlength integers (eg uint24_t) * Performance core uses a new S-CPU core, written from scratch for speed * Performance core uses blargg's snes_dsp library for S-DSP emulation * Binaries are now compiled using GCC 4.5 * Added a workaround in the SA-1 core for a bug in GCC 4.5+ * The clock-based S-PPU renderer has greatly improved OAM emulation; fixing Winter Gold and Megalomania rendering issues * Corrected pseudo-hires color math in the clock-based S-PPU renderer; fixing Super Buster Bros backgrounds * Fixed a clamping bug in the Cx4 16-bit triangle operation [Jonas Quinn]; fixing Mega Man X2 "gained weapon" star background effect * Updated video renderer to properly handle mixed-resolution screens with interlace enabled; fixing Air Strike Patrol level briefing screen * Added mightymo's 2010-08-19 cheat code pack * Windows port: added XAudio2 output support [OV2] * Source: major code restructuring; virtual base classes for processor cores removed, build system heavily modified, etc. ________________________________________________________________________________ 2010-08-20 - bsnes_v067r26.tar.bz2 Okay, I'm pretty much ready to release the next version, so heavy testing on this would be appreciated. To test the debugger (built with the compatibility core for moderate speed and PPU debugging support), rename the DLL to an EXE. bsnes_v067r26.tar.bz2 I think I'd rather play it safe though and go with v068. While the performance core is definitely major, I only have one shot at v1.0. It would at least be nice to have perfect mapping and the BGnxOFS caching for SMW1 in there first. Anyway, changelog: Re-added blargg's DSP, but this time I merged only spc_dsp and also fixed the initial regs for Dual Orb II. Which restores the 5-10% speedup on the compatibility and performance cores. Fixed the initial register values for the fast CPU core, which fixes Armored Police and the other Atlus game's title screen in the performance core. Added a missing debugvirtual prefix to op_step, which fixes CPU stepping in the performance core. I was using the description field for profile identification in savestates, but that was of course the description for the state manager. Whoops. Added a new field for profile name to the save states, and fixed the state manager to work with that change. Adjusted the about screen colors, which is how you can tell which core you're using without it being annoying. Probably did some other stuff too, meh. ________________________________________________________________________________ 2010-08-19 - bsnes_v067r25.tar.bz2 Removed snes_spc, and the fast/smp + fast/dsp wrappers around it. Cloned dsp to fast/dsp, and re-added the state machine, affects Compatibility and Performance cores. Added debugger support to fast/cpu, with full properties list and Qt debugger functionality. Rewrote all debugger property functions to return data directly: - this avoids some annoying conflicts where ChipDebugger::foo() overshadows Chip::foo() - this removes the need for an extra 20-200 functions per debugger core - this makes the overall code size a good bit smaller - this currently makes PPU::oam_basesize() inaccessible, so the OAM viewer will show wrong sprite sizes Used an evil trick to simplify MMIO read/write address decoding: - MMIO *mmio[0x8000], where only 0x2000-5fff are used, allows direct indexing without -0x2000 adjust So end result: both save states and debugger support work on all three cores now. Dual Orb II sound is fixed. The speed hit was worse than I thought, -7% for compatibility, and -10% for performance. At this point, the compatibility core is the exact same code and speed as v067 official, and the performance core is now only ~36-40% faster than the compatibility core. Sigh, so much for my dream of using this on my netbook. At 53fps average now, compared to 39fps before. Profiling will only get that to ~58fps, and that's way too low for the more intensive scenes (Zelda 3 rain, CT black omen, etc.) It would probably be a good idea to find out why my DSP is so much slower than blargg's, given that it's based upon the same code. The simple ring buffer stuff can't possibly slow things down that much. More precisely, it would probably be best to leave blargg's DSP in the performance core since it's a pretty minor issue, but then I'd have to have three DSPs: accuracy=threaded, compatibility=state-machine, performance=blargg. Too much hassle. Only code in the core emulator now that wasn't at the very least rewritten for bsnes would be the DSP-3 and DSP-4 modules, which are really, really lazily done #define hacks around the original C code. ________________________________________________________________________________ 2010-08-18 - bsnes_v067r24.tar.bz2 Windows binaries and source included Fixed bsnes launcher on Windows XP Fixed Windows bsnes launcher internationalization support (emulator can be in a folder with spaces and Japanese characters, and you can drag a Japanese file name onto the launcher, and it will load it properly) Moved fast CPU to use a switch table for MMIO, unfortunately for no speed gain Bus::read/write take uint24 parameters for address, luckily no speed penalty MMIOAccess gained a handle() function, and hid the mmio[] table. Makes hooking it cleaner Added malloc.h header to nall/function.hpp to fix a ridiculous GCC 4.5.0 error Fixed a fairly large bug in the fast CPU IRQ handler, which fixes Robocop et al Forgot to bump revision to .24 in the compiled binaries, too lazy to recompile or hex edit to change them Unfortunately, in order to add nice battery usage, I have to add the sleep calls to the video and audio wait loops. But they don't know anything about the GUI and its settings, nor do I really want to make them know about this setting. I do not want to force allow it. Even with the media timer trick, Sleep(0) makes Vsync+Async fail a lot more frequently than never sleeping at all. I would rather laptop users suffer 100% utilization of a single core than for all users to not be able to get good audio+video sync. Not sure what to do about that, so I'll probably just remove the battery usage comment from performance mode for now. ________________________________________________________________________________ 2010-08-16 - bsnes_v067r23.tar.bz2 Source only, previous link with Windows binaries is still valid for now. Added missing $4200 IRQ lock, which fixes Chou Aniki on the fast CPU core, so slower PCs can get their brotherly love on. Added range-based controller IOBit latching to the fast CPU core, which enables Super Scope and Justifier support. Uses the priority queue as well, so there is zero speed-hit. Given the way range-testing works, the trigger point may vary by 1-2 pixels when firing at the same spot. Not really a big deal when it avoids a massive speed penalty. Fixed PAL and interlace-mode HVIRQs at V=0,H<2 on the fast CPU core. Added the dot-renderer's sprite list update-on-OAM-write functionality to the scanline-based PPU renderer. Unfortunately it looks like all the speed gain was already taken from the global dirty flag I was using before, but this certainly won't hurt speed any, so whatever. Added #ifdef to stop CoInitialize(0) on non-Windows ports. Added #ifdefs to stop gradient fade on Windows port. Not going to fuck over the Linux port aesthetic because of Qt bug #47,326,927. If there's a way to tell what Qt theme is being used, I can leave it enabled for XP/Vista themes. Moved HDMA trigger from 1104 to 1112, and reduced channel overhead from 24 to 16, to better simulate one-cycle DMA->CPU sync. Code clarity: I've re-added my varint.hpp classes, and am actively using them in the accuracy cores. So far, I haven't done anything that would detriment speed, but it is certainly cool. The APU ports exposed by the CPU and SMP now take uint2 address arguments, the CPU WRAM address register is a uint17, and the IRQ H/VTIME values are uint10. This basically allows the source to clearly convey the data sizes, and eliminates the need to manually mask values when writing to registers or reading from memory. I'm going to be doing this everywhere, and it will have a speed impact eventually, because the automation means we can't skip masks when we know the data is already masked off. Source: archive contains the launcher code, so that I can look into why it's crashing on XP tomorrow. It doesn't look like Circuit USA's flags are going to work too well with this new CPU core. Still not sure what the hell Robocop vs The Terminator is doing, I'll read through the mega SNES thread for clues tomorrow. Speedy Gonzales is definitely broken, as modifying the MDR was breaking things with my current core. Probably because the new CPU core doesn't wait for a cycle edge to trigger. I was thinking that perhaps we could keep some form of cheat codes list to work as game-specific hacks for the performance core. Keeps the hacks out of the emulator, but could allow the remaining bugs to be worked around for people who have no choice but to use the performance core. ________________________________________________________________________________ 2010-08-16 - bsnes_v067r22.tar.bz2 Added OV2's XAudio2 driver (it's better and faster than the DirectSound one) Fixed DirectInput keypad number codes Added launcher to make the profiles work Profiles now called: Accuracy, Compatibility, Performance (not debating names anymore) The launcher isn't going to work on OS X because of the .app folder bullshit (yes, yes, .sfc folders.) It also crashes on Windows XP for god only knows what reason. Works fine on Windows 7 and Linux. So XP users, rename the .dll files to .exe to test this release. I'll fix it on Monday. The color highlighting fucks up the radio boxes on the Windows classic theme, because Nokia can't afford a god damn QA team. Lastly, I forgot to add launcher to the make archive-all command, so the source for it will be in the next WIP. ________________________________________________________________________________ 2010-08-14 - bsnes_v067r21.tar.bz2 This moves toward a profile-selection mode. Right now, it is incomplete. There are three binaries, one for each profile. The GUI selection doesn't actually do anything yet. There will be a launcher in a future release that loads each profile's respective binary. I reverted away from blargg's SMP library for the time being, in favor of my own. This will fix most of the csnes/bsnes-performance bugs. This causes a 10% speed hit on 64-bit platforms, and a 15% speed hit on 32-bit platforms. I hope to be able to regain that speed in the future, I may also experiment with creating my own fast-SMP core which drops bus hold delays and TEST register support (never used by anything, ever.) Save states now work in all three cores, but they are not cross-compatible. The profile name is stored in the description field of the save states, and it won't load a state if the profile name doesn't match. The debugger only works on the research target for now. Give it time and it will return for the other targets. Other than that, let's please resume testing on all three once again. See how far we get this time :) I can confirm the following games have issues on the performance profile: - Armored Police Metal Jacket (minor logo flickering, not a big deal) - Chou Aniki (won't start, so obviously unplayable) - Robocop vs The Terminator (major in-game flickering, unplayable) Anyone still have that gigantic bsnes thread archive from the ZSNES forum? Maybe I posted about how to fix those two broken games in there, heh. I really want to release this as v1.0, but my better judgment says we need to give it another week. Damn. ________________________________________________________________________________ 2010-08-13 - bsnes-20100813.tar.bz2 Since we're now talking about three splits, that's getting a bit out of hand. This WIP combines everything back into one project again. Added the src/fast folder that has all the speed-oriented cores. A slight slowdown to csnes from what it was before, I'm using blargg's accurate DSP. I just don't like the idea of releasing a less accurate DSP core than Snes9X v1.52 has. Plus the fast DSP core doesn't serialize yet. I moved back to snes_spc 0.9.0 because I care more about Tales and Star Ocean than I do about Earthworm Jim 2. So if you try EWJ2 on csnes, expect it to sound like it does on Snes9X. In other words, don't wear headphones if you value your hearing. The middle-of-the-road bsnes core uses blargg's accurate DSP, because it's about 3% faster than mine which removes all of blargg's optimizations. There is absolutely no accuracy loss here. bsnes v067.20 that is included should be equal to v067 official. Performance: Code: asnes = 58fps bsnes = 172fps +2.97x csnes = 274fps +1.59x +4.72x The binaries are not profiled, so that's an additional 15% slower from the previous builds. Save states only work on asnes, as I don't know how to serialize blargg's cores yet. The copy_func thing is very confusing to me for some reason. The debugger won't work anywhere. Outside of that, please go ahead and bug test. Once I get the debugger and save states working, I'll build some profiled v1.0 releases for all three, and we can test that for a bit and then release. ________________________________________________________________________________ 2010-08-11 - snes-20100811.tar.bz2 12-15% faster than v067.10, and my Atom never goes below 58fps for normal lo-res games at this point. Just a little more and I can leave Async on. That's pretty much it though for the low hanging fruit. Everything else will be a lot of work for a little gain. Speedups are from range testing across scanline boundaries and from using blargg's fast DSP core. Snes9X is now only 1.93x faster than bsnes, and bsnes is now faster than Super Sleuth. I also fixed the Circuit USA menus (HDMA timing adjustment), Wild Guns flickering (IRQ lock) and Jumpin' Derby (external IRQ triggering.) There's definitely a lot of troublesome games, mostly the same ones we had in the past (Koushien 2, Robocop vs The Terminator, etc.) I'm definitely going to debug Starfox, but I may not bother with some of the more obscure ones. EDIT: Starfox 1.2 runs fine on this PC ... weird. ________________________________________________________________________________ 2010-08-10 - snes-20100810-2.tar.bz2 I wrote a new CPU core from scratch. It has range-based IRQs, and is good enough even to run F-1 Grand Prix and Sink or Swim. It also uses a binary min-heap array for the timing priority queue. This resulted in a ~40% speedup. I also added in blargg's snes_spc library, which is an S-SMP + S-DSP emulator. I am still using his accurate DSP core, and not the fast one. This gives an additional ~10% speedup. THIS IS NOT PERFECT, THERE WILL BE BUGS! I already know that Tales of Phantasia and Star Ocean are hitting some edge cases. Now that it's fast enough, hopefully blargg can take a look at it. Something he couldn't test before because you can't rip SPCs of these games, so it's probably something simple. My CPU core also doesn't nail every last possible edge case. So things like Wild Guns and the two or three games that rely on NMI/IRQ hold aren't going to work ... yet. Be patient. The SuperFX and SA-1 cores are still cycle-accurate. It wouldn't hurt compatibility to reduce their precision a bit. End result is that you can now get well over 60fps in normal games even on a first-generation Intel Atom. snes-20100810-2.tar.bz2 Windows profiled binary is in out/bsnes.exe. ________________________________________________________________________________ 2010-08-09 - snes-20100809.tar.bz2 Code cleanups, no binaries. I'll leave the previous WIP up so you can get Windows binaries for now. This adds some sync.sh improvements to make it handle errors more gracefully. It also updates asnes a good bit. All of the four base processors now have all publicly accessible functions right at the top of the main headers, and everything else is private. This is to allow these headers to essentially take the place of the previous base classes in the old bsnes-merged format. So if there's something public there, you need to implement that exact function to make your own module. I removed the frame counter from the PPU, as it has nothing to do with emulation. That now resides inside the Qt -> SNES interface code. Quite amazing, I was actually saving the frame counter into the save state files before, yuck. Removed some baggage in the System class: it was friending a bunch of long-dead functions and classes. Forgot to re-add the CHEAT_SYSTEM define to info.hpp, so that's been put back. Need to think of something to do about the documentation and about screen, kind of silly for asnes to display bsnes in certain areas. I'll also play around with tar --transform sometime tomorrow, no promises on whether or not I'll use it. ________________________________________________________________________________ 2010-08-08 - snes-20100808.tar.bz2 This fixes libsnes and debugger builds, and collapses bsnes/ppu/bppu to bsnes/ppu and bsnes/dsp/sdsp to bsnes/dsp. It also introduces bsnes/sync.sh, which will synchronize all of asnes/ with bsnes/, excepting the custom speed-focused modules. So far, that's bsnes/ppu (scanline renderer) and bsnes/dsp (state machine.) Should make keeping the two ports in sync much, much easier. It's basically the same thing as before, only you run sync.sh and have a few duplicated folders now. May make it clearer by creating a stub/ or src/ folder inside bsnes to do all of the copying, so that you only see the custom folders in bsnes/' root directory. There are binaries for asnes and bsnes in the above archive. I would appreciate testing, especially on the new bsnes.exe in this archive. I'd like to make the v1.0 releases, but I really, really need to wait and have that one tested. I do not want v1.0 to be a buggy, broken release. ________________________________________________________________________________ 2010-08-07 - snes-20100807.tar.bz2 This represents a major code restructuring. The dot-based and scanline-based renderers are now split into two separate core libraries, asnes and bsnes. For now at least, these are -internal- names. I'm not entirely decided on how I'm going to handle releasing these two separate builds. Regardless, the folders need names. asnes has had all of the processor subfolders collapsed back into their parent folders. In other words, ppu's functions were moved into ppu/sppu, and then ppu was deleted, and then ppu/sppu became the new ppu. Repeat this for the cpu, smp and dsp and there you go. asnes/dsp also removed the DSP_STATE_MACHINE option. This was done for the sake of consistency with the rest of the core. asnes' debugger mode is currently extremely broken, but I will be fixing it in time. And for now, bsnes has kept the processor abstraction layer. I may keep it around, not sure yet. It doesn't hurt speed or anything, so I'm not too worried about making a decision right away. I may throw snesfilter, snesreader and supergameboy into this folder, just to have everything in one place. The alternate GUI forks are definitely going in there as dotnet, cocoa and python. Compiled output goes to the out/ folder now, to prevent conflicts with a file and folder named bsnes, for instance. ________________________________________________________________________________ 2010-08-07 - v067r05 (Windows binary + source) This will be the final release with the current source structure. This WIP contains a bugfix so that the last scanline does not fetch OAM items. This fixes flickering in Ninja Warriors and Lord of the Rings. ________________________________________________________________________________ 2010-08-06 - v067r04 (Windows binary [sPPU] + source) This build simplifies the tile cache significantly, and it now builds the cache and fetches the VRAM data during Hblank, the VRAM reads are modeled after real hardware. This fixes Mega lo Mania without regressing Winter Gold or Adventures of Dr. Franken. I also fixed a pseudo-hires back color glitch in Super Buster Bros. ________________________________________________________________________________ 2010-08-05 - v067r03 (Windows binary [sPPU] + source) This substantially improves the S-PPU dot-renderer's sprite processing. Instead of happening immediately at the start of the scanline, each pixel is rendered one at a time. It eliminates the SpriteList caching, sprite width/height caching, oam_palette caching and oam_priority caching. I'll explain it in more detail in the public thread in a bit. Most noticeable is that Winter Olympics is now perfect, with no known regressions on any of the sprite-sensitive games. ________________________________________________________________________________ 2010-08-04 - v067r01 (source code) v067r01 (64-bit Windows binary, profiled with MinGW GCC 4.5.0) v067-dotnet v067-snowleopard This adds the SA-1 compiler bug workaround for GCC 4.5.0, and updates the load special libsnes functions to also generate XML mapping data if given empty strings. I built the binary above with GCC 4.5.0, so let me know if any new problems appear. What I've noticed is that when not profiled, 4.5.0 is about 3-5% faster, but when profiled, they are equivalent in speed. Lastly, I did some more work on the .NET/C# and Snow Leopard/Cocoa ports. They can both load all special types of ROMs, including Super Game Boy. For .NET, you need to be on a 64-bit version of Windows, have .NET 3.5 installed, and have SlimDX installed (I used February 2010, but anything later should be fine.) For Snow Leopard, you may want to build and install libsupergameboy, but you don't have to. Just don't try loading SGB games without it. Yes, the .NET one is pure 64-bit. I built snes.dll and supergameboy.dll using MinGW64-GCC 4.5.0. Since the core library doesn't use Qt, it builds fine in 64-bit mode. ________________________________________________________________________________ 2010-08-01 - v067 I apologize, bsnes v066 had a small error in the source that resulted in the PPU not synchronizing properly to the CPU. This bug was not exposed in the images I use to test releases. I have also updated the cheat code database, which is maintained by mightymo. ________________________________________________________________________________ 2010-07-31 - v066 Major features in this release are: serial controller emulation, a brand new scheduler that supports multiple simultaneous coprocessors, and accuracy improvements. The serial controller is something devised by blargg. With the proper voltage adjustments (5v-9v), it is possible to wire an SNES controller to a serial port, which can then be used for bidirectional communication between the SNES, and (usually, but not only) a PC. The support in bsnes was added so that such programs could be debugged and ran from within an emulator, and not just on real hardware. The scheduler rewrite was meant to allow the combination of coprocessors. It was specifically meant to allow the serial controller thread to run alongside the SuperFX and SA-1 coprocessor threads, but it also allows fun things like MSU1 support in SuperFX and SA-1 games, and even creating dev cartridges that utilize both the SuperFX and SA-1 at the same time. The one thing not yet allowed is running multiple instances of the exact same coprocessor at the same time, as this is due to design constraints favoring code inlining. There are two important accuracy updates. The first is that when PAL video mode is used without being in overscan mode, black bars are shown. Emulators have always shown this black bar at the bottom of the screen, but this is actually incorrect. resxto took pictures from his PAL TV that shows the image is in fact vertically centered in the screen. bsnes has been updated to reflect this. Also interesting is that I have backported some code from the dot-based PPU renderer. In the game Uniracers, it writes to OAM during Hblank, and expects the write to go to a specific address. In previous releases, that address was hard-coded to go to the required memory location. But the way the hardware really works is that the write goes to the extended attribute address for the last sprite that the PPU fetched, as the PPU is still asserting the OAM address bus. Now, due to the precision limitations, I was not able to also port timing access during the active display period. However, this is sufficient to at least remove the last global hack from the older, speed-focused scanline renderer. ________________________________________________________________________________ 2010-07-29 - v065r05 Fairly major changes here, I'd appreciate some testing if anyone's not busy. Note that the save state version has been bumped, so consider WIP saves unstable until v066 official. Rewrote the entire scheduling system. Instead of having a global class that all of the chips call into, each class now contains its own thread, clock and frequency information. They also implement their own syncing primitives, but with a tiny bit of standardization. void step(unsigned clocks) -- add to/subtract from counter based on master/slave select. void synchronize_chip() -- make sure chip is caught up to our current thread before continuing. So we go from scheduler.sync_copcpu() to sa1.synchronize_cpu(); with the sa1. being omitted inside the SA1 class itself. The S-CPU implementation also adds an array coprocessors; list, and iterates them all. This allows bsnes to have an infinite number of additional coprocessors at the same time. But there is still the limitation of only one of each type. So you can use the XML memory mapping to make a cartridge that contains a SuperFX2 chip, an SA-1 chip, an MSU1 chip and that can be debugged via serial communications. However, you can't make a cart that has two SA-1 chips. That limitation probably could be overcome as well, but it's less important. I mainly wanted to be able to use MSU1 and Serial on special chip games. I implemented the synchronization primitives in the chip base classes, which means that for inlining purposes I had to make it all global, so you'll have src/cpu/synchronization.hpp, etc now. This was to reduce some redundancy of having the same exact code inside both bPPU and sPPU, etc. I'll probably make a Coprocessor : Processor class to automatically implement the step+synchronize_cpu functions for the five coprocessors next. The Scheduler class is actually still around, but it's very trivial now. It simply saves the program thread and last active emulation thread for the purpose of entering and exiting emulation. Because I killed Scheduler::init(), which was responsible for destroying and re-creating threads, I had to create the threads inside ChipName::create(), which I call at power and reset. This means that to load a save state, the system needs to be reset to destroy those threads. This caused some troubles with the SA-1, specifically in Kirby's Dreamland 3, but no other games I tried. I had to move the SA-1 bus initialization to the power-on event, and only reset when loading a save state. It would appear that the SA-1 is leaking bus mapping state information, presumably from the SA-1 MMIO registers that control some of the mapping layout. If I add remapping of those sections into the SA1::serialize() function, it should take care of that problem and I can move sa1bus.init() back into SA1::reset(). All of this results in a 2-3% speed hit for normal games, and a 6-7% speed hit for special chip games. The former should not have any speed hit, so I will have to look into what's going on there. The latter we have no choice on, to allow for more than one coprocessor, the coprocessor synchronization needs to iterate a list, compared to a single hard-coded check in the previous builds. If I can figure out what is happening with the regular game speeds, it should drop the special chip hit to 4%. Worst part is this hit is in addition to the 10-15% speed hit from v065 official where I wasn't syncing the special chips up to the CPU except once per scanline and on MMIO accesses. But that's progress. v065 is definitely going to be the preferred build for playing SuperFX/SA-1 games for a long time to come. ________________________________________________________________________________ 2010-07-16 - v065r04 Only posting because the link changed, it's the exact same as r03. Only difference is some improvements to nall: - string class gains lower(), upper(), transform(), *trim(_once) - file::print now accepts variadic arguments like print Examples: Code: strtr(item, "ABCDEF", "abcdef"); -> item.transform("ABCDEF", "abcdef"); strlower(item); -> item.lower(); fp.print(string("Age: ", age, "\n")); -> fp.print("Age: ", age, "\n"); ________________________________________________________________________________ 2010-07-12 - v065r03 Polishing work. My dlopen wrapper accepts an optional path argument now, and the basename setting is universal instead of just for MSU1, so serial-based games can load in a dynamic client library directly. Still need to update snesserver to accept another argument for the program library name to load. Upped the serial polling frequency to 8x UART speed per blargg. And a very tricky change, I updated nall/string to remove sprint(). At first, I used: Code: string name = string() << path << basename << ".msu"; I then improved upon that with: Code: string name = sprint(path, basename, ".msu"); Tonight I went ahead and finished this by taking advantage of variadic templates for the constructor itself. Very tricky because my conversion functions created new strings to copy data into, which would create an infinite loop; then of course I also had to leave the copy constructor behind even after this. So the end result is the following: Code: string name(path, basename, ".msu"); Oh, and I found a typo in MSU1, it wasn't using the proper extension when loading a save state for the data file. ________________________________________________________________________________ 2010-07-11 - v065r02 Be warned, this is going to get complicated. To start out with, serial.tar.bz2 is a simple SNES program that is right now being used for integrity testing. The important part is here: Code: serial_read: lda #$01 -; bit $4017; bne - -; bit $4017; beq - nop #24 pha; lda $4017; eor #$01; ror; pla; ror; nop #18 pha; lda $4017; eor #$01; ror; pla; ror; nop #18 pha; lda $4017; eor #$01; ror; pla; ror; nop #18 pha; lda $4017; eor #$01; ror; pla; ror; nop #18 pha; lda $4017; eor #$01; ror; pla; ror; nop #18 pha; lda $4017; eor #$01; ror; pla; ror; nop #18 pha; lda $4017; eor #$01; ror; pla; ror; nop #18 pha; lda $4017; eor #$01; ror; pla; ror; rts serial_write: pha #6; pla #6; wdm #$00; stz $4016; sec pha #6; pla #6; wdm #$00; sta $4016; ror pha #6; pla #6; wdm #$00; sta $4016; ror pha #6; pla #6; wdm #$00; sta $4016; ror pha #6; pla #6; wdm #$00; sta $4016; ror pha #6; pla #6; wdm #$00; sta $4016; ror pha #6; pla #6; wdm #$00; sta $4016; ror pha #6; pla #6; wdm #$00; sta $4016; ror pha #6; pla #6; wdm #$00; sta $4016; ror pha #6; pla #6; wdm #$00; sta $4016; rts Fairly ugly, but it works. Next, I needed a way to be able to execute the client in such a way that it would work with both bsnes and real hardware, with no recompilation or changes needed. The nice way would be some form of inter-process communication, but well, I don't really do that. And it's probably extremely platform-dependent. So I used what was available to me already, a cross-platform dlopen wrapper for dynamic library support. The client application is written and compiled into a shared library that exports a single function, snesserial_main, which runs as if it is its own program and never returns. It takes three parameters, the time tick(), read() and write() function pointers. It can call them to do its work. This process is put in a folder called snesserial for now. It's the accompanying program to serial.sfc. Now I have both bsnes (v065.02 above) and snesserver, they both act the same way. They load in snesserial, and give it those three functions and call its main entry point. The difference is that the read/write functions in bsnes simulate a serial strobe to the emulator, and the read/write functions in snesserver actually read and write to the TTY device you specify as the program argument, eg for me I use: ./snesserver /dev/ttyUSB0 Mmm, USB<>SNES for the win. There's a limitation in my dlopen wrapper, it adds the libN.so or N.dll stuff automatically, making it difficult to also specify a path. That means that for now you have to put libsnesserial.so into /usr/local/lib. Obviously you don't want to be limited to just one program. The plan is to have it load the library that matches the game name: zelda.sfc + zelda.so/zelda.dll/zelda.dylib (yeah, no libzelda.so.) Now, the bsnes+serial emulation works on any platform. However, snesserver only works on Linux. You can blame that one on Microsoft. They make you require special kernel drivers to be able to access the serial port. I'm not going through the trouble. OS X can probably use it if it makes the appropriate /dev/tty device, but I'm not going to test it. Activating the module can only be done with a custom XML file, as before. Still need to work on integration with the controller port options, as it's not really a special chip. Lastly, the timing is "pretty good", but not perfect. It accepted a 374 cycle-per-bit loop for serial writes from the SNES to the PC, but snesserver did not. I had to adjust to 364 cycle-per-bit loop for it to work on both. This is really bad, because the goal here is to use the PC as the testbed to make sure it'll work on the real thing. On the plus side, you only have to get it working one time, and stick with the serial_read/serial_write functions like at the top of this post. But I do need to address this. I'm not entirely sure how to more accurately simulate a serial port at this point though. Oh, and I am thinking I need to expand the read/write functions to process more than one byte at a time. That should greatly speed up transfer time on the real thing. I also need to add some slowdown so the emulator more closely matches hardware speeds. ________________________________________________________________________________ 2010-07-09 - v065r01 In order to fully decode the 16MB address maps, I am going to need to use blargg's stop-and-swap, which will require a serial-communications program. To develop this program, and others in the future, as well as for testing automation, it would be very beneficial to have a way to debug these programs through bsnes. So what I'm working on now is emulating a serial port inside bsnes. The basic premise is to start with a custom XML map that specifies its presence: Code: I am essentially treating the serial communication as a special chip. One could argue this belongs as an option under controllers, and one would be right. But as I can't have two coprocessor threads at the same time, this is how it is for right now. Eventually it'll probably be under controller port 2, and only enabled in the debugger builds. So, this pseudo-coprocessor ... it's basically emulating the PC-side communications program. Meaning I still need to externalize this somehow so that any program can be run. The below program writes 0x96 six times, and then reads in data six times. Well, technically forever, but the SNES ROM only writes six times at the end. Code: void Serial::enter() { scheduler.clock.cop_freq = cartridge.serial_baud_rate() * 2; latch = 0; add_clocks(512); for(unsigned i = 0; i < 6; i++) { latch = 1; add_clocks(2); latch = 1; add_clocks(2); latch = 0; add_clocks(2); latch = 0; add_clocks(2); latch = 1; add_clocks(2); latch = 0; add_clocks(2); latch = 1; add_clocks(2); latch = 1; add_clocks(2); latch = 0; add_clocks(2); latch = 0; add_clocks(2); } while(true) { while(cpu.joylatch() == 0) add_clocks(1); while(cpu.joylatch() == 1) add_clocks(1); add_clocks(1); uint8 data = 0; for(unsigned i = 0; i < 8; i++) { add_clocks(2); data = (data << 1) | cpu.joylatch(); } print("Read ", strhex<2>(data), "\n"); } } The SNES code looks like this: Code: //21,477,272hz cpu / 57,600hz serial = ~372.87 clocks/tick org $8000 xce; rep #$10 ldx #$01ff; txs jsr serial_read; sta $700000 jsr serial_read; sta $700001 jsr serial_read; sta $700002 jsr serial_read; sta $700003 jsr serial_read; sta $700004 jsr serial_read; sta $700005 nop #46 jsr serial_write jsr serial_write jsr serial_write jsr serial_write jsr serial_write jsr serial_write //hang -; bra - serial_read: -; lda $4017; and #$01; bne - -; lda $4017; and #$01; beq - nop #23; lda $00; nop #10 lda $4017; and #$01; asl $00; ora $00; sta $00; lda $00; nop #13 lda $4017; and #$01; asl $00; ora $00; sta $00; lda $00; nop #13 lda $4017; and #$01; asl $00; ora $00; sta $00; lda $00; nop #13 lda $4017; and #$01; asl $00; ora $00; sta $00; lda $00; nop #13 lda $4017; and #$01; asl $00; ora $00; sta $00; lda $00; nop #13 lda $4017; and #$01; asl $00; ora $00; sta $00; lda $00; nop #13 lda $4017; and #$01; asl $00; ora $00; sta $00; lda $00; nop #13 lda $4017; and #$01; asl $00; ora $00; sta $00; lda $00; nop #13 rts serial_write: lda #$01; sta $4016; nop #23 lda #$00; sta $4016; nop #23 lda #$01; sta $4016; nop #23 lda #$00; sta $4016; nop #23 lda #$00; sta $4016; nop #23 lda #$01; sta $4016; nop #23 lda #$00; sta $4016; nop #23 lda #$01; sta $4016; nop #23 lda #$01; sta $4016; nop #23 lda #$00; sta $4016; nop #23 lda #$01; sta $4016; nop #23 rts That reads six times, and then writes six times. I haven't made the test do an infinite PC->SNES transfer, but I have for SNES->PC. No errors after millions of bytes, even if I stride the CPU timing. As this is just an example, it's pretty lousy with actual timing, but I guess that's a good thing as it still works quite well. More tolerance = less potential for errors. Now, this part is important. While debugging this, I noticed that my serial coprocessor was only running when Vcounter=n,Hcounter=0. In other words, nothing was making the CPU synchronize back to the coprocessor, except the once-per-scanline synchronization that was there in case of CPU stalls. That's ... really bad. MSU1 worked only because it buffers a few hundred samples for audio mixing. I don't really know why this didn't cause an issue for SuperFX, SA-1 or Super Game Boy games; but in theory they were at most 682x less precise than they should have been in terms of CPU->coprocessor synchronization. Making it sync after every add_clocks() call results in a 10% speed hit to SuperFX, SA-1 and Super Game Boy emulation, unfortunately. I don't notice any quality improvements in emulation, but in theory the lack of this syncing before effectively eliminated the benefits of the SuperFX and SA-1 being cycle based. I'm going to have to look into this more to understand if I was intentionally not doing this sync before, or if I really did forget it. I'm thinking it was an oversight right now. The SuperFX and SA-1 don't really talk back and forth a whole hell of a lot, so once a scanline probably wouldn't be that noticeable. But holy hell ... now that I'm thinking about it, I wonder if this was the cause of all that craziness in trying to sync up the Super Game Boy's VRAM transfers. Yeah, definitely need to look into this more ... ________________________________________________________________________________ 2010-06-26 - v065 It's been a while, so here is a new release of bsnes. Unfortunately I don't have a full changelog this time. Most of the work went into stabilizing libsnes (which is used by the experimental .NET, Cocoa and Python UIs; as well as by Richard Bannister's OS X port). The Windows binary package now comes with all three variants included: bsnes.exe, the standard version that casual users should run; bsnes-debugger.exe, for SNES programmers and ROM hackers only; and bsnes-accurate.exe, which should not be used by anybody, ever. In all seriousness, bsnes-accurate.exe is bsnes with the dot-based S-PPU renderer. It's twice as slow as the normal build, and you won't really notice any differences except in Air Strike Patrol. It's there for the curious and for any SNES programmers who want to try making some really awesome video demos. Changelog: * OS X port builds once again; now requires gcc44 from Macports * libsnes API finalized * fixed a bug with S-CPU debugger breakpoints * various source cleanup ________________________________________________________________________________ 2010-04-25 - v064r05 - swaps the video_refresh output from BGR555 to RGB555, for the sake of direct copying for certain APIs. Not going to do RGB565 because the G5 bit doesn't exist, and faking it is lame. bsnesui_2010-04-24.tar.bz2 bsnes.python: - adds more icons and stuff. bsnes.net: - new port, targets C#, binds every function in libsnes - targets .NET 3.5 ... I honestly would have went with 4.0 for the nicer IntPtr addition alone, but the SP3 requirement may put off a lot of people - video output that doesn't scale (or clean up when dropping to a smaller size) - Port1 joypad input support via keyboard only bsnes.cocoa: - stuck in a time/space wormhole until Apple gets their heads out of their asses and updates GCC ________________________________________________________________________________ 2010-04-20 - v064r04 Fixes S-CPU debugger breakpoint issue. libsnes always returns 0 for "no memory present" now, never -1U. bsnes-python-20100420 Won't error if there's no joypad present. Swaps menu and status bars with a toolbar. Adds keyboard support - you can use both a keyboard and joypad for input now. Won't crash if RAM doesn't exist yet. Won't crash if game uses no RAM. ________________________________________________________________________________ 2010-04-19 - v064r03 bsnes-python-20100419 Some changes to libsnes. Really hoping the API will be stable from this point out ... ________________________________________________________________________________ 2010-04-18 - v064r02 Nothing interesting, just added bsnes-qt.py to ui_python. No input handling, but OpenGL-based video resizing and libao audio. Doesn't use numpy, found a workaround for that. It's obvious that we need video/audio/input handled by an external library for this to work, so I'm thinking now about a rewrite of ruby to a C-like interface. ________________________________________________________________________________ 2010-04-16 - v064r01 Adds bool snes_get_region(void) to libsnes (permanent). Adds snes_blit_colortable and snes_blit to libsnes (temporary). Adds src/ui_python with a basic Python GUI, and abstraction between the libsnes wrapper and PyGTK (so it can be reused for PyQt, etc.) The GUI has: - menubar - video output (2x scale, supports NTSC/PAL, hires, overscan and interlace correctly) - audio output (libao through ALSA) - input (very lousy key press events, they toggle off and on if you hold a key down ...) I'm getting full-speed, so that's good. Not sure where I want to take all of this stuff yet, but it's kind of neat for now I suppose. It would be kinda fun to go really out there with completely new GUI design styles that aren't just your standard menubar+video. Things like a toolbar, mouse gestures, really deep platform integration, AVI-based recording, frame analysis shit, game-specific GUI shit (perhaps map touch-screen input + gyroscope on top of a simulated gamepad; or perhaps read the contents of RAM and provide statistical information on the sides of the video output screen?), I dunno ... whatever. It's there, it's possible, but it's certainly not good enough to replace the official C++ Qt port, and I don't really have the time or patience to make it that good myself. ________________________________________________________________________________ 2010-04-14 - v064 A thank you to everyone who helped test the RC to ensure stability. I've uploaded the official v064 release to Google Code. The most important change in this release is the cycle-based PPU renderer; but due to performance reasons the scanline-based renderer remains the default in the Windows binary. If you want to try out the cycle-based renderer, you will need to compile from source for now. Another major change is the introduction of libsnes, which allows one to build bsnes as a shared library that can be used from other programming languages. It is intended both to create a regression testing framework, and to provide API stability for the various projects that use the bsnes core. While I can't guarantee the API to libsnes won't change, I will properly revision it and do everything I can to avoid changing it if possible. ________________________________________________________________________________ 2010-04-13 - v063r14 - libsnes updated ... should be the official syntax now, I don't expect any more changes - added kode54's patch for HQ2x - NOT going to add the libjma Windows Unicode fix, I want something more elegant than hijacking all of std::ifstream, so that can wait for now - fixed status.irq_lock for Power Rangers - went back to blargg's 1.024MHz S-DSP for the fast build - updated mightymo's cheat pack to the latest version ________________________________________________________________________________ 2010-04-14 - v064rc1 I'm posting a release candidate for v064, for which I am looking for beta testers. If you would like to help out, please give it a try and report any bugs or regressions on the forum. If all goes well, this will be posted as v064 official shortly. Note that you will need the Qt run-times from bsnes v063 official to use this. Also, this build does not use the new cycle-based PPU. Official builds are going to continue using the scanline-based renderer. This build should be about 10% faster than v063 was, which should lower the system requirements further. ________________________________________________________________________________ 2010-04-11 - v063r12 Well I really don't want to think about a caching system right now, so I skipped that. - added sPPU::Background::get_tile(), which computes its own copies of mask_xy, screen_xy, tile_size, etc; allows BG3 offset-per-tile to compute tile correctly - fixed two V=(start of Vblank) checks that lacked overscan tests - removed fade stuff from video output, going to rely exclusively on filters for that stuff now - modified state. to t. for brevity - cached regs.overscan for overscan() function - PPUDebugger uses interlace_enable() and overscan_enable() to avoid conflicts with the base classes; forgot to move PPUcounter to PPUCounter - added controller selection capability to libsnes; still needs cheat code and save state support Should fix that Adventure Island thing, confirmation would be appreciated. I tried some quick hacks and was able to get mode7 caching (NHL '94) and OAM caching (Winter Gold) working without breaking anything, but it's too scanline-PPU for my tastes. There's really no reason to half-ass this just to get games playable, so I'll wait and do it the right way later on. Only worked on this for about an hour today ... I must be burned out. Think I'll try messing around with Python or something, since Ruby is a dead-end for using libsnes. ________________________________________________________________________________ 2010-04-09 - v063r11 Writing to SETINI will update video mode priorities for EXTBG mode. Merged pixel output { main, sub { valid, priority } } into just priority. A priority of zero is considered invalid now. Merged pixel output { main, sub { palette_index, palette_number } } into just palette with the tiledata bits for direct color mode at d8-d10. This cuts a lot of copying and extra comparisons out of the final screen rendering pass, though it doesn't really help speed. Output is always 512x448 now. Having trouble deciding on how to do video for that, but I'll post more on that later. Really need to figure out how offset-per-tile fetches in regards to lores v hires and SC size, tile size and wrapping. For now, I simplified it to constants; whereas the scanline-renderer uses the BG3 settings. I also made it not perform OPT lookup on BG3 and BG4 anymore. Skips a pointless trickery of setting the OPT valid bit to zero for BG3,BG4 and is faster. Forgot an overscan check in sprite drawing, should draw sprites properly to V=225-239 now. Made the mode7 variable names more consistent. ________________________________________________________________________________ 2010-04-05 - v063r10 With this release, the final last-generation holdout, the scanline-based PPU renderer, has been replaced with a true, accurate, cycle-level PPU that renders one dot at a time. Finally, this fulfills the greatest milestone remaining in the SNES emulation scene. With every processor emulated at the lowest possible level, SNES emulation finally rivals the accuracy levels that NES emulators have offered for years. Now, please do understand that this release is not a beta, nor is it even an alpha. It is simply a preview of things to come, and as such you can consider it a pre-alpha. There are many caveats at this time. First, it is very slow. More than twice as slow as v063 official. There have been absolutely no optimizations whatsoever to the new dot-based renderer. I do expect to be able to speed this up significantly in future releases. Second, this may lock up on Windows Vista and later for unknown reasons. I haven't had a chance to look into it; so stick with Windows XP or Linux for now. Third, save states are not supported yet. If you try and use them anyway, bad things will happen. Fourth, and most importantly, this isn't 100% bit-perfect by any stretch of the imagination. Off the top of my head, memory is accessed far too often, the OAM and CGRAM address lines are not controlled by the S-PPU during active display, none of the various glitches are supported, and the OAM renderer does not pre-cache the next scanline's sprites, it happens on the same line for now. I will obviously be doing my best to improve the accuracy of the aforementioned things. But even with those missing, this is still leaps and bounds above a pure scanline-based renderer. It essentially provides 682 times the parallelism. It is enough to finally properly emulate the shadow effect in Air Strike Patrol, and it finally eliminates the "PPU Hclock render position" hack once and for all. Lastly, you'll need the DLLs from v063 official. I didn't bother to include them this time. Enjoy! ________________________________________________________________________________ 2010-04-05 - v063r09 Windows binary w/sPPU enabled included So that's about 24 solid hours worth of programming in two days. Holy fuck am I exhausted. Don't expect the last bits any time soon. Missing features: - Mode 7 renderer - OAM previous-line caching - offset-per-tile mode - some edge cases in color add/sub - hires - interlace - overscan - S-PPU control over VRAM, OAM, CGRAM during active display Speed hit is about as bad as I had feared. 172fps with scanline rendering to 80fps with dot rendering. I'm guessing that with optimizations I can make it to ~100-110fps. ________________________________________________________________________________ 2010-04-05 - v063r08 No binary, this is just a point release. I have basic lores BG1-4 rendering with mosaic added. No offset-per-tile, no windowing, no color math (requires windowing), no sprites, no hires, no interlace, no mode7. It's enough to see how powerful the concept is already, though. - Battle Blaze intro looks just fine (can't beat a battle because I can't see my sprites or save states yet) - Dai Kaijuu Monogatari II stat bar looks fine (no duplicated line) - Super Metroid looks fine (no extra status bar line) - Air Strike Patrol shows the translucent shadow for your plane (but the left-hand scrolling is glitchy ... not sure what's up yet) Speed is ... yeah, it's bad. About 50-60% speed. But it can get better, I'm being really lazy and completely recomputing everything for each pixel. A very large number of these operations can be cached. I'm going to wait until the renderer matches the quality of the scanline-renderer before optimizing; and I'm not going to push too far on optimizing this (eg I probably won't bring back the tiledata planar->packed conversion cache.) I'm designing this similar to MooglyGuy's N64 renderer, putting each component in its own class. So far I'm really liking the concept. ________________________________________________________________________________ 2010-04-04 - v063r07 src/lib is no more, merged libco, nall and ruby into src/. libsnes has been improved, builds in when you "make library" now. XML memory map generation happens from a nall template header, so both libsnes (used by ui_sdl) and ui_qt can run again without snesreader. ui_sdl improved, can run any game via command-line, but doesn't load or save RAM yet. And most importantly, much work has gone into sPPU, the new cycle-based PPU renderer. It has enough support to be compatible with all games ($2134-213f are mostly complete, just missing range/time over flags and VRAM/OAM/CGRAM blocking.) It only renders the back color, as if you had all BG and OAM layers disabled. At this point, if you run Air Strike Patrol, thanks to its gradient fade highlighting, you can see the plane's shadow, just as on real hardware now. It also runs test_hello and test_noise, which I will upload shortly. ________________________________________________________________________________ 2010-04-02 - v063r03 Extremely substantial code structure changes this time. Probably the most in four years. All of the SNES core now resides in src/snes, and the contents of system have been unrolled into this directory as well. This folder gets its own Makefile now, and some special build commands, "make library" and "make install-library". This creates static and dynamic link libraries of the core, completely devoid of Qt, ruby, the GUI, etc. There's a new module as well, src/snes/libsnes. This is a C interface that will let you initialize and control the bsnes core without the need for anything more than a 1KB header file. To test this, I've created a UI fork, ui_sdl. Very very simple, 2KB, nothing there at all really, it just boots up Zelda 3 and runs it directly with keyboard input support and video only. The important point here is that the ui_sdl project does not reference the core, or ruby, or Qt, or anything else, and is fully C++98 (though it could also be C89 if desired.) Now I'm being a bit lazy and using the compiled objects directly, but it'd be just as easy to replace them with a library include directive, or even dynamically link against the shared library and use an entirely different language. It's not actually my goal to make a C++ SDL port, what I really want to do is make a port using Ruby only. May not be so easy, we'll have to see how one accesses shared libraries in it. The main src/Makefile was also simplified for the sake of supporting non-Qt code. All of the Qt and ruby references were moved into the src/ui_qt/Makefile. I fixed up aDSP to compile again, but you still have to manually comment out sDSP and comment in aDSP. Doing so will net you a 6-12% speedup at the cost of some accuracy. Lastly, I added a workaround for the Battletech 3050 splash screen. ________________________________________________________________________________ 2010-03-31 - v063r02 It would be a really good idea to test all of the HDMA-sensitive games with this WIP, if anyone's up for it. Rewrote most of sCPU::DMA. It now implements a parallel two-stage pipeline to more closely model the hardware. Even if it turns out to be wrong, simply making dma_write() immediate would revert it to the old behavior. Fixed a bug where HDMA init and run were always syncing to the DMA counter, even when a DMA was already in progress. Will speed up the S-CPU in a very, very small number of games, namely College Football '97. Most games avoid this because it can crash CPUr1. New DMA variables means new save state version, sorry. I did not add the MDR override code, because it's too fucking insane. Speedy Gonzales still works. Removed the status bar size grip entirely. There's really no point in it being there in windowed mode since you can already grip the sides of the window anyway. Added space to each side of the status text so that it doesn't nail the very edge of the monitor. Added checks in XML mapping to not map in special chip sections when you try and load BIOSes directly, which will stop the SGB and BS-X BIOSes from crashing the emulator. Load it the right way and it'll work fine, as always. Fixed the loader window to display screenshots properly when you have HTML entities in the filename, eg &, < and >. ________________________________________________________________________________ 2010-03-29 - v063r01 I've had enough of idiots incapable of finding fullscreen settings. The menubar is enabled in fullscreen mode by default. A new option in settings->configuration->video will let you hide it as with v063 official. I don't want to hear about how I shouldn't allow any settings to be configured differently in fullscreen mode, or how it should be in a GUI panel, or whatever. I will ignore you if you bring it up. I've also added the strpos / qstrpos function->class code, as mentioned in the programming section. ________________________________________________________________________________ 2010-03-28 - v063 Time for another (hopefully) stable release. The changelog has all updates since the last stable release. Most notably, this release features substantial accuracy improvements all around. Almost all of them represent brand new findings never before seen in any SNES emulator. Changelog: - fixed off-by-one buffer size issue in S-PPU RTO calculations [PiCiJi] - added XML parser - added XML-based memory mapping system - moved header-based memory mapping code into snesreader library - added some linker flags for Fedora [belegdol] - added cheat code database; with codes for over 1,500 games [mightymo] - fixed a bug where S-CPU IRQs were being tested one cycle early on direct page indexed read opcodes - added global cheat system enable/disable checkbox to cheat code editor - fixed bug in overflow calculation of S-CPU ADC and SBC opcodes in BCD mode [blargg] - emulated the S-CPU ALU MUL and DIV hardware delays with partial result calculation steps [blargg] - controller port read now returns real-time results of B button when strobe latch is raised - major improvements to emulation of the S-SMP TEST register [blargg, byuu] - fixed DSP2 memory map [Overload] - "Apply Patch" checkbox will now scan UPS patch folder if one is set in the paths section - fixed S-CPU TSC negative flag calculation in emulation mode [address] - added "make uninstall" command to Makefile for Linux users - S-CPU (H)DMA now updates the S-CPU MDR; fixes a freeze in Speedy Gonzales - Stage 6-1 - very substantial code cleanups and optimizations as a result of moving from C++98 to C++0x ________________________________________________________________________________ 2010-03-24 - v062.10 Added make uninstall, and fixed up nall::function to also bind lambdas that don't yet exist in GCC 4.4. ________________________________________________________________________________ 2010-03-23 - v062.09 Mostly minor stuff again. Fixes: array, linear_vector and pointer_vector need to set source.pool = 0 before calling reset() to avoid destroying the object we're trying to move. All of nall::string is inside namespace nall now. No idea what I was trying to do before with the half-global approach. nall::function gains a reset() function, more obvious than func = (void*)0; The movie file loader wasn't binding the right action when changing files and clicking load, can't believe nobody noticed that one. ________________________________________________________________________________ 2010-03-20 - v062.08 This WIP has bsnes.exe, snesreader.dll, and src/. If you need anything else, get it from past releases, please. I fixed TSC negative flag calculation in emulation mode. Will pass this test now: snes_test_tsc.zip Way too obscure to affect anything, but definitely good to get it right. Also rewrote nall/function.hpp to use C++0x variadic templates. New version is ~85 lines instead of ~190, 40% smaller, doesn't require recursively including itself, doesn't require the C preprocessor, evaluates to ensure the member function pointer is big enough to hold what you're assigning statically (at compile time) instead of dynamically (at run time), and supports infinite arguments instead of zero to eight now. ________________________________________________________________________________ 2010-03-19 - v062.07 This is source code only, no binaries. Sorry, worn out after spending four hours straight writing crazy ass Julian<>Gregorian date functions. Holy fucking hell that is crazy shit. Tell me, how many days have passed since 01-01-4731 BC on the Julian calendar? Okay, this really was just about taking advantage of vectors inside of vectors. I've updated the XML parser to use vectors of actual objects instead of pointers. This makes cleanup free, and turns countless ->'s into .'s -- much nicer to look at. I may take advantage of overloaded operators for something now, not sure yet. ________________________________________________________________________________ 2010-03-18 - v062.06 You'll need snesreader's DLL from my last WIP post to use the above. This initializes mode, region and ram_size again in Cartridge::load() to stop the phantom SRAM files from being generated. This fixes DSP-2 mapping to match Overload's findings (which requires an unposted snesreader, so Dungeon Master won't run for you guys yet.) This removes nall/traits.hpp and uses std::tr1::type_traits instead. It also drops move, forward and identity in favor of those from std::tr1::utility*. This fixes linear_vector and pointer_vector to not crash when using vectors of vectors and copying them. This fixed linear_vector, pointer_vector and array to initialize all internal variables for all constructors. This fixes the file browser to look for patches in your patch directory, so the "Apply Patch" box should work correctly now. * I have no objection to using functions from the C++ standard library when they don't suck. ________________________________________________________________________________ 2010-03-17 - v062.05 snesreader_2010-03-16 To run this, you'll need the DLLs from v062r04's public beta, and the updated snesreader.dll from the above in the same folder as the WIP. No profiling. This fixes UPS patching, and it also modifies snesreader to generate the XML map separately, so that the map can be generated post-patching. The new enum classes weren't attaching properly to the config file, so the input settings, expansion port and region settings are saved again. It also converts the S-SMP timers back to unsigned integers instead of using floating point, no accuracy improvement but much more in line with hardware. Lastly, it makes the div register shift left 16 places and pre-shifts on divide, which is just for aesthetics. And I'll wait on your tests, FitzRoy. I really hope that Big Run Jaleco Rally is correct, because I don't have the first idea how to debug that one. Speedy I can probably handle. ________________________________________________________________________________ 2010-03-15 - v062.04 I suppose I should start calling these nightlies, heh. blargg went ahead and verified every last possible edge case with regards to the S-CPU MUL / DIV registers. It uncovered a few errors in my implementation, which have since been corrected. The design used now should be a direct reflection of the hardware implementation: no actual multiplication, no actual division, and no variable-length bit-shifting. We also spent about eight hours straight hammering away at the S-SMP test register. We have a partial understanding of TEST.d3 and TEST.d0, and a complete understanding of the other six bits. All of this has been implemented as well. Lastly, snesreader gets a tiny update to fix Test Drive II, which broke due to a slight regression when porting the mapping code to XML. ________________________________________________________________________________ 2010-03-15 - v062.03 blargg and I sat around for a good 8+ hours today hacking away at the S-SMP Pandora's Box: the TEST register. What better way to spend Pi Day, right? We came up with the following tests: http://byuusan.kuro-hitsuji.net/blargg_2010-03-14.zip First, controller_strobebehavior.smc improves emulation of $4016. When the joypad strobe latch = 1, reading $4016 returns the current value of the B button. As in, you can keep reading it over and over. It won't increment the shift register, and it will keep telling you the actual current state of the button. This is very much like the NES behavior. One more TODO in the S-CPU code taken care of. Next, all kinds of S-SMP TEST register improvements. Turns out d7-d6 alone controls the actual S-SMP clock rate. 0 = 100%, 1 = 50%, 2 = 0% (locks the S-SMP forever), 3 = 10%. Wild stuff, you can actually permanently slow the S-SMP relative to the S-CPU. d6-d5 is a timer tick control, but it actually uses d7-d4 overlaid. The algorithm is fucking nuts, and is really my only contribution to today's work. The rest was all blargg's research. We had d2 wrong, it's not MMIO disable, it's RAM disable. As in, disable read and write. Returns 0x5a on regular SNES, 0xff on mini-SNES. 0x5a is not the S-SMP MDR. IPLROM is still readable when RAM is disabled. d1 was correct, just RAM write disable. Can still write to $f8 and $f9, of course. But it won't go through to RAM. d3 and d0, we are still a little unsure on. The T0-T2 timers seem to have a low and high phase, and if you strobe them you can force ticks of stage 2 to happen, and you can disable them in such a manner than stage 2 never ticks at all. blargg is still uncovering all sorts of crazy things in $xB mode, so emulation of these two bits is not perfect. But overall we are leaps and bounds further now toward complete emulation. I'd say we went from 10% to 80% with today's work. But we'll have to see how deep the rabbit hole goes on d3+d0 first. Current register map: Code: case 0xf0: { //TEST if(regs.p.p) break; //writes only valid when P flag is clear status.clock_speed = (data >> 6) & 3; //100%, 50%, 0%, 10% status.timer_speed = (data >> 4) & 3; //100%, ... status.timers_enabled = data & 0x08; status.ram_disabled = data & 0x04; status.ram_writable = data & 0x02; status.timers_disabled = data & 0x01; unsigned base = 1 + (1 << status.clock_speed); unsigned step = base + (15 >> (3 - status.timer_speed)); status.timer_step = 1.0 / (3.0 / step); t0.sync_stage1(); t1.sync_stage1(); t2.sync_stage1(); } break; Fairly confident that no emulator prior to this WIP could pass any of blargg's tests, so this is all brand new information. Fun stuff :) ________________________________________________________________________________ 2010-03-14 - v062 Major accuracy improvements have happened over the past few days. They easily warrant a new beta release. First, it turns out that every emulator to date; not only for the SNES, but for the Apple II GS as well, incorrectly computed ADC (add) and SBC (subtract) flags in BCD (binary-coded decimal) mode. At least fifteen years of emulating the 65816 processor, at least five known investigations into their behavior, and we all still had it wrong. So I wrote some tests that dumped every possible combination of adc and sbc with every possible input and every possible flag, and recorded both the accumulator result and status flag register. From here, blargg figured out the underlying trick: the CPU was computing overflow before the top-nibble's BCD correction pass. With the routines rewritten, bsnes perfectly matches real hardware now. Next, some background. The whole reason I got into SNES emulation was because I was tired of writing code that ran perfectly fine on emulators, but failed miserably on real hardware. The number one problem was emulators allowing video RAM to be written while the screen was being rendered. This single bug has broken dozens of fan translations and ROM hacks. Some have been updated to work around this bug, and many others are left in a permanently broken state (such as the translations of Dragon Quest I & II and Sailor Moon: Another Story, to name just two.) After asking emulator authors to fix this since 1997, I finally had enough in 2004 and started on bsnes. For this particular bug, I'm very happy to report that all but one SNES emulator now properly blocks these invalid accesses. Although sadly one still offers a configuration setting for backwards compatibility with these translations. What an ironic shame ... emulating an emulator. And in the process, sapping the motivation to ever go back and fix these titles to ever run on real hardware. But I digress ... The second biggest problem that causes software created under emulation to break on real hardware has, without a doubt, been the hardware delays as the S-CPU computes MUL (multiplication) and DIV (division) results. To date, whenever you used this hardware functionality, emulators have immmediately furnished the correct results. But on real hardware, multiplication requires eight CPU cycles, and division requires sixteen. Each step computes one bit of the source operand and updates the results. Reading the output registers early thus provides the partially computed results. This is obscure. It isn't well known, and many people writing software for the SNES probably aren't even aware of this limitation. Because of the partial computation results, outright delaying the computation would break many commercial software titles. But by not emulating the delay at all, we were causing a great disservice to anyone wishing to use an emulator for development purposes. Now, once again, thanks to blargg's algorithm help, he has determined the underlying multiplication and division algorithms. Combined with my expertise of SNES analysis and hardware testing, I was able to determine when and how the ALU (arithmetic logic unit) stepped through each work cycle. Our work combined, bsnes now also perfectly emulates the hardware MUL and DIV delays. Again, this isn't going to fix commercial software titles. They would have realized that they were reading back invalid MUL and DIV values, and fixed their code. This is for all of the software developed using emulators. This is an extension of my commitment to create a hardware emulator, and not a video game emulator. We also verified that the S-PPU multiplication interface does indeed return instant results with no delay. So emulation of that interface was already correct. I'm only labelling this release a beta because it hasn't been tested. But I'm fairly confident that it is stable, and I seriously recommend upgrading from v060 or prior releases. This is easily one of the last major pieces missing from emulation. The last notable elements are: S-CPU auto joypad poll timing, S-CPUr1 HDMA crash detection, S-CPU<>S-SMP port ORing, S-SMP timer glitching, S-DSP mute pulse, and full cycle-level emulation of the S-PPU. With all of the aforementioned items, I will consider a v1.0 release of bsnes ;) Lastly, I'll post this screenshot just for fun. When d4s translated Breath of Fire II to German, he added some code that relies on the incorrect emulation of the DIV register to detect emulators. With this emulated properly, you now see the following screen: ./sshots/bs_349.png Sorry to spoil that, but the secret's already out, as the MESS team reported on it publicly already. I intend to add pseudo-randomness support shortly, which should eliminate one of the last vectors possible to distinguish bsnes from real hardware :) A million thanks to blargg for making this release possible. ________________________________________________________________________________ 2010-03-08 - v061.01 Found the cause of the issue breaking SuperFX games after loading SA-1 games. Seems the XML mapping tree wasn't being cleared. It's also not a good idea to use bsnes/ as the folder name when the Makefile generates a binary by the same name in the same directory, so back to src/ for the main emulator it is. With those fixes, this release should be fully stable; but again my intentions are to keep v060 as the stable release for a while. Nonetheless, you can grab the new beta at Google Code. It should be the last update for at least a few weeks. ________________________________________________________________________________ 2010-03-07 - v061 Please keep in mind that bsnes v060 remains the current stable release. v061 has been released as a work-in-progress build. As such, it is only available at Google Code. I am releasing this WIP to allow the public to test out and comment on the new XML mapping system, as well as the integration of mightymo's cheat code database into the cheat editor. I would greatly appreciate feedback on these two on the forums. There are some important issues with this release. The biggest is the move to C++0x. This requires GCC 4.4.0 or newer to compile, thus it is not currently possible to build this on OS X using Xcode. Nor would it be possible on certain BSDs or older distros. If you have an older compiler, please stick with v060, or use a binary release where available. Another issue is that TDM/GCC 4.4.1 for Windows crashes with an internal compiler error when attempting to generate a profile for the DSP-1 module. This is a bug in the compiler, and not in the code itself. The workaround is to simply omit profile-guided optimization for this one object. Lastly, there's also a known bug in the memory mapping. If you load an SA-1 game, SuperFX games will not load properly afterward unless you restart the emulator. I'm looking into the cause now, but it didn't seem serious enough to hold up a WIP release. So, yes. If you want a good gaming experience that's been fully tested and stable, please stick with v060. If you want to see some bleeding edge features, I'd appreciate feedback on v061. Thanks for reading this. Changelog: - added mightymo's cheat code database, access via "Find Cheat Codes" button on cheat editor window - added an option to temporarily disable all cheat codes quickly - debugger now properly uses S-SMP IPLROM when needed for disassembling and tracing - indexed indirect read opcodes in the S-CPU were testing for IRQs one cycle too early [someone42] - fix an off-by-one array iteration in S-PPU OAM rendering [PiCiJi] - added some implicit linked libraries to linker flags for Fedora [belegdol] - moved from C++98 to C++0x, resulting in substantial code cleanups and simplifications - C++0x: implemented foreach() concept for linear container iteration - C++0x: implemented concept system using SFINAE and type traits - C++0x: utilized auto keyword to increase source readability - C++0x: moved to strongly-typed enumerators - C++0x: rewrote va_list-based code to use type-safe variadic templates - C++0x: replaced noncopyable class with deleted default copy functions - C++0x: replaced custom static_assert template class with built-in version - C++0x: utilized rvalue references to implement move semantics into string, array, vector and serialization classes - C++0x: utilized std::initializer_list for { ... } initialization support to lstring, array and vector classes ________________________________________________________________________________ 2010-02-08 - v060 This is a long-term stable release. A full changelog will be available at the forum link below later in the day. Also, please note that I have merged all of the various distributions into two packages. The Windows binary package now contains both the profile-optimized (fast) build, and the debugger build. The source code package now contains sources for bsnes, snesreader, snesfilter and supergameboy. Changelog: - added Direct3D HLSL pixel shader support [mudlord] - fixed a signal issue that caused loading games to take 1-2 seconds longer in v059 - 21fx API revised to its final form, S-MSU (public documentation pending) - worked around QTBUG-7188 to fix multi-file 7-zip file listbox to update when scrolling - added scale max - normal, wide, and wide zoom modes to fullscreen mode - added overscan cropping tool (needed for wide zoom mode; useful for developers simulating games on a real TV) - added "go up one folder" button to file load dialog - added group (un)assignment to the input settings window - now honors input.allowInvalidInput setting; defaults to false [Jonas Quinn] - cheat code editor grays out empty slots - cheat code editor adds "clear selected" button to quickly erase multiple cheat codes - to load folders as game images, folders must end in .sfc, .bs, .st, .gb now - debugger: added S-CPU (H)DMA registers; S-SMP registers; S-DSP registers to properties list - snesfilter: HQ2x filter is now multi-threaded (scales infinitely: the more cores you have, the less overhead required) - pixelshaders: added screen curvature shader to simulate curved CRT tubes - source: lots of code cleanup, as always ________________________________________________________________________________ 2010-01-24 - v0.059.06 This is an experimental release, as such it is posted only to Google Code. Changelog: - 21fx API moved to pre-finalized form as S-MSU1; more about this on the forum - OpenGL driver now uses GL_CLAMP_TO_BORDER instead of GL_CLAMP_TO_EDGE to support screen curvature shader - rewrote file open dialog; code is greatly simplified, interface is improved - all cheat code columns are now enquoted, and empty codes at the bottom of the file are omitted (format is compatible with previous releases still) - debugger: added missing DMA variables to S-CPU properties viewer - snesfilter: added OpenMP (multi-threading) support to HQ2x filter - lots of other miscellaneous code cleanup work ________________________________________________________________________________ 2010-01-11 - v0.059.02 Changelog: - added folder-up button to the file loading window - hid new-folder button except on path selection window - removed "Assign Modifiers as Keys" button; replaced with input.modifierEnable in the configuration file - fixed a Qt signal issue that was causing ROM loading to take an extra second or two longer than necessary - scale 5x setting will now maintain an exact multiple in both width and height for both NTSC and PAL modes - re-added group assignment and unassignment to the input settings window - re-wrote mouse capture code to be more intuitive, now uses buttons to set assignment - re-added input.allowInvalidInput check to stop up+down and left+right key combinations by default [Jonas Quinn] - split "Tools Dialog" menu option into separate items for each tool (Cheat Editor, Cheat Finder, State Manager) - added S-SMP and S-DSP property information readouts to the debugger ________________________________________________________________________________ 2010-01-06 - v0.059 This is mostly a polishing release. There's lots of nice little improvements over the last release, so it should be well worth the update. Changelog: - fixed a bug in the save state manager that was allowing saves for unsupported special chips - added save state support for SuperFX games - added save state support for SA-1 games - the "Apply UPS" checkbox actually works now; allows bypassing of patching prior to ROM loading - ROM loader will display internal ROM title and header info for uncompressed files ending in ".sfc" - added Shift JIS to UTF-8 conversion for internal ROM titles - "open-folder" concept now requires folders to end in ".sfc" to avoid false positives - shrunk all GUI buttons and right-aligned them, as some of them were ridiculously long before - rewrote settings and tools windows to be driven via tabs instead of lists; this saves a lot of screen space - rewrote input mapping system to use a tree view instead of the confusing combo box hierarchy; hopefully more people will find the user interface GUI hotkey remapping section now - added support to map modifiers as individual keys (eg you can map the shift key to the SNES select button) - rewrote the cheat code editor, it behaves exactly like the state manager now; there are 128 pre-defined slots, and it is easy to clear any or all of them - the cheat file will auto erase itself upon exit if all codes and descriptions have been erased - fixed title bar game name ordering; was "bsnes v058 - Game Name", is now "Game Name - bsnes v059" - fixed a bug where pressing escape inside the main window's menus would cause the program to quit - Windows: worked around QTBUG-7188 to fix the multi-file archive loading dialog; it was not updating properly before - Linux: added full-API PulseAudio driver with synchronization and latency control [RedDwarf] - Linux: fixed a crashing bug involving OpenGL and glXSwapIntervalEXT() - Linux: X-Video driver texture now resizes dynamically to support > 1024x1024 for any future filters to use - Debugger: single-stepping instructions now updates all windows marked to "auto update" - Debugger: fixed execute breakpoints, they were disassembling at the wrong offset - Debugger: S-CPU bus breakpoints now mirror WRAM $7e:0000-1fff to $00-3f|80-bf:0000-1fff - Debugger: fixed a rendering issue when stepping through hires games - Debugger: added property system; can now view internal register states of all S-CPU and S-PPU registers (S-SMP and S-DSP coming soon) - Debugger: added CGRAM palette viewer - Debugger: added OAM sprite viewer (no graphical output yet) - Debugger: added options window -- so far only to control output of memory / execution usage tables - Debugger: updated usage and memory export file names to start with the loaded cartridge name - Source: cleaned Utility class, split some of the functionality out to Cartridge class - Source: greatly simplified SNES::Cheat class, SNES::Cartridge class; etc A note to Windows Vista and Windows 7 users: there is still an open bug in Qt 4.6.0 that causes menus attached to popup buttons to initially appear invisible. See QTBUG-6645 for reference. As it is a bug with Qt itself, there is nothing I can do about it but wait patiently. You can work around this by pressing the tab key after you click the button. This affects the options buttons on the file load dialog, and on the input settings window. Also, mudlord has submitted an updated Direct3D driver that adds HLSL pixel shader support. It was too close to get into this release, I'd like some time to test it. But hopefully it will get in by v060, or at the very worst, v061. Many, many thanks to mudlord for the awesome work :D ________________________________________________________________________________ 2009-12-09 - v0.058 We've tested the latest release on at least a dozen computers now, all seems to be in order for a release. Changelog: - added 21fx support (more on this later) - added movie recording and playback support - added rewind support (enable under Settings->Configuration->Advanced, use backspace key to rewind) - added speedup (fast forward) and slowdown key bindings - audio no longer stutters on Windows when moving or resizing the main window - co-processors can now specify their own clock rates instead of sharing the S-CPU clock rate - Super Game Boy 2 now runs at the correct hardware speed, and not 2.4% faster like the Super Game Boy 1 does - added Vsync support to the Windows OpenGL driver (Intel graphics drivers do not support this option, because their engineers are lazy) - OpenGL driver no longer re-initializes when changing video synchronization, helps pixel shaders - refactored user interface compilation; now split into several object files, auto-generated MOC files placed under src/obj/ - worked around a bug in the PulseAudio sound server that was causing the ALSA output driver to lock up [BearOso] - rewrote and simplified the save state manager, it is no longer a part of the core - S-DD1 and SPC7110 can now access up to 256MB via their MMCs - re-added background and OAM layer toggling under the tools dialog - added config file options to adjust emulation speed levels (config.system.speed*) - added snesreader, snesfilter and supergameboy support to the OS X port - added a really neat pixel shader that can perform point scaling to non-even multiples, eg it looks great even with aspect correction [Fes] - upgraded to Qt 4.6.0 official Debugger changelog: - added memory export and import to the memory editor - added bus usage analyzer: logs opcodes, memory reads, memory writes and M/X states to usage.bin file - added disassembler that can trace both forward and backward from the current execution address - extended read/write breakpoints to the S-SMP - re-added trace masking option Errata: there is one known bug in Qt 4.6.0 that affects the Windows port: menus attached to buttons show up as invisible on Windows Vista and above. I only use this on the file load dialog options button, and only to toggle the information pane on and off. Given that this is less severe than the bugs in the beta versions, I've upgraded anyway. I'll submit a bug report to the Qt team for this shortly. Also, my sincerest thanks to Bradley Hughes from the Qt development team for quickly fixing this show-stopper bug that greatly affected performance in bsnes v056. ________________________________________________________________________________ 2009-11-22 - v0.057 I'm really sorry about this, but a major issue snuck into v056. It was caused by a bug in the newly released Qt 4.6.0 RC1. Whenever one moved the mouse cursor over the main window in the Windows port, the frame rate was immediately cut in half, which effectively ruined Mouse, Super Scope and Justifier support. As for how this could happen, well ... I'm ... really at a loss for words about this. This release does not change the source code at all except to increment the version number, and it is built against Qt 4.6.0 beta 1 instead of 4.6.0 release candidate 1 as v055 was. I will file an official bug complaint and post a link to it here during next week. Again, my apologies for any inconvenience. I incorrectly assumed it would be safe to update to RC1, and didn't spot the bug in time. ________________________________________________________________________________ 2009-11-22 - v0.056 This release adds a lot of new user interface features, and polishes Super Game Boy support. Note that many pixel shaders need to be coded specifically for bsnes, eg ones designed for Pete's OpenGL2 plugin will not work. I will maintain a pixelshaders archive on the bsnes download page with a collection of working shaders. Right now, there are three: HDR TV, Scale2x and HQ2x; written by guest(r) and Pete, and ported by myself. Changelog: - lowered Game Boy audio volume so that it matches SNES audio volume - fixed Super Game Boy multi-player support - fixed Super Game Boy swapped player bug - compressed Game Boy cartridges can now be loaded - added save state support for Super Game Boy games - blocked illegal Super Game Boy packets, fixes Zelda DX, Akumajou Dracula, etc palette issues - main window once again shrinks on size changes - joypads can now control the file loading window (support is very rudimentary) - cleaned up video and audio sliders, increased audio input frequency range for 59hz monitors - rewrote all of the input capture system from scratch - added dozens of additional GUI hotkey bindings to resize the main window, control synchronization, control speed, etc - it is now possible to map keyboard modifiers (shift, control, alt, super) to any input or hotkey; eg alt+enter = fullscreen - merged all input capture windows into the main settings panel - added turbo button support; hold down turbo buttons to send a 30hz input pulse - added asciiPad controller emulation; contains off/turbo/auto fire toggles and slow-motion mode - asciiPad support allows for quick switching between keyboard and gamepad input - merged scanline filter into the user interface (under Video Settings) to allow it to work on all filters; including the NTSC filter - killed off an evil QString <> string intermediary class called utf8; string class can convert to and from QString directly now - added fast BS-X, Sufami Turbo and Game Boy cartridge loading: use the filter list under "Load Cartridge" to bypass the BIOS selection screen - added pixel shader support to the OpenGL driver on Windows and Linux; note that it only really works well on Linux at the moment - added proper Vsync support to the OpenGL driver on Windows and Linux using GL extensions; again this really only works well on Linux - added unique path memory for shaders, folders, cartridges, BS-X, Sufami Turbo and Game Boy images - upgraded to Qt 4.6.0 release candidate 1; fixes an issue with the first checkbox in lists not updating when clicked ________________________________________________________________________________ 2009-10-31 - v0.055 Happy Halloween, this release adds full Super Game Boy support ... but is it a trick, or a treat? ;) ::cough::, lameness aside ... The Game Boy emulation core is courtesy of gambatte, and excellent, accuracy-focused, open source, and lightning fast Game Boy Color emulator. Now I know what you're thinking, using a Game Boy Color emulator with the Super Game Boy? The truth is, gambatte was just such an amazingly perfect fit that nothing else compared. I fully believe that even as a CGB emulator, gambatte will do a better job than any pure DMG emulator could. The emulation of the ICD2 chip (aka the Super Game Boy) was fully reverse engineered by myself. Eventually I'll get an updated document put up explaining how it works. The next question might be, "why emulate the Super Game Boy when existing Game Boy emulators do?"; well, they can only simulate part of the SGB. Features such as custom SNES sound effects, hand-drawn borders, multi-tap support and custom SNES code execution can only be accomplished by a true SNES emulator. Space Invaders is perhaps the most impressive demonstration, as it contains an entire SNES game embedded inside the Game Boy cartridge. bsnes' SGB emulation supports virtually every command, full sound mixing from both the SNES and Game Boy sides, both BIOS revisions, etc. The only thing that is not fully functional yet is the multi-player support, but it should be in due time. Save state support is also planned for a later date. Changelog: - added Super Game Boy emulation (thanks to gambatte for the Game Boy core) - extended hybrid scanline/cycle PPU renderer to support Mode7 register caching; fixes scanline flickering on NHL '94 title screen - all windows (other than the main window) can be closed with the escape key now - file dialog path selection now accepts typed paths; can be used to access hidden directories and network shares - file dialog's game information panel can now be disabled - fixed a crashing issue when the file dialog was given an invalid path - fixed screenshot capture save location - added screenshot capture option to tools menu - state manager now auto-closes when loading a state; it can be reopened quickly with F3 - fixed GZip archive loading - fixed NTSC off-by-one filter bug on hires screens - extended Scale2x, LQ2x and HQ2x to properly filter hires screens - added Pixellate2x filter ________________________________________________________________________________ 2009-10-19 - v0.054 After a half-dozen hours of installing and compiling various combinations of MinGW and Qt, I've finally found a combination that once again allows for profile-guided optimizations: MinGW GCC 4.3.3 and Qt 4.6.0-beta 1. Though Qt 4.4 still has broken PGO, the latest Qt beta no longer has the process freeze issue upon termination. This release is essentially the same as v053, but it's now at least as fast as v052 was, and ~10% faster than v053, which lacked profiling. I did add in two quick changes, however: first, when starting in fullscreen mode, the video output size was being incorrectly set to the windowed size; second, by requiring save states to match the CRC32 of games, it made debugging with them impossible, so I've turned off the CRC32 matching. ________________________________________________________________________________ 2009-10-18 - v0.053 This release greatly polishes the user interface, adds a new cheat code search utility, adds the snesfilter library, and adds Qt-based GUI support to both snesfilter and snesreader. snesfilter gains 2xSaI, Super 2xSaI and Super Eagle support, plus full configuration for both the NTSC and scanline filters; and snesreader gains support support for multi-file ROM archives (eg GoodMerge sets.) Statically linking Qt to bsnes, snesfilter and snesreader would be too prohibitive size-wise (~10MB or so.) I have to link dynamically so that all three can share the same Qt runtime, which gets all of bsnes and its modules to ~1MB (including the debugger build); and Qt itself to about ~2.5MB. However, there is some bad news. There's a serious bug in MinGW 4.4+, where it is not generating profile-guided input files (*.gcno files.) There is also a serious bug in Qt 4.5.2/Windows when using dynamic linking: the library is hanging indefinitely, forcing me to manually terminate the process upon exit. This prevents the creation of profile-guided output files (*.gcda files.) It would be tough enough to work around one, but facing both of these issues at once is too much. I'm afraid I have no choice but to disable profile-guided optimizations until these issues can be addressed. I did not know about these bugs until trying to build the official v053 release, so it's too late to revert to an all-in-one binary now. And I'm simply not willing to stop releasing new builds because of bugs in third-party software. As soon as I can work around this, I'll post a new optimized binary. In the mean time, despite the fact that this release is actually more optimized, please understand that the Windows binary will run approximately ~10% slower than previous releases. I recommend keeping v052 for now if you need the performance. Linux and OS X users are unaffected. Changelog: - save RAM is initialized to 0xff again to work around Ken Griffey Jr Baseball issue - libco adds assembly-optimized targets for Win64 and PPC-ELF [the latter courtesy of Kernigh] - libco/x86 and libco/amd64 use pre-assembled blocks now, obviates need for custom compilation flags - added a new cheat code search utility to the tools menu - separated filters from main bsnes binary to libsnesfilter / snesfilter.dll - added 2xSaI, Super 2xSaI and Super Eagle filters [kode54] - added full configuration settings for NTSC and scanline filters (12+ new options) - further optimized HQ2x filter [blargg] - added Vsync support to the Mac OS X OpenGL driver - added folder creation button to custom file load dialog - fixed a few oddities with loading of "game folders" (see older news for an explanation on what this is) - updated to blargg's file_extractor v1.0.0 - added full support for multi-file archives (eg GoodMerge sets) - split multi-cart loading again (BS-X, Sufami Turbo, etc) as required for multi-file support - cleaned up handling of file placement detection for save files (.srm, .cht, etc) - file load dialog now remembers your previous folder path across runs even without a custom games folder assigned - windows now save their exact positioning and size across runs, they no longer forcibly center - menus now have radio button and check box icons where appropriate - debugger's hex editor now has a working scrollbar widget - added resize splitter to settings and tools windows - worked around Qt style sheet bug where subclassed widgets were not properly applying style properties ________________________________________________________________________________ 2009-09-28 - v0.052 This is a maintenance release, which fixes a few important bugs. It also adds some graphical icons to soften the user interface. Note that if you have set any custom paths with v051, you'll need to set them again for the fix to work. As always, my apologies for releasing two versions so close together. I felt the bugs were important enough to warrant it. Changelog: - fixed loading of files and folders containing non-ANSI characters (Chinese, Japanese, etc) - fixed a slight lag on startup due to the new file browser - fixed path selection setting, screenshots will now be saved to the correct directory - hid memory editor scrollbar since it does not work yet - disabled window positioning on Linux due to bugs in the Compiz compositor - added icons from the Tango icon library to the menus and panels ________________________________________________________________________________ 2009-09-26 - v0.051 Starting with this release, I wish to take bsnes in a new direction. It has always excelled in accuracy, as the only SNES emulator to offer a full 100% compatibility rate with all known commercial software. But over the years, it has also gained an impressive array of features and enhancements not found anywhere else. It is also the only actively developed SNES emulator with rapid, periodic releases. Its only achilles heel is the steep system requirements, which is quickly being overcome by aggressive new optimizations and steadily-increasing hardware speeds. In an effort to make bsnes even more accessible to everyone, starting with this release, bsnes is now fully open source software, licensed under the terms of the GNU General Public License. I would like to work toward positioning bsnes as a truly general use emulator, and would welcome any help with this. Specifically, I am looking for an interested Debian maintainer to package bsnes for Linux users; as well as for anyone interested in helping to optimize and improve bsnes as a whole. It also seems that many still do not know about bsnes, I'd appreciate advice and help on spreading the word. Please leave a message on my forum if you are interested. I would also welcome and support any forks that target specific areas: a speed-oriented version, a tool-assisted speedrun version, netplay bindings, and so on. As part of this targeting, I've also released a custom debugger-enabled version, which trades a bit of speed in turn for best-in-class debugging capabilities. Please check back here over the following few days, I'll be writing up documentation explaining all of the various unique features of bsnes, as well as detailed compilation instructions for programmers. Changelog: - corrected a small bug in HDMA processing; fixes College Football '97 flickering - corrected ROMBR and PBR SuperFX register masking; fixes Voxel demo [MooglyGuy] - DSP-4 driver AI bug fixed [Jonas Quinn] - added save state support to the S-DD1, S-RTC, DSP-1, DSP-2 and ST-0010 co-processors - fixed a freeze issue when the S-SMP encounters STOP and SLEEP opcodes - Cx4 save states no longer need floating-point values, and are thus fully portable now - added new custom file loading dialog; allows non-modal usage, screenshot previews and ROM info summary, among many other benefits - added support for IPS soft-patching - added blargg's File_Extractor library - added support for archives compressed using 7-zip, RAR and BZip2; which is in addition to existing support for Gzip, ZIP and JMA - state manager now properly updates the timestamp column on saves [FitzRoy] - added OpenGL renderer to OS X port - fixed system beep issue with keyboard input on OS X port - fixed menubar visibility issue on OS X port - fixed a Display handle leak on Linux port [snzzbk] - X-video driver now releases SHM memory properly upon exit [emon] - fixed Direct3D rendering issue that was blurring video on some cards [Fes] - enhanced window positioning code for all platforms - debugger is now GUI-driven instead of via command-line - memory hex editor is now fully usable - added PPU video RAM viewer to debugger - added S-CPU and S-SMP tracing capabilities to debugger - Qt version upgraded to 4.5.2, and compiled with optimizations enabled; runs faster but makes the binary slightly larger - too many code cleanups to list ________________________________________________________________________________ 2009-08-25 - v0.050 I always regret having to post new releases so quickly, but a semi-major bug crept into v049. I'd rather fix it now, before I start making major changes that will need testing again. The problem was that the S-PPU was not being synchronized as often as it should have been, resulting in titles such as F-Zero and Super Mario Kart showing flickering lines here and there. This release fixes that. This release also adds savestate support for Mega Man X2 and Mega Man X3, which utilize the Cx4 coprocessor; and it fixes a bug where input was still accepted even when the main window was minimized. ________________________________________________________________________________ 2009-08-21 - v0.049 This is a maintenance release, but it offers a lot of bug-fixes and speed-ups, so it should be well worth the update. The debugger is not finished yet, so use it at your own risk. It is disabled in the binary release because breakpoint testing impacts performance. Once it is ready, I will release a separate binary with the debugger enabled. Changelog: - Optimized S-PPU emulation, provides a ~10-15% speedup in normal games - Cleaned up cheat editor user interface - Added save state and export data path selections - Added workaround for a strange issue that caused PAL games to run at 60 fps sometimes - Fixed sprite caching issue; fixes SD F-1 Grand Prix - Fixed PPUcounter reset issue; fixes Bishoujo Janshi Suchie-Pai [Jonas Quinn] - Fixed scaling on scanline, Scale2x, LQ2x and HQ2x filters on hires and interlace screens - Fixed sizeof(bool) serialization issue for PowerPC architecture [Richard Bannister] - Fixed cheat code sort ordering - Fixed a bug with centering in fullscreen mode - Fixed an audio pitch bug when changing frequency - Fixed a volume adjust bug when frequency was exactly 32000hz - Fixed X-video RGB rendering bugs [thanks to tukuyomi for testing] - Fixed a file open dialog issue on Linux when using QGtkStyle [jensbw] - Fixed a memory corruption issue involving QApplication::main() [giovannibajo] - Added a preliminary debugger (disabled in binary releases due to associated speed hit) - Added S-CPU and S-SMP stepping and tracing support - Added read/write/execute breakpoint support - Added memory editor (currently it can only view memory) - Added screenshot capture support [kode54] - Save state archives are now ~60% smaller than before - Various code cleanup work, as usual (note: the debugger code is messy, as it is in-progress) ________________________________________________________________________________ 2009-07-11 - v0.048 The biggest feature of this new release is the addition of save state support. Note that this is only currently supported for normal games, and the SPC7110 and OBC-1 co-processors. Other special chips, such as the SuperFX and SA-1, cannot currently save and load state files. I will be adding support for other co-processors little by little in future releases. Changelog: - Added save state support - Added SPC7110 and OBC1 save state support - Added new tools group, with new cheat code and save state managers - Lots of new UI shortcuts: quick save state, quick load state, show state manager, etc - Escape key will now close both the settings and tools group windows - Added major speed-ups to both SuperFX and SA-1 emulation; both now run ~15-25% faster than v047 - Added new video filter, LQ2x; it's as fast as Scale2x while being almost as smooth as HQ2x - Re-wrote HQ2x algorithm; code size was reduced to less than 10% of its original size with virtually no speed loss - Corrected SuperFX2 cache access timing; fixes Stunt Race FX menus and slowdown in other titles - Relaxed palette write limitations for PGA Tour Golf [Jonas Quinn] - Fixed a slight timing issue that was breaking 'An Americal Tail - Feivel Goes West' - Turned off auto-save of SRAM as it was causing slowdowns when writing to flash memory; can be re-enabled via bsnes.cfg -> system.autoSaveMemory = true - Added bsnes.cfg -> system.autoHideMenus, defaults to false; when true, menu and status bars will be hidden upon entering fullscreen mode - Added skeletons for ST011 and ST018 support. Both Quick-move titles get in-game now - Re-wrote S-CPU and S-SMP processor cores to use templates, removed custom pre-processor - Split PPUcounter into a base class inherited by both PPU and CPU; allows both cores to run out-of-order - Split inline header functions to separate files, allows headers to be included in any order now ________________________________________________________________________________ 2009-07-06 - v0.047 The most notable feature for this release is the addition of SuperFX support. This enables an additional eight commercial games, and two unreleased betas, to run with full support. Most notably of these would be Super Mario World 2: Yoshi's Island and Starfox. Though timing is not quite perfect just yet, there should be no known issues with any titles at the time of this release. That means there should only be two official, commercially-released titles that are not compatible with bsnes at this time: Quick-move Shogi Match with Nidan Rank-holder Morita 1 and 2 (using the ST011 and ST018 co-processors, respectively.) SuperFX support was the work of many people. GIGO was a great help by providing the source code to his SuperFX emulator (for reference; the implementation in bsnes is my own design), _Demo_ was very helpful in getting Starfox to work properly, and Jonas Quinn provided roughly a half-dozen very important bug fixes that affected nearly every SuperFX game. Without them, this release would not be possible. So please do thank them if you appreciate SuperFX support in bsnes. Please note that SuperFX emulation is very demanding. I hate to have to repeat this, but once again: bsnes is a reference emulator. It exists to better understand the SNES hardware. It is written in such a manner as to be friendly to other developers (both emulator authors and game programmers), and the findings are meant to help improve other emulators. As far as I know, bsnes is the first emulator to fully support all SuperFX caching mechanisms (instruction cache, both pixel caches, ROM and RAM buffering caches, ...); as well as many other obscure features, such as full support for ROM / RAM access toggling between the SNES and SuperFX CPUs, and multiplier overhead timing. By emulating these, I was able to discover what additional components are needed to emulate Dirt Racer and Power Slide, two titles that no emulator has yet been able to run (they aren't very good games, you weren't missing much.) It should be possible to backport these fixes to faster emulators now. That said, with a Core 2 Duo E8400 @ 3GHz, on average I get ~100fps in Super Mario World 2, ~95fps in Starfox and ~85fps in Doom. Compare this to ~165fps in Zelda 3, a game that does not use the SuperFX chip. My binary releases also target 32-bit x86 architecture. For those capable of building 64-bit binaries, especially Linux users, that should provide an additional ~10% speedup. Be sure to profile the application if you build it yourself. Lastly on the SuperFX front, note that Starfox 2 is fully playable, but that most images floating around have corrupted headers. I do not attempt to repair bad headers, so these images will not work. Please either use NSRT on the Japanese version, or use Gideon Zhi's English fan translation patch, if you are having trouble running this title. With that out the way, a few other improvements have been made to this release: xinput1_3.dll is no longer required for the Windows port (though you will need it if you want to use an Xbox 360 controller), the video drivers in ruby now allocate the smallest texture size possible for blitting video, and the code has been updated with preliminary compilation support for Mac OS X. Note that I will not be releasing binaries for this: it is primarily meant for developers and for porting my other libraries to the platform. Richard Bannister maintains a much better OS X port with full EE support and a native Apple GUI that follows their interface guidelines much better than a Qt port ever could. He has also synced the Mac port with this release. You can find a link to that in the bsnes download section. ________________________________________________________________________________ 2009-05-10 - v0.046 Unfortunately, I was not able to include any actual Super Game Boy support in this release. I was however able to back-port all other changes since v045, as well as add a lot of new stuff. Though there are few visible changes from the last release, internally much has changed. I'm releasing this mostly as a point release whilst everything should be stable. I've decided to support the Super Game Boy via external DLL (or SO for Linux users.) There are many reasons for this. Most notably is that the largest special chip in bsnes right now weighs in at ~30kb of code. Emulating an entire Game Boy, not including the SGB enhancements, would require an additional ~800kb of code, or nearly half the size of the entire SNES emulation core. Add to that potential issues with licensing, conflicts with the build process / namespace, a significant increase to build time, and a lack of flexibility over which Game Boy emulator to use, and it's pretty clear that this is something best left external. At least until we have a fully trimmed, fully working SGB emulator available. The way this will work is bsnes will look for SuperGameBoy.(dll,so), and if present, it will call out to pre-defined functions. Users will need the SGB BIOS loaded, at which point they can select a Game Boy cartridge, and bsnes will use the DLL for actual emulation. Sadly I don't have a working DLL ready for this release, and even if I did, there's no sound bridge yet for the Game Boy audio. Other than that, much of the core has been updated in an attempt to make the core more library-like. It still has a few major limitations: it requires libco (which is not portable) and nall (which is quite large), and only one instance can be instantiated as all of the base objects are pre-defined and inter-linked. Not that I can imagine any practical use for multiple simultaneous SNES emulators anyway ... Changelog: - Save RAM is now automatically saved once per minute - Added delay to Super Scope / Justifier latching to fix X-Zone - Fixed an edge case in CPU<>PPU counter history - S-CPU can now run up to one full scanline ahead of S-PPU before syncing - Added interface for Super Game Boy support (no emulation yet) - Fixed a bug with path selection not adding trailing slash - All S-SMP opcodes re-written to use new pre-processor - Entire core encapsulated into SNES namespace - Core accepts files via memory only; zlib and libjma moved outside of core - Major Makefile restructuring: it's now possible to build with just "make" alone - Linux: libxtst / inputproto is no longer required for compilation - Lots of additional code cleanup ________________________________________________________________________________ 2009-04-19 - v0.045 This is a maintenance release to fix a crashing bug in S-DD1 games (Star Ocean, Street Fighter Alpha 2), and a video issue in games using the WAI instruction. As always, my apologies for any inconvenience. SA-1 support required modification of a large amount of delicate code in the emulation core, and our limited testing team was not able to catch these in time before release. ________________________________________________________________________________ 2009-04-19 - v0.044 This release adds full SA-1 support, with no known issues. All 26 games have been tested by myself and others, and a few have been beaten from start to finish. The latter include Super Mario RPG, Kirby's Dreamland 3, Kirby Super Star and Jikkyou Oshaberi Parodius. Please understand that the SA-1 is essentially four times faster than the SNES' main CPU, so system requirements will be very high for these games. For example, on an E8400 @ 3.0GHz, I average ~160fps in ordinary games. But for SA-1 emulation, this drops to ~90fps, with the worst case being ~80fps. The following features are emulated: - 5a22 CPU core (bus-cycle accurate) - Memory access timing - SA-1 -> S-CPU interrupts (IRQ + CHDMA IRQ) - S-CPU -> SA-1 interrupts (IRQ + Timer IRQ + DMA IRQ + NMI) - SIV / SNV interrupt vector selection - Timer unit (linear and H/V) - Super MMC unit (ROM + BW-RAM) - BS-X flash cart slot mapping - Normal DMA - Character-conversion 1 DMA (2bpp + 4bpp + 8bpp) - Character-conversion 2 DMA (2bpp + 4bpp + 8bpp) - BW-RAM virtual bitmap mode (2bpp + 4bpp) - Arithmetic unit (multiplication + division + cumulative sum) - Variable-length bit processing (fixed and auto increment) While the following features are not currently emulated, mostly due to lack of information: - SA-1 bus conflict delays - Write protection (BW-RAM + I-RAM) - SA-1 CPU priority for DMA transfers - DMA access timing ________________________________________________________________________________ 2009-04-17 - v0.043 This version adds complete SA-1 emulation. Sans a sprite issue in Jumpin' Derby that was discovered after the build was completed, all games should be fully playable. The following games in particular have been played from start to finish with no bugs found: - Dragon Ball Z: Hyper Dimension - Jikkyou Oshaberi Parodius - Kirby Super Star Kirby's Dream Land 3 - Super Mario RPG: Legend of the Seven Stars All other games have been tested for several minutes each. Special thanks to Fras, King of Chaos and powerspike for completing these games; and everyone else who helped test. All features of the SA-1 have been emulated, even those that aren't used by commercially released software. It and the S-CPU are synchronized at the bus level, and even bus conflicts are emulated. Sans future bug fixes, this is about as precise as I can get the emulation. Please note that the SA-1 is four times more powerful than the SNES' main CPU, and has many additional features on top of that. Therefore, a much more powerful machine will be required. To give an idea, on my E8400 @ 3GHz, I get ~160fps in Zelda 3 (a non-SA1 game), ~95fps in Kirby 3, and ~85fps in Mario RPG. I do hope to one day offer a speed-focused build that sacrifices some accuracy whilst maintaining as much compatibility as possible. Unfortunately, as one person, I have to prioritize other issues first. Side note: I wasn't able to determine the proper BS-X cart mapping for Bass Tsuri no. 1 or SD Gundam G NEXT; so data carts will not work just yet. I hope to correct this in a future release. ________________________________________________________________________________ 2009-03-30 - v0.042 A new release quite a bit faster than I was expecting, but a lot has changed. Most importantly is a new Windows input driver, "RawInput". The downside is that this makes bsnes require at least Windows XP, as Windows 2000 and earlier lack RawInput support. The upside is that input from multiple keyboards and mice can be distinguished from each other — very useful for dual-Justifier support in Lethal Enforcers. Users of previous versions of bsnes will need to manually select the new driver via Settings->Configuration->Advanced->Input driver, and will need to re-map all assigned input keys, including the default user interface hotkeys. Or alternatively, delete the configuration file under %APPDATA%\.bsnes or ~/.bsnes. Also new is an XInput driver, which avoids the DirectInput driver limitation of being unable to distinguish the two shoulder trigger buttons. This makes bsnes require DirectX 9.0c or later for the necessary drivers. Note that Windows Vista SP0 does not ship with these, so if you haven't installed it yet, you'll need to do so. This driver is part of the "RawInput" driver mentioned above. This part is important: if you receive an error regarding xinput1_3.dll, you need to download and install the DirectX 9.0c run-time. For those on Windows 2000, or without DirectX 9.0c, it is still possible to compile and run bsnes with the older DirectInput driver only; but I won't be providing a binary myself for this — at least not at this time. More bad news for some: hiro, my Win32 / GTK+ API wrapper, has been discontinued and removed from the source tree for this release. Qt 4.5.0+ is now required for the user interface. Very sorry to the Linux distros that do not have packages for QT 4.5 yet. You'll need to continue with v041 for now. ________________________________________________________________________________ 2009-03-15 - v0.041 I apologize for posting a new version so quickly. This is mostly a maintenance release: joypad analog axes can once again be mapped to the mouse / super scope axis controls, the input capture window has been rewritten to be much more compact, and I've omitted all unneeded features of Qt 4.5 to reduce the final binary size as much as possible (from ~3.33MB to ~2.3MB.) The source archive is also ~20% smaller. Barring any unforseen problems, this will likely be the last official release for a while. Also, I finally have dedicated hosting for byuu.org. I ask that you please update any bookmarks to point here, rather than to byuu.cinnamonpirate.com from this point on, as we'd like to free up the cinnamonpirate sub-domain slot. ________________________________________________________________________________ 2009-03-09 - v0.040 Too much to really name. The biggest news is that the entire user interface has been re-written from scratch. It is now far more polished and professional. To name one example; the cheat code editor now has checkboxes in the list to quickly toggle codes on an off, there is now a global hotkey to toggle all cheat codes, and each cheat code can contain multiple individual Game Genie or Pro Action Replay codes, allowing easy grouping of multi-part codes. You'll also notice new artwork: a logo created by Derrick Sobodash (note that the logo contest from below is still active — if someone can design a better logo, it can appear in v041), and a new photo-realistic SNES controller graphic by FirebrandX. I was finally able to utilize MinGW's profile-guided optimizations, which means this release is approximately ~12% faster than v039. And emulation itself was even improved(!), such as with Jonas Quinn's fix for a sprite overflow bug. There were many other changes as well: Linux users will be happy to see RGB overlay support for the X-Video driver, many will benefit from greatly enhanced warning messages and tooltips throughout the GUI, Windows users will now be able to access the menu without freezing emulation, etc etc. ________________________________________________________________________________ 2009-01-18 - v0.039 Changelog: - Recovered ~10% speed loss from last release via S-CPU IRQ timing optimizations - Implemented O(1) binary-heap priority queue for event scheduling - Fixed a bug where BS-X slotted carts were never mapping SRAM - Fixed a bug where invalid controller input was always being allowed - Fixed all compilation warnings with GCC 4.3 and Visual C++ 9.0 - Added advanced options to control S-CPU ALU hardware delays - S-RTC and SPC7110 timers updated to handle time_t overflow (Y2k38) gracefully - Cheat codes can now have multiple codes per entry, and multiple lines per description - Rewrote config file parser; removed config/ class from emulator core - Windows: added 256x256 image to program icon set - Linux: fixed Xorg keysym mapping, key names should show correctly in all cases now - UI: updated video panel, added fullscreen-on-startup and NTSC merge fields options - UI: simplified audio panel - UI: boolean options on advanced panel can be toggled via double-click - Lots of code cleanup, especially for S-CPU IRQ handling and nall template library ________________________________________________________________________________ 2008-12-15 - v0.038 - eliminated S-DD1 DMA enslavement to the S-CPU; this allows the S-DD1 to behave more like the real chip, and it also simplifies the S-CPU DMA module - eliminated S-PPU enslavement to the S-CPU; all processor cores now run independently of each other - added cycle-level S-PPU timing for OAM address reset and OBSEL; fixes scanline glitches in Mega Lo Mania and Winter Olympics - removed ppu.hack.* settings; as they are no longer needed due to above changes - corrected VRAM tiledata cache bug; fixes Super Buster Bros v1.0 reset glitch - added memory export and trace logging key bindings to user interface - removed WAV logging (to trim the emulation core) - embedded readme and license texts inside executable - simplified S-CPU, S-SMP flag register handling - source code cleanup for S-CPU timing module - GUI-Linux: added style improvements to the listbox and combo box controls - GUI-Linux: finally added filetype filter support to the file open dialog - GUI-all: shrunk configuration panel [FitzRoy] - GUI-all: modified paths panel descriptions for clarity [FitzRoy] ________________________________________________________________________________ 2008-10-26 - v0.037 This release adds support for the SNES mouse, Super Scope and Justifier peripherals. It also simplifies cartridge loading and refines the user interface. Lastly, GZ and ZIP archives can now contain non-ANSI characters (Chinese, Japanese, Russian, ...) This support existed in the last release for all uncompressed files. Together, this means only JMA support on Windows lacks support for loading non-ANSI filenames. This is due to the library itself (really, it's more Windows' fault), and licensing issues prevent me from patching libjma as I did with zlib (bsnes is not GPL compatible.) I'm planning to work with Nach to fix this in a future release. About the cartridge loading changes ... the emulator now determines what kind of cartridge is being loaded (eg normal, BS-X BIOS, Sufami Turbo cart, etc) by looking inside the file itself. If it detects a cart type that requires more than one ROM image to load, it will present you with the appropriate specialized load menu automatically. Aside from being more intuitive, this method also allows loading of BS-X and Sufami Turbo games from the command-line or via file association. Changelog: - added mouse support to DirectInput and SDL input drivers - up to 96 buttons per controller; 8 buttons per mouse (5 per mouse on Linux) can be mapped now - added SNES mouse support (does not support speed setting yet) - added Super Scope support - added Justifier support (supports both Justifiers) - input management system almost completely rewritten to support new controllers - "Load Special" menu removed, all cart loading merged to "Load Cartridge ..." option - replaced "Power Cycle" and "Unload Cartridge" with "Power" -> "On" / "Off" - when video exceeds screen size and is scaled down, aspect ratio is now maintained [Ver Greeneyes] - zlib modified to support non-ANSI characters - cheat code count was limited to 1,024 codes before; it now supports unlimited codes per game - added sort by description setting for cheat code list - polished listbox control interaction (disable buttons when nothing selected, etc) - cleaned up OBC-1 chip emulation (code is functionally identical to v036) - added option to toggle fullscreen mode to settings menu - added advanced mode options to toggle base unit (none, Satellaview) and system region (Auto-detect, NTSC, PAL) ________________________________________________________________________________ 2008-09-16 - v0.036 This release fixes a somewhat serious bug introduced in v035, and also vastly improves Windows support for non-ANSI filenames. The bug was triggered when HDMA would occur during DMA. If the DMA were long enough, subsequent HDMA transfers would be blocked. This caused graphical glitches in Star Ocean, Super Mario Kart, and possible more games. If you noticed any regressions from v034 to v035, this was almost certainly the cause. Once again, we're operating under the assumption that there are no known bugs currently, so please let us know here if you find any. I've also rewritten the file handling for the emulator. On Windows, attempting to load a file with non-ANSI characters (eg Russian, Japanese, etc) would cause these characters to be removed. This meant that no version of bsnes thus far could load these files. This problem was exacerbated when I ported the user interface to Unicode (UTF-16), this caused even config and locale file loading to crash the emulator. The root of the problem is that Windows only accepts non-ANSI strings in UTF-16 format, whereas bsnes' UI wrapper converts strings to UTF-8 interally. When passing these file names to the standard file functions (fopen(), std::ifstream, etc), file loading would fail. To fix this, I replaced all file access functions with a new version that would convert the UTF-8 filenames back to UTF-16, and use appropriate access functions (_wfopen(), _wmkdir(), etc.) ... but there is still one limitation to this: ZIP and GZ support use zlib, and JMA support uses libjma. Neither of these libraries convert UTF-8 strings to UTF-16 before attempting to open files. Due to licensing issues, as well as technical issues, I am unable to correct this at this time. What this means is that loading ZIP, GZ and JMA files; on Windows only; and with Unicode characters in the file name only; will cause the image load to fail. Loading uncompressed images (SMC, SFC, etc) will work with or without Unicode on all platforms. I tried to be as thorough as possible with this fix: command-line arguments (via CommandLineToArvW + GetCommandLineW), user path (via SHGetFolderPathW), real path (via _wfullpath),folder creation (via _wmkdir) and file access/existence checks (via _wfopen) were updated in all cases. I also updated file loading for ROMs (SMC, SFC, etc), save RAM (SRM), real-time clock save (RTC), cheat files (CHT), UPS patches (UPS) and both configuration files (bsnes.cfg and locale.cfg.) Configuration file loading should work even if your username contains non-ANSI characters, and it should also detect config files put in the same folder as the bsnes executable, even if the path to the executable contains non-ANSI characters. Still, if you spot any bugs, aside from the ZIP/GZ/JMA loading issue, please let me know via e-mail at setsunakun0; at hotmail. Lastly, I'd like to apologize for the poor support for non-ANSI filenames in the past. Using an English version of Windows didn't expose the problems to me. I'll be more thorough in the future with this. ________________________________________________________________________________ 2008-08-22 - v0.035 Changelog: - Added video synchronization support at long last [blargg, byuu]. - Added audio panel to control volume, latency, frequency and SNES input frequency settings. - Added driver panel to select APIs to use for video, audio and input. - Added crash handler for driver initialization. - Xv and SDL video drivers now work with compositing enabled on Linux/Xorg. - Improved ALSA audio driver for Linux. - Now using a fixed output frequency, along with a 4-tap hermite resampler. - Improved header detection; fixes Batman: Revenge of The Joker and a few fan translations. - Frameskip will now randomly choose a frame in each set to display; helps with animations. - Locales now support meta-data, which allows for unique translations of the same English input. ________________________________________________________________________________ 2008-08-10 - v0.034 For this release: SPC7110 emulation speed has been greatly optimized, massive improvements to HDMA timing have been implemented, Multitap support was added, and the user interface was polished a bit more. Changelog: - SPC7110 decompression code updated to latest version by neviksti and converted to a state machine; SPC7110 overhead is now identical to S-DD1 overhead (eg ~5% speed hit over standard games) - Fixed a major bug in SPC7110 data port emulation that was crashing Super Power League 4 [Jonas Quinn] - HDMA trigger point corrected to H=1104, bus sync timing corrected - All illegal DMA A-bus accesses should now be properly blocked - DMA state machine rewritten, greatly simplified - Major corrections to HDMA run timing; fixes flickering bugs in Mecarobot Golf and Super Mario Kart - Emulator now defaults to 2/1/3 SNES (CPU/PPU1/PPU2 revision numbers) - Multitap emulation added, can be attached to either or both controller ports; user interface updated to reflect this - Status messages (cartridge loaded / unloaded, UPS patch applied, etc) now appear in status bar - Added advanced configuration option, "input.analog_axis_resistance", to control gamepad analog stick sensitivity Also, the SPC7110 emulator download link below was removed: if you are looking for this, please download the bsnes v034 source code, which has the most up-to-date version in the src/chip/spc7110 folder. ________________________________________________________________________________ 2008-07-19 - v0.033 This release adds SPC7110 emulation, without the need for graphics packs!!, and a rewritten S-RTC (real-time clock) emulator. SPC7110 support means that Far East of Eden Zero, FEoEZ: Shounen Jump Edition, Momotarou Dentetsu Happy and Super Power League 4 are now all fully playable. I will warn you, the emulation is very slow in this version -- while most areas of each game will run at the same speed as other games, there are a few peak moments where speed will drop by up to ~50%. The reason for the slow-down is that I am currently uncertain how to determine the amount of data to decompress in advance, so I default to the maximum amount possible. The reason I am releasing now anyway, is because I beleive in the "release early, release often" paradigm. It will likely take me a few weeks to finish researching this chip, and I didn't want to keep the work I had private during that time. But rest assured, bsnes v034 should feature much faster SPC7110 emulation. neviksti, Andreas Naive and jolly_codger worked non-stop on the SPC7110 decompression algorithm for the past two weeks. caitsith2 provided valuable data to the effort. I only wish that I could've been of some use, but alas, I had no role in this. In the end, it was neviksti who managed to crack all three(!!) compression modes of this chip, which turned out to be a customized 8-bit QM-coder with a prediction model. You can read more about this here. I would also like to thank Dark Force and John Weidman (aka The Dumper) for their research notes on the SPC7110 register interface. For those who don't understand the hoopla about figuring out this compression algorithm when we already had graphics pack simulation, I should note that we have since found a few errors in these packs. Not to mention, you no longer need ~4-16MB packs for each game you wish to run. They work like any other game now. Better still, the chip can now be used to compress new graphics, eg for any future translation efforts on these titles. The real-time clocks in both Far East of Eden Zero and Dai Kaijuu Monogatari 2 will now save a ".rtc" file in your save folder, which contains the clock as set by the video game, as well as a timestamp from your computer when the time was last updated. It uses the difference between the saved timestamp and current time to update the time. This allows you to specify any time you like, whereas previously bsnes would just use your computer's current time, ignoring the time you set in-game. It also allows the "round clock by 30 seconds" option in both games to work. I avoided this before because this method makes supporting daylight savings time and such impractical, although I should note that the original hardware did not support DST, either. This method was required to pass the SPC7110 tests, and is overall much more faithful to how the original chips worked. Once again, I'd really like to personally thank neviksti for his tireless efforts. Eliminating graphics packs from SNES emulation was one of my primary reasons for getting involved in the SNES emulation scene. That neviksti managed to crack this algorithm means a lot to me. Thank you so much, neviksti. This release is dedicated to you, now go get some sleep Wink ________________________________________________________________________________ 2008-05-25 - v0.032a - Windows: file open filters are now working once again - All ports: emulation speed setting is now properly restored at startup ________________________________________________________________________________ 2008-05-25 - v0.032 - Core: simplified CPU / SMP flag calculations - Added ALSA audio output driver to Linux port [Nach] - Improved font handling for Windows and Linux ports - Greatly cleaned up the user interface - Windows port now uses Unicode instead of ANSI - Added localization support - Config and locale files can now be placed inside bsnes executable directory for single-user mode, if desired - Fixed crashing bug with HQ2x on Linux/amd64 port [RedDwarf, Nach] - Hid "Power Cycle" option by default, as it is too similar to "Reset" - Slighty tweaked program icon [FitzRoy] - Minor code cleanups -- replaced union bitfields with templates, improved memory allocation, etc ________________________________________________________________________________ 2008-04-13 - v0.031 New release posted. Perhaps the most important change was fixing a bug in the Windows port when the keyboard was used for input. For some reason, the IsDialogMessage() function I use for tab key support was causing the main window to emit the Windows error beep every time a key was pressed after a few minutes of use. I do not know why this is, so I have simply disabled the tab key support to prevent this from happening. Other than that, lots of polishing went into this release. UPS soft-patching will work with the recently released Der Langrisser v1.02 translation, for those curious. You can also store the UPS patches in GZ/ZIP/JMA support, and bsnes will detect this and decompress the patches first. Use the same ".ups" file extension for this, as it detects via file header. If you wish to try out the newly added OpenGL support: start bsnes, go to Settings->Configuration->Advanced and set system.video to "wgl" (or "glx" for Linux users), and then restart the emulator. Please bear in mind that ATI's OpenGL drivers are an industry-wide joke, so I'd only recommend trying this on an nVidia or Intel video card. Changelog: - Fixed bug and re-enabled HDMA bus sync delays - Emulated newly discovered IRQ timing edge case - Optimized offset-per-tile rendering - Added state-machine implementation of S-DSP core, ~5% speedup - Added SPC7110 detection, will now warn that this chip is unsupported - Fixed very annoying Windows port OS beeping noise when using keyboard for input - Linux port will now save most recent folder when no default ROM path is selected - Added OpenGL rendering support to Windows port [krom] - Fixed Direct3D pixel mode scaling bug [krom, sinamas, VG] - Improved SNES controller graphic [FitzRoy] - Added UPS (not IPS) soft-patching support; UPS patch must be made against unheadered ROM - As always, cleaned up source code a bit ________________________________________________________________________________ 2008-03-24 - v0.030 I didn't want to release a new version so soon, however there is a rather serious bug in bsnes v029 where the path information for the save RAM files is discarded when one has not selected a default save RAM / cheat path from the path settings tab in the configuration settings window. Because of this, it gets stored to the base directory. For Windows users, this is c:\, and for Linux users, this is / This bug forced my hand, so I'm releasing v030 to correct this issue. I also cleaned up the S-DSP emulation code to be more consistent with my programming style -- it gets bit-perfect matches to v029's wave output, so I don't foresee there being any problems. ________________________________________________________________________________ 2008-03-17 - v0.029 A new version of bsnes has been released. It contains a few minor emulation fixes, as well as user interface improvements. Behind the scenes, the source has been cleaned up more in preparation for running the CPU and PPU (video processor) separately from each other (eg with no enslavement.) This is required for implementing a clock cycle based PPU renderer. - Greatly improved invalid DMA transfer behavior, should be nearly perfect now - Major code cleanup -- most importantly, almost all PPU timing-related settings moved back to PPU, from CPU - Added option to auto-detect file type by inspecting file headers rather than file extensions - Rewrote video filter system to move it out of the emulation core -- HQ2x and Scale2x will work even in hires and interlace modes now, 50% scanline filter added - Re-added bsnes window icon - Added new controller graphic when assigning joypad keys [FitzRoy] - Redundant "Advanced" panel settings which can be configured via the GUI are no longer displayed - Improved speed regulation settings - XP and Vista themes will now apply to bsnes controls - Added "Path Settings" window to allow easy selection of default file directories - Tab key now mostly works throughout most of the GUI (needs improvement) - Main window will no longer disappear when setting a video multipler which results in a window size larger than the current desktop resolution - Added two new advanced options: one to control GUI window opacity, and one to adjust the statusbar text ________________________________________________________________________________ 2008-02-04 - v0.028 Changelog: - OpenGL (with hardware filter mode support) and SDL video drivers added to Linux port - OpenAL (with speed regulation disable support) and OSS audio drivers added to Linux port [Nach] - SDL input driver (with joypad support) added to Linux port - Emulator pause option added - Added option to select behavior of bsnes when idle: allow input, ignore input or pause emulator - Added support to remap common GUI actions to key/joypad presses on the "Input Configuration" screen - bsnes will now clamp the video output size when it is larger than the screen resolution - GUI library has been enhanced, and renamed to hiro - Fullscreen mode now always centers video, rather than approximates - Fullscreen mode now works correctly on Linux/Openbox - Extra layer of abstraction in src/ui has been removed, as GUI lib unifies all ports anyway - Video, audio and input drivers unified into standard library, named ruby - All custom headers have been merged into a new template library, named nall - Makefile rewritten, vastly improved. Allows quick toggling of compiled-in drivers - Makefile: all object files now placed in /src/obj, binary placed in / - libco greatly enhanced, no longer requires an assembler to build [byuu, blargg, Nach] - libco SJLJ driver added; bsnes should now build on any Unix-derivative now (Solaris, OS X, PS3, etc) [Nach] - Fixed register $213e.d4 PPU1 open bus behavior [zones] - Windows port will not activate screensaver while bsnes is running [Nightcrawler] - Visual C++ target no longer requires stdint.h - And lots more -- mostly code refactoring related ________________________________________________________________________________ 2007-12-22 - v0.027 This version replaces libui with miu -- a new GUI wrapper library, and cleans up large portions of the source code. Unfortunately, the GUI rewrite took far, far longer than I ever imagined. As a result, no work has gone into the core emulation for this version. But with the GUI rewrite out of the way, that should change in the near future. And thanks to the new UI library, I can now begin work on adding a cross-platform debugger to bsnes, at long last. Changelog: - Major source code cleanup (lib/, ui/miu/, ui/vai/) - Cheat code editor was broken in v0.026, this is now fixed - Cheat code file format simplified for human readability - Makefile install target improvements [belegdol] - libui replaced with miu GUI library - Custom video / audio / input drivers replaced with vai HW library - ppc and ppc64 libco targets added [Vas Crabb] - x86 and x86-64 libco targets now work on OS X [Lucas Newman] ________________________________________________________________________________ 2007-11-21 - v0.026 - Major source code cleanup - Completely rewrote memory mapper to support runtime MMCs - Updated S-DD1 MMC to use new memory mapping interface - Improved S-DD1 emulation, thanks to information from orwannon - Added support for SameGame -- load via "Load Special -> Load BS-X Slotted Cart" menu option - Completely rewrote cartridge loader to support BS-X, BS-X slotted carts and ST carts - Created custom dialog windows for multicart loading - Improved generic memory mapper, which eliminates the need for cart.db [Nach] - Added BS-X slotted cart detection to generic memory mapper [Nach] - Linux port will now ignore keypresses when window is inactive - Linux port will use much less CPU power when idle - Added detailed compilation instructions to Makefile for Linux port - Added "make install" target and PNG program icon for Linux port - Switched Windows compiler to MinGW/GCC4 - Windows executable is now packed with UPX to decrease filesize - Removed .ufo, .gd7 and .078 ROM extensions; added .bs extension - Added preliminary support for the BS-X base unit, BS-X base cartridge + MMC, and BS-X flash I/O ________________________________________________________________________________ 2007-10-16 - v0.025a My apologies, I added code to display an alert when the Sufami Turbo BIOS was not present at the last minute before the recent release. What I failed to realize was that I added the alert to the same routine that loads save RAM files. Meaning that whenever one loads a game that has not yet created a .srm file, one will get a warning that the save RAM file does not exist. Oops. You'll never see the warning more than once, and it's harmless, but for those it annoys, and for people who haven't upgraded yet, I've posted bsnes v0.025a. This version changes absolutely nothing other than disabling the warning box in question. I'll be sure to get a proper, tested fix into the next release. Again, I apologize for any inconveniece this may have caused. ________________________________________________________________________________ 2007-10-14 - v0.025 bsnes is exactly three years old today. I've posted a new version which adds DSP-3 and DSP-4 special chip support. The DSP-3 is used by SD Gundam GX, and the DSP-4 is used by Top Gear 3000. Please note that the DSP-3 is not fully emulated, thusly SD Gundam GX is not fully playable. Also, due to lack of timing emulation with the DSP-4, the Top Gear 3000 track sometimes flickers in split screen mode. However, it is believed that Top Gear 3000 is fully playable. I should also note that I have started on SuperFX emulation, as some will inevitably see said code in my source releases. What I have now is nothing more than a skeleton implementation, and absolutely nothing using it is playable yet. I am making absolutely no promises that I will ever be able to emulate this chip. It will take at least several months of work, and even then, the speed will probably be too slow to reach 60fps on any system, but ... I'm working on it. While I have no way to run tests on the actual SuperFX hardware, I will do the best I can to emulate the chip accurately. I will be emulating the caching and cycle delays as best I can, but the information I have on this chip is extremely limited, so don't expect miracles. Lastly, as promised, I have released the special chips I have personally emulated to the public domain. See license.txt for more information if interested. I cannot release the special chips whose code I did not write to the public domain, but all of that is already available under the GPLv2 (from ZSNES) or the SNES9x license. Changelog: - Added DSP-3 support, thanks to John Weidman, Kris Bleakley, Lancer, z80 gaiden - Added DSP-4 support, thanks to Dreamer Nom, John Weidman, Kris Bleakley, Nach, z80 gaiden - Started on support for SuperFX, no games playable as chip emulation is less than 1% complete - Unsupported special chips will now display an alert - Missing stbios.bin file when loading Sufami Turbo cartridges will now display an alert - Video settings now saved separately for windowed and fullscreen mode - Advanced option video<.mode>.synchronize can be enabled for vsync, but will cause sound crackling - Added menu option to toggle FPS counter - Minor source code cleanup ________________________________________________________________________________ 2007-10-01 - v0.024 This is an interim release between some major changes to the video mode support, which may take a long time to complete. It also fixes a bug with CGRAM access timing, re-adds the Sufami Turbo load menu, and adds support for the ST-010 coprocessor, used by F1 Race of Champions. To load Sufami Turbo cartridges, stbios.bin must be placed inside a folder named bios in the bsnes folder. There is not currently a warning if this file is missing. ________________________________________________________________________________ 2007-09-16 - v0.023 I've recently fixed a bug in bsnes that I feel is serious enough to warrant a new release, even though little else has changed. I attempted to build this release with MinGW, but ran into problems with profiling and JMA support, so this release was built with Visual C++ once again. Changelog: - Fixed serious bug in S-SMP incw and decw instructions -- fixes sound bug in Emerald Dragon - Added Nach's MinGW fixes -- can now be compiled with MinGW/GCC3 or MinGW/GCC4 - Fixed const char* cast warnings in GCC 4.2, thanks to [vEX] for the feedback - Updated source to use latest libraries for libco, libui, etc. - Added new advanced options to adjust aspect ratio correction - Cleaned up source code a bit ________________________________________________________________________________ 2007-08-04 - v0.022 Today marks a milestone for bsnes, and possibly for SNES emulation as a whole. With this new release, bsnes' compatibility has now reached 100.0%, with zero game-specific hacks. With every last commercially released game tested by both FitzRoy and tetsuo55 for at least five minutes each, all known bugs have been resolved. Now, needless to say, I am referring to the emulation of the base SNES unit. As many SNES cartridges contain additional coprocessors on their PCBs, there are still unplayable titles. So how can I claim compatibility of 100%? Because I don't consider special chips inside game cartridges as part of the base SNES hardware. I realize that many people enjoy these games, and I do actively attempt to emulate as many coprocessors as possible (six are supported thus far). However, coprocessors such as the SuperFX and SA-1 continue to pose very significant challenges. So, after nearly three years of development, I've finally achieved my primary goal. But it wasn't a complete victory ... I've learned a lot over the years. Emulation accuracy is not black and white -- there are heavy costs to pay and forced tradeoffs to achieve it. I no longer believe there is only one absolute path for emulation, as I did in 2004. So does this mean bsnes is now perfect? Of course not. There are many technical details that are not emulated correctly. This also does mean that there are no bugs, merely that there are no bugs that we are aware of. While absolute verification of 100% compatibility is obvioulsy impossible, even by actually beating every single game from start to finish, this very well should be the first time any SNES emulator could claim zero known bugs with all known games tested. I very much expect this announcement to entice many new users to begin actively searching for bugs, in an effort to discredit my above claim. My response? Go for it! I would very much appreciate any and all discovered bugs to be posted here, so that they can be verified and addressed. One major thing that needs to be said, is that there consists of one major hack in all SNES emulators, including bsnes: the use of scanline-based PPU renderers. This necessitates global hacks in all emulators to minimize their inaccuracies. I was going to write up a very long post here, going into specifics, but I've decided an article would be a better place for that. I will hopefully be writing up this article in a few days to post here. In the meantime, one very important issue does need to be addressed. This version fixes a bug in Uniracers 2-player mode, where the game writes to OAM during active display. Like other PPU global hacks, Uniracers required a special consession. But because this hack only affects one game, it can very fairly be seen as cheating. Suffice to say, bsnes does not contain a game-specific hack, and the change made to fix Uniracers affects all games, but I do still very much consider it to be a hack. The fix I have added is quite literally and honestly more accurate than the behavior of bsnes v0.021. Before, writes to OAM and CGRAM during active display went where a programmer would expect, which would cause bugs when ran on real hardware. Uniracers is the only game known to do this, and it is very dangerous to do so. The writes do go through, but not where one would expect. The access address basically changes as the screen is rendered. With a scanline-based PPU, it is not possible to emulate the individual steppings of the PPU, as there is not enough precision. Further, the entire SNES emulation community has virtually no information on how active display OAM and CGRAM writes work. Now, as Uniracers is the only game known to do this, I had the choice of either intentionally remapping the writes to an arbitrary location, or change it to the address Uniracers expects. Neither would be more accurate than the other, as both are completely wrong from a haradware standpoint. So the decision was to either fix Uniracers and deal with some calling it a game-specific hack, or to leave it broken with absolutely no gain to accuracy. Rather than decide for myself, I asked those who have supported me over the past three years for their opinions. The decision was unanimous to fix Uniracers. You can read the discussion, along with a more technical explanation of the issue, here. I will be addressing this topic in much greater detail in the article I will be writing up shortly. Changelog: - Fixed buffer overflow that was manifesting as corrupted tiles in Lemmings 2 - OAM and CGRAM addresses are now invalidated during active display, however the algorithms for how this address invalidation occurs is currently still unknown, so reads/writes are mapped to static addresses for now - Re-added cheat code editor. - Windows only: keypresses when main emulation window is not active are ignored once again ________________________________________________________________________________ 2007-06-10 - v0.021 This is a maintainence release. I am mostly releasing this for the sake of the recently released Der Langrisser translation. Changelog: Windows port can once again map joypads through the Input Configuration panel Using enter or spacebar to assign a key should no longer instantly map those keys F11 now toggles fullscreen mode Esc now toggles menu on and off (use F11+Esc combined to hide UI completely) Fixed a bug in King of Dragons (J, U, E), KOFF was not cleared during S-DSP power(), thanks to FitzRoy for the report, and blargg for assistance fixing the bug Fixed serious crashing error with File->Load on Linux/amd64 port Hopefully fixed min/max undefined error on GCC 4.2.0, but I am unable to test to verify Fixed many cast const char* to char* warnings for GCC 4.2.0, but some probably remain, as again, I am unable to test as I lack GCC 4.2.0 Set XV_AUTO_COLORKEY to 1 for Video/Xv renderer. Should fix some video drivers where there was no output, especially after running mplayer, etc. Thanks to sinimas for the fix Added clear_video() to Video/Xv renderer. Green edges at the bottom and right sides of the video output are now gone, and unloading a ROM will clear video I have finally figured out how to poll the keyboard status in real-time through Xorg: the XQueryKeymap function. I will be rewriting the Linux key capture system to use this, instead of capturing window key up / down messages through GTK+. This will finally allow me to completely abstract the UI from the hardware video, audio and input interfaces: a necessary step toward Linux joypad support. ________________________________________________________________________________ 2007-06-03 - v0.020 Five months and 43 WIP releases in the making, today I am releasing bsnes v0.020. I'd really like to express my thanks to blargg, for he has written a new S-DSP emulator that is an impressive 32 times more precise than all existing S-DSP emulators. It is now bus-accurate, and should produce bit-perfect sound output to that of a real SNES, excepting very minor, very extreme edge cases. Not only did he do this, he went out of his way to develop a special version exclusively for bsnes to ease licensing concerns and take advantage of bsnes' unique features, notably cothreads. I can't thank him enough. Unfortunately, bsnes has taken a ~10% speed hit over v0.019 by using this new S-DSP emulator, but I must stress the speed hit is entirely due to the way bsnes is implemented. blargg's standalone S-DSP emulator is very, very fast. Anyone is free to take a look at his S-DSP emulator, as he has released it as open source under the LGPL, by visiting his homepage, here. Unfortunately, the new cross-platform UI is not entirely finished. Some sacrifices had to be made to support libui. Specifically, the following features are missing from v0.019, but will hopefully be added back in future releases: - Fullscreen support - Input Configuration panel cannot capture joypad input. Joypad support is still present, but it must be mapped manually through the Advanced panel or through editing bsnes.cfg by hand - The Cheat Code Editor is missing, but cht files can still be used from bsnes v0.019, and created by hand - Sufami Turbo support is not accessible from the UI - The UI on Windows is slightly less polished due to compromises to allow the UI to be readable on Linux. I am sorry for the rough edges listed above, but I wanted to get a new release out, as it has been over five months since the last release, and I really want the world to be able to experience blargg's new S-DSP emulator. Changelog: - Added blargg's new S-DSP emulator, runs at 1.024mhz. Many thanks to blargg for this, as this puts all portions of SNES emulation except for the S-PPU at bus-accuracy - blargg's S-DSP core fixes bugs in both Koushien 2 (J) and Toy Story (U) - Corrected all S-SMP cycle timings to be hardware accurate. Thanks to blargg for creating an amazing test ROM that tested every possible opcode - Corrected S-CPU wai instruction timing, fixes Mortal Kombat II - Reverted HDMA sync emulation once more to fix Breath of Fire II (G) and Secret of Mana (U) - Completely rewrote user interface to use libui, which is a wrapper that allows the same code to produce the same UI on both Windows (through the Win32 API) and Linux (through the GTK+ API) - Corrected $2100.d7 OAM reset behavior, thanks to research from anomie - Massively revamped the Linux port, should compile with no warnings or errors now - Added 64-bit support to libco, tested on FreeBSD/amd64, should work on Linux as well - Revamped makefile with suggestions from Nach - Improved Linux Xv renderer to use the far more common YUY2 format, which should work on most Xorg drivers, allowing hardware accelerated video scaling - Completely rewrote config file system. bsnes.cfg is now saved to user's profile folder on both Windows and Linux, allowing multi-user support - A lot more work has been done behind the scenes, including massive code cleanups and portability improvements You may download the new version on the main bsnes page. ________________________________________________________________________________ 2007-01-02 - v0.019 I´m releasing bsnes v0.019 today. This version contains Bandai Sufami Turbo support, new IRQ emulation code, and some various bugfixes. Unfortunately, this release is not entirely cause for celebration. Due to fatal errors in Microsoft´s "enterprise class" c++ compiler package, I am no longer able to compile bsnes with profile guided optimizations. I have tested v0.018 with and without these optimizations, and the difference is a 40% speedup when PGO is used, even more significant than I had previously believed. However, bsnes has now become too complex for Visual C++ to handle. Unfortunately, there is nothing I can do about this, except wait for Microsoft to fix their compiler. (Warning: this paragraph contains personal opinions, skip it if you can´t handle that) As if this wasn´t enough, I´m now doing my best to wean my dependence from Microsoft´s line of operating systems, as I´m particularly concerned about the black box nature of Vista and its´ DRM control mechanisms. This isn´t a road I wish to begin traveling down, and thusly have no interest in upgrading to future versions of Windows. Therefore, as of late, I´ve been writing a UI wrapper that will allow me to code applications that are truly platform independent. The biggest goal for this library is to design a GUI for bsnes that runs virtually identically on both Windows and Linux/BSD. This is mostly complete, however there were many tricks I used in bsnes using the win32 API that I simply cannot do with GTK+ on Linux/BSD, such as the memory editor window subclassing. I will be porting bsnes to use this new UI wrapper, and in turn this will lessen the attractiveness / functionality of the bsnes UI to a certain degree. Perhaps the most devastating news is that I am still contemplating the idea of designing a dot-based PPU renderer for bsnes. As if the loss of PGO wasn´t bad enough, this will likely eat away an unimaginable level of performance as well. I can only estimate the speed loss being between 100-500%. Yes, it will be that bad. And despite weeks of planning, I cannot think of a way to allow a scanline-based and dot-based renderer to coexist as selectable options, given their massive differences in implementation. And let´s not even joke about SA-1 or SuperFX support ... those processors are each four to eight times more powerful than the SNES´ main CPU. All of these speed losses will basically make bsnes mostly irrelevant as an alternative to ZSNES, SNES9x et al. Although I believe I really came close to a viable alternative with v0.018, I know that I cannot both create a mainstream emulator, as well as keep with my original goal to emulate the SNES as accurately as possible. The past few months have been very tough for me; trying to decide which of the above two goals to pursue. I´ve still not absolutely made up my mind. But for now, I´ve been sitting on a mostly untouched version of bsnes for the last few months, and have decided to release it to the public, profile guided optimizations be damned. I´m once again asking for help, if anyone can figure out why bsnes won´t compile with PGO support, please let me know. I´d very much like to get one last PGO build of bsnes released before starting on a dot-based PPU renderer. But given the usual response I get from these requests for help, I´d suggest no one getting their hopes up that bsnes will ever be as fast as it once was again. The new version can be downloaded at the usual place. I´m leaving v0.018 up, as it may very well be the last stable, fast version of bsnes ever released. ________________________________________________________________________________ 2006-10-14 - v0.018 I began working on bsnes on October 14th, 2004. I am releasing bsnes v0.018 today to celebrate bsnes' two year anniversary. Please note that this release incurs a ~15% speed reduction since v0.017, due to IRQ and S-SMP timing improvements. Changelog: - Fixed many critical errors in IRQ timing, should be *very* close to real hardware now - Corrected major CPU timing bug involving CPU I/O condition 4 - Corrected bug with generic HiROM / LoROM memory maps - Corrected bug involving HDMA indirect channel termination [anomie] - OAM address reset now occurs when screen display is enabled, per recent research - Readded full DMA, HDMA and HDMA init bus sync timing - Added preliminary emulation of S-SMP $00f0 TEST register (6 of 8 bits are supported) - Readded emulation of known timing differences between CPU revisions 1 and 2 - Config file can now control scanline-based PPU render position. This will only be needed until a proper dot-based PPU renderer is added - Removed core debugging hooks so that debugging console can remain in public releases, it now functions as a tracer and memory editor - Config file paths once again work correctly even if missing trailing backslash - Video configuration simplified, sorry in advance to those who enjoyed the profile mode used before - Added new configuration screen to control some emulation settings - Replaced bsnes program icon with a much nicer one [FitzRoy] - Optimized memory speed detection algorithm - Preliminary UPS soft-patching support (do not use this yet!) - Decreased memory usage and optimized generic libraries used by bsnes (/src/lib) - Now caching OAM by one line, somewhat similar to a real SNES. Fixes Winter Gold, but causes line rendering error in Mega lo Mania - Lots more, as usual The following games have been fixed since v0.017 by the above bugfixes: - Battle Blaze (J, U) - Circuit USA (J) - F1 Grand Prix (J) - Funaki Masakatsu no Hybrid Wrestler - Tougi Denshou (J) - Jumbo Ozaki no Hole in One (J) - Mahjongg Taikai II (J) - RPG Tsukuru - Super Dante (J) - Robocop Versus The Terminator (U, E) - Sink or Swim (U, E) - Street Racer (J) - Touge Densetsu Saisoku Battle (J) - Winter Olympics (U, E) ________________________________________________________________________________ 2006-08-27 - v0.017 - This version adds major accuracy improvements, countless bugfixes and DSP-1 support. At the time of this release, the only remaining known bug in bsnes is with Uniracers 2-player mode, with well over 300+ games tested. Changelog: - DSP-1 support added [Andreas Naive, byuu] - Added cooperative multithreading library, written by myself - Rewritten CPU core, now bus accurate - Rewritten APU core, now bus accurate - Added cartridge database - Added several PCB mappers, thanks to research from Overload - Added several games to database, fixing several mapping-related bugs - Improved mirroring [Nach, grinvader, byuu] - vscroll bug in hires, interlaced mode fixed. Fixes RPM racing - RTO X=256 bug corrected. Fixes Super Conflict title screen [anomie] - Fixed bug in NTSC filter with hires games - Updated snes_ntsc to version 2.0.1 [blargg] - Fixed bugs in HiROM / LoROM memory mapping. Fixes countless games - Fixed major bugs in HDMA routine. Fixes ToP, Mortal Kombat and Genjuu Ryodan - Added out-of-order execution to CPU, APU synchronization for major speedup with no accuracy loss - IRQs are now delayed after H/DMA transfers. Fixes Wild Guns - HDMA transfers now kill active DMA channels that are on the same channel. Fixes Bugs Bunny and World Class Rugby. Special thanks to zones for researching this - CPU emulation mode accuracy was improved - Cleaned up port-specific code to ease porting - Created unified Makefile, used by all ports [Nach] - Created GTK+ port of bsnes (although input is currently broken) - WRAM is now initialized to 0x55, SRAM to 0xff. Fixes Power Drive, Death Brade and RPM Racing - Fixed extreme NMI / IRQ edge case. Fixes Chou Aniki - Adjusted PAL execution speed. Fixes Earthworm Jim 2 (E) sound effects - Fixed auto joypad polling bug. Fixes La Wares - Fixed H/DMA bug that was preventing saves from working in Secret of Evermore - bsnes low loads d3dx9_*.dll dynamically at runtime, it is no longer required - Added support for 239-line PAL mode rendering - As usual, there have been much more changes I've forgotten about since the last release - Two C4 bugs fixed. Mega Man X2 / X3 have no remaining known bugs [anomie, byuu] ________________________________________________________________________________ 2006-04-24 - v0.016 - Added Direct3D renderer with options for disabling hardware filtering and scanlines - Screenshots can now be captured in BMP, JPEG, or PNG format - Added config file option to specify default ROM and SRAM paths - Config file is always loaded from path to bsnes executable - Added support for analog mode joypad input - Up to 32 joypads can be used at once now - Fixed bug regarding enabling interlace mid-frame - Moved PPU rendering to V=240, from V=0 - Started on new debugger. So far only debug messages and memory editor added - Added joypad axis resistance option for analog input mode - Added config file option to set window style attributes - Added color adjustment settings for brightness, contrast, gamma, and scanline intensity - Added grayscale, sepia, and invert color settings - Added NTSC filter by blargg, HQ2x filter by MaxSt, and Scale2x filter - PPU now renders scanline 224 - Revampled about box - Added Game Genie / PAR cheat code support + editor, saves codes to .cht files - HDMA channels are no longer disabled when starting DMA, fixes Dracula X [DMV27] - Fixes to OAM priority mode (not perfect), fixes Final Fantasy: Mystic Quest [DMV27] - Fixed ENDX sound bug, fixes voices in Earthworm Jim 2 [DMV27] - bsnes should now compile with MinGW [DMV27] - Added DSP-2 support - Added OBC-1 support - Major rewrite of SNES address bus mirroring and MMIO handlers - Many address mirroring corrections, fixes Dezaemon, etc - Blocked invalid (H)DMA transfers, fixes Kirby's Super Funhouse - Wrote Win32 API wrapper and ported all GUI code to use it, should help to create Linux GUI later on - Revampled input system, should lead to customizable GUI shortcut keys later on - Fixed numerous bugs with input registers. Fixes many games that previous had their intro cut off (Super Conflict, etc), and many that never accepted input (Super Double Dragon, etc) - Moved auto joypad strobing from V=225 to V=227 - Killed OAM table caching and window range caching, as they were actually hindering speed - Rewrote input configuration screen to show currently mapped keys - Greatly enhanced configuration options for each video profile - Modified fullscreen mode to exit to windowed mode when menu is activated, use F11 to toggle fullscreen mode - Fixed bugs in txs, wai, brk, cop, and rti opcodes [DMV27] - Fixed bug with emulation-mode IRQs [DMV27] - Initializing DMA registers to $ff [DMV27] - Memory writes now update CPU MDR register (open bus) [DMV27] - Improved ROM header detection, fixes Chou Jikuu Yousai Macross [DMV27] - Reading OAM no longer updates OAM latch - Writing to OAM high table no longer updates OAM latch - Writing CGRAM now updates CGRAM latch - Improved pseudo-hires rendering [blargg] - Much, much more ________________________________________________________________________________ 2005-12-04 - v0.015 - Added GZ / ZIP / JMA archive support [Nach, NSRT team] - Fixed bug in APU ADDW/SUBW opcode flags, thanks to DMV27, anomymous for info - Mosaic support is now (mostly) hardware accurate, thanks to TRAC for info - Fixed a bug in SC tilemap clipping, fixes Seiken Densetsu 3 - Emulated pseudo-hires mode, uses a fairly poor color filter to simulate TV effect, the same one that SNES9x and Super Sleuth use - Rewrote the ROM loading code to be more port-friendly, and improved header detection - Added C4 emulation -- mostly correct. Only minor bugs remain, possibly not C4 related [Nach, byuu], also uses code from zsKnight, Overload, and anomie - Fixed noise channel generation for DSP, fixes Dual Orb 2 opening. Thanks to DMV27 for info - Fixed bug with DSP VxSRCN registers, fixes horrible sound corruption in Mortal Kombat 2/3 - Modified DSP KON register reading to act according to anomie's research, while still allowing Der Langrisser, etc. to play sounds correctly - Fixed a bug in CPU BCD math, fixes numbers in SimEarth, thanks to DMV27 for info - Rewrote the windows port from scratch - -- Added triple buffering support (buggy) - -- Added DirectInput (joypad) support, allows both keyboard and joypad to be mapped to the same SNES controller button. Only one controller supported for this release, will be improved shortly - -- Added pause key (mapped to Pause/Break) - -- bsnes no longer consumes CPU time when paused or when no ROM is loaded - -- Updated DirectDraw to 7, and added video mode configuration options to configuration file - -- Video modes can specify screen width+height, refresh rate, and render width+height - -- Added CTRL+[1-0] hotkeys for swapping video modes - -- Added +/- hotkeys for adjusting frameskipping rate - -- Added adjustable speed regulation. There are five modes, all can be adjusted inside the configuration file. CTRL+[+/-] will adjust the speed mode. - -- Added PPU options to toggle any BG / OAM layers with any priority, HDMA effects, and offset per tile effects - -- Added option to accept invalid button combinations (up+down, left+right) to joypad config menu - -- bsnes now properly clears the main window when unloading games - [code] Made destructors for base classes virtual, so the correct destructors will be called now ________________________________________________________________________________ 2005-11-13 - v0.014 This version adds speed regulation, greatly improves PPU rendering, and increases speed by ~30% over the previous version. Changelog: - Rewrote offset-per-tile mode emulation, should be correct now. Fixes Chrono Trigger, Contra III, Tetris Attack, etc. - Fixed a bug with HDMA occuring during interrupts. Fixes Tales of Phantasia souond test screen - Updated compiler to Visual Studio 2005, and enabled profile guided optimizations - Added conditional compilation of debugging functions (faster without them) - Added conditional compilation of core classes as pointers (allowing polymorphism) or objects (allowing inlining). The latter results in a speed increase - Small fixes to BG and OAM rendering routines - Corrected sprite tile bounds wrapping - Corrected sprite rendering in hires video modes - Rewrote color add/sub routines, should be correct now. Fixes Illusion of Gaia menu, etc. - Optimized video blitting routines, will temporarilly break mixed video mode screenshots - Prevented selecting menu options via return key from being recognized as keypresses by the emulator - Added system speed regulation (60hz/NTSC or 50hz/PAL)! Many thanks to kode54, GIGO, and Richard Bannister for their assistance I disabled the debugger and polymorphism, and enabled profile guided optimizations for this build, to maximize speed. The debugger and polymorphism can be re-enabled via uncommenting the respective #defines in src/base.h and recompiling, or bsnes v0.013 can be used. I may start releasing two separate builds in the future... not sure yet. ________________________________________________________________________________ 2005-10-24 - v0.013 - Greatly improved HDMA timing and accuracy with help from anomie and DMV27 -- fixes bugs in Energy Breaker and Street Fighter Alpha 2 - Fixed a problem with color add/sub code -- fixes opening battle in Tales of Phantasia and clouds in Energy Breaker - Temporarily added DMV27's bugfix for the DSP KON register -- fixes sound in Der Langrisser, but this is not a hardware-accurate fix - Disabled VRAM writes outside of vblank -- fixes Hook, but breaks many PD ROMs and fan translations (Roto's BS Zelda hack, Gideon Zhi's Ys 4 translation, etc). I might add an option in the future to toggle this behavior, but for now these games will no longer work. Please keep in mind these games will not run properly on real SNES hardware, either. - Improved frameskipping code thanks to a suggestion from Richard Bannister - Misc. other code cleanups and improvements (notably in the color table generation code) - bsnes is now endian-safe and runs on Mac OS X - Added caching support for window clipping tables resulting in a slight speedup. Please let me know if you spot any errors as a result of this change. ________________________________________________________________________________ 2005-10-02 - v0.012 Changelog: - Added S-DSP emulation - Added sound output support via DirectSound -- no sound buffering though, so sound is muted by default - Added option to record raw sound output to WAV files - Added multiple color adjustment filters to the video output - Added mode3/4 direct color support - Added mode7 direct color and mosaic support - Greatly improved mode7 rendering algorithm thanks to anomie - Fixed mode7 screen repitition and EXTBG effects - Greatly increased accuracy of NMI and IRQ timing, and emulated many newly discovered hardware quirks involving the two - A few speed improvements courtesy of Nach for profiling the code for me I'm now looking for assistance with sound buffering. Specifically, I need help modifying the DirectSound code to allow the emulator to be ran between 50%-400% normal speed, while keeping the sound output relatively good. If you have experience with this and can help, please get in touch with me (setsunakun0 at hotmail dot com). ________________________________________________________________________________ 2005-08-27 - v0.011 - Fixed Mode 0 color palette index problem. Fixes ToP, DQ5, etc. - Improved LoROM memory mapper to support 32mbit images. Fixes Tokimeki Memorial, etc. - Added full S-DD1 support, SFA2 and Star Ocean are now playable. Special thanks to Andreas Naive - Updated BGnxOFS / Mode7 registers with anomie's latest findings - Added basic ROM mirroring support. Fixes copy protection issues in MMX, etc. - Rewrote string library to work better on gcc/linux - Cleaned up S-RTC/S-DD1 emulation to make way for future add-on chip emulation - Rewrote DMA code, now runs cycle-by-cycle - Rewrote HDMA code, now allows HDMA to be enabled mid-frame, fixes many games - Fixed a bug in Mode7 vertical screen flip mode. Fixes FF5 title screen, etc. - Greatly improved IRQ triggering. Fixes Der Langrisser, etc. - Added full support for open bus. This includes PPU1 and PPU2 open bus support - Modified CPU core back to cycle-based system. Slower, but improves debugger - Implemented temporary fix for debugger to handle new cycle-based cores - Modified CGRAM to ignore highest bit, since it is not used at all by the SNES, and is impossible to read on real hardware. Lowers memory usage by ~1.2mb - Added mostly accurate PAL timing support. This should increase compatibility by ~30% or so - More stuff I'm forgetting at the moment... ________________________________________________________________________________ 2005-08-04 - v0.010 bsnes now supports SPC700 emulation (no DSP or sound support, however), and has greatly improved compatibility. It also now contains a keyboard-only joypad configuration tool. ________________________________________________________________________________ 2005-06-26 - v0.009 - Fixed non-interlaced display modes from not drawing every other frame - Changed OAM halve to skip every other scanline in 224-height modes - Updated renderer to properly support games that switch resolutions mid-frame - Fixed VRAM address remapping modes, fixes DQ3R, FF: MQ - Fixed a bug in main color window clipping affecting BGs - Added video color curve option, thanks to Overload for the idea + color table - Added vblank, FPS counter, and DDraw surface memory options to settings menu - Added fullscreen modes 640x480 and 1024x768 to video modes - Added option to toggle the menubar on and off by pressing the escape key - Mode3 was not rendering sprites - Priorities were wrong for modes 2-4, thanks to anomie for info - Fixed a serious bug in IRQ interrupts. May not be perfect, but helps many games ________________________________________________________________________________ 2005-06-22 - v0.008 moving the window + main color window clipping into the bg/oam/mode7 rendering routines themselves, I was able to greatly simplify the most complicated part of rendering: the final pass where color add/sub effects are applied. As a result, the new PPU core is not only ~35% faster (on graphics intensive screens, even faster on simpler screens), but more accurate as well. Awesome. In celebration, I´m releasing bsnes v0.008. I can actually run all games I have at >60fps on my Athlon 1.67ghz PC. Probably not something to brag about, though ... Oh, and I also updated the keyboard polling code to only capture keypresses if the main window has focus. I´ve been meaning to do this for the better part of a year now, but never got around to it. If, for some reason, you still want to use the old renderer, you can uncomment the first line in src/ppu/bppu/bppu.h and recompile the emulator yourself. Or you can use v0.007a, I´ll leave it up for a bit. ________________________________________________________________________________ 2005-06-12 - v0.007a ________________________________________________________________________________ 2005-06-12 - v0.007 I have done quite a bit, so I´ll try my best to recap most of the fixes since the last release... - HDMA was not running during DMA transfers - Emulator did not recognize any filetype other than .smc - Added configuration file support and imported my vector/string/config libraries into bsnes - Added option to use system RAM instead of video RAM for display, this can greatly increase speed on certain video cards - Increased speed by ~15% by adding 256x224 renderer (still very buggy when the SNES mixes video modes mid-frame) - mvn/mvp opcodes were not setting the DB register - Fixed joypad input in many games (Super Mario: All Stars, Dragon Quest III, etc.) - Major speedup with frakeskip option - Fixed default aspect ratio when emulator is first started There´s probably a lot more, but that´s all I remember offhand... this release should be a lot closer to the quality of v0.005a, but still needs a bit more polishing. ________________________________________________________________________________ 2005-05-13 - v0.006 The rewrite is now complete. I finished adding frameskip, and fixed some crashing issues with loading multiple ROMs. I wrapped all malloc/free calls with memalloc/memfree, which are custom functions that log each call, and let you pass sprintf-style arguments to them to debug memory leaks. Don´t see any, nor have I noticed any in bsnes; but it makes a nice test tool anyway. I found out today that the mvn/mvp instructions actually set the DB register to the destination bank. Weird. This fixed Final Fantasy V, Chrono Trigger, and Dragon Quest III (which now runs as a result) graphics. Not all of them, but quite a few. I had also previously been setting the M/X flags of the P register when xce was executed. I never anticipated a game using xce while in native mode to switch to... native mode... but apparently, Chrono Trigger does. And my code was incorrect. So now Chrono Trigger gets past the name select screen, but dies a few screens after still. The only really major flaw I am aware of that bsnes v0.005 did not have is with the battle screens in Squaresoft games. I get horrible flickering and "crushed scanlines" every other frame on them, for some reason. I´ll try and track that down for the next release, but I didn´t want to hold up a new release any longer. As a result, I´ll leave up v0.005a for the time being until I get this problem fixed. ________________________________________________________________________________ 2005-02-06 - v0.0.005a ________________________________________________________________________________ 2005-02-05 - v0.0.005 Released a new version of bsnes today. Version 0.0.005 is up on the main page now. The changes since .004 wip10 include: DRAM timing fix (now occurs mid-opcode), memory address speed fix, added CPU cycle condition 4 to all opcodes that use it, and fixed a bug where DRAM refresh was not changing start positions every other scanline. With the new version, Chrono Trigger should get a little further, and Final Fantasy 5 should get in-game now. The only problem FF5 seems to have is sprite corrution in the menus. I´m too busy with the CPU timing to mess around with the PPU right now, though. Also, the APU is not bridged to the CPU in this release, so compatibility is (still) really low. After I get the APU working fairly well, I´ll (try and) start keeping a what´s new file so that people can know what all changed between public releases of the emulator without having to follow this page. Sorry for the inconvenience in the mean time. ________________________________________________________________________________ 2004-12-24 - v0.0.004 ________________________________________________________________________________ 2004-12-13 - v0.0.003 wip1 ________________________________________________________________________________ 2004-12-11 - v0.0.002 ir11 Doubled the width of sprites when the width of the screen is 512. The SNES Test Program now runs through all of the character test correctly. The windows are off-by-one though. Added the very bizarre 00:4300-00:437f memory region that is unique from 7e:4300-7e:437f. Then I added read support from $2180. This allowed the SNES Test Program to not crash after failing the electronics test, and it also fixed the horrible graphics corruption in Der Langrisser. The fonts were still failing, so I went in with my tracer and found out what was causing it. The following code: gx816->regs.pc += (signed char)(arg + 2); This is the code used to increment the pc counter after relative branches. The problem is that I had parinthesis around the + 2 as well as arg. Therefore, if arg was 0x7e, 0x7f, 0xfe, or 0xff, it would change the sign. This would in turn make the program counter off by 256 bytes. Very bad. Fixing this fixed the font in Der Langrisser, and also fixed Super Mario World, when Yoshi spits a turtle out, the game will no longer crash. Next, via the Der Langrisser world map, I realized that anomie´s description of the BG/mode7 register latches was reversed: the BG registers (may) share a common latch between all of them, but the mode7 registers do not. I removed the common latches from the mode7 regs, but I haven´t added the latch to the BG registers yet. I also realized that clearing the entire screen on a BG mode change would probably not be a good thing for games that change video modes mid-frame. So I tried working on getting the weird single-frame garble that pops up every minute or so to go away, but to no avail. I´m having a difficult time tracking down the exact cause of the error, but I believe it to be a buffer overflow, or something along those lines. ________________________________________________________________________________ 2004-12-05 - v0.0.002 ir7 The bug in the Bahamut Lagoon mode7 screens turned out to be that I never added the dividend result to $4216/$4217. It always returned the multiplication of $4202/$4203. This also fixed the sprites in battles for Dai Kaijuu Monogatari. I added a bunch of window stuff, including a double size windowed mode, and a fullscreen mode. Lots of fixes to the interface, as well as code cleanup. It's still pretty buggy, there's a lot of variables to keep up with in the GUI at present... I also added better tile caching, I just cache all tiles when they are rendered, for all 3 color depths (4, 16, 256). Seems to help a little. A portion of the speed gain was lost by fixing the dividend result, though. Very strange, since I wouldn't think much work would go into a simple line of code that's called 20 times a frame probably at best... oh well. ________________________________________________________________________________ 2004-12-04 - First, I fixed some issues with the mode7 / scroll regs thanks to info from anomie. Qwertie's mode7 demo runs without modification now. Next, I fixed a small glitch with tiles getting cut off on the right edge of the screen, fixes some flickering on the edges in Zelda 3. Finally, I added tile caching to all 4 BG layers. It didn't really increase speed by much (~10%), and upped the RAM requirements by 1.2mb... I left the old code in case I need to fall back on it. My only guess (hope) is that the bottleneck lies somewhere else... ________________________________________________________________________________ 2004-11-27 - Had a small glitch in the OAM $2102/$2103 register settings, fixed that and now both Zelda 3 and Super Mario World always show sprites perfectly. The only error to my knowledge in the below screenshots is that the large version of the mario sprite in the third pic is not shown at the top left of the screen. Which could be because I have no mosaic support. But at any rate, both games should be completely playable now, albeit very slowly. I tried to speed up things by caching some stuff in the PPU, but I couldn't find a nice way to implement it that would result in a significant speed increase. Oh yeah, Zelda won't follow you in Zelda 3, but you can just go to the throne room and push the picture to the right yourself, and she'll appear when you reach the sanctuary. I also updated the debugger, it uses a smaller font, which is a bit harder to read, but saves a lot of screen space. This will definately be needed when I add in more of the debugging windows in the future, so it's better to get used to it now than later. ________________________________________________________________________________ 2004-11-21 - Added SRAM support. It's compatible with other emulators. It maps both the LoROM SRAM between $700000-$7dffff, and HiROM SRAM between $3n6000-$3n7fff (where n = 0 - f). Modified the screen to redraw at scanline 224, instead of 0. Fixes some flickering between screens in some games. Moved the lighting adjustment code ($2100 bits 0-3) directly into the PPU, rather than outside in the platform-specific code. This is because games have the ability to adjust this value per scanline. Also allowed the games to control the background enable ($2100 bit 7) flag per scanline now. This allowed Bahamut Lagoon's dragon intro to work. I then added mode2 support, so now all that's missing is modes 5 and 6 (interlaced). I also created an easy #define to select between the public domain mode7 code I wrote, and the snes9x mode7 code. I'll go through one of these days and rewrite the snes9x code in a clean environment (e.g. without using the current mode7 file as a reference) to avoid the issue altogether, but for now... the snes9x code is twice as fast, and that's good enough for me. Lastly, I also added in a trace checkbox to enable tracing. As such, the zip file of my work up now has debug mode enabled by default. I really need an overhaul of the gui implementation, and a configuration file. I have a very nice string library system (that I wrote myself) that I would love to take advantage of in this project. Here's some screenshots of the dragon intro. Lots of HDMA here, showing that I pretty much have HDMA down, now. I remember zsnes used to have a problem with these screens, and had to do something with an HDMA hack to get around it. They figured out what the problem was, eventually. I was actually quite surprised my emulator does not suffer from this same problem. Lucky for me, as they never did mention what the problem was to begin with. The HDMA is technically drawing too soon (at the start of the scanline instead of the end) which probably messes things up a bit, and I'm guessing the scroll registers are screwing up in one or two of the below pics. No mosaic support either. ________________________________________________________________________________ 2004-10-14 - Initial release