2016-06-15 11:32:17 +00:00
|
|
|
struct Object {
|
2016-06-14 10:51:54 +00:00
|
|
|
alwaysinline auto addressReset() -> void;
|
|
|
|
alwaysinline auto setFirstSprite() -> void;
|
|
|
|
auto frame() -> void;
|
|
|
|
auto scanline() -> void;
|
|
|
|
auto run() -> void;
|
|
|
|
auto tilefetch() -> void;
|
|
|
|
auto reset() -> void;
|
|
|
|
|
2016-06-15 11:32:17 +00:00
|
|
|
struct Sprite;
|
|
|
|
auto onScanline(Sprite&) -> bool;
|
2016-06-14 10:51:54 +00:00
|
|
|
|
|
|
|
//list.cpp
|
|
|
|
auto update(uint10 addr, uint8 data) -> void;
|
|
|
|
auto synchronize() -> void;
|
|
|
|
|
|
|
|
auto serialize(serializer&) -> void;
|
|
|
|
|
|
|
|
struct Registers {
|
|
|
|
bool aboveEnable;
|
|
|
|
bool belowEnable;
|
|
|
|
bool interlace;
|
|
|
|
|
|
|
|
uint3 baseSize;
|
|
|
|
uint2 nameSelect;
|
|
|
|
uint16 tiledataAddress;
|
|
|
|
uint7 firstSprite;
|
|
|
|
|
|
|
|
uint priority[4];
|
|
|
|
|
|
|
|
bool timeOver;
|
|
|
|
bool rangeOver;
|
|
|
|
} r;
|
2010-08-09 13:28:56 +00:00
|
|
|
|
2016-02-18 10:32:22 +00:00
|
|
|
struct Item {
|
2016-02-25 10:38:03 +00:00
|
|
|
bool valid;
|
2016-02-18 10:32:22 +00:00
|
|
|
uint7 index;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Tile {
|
2016-06-14 10:51:54 +00:00
|
|
|
bool valid;
|
|
|
|
uint9 x;
|
|
|
|
uint2 priority;
|
|
|
|
uint8 palette;
|
|
|
|
uint1 hflip;
|
|
|
|
uint32 data;
|
2010-08-09 13:28:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct State {
|
Update to v095r05 release.
byuu says:
Changelog:
- GBA: lots of emulation improvements
- PPU PRAM is 16-bits wide
- DMA masks &~1/Half, &~3/Word
- VRAM OBJ 8-bit writes are ignored
- OAM 8-bit writes are ignored
- BGnCNT unused bits are writable*
- BG(0,1)CNT can't set the d13
- BLDALPHA is readable (fixes Donkey Kong Country, etc)
- SNES: lots of code cleanups
- sfc/chip => sfc/coprocessor
- UI: save most recent controller selection
GBA test scores: 1552/1552, 37/38, 1020/1260
(* forgot to add the value to the read function, so endrift's I/O tests
for them will fail. Fixed locally.)
Note: SNES is the only system with multiple controller/expansion port
options, and as such is the only one with a "None" option. Because it's
shared by the controller and expansion port, it ends up sorted first in
the list. This means that on your first run, you'll need to go to Super
Famicom->Controller Port 1 and select "Gamepad", otherwise input won't
work.
Also note that changing the expansion port device requires loading a new
cart. Unlike controllers, you aren't meant to hotplug expansion port
devices.
2015-11-12 10:15:03 +00:00
|
|
|
uint x;
|
|
|
|
uint y;
|
2010-08-09 13:28:56 +00:00
|
|
|
|
2016-06-14 10:51:54 +00:00
|
|
|
uint itemCount;
|
|
|
|
uint tileCount;
|
2010-08-09 13:28:56 +00:00
|
|
|
|
|
|
|
bool active;
|
2016-02-18 10:32:22 +00:00
|
|
|
Item item[2][32];
|
|
|
|
Tile tile[2][34];
|
2010-08-09 13:28:56 +00:00
|
|
|
} t;
|
|
|
|
|
Update to v068r12 release.
(there was no r11 release posted to the WIP thread)
byuu says:
This took ten hours of mind boggling insanity to pull off.
It upgrades the S-PPU dot-based renderer to fetch one tile, and then
output all of its pixels before fetching again. It sounds easy enough,
but it's insanely difficult. I ended up taking one small shortcut, in
that rather than fetch at -7, I fetch at the first instance where a tile
is needed to plot to x=0. So if you have {-3 to +4 } as a tile, it
fetches at -3. That won't work so well on hardware, if two BGs fetch at
the same X offset, they won't have time.
I have had no luck staggering the reads at BG1=-7, BG3=-5, etc. While
I can shift and fetch just fine, what happens is that when a new tile is
fetched in, that gives a new palette, priority, etc; and this ends up
happening between two tiles which results in the right-most edges of the
screen ending up with the wrong colors and such.
Offset-per-tile is cheap as always. Although looking at it, I'm not sure
how BG3 could pre-fetch, especially with the way one or two OPT modes
can fetch two tiles.
There's no magic in Hoffset caching yet, so the SMW1 pixel issue is
still there.
Mode 7 got a bugfix, it was off-by-one horizontally from the mosaic
code. After re-designing the BG mosaic, I ended up needing a separate
mosaic for Mode7, and in the process I fixed that bug. The obvious
change is that the Chrono Trigger Mode7->Mode2 transition doesn't cause
the pendulum to jump anymore.
Windows were simplified just a tad. The range testing is shared for all
modes now. Ironically, it's a bit slower, but I'll take less code over
more speed for the accuracy core.
Speaking of speed, because there's so much less calculations per pixel
for BGs, performance for the entire emulator has gone up by 30% in the
accuracy core. Pretty neat overall, I can maintain 60fps in all but,
yeah you can guess can't you?
2010-09-04 03:36:03 +00:00
|
|
|
struct Output {
|
|
|
|
struct Pixel {
|
2016-02-25 10:38:03 +00:00
|
|
|
uint priority; //0 = none (transparent)
|
Update to v068r13 release.
byuu says:
Bug-fix night for the new PPUs.
Accuracy:
Fixed BG palette clamping, which fixes Taz-Mania.
Added blocking for CGRAM writes during active display, to match the
compatibility core. It really should override to the last fetched
palette color, I'll probably try that out soon enough.
Performance:
Mosaic should match the other renderers. Unfortunately, as suspected, it
murders speed. 290->275fps. It's now only 11fps faster, hardly worth it
at all. But the old rendering code is really awful, so maybe it's for
the best it gets refreshed.
It's really tough to understand why this is such a performance hit, it's
just a decrement+compare check four times per pixel. But yeah, it hits
it really, really hard.
Fixed a missing check in Mode4 offset-per-tile, fixes vertical alignment
of a test image in the SNES Test Program.
2010-09-05 13:22:26 +00:00
|
|
|
uint8 palette;
|
2016-06-14 10:51:54 +00:00
|
|
|
} above, below;
|
2010-08-09 13:28:56 +00:00
|
|
|
} output;
|
|
|
|
|
2016-06-15 11:32:17 +00:00
|
|
|
struct Sprite {
|
2016-06-14 10:51:54 +00:00
|
|
|
alwaysinline auto width() const -> uint;
|
|
|
|
alwaysinline auto height() const -> uint;
|
Update to v068r12 release.
(there was no r11 release posted to the WIP thread)
byuu says:
This took ten hours of mind boggling insanity to pull off.
It upgrades the S-PPU dot-based renderer to fetch one tile, and then
output all of its pixels before fetching again. It sounds easy enough,
but it's insanely difficult. I ended up taking one small shortcut, in
that rather than fetch at -7, I fetch at the first instance where a tile
is needed to plot to x=0. So if you have {-3 to +4 } as a tile, it
fetches at -3. That won't work so well on hardware, if two BGs fetch at
the same X offset, they won't have time.
I have had no luck staggering the reads at BG1=-7, BG3=-5, etc. While
I can shift and fetch just fine, what happens is that when a new tile is
fetched in, that gives a new palette, priority, etc; and this ends up
happening between two tiles which results in the right-most edges of the
screen ending up with the wrong colors and such.
Offset-per-tile is cheap as always. Although looking at it, I'm not sure
how BG3 could pre-fetch, especially with the way one or two OPT modes
can fetch two tiles.
There's no magic in Hoffset caching yet, so the SMW1 pixel issue is
still there.
Mode 7 got a bugfix, it was off-by-one horizontally from the mosaic
code. After re-designing the BG mosaic, I ended up needing a separate
mosaic for Mode7, and in the process I fixed that bug. The obvious
change is that the Chrono Trigger Mode7->Mode2 transition doesn't cause
the pendulum to jump anymore.
Windows were simplified just a tad. The range testing is shared for all
modes now. Ironically, it's a bit slower, but I'll take less code over
more speed for the accuracy core.
Speaking of speed, because there's so much less calculations per pixel
for BGs, performance for the entire emulator has gone up by 30% in the
accuracy core. Pretty neat overall, I can maintain 60fps in all but,
yeah you can guess can't you?
2010-09-04 03:36:03 +00:00
|
|
|
|
2016-06-14 10:51:54 +00:00
|
|
|
uint9 x;
|
|
|
|
uint8 y;
|
|
|
|
uint8 character;
|
|
|
|
uint1 nameSelect;
|
|
|
|
uint1 vflip;
|
|
|
|
uint1 hflip;
|
|
|
|
uint2 priority;
|
|
|
|
uint3 palette;
|
|
|
|
uint1 size;
|
|
|
|
} list[128];
|
2010-08-09 13:28:56 +00:00
|
|
|
|
Update to v068r12 release.
(there was no r11 release posted to the WIP thread)
byuu says:
This took ten hours of mind boggling insanity to pull off.
It upgrades the S-PPU dot-based renderer to fetch one tile, and then
output all of its pixels before fetching again. It sounds easy enough,
but it's insanely difficult. I ended up taking one small shortcut, in
that rather than fetch at -7, I fetch at the first instance where a tile
is needed to plot to x=0. So if you have {-3 to +4 } as a tile, it
fetches at -3. That won't work so well on hardware, if two BGs fetch at
the same X offset, they won't have time.
I have had no luck staggering the reads at BG1=-7, BG3=-5, etc. While
I can shift and fetch just fine, what happens is that when a new tile is
fetched in, that gives a new palette, priority, etc; and this ends up
happening between two tiles which results in the right-most edges of the
screen ending up with the wrong colors and such.
Offset-per-tile is cheap as always. Although looking at it, I'm not sure
how BG3 could pre-fetch, especially with the way one or two OPT modes
can fetch two tiles.
There's no magic in Hoffset caching yet, so the SMW1 pixel issue is
still there.
Mode 7 got a bugfix, it was off-by-one horizontally from the mosaic
code. After re-designing the BG mosaic, I ended up needing a separate
mosaic for Mode7, and in the process I fixed that bug. The obvious
change is that the Chrono Trigger Mode7->Mode2 transition doesn't cause
the pendulum to jump anymore.
Windows were simplified just a tad. The range testing is shared for all
modes now. Ironically, it's a bit slower, but I'll take less code over
more speed for the accuracy core.
Speaking of speed, because there's so much less calculations per pixel
for BGs, performance for the entire emulator has gone up by 30% in the
accuracy core. Pretty neat overall, I can maintain 60fps in all but,
yeah you can guess can't you?
2010-09-04 03:36:03 +00:00
|
|
|
friend class PPU;
|
2010-08-09 13:28:56 +00:00
|
|
|
};
|