Skip to content

Conversation

@ZERICO2005
Copy link
Contributor

Fixes TODO: I think the CP here might sometimes SET carry when it shouldn't be? in fontlibc_GetFontByStyleRaw

@ZERICO2005 ZERICO2005 requested a review from drdnar February 11, 2026 20:29
@ZERICO2005 ZERICO2005 added bug lib/fontlibc Issues related to the font rendering library labels Feb 11, 2026
Comment on lines -2013 to 2015
and a,c
cp a,c
ld c, (ix + strucFont.style)
ld a, (iy + arg5)
; test for required set bits
and a, c
xor a, c
ret nz
Copy link
Contributor Author

@ZERICO2005 ZERICO2005 Feb 11, 2026

Choose a reason for hiding this comment

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

and a, c makes it so a is less than or equal to c. Meaning that carry will be set if a does not equal c. Switching cp to xor fixes this (we only need to test for equality and don't need to preserve a)

Comment on lines -2018 to -2020
and a,c
xor a,c
cp a,c
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using the same trick of converting cp to xor to test for equality, we find that this becomes and a, c \ xor a, c \ xor a, c, which simplifies to and a, c

@ZERICO2005 ZERICO2005 marked this pull request as ready for review February 11, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug lib/fontlibc Issues related to the font rendering library

Development

Successfully merging this pull request may close these issues.

1 participant