Ok, the new WIP adds ppu.hack.obj_cache = [true/false], and renames
the scanline render pos to ppu.hack.scanline_render_position = [dec].
OBJ cache defaults to off now, as two bugs are better
than four.
Made SDP a bit more friendly to view now. I may port that style over
to my main website, too. Specifically the non fixed width part.
[No archive available]
> Overall, I have a small list of possibles. Will wait until after
> R-Type to explore.
Damn :(
I don't think the R-Type III fix will correct anything else. But,
cross your fingers I guess. The new WIP fixes the aforementioned game.
My SNES tests seem to indicate that writing #$20 to $4200 when
VCOUNTER==VIRQ will trigger an IRQ, even after an IRQ has already
fired on said line. My tests today indicate that it will not trigger
an IRQ under the above circumstances when the I flag is set. I don't
know why, it's the only thing other than the final IRQ trigger test
that cares what the I flag is set to. I'm not happy with the fix, but
it's the only explanation I can come up with, and all IRQ sensitive
games are running, as well all IRQ tests are still passing. So for
now, it'll have to do.
I'm going to attempt to document all of SNES IRQs and see if I can
figure out a more simple method of emulating them, but I'm not
hopeful.
I also removed the "guessed" entries from my database. I've decided
not to add anything unless we definitively know its' PCB ID, or in the
case of ST games, if it doesn't have one.
Lastly, rewrote my SDP page on my site. It now uses XHTML 1.0 + pure
CSS2, so it should be a little easier on the eyes and a lot easier to
write documentation pages for.
[No archive available]
Ok, _please_ be courteous to my webhost and only download this WIP if
you're going to test it on a processor that hasn't been tested thus
far.
byuu.org/files/bsnes_v018_wip4.zip
byuu.org/files/bsnes_tests.zip
This has two separate builds. Neither have PGO, SSE, SSE2, ZIP or JMA
support. They are identical except for the FAVOR_ flag define and
title of the program.
FAVOR_ACCURACY [bsnes_accurate.exe]:
- Always tests OAM RTO flags even on skipped frames
- Tests NMI/IRQ trigger every clock cycle
FAVOR_SPEED [bsnes_fast.exe]:
- Only tests OAM RTO flags on rendered frames (always
with no frameskipping)
- Tests NMI/IRQ trigger using ranges
If you'd like to test, please run demo_mode3.smc on both versions of
bsnes, turn off speed regulation, and report the framerate both with a
frameskip of zero and a frameskip of nine (max), along with your
processor speed.
The other test ROMs are just to verify that IRQ behavior is still
reliable in both versions. A blue screen indicates passing, they all
pass on both versions. Don't expect test_* ROMs to pass on other
emulators, but demo_* ones should.
Example (my main PC):
AMD Athlon 3500+
Accurate:
- 121.5 fps w/o frameskipping
- 171 fps w/max frameskipping
Fast:
- 146.5 fps w/o frameskipping
- 271.5 fps w/max frameskipping
-----
As you can see, there are _major_ speed differences on my
A64. Personally, I'm all for accuracy, but I also want people to
actually be able to use this program in the interim. Perhaps in the
future when a low end computer is a current low-end Core 2 Duo, we can
remove all of the "speedhack" code. And in the meantime, the full 100%
precision is there for people who have the CPU power to afford it.
-----
If anyone wants to try and help, heh.
src/cpu/scpu/timing/irqtiming_accurate.cpp and
src/cpu/scpu/timing/irqtiming_fast.cpp are the two versions of the IRQ
testing code. If you see any ways to optimize either (preferrably the
former, obviously), I'd greatly appreciate it. Understand that both
the CPU counters (VCOUNTER, HCLOCK) and the IRQ timing positions
(VIRQPOS, HIRQPOS) can wrap not only the horizontal clock position
(1362->0), but the vertical position as well (261->0). And also that
they are "misaligned" by 10 clocks (which is really more of an
internal CPU IC delay thing, we aren't entirely sure why the
difference is there). You probably shouldn't mess with the code if you
don't understand the implications of this on eg range testing :/
I've written a new scheduler for bsnes to take 100% full advantage of
cooperative multithreading. Now, bsnes only performs jumps directly
from one thread to another (CPU->SMP instead of CPU->main->SMP), and
even then only when absolutely needed (eg CPU is accessing SMP when
CPU is currently ahead of SMP).
This unfortunately makes bCPU and bSMP no longer compile. However, it
does yield some impressive speed gains. From 109fps to 125fps.
By comparison, bsnes v0.017 yielded 128fps with my test
ROM.
The speed gain though is dependant upon how utilized the CPU<>SMP
communication is, the difference in speed between v0.017 and my WIP
can be anywhere between 1% and 10%, with the WIP always being slower.
The better news is that this is still without IRQs fully optimized. I
don't know how easy it will be to optimize these, if it's even doable
at all... but if I can, that would yield another very important speed
increase, making the next release the fastest ever. Here's to hoping.
The bad news though is that cothreading's advantages are pretty much
maxed out completely now. Don't expect any future leaps in performance
from this. Still, overall... a 40% total speed increase and double the
processor synchronization precision was definitely worth the effort,
even for the potential loss of savestates.
The scheduler should also make sPPU much faster when and if that's
ever started upon, but that's still going to take a very significant
speed hit over bPPU.
One last benefit of the scheduler is that the new synchronization
method isn't limited to only two clocks. I can now easily add another
clock, eg for SFX/SA-1. Not that I'll be emulating either of those
within the next year or two, though. Just saying...
I might also make two schedulers, one for cothreaded cores and one
for non-cothreaded cores. One thing is for certain though, I won't be
writing schedulers for every combination of cothreaded<>non-cothreaded
cores (there's 4 of them, CPU, SMP, PPU and DSP). And this will also
rule out run-time polymorphism's compile-time option, so expect that
to change to a compile-time only setting, meaning possibly two
versions of bsnes in the future.
Now then, I also fixed up S-CPU emulation mode opcodes. Direct page
wrapping, stack wrapping with native mode opcodes and processor status
flag fixes. No games use emulation mode, but accuracy is always nice.
[No archive available]
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)
Ok, reverted the SPCRAM initialization pattern, which
should fix Kamen Rider SD.
Verified DMA timing steps, I had them right. Still need to verify
HDMA/HDMA init, but they're almost definitely the same anyway.
Also, I noticed the spc700.txt doc by anomie on romhacking.net was
more recent than mine, and had info on $00f0 - TEST o_O
So, went ahead and added emulation for 5 out of 8 of these bits.
Notably, the CPU speed control bits and the RAM write enable bit. The
other three aren't well understood enough to add support for them just
yet.
Now, the CPU speed control in the S-SMP means the SMP core is taking
a significant speed hit to support this register. ~5% total speed hit,
though I can probably get that number down a little with some more
optimizations. I know the register is never used by any games, but you
know how I am. I added support for it anyway.
Note that the WIP doesn't like my inlining combination and is taking
a much more significant speed hit with global optimizations turned on,
so the WIP is ~13% slower than the last one.
> On a side note, kernel streaming method works with event
> notification per audio packet you feed into it, and that
> notification receives full precision time slices even without
> setting the timer resolution manually. At least, when I was using
> kernel streaming in my NES emulator, it didn't need vsync to output
> almost a smooth 60fps, while WaveOut mode outputs in bursts and
> requires vsync to smooth out the frames.
If you wouldn't mind turning that into a compatible derived Audio
class, I'd love to add this as an option into bsnes :)
It'll be drop-in and compile, so you don't have to worry about me not
adding the code this time. No problem if you don't have the time /
desire / patience to do this.
Although, I wouldn't want to do this if it requires 3rd-party
libraries / loading a special .sys driver into the kernel space /
Windows DDK to compile / something else crazy like that.
[No archive available]
New WIP should fix: RPG Tsukuru, Circuit USA, Jumbo Ozaki no Hole in
One (not a permanent fix, I'm not entirely happy with the HDMA timing,
but at least the name entry screen works again for now), and Taz-
Mania.
The two games you said started flickering since v0.017.07 might be
fixed now, but I'm not worried about these horizontal-line issues
regardless of when they started occurring at the moment. The other
ones you said would be fixed by setting HCLOCK=256 should be fixed as
well, as this is the new default value.
Super Mario Kart's line doesn't appear to flicker now, but I think
it's because I'm technically running the emulation a little too fast
again, due to the Ozaki fix. Another game you shouldn't expect to stay
fixed, and again another game I'm not worried about remaining fixed.
Koushien 2 and Mahjongg Taikai 2 are very likely still broken.
Uniracers definitely is. These appear to be the only three serious
known bugs remaining.
[No archive available]
- 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]
bsnes now builds with no warnings on Linux:
http://byuu.cinnamonpirate.com/images/desktop082106.png
However, input is not working unless you build the non-
GTK+ port (see below for more info).
I'm planning on releasing next weekend. This will likely be the last
public WIP, unless something major is found before the weekend:
byuu.cinnamonpirate.com/files/bsnes_v016_wip52.zip <-
copy/paste link
> If you can actually get it going fast in an all-in-one window like
> that it'd be cool. I normally just punt and have the GUI separate
> from the emulator output (GTK or Qt for the UI, SDL for the output)
> but it'd be nice for my NEStopia port if I could make it "one piece"
> like the Win32 original
I can. Please take a look at my above sourcecode, and check your
private messages for another note. Specifically, src/ui/video/sdl.cpp
and src/ui/gtk/gtk_mainwindow.cpp. I am able to merge the SDL output
into the GTK+ window by setting the environment variable
"SDL_WINDOWID=%ld", GDK_WINDOW_XWINDOW(mydrawingbox->window).
One important thing to note is that you must not initialize SDL video
until the render window has been realized. Simply showing the window
is not enough. You need to also clear all pending events in GTK+ after
showing the window before calling SDL video init, or it will die.
You can do that with this code:
gtk_widget_show(mainwindow);
while(gtk_events_pending() == true) {
gtk_main_iteration_do(false);
}
However, one problem I am having is that by calling
gtk_main_iteration_do(), it steals all SDL input, and I'm not able to
poll any keypresses. This happens whether I embed the SDL video output
into the GTK+ window or not. The only way to get SDL input is to
ignore all GTK+ events, effectively freezing the window completely.
I don't suppose you'd mind sharing how you got SDL
input working with GTK+ with me?
wip46 up. Adds all kinds of things, please test.
First, no more d3dx9_27.dll requirement to run the application, but
screenshots still work if you have any d3dx9_nn.dll files.
I specifically want to know if any of the other versions (24, 30,
etc) cause the emulator to crash when use. I'm pretty sure the
function is backwards-compatible, but we should probably make sure
before I make the next release and start getting bugreports about
screenshots crashing the program.
Note: there is no error message for failed screen
captures, I'll add that in eventually.
Next, the video options finally enable/disable controls depending on
certain settings. Should make using the video options a little easier.
Next, to enable SDL audio on Windows and remove the win32 port's
wMain.hwnd reference, I now pass GetDesktopWindow() to DirectSound's
SetCooperativeLevel function, since no sound comes out if you pass a
null handle. This is because I don't know how to get the window handle
from SDL, and I prefer to keep port-specific code out of there if
possible.
Note: SDL is not a windows port, but it builds on
windows, and thus needs DirectSound to output audio on windows.
I'm hoping this doesn't cause audio problems for anyone else, but
honestly I have no idea what DSound uses the window handle with
DSSCL_PRIORITY for anyway.
The $2100 luminance stuff was improved by adding rounding support to
the double-to-int casts, so fades should appear a little smoother now
in games.
Possibly fixed a bug where RTO wasn't being calculated when
brightness=0 and the screen is enabled. Didn't see any improvements in
the three known bugged games.
[No archive available]
Ok, one semi-large change if anyone wants to test.
byuu.cinnamonpirate.com/files/bsnes_v016_wip42.zip
This is built for maximum speed. No debugger, PGO enabled, favor
speed, no c++ EH (so no ZIP/JMA), and a new addition: links against
msvcrt instead of libcmt.
By using msvcrt and some evil linker hacks I was finally able to
build the SDL port again on Windows. So now I just need to focus on
cleaning that up so the next release will build on Linux out of the
box. Anyway, I tried it on the non-SDL port for the hell of it, and
noticed not only a 20% drop in EXE size, but a ~10-11% speedup as
well. Only problem is it requires msvcr80.dll, and I have no idea how
common that file is. So, that's what this wip is for. Does this
version work for you, and if it does, does it run faster? A direct FPS
comparison between v0.016 and v0.016.42 would be helpful if you're not
sure.
Ok, this WIP rewrites the input code and modifies the PAL clock speed.
Fairly major changes. Ideally, this will wipe out four bugs without
causing any new ones since wip37.
Bug fixes :
Earthworm Jim 2 (E) - adjusted PAL CPU clock speed.
Please test for *new* sound problems in PAL games
La Wares (J) + Galivan 2 (J) - no longer return 0 when
auto joypad is off for polling $4218-$421f
Super Conflict (J) - added anomie's new OAM RTO findings
to fix title screen
The input code was almost completely rewritten to simulate real
hardware more. As such, it's very possible there are new input bugs.
Ok, so then
byuu.cinnamonpirate.com/files/bsnes_v016_wip38.zip
Please only download if you intend to test games and report feedback.
This version is slower than normal, lacks ZIP+JMA loading, and has the
debugger enabled (that is only useful to me, it lacks a functional
user interface) which slows down emulation even more. eg you're better
off with v0.016 official if you just want to run games.
As always, please don't post this link anywhere else, or
I will be forced to remove the file to conserve bandwidth.
If anyone posts bugs that hasn't tested against wip37, can I please
have someone with wip37 verify/deny the bug presence in wip37 as well
as in 016 official? wip37 isn't on my website because I don't have a
lot of web space to spare.
Thank you to everyone in advance for helping.
Ok, I tried converting the switch/case table to a jump table for both
CPU+APU cores. Results? EXE is 70kb larger, compile time is 5-10%
slower, and speed is identical. Needless to say I reverted that change
back. I then tried narrowing down the cause of the PGO error. Found
out it was Dai Kaijuu Monogatari. If I don't run that, I can build
with PGO. Unfortunately, this is the ROM I use to stress optimize
color add/sub. So as a result, this game will run a little slowly now
(sort of like how Chrono Trigger's OPT title screen effects were
before). But, better one game than all, right?
byuu.org/files/bsnes_v016_wip27a.zip
Once again, please do not submit news about this to an emulation
site. The file will be removed if I notice anyone mentioning it
anywhere.
That will be 20-25% faster than wip27, but otherwise
everything is identical.
DSP1: there's either a bug in op02, op06, or in the getSr/getDr/setDr
functions. We have so far been unable to spot the error and correct
it. Help is always welcome, as always. Please consider DSP-1 support
as not being there at all. I doubt any games will work right with it
right now :(
This is how interlace works :
I call each frame a "field", meaning even or odd fields
on your television / monitor.
When interlace is off, I draw to the even fields every
time, so you don't notice anything.
However, when interlace is on, I alternate between which one I draw
to each field. So depending on your frameskip, this can cause serious
problems for interlace mode. I also only physically draw to "half" the
resolution each field, much like a real TV would. This makes 512x448
mode just as fast as 512x224 mode.
I can't think of an easy way to cheat the system with frameskipping.
Luckily, very very few games use interlace at all. Most use hires
512x224 and that's it.
Here's a WIP to try out, it's 20-40% slower than it
should be, due to PGO crashing the compiler*.
Please copy and paste link, and _do not_ post this on
emulation news sites or I will remove the file.
byuu.org/files/bsnes_v016_wip27.zip
Even though it's slower, could I get some people to try running
through a bunch of games and look for new bugs? Given I rewrote the
entire CPU+APU, it's possible some new bugs crept in.
* No release this weekend. Please be sure to thank
Microsoft personally for the delay.
rc /r /fobsnes.res bsnes.rc
cl /Febsnes.exe /nologo /O2 /GL /EHsc main.obj
libco.obj libstring.obj
libconfig.obj libbpf.obj reader.obj cart.obj
cheat.obj memory.obj bmemory.obj
cpu.obj scpu.obj bcpu.obj apu.obj sapu.obj
bapu.obj bdsp.obj ppu.obj bppu.ob
j snes.obj srtc.obj sdd1.obj c4.obj dsp1.obj
dsp2.obj obc1.obj adler32.obj co
mpress.obj crc32.obj deflate.obj gzio.obj
inffast.obj inflate.obj inftrees.obj
ioapi.obj trees.obj unzip.obj zip.obj zutil.obj
jma.obj jcrc32.obj lzmadec.obj
7zlzma.obj iiostrm.obj inbyte.obj lzma.obj
winout.obj bsnes.res kernel32.lib use
r32.lib gdi32.lib comdlg32.lib comctl32.lib
d3d9.lib d3dx9.lib ddraw.lib dsound
.lib dinput8.lib dxguid.lib /link
/PGD:bsnes.pgd /LTCG:PGOPTIMIZE
Merging bsnes!1.pgc
Generating code
\bsnes\src\apu\sapu\core\core.cpp(16) : fatal
error C1001: An internal er
ror has occurred in the compiler.
(compiler file
'f:\rtm\vctools\compiler\utc\src\P2\main.c[0x10CB9ABB:0x00000025]
', line 182)
To work around this problem, try simplifying or
changing the program near the l
ocations listed above.
Please choose the Technical Support command on
the Visual C++
Help menu, or open the Technical Support help
file for more information
LINK : fatal error LNK1000: Internal error
during IMAGE::BuildImage
What is on sapu\core\core.cpp(16) that's too complex
for Visual c++ to handle?
status.in_opcode = false;
Please, if anyone can simplify that for me, let me
know.
Seriously, though, if anyone can take a look at the source and fix
this compiler error I'd really appreciate it, and I'll get a release
out this weekend. I'm using Visual C++ 2005 Professional. Otherwise
I'll have to set it aside because I don't have time.
[No archive available]
- 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
- 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
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.
- 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.
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).
- 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...
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.
- 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
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.
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.
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.
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.
[No archive available]
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.
[No archive available]
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.
[No archive available]
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...
[No archive available]
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.
[No archive available]
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.
[No archive available]