#set DA2_magic_number = &F0000002

;vector_handler_5C
;-----------------
;Returns the RO3.1 address for DA2

;Entry:
; R0 - Area
;       bit 7 set if we need to return the max size
; R11 - free to use
; R12 - address for state

.vector_handler_5C
 BIC     R14, R0, #1 << 7
 TEQ     R14, #DA2_magic_number		;are we calling for the OS DA2 info?
 ANDEQ   R0, R0, #&FF			;YES
 LDRNE   R14, is_screen_remapped	;emulating RO3.11?
 TEQNE   R14, #0			;is screen memory remapped?
 BEQ     vector_handler_forward		;pass call onto OS

 TEQ     R0, #2				;screen DA?
 TEQNE   R0, #2 + (1<<7)
 BLEQ    check_SWI_in_appspace_or_JIT
 BNE     vector_handler_forward		;pass call onto OS

 TST     R0, #1 << 7			;do we need to return the max size?
 MOVNE   R2, #480 * 1024		;max DA2 size on RO3.1

 MOV     R0, #&2000000			;RO3.1 DA2 end
 LDR     R1, DA2_size			;DA2 size
 SUB     R0, R0, R1			;RO3.1 DA2 start
EXITSWI ""				;return to original caller