Coder Social home page Coder Social logo

libretro / sameboy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from liji32/sameboy

16.0 8.0 23.0 11.5 MB

Gameboy and Gameboy Color emulator written in C

Home Page: https://sameboy.github.io/

License: MIT License

Assembly 1.44% Objective-C 17.18% C 77.82% Makefile 1.45% GLSL 1.97% Perl 0.01% Metal 0.13%

sameboy's Introduction

SameBoy

SameBoy is an open source Game Boy (DMG) and Game Boy Color (CGB) emulator, written in portable C. It has a native Cocoa frontend for macOS, an SDL frontend for other operating systems, and a libretro core. It also includes a text-based debugger with an expression evaluator. Visit the website.

Features

Features common to both Cocoa and SDL versions:

  • Supports Game Boy (DMG) and Game Boy Color (CGB) emulation
  • Lets you choose the model you want to emulate regardless of ROM
  • High quality 96KHz audio
  • Battery save support
  • Save states
  • Includes open source DMG and CGB boot ROMs:
    • Complete support for (and documentation of) all game-specific palettes in the CGB boot ROM, for accurate emulation of Game Boy games on a Game Boy Color
    • Supports manual palette selection with key combinations, with 4 additional new palettes (A + B + direction)
    • Supports palette selection in a CGB game, forcing it to run in 'paletted' DMG mode, if ROM allows doing so.
    • Support for games with a non-Nintendo logo in the header
    • No long animation in the DMG boot
  • Advanced text-based debugger with an expression evaluator, disassembler, conditional breakpoints, conditional watchpoints, backtracing and other features
  • Extremely high accuracy
  • Emulates PCM_12 and PCM_34 registers
  • T-cycle accurate emulation of LCD timing effects, supporting the Demotronic trick, Prehistorik Man, GBVideoPlayer and other tech demos
  • Real time clock emulation
  • Retina/High DPI display support, allowing a wider range of scaling factors without artifacts
  • Optional frame blending (Requires OpenGL 3.2 or later)
  • Several scaling algorithms (Including exclusive algorithms like OmniScale and Anti-aliased Scale2x; Requires OpenGL 3.2 or later or Metal)

Features currently supported only with the Cocoa version:

  • Native Cocoa interface, with support for all system-wide features, such as drag-and-drop and smart titlebars
  • Game Boy Camera support

Read more.

Compatibility

SameBoy passes all of blargg's test ROMs, all of mooneye-gb's tests (Some tests require the original boot ROMs), and all of Wilbert Pol's tests. SameBoy should work with most games and demos, please report any broken ROM. The latest results for SameBoy's automatic tester are available here.

Contributing

SameBoy is an open-source project licensed under the MIT license, and you're welcome to contribute by creating issues, implementing new features, improving emulation accuracy and fixing existing open issues. You can read the contribution guidelines to make sure your contributions are as effective as possible.

Compilation

SameBoy requires the following tools and libraries to build:

  • clang (Recommended; required for macOS) or GCC
  • make
  • macOS Cocoa port: macOS SDK and Xcode (For command line tools and ibtool)
  • SDL port: libsdl2
  • rgbds, for boot ROM compilation

On Windows, SameBoy also requires:

  • Visual Studio (For headers, etc.)
  • GnuWin
  • Running vcvars32 before running make. Make sure all required tools and libraries are in %PATH% and %lib%, respectively. (see Build FAQ for more details on Windows compilation)

To compile, simply run make. The targets are cocoa (Default for macOS), sdl (Default for everything else), libretro, bootroms and tester. You may also specify CONF=debug (default), CONF=release, CONF=native_release or CONF=fat_release to control optimization, symbols and multi-architectures. native_release is faster than release, but is optimized to the host's CPU and therefore is not portable. fat_release is exclusive to macOS and builds x86-64 and ARM64 fat binaries; this requires using a recent enough clang and macOS SDK using xcode-select, or setting them explicitly with CC= and SYSROOT=, respectively. All other configurations will build to your host architecture. You may set BOOTROMS_DIR=... to a directory containing precompiled boot ROM files, otherwise the build system will compile and use SameBoy's own boot ROMs.

The SDL port will look for resource files with a path relative to executable and inside the directory specified by the DATA_DIR variable. If you are packaging SameBoy, you may wish to override this by setting the DATA_DIR variable during compilation to the target path of the directory containing all files (apart from the executable, that's not necessary) from the build/bin/SDL directory in the source tree. Make sure the variable ends with a / character. On FreeDesktop environments, DATA_DIR will default to /usr/local/share/sameboy/. PREFIX and DESTDIR follow their standard usage and default to an empty string an /usr/local, respectively

Linux, BSD, and other FreeDesktop users can run sudo make install to install SameBoy as both a GUI app and a command line tool.

SameBoy is compiled and tested on macOS, Ubuntu and 64-bit Windows 10.

sameboy's People

Contributors

andres-asm avatar bentley avatar inactive123 avatar issotm avatar jan200101 avatar jl2210 avatar jverkoey avatar kylophone avatar libretroadmin avatar liji32 avatar lior-halphon avatar lmlb avatar lpla avatar max-m avatar meithecatte avatar nadiaholmquist avatar orbea avatar pinobatch avatar r-type avatar renatoliveira avatar robloach avatar rokkumanx avatar ryunam avatar rzumer avatar simpletease avatar slash0042 avatar snowymouse avatar webgeek1234 avatar yo-wotop avatar zenithmdc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sameboy's Issues

Incomplete memory mapping for achievements

I'm unsure if this needs to be addressed on the libretro end or in upstream. Numerous games have large sections of achievements unsupported due to SameBoy not exposing memory fully. One such example is Kirby's Dream Land 2, but in my experience a solid half or more of the games with achievement sets can't activate the full set. This is particularly disheartening when dealing with SGB-enhanced games, which no other core can make look even halfway decent.

Corresponding upstream issue: LIJI32#227

Can't update the core anymore because of merge conflicts

So yeah, things used to be so simple a couple of months ago when you could compare repositories, create a pull request and merge it relatively quickly.

I have been wanting to update the Libretro core with all the latest changes but for the first time I've hit a roadblock, "This branch has conflicts that must be resolved"

I have no idea what commit/commits it's referring to because it's being very cryptic and I can't do anything about it from here via the browser version of GitHub.

I also have no idea how to use the command line or knows what the GitHub desktop is, so here everything have halted I'm afraid and don't know how to proceed from here.

Subsystem Dual audio output

It would be wonderful if we could output audio from both gameboys at once: Especially useful with multiple music making software available on Gameboy like LSDj!

Sound Stutters During Specific Screen Transitions (LCD On/Off Scenarios?)

Certain screen transitions cause some sound stuttering that doesn't happen in stand alone. Here's an example in Link's Awakening:

La.Sameboy.Test-1.mp4

Very noticeable on going from the Nintendo BIOS screen to opening cutscene, then again to the title screen.

This issue was originally fixed with 431f1f8 but popped up again in the last year or so. @LIJI32 thinks it's related to how the core handles extra frames in LCD on/off scenarios.

I reopenned the original issue report upstream, but people have asked to open an issue here as well to try to get more libretro experienced eyes on it. The original issue (with more info in comments) is here: LIJI32#161

Libretro Core fails to copy the right file for iOS

As it says in the title. It is seeming to try to copy sameboy_libretro_ios.dylib in the root of the build directory, but the file itself is present as build/bin/sameboy_libretro_ios.dylib

This leads to the following error:

cp "sameboy_libretro_ios.dylib" "/Users/chucksmith/retroarch-stuff/libretro-super/dist/ios-arm64/sameboy_libretro_ios.dylib"
cp: sameboy_libretro_ios.dylib: No such file or directory

However, the compiled file is present and works fine. It is just in an unexpected place.

Frequent release/tag

Since this repo already uses versions like Major.Minor.Patch for releases could you tag more recent ones?

[Request] Load a file to load 2 different roms at once (link mode)

I'm from the Retrobat team (a frontend like batocera and recalbox etc...but for Windows )

We ar using Sameboy libretro core, and I would like to ask you to add an option that would allow, via a file, (.m3u or other...) to load 2 roms at once in link mode, for example Pokemon Red and Pokemon Yellow.

Thanks.

Better SGB+GBC support

Current version allows you to force display SGB borders while using GBC colors, however this seems to only work for native SGB-supported games. Certain SGB borders added by ROM hacks are not detected/enabled as they would be on emulators with full support (I believe mGBA on desktop (but not the core) has this functionality).

Can't load ROM files with special characters in filename.

If I try to load a ROM file with the word Pokémon in it, the core will fail to start up. If I rename the same file to say Pokemon then it will load normally. Standalone SameBoy can load the file even if it has a special character in its name.

Better Auto System Model Support

Currently, the Auto System Model option only detects the difference between a Gameboy and Gameboy Color game, which it does by checking the game's file extension.
In the event it detects a Gameboy .gb game, it sets the model to be a monochrome DMG Gameboy.
This makes it so that you'd have to set the model manually in order for, for example, have SGB enhanced Gameboy games to display in color, which ultimately means a lot of overrides in the event of a large library.

A better would be to check the header of a Gameboy game and set the Auto System Model depending on whenever the SGB and/or CGB bits are set or not
That way it would also work more like other Gameboy emulators in that regard.

Real time clock broken

When playing a game that uses the real-time clock in SameBoy, a seemingly random number is selected every time the clock is queried.

See video of me scrolling back in forth on Pokemon Gold checking the time again and again:

https://www.youtube.com/watch?v=tgkD2KPV5Bw&feature=youtu.be

Notice the clock changes, and the date changes every time.

Some info: This does NOT occur on the standalone Sameboy emulator. Nor does it occur on other GBC cores in libretro. I used the same save/battery file to test all. The error persists regardless of bios used or save settings in retroarch.

Cannot undo load state on the auto-loaded state

Bit of a weird issue, and I'm not positive that this is a core issue and not a RetroArch issue, but so far SameBoy is the only affected core I've found.

When using the option to automatically load the last state when opening content, attempting to undo that load results in an error message stating that no state was loaded to undo. This only happens with the initial auto load. Manually loading a state and undoing it works fine. And as stated before, among the 20 or so cores I use, I've only discovered this issue in SameBoy.

This was tested on multiple Android devices. Unfortunately, I have no access to a PC for the time being.

SameBoy Libretro Core Version: GameBoy Link Multiplayer Crash

I tried to boot these two GB games up with SameBoy Core via GameBoy Link. It crashed, and it shows the Problem Report for RetroArch. The version I tried both versions of RetroArch which is the Regular Mac Version, and the Metal Mac Version. And they both crashed when I tried to play multiplayer on one computer with no Netplay. Tried it on RetroArch 1.14.0, and RetroArch 1.15.0. The old core version works, but the new version doesn't. My new core version is SameBoy (0.15.4 0913833), and the old core version is SameBoy (0.14.7 b154b7d).
83xuzs9af2ja1
gjn9wo96f2ja1
jgj45747f2ja1

Potential Feature Request: Wide AutoMapping

This is a duplicate Request, but with "different" system implementation!:)

Daniel5151 and Kemenaran have both respectively done some fun work with a gimmick that allows games to be automapped, and assets drawn from files to display landscapes you have already traversed within any given "supported" games. I am hoping to try to get this into a viable NES Core, as well as GB one..I did a video demonstration, to showcase exactly what is going on.

https://www.youtube.com/watch?v=OOjPgagSZC4

Like with the previous Custom Arcade MAME Samples...Additions like "WIDE NES-GB" would truly accentuate a game playing experience:) Thanks for perusing this Feature Request! The Githubs containing codings for both implementations, are:

https://prilik.com/ANESE/

https://github.com/daniel5151/ANESE

https://kemenaran.winosx.com/posts/widegb-playing-game-boy-games-on-wide-screens

https://github.com/kemenaran/SameBoy/tree/wide_gb

Thanks! Hoping we can get this going for NES with fceumm or nestopia; and gb/gbc with gambatte or sameboy!

[Regression] Delayed audio notes with certain games (ex: Donkey Kong Land)

I have noticed an audio-related regression with the latest Sameboy core as it is currently downloaded from the buildbot. I only reproduced this with one game so far (Donkey Kong Land), but it could affect other titles.

When playing Donkey Kong Land and idling on the world map, you can hear that the melody of the music plays with a noticeable delay compared to the other instruments in the same track.

This does not occur on the latest standalone version of Sameboy for Windows. It also does not happen with older versions of the Sameboy core, prior to the latest resync to upstream.

Check here a quick recording for comparison's sake:

With current master (d478d3e)
https://user-images.githubusercontent.com/17614150/113507214-73083100-9549-11eb-96dc-2ed71a849fad.mp4

With an older version prior to the resync (907cb96)
https://user-images.githubusercontent.com/17614150/113507312-f3c72d00-9549-11eb-8010-78f669b30368.mp4

gbc accelerometer games

Korokoro Kirby (Japan)
Kirby - Tilt 'n' Tumble (USA)

RetroArch - Settings - Input - Auxiliary Sensor Input

Version number error and update core.

In the version number of this core it appears as 1.9.0 which is rare and does not match the standalone version. It's a mistake??

On the other hand, the core I think is in 0.13.3 and they already updated to 0.13.6, so I think that if there are no errors and it is up to date or when it is updated, the numbering would have to match unless this forked gets too far apart that it follows its own numbering.

These details make many think that the cores used in Retroarch are very old and prefer not to use them, just because of the numbers of the versions.

Thank you.

update to 0.12.1

Since Jun 22, the emulator SameBoy was updated with several improvements and it would be interesting to update the core of libretro as well which is 0.11.2 at the moment.

SameBoy does not make multiple saves in Linked Mode

I spent about an hour trying to set up SameBoy initially, where the information is difficult to find for whatever reason. I linked the game and saved it on both instances but it saved both to the same file, resulting in the first save game being deleted.

I read the docs here and it mentions something about a "Single cart dual mode" but doesn't show a screenshot of said option. I've looked through every related menu, and it does not exist.

Either this function never existed, or it's been removed in some version, and the doc hasn't been updated. This needs to be resolved.

[Feature Request] Cheat Support

Right now only the Cacoa port has cheat support, but it would be nice if it could be implemented for the Libretro port as well.

Overclock Support

I don't know if this is something that has been done in other GB/GBC emulators before, but is it possible to overclock the emulated CPU to fix slowdown that is present in some/(a lot?) of the GB/GBC games? I think I've heard that on the original handhelds it actually makes the game just run super fast, instead of fixing the actual framerate. So I don't know if that would do the same thing to the emulator, but I could be wrong.

But doesn't Snes9x and FCEUmm have the ability to overclock, but they had to do a workaround to prevent the game from speeding up instead of just giving the CPU more power? I don't know much about how the GB works XD.

Also sorry I'm a noob to Github, sorry if this doesn't belong in Issues.

visual bug with default sameboy bios on pokemon blue.

Game: Pokemon - Blue Version (USA, Europe) (SGB Enhanced) 'no-intro verified'
Retroarch v1.16.0 x64, on windows 10 x64 also happen on android 12.

sameboy without bios

this is how it looks with the build in sameboy bios, also happens in game not just on start screen.
Emulated model: Auto Detect DMG/CGB has no issues, the problem starts when setting the system to 'Game Boy Color (CPU-CGB E), using the "cgb_boot.bin md5:dbfce9db9deaa2567f6a84fde55f9680" fixes the issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.