From fed7f6fe06a4f216d8c28b9b7e4f278a7274514f Mon Sep 17 00:00:00 2001 From: palxex Date: Thu, 9 Jul 2026 00:33:57 +0800 Subject: [PATCH] perf: fast-path pure palette animation for dos --- src/video/dos/SDL_dosframebuffer.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/video/dos/SDL_dosframebuffer.c b/src/video/dos/SDL_dosframebuffer.c index 1500060ee5..e77234110d 100644 --- a/src/video/dos/SDL_dosframebuffer.c +++ b/src/video/dos/SDL_dosframebuffer.c @@ -502,6 +502,12 @@ bool DOSVESA_UpdateWindowFramebuffer(SDL_VideoDevice *device, SDL_Window *window } } + // No rectangles to update, so just program the palette and return. + // This is useful for pure palette animations. + if (numrects <= 0) { + return true; + } + if (fb_state.use_dosmemput) { // dosmemput path (banked window, possibly multi-bank) const int src_pitch = fb_state.src_pitch;