Commit graph

77 commits

Author SHA1 Message Date
JetSetIlly
fe326140c3 refined version package
window now includes revision information if the build is not a "release"
build

added version.Version() function to help with deciding if build is a
"release". supercedes the global Version and Revision variables in the
version package
2025-02-11 21:38:11 +00:00
JetSetIlly
8c63cf706a disabled sdl.HINT_VIDEO_X11_NET_WM_PING hint
this complements the commit that disables the bypass_compositor option

removed sdl.WINDOW_FOREIGN option because it is incorrect
2024-12-15 18:33:36 +00:00
JetSetIlly
d049c5ee31 disabled sdl.HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR hint
this is on by default and seems to be the cause of the occassional loss
of VSYNC (for want of a better description) seen when displaying ROMs
with flicker kernels

note that disabling the bypass_compositor option doesn't completely
solve the VSYNC problems when running under the muffin window manager.
it does however solve the problem under other window managers that have
been tested. either way, the issue is purely one for X11 and doesn't
affect Windows of MacOS

I've also removed the artificial window event delays added in 28c22cb34.
the delays seemed to mitigate the problem but not solve it.
2024-12-15 18:33:32 +00:00
JetSetIlly
7098984611 render "resync" is triggered if a frame takes too long
display average render time per frame in overlay along with an alert
whenever a frame takes too long
2024-12-15 18:32:34 +00:00
JetSetIlly
d7adb54642 removed ticker option for GL swap interval
it never worked very well and was likely to cause screen tearing

added SetConstraint() function to the types in the prefs package. this
is used to make sure the old ticker value is replaced with the value
indicating 'sync with vertical retrace'
2024-12-15 18:32:28 +00:00
JetSetIlly
1145b823b7 a short delay after every window event
this seems to help the screen rendering to mesh with the monitor's
VSYNC. this method was already in place when switching between
full-screen and windowed mode

the current policy is to run time.Sleep() for the duration of a frame
(1000/60ms for a 60Hz monitor) before calling GLSwap() and to do that
for 5 consecutive frames

for the specific instance of WINDOWEVENT_RESIZED the GLSwap() is
also completely inhibited for a frame

outside of the window event period a random sleep of between 1 and 10
microseconds is introduced

tweaked frame queue slack indicator
2024-12-15 18:31:36 +00:00
JetSetIlly
3473323534 opengl vendor information logged on start
fixed gl2.1 build
2024-12-15 18:31:36 +00:00
JetSetIlly
18284032d1 added graphical bevels
screen can now be repositioning and sized so that it fits inside the
bevel. this needs improvement such that a bevel can specify how the
screen needs to be transformed for the bevel

set ClearColor before calling gl.Clear(). this completes the change
started in 8763b77f
2024-12-15 18:31:36 +00:00
JetSetIlly
a7c296d6c4 simplified calls to logger package
calls to Logf() which do no formatting replaced with Log()

calls to Log() with Sprintf() replaced with Logf()

error types sent without use of Error(), taken advantage of new logger
package features

correct construction of wrapped errors in eeprom package
2024-11-23 14:56:36 +00:00
JetSetIlly
cd2a00d4ba logger.Log() and logger.Logf() now require a logger.Permission instance
the logger.Permission interface indicates whether the environment making
the logging request is allowed to create new log entries. the
environment.Environment type satisifies the Permission interface

logger.Allow is provided as a convienient way of indicating the the log
entry should always be created
2024-04-30 11:23:40 +01:00
JetSetIlly
24d4f2531e DPI aware font scaling
font sizing for non-freetype font rendering
2024-01-22 08:10:16 +00:00
JetSetIlly
3a6b1f3a3e changed EventDataPaddle to use integer based (int16) values
EventDataPaddle can now specify whether the values are relative or
absolute values. previously all values were absolute

hardware mice use relative values whereas devices like the stelladaptor
use absolute values

removed gamepad trigger operation of paddles. it was a poor solution to
the problem
2024-01-10 17:42:11 +00:00
JetSetIlly
5a4b01fd13 added rendering support for OpenGL2.1
all references to opengl are now made through the renderer interface.
which renderer is to be used is controlled by buildtags

now requires minimum go version of 1.21

CRT preferences and CRT preview in debugger TV window are disabled for
OpenGL2.1
2023-11-20 16:58:32 +00:00
JetSetIlly
b48d487643 added version package
Makefile now sets the version string for the project. the version
package tries to set a meaningful version string if the project is not
built with the Makefile

added VERSION command
2023-11-08 22:05:41 +00:00
JetSetIlly
9035f1f3eb log SDL version on startup 2023-09-18 16:36:19 +01:00
JetSetIlly
a1e5a27684 added WINDOW_FOREIGN flag to SDL window 2023-05-18 19:16:33 +01:00
JetSetIlly
96fd0bbfc0 added new "ticker" vsync option. reverted "immediate updates" to intended function 2023-05-18 19:16:33 +01:00
JetSetIlly
c1df3782f5 no VSYNC option uses a manual ticker to limit screen updates 2023-05-17 17:21:51 +01:00
JetSetIlly
8565415ddd set gl core and compatibility attributes
completes reversion started in b67222394d
2023-04-07 14:35:08 +01:00
JetSetIlly
b67222394d bumped gl version back to v3.2-core
undoes much of the changes in 203891dde9

macos shader compiler is much stricter than others and won't compile a
glsl version 1.5 script gl version 2.1 and dropping the glsl version to
1.2 degrades the features of glsl too much

in any case, dropping to v2.1 was only an experiment to see if there was
any meaningful performance difference. there is not
2023-04-07 14:09:24 +01:00
JetSetIlly
c47b779464 dropped fields pointing to imgui structs in sdlimgui type 2023-04-07 08:12:30 +01:00
JetSetIlly
a10865a473 changed for how long emulation waits when it crashes into rendering queue
emulation will wait for half as many render frames as there are in the
frame queue. this ensures that plotting and rendering are as far away
from each other as possible and ensures that the framequeue has
sufficient space to do its job properly
2023-03-31 07:34:21 +01:00
JetSetIlly
2a3dee4960 corrected "adaptive VSYNC" value
sdl.GLSetSwapInterval() would fail with "Restore All" in prefs window

"Restore All" pushes preference loading to the emulation thread. it does
not need to push loading for GUI preferences however. GLSetSwapInterval()
was failing because it was running outside of the GL context
2023-03-31 07:34:21 +01:00
JetSetIlly
203891dde9 removed calls to sdl.GLSetAttribute(). using SDL defaults
using open gl v2.1, rather than v3.2-core

change CLAMP_TO_EDGE to CLAMP_TO_BORDER
2023-03-31 07:34:21 +01:00
JetSetIlly
2d493947c3 first attempt at joystick support via stelladaptor 2023-02-25 19:22:51 +00:00
JetSetIlly
f4d3fcc341 log joystick events 2023-02-25 18:07:03 +00:00
JetSetIlly
d0fcec1065 hardware joysticks (that are not part of gamepads) are added 2023-02-24 21:05:39 +00:00
JetSetIlly
3aa5885ebe removed curated pacakge. replaced with wrapped errors
curated package predated the standard errors package introduced in
go1.13

the standard package does a better job of what curated attempted to do

the change of package also gave me a opportunity to clean up the error
messages a little bit
2023-02-13 21:58:39 +00:00
JetSetIlly
dafbec9c1f govern mode field in sdlimgui is now an atomic value
added a small delay to the program after SDL SetFullscreen() has been
called. this seems to give the system time to make the change to the
full screen state - meaning that placement of imgui windows in the
debugger is more consistent
2023-01-21 09:20:46 +00:00
JetSetIlly
1478b268d5 add support for trickling right mouse button
complements changes done for left mouse button (5325c5d968)
2023-01-07 09:33:11 +00:00
JetSetIlly
5325c5d968 support trickling of left mouse button event to dear imgui
if a left mouse button is pressed down and up in the same frame, imgui
will not see the down event. trickling the two events over two frames
should solve the problem
2022-11-15 21:35:40 +00:00
JetSetIlly
cad2d2b93f added preference to alter OpenGL refresh policy
this is primarily a test to see if disabled VSYNC fixes an observed
problem on MacOS Ventura (13.0)
2022-11-15 21:35:40 +00:00
JetSetIlly
3d3efbf3f4 static linking of freetype for cross_windows target
corrected error handling on SDL initialisation failure
2022-03-16 14:52:45 +00:00
JetSetIlly
af940e9ecd better interaction of window geometry preference saving with fullscreen setting
*.windowSize and *.windowPos preference values replaced with single *.windowGeometry value

prefs package type now have a pre-hook (called before new value is set).
existing hook/callback clarified to be a post-hook (called after new
value is set).

prefs generic type now handles prefs.GenericGetValueUndefined to
indicate that the value cannot be ascertained at this time (the prefs
package should use the most recent previous value instead)
2021-11-05 17:58:35 +00:00
JetSetIlly
92d96cc4e9 major refactor. amalgamated debugger/playmode emulations
switch between debugger and playmode with F6 or backtick key

pakage debugger remains for now but it will be renamed to emulator or
something like that. playmode package removed.

commandline options for both debugger and playmode are the same
currently, with some playmode features being lost (temporarily)
2021-11-04 09:38:35 +00:00
JetSetIlly
9a5fb8fd1f updated README and lint fixes 2021-09-16 12:34:05 +01:00
JetSetIlly
1f17998b97 improved system window handling in playmode
window not opened until window preferences loaded. fullscreen state
saved on exit.

changed hotkeys. toggle mouse capture with scroll-lock and quit with
escape key
2021-08-24 09:47:41 +01:00
JetSetIlly
d830c956d9 sdl opens all available gamepads/joysticks
all devices control player zero. other players will be supported in the
future once a suitable system for allocating controllers is settled on.

this was added only so that my Hori fighting stick could be used with
minimal effort
2021-07-20 16:28:59 +01:00
JetSetIlly
9c0e6ee970 tweaked window sizing/positioning 2021-06-16 20:06:19 +01:00
JetSetIlly
94a7abab33 corrected mouse click detection on dbgscr
selecting a color from the playfield color popup would cause a rogue
GotoFrameCoords() if popup overlay the dbgscr.
2021-03-26 10:28:48 +00:00
JetSetIlly
b21529c573 controller no longer rumbles on start up 2021-03-12 07:10:08 +00:00
JetSetIlly
156534a3fd added userinput package
debugger and playmode refer to userinput package rather than the common
code being in the playmode package

GUI events are now userinput events

more versatile handling of EventData in controller package. parsing of
EventData is handled by the controller types as required. added
EventDataPlayback type to ports package to help distinguish source of
data.

EventDataStick used to specify stick data value. used to help
distinguish between setting a stick direction and toggle a stick
direction. the latter case is useful for (physical) gamepad input and
the former for input from a keyboard.

Gamepad analogue stick can be used for paddle input. PaddleFire removed
and Fire used instead.

version number of playback file increased to 1.1. version detection of
recorder.IsPlaybackFile() improved.
2021-03-09 22:37:08 +00:00
JetSetIlly
d4f72c3b40 Logf() function in logger package
replaced all instances of logger.Log() that used fmt.Sprintf() to build
the details argument
2021-03-06 08:01:48 +00:00
JetSetIlly
b6374dc00b bumped imgui-go to v4.0.0 2021-02-21 21:20:51 +00:00
JetSetIlly
7e9a64a5ab added ARM section to the readme file
tweaked default window positions
2021-01-19 17:53:22 +00:00
JetSetIlly
d5fa669b1b fullscreen command line option
can start playmode in fullscreen mode
2021-01-01 16:50:53 +00:00
JetSetIlly
376165aaa8 new service loop did not work in Windows. fixed.
two polling methods have been abstracted into two files polling_fancy
and polling_simple. these are built according to the build constraints.
currently fancy polling is used by linux and darwin and simple by
everything else.
2020-12-30 20:45:07 +00:00
JetSetIlly
cdd01db301 bumped imgui-go version to v3.0.0
fixed lint errors
2020-12-30 20:45:07 +00:00
JetSetIlly
17eb04b931 added trace profile type to performance package
expanded --profile option for DEBUG and PERFORMANCE so that different
profile options can be selected/combined

added --profile option to PLAY mode.

many lint errors removed (re-added "make lint" to git pre-commit hook)
2020-12-30 20:45:07 +00:00
JetSetIlly
7b54b19e4b better handling of mouse motion events in mini-service loop
handling of mouse motion is stalled slightly unless the gui is in
playmode or input is "captured"
2020-12-30 20:45:07 +00:00