Commit Graph

6896 Commits

Author SHA1 Message Date
zeromus af06cc4aca fix window title on non-english locales (probably, but not tested)
fixes #496 addendum
2022-01-11 20:29:05 -05:00
zeromus 81573818a9 Revert "WiFi: Fix compiling for Cocoa port by eliminating typed enums. (Regression from commit 43b00fb2, for which the regression was caused by commit 5f76ba8b.)"
This reverts commit 9f82cea20b.

If cocoa compiling is broken let's discuss it instead of reverting work
2022-01-11 19:12:37 -05:00
zeromus 8510948f6c fix game info text fields on non-english locales (probably, but not tested)
fixes #496
2022-01-11 19:09:34 -05:00
zeromus 3ba3821228
Merge pull request #495 from rinsuki/ci/macos-app
ci: Add macOS app Build
2021-12-14 15:26:28 -06:00
rinsuki e344b4ce2a ci: Add macOS app Build 2021-12-14 21:02:07 +00:00
Ingo Saitz b4080b2cae Linux: Call NDS_Init() early
Since NDS_Init takes no arguments, it should not hurt to call it early
in the gtk frontend, too.

This fixes the segfault in issue #415, although I could not get it to
run a r4 kernel in a quick test.
2021-11-19 16:52:44 +01:00
Ingo Saitz f827be2e0f Linux: Add pop-up menu back
This adds the view menu back as pop-up menu, which was disabled by the
gtk2 port.

This fixes issue #407.
2021-11-19 16:51:44 +01:00
Ingo Saitz 327dcd3d7b Linux: Fix recent entries with quote in filename
According to RFC 2396, the single quote character (') is allowed in uri
strings and is not escaped by gtk, so the action string constructed for
the recent files menu must be quoted with " instead of '.

This fixes issue #437
2021-11-19 16:49:36 +01:00
zeromus 629724d865
Merge pull request #489 from Salz/pullreq/openal-linux-01
Pullreq/openal linux 01
2021-11-18 12:47:28 -05:00
Ingo Saitz 6aa320aa0a [Linux] OpelAL: Initialize the Mic_Buffer with silence data 2021-11-18 13:38:01 +01:00
Ingo Saitz 9f19d681de [Linux] OpenAL: fix mic data
The data returned by Mic_ReadSample() must be transfered in 2 parts.
This must be done by every microphone driver.

I did test with Lunar: Dragon Song which values are considered loud,
since you can run away by screaming/blowing into the microphone. Values
from 33-223 don't trigger the escape, values from 0-32 and from 224-255
trigger an escape attempt. Thus 128 would be considered silence.
2021-11-18 13:15:52 +01:00
rogerman 0b4b58f3b4 GPU: Remove a now defunct check that could cause the window test buffer to fail to update. This fixes a graphical issue in Pokemon Black 2 when watching movies at the Pokestar Studios. (Regression from commit 7fc2e4b6. Fixes #486.) 2021-11-12 16:27:11 -08:00
rogerman 9f82cea20b WiFi: Fix compiling for Cocoa port by eliminating typed enums. (Regression from commit 43b00fb2, for which the regression was caused by commit 5f76ba8b.) 2021-11-12 16:16:37 -08:00
rofl0r f000d1a9c0 gtk2: fix build with fresh clone
this was overlooked as my copy already contained a generated Makefile.in.
2021-11-07 16:23:31 +00:00
rofl0r d1d626f221 GTK2: add crude 'dump memory' button to tools
the offsets in the dump file are as follows (code snippet taken
from the dump function and annotated with locations from gbatek:

                0x2000000
        fp.fseek(0x000000,SEEK_SET); fp.fwrite(MMU.MAIN_MEM,0x800000); //arm9 main mem (8192K)

  4       DTCM            027C0000h 16KB   -     -    -    R/W
or 0x800000 or 0xb000000 . DTCM location in real NDS varies, as the program can select where
it's mapped to, apparently.

        fp.fseek(0x900000,SEEK_SET); fp.fwrite(MMU.ARM9_DTCM,0x4000); //arm9 DTCM (16K)
        fp.fseek(0xA00000,SEEK_SET); fp.fwrite(MMU.ARM9_ITCM,0x8000); //arm9 ITCM (32K)
        fp.fseek(0xB00000,SEEK_SET); fp.fwrite(MMU.ARM9_LCD,0xA4000); //LCD mem 656K

  0       I/O and VRAM    04000000h 64MB   -     -    R/W  R/W

        fp.fseek(0xC00000,SEEK_SET); fp.fwrite(MMU.ARM9_VMEM,0x800); //OAM
                 0xc000bc

        fp.fseek(0xD00000,SEEK_SET); fp.fwrite(MMU.ARM7_ERAM,0x10000); //arm7 WRAM (64K)
        fp.fseek(0xE00000,SEEK_SET); fp.fwrite(MMU.ARM7_WIRAM,0x10000); //arm7 wifi RAM ?
        fp.fseek(0xF00000,SEEK_SET); fp.fwrite(MMU.SWIRAM,0x8000); //arm9/arm7 shared WRAM (32KB)
2021-11-03 22:07:52 +00:00
rofl0r b1ffe0ae76 GTK2: add crude "import backup" dialog to File menu
this is necessary to load saves from other devices or emulators,
as desmume uses its own incompatible format.

it works for importing .sav files from flashcarts, but only if the
file extension is .sav or .SAV - if using .dsv desmume guesses it's
of its own type and looks for a specific string, then fails.

the right code was taken from windows/importSave.cpp - it might make
sense to add the export item at some point too, however that will
probably require some more effort.
2021-11-03 22:07:52 +00:00
rofl0r da75178fd6 update README.LIN 2021-11-03 22:07:52 +00:00
rofl0r 2bd5f2804f configure.ac: switch gtk dir to gtk2 2021-11-03 22:07:52 +00:00
rofl0r c2d7a8a643 revert autoconf-part of ba92804d9f 2021-11-03 22:07:52 +00:00
rofl0r 03e14584f6 re-add gtk+2 frontend in gtk2 directory 2021-11-03 22:07:52 +00:00
rofl0r 54f3549108 fix implicit declaration of pthread_setname_np on musl 2021-11-03 22:07:52 +00:00
rofl0r f9393ab57c fixup build sys for GLX removal
the cli frontend still doesn't build, but gtk does
2021-11-03 22:07:52 +00:00
rofl0r d5e9df3691 fixup build system for SDL2
doesn't build yet (at least with --enable-glx - this will be fixed later)
2021-11-03 22:07:52 +00:00
rofl0r 4cef851cbf Revert "Linux: Remove the autotools build system"
This reverts commit 19147a8457.
2021-11-03 22:07:52 +00:00
zeromus 83a3d30fa8
Merge pull request #484 from Minabsapi/master-fix-interface_memory_leak_mitigation
Hotfix: fixed memory leak in binary interface
2021-11-03 14:14:45 -04:00
Minabsapi 00ab686625 Hotfix: fixed memory leak in binary interface's draw_sdl_window.cpp `sdl_draw_no_opengl` method
A call to the `SDL_DestroyTexture` method was forgotten, resulting in all the textures created to render the game's frames being stored indefinitely until running out of memory
This is a temporary fix so anyone using the interface (mainly `py-desmume` users) can have it working correctly again. Next step is to mirror the changes from POSIX CLI's main.cpp `Draw` method, if stable
2021-11-03 16:47:06 +01:00
zeromus 2468b1dbbe
Merge pull request #482 from rofl0r/pr481new
PR 481 redone
2021-11-02 10:37:13 -04:00
rofl0r 2153e53012 frameskip log update: use snprintf, remove gratuitous memset 2021-11-01 21:48:50 +00:00
thesource 79abd40913 Update menu state on setting frameskip value and also print new value 2021-11-01 21:46:18 +00:00
zeromus 8461e2f08d fix bug where windows frontend stopped processing hotkey input from gamepads while paused (fixes #479) 2021-10-28 03:15:15 -04:00
zeromus 021fcdd0de
Merge pull request #478 from rofl0r/cli_fix
fix/improve CLI frontend
2021-10-27 10:06:40 -04:00
rofl0r 7db8f4fcd6 sdl: use emu_halt before loading savestates, just like win32 2021-10-26 16:56:42 +00:00
rofl0r d3dee7ce9c cli: disable jit when using gdb stub 2021-10-26 16:56:42 +00:00
rofl0r 65a280618b cli: turn off sound when entering gdb stub 2021-10-26 16:56:42 +00:00
rofl0r 9f4e6992fb simplify/fix sdl2 sound backend, fixes no audio in CLI
- simplified ring-buffer mechanism
- added proper locking for all variables accessed by 2 different threads
- fixed oob writes that occassionally crashed SDL's "Alsa Hotplug thread"
- make buffer sufficiently large to prebuffer enough samples to survive
  the occassional SDL_Delay(1) in the frontend.
- fixed ignoring volume set by the SPU.
- improved speed and robustness by not calling malloc over and over in
  SDL callback, and copying directly to the SDL buffer if volume is max
  (no need to use mixer to lower the volume in that case).
2021-10-26 16:56:42 +00:00
rofl0r 09506c9a19 cli: add fullscreen toggle with alt-enter 2021-10-26 16:56:42 +00:00
rofl0r 9868c00fca cli: add --horizontal command line option
this option puts the touchscreen to the right, allowing higher scales
on widescreen monitors.
2021-10-26 16:56:42 +00:00
rofl0r 90326ea1f9 cli: add scaling
the new command line parameter --scale allows to scale the window by
a floating point factor. SDL2 stretches it in hardware to the desired
size, which makes the scaled window run at almost identical speed to
1x scale.
2021-10-26 16:56:42 +00:00
rofl0r b685818413 cli: fix FPS display
1) the float format displayed like 50.123456789123456 wouldn't fit
   into the window title bar, and
2) most likely not into the char buffer of length 20, of which half
   was already used for the desmume string.
2021-10-26 16:56:42 +00:00
rofl0r 699f63d688 cli: user proper SDL2 OpenGL-accelerated rendering primitives
additionally:
- don't allocate memory for surfaces and textures over and over
- use one texture for each NDS screen - this allows to easily
  add support for horizontal screen layout.
2021-10-26 16:56:42 +00:00
rofl0r 7e0336d57d cli: re-add ability to set frameskip
the command line option existed once, but was turned off when a
new generic commandline parser class was introduced. the entire
array in main.cpp using custom commandline options is currently
unused.
2021-10-26 16:56:42 +00:00
rofl0r d07bdedbd6 cli: remove unused and broken OPENGL2D code
this code was broken since the switch to SDL2, but nobody noticed
because the new meson build system doesn't set HAVE_GL_GL_H.
2021-10-26 16:56:42 +00:00
rofl0r a2c6a789ad cli frontend: fix mouse input
there were 2 logical issues which caused reproducible misbehaviour.
for example when starting up pokemon soulsilver, one can click away
the intro, but it's not possible to click on the "load savegame"
icon.
the issues were:

1) failure to record whether the down event has been
passed to the emulator before abandoning it and turning it into
a click event (on a fast click, both events would happen during
the same SDL_Pollevent loop), and
2) mouse coordinates were discarded and unless the mouse down
event was registered. that means if the down and up events happen
on the exact same coordinate, the .x and .y of the mouse weren't
updated at all.
2021-10-26 16:56:42 +00:00
zeromus 086112c4b5 isSwapBuffers is savestated with a size set to 4, so it needs to be a u32 and not a BOOL 2021-10-25 23:00:25 -04:00
zeromus 43b00fb2a0 fix some sloppy stuff in wifi that made its savestates unreliable 2021-10-25 20:07:51 -04:00
zeromus fe8c424c4a fix gdbstub compiling on windows 2021-10-25 20:04:35 -04:00
zeromus b8bed7082b
Merge pull request #477 from rofl0r/gdbstub_block
Gdbstub improvement, fix 100% cpu use in cli frontend
2021-10-24 21:07:12 -04:00
rofl0r 339ea16b15 gdbstub_wait(): add timeout parameter
this is probably helpful for frontends other than cli that have to repaint
and react on events in the user interface, so they can set a timeout like
100 ms, or simply poll whether the stub is active using timeout 0.
2021-10-24 15:39:01 +00:00
rofl0r ed5ff51c0c gdb stub: since debug info is printed anyway, show the actual command 2021-10-24 15:38:55 +00:00
rofl0r d5693c54cf cli frontend: fix 100% cpu when using gdb stub
the emulator thread was consuming 100% cpu even when the debugger was
active and execution paused.

a second pipe was added to gdb stub, which allows communication in
direction stub -> emulator/frontend, and also to infinitely block
in the frontend until the debugger returns control, for example
by typing "c" (continue) in gdb.

the other frontends use an inefficient method of running usleep(1000)
or similar in a loop, which will cause high cpu usage too, albeit not
a full 100% but more like 10-20%.

in order not to fill up the pipe with data for frontends that don't use
this mechanism, the functionality needs to be explicitly enabled.
(see functions added to gdbstub.h)

the functions added could in theory also be used to communicate
other data to the frontend, and optimally even replace all the locking
between the 2 sides.
2021-10-24 15:38:50 +00:00