h6. [[Service Calls|Service Calls]] h6(. » Service_DisplayChanged h2. Service_DisplayChanged h5. (Service &DE) |_<^{width:4em}. Entry | | |<^. R0 |<^. Reason | |<^. R1 |<^. 222 (&DE)| |<^. R2 |<^. New display number | |/4<^. R3 |<^. Sub-reason: | |<^. 0 = Mode will be changed | |<^. 128 = Mode will not be changed | h4(#reason). Reason Codes |_<^{width:4em}. #|_<^{width:4em}. Hex #|_<^. Action| |<^. 0|<^. &00|<^. Display is in process of being changed | |<^. 1|<^. &01|<^. Display change complete | |<^. 128|<^. &80|<^. Display change about to begin | h4. Use This service call is issued by [[OS_ScreenMode 11]] when the OS is switching to a different video driver, or when the kernel receives a [[Service_DisplayStatus]] 'configuration changing' service call for the current [[GraphicsV]] driver. Under RISC OS 5 the service call is issued three times, for three different stages of the operation: * The first call will be made with reason 128 (change about to begin). At this point in time the VDU state will not have changed in any way. Programs should cease any interrupt-driven VDU output or direct screen access, as the VDU state is about to become indeterminate. * The second call will be made with reason 0 (change in progress), after the kernel has updated [[VDU Variables|VDU variable 192]] to contain the new driver number. However the rest of the VDU state will not have been updated yet. Software which deals with screen mode selection (e.g. the [[ScreenModes]] module) should recache its mode lists for the new driver. * The third call will be made with reason 1 (change complete), once the kernel has fully switched over to the new driver and selected a new screen mode. At this point the VDU is stable again and it is safe for interrupt-driven VDU output to resume. For all the stages, R2 contains the new display number (i.e. GraphicsV driver number). If activation of the new driver fails for any reason, the kernel will attempt to restore the previous driver. This will result in a sequence of four service calls instead of the usual three; reasons 128 and 0 will be issued with R2 set to the new driver, followed by 0 and 1 for the original driver. h4. Notes The value of R3 is a sub-reason code. Sub-reason code 0 is used from within [[OS_ScreenMode 11]] to indicate that the operation is going to result in the screen mode being changed. Sub-reason code 128 is used from within [[Service_DisplayStatus]] to indicate that the screen mode isn't going to change. Other sub-reason codes may be defined in future. Under RISC OS 5, the display number in R2 corresponds to the [[GraphicsV]] driver number. Under RISC OS Select, the display number in R2 corresponds to the [[VideoV]] driver number. h4. See Also * [[OS_ScreenMode]] * [[GraphicsV]] * [[VDU Variables]] * [[Service_DisplayStatus]]