Files
Main_MiSTer/support/cdi/cdi.h
Andre Zeps d0cf945ae2 CD-i: Buffer overflow fix + Initial default NvRAM (#1106)
* CD-i: Fixed buffer overflow

Fixed reintroduction of the buffer overflow by
commit 1addb89ff

Originally was fixed with c0171c9 but not yet
well understood.

* CD-i: Mount root folder NvRAM after core load

Instead of starting with an empty NvRAM,
"saves/CD-i/CD-i.sav" will be loaded instead.

Avoids machine reset by NvRAM change in case
a root folder CD image shall be used
2026-02-26 13:16:21 +08:00

17 lines
435 B
C

#ifndef CDI_H
#define CDI_H
#define CDI_SECTOR_LEN 2352
#define CDI_SUBCHANNEL_LEN 24
#define CDI_CDIC_BUFFER_SIZE (CDI_SECTOR_LEN + CDI_SUBCHANNEL_LEN)
void cdi_mount_cd(int s_index, const char *filename);
void cdi_fill_blanksave(uint8_t *buffer, uint32_t lba, int cnt);
void cdi_read_cd(uint8_t *buffer, int lba, int cnt);
int cdi_chd_hunksize();
const char* cdi_get_game_id();
void cdi_poll();
void cdi_load_root_nvram();
#endif