2011-06-24 10:43:29 +00:00
|
|
|
struct Mouse : Controller {
|
2015-11-10 11:02:29 +00:00
|
|
|
enum : uint {
|
|
|
|
X, Y, Left, Right,
|
|
|
|
};
|
|
|
|
|
2011-06-24 10:43:29 +00:00
|
|
|
Mouse(bool port);
|
|
|
|
|
2015-10-10 02:16:12 +00:00
|
|
|
auto data() -> uint2;
|
|
|
|
auto latch(bool data) -> void;
|
|
|
|
|
2011-06-24 10:43:29 +00:00
|
|
|
private:
|
|
|
|
bool latched;
|
2016-06-17 13:03:54 +00:00
|
|
|
uint counter;
|
Update to v089r03 release.
byuu says:
Substantial improvements to SPC7110 emulation. Added all of the findings
from http://byuu.org/temp/spc7110-mmio.txt that I understood.
I also completely rewrote the RTC. We only had about ~40% of the chip
emulated before. Turns out there's cool stuff like spare RAM, calendar
disable, 12-hour mode, IRQs, IRQ masking, duty cycles, etc. So I went
ahead and emulated all of it. The upper bits on hour+ don't work as
nocash described though, not sure what doc he was reading. The Epson
RTC-4513 manual I have doesn't explain any of the registers.
The new RTC core also ticks seconds based on the emulated clock, and not
on the system clock. This is going to suck for people wanting to keep
the in-game clock synced with their computer, who also abuse fast
forward and save states. Fast forward makes the clock run faster, and
save states will jump the clock to the time it was at when you took the
save state. (It will keep track of the number of seconds between
unloading the game and loading it again, so time passes normally there.)
This is required, however, and how I'm going to rearrange all of the
RTCs for all systems. Any other method can be detected by the game, and
is thus not faithful emulation. To help with this, I'll probably make an
RTC time tool so that you can adjust the time when the emulator isn't
running, but I don't intend to bundle that into bsnes.
New state format bit-packs the RTCRAM values, and it also uses a 64-bit
timestamp. So it's 16 bytes now instead of 20 bytes. S-RTC will drop
from 16 to 12 when it's done.
The RTC busy flag timing needs to be refined with more hardware tests,
there's a slim chance of the game hanging on save at the moment.
The SPC7110 ALU delays are emulated now, too. They may not be perfectly
accurate, but they get the basic gist down.
The only hack that needs to be removed now is the decompression busy
flag. That's ... not going to be fun.
I also redid the mouse emulation. I was polling the mouse position
multiple times per latch. So it should be a bit more precise now,
I hope.
I read it regardless of latch state, dunno if that's good or not.
2012-05-16 00:27:34 +00:00
|
|
|
|
2016-06-17 13:03:54 +00:00
|
|
|
uint speed; //0 = slow, 1 = normal, 2 = fast
|
|
|
|
int x; //x-coordinate
|
|
|
|
int y; //y-coordinate
|
|
|
|
bool dx; //x-direction
|
|
|
|
bool dy; //y-direction
|
|
|
|
bool l; //left button
|
|
|
|
bool r; //right button
|
2011-06-24 10:43:29 +00:00
|
|
|
};
|