SameBoy icon indicating copy to clipboard operation
SameBoy copied to clipboard

feature request: unlimited sprites

Open ghost opened this issue 7 years ago • 3 comments

Hi, is there a chance we can have unlimited sprites toggle option?

ghost avatar Aug 08 '18 03:08 ghost

Unlikely. SameBoy is accuracy focus, and has full emulation of the PPU pipeline. This means rendering sprites actually have an effect on the timings events occur on SameBoy, just like on a real Game Boy. Removing the sprite limit (by adding more emulated hardware comparators, the Game Boy has 10) will make the maximum length of Mode 3 significantly longer, making it possible to make it longer than 456 T-cycles, the total length of a single line, completely breaking the timing model of the PPU. So in order to increase the sprite limit you'd have to either add ugly hacks in the current PPU (which is already complicated enough) to prevent augmenting the timing for >10 sprites, or just make an entirely new PPU just for that. I'll leave this issue open as a non-goal feature for later version though.

LIJI32 avatar Aug 08 '18 08:08 LIJI32

Wow. Both solutions sound terrible. I can easily live with 10 sprites. Thanks for explaining! ;)

turhope avatar Aug 08 '18 13:08 turhope

Hi. I was playing around with the code and created this working (*) idea. Code is a little unsightly but I have no clue if it ""pseudo-simulates"" normal sprite renderer timing.

https://github.com/kalita-kan/SameBoy/commit/696c3d994e2fd7f2b0d81d5a2ffceef3fa4683cd

(*) Played a bunch of games and noticed nothing odd. I don't know of any games though that intentionally use the 10-limit to mask sprites.

ghost avatar Dec 15 '21 01:12 ghost