;Entry_ADFEmulateFDC
;-------------------
;Force emulation of a specific FDC, 710/711 or 1772
;
;Entry:
; R0 - Command tail
; R12 - pointer to module private word

.Entry_ADFEmulateFDC
 STMFD   R13!, {R0-R2, R14}
 LDR     R12, [R12, #0]

 MOV     R1, R0				;command tail
 MOV     R0, #10			;assume base 10 number
 SWI     XOS_ReadUnsigned		;read the value PRM1-460
 LDMVSFD R13!, {R0-R2, PC}		;exit on error
					;R2=FDC number
 MOV     R1, #1772
 TEQ     R2, R1				;emulate 1772?
 MOVEQ   R0, #Error_Sector_CRC_1772	;YES
 MOVEQ   R1, #Error_Sector_Not_Found_1772
 MOVEQ   R2, #1
 MOVNE   R0, #Error_Sector_CRC		;NO
 MOVNE   R1, #Error_Sector_Not_Found
 MOVNE   R2, #0
 STR     R0, [R12, #FDC_Error_Sector_CRC - VARS]
 STR     R1, [R12, #FDC_Error_Sector_Not_Found - VARS]
 STR     R2, [R12, #emulate_1772 - VARS]

LDMFD   R13!, {R0-R2, PC}