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

Change font sizes from short to fix31 #36

Merged
merged 1 commit into from
May 13, 2022
Merged

Conversation

chrisridd
Copy link

font->size (short) has been renamed and is now replaced with font->extra.size (fix31).
Many C interfaces are now changed to take fix31 sizes, and to convert back to short when
necessary.

New assembly macros are added for fix31<->short conversions, and to slightly improve
readability. The GNU macros are tested. The Lattice and PortAsm macros are hopefully
correct.

vst_arbpt32() is now supported correctly. Papyrus uses this a lot.

@chrisridd
Copy link
Author

This doesn't add full fix31 support everywhere, but it should be a good start for adding the remaining support e.g. vqt_advance32(), vqt_f_extent(), v_ftext() etc.

@mfro0
Copy link
Member

mfro0 commented May 12, 2022

Thank you for your pull request.

It appears your changes aren't liked much by pacf, however, causing the build process for ColdFire to fail.

Can you check, please?

@chrisridd
Copy link
Author

I'm puzzled by that. It looks like pacf is being told "gas=1" so is using macros.gnu. But even though gas is OK with them, pacf is somehow not. Strange.

I'll need to get pacf installed in a Linux x86 VM to investigate further.

@mfro0
Copy link
Member

mfro0 commented May 12, 2022

What platform are you on? There is a pacf.exe for Windows (nothing for Mac, unfortunately) as well.

@chrisridd
Copy link
Author

I'm on an M1 Mac. But I can get a Linux VM going on my work x86 Mac and install pacf there.

@chrisridd
Copy link
Author

After some investigation, it looks like pacf doesn't convert register names passed as parameters to a macro. You'd need to write something like this:

    ifne mcoldfire
        short_to_fix31 %d0,(%a2)
    else
        short_to_fix31 d0,(a2)
    endc

which is pretty gross and IMO loses most of the benefits of using the macro. pacf also adds code to preserve registers around the macro, which might need disabling somehow.

I'll play around some more and maybe contact MicroAPL but I think I might have to revert from using macros with register parameters 😞

font->size (short) has been renamed and is now replaced with font->extra.size (fix31).
Many C interfaces are now changed to take fix31 sizes, and to convert back to short when
necessary.

New assembly macros are added for fix31<->short conversions, and to slightly improve
readability. The GNU macros are tested, which also work with PortAsm. The other macro
versions are hopefully correct.

vst_arbpt32() is now supported correctly. Papyrus uses this a lot.
@chrisridd
Copy link
Author

OK, so while trying to figure out a test case for microapl support I figured out what was wrong. The change was in the macro definitions. From:

    .if \src == \dst

to:

    .ifc \src,\dst

(And a similar one to .ifnc)

@mfro0 mfro0 merged commit 60934b6 into freemint:master May 13, 2022
@mfro0
Copy link
Member

mfro0 commented May 13, 2022

Great you found the culprit. Thanks again!

@chrisridd chrisridd deleted the fix31 branch May 13, 2022 19:41
@mfro0
Copy link
Member

mfro0 commented May 14, 2022

#30 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants