Commit ae2893c9 authored by Ben Avison's avatar Ben Avison
Browse files

Modernise build structure

* When cross-compiling, allow the assembler tool used to be overridden using
  the environment variable ASMCMD
* Rewrite Makefile to use shared makefile fragments
* Integrate separate build scripts for cros-compiling variant
* Remove dependence on ancient local copy of OSLib header files - requires a
  few tweaks to adjust for changes in OSLib types
* Remove some unused files from the local copy of the Support library
* Add .gitignore
* Tell GitLab that one source file is yacc format (rouge syntax colour
  library doesn't know yacc, so select C as next-best fit)
* Enable CI/CD
parent ba4644a1
Pipeline #1307 passed with stages
in 49 seconds
......@@ -2,3 +2,4 @@
**/s/** gitlab-language=armasm linguist-language=armasm linguist-detectable=true
**/c/** gitlab-language=c linguist-language=c linguist-detectable=true
**/h/** gitlab-language=c linguist-language=c linguist-detectable=true
**/y/** gitlab-language=c linguist-language=yacc linguist-detectable=true
/c/defmod
/o/
/objs/
/Makefile.d
/defmod,ff8
/defmod-D,fd3
variables:
WHITESPACE_WHITELIST: "./support/c/x"
include:
- project: 'Support/CI'
file: '/defmod.yml'
deploy_to_library:
stage: deploy
only:
refs: [ master ]
tags: [ cross ]
script:
# Depending on whether the pipeline is launched by the merge request or
# manually, VersionNum may or may not have been updated. Switch to the
# tip of master to ensure consistency.
- git checkout origin/master
- SOURCETAG=$(git describe --abbrev=8 --tags --always)
- BRANCH=Import$(echo $SOURCETAG | sed -e 's/[-._]//g')
- 'curl --location --output ~/cache/common/BuildHost.zip -z ~/cache/common/BuildHost.zip "https://gitlab.riscosopen.org/Products/BuildHost/-/jobs/artifacts/master/download?job=latest_package_tree"'
- unzip -q ~/cache/common/BuildHost.zip
- source RiscOS/Env/ROOL/BuildHost.sh
- git clone https://$USER:$PASSWORD@gitlab.riscosopen.org/$USER/Library.git
- TARGET=!Run INSTDIR=../Library/Build/DefMod mk install
# If the installed binary has changed in any way, raise a merge request
- cd Library && git diff --quiet --exit-code || ( git checkout -b $BRANCH; git add .; git commit -m "Update defmod from tag $SOURCETAG"; git push -o merge_request.create origin $BRANCH )
deploy_to_runner:
stage: deploy
only:
refs: [ master ]
tags: [ cross ]
script:
# Depending on whether the pipeline is launched by the merge request or
# manually, VersionNum may or may not have been updated. Switch to the
# tip of master to ensure consistency.
- git checkout origin/master
- git clone --recurse-submodules https://gitlab.riscosopen.org/Products/CrossTools.git
# Some components have outstanding MRs for cross-compilation support
- ( cd CrossTools/RiscOS/Sources/Lib/RISC_OSLib && git remote add -f bavison https://gitlab.riscosopen.org/bavison/RISC_OSLib.git && git checkout CrossCompilationSupport || true )
- ( cd CrossTools/RiscOS/Sources/Lib/OSLib && git remote add -f bavison https://gitlab.riscosopen.org/bavison/OSLib.git && git checkout CrossCompilationSupport || true )
- rm -rf RiscOS && mv CrossTools/RiscOS .
# Assume tools are not 64-bit safe until we determine otherwise
- export CFLAGS=-m32
- export LDFLAGS=-m32
- source RiscOS/Env/ROOL/CrossTools.sh
# Build dependency libraries
- mk -C RiscOS/Sources/Lib/OSLib export_hdrs
- COMPONENT=RISC_OSLib mk -C RiscOS/Sources/Lib/RISC_OSLib export_libs
# Build the tool
- INSTDIR=.. mk install
# Upload binary
- chmod 400 $SSH_PRIVATE_KEY
- rsync -avc -e "ssh -i $SSH_PRIVATE_KEY" --chown rool:rool --chmod=711 defmod root@localhost:/opt/rool/bin/defmod
......@@ -8,126 +8,67 @@
# 16-Nov-99 SNB Created.
#
#
# Paths
#
VPATH = @ sources oslib support
#
# Generic options:
#
MKDIR = do mkdir -p
AS = objasm
CP = copy
CC = cc
CM = cmhg
RM = remove
LD = link
LB = libfile
TOUCH = create
SQZ = squeeze
WIPE = x wipe
YACC = GNU.bison
DEFINES = -DRISCOS -DEXECUTE_ON_RISCOS -DPACE_BUILD
CCFLAGS = -c -depend !Depend -ffa ${INCLUDES} ${DEFINES} ${THROWBACK} -DTRACE=0 -Wp
YACCDEFS= -DYYDEBUG=0 -DYYMAXDEPTH=0
ASFLAGS = -depend !Depend -Stamp -quit ${THROWBACK} ${ASMINC}
CPFLAGS = ~cfr~v
LBFLAGS = -c
WFLAGS = ~CFR~V
SQZFLAGS = -f
YACCFLAGS = -y
#
# Libraries
#
CLIB = CLIB:o.stubs
DIRS=o._dirs
#
# Include files
#
INCLUDES = -J@.,oslib.,support.,C: -Ioslib -Isources -Isupport -IC:
ASMINC = -Ioslib -Isources -Isupport
#
# Program specific options:
#
COMPONENT = defmod
ICOMPONENT = !Run
TARGET = ${COMPONENT}
SOURCE =
EXPORTS =
OBJS=o.asmhelp o.callback o.chelp o.def o.defmod o.cheader o.hdr o.x \
o.lookup o.objasm o.realloc o.resource o.riscos o.riscosa o.cstrong
LIBS=${CLIB}
#
# Rule patterns
#
.SUFFIXES:
.SUFFIXES: .o .c .y .s
.c.o:
${CC} ${CCFLAGS} -o $@ $<
.s.o:
${AS} ${ASFLAGS} -o $@ $<
c.defmod: sources.y.defmod
${YACC} ${YACCFLAGS} -o c.defmod sources.y.defmod
COMPONENT ?= defmod
CFLAGS += ${C_NOWARN_NON_ANSI_INCLUDES}
CINCLUDES = ${OSINC} -Isources -Isupport
VPATH = sources support
OBJS = \
asmhelp \
chelp \
def \
defmod \
cheader \
hdr \
x \
lookup \
objasm \
realloc \
cstrong \
ifeq (${APCS},Host)
CDEFINES = -DPACE_BUILD -DUNIX -DEXECUTE_ON_UNIX
OBJS += \
unix \
else
CDEFINES = -DRISCOS -DEXECUTE_ON_RISCOS -DPACE_BUILD -DTRACE=0 -DYYDEBUG=0 -DYYMAXDEPTH=0
LIBS = ${OSLIB}
OBJS += \
callback \
resource \
riscos \
riscosa \
endif
SOURCES_TO_SYMLINK = \
$(wildcard sources/c/*) $(wildcard sources/h/*) $(wildcard sources/y/*) \
$(wildcard support/c/*) $(wildcard support/h/*) $(wildcard support/s/*)
include CApp
ifeq (,${MAKE_VERSION})
c.defmod: y.defmod
${MKDIR} $*
${YACC} ${YFLAGS} -o $*.c sources.y.defmod
${CP} $*.c c.$* ${CPFLAGS}
${WIPE} $* ${WFLAGS}
o.defmod: c.defmod
${CC} ${CCFLAGS} ${YACCDEFS} -o $@ c.defmod
${CC} ${CFLAGS} -o $@ c.defmod
#
# build defmod
#
all: ${TARGET}
@|
clean::
${RM} c.defmod
install: all
${MKDIR} ${INSTDIR}.DefMod
${CP} ${TARGET} ${INSTDIR}.DefMod.!Run ${CPFLAGS}
@echo Installation of tool ${COMPONENT} complete
else
#
# RISC OS ROM build rules:
#
rom: ${TARGET}
@echo ${COMPONENT}: rom module built
defmod.c: defmod.y
${YACC} ${YFLAGS} -o $*.c $<
export: export_${PHASE}
install_rom: ${TARGET}
@echo ${COMPONENT}: rom module installed
clean:
${WIPE} c ${WFLAGS}
${WIPE} o ${WFLAGS}
${RM} ${COMPONENT}
@echo ${COMPONENT}: cleaned
export_hdrs:
@echo ${COMPONENT}: export complete (hdrs)
export_libs:
@echo ${COMPONENT}: export complete (libs)
${DIRS}:
${MKDIR} c
${MKDIR} o
${TOUCH} $@
#
# Final link
#
${TARGET}: ${OBJS} ${LIBS} ${DIRS}
${LD} ${LDFLAGS} -o ${COMPONENT} ${OBJS} ${LIBS}
${SQZ} ${SQZFLAGS} $@
endif
# Dynamic dependencies:
[ :LNOT: :DEF: Get_Types
GBLS Get_Types
]
[ :LNOT: :DEF: Types_Hdr
Get_Types SETS "GET Hdr.Types"
|
Get_Types SETS ""
]
$Get_Types
[ :LNOT: :DEF: OS_Hdr
GBLS OS_Hdr
XOS_ReadVarVal * &20023
OS_ReadVarVal * &23
;Entry
; R0 -> var (String)
; R1 = value (pointer to String)
; R2 = size (Int)
; R3 = context (Int)
; R4 = var_type (OS_VarType)
;Exit
; R0 corrupted
; R2 = used (Int)
; R3 = context_out (Int)
; R4 = var_type_out (OS_VarType)
]
END
[ :LNOT: :DEF: Types_Hdr
GBLL Types_Hdr
R0 RN 0
R1 RN 1
R2 RN 2
R3 RN 3
R4 RN 4
R5 RN 5
R6 RN 6
R7 RN 7
R8 RN 8
R9 RN 9
R10 RN 10
R11 RN 11
R12 RN 12
R13 RN 13
R14 RN 14
R15 RN 15
A1 RN 0
A2 RN 1
A3 RN 2
A4 RN 3
V1 RN 4
V2 RN 5
V3 RN 6
V4 RN 7
V5 RN 8
V6 RN 9
R RN 0
SL RN 10
FP RN 11
IP RN 12
SP RN 13
LR RN 14
PC RN 15
Int * 4
Bits * 4
Bool * 4
Short * 2
Char * 1
Byte * 1
Ptr * 4
Float * 4
Double * 8
Null * 0
False * 0
True * 1
None * 0
All * &FFFFFFFF
Skip * 0
;may be used as a "don't care" value
V * 1 :SHL: 28
C * 1 :SHL: 29
Z * 1 :SHL: 30
N * 1 :SHL: 31
Error * -2
]
END
#ifndef fileswitch_H
#define fileswitch_H
/*OSLib---efficient, type-safe, transparent, extensible,\n"
register-safe A P I coverage of RISC O S*/
/*Copyright 1994 Jonathan Coxhead*/
/*
OSLib is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
OSLib is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this programme; if not, write to the Free Software
Foundation, Inc, 675 Mass Ave, Cambridge, MA 02139, U S A.
*/
#ifndef types_H
#include "types.h"
#endif
#ifndef os_H
#include "os.h"
#endif
/**********************************
* SWI names and SWI reason codes *
**********************************/
#undef OS_BGet
#define OS_BGet 0xA
#undef XOS_BGet
#define XOS_BGet 0x2000A
#undef BGetV
#define BGetV 0xA
#undef OS_BPut
#define OS_BPut 0xB
#undef XOS_BPut
#define XOS_BPut 0x2000B
#undef BPutV
#define BPutV 0xB
#undef Service_StartUpFS
#define Service_StartUpFS 0x12
#undef Service_FSRedeclare
#define Service_FSRedeclare 0x40
#undef Service_CloseFile
#define Service_CloseFile 0x68
/************************************
* Structure and union declarations *
************************************/
typedef union fileswitch_info_words fileswitch_info_words;
/********************
* Type definitions *
********************/
typedef byte fileswitch_fs_no;
typedef bits fileswitch_fs_info;
typedef bits fileswitch_fs_extra_info;
typedef int fileswitch_object_type;
typedef bits fileswitch_attr;
union fileswitch_info_words
{ os_date_and_time date_and_time;
struct
{ bits exec_addr;
bits load_addr;
}
addrs;
};
/************************
* Constant definitions *
************************/
#define error_FILE_SWITCH_NO_CLAIM 0x400u
/*Unable to claim FileSwitch workspace*/
#define error_BAD_FS_CONTROL_REASON 0x401u
/*Bad FSControl call*/
#define error_BAD_OS_FILE_REASON 0x402u
/*Bad OSFile call*/
#define error_BAD_OS_ARGS_REASON 0x403u
/*Bad OSArgs call*/
#define error_BAD_OSGBPB_REASON 0x404u
/*Bad OSGBPB call*/
#define error_BAD_MODE_FOR_OS_FIND 0x405u
/*Bad mode for OSFind*/
#define error_NO_ROOM_FOR_TRANSIENT 0x406u
/*No room to run transient*/
#define error_EXEC_ADDR_NOT_IN_CODE 0x407u
/*Execution address not within code*/
#define error_EXEC_ADDR_TOO_LOW 0x408u
/*Code runs too low*/
#define error_UNKNOWN_ACTION_TYPE 0x409u
/*No run action for this file type*/
#define error_TOO_MANY_LEVELS 0x40Au
/*Too many levels*/
#define error_NO_SELECTED_FILING_SYSTEM 0x40Bu
/*No selected filing system*/
#define error_CANT_REMOVE_FS_BY_NUMBER 0x40Cu
/*Can't remove filing system by number*/
#define error_UNALIGNED_FS_ENTRY 0x40Du
/*Unaligned filing system entry point*/
#define error_UNSUPPORTED_FS_ENTRY 0x40Eu
/*Filing system does not support this operation*/
#define error_FS_NOT_SPECIAL 0x40Fu
/*Filing system does not support special fields*/
#define error_CORE_NOT_READABLE 0x410u
/*No readable memory at this address*/
#define error_CORE_NOT_WRITEABLE 0x411u
/*No writable memory at this address*/
#define error_BAD_BUFFER_SIZE_FOR_STREAM 0x412u
/*Bad buffer size*/
#define error_NOT_OPEN_FOR_READING 0x413u
/*Not open for reading*/
#define error_NOT_ENOUGH_STACK_FOR_FS_ENTRY 0x414u
/*Not enough stack to call filing system*/
#define error_NOTHING_TO_COPY 0x415u
/*Nothing to copy*/
#define error_NOTHING_TO_DELETE 0x416u
/*Nothing to delete*/
#define error_FILE_SWITCH_CANT_BE_KILLED_WHILST_THREADED 0x417u
/*FileSwitch can not be killed whilst it is threaded*/
#define error_INVALID_ERROR_BLOCK 0x418u
/*Invalid error block*/
#define error_FS_FILE_TOO_BIG 0x419u
/*File too big , Clashed with ROMFS FileTooBig*/
#define error_CANT_RM_FASTER_FILE_SWITCH 0x41Au
/*Can't RMFaster FileSwitch*/
#define error_INCONSISTENT_HANDLE_SET 0x41Bu
/*Inconsistent handle set*/
#define error_IS_AFILE 0x41Cu
/*Object is a file*/
#define error_BAD_FILE_TYPE 0x41Du
/*Bad file type*/
#define error_LIBRARY_SOMEWHERE_ELSE 0x41Eu
/*The library is somewhere else*/
#define error_PATH_IS_SELF_CONTRADICTORY 0x41Fu
/*Path is self contradictory*/
#define error_WASNT_DOLLAR_AFTER_DISC 0x420u
/*Disc was specified, but absolute wasn't $*/
#define error_NOT_ENOUGH_MEMORY_FOR_WILDCARD_RESOLUTION 0x421u
/*Not enough memory for wildcard resolution*/
#define error_NOT_ENOUGH_STACK_FOR_WILDCARD_RESOLUTION 0x422u
/*Not enough stack for wildcard resolution*/
#define error_DIR_WANTED_FILE_FOUND 0x423u
/*Directory wanted, but file found*/
#define error_NOT_FOUND 0x424u
/*Not found, &0100D6*/
#define error_MULTIPART_PATH_USED 0x425u
/*Path variable had multiple entries and was used for a write operation*/
#define error_RECURSIVE_PATH 0x426u
/*One of the path variables used refers to itself*/
#define error_MULTI_FS_DOES_NOT_SUPPORT_GBPB11 0x427u
/*The OS_GBPB 11 call is not supported by image filing systems*/
#define error_FILE_SWITCH_DATA_LOST 0x428u
/*Data lost, &4AC , Consistent with ADFS*/
#define error_TOO_MANY_ERROR_LOOKUPS 0x429u
/*Too many error lookups happening at once - recursion assumed*/
#define error_MESSAGE_FILE_BUSY 0x42Au
/*FileSwitch message file busy*/
#define error_PARTITION_BUSY 0x42Bu
/*Partition not ready*/
#define fileswitch_FS_NUMBER_NONE ((fileswitch_fs_no) 0x0u)
#define fileswitch_FS_NUMBER_ROMFS ((fileswitch_fs_no) 0x3u)
#define fileswitch_FS_NUMBER_NETFS ((fileswitch_fs_no) 0x5u)
#define fileswitch_FS_NUMBER_ADFS ((fileswitch_fs_no) 0x8u)
#define fileswitch_FS_NUMBER_NETPRINT ((fileswitch_fs_no) 0xCu)
#define fileswitch_FS_NUMBER_NULL ((fileswitch_fs_no) 0xDu)
#define fileswitch_FS_NUMBER_PRINTER ((fileswitch_fs_no) 0xEu)
#define fileswitch_FS_NUMBER_SERIAL ((fileswitch_fs_no) 0xFu)
#define fileswitch_FS_NUMBER_VDU ((fileswitch_fs_no) 0x11u)
#define fileswitch_FS_NUMBER_RAWVDU ((fileswitch_fs_no) 0x12u)
#define fileswitch_FS_NUMBER_KBD ((fileswitch_fs_no) 0x13u)
#define fileswitch_FS_NUMBER_RAWKBD ((fileswitch_fs_no) 0x14u)
#define fileswitch_FS_NUMBER_DESKFS ((fileswitch_fs_no) 0x15u)
#define fileswitch_FS_NUMBER_RAMFS ((fileswitch_fs_no) 0x17u)
#define fileswitch_FS_NUMBER_RISCIXFS ((fileswitch_fs_no) 0x18u)
#define fileswitch_FS_NUMBER_STREAMER ((fileswitch_fs_no) 0x19u)
#define fileswitch_FS_NUMBER_SCSIFS ((fileswitch_fs_no) 0x1Au)
#define fileswitch_FS_NUMBER_DIGITISER ((fileswitch_fs_no) 0x1Bu)
#define fileswitch_FS_NUMBER_SCANNER ((fileswitch_fs_no) 0x1Cu)
#define fileswitch_FS_NUMBER_MULTIFS ((fileswitch_fs_no) 0x1Du)
#define fileswitch_FS_NUMBER_NFS ((fileswitch_fs_no) 0x21u)
#define fileswitch_FS_NUMBER_CDFS ((fileswitch_fs_no) 0x25u)
#define fileswitch_FS_NUMBER_DOSFS ((fileswitch_fs_no) 0x2Bu)
#define fileswitch_FS_NUMBER_RESOURCEFS ((fileswitch_fs_no) 0x2Eu)
#define fileswitch_FS_NUMBER_PIPEFS ((fileswitch_fs_no) 0x2Fu)
#define fileswitch_FS_NUMBER_DEVICEFS ((fileswitch_fs_no) 0x35u)
#define fileswitch_FS_NUMBER_PARALLEL ((fileswitch_fs_no) 0x36u)
#define fileswitch_FS_NUMBER_PCCARDFS ((fileswitch_fs_no) 0x59u)
#define fileswitch_FS_NUMBER_SHAREFS ((fileswitch_fs_no) 0x63u)
#define fileswitch_FS_NUMBER ((fileswitch_fs_info) 0xFFu)
#define fileswitch_FS_OPEN_FILE_LIMIT ((fileswitch_fs_info) 0xFF00u)
#define fileswitch_FS_READ_ONLY ((fileswitch_fs_info) 0x10000u)
#define fileswitch_HAS_EXTRA_FLAGS ((fileswitch_fs_info) 0x20000u)
#define fileswitch_NO_FILE_ENTRIES ((fileswitch_fs_info) 0x40000u)
#define fileswitch_NO_SAVE_ENTRY ((fileswitch_fs_info) 0x80000u)
#define fileswitch_NO_LOAD_ENTRY ((fileswitch_fs_info) 0x100000u)
#define fileswitch_IMPLICIT_DIRECTORIES ((fileswitch_fs_info) 0x200000u)
#define fileswitch_NEEDS_URD_AND_LIB ((fileswitch_fs_info) 0x400000u)
#define fileswitch_SUPPORTS_IMAGE ((fileswitch_fs_info) 0x800000u)
#define fileswitch_RESERVED ((fileswitch_fs_info) 0x1000000u)
#define fileswitch_SUPPORTS_FILE_INFO ((fileswitch_fs_info) 0x2000000u)
#define fileswitch_SUPPORTS_STAMP_NAMED ((fileswitch_fs_info) 0x4000000u)
#define fileswitch_NEEDS_FLUSH ((fileswitch_fs_info) 0x8000000u)
#define fileswitch_NEEDS_CREATE ((fileswitch_fs_info) 0x10000000u)
#define fileswitch_SUPPORTS_EMPTY_NAMES ((fileswitch_fs_info) 0x20000000u)
#define fileswitch_INTERACTIVE ((fileswitch_fs_info) 0x40000000u)
#define fileswitch_SUPPORTS_SPECIAL ((fileswitch_fs_info) 0x80000000u)
#define fileswitch_SUPPORTS_DIR_CHANGE ((fileswitch_fs_extra_info) 0x1u)
#define fileswitch_NEEDS_CAT ((fileswitch_fs_extra_info) 0x2u)
#define fileswitch_NEEDS_EX ((fileswitch_fs_extra_info) 0x4u)
#define fileswitch_NOT_FOUND ((fileswitch_object_type) 0x0u)
#define fileswitch_IS_FILE ((fileswitch_object_type) 0x1u)
#define fileswitch_IS_DIR ((fileswitch_object_type) 0x2u)
#define fileswitch_IS_IMAGE ((fileswitch_object_type) 0x3u)
#define fileswitch_ATTR_OWNER_READ ((fileswitch_attr) 0x1u)
#define fileswitch_ATTR_OWNER_WRITE ((fileswitch_attr) 0x2u)
#define fileswitch_ATTR_OWNER_SPECIAL ((fileswitch_attr) 0x4u)
#define fileswitch_ATTR_OWNER_LOCKED ((fileswitch_attr) 0x8u)
#define fileswitch_ATTR_WORLD_READ ((fileswitch_attr) 0x10u)
#define fileswitch_ATTR_WORLD_WRITE ((fileswitch_attr) 0x20u)
#define fileswitch_ATTR_WORLD_SPECIAL ((fileswitch_attr) 0x40u)
#define fileswitch_ATTR_WORLD_LOCKED ((fileswitch_attr) 0x80u)
#define error_NOT_SUPPORTED 0xF8u
/*Bad operation on ...:*/
#define error_FS_WRITE_ONLY 0xFAu
/*...: is a write only filing system*/
#define error_FS_READ_ONLY 0xFCu
/*...: is a read only filing system*/
#define xos_bget(file, c, psr) \
_swix (OS_BGet, _IN (1) | _OUT (0) | _OUT (_FLAGS), file, c, psr)
#define xos_bput(c, file) \
_swix (OS_BPut, _IN (0) | _IN (1), c, file)
#endif
#ifndef font_H
#define font_H
#include <swis.h>
#ifndef types_H
#include "types.h"
#endif
#ifndef os_H
#include "os.h"
#endif
#define font_COMMAND_NUL 0
#define font_COMMAND_MOVE_HORIZONTAL 9
#define font_COMMAND_LF 10
#define font_COMMAND_MOVE_VERTICAL 11
#define font_COMMAND_CR 13
#define font_COMMAND_GCOL 17
#define font_COMMAND_COLOURS 18
#define font_COMMAND_TRUE_COLOURS 19
#define font_COMMAND_COMMENT 21
#define font_COMMAND_UNDERLINE 25
#define font_COMMAND_FONT 26
#define font_COMMAND_MATRIX 27
#define font_COMMAND_MATRIX_WITH_OFFSET 28
#define font_PAINT_JUSTIFY (1U << 0)
#define font_PAINT_RUBOUT (1U << 1)
#define font_PAINT_OS_UNITS (1U << 4)
#define font_PAINT_GIVEN_COORDS (1U << 5)
#define font_PAINT_GIVEN_TRFM (1U << 6)
#define font_PAINT_GIVEN_LENGTH (1U << 7)
#define font_PAINT_GIVEN_FONT (1U << 8)
#define font_PAINT_KERN (1U << 9)