Commit Graph

2601 Commits

Author SHA1 Message Date
Rafael Kitover 6bf107f75d
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-05-05 14:00:58 +00:00
Rafael Kitover 09e8da43db Joystick refactor pt. Deux: Support Joysticks.
Add support for non-GameController SDL Joysticks.

Add proxy class wxSDLJoyDev to support using either SDL_GameController*
or SDL_Joystick* values in joystate.dev.

Add pretty much identical SDL code to support SDL_Joystick* when the
device cannot be opened as an SDL_GameController*, without changing the
API. SDL_Joystick* devices operate almost identically to SDL_Controller*
devices with their own default mappings, for both events and polling.

Filter axis motion events in the bindings editor widget for subsequent
events within 300ms. This gets rid of the double binding for +1/-1 when
the stick is moved to a direction.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-05-05 08:47:52 +00:00
Rafael Kitover ad3327d437
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-05-03 00:08:09 +00:00
Rafael Kitover 504ca08b6b Hide menubar + minor UI refactor.
Add ui/hideMenuBar boolean option, defaulting to on, which hides the
main menubar when the mouse is idle or outside the frame.

This is disabled on mac, because on macs the main menubar is not part of
the application window.

Fix pointer hiding/unhiding by connecting panel events to the gamearea
mouse event handler.

Clean up the pausing when menus are opened code, make it actually work
on Windows.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-05-02 13:14:46 +00:00
Rafael Kitover 2868c1b753 Fix changing aspect ratio option.
When toggling "retain aspect ratio", destroy the drawing panel so it is
recreated with the desired aspect ratio settings.

Only add the vertical spacers when aspect ratio is on, they are not
needed when it's off.

Set the sizer priority of the DrawingPanel to 1 if aspect ratio is off
so that wxEXPAND always works.

Clear the GameArea sizer when attaching a new DrawingPanel, this is so
that the vertical spacers used when aspect ratio is on are not included
when aspect ratio is off.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-05-02 13:08:34 +00:00
Rafael Kitover 0f55b5d1c8
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-05-01 23:58:42 +00:00
Josh Smith 3041e3262b Removing meaningless conditional
reg[0].I is unsigned so checking if it is greater than or equal to zero is always true by definition.

Fixes #578
2020-04-30 02:17:23 +00:00
Rafael Kitover 045e95ab4e GB: Support 4MiB MBC30 ROM bank select.
MBC30 is a variant of MBC3 with a 4MiB ROM size and a larger RAM size.

https://gekkio.fi/files/gb-docs/gbctr.pdf

Allow addressing 4MiB of the ROM in MBC3 ROM bank select if the ROM size
is 4MiB.

Fix provided by roytam1.

- Fix #652.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-04-27 18:32:12 +00:00
Rafael Kitover a972da8ddb
Update github issue template.
Use html comments for section instructions that shouldn't be visible in
the completed form.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-04-24 12:53:51 +00:00
Rafael Kitover eecde424ae
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-04-21 21:56:56 +00:00
Edênis Freindorfer Azevedo 0b14e9f885
[WINDOWS] Add function to open unicode files. (#644)
We have some issues when trying to open files on Windows that contains
characters not included in the current codepage. Using `fopen` fails
when that happens.

One example is using the `pt_BR` codepage and then using a name with
japanese chars for the battery file.

The games and BIOS work since they use `blargg_open`. It converts a
`const char *` to `const wchat_t *` and uses `_wfopen` for windows.
(doing a multibyte to widechar conversion)

Since we want to avoid doing many code changes on our cores, we need
some `util*` functions for the matter.

Replace `mb_fn_str` by UTF-8 strings.

Replace all occurrences of `fopen` for `utilOpenFile` on GBA core.

Replace all occurrences of `fopen` for `utilOpenFile` on GBA e-reader.

Adjust e-readers calls on wx frontend.

Replace all occurrences of `fopen` for `utilOpenFile` on Patcher files.

Always apply UTF-8 when dealing with path strings.

On our wx frontend we should always send UTF-8 `char *` to our cores
functions. This way we can have consistency when dealing with them for
each platform.

On Windows, we will convert all multibyte to wide chars and use proper
functions for I/O operation.

Create function to deal with unicode calls of `gzopen`.

We use `gzopen_w` (`zlib>=1.27`).

Replace all occurrences of `fopen` for `utilOpenFile` on Config Manager.

Replace all occurrences of `fopen` for `utilOpenFile` on Cheat files.

Use proper functions for unicode on GB core.

Use function instead of macro for `UTF8()`.

Use `nullptr` instead of `NULL`.

Print wide char strings on status bar.
2020-04-21 10:24:28 -03:00
Rafael Kitover ed438d6e52
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-04-15 10:09:27 +00:00
Rafael Kitover b7f5754338 Add to dev manual on translations and char sets.
Document how we interact with transifex and how to pass strings to
non-wxWidgets code.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-04-13 00:25:11 +00:00
Rafael Kitover a36b147411
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-04-13 00:12:21 +00:00
Rafael Kitover 9e03af83c4
Transifex push.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-04-12 00:21:04 +00:00
Rafael Kitover 3869b08c9a
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-04-12 00:18:00 +00:00
Rafael Kitover 8e3978b314 Speedup/Turbo/Throttle fixes.
Fix throttle=0 (unlimited speed) settings for both the Speedup/Turbo
config panel and the general throttle setting and make 100 the default.

Replace the speedup frame skip option with a "Frame skip" checkbox,
which enables skipping the appropriate number of frames if vsync or very
low system performance is in effect. The systemFrameSkip (under video
config) is added to this value.

With speedup_throttle=100, the old speedup behavior is used with 9
frames skipped.

With speedup_throttle == 0 && speedup_throttle_frame_skip, skip 9
frames at full speed, which is exactly the same as the old behavior,
since throttle == 0 is equivalent to speedup == true.

Hopefully these changes will make the turbo config dialog more useful
for users, by default frame skipping to work around vsync will be
enabled, and users can uncheck the "Frame skip" checkbox for a smoother
experience.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-04-10 10:19:03 +00:00
Rafael Kitover d6cc14ef10
builder: URL updates.
Update openssl version, getopt URL and roll nasm back to stable, because
the snapshot hangs on Catalina.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-04-04 15:17:05 -07:00
Rafael Kitover f24e8aae2f
Change board/nightly URLs in README.md to https.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-23 00:27:51 +00:00
Rafael Kitover 83b6efa6cd
Add forums link back to README.md.
Now that the board is back up.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-22 15:04:06 +00:00
Rafael Kitover b21880ea15
cmake: Zip suffix fix for 60f05ced.
Fix problem with the ZIP_SUFFIX option, which causes zip files to have a
suffix of "OFF" if the option is not set.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-18 01:01:19 +00:00
Edênis Freindorfer Azevedo 166cf446f7 Disable menu LCD filter unless playing GB or GBA.
Since they share the filter function, but can change one from another
(setting on the GBA would apply to GB and vice-versa), we allow only
the proper setting to be toggled while a ROM is loaded.

If GB ROM, then `Options` > `Game Boy` > `LCD Filter` is enabled.

Likewise for GBA. If neither, then no option is enabled.
2020-03-18 00:48:43 +00:00
Edênis Freindorfer Azevedo 060010699d Init systemColorMaps after output module init.
It is done only once after the output module is initialized. It is also
adjusted to whatever ROM is being loaded.
2020-03-18 00:48:43 +00:00
Edênis Freindorfer Azevedo cd029ae696 Fix video recording with frame skip enabled.
When we skip frames, we just don't draw them on our frontend. The
function `systemDrawScreen` also send the video frames to be recorded,
but only when called from the core.

Our solution creates a auxiliary `systemSendScreen` that only adds the
frame to the recording. It is called when the core decides to skip a
frame. This way we can get the video frame for recording, just like
audio ones are always sent.
2020-03-18 00:48:43 +00:00
Edênis Freindorfer Azevedo 008aecde67 [LINUX] Fix display of `RGB` values on viewers.
The flag `wxST_NO_AUTORESIZE` does not behave well on our viewers. They
were being hidden due to not fitting the text box available.

On Windows, they were working as expected. It is unknown on MacOs.
2020-03-18 00:48:43 +00:00
Edênis Freindorfer Azevedo 834d153725 Fix accel shortcuts when using some menu options.
`gbColorOption`, `GBALcdFilter` and `GBLcdFilter` did not respond
to accelerators shortcuts.
2020-03-18 00:48:43 +00:00
Edênis Freindorfer Azevedo 994726dd8d Do not pause while opening configuration windows.
The only configuration that we cannot change while playing is the sound
driver. All the others should be changeable without any major issues.
2020-03-18 00:48:43 +00:00
Edênis Freindorfer Azevedo 54335dc67c [WINDOWS] Fix weird WX errors messages.
XRC error: 131: vertical alignment flag `wxALIGN_BOTTOM` has no effect
inside a vertical box sizer, remove it and consider inserting a spacer
instead.

- Fix #517.
2020-03-18 00:48:43 +00:00
Edênis Freindorfer Azevedo 7bac34eda4 Remove duplicate variable `winFlashSize`.
We already had `optFlashSize` for both SDL and WX ports. We assigned
this variable to replace all ocurrences of `winFlashSize`.

As a side note, this entire scope could/should be replaced by a better
auto-detect system for saving types. At the moment, it is only really
useful for the SDL port, since we have overrides for the WX port.

- Fix #585.
2020-03-18 00:48:43 +00:00
Edênis Freindorfer Azevedo 8d62a790e3 Change default options for GB.
We set to automatically display borders on SGB games, as well as
setting the default emulation system to `automatic`.
2020-03-18 00:48:43 +00:00
Edênis Freindorfer Azevedo 99b66e1326 Expose LCD filter for GBA and GB color saturation.
We offer a way to control the color saturation for GBA games such as
Fire Emblem Tactics Advance.

It will be enabled by default for GBA games and disabled for GB.
The user will be able to toggle both of them and these options
will be persistent by saving to `vbam.ini`.

- Fix #131.
2020-03-18 00:48:43 +00:00
Edênis Freindorfer Azevedo c789020e93 Fix `Save` button on OAM Viewer for GB and GBA.
No idea why this was not implemented yet...
2020-03-18 00:48:43 +00:00
Edênis Freindorfer Azevedo dcaa1b9abc Fix `Save` button on Tile Viewer for GB and GBA.
For some reason this was not implemented yet.
2020-03-18 00:48:43 +00:00
Edênis Freindorfer Azevedo d05e8fc141 Make AGBPrint output to our Logging.
We also output using `dbgOutput`, hence the behaviour will not change
for users relying on this.
2020-03-18 00:12:27 +00:00
Rafael Kitover 60f05cedc2
cmake: Add ZIP_SUFFIX option, for build configs.
Add a ZIP_SUFFIX option defaulting to "" that is added to the generated
.zip file with UPSTREAM_RELEASE before the .zip extension.

For example, for an experimental feature you could pass
-DZIP_SUFFIX=-timer_loop and the resulting .zip file would be
visualboyadvance-m-Win-64bit-timer_loop.zip or
visualboyadvance-m-Win-64bit-debug-timer_loop.zip for a debug build.

Also add a modeline to this cmake file because vim-sleuth always gets
the settings wrong. Or it could be the cmake filetype plugins.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-17 03:24:43 +00:00
Rafael Kitover abb8234174
Allow binding specific server IP. (#633)
For the netlink dialog, leave the server IP text field enabled when the
server radio button is selected and bind it to the new option
gopts.server_ip which defaults to "*" for binding on all addresses,
which was the previous behavior.

Copy this value to the new GBALink global IP_LINK_BIND_ADDRESS and use
it when creating a listening socket.

SFML supports creating sf:IpAddress values from hostnames, consequently
no additional code is needed to support hostnames in the netlink dialog.

Change GetLinkServerHost to return the primary local address when the
value is "*", which was the previous behavior, and the set value
otherwise.

Remove the min/max macros from GBALink as they are unnecessary and
conflict with std headers.

Require at least SFML 2.4 instead of 2.x for the IP binding
functionality in cmake.

- Fix #632

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-16 13:37:01 -03:00
Rafael Kitover 4f49c89a98
Update README.md for current project status.
- Remove forum link until it's back up.

- Add nightly builds link.

- Use ninja for build instructions instead of make.

- Note that wx 2.8 and non-stl builds are no longer supported.

- Mention fprintf(stderr, ...) in the debug messages section.

- Misc. minor edits.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-16 12:13:25 +00:00
Rafael Kitover a462904c58
Merge remote-tracking branch 'vbam-libretro/master'
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-16 11:48:19 +00:00
Rafael Kitover 7ab7bc3a9d
cmake: Add -debug suffix to windows debug zips.
For the zip file containing the executable (and symbols for debug builds
on msvc) add the -debug suffix to the basename of the zip file for debug
builds.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-15 20:44:22 +00:00
Rafael Kitover 57bc8f9e40
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-15 02:19:42 +00:00
Rafael Kitover 571025da66
cmake: Do not use gpg if user has no keys.
When UPSTREAM_RELEASE is set, only use gpg to make detached signatures
if the output of gpg -k is not blank. If it is not, the user has likely
installed a private key to sign with.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-14 13:28:36 +00:00
Rafael Kitover 7b04c4ceec
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-14 01:55:08 +00:00
Rafael Kitover 8ede756fb0
Gettext pot regen and transifex push.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-13 14:41:14 +00:00
Rafael Kitover 6c64db0794
cmake: Windows codesigning refactor.
Quote variables containing the HOME or USERPROFILE, as they may have
spaces.

Check for both osslsigncode and signtool regardless of platform, and
prefer osslsigncode.

The reason for this being that osslsigncode is more reliable and does
not depend on system configuration in any way, while signtool can fail
under more conditions.

The other reason being that you can use either program on both windows
and linux. E.g. the mingw version of osslsigncode or the signtool from
mono distributions on linux.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-13 00:30:26 +00:00
Rafael Kitover 7a4a7d148c
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-12 23:45:45 +00:00
Edênis Freindorfer Azevedo 4f1a351d4a Try to configure vsync for multiple options.
When we have a notebook with intel+nvidia, OpenGL sets both
`glXSwapIntervalSGI` (nvidia) and `glXSwapIntervalMESA` (intel) for
usage. That means that if the display is controlled by one, we may
disable vsync for the other card, therefore having no actual effect
on gameplay. With this, we check for all available functions and try
them all.

This may lead to some false warnings, but useful for debugging
purposes.
2020-03-11 14:00:24 +00:00
Edênis Freindorfer Azevedo ed8a9af250 Use proper functions and checks for OpenGL VSYNC.
The vsync has to be {dis,en}abled before a ROM is loaded or we need to
restart the output module to apply it.

We also support MESA based installations (Intel HD Graphics, AMD/ATI and
Nouveau) on Linux.
2020-03-11 14:00:24 +00:00
hizzlekizzle 29dffc0120
Merge pull request #86 from negativeExponent/patch-1
Fix Save Failed error for Super Monkey Ball Jr.
2020-03-10 18:43:54 -05:00
negativeExponent 6092082e04
Fix Save Failed error for Super Monkey Ball Jr. 2020-03-11 06:47:25 +08:00
Rafael Kitover 2ba0d316cd
cmake: Include .pdb in zips of debug builds.
Include the visualboyadvance-m.pdb file alongside the .exe for Visual
Studio debug builds.

Visual Studio generates this file with the debug symbols for debug
builds. The file is not generated for release builds. It is also
generated for RelWithDebInfo builds.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-09 04:28:52 +00:00