; spinner.s

	.module nmi

	; global from external code
	
	.globl _spinner_1
	.globl _spinner_2
	.globl spinner_enabled	
	
	; global from this code
	
	.globl  _disable_spinner
	; void disable_spinner(void)
	.globl  _enable_spinner
	; void enable_spinner(void)
	.globl  _reset_spinner_1
	; void reset_spinner_1(void)
	.globl  _reset_spinner_1
	; void reset_spinner_2(void)
	.globl _reset_spinners
	; void reset_spinners(void)
	
	.area _CODE

_disable_spinner:
	push af
	di
	xor a
	ld (spinner_enabled),a
	pop af
	ret
	
_enable_spinner:
	push af
	ei
	or #255
	ld (spinner_enabled),a
	pop af
	ret

_reset_spinner_1:
	push af
	xor	a
	ld (_spinner_1),a
	pop af
	ret

_reset_spinner_2:
	push af
	xor	a
	ld (_spinner_2),a
	pop af
	ret

_reset_spinners:
	push af
	xor	a
	ld (_spinner_1),a
	ld (_spinner_2),a
	pop af
	ret
