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

MEGA65: VIC-IV (alt-)palette related issues #402

Open
lgblgblgb opened this issue Jun 9, 2024 · 0 comments
Open

MEGA65: VIC-IV (alt-)palette related issues #402

lgblgblgb opened this issue Jun 9, 2024 · 0 comments

Comments

@lgblgblgb
Copy link
Owner

lgblgblgb commented Jun 9, 2024

Mirage_BD on Discord has some very useful observations (thanks!) in terms of bugs in Xemu's VIC-IV emulation. This issue stands here as a reminder for me not to forget these and also as a place to discuss further this (these) issues.

The thread on Discord: https://discord.com/channels/719326990221574164/781481205639020554/1249020115085955123

Test program: megajpg.d81.zip

The highlights (so far):

The good: MEGAJPG seems to work (compared to 2023/July/2 state) basically

image1

The bad: ... however the file selector has a strange red background which was not the case before:

image2

His suggestion:

if bold and reverse both need to be set, shouldn't SXA_ATTR_ALTPALETTE(cw) in vic4.h be this:
#define SXA_ATTR_ALTPALETTE(cw) (((cw) & 0x0060) == 0x0060) instead of just ((cw) & 0x0060)
[...]
Just had another look at it, and the other thing you'll have to change is line 1474 of vic4.c:
const Uint32 *palette_now = ((REG_VICIII_ATTRIBS) && SXA_ATTR_ALTPALETTE(color_data)) ? altpalette : used_palette;
The change being the extra check for REG_VICIII_ATTRIBS... The alternate palette only has to be selected if bold+reverse and
vic3-attribs are enabled. That with the fix for the #define fixes all the issues in my programs.

And the ugly: bad border colour?

Unknown if there is anything related to the previous topic here, or something independent as a bug. Xemu currently does this, when it needs to render border colour: palette[REG_BORDER_COLOR]. Maybe this should be done?

used_palette[REG_BORDER_COLOR]

Images got from Discord and were taken by Mirage_BD.

@lgblgblgb lgblgblgb self-assigned this Jun 10, 2024
@lgblgblgb lgblgblgb moved this from TODO to In Progress in MEGA65 emulator project Jun 10, 2024
@lgblgblgb lgblgblgb changed the title MEGA65: VIC-IV palette related issues MEGA65: VIC-IV (alt-)palette related issues Jun 10, 2024
lgblgblgb added a commit that referenced this issue Jun 12, 2024
Reported/suggested by Mirage_BD on Discord. Thanks!!
lgblgblgb added a commit that referenced this issue Jun 12, 2024
Reported/suggested by Mirage_BD on Discord. Thanks!!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

1 participant