; ImageFileRender's boundaries. Its C works on register blocks, as its
; ARM32 CMHG veneers gave it, so each SWI hands it the caller's register
; image (`pass regs`); c/ifrglue.c turns the entries into its own calls.
;
; Copyright (c) RISC OS Technologies 2026. MIT licence - see LICENSE.

prefix	ifr
include	riscos/services.h

module-init
module-final
command	ImageFileRenderers

module-service	dispatch=r1
	on 0xDA -> ifr_service_post_init
		in	r2	title		uint32_t
	; A module has gone: r2 its title, r3 where its code was.
	on 0xDB -> ifr_service_post_final
		in	r2	title		uint32_t
		in	r3	base		uint32_t
	otherwise -> ifr_service_ignored

module-swi	dispatch=r11
	on 0 -> ifr_swi_render
		pass	regs
	on 1 -> ifr_swi_bbox
		pass	regs
	on 2 -> ifr_swi_transform
		pass	regs
	on 3 -> ifr_swi_declare_fonts
		pass	regs
	on 4 -> ifr_swi_info
		pass	regs
	on 5 -> ifr_swi_renderer_info
		pass	regs
	on 6 -> ifr_swi_register
		pass	regs
	on 7 -> ifr_swi_deregister
		pass	regs
	on 8 -> ifr_swi_enumerate
		pass	regs
	otherwise -> ifr_swi_unknown
