Skip to content

Scrolled backgrounds should wrap #5

@zmarvel

Description

@zmarvel

I optimistically hoped that SDL_BlitSurface would wrap the source image---for example, if the width of the source image is 64 and the source rectangle is (x=48, y=0, w=64, h=64), the destination image would contain pixels from the source image rectangle (x=0, y=0, w=48, h=64). This is how the Game Boy behaves with the SCX and SCY registers.

This means slowboy should handle the following additional cases in the GPU.draw method (assume BGW and BGH are background width and height, respectively, and SW and SH are screen width and height, respectively):

  • SCX+SW > BGW
  • SCY+SH > BGH
  • SCX+SW > BGW and SCY+SH > BGH

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions