#OpenDiskFont()
16-Jun-95 07:47:58
Sb: #47219-#OpenDiskFont()
Fm: Phillip Wooller 100024,2227
To: Bart Mathias 72017,1005
I couldn't see anything else wrong except you need to change the line
move.l ascfont,a0
to
move.l #ascfont,a0
or preferably
lea ascfont,a0
Some people don't like the lea instruction because it can't be used to load a
value into a data register, only address registers.
What you would find if you used a debugger (codeprobe or equivalent) is that a0
is actually being set to the address of the font name (the font name address is
the first long word in your textattr structure). When OpenDiskFont came to open
your font it would take the first 4letters of the fontname and use that as an
address, so if you were trying to open the font "times" it would then look at
the address 0x74696D65 for the font name. As you won't have any memory at that
address, it is no wonder it didn't work (weird you didn't get a system crash on
that one).
I have made that mistake in assember on 8086,68000 & 6502, so don't feel to bad
🙂
Try it, it should then work.
Phill