Skip to content

[WIP] DRAFT Add PSP port with shared fast software renderer#234

Draft
kikugrave wants to merge 6 commits intoSAT-R:mainfrom
kikugrave:psp-port-squashed
Draft

[WIP] DRAFT Add PSP port with shared fast software renderer#234
kikugrave wants to merge 6 commits intoSAT-R:mainfrom
kikugrave:psp-port-squashed

Conversation

@kikugrave
Copy link

@kikugrave kikugrave commented Feb 15, 2026

DRAFT PSP Port Beta

  • PSP build chain and an associated psp_module with PSP macros (kept as minimal as possible)
  • Frameskip to the SDL2 loop (needed for menus until we debug further)
  • sw_renderer_fast.c — a single-pass software renderer that composites all layers in one scanline sweep instead of the multi-pass approach. This is more complex but significantly faster on platforms without hardware blending.

memset(gameImage, 0, sizeof(gameImage));
#if RENDERER == RENDERER_SOFTWARE_FAST
{
extern void DrawFrame_Fast(uint16_t * pixels);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this could be moved to a header file?

#define applySpriteVerticalMosaicEffect(y) (y - (y % (mosaicSpriteEffectY + 1)))

// NOTE: This is the corrected function.
static void RenderBGScanline(int bgNum, uint16_t control, uint16_t hoffs, uint16_t voffs, int lineNum, uint16_t *line)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this code need to be changed if you now use fast draw? Or at these bug fixes?

int32_t y = oam->split.y;

#if !EXTENDED_OAM
// The regular, unextended values are 9 and 8 unsigned bits for x and y respectively.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why were these comments removed?

Comment on lines +222 to +226
sdlRenderer = SDL_CreateRenderer(sdlWindow, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
if (sdlRenderer == NULL)
sdlRenderer = SDL_CreateRenderer(sdlWindow, -1, SDL_RENDERER_ACCELERATED);
if (sdlRenderer == NULL)
sdlRenderer = SDL_CreateRenderer(sdlWindow, -1, 0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need these fallbacks?


bool newFrameRequested = FALSE;

// Every GBA frame we process the SDL events and render the number of times
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did you intend for these comments to be re-written?


void VDraw(SDL_Texture *texture)
{
memset(gameImage, 0, sizeof(gameImage));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't reset the image every frame?

@kikugrave kikugrave marked this pull request as draft February 15, 2026 21:02
@kikugrave kikugrave changed the title Add PSP port with shared fast software renderer [WIP] Add PSP port with shared fast software renderer Feb 15, 2026
@kikugrave kikugrave changed the title [WIP] Add PSP port with shared fast software renderer [WIP] DRAFT Add PSP port with shared fast software renderer Feb 15, 2026
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

Comments