;License:MIT ;(c) 2018-9 by 4am ; ; functions for managing which HGR page is showing, and doing things on the other one ; ; - GetOffscreenAddress ; - LoadTitleOffscreen ; - LoadCoverOffscreen ; - LoadHelpOffscreen ; - LoadGameTitleOffscreen ; - ResyncPage ; - ShowOtherPage ; - ToggleOffscreenPage ; - ClearOffscreen ; - ClearHGR1 ; ; Public variables ; - OffscreenPage ; OffscreenPage !byte 0 ; 0 = currently showing HGR page 2 ; (so offscreen is page 1 @ $2000) ; 1 = currently showing HGR page 1 ; (so offscreen is page 2 @ $4000) ;------------------------------------------------------------------------------ ; GetOffscreenAddress ; get high byte of HGR page that is currently not showing ; ; in: none ; out: A = high byte of offscreen HGR page (#$20 or #$40) ; preserves X/Y ;------------------------------------------------------------------------------ GetOffscreenAddress lda OffscreenPage beq + lda #$40 rts + lda #$20 rts ;------------------------------------------------------------------------------ ; LoadTitleOffscreen ; load title screen in the HGR page that is currently not showing ; ; in: none ; out: all flags and registers clobbered ;------------------------------------------------------------------------------ LoadTitleOffscreen !if >kTitleFile = >kCoverFile { lda #