1
0
mirror of https://github.com/UzixLS/zx-sizif-xxs.git synced 2025-07-19 07:11:28 +03:00
Files
zx-sizif-xxs/rom_src/pause.asm
UzixLS 0e572d9d69 merge latest changes from sizif-512
* add 4.4 MHz and 5.2 MHz turbo modes
* handle magic key press if initialization wasn't completed before
* replace 'timings', 'ram', 'plus3' settings with one 'machine' setting
* refactor memory controller
* significantly improve classic timings
* magic rom: fix 'h' font character
* fix hanging of esxdos browser after magic key double press
* enable divmmc (esxdos OS) by magic rom on poweron; add NO-OS option
* improve pause ('f12' on ps/2 keyboard or 'start' on gamepad)
* magic rom: handle C-key on sega gamepad as exit
2021-09-21 20:00:23 +03:00

34 lines
921 B
NASM

pause_init:
ld d, PAUSE_BODY_ATTR
ld c, PAUSE_X
ld b, PAUSE_Y
ld e, PAUSE_WIDTH
call draw_attribute_line
ld b, PAUSE_Y+2
ld e, PAUSE_WIDTH
call draw_attribute_line
ld d, PAUSE_TEXT_ATTR
ld b, PAUSE_Y+1
ld e, PAUSE_WIDTH
call draw_attribute_line
ld b, (PAUSE_Y+1)<<3
ld hl, str_pause
call print_string
ret
pause_process:
ld a, #ff ; read pause key state in bit 1 of #FFFF port
in a, (#ff) ; ...
bit 1, a ; check key is hold
jr nz, .is_hold ; yes?
ld a, 1
ld (var_pause_is_released), a
ret
.is_hold:
ld a, (var_pause_is_released) ; if key wasnt released - do nothing
or a ; ...
ret z ; ...
ld a, 1 ; otherwise - var_exit_flag = 1
ld (var_exit_flag), a ; ...
ret