;************************************************
;* openHelp
;*
;* Input : map/battle state; displayList and helpDisplay
;* Output: modal text help; game timers remain paused
;* Trash: a,flags; ANTIC/GTIA display configuration
;************************************************

openHelp

        jsr	muteSound

        lda	#1
        sta	help.active
        lda	#$40
        sta	NMIEN
        lda	#0
        sta	GRACTL
        sta	HELPFG
        lda	#<helpDisplay
        sta	SDLSTL
        lda	#>helpDisplay
        sta	SDLSTH
        lda	#$0e
        sta	COLOR1
        lda	#$02
        sta	COLOR2
        lda	#$22
        sta	SDMCTL
        rts

;************************************************
;* closeHelp
;*
;* Input : help.active; preserved map or battle bitmap
;* Output: original display restored without a bitmap redraw
;* Trash: a,flags; display configuration and input latches
;************************************************

closeHelp

        lda	#<displayList
        sta	SDLSTL
        lda	#>displayList
        sta	SDLSTH
        lda	#MAP_ORANGE
        sta	COLOR1
        lda	#MAP_BLUE
        sta	COLOR2
        lda	#3
        sta	GRACTL
        lda	#$3e
        sta	SDMCTL
        lda	#$c0
        sta	NMIEN
        lda	#0
        sta	help.active
        sta	HELPFG
        sta	input.repeatDelay
        lda	STRIG0
        sta	input.fireOld
        lda	CONSOL
        and	#5
        sta	input.consoleOld
        lda	#NONE
        sta	CH
        rts
