2011-08-06 14:03:52 +00:00
|
|
|
static void HorizontalScrollBar_change(HorizontalScrollBar *self) {
|
|
|
|
if(self->state.position == self->position()) return;
|
|
|
|
self->state.position = self->position();
|
2011-12-12 10:59:53 +00:00
|
|
|
if(self->p.locked == false && self->onChange) self->onChange();
|
2011-08-06 14:03:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Geometry pHorizontalScrollBar::minimumGeometry() {
|
|
|
|
return { 0, 0, 0, 20 };
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned pHorizontalScrollBar::position() {
|
|
|
|
return (unsigned)gtk_range_get_value(GTK_RANGE(gtkWidget));
|
|
|
|
}
|
|
|
|
|
|
|
|
void pHorizontalScrollBar::setLength(unsigned length) {
|
2011-12-12 10:59:53 +00:00
|
|
|
locked = true;
|
2011-08-06 14:03:52 +00:00
|
|
|
length += length == 0;
|
Update to v084r05 release.
(note: before the post announcing this release, there had been
a discussion of a performance optimisation that made the Super Scope
emulation a lot faster, but caused problems for the Justifier perpheral)
byuu says:
Spent a good two hours trying things to no avail.
I was trying to allow the CPU to run ahead, and sync on accesses to
$4016/4017/4201/4213, but that doesn't work because the controllers have
access to strobe IObit at will.
The codebase is really starting to get difficult to work with. I am
guessing because the days of massive development are long over, and the
code is starting to age.
Jonas' fix works 98% of the time, but there's still a few missed shots
here and there. So that's not going to work either.
So ... I give up. I've disabled the speed hack, so that it works 100% of
the time.
Did the same for the Super Scope: it may not have the same problem, but
I like consistency and don't feel like taking the chance.
This doesn't affect the mouse, since the mouse does not latch the
counters to indicate its X/Y position.
Speed hit is 92->82fps (accuracy profile), but only for Super Scope and
Justifier games.
But ... at least it works now. Slow and working is better than fast and
broken.
I appreciate the help in researching the issue, Jonas and krom.
Also pulled in phoenix/Makefile, which simplifies ui/Makefile.
Linux port defaults to GTK+ now. I can't get QGtkStyle to look good on
Debian.
2011-12-18 03:19:45 +00:00
|
|
|
gtk_range_set_range(GTK_RANGE(gtkWidget), 0, max(1u, length - 1));
|
2011-08-06 14:03:52 +00:00
|
|
|
gtk_range_set_increments(GTK_RANGE(gtkWidget), 1, length >> 3);
|
2011-12-12 10:59:53 +00:00
|
|
|
locked = false;
|
2011-08-06 14:03:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void pHorizontalScrollBar::setPosition(unsigned position) {
|
|
|
|
gtk_range_set_value(GTK_RANGE(gtkWidget), position);
|
|
|
|
}
|
|
|
|
|
|
|
|
void pHorizontalScrollBar::constructor() {
|
|
|
|
gtkWidget = gtk_hscrollbar_new(0);
|
|
|
|
g_signal_connect_swapped(G_OBJECT(gtkWidget), "value-changed", G_CALLBACK(HorizontalScrollBar_change), (gpointer)&horizontalScrollBar);
|
2011-09-05 03:48:23 +00:00
|
|
|
|
|
|
|
setLength(horizontalScrollBar.state.length);
|
|
|
|
setPosition(horizontalScrollBar.state.position);
|
|
|
|
}
|
|
|
|
|
|
|
|
void pHorizontalScrollBar::destructor() {
|
|
|
|
gtk_widget_destroy(gtkWidget);
|
|
|
|
}
|
|
|
|
|
|
|
|
void pHorizontalScrollBar::orphan() {
|
|
|
|
destructor();
|
|
|
|
constructor();
|
2011-08-06 14:03:52 +00:00
|
|
|
}
|