Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Libretro #377

Merged
merged 24 commits into from
Aug 30, 2024
Merged

Libretro #377

merged 24 commits into from
Aug 30, 2024

Conversation

hazelwiss
Copy link
Contributor

a WIP pull request for libretro support. Not ready to be merged yet.

kylon added a commit to kylon/SkyEmu that referenced this pull request Apr 12, 2024
fixes skylersaleh#377
one less point in skylersaleh#334

there are other bugs in code, at least now you are no longer stuck in /home
src/gba.h Outdated Show resolved Hide resolved
@@ -0,0 +1,4405 @@
/* Copyright (C) 2010-2020 The RetroArch team
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you make any changes to this file for the SkyEmu port? Or is it just the straight header from the retro arch project?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is a straight copy

src/libretro.c Outdated
#include "gba.h"
#include "nds.h"

#define SKYEMU_LIBRETRO_VERSION "0.1.0"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be based on the GIT_COMMIT_HASH define that we set in our CMake file?

That way we can correlate it back with the regular builds and have it automatically update.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, I'll look into that

src/libretro.c Outdated
#define SKYEMU_LIBRETRO_VERSION "0.1.0"

// necessary to resolve a linker error when loaded by retroarch
bool se_load_bios_file(const char* name, const char* base_path, const char* file_name, uint8_t* data, size_t data_size) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its probably better to make this a callback function in the cores that you can just set to NULL in the retro arch load rom commands. That way the cores are completely decoupled from the frontend.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually quite like how this ended up, I made some changes to this function (that I have yet pushed), so this function is actually used at this point and I don't know if we should remove it still, in favour of a callback?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets push your set of changes and go from there!

src/libretro.c Outdated

/* ------------------ RETROARCH GB ----------------- */

static gb_scratch_t gb_scratch;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should union the cores/scratch space for all the systems like the main frontend to save RAM.

src/libretro.c Outdated
info->geometry.max_width = SB_LCD_W;
info->geometry.base_height = info->geometry.max_height;
info->geometry.base_width = info->geometry.max_width;
info->timing.fps = 60;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

59.727 FPS

src/libretro.c Outdated
info->geometry.max_height = GBA_LCD_H;
info->geometry.base_width = info->geometry.max_width;
info->geometry.base_height = info->geometry.max_height;
info->timing.fps = 60;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

59.727

src/libretro.c Outdated
info->geometry.max_height = NDS_LCD_H * 2; // (bottom and top screen)
info->geometry.base_width = info->geometry.max_width;
info->geometry.base_height = info->geometry.max_height;
info->timing.fps = 60;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

59.8261

@skylersaleh
Copy link
Owner

One observation is that if you drag from the bottom touch screen to a location overlapping the top touch screen of the NDS, it yields erratic touch points. I assume this is a result of not sanitizing the touch coordinates to only the region of the bottom touch screen.

I also can't seem to get cheat codes to work correctly. Have you tested them out?

@hazelwiss
Copy link
Contributor Author

What cheat codes are not working properly for you?

@skylersaleh
Copy link
Owner

Can you resolve the merge conflict please?

@skylersaleh
Copy link
Owner

image

@skylersaleh skylersaleh merged commit c37a444 into skylersaleh:dev Aug 30, 2024
9 of 10 checks passed
This was referenced Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants