Compare commits

...

5 Commits

Author SHA1 Message Date
byuu
81f43a4d01 Update to snes-20100807 release.
This represents a major code restructuring. The dot-based and
scanline-based renderers are now split into two separate core
libraries, asnes and bsnes.

For now at least, these are -internal- names. I'm not entirely decided
on how I'm going to handle releasing these two separate builds.
Regardless, the folders need names.

asnes has had all of the processor subfolders collapsed back into
their parent folders. In other words, ppu's functions were moved into
ppu/sppu, and then ppu was deleted, and then ppu/sppu became the new
ppu. Repeat this for the cpu, smp and dsp and there you go.

asnes/dsp also removed the DSP_STATE_MACHINE option. This was done for
the sake of consistency with the rest of the core.

asnes' debugger mode is currently extremely broken, but I will be
fixing it in time.

And for now, bsnes has kept the processor abstraction layer. I may
keep it around, not sure yet. It doesn't hurt speed or anything, so
I'm not too worried about making a decision right away.

I may throw snesfilter, snesreader and supergameboy into this folder,
just to have everything in one place. The alternate GUI forks are
definitely going in there as dotnet, cocoa and python.

Compiled output goes to the out/ folder now, to prevent conflicts with
a file and folder named bsnes, for instance.
2010-08-07 15:07:24 +00:00
byuu
9ea739aec1 Update to bsnes v067r05 release.
This will be the final release with the current source structure.

This WIP contains a bugfix so that the last scanline does not fetch
OAM items. This fixes flickering in Ninja Warriors and Lord of the
Rings.
2010-08-07 11:44:19 +00:00
byuu
254a5016e1 Update to bsnes v067r04 release.
This build simplifies the tile cache significantly, and it now builds
the cache and fetches the VRAM data during Hblank, the VRAM reads are
modeled after real hardware.
This fixes Mega lo Mania without regressing Winter Gold or Adventures
of Dr. Franken.
I also fixed a pseudo-hires back color glitch in Super Buster Bros.
2010-08-06 14:06:31 +00:00
byuu
dcc661cb28 Update to bsnes v067r03 release.
This substantially improves the S-PPU dot-renderer's sprite
processing. Instead of happening immediately at the start of the
scanline, each pixel is rendered one at a time. It eliminates the
SpriteList caching, sprite width/height caching, oam_palette caching
and oam_priority caching.

I'll explain it in more detail in the public thread in a bit.

Most noticeable is that Winter Olympics is now perfect, with no known
regressions on any of the sprite-sensitive games.
2010-08-05 14:37:02 +00:00
byuu
431d5c8db7 Update to bsnes v067r01 release.
This adds the SA-1 compiler bug workaround for GCC 4.5.0, and updates
the load special libsnes functions to also generate XML mapping data
if given empty strings.
I built the binary above with GCC 4.5.0, so let me know if any new
problems appear. What I've noticed is that when not profiled, 4.5.0 is
about 3-5% faster, but when profiled, they are equivalent in speed.

Lastly, I did some more work on the .NET/C# and Snow Leopard/Cocoa
ports. They can both load all special types of ROMs, including Super
Game Boy.

For .NET, you need to be on a 64-bit version of Windows, have .NET 3.5
installed, and have SlimDX installed (I used February 2010, but
anything later should be fine.)
For Snow Leopard, you may want to build and install libsupergameboy,
but you don't have to. Just don't try loading SGB games without it.

Yes, the .NET one is pure 64-bit. I built snes.dll and
supergameboy.dll using MinGW64-GCC 4.5.0. Since the core library
doesn't use Qt, it builds fine in 64-bit mode.
2010-08-04 12:57:37 +00:00
1200 changed files with 31808 additions and 79133 deletions

View File

@@ -1,10 +1,11 @@
include nall/Makefile
ui := ui_qt
snes := asnes
ui := qt
# compiler
c := $(compiler) -std=gnu99
cpp := $(subst cc,++,$(compiler)) -std=gnu++0x
flags := -O3 -fomit-frame-pointer -I.
flags := -O3 -fomit-frame-pointer -I. -I$(snes)
link :=
objects :=
@@ -43,7 +44,7 @@ compile = \
all: build;
include snes/Makefile
include $(snes)/Makefile
include $(ui)/Makefile
objects := $(patsubst %,obj/%.o,$(objects))
@@ -54,7 +55,7 @@ ifeq ($(platform),osx)
test -d ../bsnes.app || mkdir -p ../bsnes.app/Contents/MacOS
$(strip $(cpp) -o ../bsnes.app/Contents/MacOS/bsnes $(objects) $(link))
else
$(strip $(cpp) -o ../bsnes $(objects) $(link))
$(strip $(cpp) -o out/$(snes) $(objects) $(link))
endif
install:
@@ -84,4 +85,7 @@ clean: ui_clean
-@$(call delete,*.pdb)
-@$(call delete,*.manifest)
archive-all:
tar -cjf snes-`date +%Y%m%d`.tar.bz2 asnes bsnes libco nall obj out qt ruby Makefile sync.sh
help:;

77
asnes/Makefile Normal file
View File

@@ -0,0 +1,77 @@
snes_objects := libco
snes_objects += snes-system
snes_objects += snes-cartridge snes-cheat
snes_objects += snes-memory snes-cpucore snes-cpu snes-smpcore snes-smp snes-dsp snes-ppu
snes_objects += snes-supergameboy snes-superfx snes-sa1
snes_objects += snes-bsx snes-srtc snes-sdd1 snes-spc7110
snes_objects += snes-cx4 snes-dsp1 snes-dsp2 snes-dsp3 snes-dsp4
snes_objects += snes-obc1 snes-st0010 snes-st0011 snes-st0018
snes_objects += snes-msu1 snes-serial
objects += $(snes_objects)
obj/libco.o : libco/libco.c libco/*
obj/libsnes.o: $(snes)/libsnes/libsnes.cpp $(snes)/libsnes/*
obj/snes-system.o : $(snes)/system/system.cpp $(call rwildcard,$(snes)/system/) $(call rwildcard,$(snes)/video/)
obj/snes-memory.o : $(snes)/memory/memory.cpp $(snes)/memory/*
obj/snes-cpucore.o : $(snes)/cpu/core/core.cpp $(call rwildcard,$(snes)/cpu/core/)
obj/snes-cpu.o : $(snes)/cpu/cpu.cpp $(snes)/cpu/*
obj/snes-smpcore.o : $(snes)/smp/core/core.cpp $(call rwildcard,$(snes)/smp/core/)
obj/snes-smp.o : $(snes)/smp/smp.cpp $(snes)/smp/*
obj/snes-dsp.o : $(snes)/dsp/dsp.cpp $(snes)/dsp/*
obj/snes-ppu.o : $(snes)/ppu/ppu.cpp $(snes)/ppu/*
obj/snes-cartridge.o: $(snes)/cartridge/cartridge.cpp $(snes)/cartridge/*
obj/snes-cheat.o : $(snes)/cheat/cheat.cpp $(snes)/cheat/*
obj/snes-supergameboy.o: $(snes)/chip/supergameboy/supergameboy.cpp $(call rwildcard,$(snes)/chip/supergameboy/)
obj/snes-superfx.o : $(snes)/chip/superfx/superfx.cpp $(call rwildcard,$(snes)/chip/superfx/)
obj/snes-sa1.o : $(snes)/chip/sa1/sa1.cpp $(call rwildcard,$(snes)/chip/sa1/)
obj/snes-bsx.o : $(snes)/chip/bsx/bsx.cpp $(snes)/chip/bsx/*
obj/snes-srtc.o : $(snes)/chip/srtc/srtc.cpp $(snes)/chip/srtc/*
obj/snes-sdd1.o : $(snes)/chip/sdd1/sdd1.cpp $(snes)/chip/sdd1/*
obj/snes-spc7110.o : $(snes)/chip/spc7110/spc7110.cpp $(snes)/chip/spc7110/*
obj/snes-cx4.o : $(snes)/chip/cx4/cx4.cpp $(snes)/chip/cx4/*
obj/snes-dsp1.o : $(snes)/chip/dsp1/dsp1.cpp $(snes)/chip/dsp1/*
obj/snes-dsp2.o : $(snes)/chip/dsp2/dsp2.cpp $(snes)/chip/dsp2/*
obj/snes-dsp3.o : $(snes)/chip/dsp3/dsp3.cpp $(snes)/chip/dsp3/*
obj/snes-dsp4.o : $(snes)/chip/dsp4/dsp4.cpp $(snes)/chip/dsp4/*
obj/snes-obc1.o : $(snes)/chip/obc1/obc1.cpp $(snes)/chip/obc1/*
obj/snes-st0010.o : $(snes)/chip/st0010/st0010.cpp $(snes)/chip/st0010/*
obj/snes-st0011.o : $(snes)/chip/st0011/st0011.cpp $(snes)/chip/st0011/*
obj/snes-st0018.o : $(snes)/chip/st0018/st0018.cpp $(snes)/chip/st0018/*
obj/snes-msu1.o : $(snes)/chip/msu1/msu1.cpp $(snes)/chip/msu1/*
obj/snes-serial.o : $(snes)/chip/serial/serial.cpp $(snes)/chip/serial/*
###########
# library #
###########
snes_objects := $(patsubst %,obj/%.o,$(snes_objects))
library: $(snes_objects) obj/libsnes.o
ifeq ($(platform),x)
ar rcs obj/libsnes.a $(snes_objects) obj/libsnes.o
$(cpp) -o obj/libsnes.so -shared -Wl,-soname,libsnes.so.1 $(snes_objects) obj/libsnes.o
else ifeq ($(platform),osx)
ar rcs obj/libsnes.a $(snes_objects) obj/libsnes.o
$(cpp) -o obj/libsnes.dylib -install_name @executable_path/../Libraries/libsnes.dylib -shared -dynamiclib $(snes_objects) obj/libsnes.o
else ifeq ($(platform),win)
$(cpp) -o obj/snes.dll -shared -Wl,--out-implib,libsnes.a $(snes_objects) obj/libsnes.o
endif
library-install:
ifeq ($(platform),x)
install -D -m 755 obj/libsnes.a $(DESTDIR)$(prefix)/lib/libsnes.a
install -D -m 755 obj/libsnes.so $(DESTDIR)$(prefix)/lib/libsnes.so
ldconfig -n $(DESTDIR)$(prefix)/lib
else ifeq ($(platform),osx)
cp obj/libsnes.dylib /usr/local/lib/libsnes.dylib
endif
library-uninstall:
ifeq ($(platform),x)
rm $(DESTDIR)$(prefix)/lib/libsnes.a
rm $(DESTDIR)$(prefix)/lib/libsnes.so
else ifeq ($(platform),osx)
rm /usr/local/lib/libsnes.dylib
endif

View File

@@ -1,4 +1,4 @@
#include <snes/snes.hpp>
#include <snes.hpp>
#include <nall/crc32.hpp>
#include <nall/sha256.hpp>

View File

@@ -1,4 +1,4 @@
#include <snes/snes.hpp>
#include <snes.hpp>
#define CHEAT_CPP
namespace SNES {

8
asnes/chip/bsx/bsx.cpp Normal file
View File

@@ -0,0 +1,8 @@
#include <snes.hpp>
#define BSX_CPP
namespace SNES {
#include "bsx_base.cpp"
#include "bsx_cart.cpp"
#include "bsx_flash.cpp"
}

31
asnes/chip/chip.hpp Normal file
View File

@@ -0,0 +1,31 @@
struct Coprocessor : Processor {
alwaysinline void step(unsigned clocks);
alwaysinline void synchronize_cpu();
};
#include <chip/supergameboy/supergameboy.hpp>
#include <chip/superfx/superfx.hpp>
#include <chip/sa1/sa1.hpp>
#include <chip/bsx/bsx.hpp>
#include <chip/srtc/srtc.hpp>
#include <chip/sdd1/sdd1.hpp>
#include <chip/spc7110/spc7110.hpp>
#include <chip/cx4/cx4.hpp>
#include <chip/dsp1/dsp1.hpp>
#include <chip/dsp2/dsp2.hpp>
#include <chip/dsp3/dsp3.hpp>
#include <chip/dsp4/dsp4.hpp>
#include <chip/obc1/obc1.hpp>
#include <chip/st0010/st0010.hpp>
#include <chip/st0011/st0011.hpp>
#include <chip/st0018/st0018.hpp>
#include <chip/msu1/msu1.hpp>
#include <chip/serial/serial.hpp>
void Coprocessor::step(unsigned clocks) {
clock += clocks * (uint64)cpu.frequency;
}
void Coprocessor::synchronize_cpu() {
if(clock >= 0 && scheduler.sync != Scheduler::SynchronizeMode::All) co_switch(cpu.thread);
}

View File

@@ -4,7 +4,7 @@
//Used in Rockman X2/X3 (Megaman X2/X3)
//Portions (c) anomie, Overload, zsKnight, Nach, byuu
#include <snes/snes.hpp>
#include <snes.hpp>
#define CX4_CPP
namespace SNES {

View File

@@ -1,4 +1,4 @@
#include <snes/snes.hpp>
#include <snes.hpp>
#define DSP1_CPP
namespace SNES {

View File

@@ -1,4 +1,4 @@
#include <snes/snes.hpp>
#include <snes.hpp>
#define DSP2_CPP
namespace SNES {

View File

@@ -1,4 +1,4 @@
#include <snes/snes.hpp>
#include <snes.hpp>
#define DSP3_CPP
namespace SNES {

View File

@@ -1,4 +1,4 @@
#include <snes/snes.hpp>
#include <snes.hpp>
#define DSP4_CPP
namespace SNES {

View File

@@ -1,4 +1,4 @@
#include <snes/snes.hpp>
#include <snes.hpp>
#define MSU1_CPP
namespace SNES {

View File

@@ -1,4 +1,4 @@
#include <snes/snes.hpp>
#include <snes.hpp>
#define OBC1_CPP
namespace SNES {

View File

@@ -1,4 +1,4 @@
#include <snes/snes.hpp>
#include <snes.hpp>
#define SA1_CPP
namespace SNES {
@@ -63,8 +63,8 @@ void SA1::last_cycle() {
}
void SA1::interrupt(uint16 vector) {
op_read(regs.pc.d);
op_io();
SA1::op_read(regs.pc.d);
SA1::op_io();
if(!regs.e) op_writestack(regs.pc.b);
op_writestack(regs.pc.h);
op_writestack(regs.pc.l);

View File

@@ -1,4 +1,4 @@
#include <snes/snes.hpp>
#include <snes.hpp>
#define SDD1_CPP
namespace SNES {

View File

@@ -1,4 +1,4 @@
#include <snes/snes.hpp>
#include <snes.hpp>
#define SERIAL_CPP
namespace SNES {

View File

@@ -1,4 +1,4 @@
#include <snes/snes.hpp>
#include <snes.hpp>
#define SPC7110_CPP
namespace SNES {

View File

@@ -1,4 +1,4 @@
#include <snes/snes.hpp>
#include <snes.hpp>
#define SRTC_CPP
namespace SNES {

View File

@@ -1,4 +1,4 @@
#include <snes/snes.hpp>
#include <snes.hpp>
#define ST0010_CPP
namespace SNES {

View File

@@ -1,4 +1,4 @@
#include <snes/snes.hpp>
#include <snes.hpp>
#define ST0011_CPP
namespace SNES {

View File

@@ -1,4 +1,4 @@
#include <snes/snes.hpp>
#include <snes.hpp>
#define ST0018_CPP
namespace SNES {

View File

@@ -1,4 +1,4 @@
#include <snes/snes.hpp>
#include <snes.hpp>
#define SUPERFX_CPP
namespace SNES {

Some files were not shown because too many files have changed in this diff Show More