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

BASIC sprite max X position doesn't support VIC-IV SPRH640 mode #70

Closed
GeorgRottensteiner opened this issue Aug 27, 2023 · 2 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@GeorgRottensteiner
Copy link

Test Environment (required)
You can use MEGA65INFO to retrieve this.

  • Platform: xemu
  • ROM Release: 920377
  • Core Commit: Sorry, what's the Mega-Key on xemu? (7 digit hex number, press MEGA-TAB)

Describe the bug
When enabling double X resolution for sprites, the X position seems to be capped at 512 (511 max). Any higher values are truncated.

To Reproduce
Steps to reproduce the behavior:

  1. Enter following BASIC program:

10 MOUSE ON,1,0
20 SPRITE 1,1,1
30 MOVSPR 1,100,100
40 SETBIT $d054,4

  1. Try to move the mouse to the right edge of the screen.

The same issue happens, when you do not use MOUSE, and manually try to MOVSPR 1,1400,100 for example.

Expected behavior
The sprite should reach the right edge in MOUSE grab mode, and also when manually positioned at coordinates with X >= 512.

Screenshots
Not applicable.

Additional context
Found by MC64 in Forum64 thread (https://www.forum64.de/index.php?thread/139199-das-seltsame-verhalten-der-spritebefehle/)

@GeorgRottensteiner GeorgRottensteiner added the new New report, not classified yet label Aug 27, 2023
@dansanderson dansanderson added enhancement New feature or request and removed new New report, not classified yet labels Sep 11, 2023
@dansanderson
Copy link
Collaborator

I'm going to leave this in the queue as an "enhancement" for now, but the solution would probably be a part of a major overhaul of BASIC 65 to support MEGA65 VIC-IV features. BASIC 65 is designed for the VIC-III and only knows about VIC-III features. SPRH640 is a VIC-IV feature, and it would have to be one of many VIC-IV features that BASIC 65 needs to know about to work properly. We might be able to fix this specific issue with a small change, but I'm not sure it makes sense to fix this one and not hundreds of other similar accommodations for VIC-IV features.

Nice find, though. :)

@dansanderson dansanderson changed the title BASIC - SPRITES X position in double X resolution capped at 512 BASIC sprite max X position doesn't support VIC-IV SPRH640 mode Sep 11, 2023
@dansanderson dansanderson self-assigned this Jan 31, 2024
@dansanderson
Copy link
Collaborator

Implemented.

We will soon be adding a mode that matches the sprite resolution to the screen resolution, using a BASIC command. The intent is to also support adjusting the sprenv400 and sprh640 registers directly with POKEs, i.e. any BASIC subsystem that depends on this state will read it from the registers.

Hires support for the MOUSE driver will be implemented separately, tracked here: #126

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants