Commit Graph

300 Commits

Author SHA1 Message Date
byuu 79b939e1c7 Update to bsnes v065 release.
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-06-27 12:29:18 +00:00
byuu 3ae74ff5a5 Update to bsnes v064r08 release.
Fixes Super Game Boy save RAM/RTC data.
Fixes a crash when you pass a null pointer for the second Sufami Turbo
cartridge, etc.

[No archive available]
2010-06-14 02:01:12 +00:00
byuu 7351b910c5 Update to bsnes v064r07 release.
Wow, that's probably a record for the longest time between two WIPs.
My priority has obviously shifted to language learning, but as time
goes on things should balance out better.

Okay, changes:
- linear_vector, pointer_vector and array are greatly improved: added
insert and remove (can insert or remove more than one item at a time
for O(n) performance); renamed add to append; improved array::find to
use optional<unsigned> instead of -1 trick ala the new strpos function
- fixed string to floating-point conversion for international systems
that use "," for fractions
- libsnes::snes_get_memory_(size|data) will return 0 if you try and
access: BS-X data without a BS-X cartridge loaded, same for ST, same
for SGB; this is in case someone tries to write a generic function
that writes all memory that is valid instead of special casing based
on the cartridge type they loaded
- libsnes::snes_load_cartridge_* returns a boolean result to indicate
success; always returns true for now, but it's meant to eventually
catch when libgambatte fails to load a GB cartridge -- bsnes itself
will never fail to load an SNES/BSX/ST cartridge
- Linux monospace font changed from "Monospace" to "Liberation Mono",
because the former is not monospaced when your desktop environment is
set to Japanese, etc.
- some other misc. cleanups

[No archive available]
2010-06-06 05:28:35 +00:00
byuu 6bbb609f2f Update to bsnes v064r06 release.
Updated to build using Xcode Snow Leopard+Qt/Cocoa 4.6.2+Macports
gcc44.
2010-05-03 14:04:30 +00:00
byuu 0d19902435 Update to bsnes v064r05 release.
- 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.

[Meanwhile, in bsnesui 2010-04-24...]

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

Probably the coolest thing about Python and .NET is that anyone can
now compile these GUIs and modify them just by having the run-times
installed. I really like the way MS is distributing the complete
development chain along with the run-time.
2010-04-25 08:39:41 +00:00
byuu 44bab83d68 Update to bsnes v064r04 release.
Fixes S-CPU debugger breakpoint issue.
libsnes always returns 0 for "no memory present" now, never -1U.

[Meanwhile, in bsnes-python 2010-04-20...]

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-20 22:33:44 +00:00
byuu 42a4c1d60e Update to bsnes v064r03 release.
Some changes to libsnes. Really hoping the API will be stable from
this point out ...
2010-04-19 17:37:14 +00:00
byuu 645689e683 Update to bsnes v064r02 release.
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-18 14:09:17 +00:00
byuu 8b0153daf0 Update to bsnes v064r01 release.
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-16 13:40:27 +00:00
byuu 9ca1e259cb Update to bsnes v064 release.
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-14 15:46:56 +00:00
byuu 7227107d5e Update to bsnes v063r14 release.
- 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-13 15:21:37 +00:00
byuu 65ff00e28a Update to bsnes v064rc1 release.
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-12 15:25:39 +00:00
byuu 717aa69d42 Update to bsnes v063r12 release.
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-11 13:00:48 +00:00
byuu 35fdb71f3d Update to bsnes v063r11 release.
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-09 16:00:03 +00:00
byuu c33f70a8c6 Update to bsnes v063r10 release.
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-07 14:40:59 +00:00
byuu 0a3fdc404d Update to bsnes v063r09 release.
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 18:38:43 +00:00
byuu efa7879c6d Update to bsnes v063r08 release.
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-05 13:28:36 +00:00
byuu b11f22f517 Update to bsnes v063r07 release.
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-04 18:42:09 +00:00
byuu 9614275b34 Update to bsnes v063r03 release.
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-04-02 15:22:04 +00:00
byuu 9995876bc5 Update to bsnes v063r02 release.
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-31 13:40:33 +00:00
byuu 43a3991ddf Update to bsnes v063r01 release.
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-29 17:41:11 +00:00
byuu 27c24bc8a6 Update to bsnes v063 release.
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-28 15:46:44 +00:00
byuu fac95dfec5 Update to bsnes v062r10 release.
Added make uninstall, and fixed up nall::function to also bind lambdas
that don't yet exist in GCC 4.4.

Spent most of tonight rewriting the standalone UPS patcher.
2010-03-24 14:19:38 +00:00
byuu 362542924e Update to bsnes v062r09 release.
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-23 12:12:10 +00:00
byuu 4179282244 Update to bsnes v062r08 release.
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:
http://blargg.parodius.com/snes-tests/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-21 07:36:46 +00:00
byuu 02820ef2e9 Update to bsnes v062r07 release.
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-19 12:50:55 +00:00
byuu 0ecce7b93d Update to bsnes v062r06 release.
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-18 15:32:55 +00:00
byuu f94fcd6f30 Update to bsnes v062r05 release.
To run this, you'll need the DLLs from v062r04's public beta, and the
updated snesreader.dll 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-17 12:58:18 +00:00
byuu 57f903630a Update to bsnes v062r04 release.
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 23:24:58 +00:00
byuu 9329de0a8d Update to bsnes v062r03 release.
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:

    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-15 15:20:52 +00:00
byuu 989648c21c Update to bsnes v062 release.
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-13 23:48:54 +00:00
byuu 0f0dcf9538 Update to bsnes v061r03 release.
This is probably the biggest accuracy fix in several years.

Thanks to the efforts of blargg and myself, bsnes is now the very
first emulator to properly emulate ALU multiplication delays. It's
100% bit-perfect.

Note that we don't yet know the underlying division algorithm. So in
this WIP, I just make it wait eight ticks before storing the results.
It _may_ cause some issues, but I wanted to get rid of the
status.alu_lock and config.alu_mul/div_delay garbage in advance.

I'm absolutely enthralled, I never thought I'd actually see this
emulated properly.
2010-03-13 15:40:21 +00:00
byuu 78e1a5b067 Update to bsnes v061r02 release.
Complete rewrite of adc + sbc opcodes, should fix:
- adc BCD overflow flag
- sbc BCD overflow flag
- sbc BCD invalid input value

Testing is appreciated, I believe Sim Earth is probably the most
likely to observe any difference.
2010-03-13 15:40:21 +00:00
byuu 79404ec523 Update to bsnes v061r01 release.
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-08 21:04:20 +00:00
byuu 6c59a2f1b4 Update to bsnes v061 release.
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-03-07 02:17:46 +00:00
byuu a295c86c05 Update to bsnes v060r12 release.
Added concept support, vastly improved foreach to handle break
properly and only compute the size once (based off concepts), extended
it to work QList, and updated cheateditor.cpp to use foreach
everywhere now.

Added an "Enable Cheat Engine" checkbox to the bottom left of the
cheat editor window with a tooltip to help explain it more. It
essentially simulates the switch on the Game Genie. A way to quickly
toggle all codes on and off, without having to check/uncheck each one
individually. Useful for the codes that lock up games between levels
and such. It's bound to the existing keyboard shortcut that did this,
and they both update the check state and system status properly.
Hopefully the GUI option will make more people aware of this
functionality.

Updated array, linear_vector, pointer_vector and lstring to support
std::initializer_list constructors. This allows:
lstring list = { "apple", "strawberry", 3.4, -27, true,
QString("why?") };
array<int> = { 3, 4, 9, 2 };

std::initializer_list is a pain in the pass, it lacks a subscript
operator, an at() function and a get() function. Forced to use
constant iterators to read out the contents.

[No archive available]
2010-03-06 08:11:35 +00:00
byuu a539f2f578 Update to bsnes v060r10 release.
Fuck, adding #include <iostream> grows the Windows binary by 300KB
pre-UPX, and 100KB post-UPX. And I'm only using std::cout to avoid the
very last call to printf(). I may just say fuck it and stick with
stdio.h instead.

Nothing really big in this one.

Added "Select All" + "Clear All" buttons to the cheat finder
Added move semantics to dictionary, array, linear_vector and
pointer_vector
Killed class noncopyable and replaced it with proper class(const
class&) = delete; (inheriting noncopyable makes some classes non-POD)
Added type-safe variadic sprint() and print() functions, which are
designed to replace sprintf() and printf(), which I only use for bug-
testing anyway
Couple other small things like that

[No archive available]
2010-03-03 07:00:13 +00:00
byuu e710259611 Update to bsnes v060r09 release.
This release parses the 1.3MB cheats.xml file about 960x faster than
the last release, no exaggeration at all there. The tiny 5-10ms lag to
search now is probably more due to Qt than anything else. It also
won't eat up an extra 40MB of RAM, instead only using about 100KB now.

So yeah, please give it a try and let me know what you think of the
new cheat lookup system.

Aside from that, I fixed a tiny S-CPU typo bug where the IRQs were
being tested one cycle too early in op dp,x and op dp,y opcodes.

I also redid a bit of nall in C++0x. Most importantly, I've added move
semantics to nall::string, which should cut out ~20% of the memory
allocations bsnes needed before. I really wanted to write a variadic
template string::printf replacement, but I couldn't come up with a
syntax I liked, and I didn't want to write a sprintf clone because
that takes forever and is ugly. So I just said fuck it, removed
string::printf (and with it the very last vestige of va_list in all of
my code, good riddance), and updated the str* functions to take
template arguments to specify padding length and character. Both
optional, another fun C++0x only thing - default function template
arguments.

Before: string foo = string::printf("%.4x", variable);  -- went
through raw sprintf(), va_list, and had a limited 4k buffer
After: string foo = strhex<4>(variable); -- manually built by hand, no
buffer issues

nall/utility.hpp got my own copies of std::move and std::forward. I
have no problem using the std:: ones, but the <move> header seems to
be missing, and I already have my own traits library, so that was easy
enough for now. Added a move-semantic swap as well. Using nall::sort
on an array of nall::string objects should be almost as fast as
sorting integers now.

The cheat code editor .. whenever you import into a new slot, or clear
that slot, it will uncheck the box now as well.

[No archive available]
2010-03-02 07:47:07 +00:00
byuu f1d1ab7ed1 Update to bsnes v060r08 release.
This version embeds mightymo's cheats.xml inside the bsnes executable.
It's about 1.3MB, but thankfully Qt compresses it heavily first, so
the binary only grows by 100kb. BZip2 doesn't fare as well,
surprisingly, and grows the source archive by 200kb. I think it's
worth it.

The cheat code editor window gets a new button, "Find Cheat Codes ..."
If you click it, it will match the SHA256 of the currently loaded game
to an entry in the database. No matches? It apologizes for letting you
down. But if it finds some, and there's a good chance it will with
~1500 entries, it gives you a list of them. Check the codes you want
and they are imported into the available slots. The way it works is
the first checked code goes to the first empty slot, the second
checked code to the second empty slot, and if there aren't any slots
left available (very unlikely), it won't import them.

It's incredible, actual innovation in the SNES scene.
- no more web searching for codes
- no more applying codes for the wrong revision, or the wrong country,
or whatever
- no more flat out broken codes
- no more having to name the codes yourself
- cheat grouping avoids the need to add and toggle multiple slots to
get a single effect

Anyone who likes this, please send a thank you PM to mightymo77 and
tukuyomi. They deserve all the credit for the amazing database that
makes this possible.

Now then: **major caveat, for the love of god read this first!** My
XML parser is ... brutal on this file. It has to allocate memory for
each attribute and each element. And ... it rapes the ever loving SHIT
out of malloc(). Oh my god. On my E8400, it takes a good 30 seconds to
parse the 1.3MB database on Linux. And on Windows, holy god, it has a
horrendous version of malloc. It takes at least 3-5 minutes.
Seriously, go make yourself a cup of coffee if you are running
Windows.

I only have to parse the file one time per program run, and I only
parse it when you click the find cheat codes button for the first
time. But yes, it is painful. Very, very painful.

[No archive available]
2010-03-01 05:59:52 +00:00
byuu 1934197fb7 Update to bsnes v060r07 release.
Feeling amazing tonight. The low of fighting a bad cold for the past
week, blocked nose, bloody lips and wrist pain combined can't hold me
down.

Two years of searching and I finally found the Midnight Panic EP, and
it's amazing. And from this WIP forward, bsnes now uses C++0x instead
of C++03. I feel like I've been given this new amazing language, and
there's all these wonderful new possibilities for cleaning up and
simplifying code.

foreach is the most amazing concept. The only reason I've made it this
long without it is because I never got to use it. You will pry this
one from my cold, dead hands. Already applied it to the cartridge and
memory classes. It's insane.

Before:
    for(unsigned i = 0; i < memory::wram.size(); i++) memory::wram[i]
    = config.cpu.wram_init_value;
    for(unsigned i = 0; i < cartridge.mapping.size(); i++) {
    Cartridge::Mapping &m = cartridge.mapping[i];


After:
    foreach(n, memory::wram) n = config.cpu.wram_init_value;
    foreach(m, cartridge.mapping) {


Before:
    for(unsigned i = 0; i < 32; i++) {
    char value[4];
    sprintf(value, "%.2x", shahash[i]);
    strcat(hash, value);
    }


After:
    foreach(n, shahash) hash << string::printf("%.2x", n);


And that's just the first thing! So many things I can do now. Can't
wait to come up with uses for all the new features to simplify code
even more.
- auto type inheritance
- variadic templates to nuke the last vestiges of va_list and its
associated horrors
- strongly typed enums (no more enum Mode { ModeOfRedundancyMode }
shit. enum class Mode : unsigned { Normal, BSX };
- _real_ static assertions with actual error messages instead of 40
pages of template errors
- default templates parameters to template functions (but still no
function partial template specialization, grrr)
- property class can be implemented natively without having to trick
GCC into using template friend classes
- rvalue references will allow my string class and such to implement
move semantics, no more useless copying
- uniform list initializers, lstring foo = { "a", "b", "c", ... };

And that's just what's there now, it's only half-way done. The
completed support will be even more awesome:
- lambda functions
- nullptr
- class variable initialization in the header instead of needing
constructors
- native functors to replace nall::function with
- string literals in UTF-8
- native multi-threading support
- and so much more

[No archive available]
2010-02-28 08:37:56 +00:00
byuu e1c8757a10 Update to bsnes v060r06 release.
Completely rewrote the syntax for all XML parsing, took over five
hours of nonstop work, holy fuck.

Sadly the expanded syntax greatly increases the parser complexity, the
SNES::Cartridge class is twice as big now, XML parsing for all special
chips takes up 20KB of space.

Example:
    void Cartridge::xml_parse_sdd1(xml_element *root) {
    has_sdd1 = true;

    foreach_element(node, root) {
    if(node->name == "mcu") {
    foreach_element(leaf, node) {
    if(leaf->name == "map") {
    Mapping m((Memory&)sdd1);
    foreach_attribute(attr, leaf) {
    if(attr->name == "address") xml_parse_address(m, attr->content);
    }
    mapping.add(m);
    }
    }
    } else if(node->name == "mmio") {
    foreach_element(leaf, node) {
    if(leaf->name == "map") {
    Mapping m((MMIO&)sdd1);
    foreach_attribute(attr, leaf) {
    if(attr->name == "address") xml_parse_address(m, attr->content);
    }
    mapping.add(m);
    }
    }
    }
    }
    }


Of course, C++ doesn't have foreach(), that'd be too goddamned
convenient, right? So behold the spawn of satan himself:

    #define concat_(x, y) x ## y
    #define concat(x, y) concat_(x, y)

    #define foreach_element(iter, object) \
    unsigned concat(counter, __LINE__) = 0; \
    xml_element* iter; \
    while(concat(counter, __LINE__) < object->element.size() \
    && (iter = object->element[concat(counter, __LINE__)++]) != 0)

    #define foreach_attribute(iter, object) \
    unsigned concat(counter, __LINE__) = 0; \
    xml_attribute* iter; \
    while(concat(counter, __LINE__) < object->attribute.size() \
    && (iter = object->attribute[concat(counter, __LINE__)++]) != 0)

[No archive available]
2010-02-27 10:04:33 +00:00
byuu 768e9b589d Update to bsnes v060r05 release.
Forgot the -lXext thing, saw it when posting. It'll be in r06.

Updated the XML parser, will reject a lot more invalid stuff, and
it'll parse comments, <? and CDATA stuff. I haven't seen PCDATA
mentioned anywhere in the spec, so fuck that for now.

Went back to using offset= for SPC7110 data ROM. Thinking about it
more, using offset= allows you to put the data ROM anywhere in the
file, even before the program ROM. size= forces it to go at the end no
matter what. Now, ideally, you want to define both, but offset= should
be more important.

[No archive available]
2010-02-25 05:00:34 +00:00
byuu 582f17b330 Update to bsnes v060r04 release.
I wrote a dedicated XML parser for nall::string, and updated
SNES::cartridge to use that instead of the ad-hoc implementation. It's
still not W3C-quality with 100% standards-adherence, but it's at least
an order of magnitude better now.

The parser supports infinitely nested elements and attributes via
pointers to child nodes, supports both single-tag <eg /> and tag-with
content <eg>content</eg>, and properly handles and validates the
<?xml?> header.

It doesn't fully ignore comments yet, but you should be okay anyway.
Whitespace culling, especially inside tags, still needs a bit of work.
It will properly reject the entire document if there are unopened /
unclosed tags now.

All in all though, it's very small. Only 3KB for the whole parser.
Usage example:

    void Cartridge::parse_xml_cartridge(const char *data) {
    xml_element *document = xml_parse(data);
    if(document == 0) return;

    for(unsigned i = 0; i < document->element.size(); i++) {
    xml_element *head = document->element[i];
    if(head->name == "cartridge") {
    for(unsigned n = 0; n < head->attribute.size(); n++) {
    xml_attribute *attr = head->attribute[n];
    if(attr->name == "region") {
    if(attr->content == "NTSC") region = NTSC;
    else if(attr->content == "PAL") region = PAL;
    } else if(attr->name == "ram") {
    ram_size = strhex(attr->content);
    }
    }

    for(unsigned n = 0; n < head->element.size(); n++) {
    xml_element *node = head->element[n];
    if(node->name == "map") {
    parse_xml_map_tag(node);
    }
    }

    break;
    }
    }

    delete document;
    }


Also updated DSP-3 and DSP-4 to separate ::DR and ::SR, SPC7110 uses
size= for program ROM size calculation now (makes more sense than
using offset=), added PCB info to BS-X, Sufami Turbo and Game Boy
cartridges to give additional meta-data (SGB emulation will properly
size RAM / RTC files again), and updated snesreader with these
changes.

And for better or worse, I made the vector classes copyable. Not
actually used by anything at the moment. I wanted to do:
struct xml_element {
vector<xml_element> element;
};

But obviously that causes an infinite recursion when the vector's copy
constructor is called, hence why I had to use pointers.

[No archive available]
2010-02-23 08:21:20 +00:00
byuu 23866a348d Update to bsnes v060r03 release.
Okay, this should get 100% compatibility back up again. All special
chips map via XML, and I also support BS-X, ST and SGB games again.
Only regression is that SGB currently forces on SRAM size to 128KB for
each loaded game. I need to move that into snesreader, and hook it
into the cartridge interface. Too much work to do it tonight, but in
time ...

Given the extensiveness of this, heavy testing appreciated. Let me
know if you spot any broken titles please.

[No archive available]
2010-02-22 09:33:13 +00:00
byuu d0de306546 Update to bsnes v060r02 release.
This one is not for the faint of heart.

All header detection code has been removed from the official bsnes
binary. It can now only load games with a valid XML memory mapping
file. If you have /path/to/zelda.sfc, then you also need
/path/to/zelda.xml that describes how to load the cartridge.

The 'ext' archive above contains a new version of snesreader, as well
as its DLL. snesreader now contains header detection, as well as XML
mapping generation. If you have snesreader, and no XML file,
snesreader will create one for you. It won't store it on your hard
disk, it'll only be in memory. An XML on the hard disk always
overrides the snesreader's auto-generated XML file.

So far, only normal ROMs, S-RTC, S-DD1 and SPC7110 games are up and
running. Everything else is broken, I'll have to fix them one by one
by extending the id= attributes in the XML parser.

Here's some example XML files:

    <?xml version="1.0" encoding="UTF-8"?>
    <cartridge ram="2000">
    <title>The Legend of Zelda - A Link to the Past</title>
    <pcb>SHVC-1A3M-30</pcb>
    <map mode="Linear" address="00-7f:8000-ffff" id="ROM"/>
    <map mode="Linear" address="70-7f:0000-7fff" id="RAM"/>
    <map mode="Linear" address="80-ff:8000-ffff" id="ROM"/>
    <map mode="Linear" address="f0-ff:0000-7fff" id="RAM"/>
    </cartridge>


    <?xml version="1.0" encoding="UTF-8"?>
    <cartridge region="NTSC" ram="2000">
    <map mode="Direct" address="00-3f:4800-483f" id="SPC7110::MMIO"/>
    <map mode="Direct" address="80-bf:4800-483f" id="SPC7110::MMIO"/>

    <map mode="Direct" address="00-3f:4840-4842" id="SPC7110::RTC"/>
    <map mode="Direct" address="80-bf:4840-4842" id="SPC7110::RTC"/>

    <map mode="Linear" address="00:6000-7fff" id="SPC7110::RAM"/>
    <map mode="Linear" address="30:6000-7fff" id="SPC7110::RAM"/>

    <map mode="Shadow" address="00-0f:8000-ffff" id="ROM"/>
    <map mode="Shadow" address="80-8f:8000-ffff" id="ROM"/>

    <map mode="Direct" address="50:0000-ffff" id="SPC7110::DCU"/>
    <map mode="Linear" address="c0-cf:0000-ffff" id="ROM"/>
    <map mode="Direct" address="d0-ff:0000-ffff" id="SPC7110::MCU"/>
    </cartridge>

[No archive available]
2010-02-21 00:27:46 +00:00
byuu 2af60d0a13 Update to bsnes v060r01 release.
This WIP fixes the S-PPU overflow issue mentioned by PiCiJi. It won't
cause any difference in terms of accuracy, for reasons I explained
earlier the effect was transparent, but it's good to do things the
right way.

It also adds a new ExSPC7110 memory mapping mode that allows for a 2MB
program ROM. This is an absolute necessity for the Far East of Eden
Zero translation.

[No archive available]
2010-02-15 02:05:28 +00:00
byuu a8263afc24 Update to bsnes v060 release.
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-02-09 00:58:03 +00:00
byuu a9943ab4f4 Update to bsnes v059r07 release.
Fun WIP, lots of work put into this one.

First, I added .st, .bs, .gb, .sgb, .gbc folder-based loading. Works
the same as .sfc folders. So far, only .st shows additional preview
info (just the ROM size for now), but the base code is in place to
specialize .bs / .st / .(s)gb(c) cartridges next.

Next, I added overscan configuration settings to the video settings
window. The reason for this is twofold:
1. testing your translation / hack without a real TV, you can set
overscan to 6% in all directions to ensure all the text is onscreen
2. for the smart video scale mode, noted below
Now, when in fullscreen mode, you get three additional scale settings:
Scale Max - Normal (keeps aspect ratio, maxes out height)
Scale Max - Fill (fills as much as the screen as possible, no
cropping)
Scale Max - Smart (splits the crop and aspect ratio distortion, 50/50
on each; try it, it looks fairly decent in most titles)
No scale max - zoom, because that's just too much cropping; almost
nothing plays well with it

Note that cropping doesn't work so great right now for games that mix
lores and hires (Secret of Mana 2 textboxes, for instance.) I'm
working on it, but it's going to be very tough. All filters take solid
screen sizes quite well, which surprised me.

Also, scale max - smart is for widescreen monitors. It makes zero
sense to use it in portrait mode. I'll add some sort of special case,
just in case anyone crazy tries it, in a future build.

Lastly, I killed the separation of video.cpp and pixelshader.cpp, it's
all inside video.cpp now; and I cleaned up the object names in
video.cpp.

Scale Max - Smart + Curvature pixel shader + NTSC filter - R/F +
Scanlines - 70% is an incredible sight to behold. So much processing,
yet still easy to get 60fps with perfectly synchronized video and
audio. Add that with the Xbox 360 gamepad, throw in a nice S-MSU CD-
quality soundtrack, and it's nirvana.

Please try out the Scale Max - Smart mode if you are using a
widescreen monitor and let me know what you think.

[No archive available]
2010-01-27 09:25:22 +00:00
byuu 46a1eb8cce Update to bsnes v059r06 release.
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-24 23:21:38 +00:00
byuu 4517c0249f Update to bsnes v059r05 release.
Funny, much more effective changes but in a lot less time. The file
dialog is just a major pain in the ass, I guess. Had to sit and think
for at least two hours just to handle the differences between activate
(double-click an item) and accept (click accept button.) Eg if it's a
folder, double-clicking needs to go into the folder, but the accept
button needs to use that folder. But files act differently, load has
the open-folder thing that overrides the default entering of folders,
and saving doesn't have any such concept at all. Fun fun fun, but done
now.

libqb (QbWindow, QbCheckAction, QbRadioAction) is dead; DiskBrowser is
dead; HexEditor is dead. They've all been merged into nall/qt now.
nall/Makefile-qt goes to the more logical nall/qt/Makefile. The last
thing to do is export style sheet defaults into nall/qt to get the
spacing of the new file dialog under control.

Improved the save dialog, instead of putting the entire path in the
box, it only puts the non-directory part, and pulls the directory from
the file system mode's root path. I decided not to allow .. and /
commands inside the save text box. I just strip all that out. Go to
the damn folder you want to save in, sheesh. And before anyone
complains about that, note that bsnes doesn't even use the save dialog
mode :P

Still have to hook up the new folder button to an actual dialog,
haven't bothered yet. Since there's plenty of room with the extended
width, I'm just going to leave them both visible.

nall/qt/hex-editor is pretty much a direct port, no changes. But I
intend to make the height programmable, and fork that into a stand-
alone, super light-weight hex editor to replace bless (so that I can
remove Mono.) Same for check-action and radio-action, direct ports.

nall/qt/window is a bit different, binds the geometry outside the
constructor. This fixes some issues where certain windows weren't
saving their geometry properly, like the debugger properties window.
And I think there's some other advantage to it not needing a
complicated constructor, but I don't recall what at the moment.

Modified GL_CLAMP_TO_EDGE to GL_CLAMP_TO_BORDER, so everyone can try
out the curvature pixel shader now. Added it to my pixelshaders pack,
but I haven't uploaded a new pack yet, so get it from the other thread
for now.

I mainly need testing on the new file dialog stuff. Please let me know
if something strange is broken, other than the new folder button.
2010-01-18 16:25:02 +00:00