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

Fix mouse showing sprite 258 pressing esc #2629

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
10 changes: 2 additions & 8 deletions src/studio/studio.c
Original file line number Diff line number Diff line change
Expand Up @@ -2313,19 +2313,13 @@ static void blitCursor(Studio* studio)
if(tic->ram->vram.vars.cursor.system)
{
bank = &getConfig(studio)->cart->bank0;
hot = (tic_point[])
nesbox marked this conversation as resolved.
Show resolved Hide resolved
{
{0, 0},
{3, 0},
{2, 3},
}[CLAMP(sprite, 0, 2)];
}
else if(sprite == 0) return;
Copy link
Owner

Choose a reason for hiding this comment

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

:) we don't draw anything if tic->ram->vram.vars.cursor.system == false


const tic_palette* pal = &bank->palette.vbank0;
const tic_tile* tile = &bank->sprites.data[sprite];
const tic_tile* tile = &studio->config->cart->bank0.sprites.data[sprite];
Copy link
Owner

Choose a reason for hiding this comment

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

you always use the cursor from the config cart, this code will not work if I want to change the cursor from the game

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's true. I'll look into that.


tic_point s = {m->x - hot.x, m->y - hot.y};
tic_point s = {m->x, m->y};
u32* dst = tic->product.screen + TIC80_FULLWIDTH * s.y + s.x;

for(s32 y = s.y, endy = MIN(y + TIC_SPRITESIZE, TIC80_FULLHEIGHT), i = 0; y != endy; ++y, dst += TIC80_FULLWIDTH - TIC_SPRITESIZE)
Expand Down
Loading