1
0
mirror of https://github.com/UzixLS/zx-sizif-xxs.git synced 2025-07-18 23:01:40 +03:00

add support for ZC SD card controller; replace NO-OS divmmc mode with ZC

This commit is contained in:
UzixLS
2022-01-31 21:39:26 +03:00
parent d6a31c0502
commit 456cb97fac
13 changed files with 63 additions and 41 deletions

View File

@ -28,7 +28,7 @@ _reserv2 DB 0
_reserv3 DB 0
joystick DB 0
ay DB 1
divmmc DB 2
sd DB 2
ulaplus DB 1
dac DB 3
ENDS

View File

@ -237,17 +237,16 @@ init_cpld:
detect_sd_card:
ld a, #ff ; read sd_cd state in bit 2 of #FFFF port
in a, (#ff) ; ...
bit 2, a ; check sd_cd == 0 (card is insert)
in a, (#77) ; read sd_cd state from ZC status port
bit 0, a ; check sd_cd == 0 (card is insert)
jr z, .is_insert ; yes?
.no_card:
xor a ; divmmc = OFF
ld (cfg_saved.divmmc), a ; ...
xor a ; sd = OFF
ld (cfg_saved.sd), a ; ...
ret
.is_insert:
ld a, 1 ; divmmc = ON
ld (cfg_saved.divmmc), a ; ...
ld a, 1 ; sd = divmmc
ld (cfg_saved.sd), a ; ...
ret

View File

@ -34,7 +34,7 @@ menudefault: MENU_DEF 20
MENUENTRY_T str_machine menu_machine_value_cb menu_machine_cb
MENUENTRY_T str_panning menu_panning_value_cb menu_panning_cb
MENUENTRY_T str_joystick menu_joystick_value_cb menu_joystick_cb
MENUENTRY_T str_divmmc menu_divmmc_value_cb menu_divmmc_cb
MENUENTRY_T str_sd menu_sd_value_cb menu_sd_cb
MENUENTRY_T str_ulaplus menu_ulaplus_value_cb menu_ulaplus_cb
MENUENTRY_T str_dac menu_dac_value_cb menu_dac_cb
MENUENTRY_T str_exit menu_exit_value_cb menu_exit_cb
@ -81,14 +81,14 @@ menu_joystick_value_cb:
DW str_joystick_kempston_end-2
DW str_joystick_sinclair_end-2
menu_divmmc_value_cb:
menu_sd_value_cb:
ld ix, .values_table
ld a, (cfg.divmmc)
ld a, (cfg.sd)
jp menu_value_get
.values_table:
DW str_off_end-2
DW str_on_end-2
DW str_divmmc_noos_end-2
DW str_divmmc_end-2
DW str_zc3e_end-2
menu_ulaplus_value_cb:
ld ix, .values_table
@ -163,11 +163,11 @@ menu_joystick_cb:
out (c), a
ret
menu_divmmc_cb:
ld a, (cfg.divmmc)
menu_sd_cb:
ld a, (cfg.sd)
ld c, 2
call menu_handle_press
ld (cfg.divmmc), a
ld (cfg.sd), a
ld bc, #09ff
out (c), a
ret

View File

@ -75,11 +75,14 @@ str_joystick_kempston_end:
str_joystick_sinclair: DB "Sinclair",0
str_joystick_sinclair_end:
str_sd: DB "SD card",0
str_sd_end:
str_divmmc: DB "DivMMC",0
str_divmmc_end:
str_divmmc_noos: DB "NO OS",0
str_divmmc_noos_end:
str_zc3e: DB "ZC/+3e",0
str_zc3e_end:
str_ulaplus: DB "ULA+",0
str_ulaplus_end