ZuluSCSI_settings.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  1. /**
  2. * ZuluSCSI™ - Copyright (c) 2023 Rabbit Hole Computing™
  3. * Copyright (c) 2023 Eric Helgeson
  4. *
  5. * This file is licensed under the GPL version 3 or any later version.  
  6. *
  7. * https://www.gnu.org/licenses/gpl-3.0.html
  8. * ----
  9. * This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation, either version 3 of the License, or
  12. * (at your option) any later version. 
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. * GNU General Public License for more details. 
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  21. **/
  22. #include "ZuluSCSI_disk.h"
  23. #include "ZuluSCSI_audio.h"
  24. #include "ZuluSCSI_log.h"
  25. #include "ZuluSCSI_config.h"
  26. #include "ZuluSCSI_settings.h"
  27. #include <strings.h>
  28. #include <minIni.h>
  29. #include <minIni_cache.h>
  30. // SCSI system and device settings
  31. ZuluSCSISettings g_scsi_settings;
  32. const char *systemPresetName[] = {"", "Mac", "MacPlus", "MPC3000", "MegaSTE", "X68000"};
  33. const char *devicePresetName[] = {"", "ST32430N"};
  34. // Helper function for case-insensitive string compare
  35. static bool strequals(const char *a, const char *b)
  36. {
  37. return strcasecmp(a, b) == 0;
  38. }
  39. // Verify format conformance to SCSI spec:
  40. // - Empty bytes filled with 0x20 (space)
  41. // - Only values 0x20 to 0x7E
  42. // - Left alignment for vendor/product/revision, right alignment for serial.
  43. static void formatDriveInfoField(char *field, int fieldsize, bool align_right)
  44. {
  45. if (align_right)
  46. {
  47. // Right align and trim spaces on either side
  48. int dst = fieldsize - 1;
  49. for (int src = fieldsize - 1; src >= 0; src--)
  50. {
  51. char c = field[src];
  52. if (c < 0x20 || c > 0x7E) c = 0x20;
  53. if (c != 0x20 || dst != fieldsize - 1)
  54. {
  55. field[dst--] = c;
  56. }
  57. }
  58. while (dst >= 0)
  59. {
  60. field[dst--] = 0x20;
  61. }
  62. }
  63. else
  64. {
  65. // Left align, preserve spaces in case config tries to manually right-align
  66. int dst = 0;
  67. for (int src = 0; src < fieldsize; src++)
  68. {
  69. char c = field[src];
  70. if (c < 0x20 || c > 0x7E) c = 0x20;
  71. field[dst++] = c;
  72. }
  73. while (dst < fieldsize)
  74. {
  75. field[dst++] = 0x20;
  76. }
  77. }
  78. }
  79. const char **ZuluSCSISettings::deviceInitST32430N(uint8_t scsiId)
  80. {
  81. static const char *st32430n[4] = {"SEAGATE", devicePresetName[DEV_PRESET_ST32430N], PLATFORM_REVISION, ""};
  82. m_dev[scsiId].deviceType = S2S_CFG_FIXED;
  83. m_dev[scsiId].sectorSDBegin = 0;
  84. m_dev[scsiId].sectorSDEnd = 4397055; // 2147MB into bytes and divide 512 - 1
  85. m_devPreset[scsiId] = DEV_PRESET_ST32430N;
  86. return st32430n;
  87. }
  88. void ZuluSCSISettings::setDefaultDriveInfo(uint8_t scsiId, const char *presetName, S2S_CFG_TYPE type)
  89. {
  90. char section[6] = "SCSI0";
  91. section[4] += scsiId;
  92. scsi_device_settings_t &cfgDev = m_dev[scsiId];
  93. scsi_device_settings_t &cfgDefault = m_dev[SCSI_SETTINGS_SYS_IDX];
  94. static const char *driveinfo_fixed[4] = DRIVEINFO_FIXED;
  95. static const char *driveinfo_removable[4] = DRIVEINFO_REMOVABLE;
  96. static const char *driveinfo_optical[4] = DRIVEINFO_OPTICAL;
  97. static const char *driveinfo_floppy[4] = DRIVEINFO_FLOPPY;
  98. static const char *driveinfo_magopt[4] = DRIVEINFO_MAGOPT;
  99. static const char *driveinfo_network[4] = DRIVEINFO_NETWORK;
  100. static const char *driveinfo_tape[4] = DRIVEINFO_TAPE;
  101. static const char *apl_driveinfo_fixed[4] = APPLE_DRIVEINFO_FIXED;
  102. static const char *apl_driveinfo_removable[4] = APPLE_DRIVEINFO_REMOVABLE;
  103. static const char *apl_driveinfo_optical[4] = APPLE_DRIVEINFO_OPTICAL;
  104. static const char *apl_driveinfo_floppy[4] = APPLE_DRIVEINFO_FLOPPY;
  105. static const char *apl_driveinfo_magopt[4] = APPLE_DRIVEINFO_MAGOPT;
  106. static const char *apl_driveinfo_network[4] = APPLE_DRIVEINFO_NETWORK;
  107. static const char *apl_driveinfo_tape[4] = APPLE_DRIVEINFO_TAPE;
  108. const char **driveinfo = NULL;
  109. bool known_preset = false;
  110. scsi_system_settings_t& cfgSys = m_sys;
  111. #ifdef ZULUSCSI_HARDWARE_CONFIG
  112. if (g_hw_config.is_active() && g_hw_config.device_preset() == DEV_PRESET_NONE)
  113. {
  114. // empty preset, use default
  115. known_preset = true;
  116. m_devPreset[scsiId] = DEV_PRESET_NONE;
  117. }
  118. else if (g_hw_config.is_active() && g_hw_config.device_preset() == DEV_PRESET_ST32430N)
  119. {
  120. driveinfo = deviceInitST32430N(scsiId);
  121. m_devPreset[scsiId] = DEV_PRESET_ST32430N;
  122. known_preset = true;
  123. }
  124. else
  125. #endif //ZULUSCSI_HARDWARE_CONFIG
  126. if (strequals(devicePresetName[DEV_PRESET_NONE], presetName))
  127. {
  128. // empty preset, use default
  129. known_preset = true;
  130. m_devPreset[scsiId] = DEV_PRESET_NONE;
  131. }
  132. else if (strequals(devicePresetName[DEV_PRESET_ST32430N], presetName))
  133. {
  134. driveinfo = deviceInitST32430N(scsiId);
  135. known_preset = true;
  136. }
  137. if (!known_preset)
  138. {
  139. m_devPreset[scsiId] = DEV_PRESET_NONE;
  140. logmsg("Unknown Device preset name ", presetName, ", using default settings");
  141. }
  142. if (m_devPreset[scsiId] == DEV_PRESET_NONE)
  143. {
  144. cfgDev.deviceType = type;
  145. if (cfgSys.quirks == S2S_CFG_QUIRKS_APPLE)
  146. {
  147. // Use default drive IDs that are recognized by Apple machines
  148. switch (cfgDev.deviceType)
  149. {
  150. case S2S_CFG_FIXED: driveinfo = apl_driveinfo_fixed; break;
  151. case S2S_CFG_REMOVABLE: driveinfo = apl_driveinfo_removable; break;
  152. case S2S_CFG_OPTICAL: driveinfo = apl_driveinfo_optical; break;
  153. case S2S_CFG_FLOPPY_14MB: driveinfo = apl_driveinfo_floppy; break;
  154. case S2S_CFG_MO: driveinfo = apl_driveinfo_magopt; break;
  155. case S2S_CFG_NETWORK: driveinfo = apl_driveinfo_network; break;
  156. case S2S_CFG_SEQUENTIAL: driveinfo = apl_driveinfo_tape; break;
  157. default: driveinfo = apl_driveinfo_fixed; break;
  158. }
  159. }
  160. else
  161. {
  162. // Generic IDs
  163. switch (cfgDev.deviceType)
  164. {
  165. case S2S_CFG_FIXED: driveinfo = driveinfo_fixed; break;
  166. case S2S_CFG_REMOVABLE: driveinfo = driveinfo_removable; break;
  167. case S2S_CFG_OPTICAL: driveinfo = driveinfo_optical; break;
  168. case S2S_CFG_FLOPPY_14MB: driveinfo = driveinfo_floppy; break;
  169. case S2S_CFG_MO: driveinfo = driveinfo_magopt; break;
  170. case S2S_CFG_NETWORK: driveinfo = driveinfo_network; break;
  171. case S2S_CFG_SEQUENTIAL: driveinfo = driveinfo_tape; break;
  172. default: driveinfo = driveinfo_fixed; break;
  173. }
  174. }
  175. }
  176. // If the scsi string has not been set system wide use default scsi string
  177. if (!cfgDefault.vendor[0] && driveinfo[0][0])
  178. strncpy(cfgDev.vendor, driveinfo[0], sizeof(cfgDev.vendor));
  179. if (!cfgDefault.prodId[0] && driveinfo[1][0])
  180. strncpy(cfgDev.prodId, driveinfo[1], sizeof(cfgDev.prodId));
  181. if (!cfgDefault.revision[0] && driveinfo[2][0])
  182. strncpy(cfgDev.revision, driveinfo[2], sizeof(cfgDev.revision));
  183. if (!cfgDefault.serial[0] && driveinfo[3][0])
  184. strncpy(cfgDev.serial, driveinfo[3], sizeof(cfgDev.serial));
  185. }
  186. // Read device settings
  187. static void readIniSCSIDeviceSetting(scsi_device_settings_t &cfg, const char *section)
  188. {
  189. cfg.deviceType = ini_getl(section, "Type", cfg.deviceType, CONFIGFILE);
  190. cfg.deviceTypeModifier = ini_getl(section, "TypeModifier", cfg.deviceTypeModifier, CONFIGFILE);
  191. cfg.sectorsPerTrack = ini_getl(section, "SectorsPerTrack", cfg.sectorsPerTrack, CONFIGFILE);
  192. cfg.headsPerCylinder = ini_getl(section, "HeadsPerCylinder", cfg.headsPerCylinder, CONFIGFILE);
  193. cfg.prefetchBytes = ini_getl(section, "PrefetchBytes", cfg.prefetchBytes, CONFIGFILE);
  194. cfg.ejectButton = ini_getl(section, "EjectButton", cfg.ejectButton, CONFIGFILE);
  195. cfg.vol = ini_getl(section, "CDAVolume", cfg.vol, CONFIGFILE) & 0xFF;
  196. cfg.nameFromImage = ini_getbool(section, "NameFromImage", cfg.nameFromImage, CONFIGFILE);
  197. cfg.rightAlignStrings = ini_getbool(section, "RightAlignStrings", cfg.rightAlignStrings , CONFIGFILE);
  198. cfg.reinsertOnInquiry = ini_getbool(section, "ReinsertCDOnInquiry", cfg.reinsertOnInquiry, CONFIGFILE);
  199. cfg.reinsertAfterEject = ini_getbool(section, "ReinsertAfterEject", cfg.reinsertAfterEject, CONFIGFILE);
  200. cfg.disableMacSanityCheck = ini_getbool(section, "DisableMacSanityCheck", cfg.disableMacSanityCheck, CONFIGFILE);
  201. cfg.sectorSDBegin = ini_getl(section, "SectorSDBegin", cfg.sectorSDBegin, CONFIGFILE);
  202. cfg.sectorSDEnd = ini_getl(section, "SectorSDEnd", cfg.sectorSDEnd, CONFIGFILE);
  203. cfg.vendorExtensions = ini_getl(section, "VendorExtensions", cfg.vendorExtensions, CONFIGFILE);
  204. char tmp[32];
  205. ini_gets(section, "Vendor", "", tmp, sizeof(tmp), CONFIGFILE);
  206. if (tmp[0])
  207. {
  208. memset(cfg.vendor, 0, sizeof(cfg.vendor));
  209. strncpy(cfg.vendor, tmp, sizeof(cfg.vendor));
  210. }
  211. memset(tmp, 0, sizeof(tmp));
  212. ini_gets(section, "Product", "", tmp, sizeof(tmp), CONFIGFILE);
  213. if (tmp[0])
  214. {
  215. memset(cfg.prodId, 0, sizeof(cfg.prodId));
  216. strncpy(cfg.prodId, tmp, sizeof(cfg.prodId));
  217. }
  218. memset(tmp, 0, sizeof(tmp));
  219. ini_gets(section, "Version", "", tmp, sizeof(tmp), CONFIGFILE);
  220. if (tmp[0])
  221. {
  222. memset(cfg.revision, 0, sizeof(cfg.revision));
  223. strncpy(cfg.revision, tmp, sizeof(cfg.revision));
  224. }
  225. memset(tmp, 0, sizeof(tmp));
  226. ini_gets(section, "Serial", "", tmp, sizeof(tmp), CONFIGFILE);
  227. if (tmp[0])
  228. {
  229. memset(cfg.serial, 0, sizeof(cfg.serial));
  230. strncpy(cfg.serial, tmp, sizeof(cfg.serial));
  231. }
  232. }
  233. scsi_system_settings_t *ZuluSCSISettings::initSystem(const char *presetName)
  234. {
  235. scsi_system_settings_t &cfgSys = m_sys;
  236. scsi_device_settings_t &cfgDev = m_dev[SCSI_SETTINGS_SYS_IDX];
  237. // This is a hack to figure out if apple quirks is on via a dip switch
  238. S2S_TargetCfg img;
  239. img.quirks = S2S_CFG_QUIRKS_NONE;
  240. #ifdef PLATFORM_CONFIG_HOOK
  241. PLATFORM_CONFIG_HOOK(&img);
  242. #endif
  243. // Default settings for host compatibility
  244. cfgSys.quirks = img.quirks;
  245. cfgSys.selectionDelay = 255;
  246. cfgSys.maxSyncSpeed = 10;
  247. cfgSys.initPreDelay = 0;
  248. cfgSys.initPostDelay = 0;
  249. cfgSys.phyMode = 0;
  250. cfgSys.enableUnitAttention = false;
  251. cfgSys.enableSCSI2 = true;
  252. cfgSys.enableSelLatch = false;
  253. cfgSys.mapLunsToIDs = false;
  254. cfgSys.enableParity = true;
  255. cfgSys.useFATAllocSize = false;
  256. cfgSys.enableCDAudio = false;
  257. // setting set for all or specific devices
  258. cfgDev.deviceType = S2S_CFG_NOT_SET;
  259. cfgDev.deviceTypeModifier = 0;
  260. cfgDev.sectorsPerTrack = 63;
  261. cfgDev.headsPerCylinder = 255;
  262. cfgDev.prefetchBytes = PREFETCH_BUFFER_SIZE;
  263. cfgDev.ejectButton = 0;
  264. cfgDev.vol = DEFAULT_VOLUME_LEVEL;
  265. cfgDev.nameFromImage = false;
  266. cfgDev.rightAlignStrings = false;
  267. cfgDev.reinsertOnInquiry = true;
  268. cfgDev.reinsertAfterEject = true;
  269. cfgDev.disableMacSanityCheck = false;
  270. cfgDev.sectorSDBegin = 0;
  271. cfgDev.sectorSDEnd = 0;
  272. cfgDev.vendorExtensions = 0;
  273. // System-specific defaults
  274. if (strequals(systemPresetName[SYS_PRESET_NONE], presetName))
  275. {
  276. // Preset name is empty, use default configuration
  277. m_sysPreset = SYS_PRESET_NONE;
  278. }
  279. else if (strequals(systemPresetName[SYS_PRESET_MAC], presetName))
  280. {
  281. m_sysPreset = SYS_PRESET_MAC;
  282. cfgSys.quirks = S2S_CFG_QUIRKS_APPLE;
  283. }
  284. else if (strequals(systemPresetName[SYS_PRESET_MACPLUS], presetName))
  285. {
  286. m_sysPreset = SYS_PRESET_MACPLUS;
  287. cfgSys.quirks = S2S_CFG_QUIRKS_APPLE;
  288. cfgSys.enableSelLatch = true;
  289. cfgSys.enableSCSI2 = false;
  290. cfgSys.selectionDelay = 0;
  291. }
  292. else if (strequals(systemPresetName[SYS_PRESET_MPC3000], presetName))
  293. {
  294. m_sysPreset = SYS_PRESET_MPC3000;
  295. cfgSys.initPreDelay = 600;
  296. }
  297. else if (strequals(systemPresetName[SYS_PRESET_MEGASTE], presetName))
  298. {
  299. m_sysPreset = SYS_PRESET_MEGASTE;
  300. cfgSys.quirks = S2S_CFG_QUIRKS_NONE;
  301. cfgSys.mapLunsToIDs = true;
  302. cfgSys.enableParity = false;
  303. }
  304. else if (strequals(systemPresetName[SYS_PRESET_X68000], presetName))
  305. {
  306. m_sysPreset = SYS_PRESET_X68000;
  307. cfgSys.selectionDelay = 0;
  308. cfgSys.quirks = S2S_CFG_QUIRKS_NONE;
  309. cfgSys.enableSCSI2 = false;
  310. cfgSys.maxSyncSpeed = 5;
  311. }
  312. else
  313. {
  314. m_sysPreset = SYS_PRESET_NONE;
  315. logmsg("Unknown System preset name ", presetName, ", using default settings");
  316. }
  317. // Clear SCSI device strings
  318. memset(cfgDev.vendor, 0, sizeof(cfgDev.vendor));
  319. memset(cfgDev.prodId, 0, sizeof(cfgDev.prodId));
  320. memset(cfgDev.revision, 0, sizeof(cfgDev.revision));
  321. memset(cfgDev.serial, 0, sizeof(cfgDev.serial));
  322. // Read default setting overrides from ini file for each SCSI device
  323. readIniSCSIDeviceSetting(cfgDev, "SCSI");
  324. // Read settings from ini file that apply to all SCSI device
  325. cfgSys.quirks = ini_getl("SCSI", "Quirks", cfgSys.quirks, CONFIGFILE);
  326. cfgSys.selectionDelay = ini_getl("SCSI", "SelectionDelay", cfgSys.selectionDelay, CONFIGFILE);
  327. cfgSys.maxSyncSpeed = ini_getl("SCSI", "MaxSyncSpeed", cfgSys.maxSyncSpeed, CONFIGFILE);
  328. cfgSys.initPreDelay = ini_getl("SCSI", "InitPreDelay", cfgSys.initPreDelay, CONFIGFILE);
  329. cfgSys.initPostDelay = ini_getl("SCSI", "InitPostDelay", cfgSys.initPostDelay, CONFIGFILE);
  330. cfgSys.phyMode = ini_getl("SCSI", "PhyMode", cfgSys.phyMode, CONFIGFILE);
  331. cfgSys.enableUnitAttention = ini_getbool("SCSI", "EnableUnitAttention", cfgSys.enableUnitAttention, CONFIGFILE);
  332. cfgSys.enableSCSI2 = ini_getbool("SCSI", "EnableSCSI2", cfgSys.enableSCSI2, CONFIGFILE);
  333. cfgSys.enableSelLatch = ini_getbool("SCSI", "EnableSelLatch", cfgSys.enableSelLatch, CONFIGFILE);
  334. cfgSys.mapLunsToIDs = ini_getbool("SCSI", "MapLunsToIDs", cfgSys.mapLunsToIDs, CONFIGFILE);
  335. cfgSys.enableParity = ini_getbool("SCSI", "EnableParity", cfgSys.enableParity, CONFIGFILE);
  336. cfgSys.useFATAllocSize = ini_getbool("SCSI", "UseFATAllocSize", cfgSys.useFATAllocSize, CONFIGFILE);
  337. cfgSys.enableCDAudio = ini_getbool("SCSI", "EnableCDAudio", cfgSys.enableCDAudio, CONFIGFILE);
  338. return &cfgSys;
  339. }
  340. scsi_device_settings_t* ZuluSCSISettings::initDevice(uint8_t scsiId, S2S_CFG_TYPE type)
  341. {
  342. scsi_device_settings_t& cfg = m_dev[scsiId];
  343. char presetName[32] = {};
  344. char section[6] = "SCSI0";
  345. section[4] = '0' + scsiId;
  346. #ifdef ZULUSCSI_HARDWARE_CONFIG
  347. const char *hwDevicePresetName = g_scsi_settings.getDevicePresetName(scsiId);
  348. if (g_hw_config.is_active())
  349. {
  350. if (strlen(hwDevicePresetName) < sizeof(presetName))
  351. {
  352. strncpy(presetName, hwDevicePresetName, sizeof(presetName) - 1);
  353. }
  354. }
  355. else
  356. #endif
  357. {
  358. ini_gets(section, "Device", "", presetName, sizeof(presetName), CONFIGFILE);
  359. }
  360. // Write default configuration from system setting initialization
  361. memcpy(&cfg, &m_dev[SCSI_SETTINGS_SYS_IDX], sizeof(cfg));
  362. setDefaultDriveInfo(scsiId, presetName, type);
  363. readIniSCSIDeviceSetting(cfg, section);
  364. if (cfg.serial[0] == '\0')
  365. {
  366. // Use SD card serial number
  367. cid_t sd_cid;
  368. uint32_t sd_sn = 0;
  369. if (SD.card()->readCID(&sd_cid))
  370. {
  371. sd_sn = sd_cid.psn();
  372. }
  373. memset(cfg.serial, 0, sizeof(cfg.serial));
  374. const char *nibble = "0123456789ABCDEF";
  375. cfg.serial[0] = nibble[(sd_sn >> 28) & 0xF];
  376. cfg.serial[1] = nibble[(sd_sn >> 24) & 0xF];
  377. cfg.serial[2] = nibble[(sd_sn >> 20) & 0xF];
  378. cfg.serial[3] = nibble[(sd_sn >> 16) & 0xF];
  379. cfg.serial[4] = nibble[(sd_sn >> 12) & 0xF];
  380. cfg.serial[5] = nibble[(sd_sn >> 8) & 0xF];
  381. cfg.serial[6] = nibble[(sd_sn >> 4) & 0xF];
  382. cfg.serial[7] = nibble[(sd_sn >> 0) & 0xF];
  383. }
  384. formatDriveInfoField(cfg.vendor, sizeof(cfg.vendor), cfg.rightAlignStrings);
  385. formatDriveInfoField(cfg.prodId, sizeof(cfg.prodId), cfg.rightAlignStrings);
  386. formatDriveInfoField(cfg.revision, sizeof(cfg.revision), cfg.rightAlignStrings);
  387. formatDriveInfoField(cfg.serial, sizeof(cfg.serial), true);
  388. return &cfg;
  389. }
  390. scsi_system_settings_t *ZuluSCSISettings::getSystem()
  391. {
  392. return &m_sys;
  393. }
  394. scsi_device_settings_t *ZuluSCSISettings::getDevice(uint8_t scsiId)
  395. {
  396. return &m_dev[scsiId];
  397. }
  398. scsi_system_preset_t ZuluSCSISettings::getSystemPreset()
  399. {
  400. return m_sysPreset;
  401. }
  402. const char* ZuluSCSISettings::getSystemPresetName()
  403. {
  404. return systemPresetName[m_sysPreset];
  405. }
  406. scsi_device_preset_t ZuluSCSISettings::getDevicePreset(uint8_t scsiId)
  407. {
  408. return m_devPreset[scsiId];
  409. }
  410. const char* ZuluSCSISettings::getDevicePresetName(uint8_t scsiId)
  411. {
  412. return devicePresetName[m_devPreset[scsiId]];
  413. }