freemint / fvdi

fVDI fork with additional fixes and drivers.
https://fvdi.sourceforge.io
7 stars 6 forks source link

Change font sizes from short to fix31 #36

Closed chrisridd closed 2 years ago

chrisridd commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

chrisridd commented 2 years ago

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

chrisridd commented 2 years ago

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 😞

chrisridd commented 2 years ago

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 commented 2 years ago

Great you found the culprit. Thanks again!

mfro0 commented 2 years ago

https://github.com/freemint/fvdi/issues/30#issuecomment-1126666174