Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions src/fontlibc/fontlibc.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1990,34 +1990,33 @@ fontlib_GetFontByStyleRaw:
.badFont:
pop ix
ret

.checkStyle:
ld a,(ix + strucFont.height)
cp (iy + arg1)
cp a, (iy + arg1)
ccf
ret nc
cp (iy + arg2)
cp a, (iy + arg2)
jr z,.sizeOK
ret nc
.sizeOK:
ld a,(ix + strucFont.weight)
cp (iy + arg3)
cp a, (iy + arg3)
ccf
ret nc
cp (iy + arg4)
cp a, (iy + arg4)
jr z,.weightOK
ret nc
.weightOK:
; TODO: I think the CP here might sometimes SET carry when it shouldn't be?
ld a,(ix + strucFont.style)
ld c,(iy + arg5)
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
ld a,(ix + strucFont.style)
ld c,(iy + arg6)
and a,c
xor a,c
cp a,c
ld a, (iy + arg6)
; test for required cleared bits
and a, c
ret nz
scf
ret
Expand Down
Loading