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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
29 changes: 14 additions & 15 deletions src/studio/studio.c
Original file line number Diff line number Diff line change
Expand Up @@ -2332,22 +2332,21 @@ static void blitCursor(Studio* studio)
s32 sprite = CLAMP(tic->ram->vram.vars.cursor.sprite, 0, TIC_BANK_SPRITES - 1);
const tic_bank* bank = &tic->cart.bank0;

tic_point hot = {0};

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;

tic_point hot = {0};
hot = (tic_point[])
{
{0, 0},
{3, 0},
{2, 3},
}[CLAMP(sprite, 0, 2)];

if(tic->ram->vram.vars.cursor.system)
{
bank = &getConfig(studio)->cart->bank0;
}

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};
u32* dst = tic->product.screen + TIC80_FULLWIDTH * s.y + s.x;
Expand Down
Loading