| 341 | } |
| 342 | |
| 343 | void flash_reset(void) { |
| 344 | memset((uint8_t*)&flash + sizeof(flash.uniqueID), 0, sizeof(flash) - sizeof(flash.uniqueID)); |
| 345 | flash.commandStatus[1] = 0x28; |
| 346 | flash.commandStatus[2] = 0x03; |
| 347 | flash.commandStatus[3] = 0x60; |
| 348 | if (asic.serFlash) { |
| 349 | flash.maskReg[0] = 0x00; |
| 350 | flash.maskReg[1] = 0x00; |
| 351 | flash.maskReg[2] = 0xC0; |
| 352 | flash.maskReg[3] = 0xFF; |
| 353 | flash_set_mask(); |
| 354 | flash_flush_cache(); |
| 355 | flash.waitStates = 2; /* Used only for calculating average cycles per access */ |
| 356 | } else { |
| 357 | flash.ports[0x00] = 0x01; |
| 358 | flash.ports[0x02] = 0x06; |
| 359 | flash.ports[0x05] = 0x04; |
| 360 | flash.ports[0x07] = 0xFF; |
| 361 | flash_set_map(); |
| 362 | } |
| 363 | gui_console_printf("[CEmu] Flash reset.\n"); |
| 364 | } |
| 365 | |
| 366 | bool flash_save(FILE *image) { |
| 367 | return fwrite(&flash, sizeof(flash), 1, image) == 1; |
nothing calls this directly
no test coverage detected