Xemu [doxygen]  hyppo 0a42be3a057156924bc1b626a687bd6e27349c45 @ Sat 19 Mar 02:15:11 CET 2022
Macros | Functions | Variables
sdcard.c File Reference
#include "xemu/emutools.h"
#include "xemu/emutools_files.h"
#include "sdcard.h"
#include "xemu/f011_core.h"
#include "xemu/d81access.h"
#include "mega65.h"
#include "xemu/cpu65.h"
#include "io_mapper.h"
#include "sdcontent.h"
#include "memcontent.h"
#include "hypervisor.h"
#include "vic4.h"
#include <sys/types.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
Include dependency graph for sdcard.c:

Go to the source code of this file.

Macros

#define COMPRESSED_SD
 
#define USE_KEEP_BUSY
 
#define KEEP_BUSY(n)   keep_busy=n
 
#define SD_ST_SDHC   0x10
 
#define MIN_MOUNT_SECTOR_NO   10
 
#define SD_BUFFER_POS   0x0E00
 
#define FD_BUFFER_POS   0x0C00
 

Functions

void d81access_cb_chgmode (const int which, const int mode)
 
int fdc_cb_rd_sec (const int which, Uint8 *buffer, const Uint8 side, const Uint8 track, const Uint8 sector)
 
int fdc_cb_wr_sec (const int which, Uint8 *buffer, const Uint8 side, const Uint8 track, const Uint8 sector)
 
Uint32 sdcard_get_size (void)
 
int sdcard_init (const char *fn, const int virtsd_flag, const int default_d81_is_from_sd_in)
 
int sdcard_read_block (Uint32 block, Uint8 *buffer)
 
int sdcard_write_block (Uint32 block, Uint8 *buffer)
 
void sdcard_notify_system_start_begin (void)
 
void sdcard_notify_system_start_end (void)
 
int sdcard_default_d81_mount (const int unit)
 
const char * sdcard_get_mount_info (const int unit, int *is_internal)
 
int sdcard_force_external_mount (const int unit, const char *filename, const char *cry)
 
int sdcard_force_external_mount_with_image_creation (const int unit, const char *filename, const int do_overwrite, const char *cry)
 
int sdcard_unmount (const int unit)
 
void sdcard_write_register (int reg, Uint8 data)
 
Uint8 sdcard_read_register (int reg)
 

Variables

Uint8 sd_status
 
Uint8 disk_buffers [0x1000]
 
Uint8disk_buffer_cpu_view
 
Uint8disk_buffer_io_mapped = disk_buffers + SD_BUFFER_POS
 
const char xemu_external_d81_signature [] = "\xFF\xFE<{[(XemuExternalDiskMagic)]}>"
 

Macro Definition Documentation

◆ COMPRESSED_SD

#define COMPRESSED_SD

Definition at line 38 of file sdcard.c.

◆ FD_BUFFER_POS

#define FD_BUFFER_POS   0x0C00

Definition at line 53 of file sdcard.c.

◆ KEEP_BUSY

#define KEEP_BUSY (   n)    keep_busy=n

Definition at line 42 of file sdcard.c.

◆ MIN_MOUNT_SECTOR_NO

#define MIN_MOUNT_SECTOR_NO   10

Definition at line 50 of file sdcard.c.

◆ SD_BUFFER_POS

#define SD_BUFFER_POS   0x0E00

Definition at line 52 of file sdcard.c.

◆ SD_ST_SDHC

#define SD_ST_SDHC   0x10

Definition at line 47 of file sdcard.c.

◆ USE_KEEP_BUSY

#define USE_KEEP_BUSY

Definition at line 39 of file sdcard.c.

Function Documentation

◆ d81access_cb_chgmode()

void d81access_cb_chgmode ( const int  which,
const int  mode 
)

Definition at line 246 of file sdcard.c.

◆ fdc_cb_rd_sec()

int fdc_cb_rd_sec ( const int  which,
Uint8 buffer,
const Uint8  side,
const Uint8  track,
const Uint8  sector 
)

Definition at line 254 of file sdcard.c.

◆ fdc_cb_wr_sec()

int fdc_cb_wr_sec ( const int  which,
Uint8 buffer,
const Uint8  side,
const Uint8  track,
const Uint8  sector 
)

Definition at line 260 of file sdcard.c.

◆ sdcard_default_d81_mount()

int sdcard_default_d81_mount ( const int  unit)

Definition at line 821 of file sdcard.c.

◆ sdcard_force_external_mount()

int sdcard_force_external_mount ( const int  unit,
const char *  filename,
const char *  cry 
)

Definition at line 925 of file sdcard.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sdcard_force_external_mount_with_image_creation()

int sdcard_force_external_mount_with_image_creation ( const int  unit,
const char *  filename,
const int  do_overwrite,
const char *  cry 
)

Definition at line 951 of file sdcard.c.

Here is the call graph for this function:

◆ sdcard_get_mount_info()

const char* sdcard_get_mount_info ( const int  unit,
int *  is_internal 
)

Definition at line 917 of file sdcard.c.

◆ sdcard_get_size()

Uint32 sdcard_get_size ( void  )

Definition at line 305 of file sdcard.c.

◆ sdcard_init()

int sdcard_init ( const char *  fn,
const int  virtsd_flag,
const int  default_d81_is_from_sd_in 
)

Definition at line 328 of file sdcard.c.

◆ sdcard_notify_system_start_begin()

void sdcard_notify_system_start_begin ( void  )

Definition at line 778 of file sdcard.c.

◆ sdcard_notify_system_start_end()

void sdcard_notify_system_start_end ( void  )

Definition at line 790 of file sdcard.c.

Here is the caller graph for this function:

◆ sdcard_read_block()

int sdcard_read_block ( Uint32  block,
Uint8 buffer 
)

Definition at line 548 of file sdcard.c.

◆ sdcard_read_register()

Uint8 sdcard_read_register ( int  reg)

Definition at line 1035 of file sdcard.c.

Here is the caller graph for this function:

◆ sdcard_unmount()

int sdcard_unmount ( const int  unit)

Definition at line 959 of file sdcard.c.

Here is the call graph for this function:

◆ sdcard_write_block()

int sdcard_write_block ( Uint32  block,
Uint8 buffer 
)

Definition at line 569 of file sdcard.c.

◆ sdcard_write_register()

void sdcard_write_register ( int  reg,
Uint8  data 
)

Definition at line 973 of file sdcard.c.

Here is the caller graph for this function:

Variable Documentation

◆ at_sector

Uint32 at_sector

Definition at line 91 of file sdcard.c.

◆ at_sector_initial

Uint32 at_sector_initial

Definition at line 92 of file sdcard.c.

◆ current_name

char* current_name

Definition at line 88 of file sdcard.c.

◆ disk_buffer_cpu_view

Uint8* disk_buffer_cpu_view

Definition at line 76 of file sdcard.c.

◆ disk_buffer_io_mapped

Uint8* disk_buffer_io_mapped = disk_buffers + SD_BUFFER_POS

Definition at line 80 of file sdcard.c.

◆ disk_buffers

Uint8 disk_buffers[0x1000]

Definition at line 74 of file sdcard.c.

◆ force_external_name

char* force_external_name

Definition at line 90 of file sdcard.c.

◆ internal

int internal

Definition at line 89 of file sdcard.c.

◆ monitoring_initial

int monitoring_initial

Definition at line 93 of file sdcard.c.

◆ sd_status

Uint8 sd_status

Definition at line 58 of file sdcard.c.

◆ xemu_external_d81_signature

const char xemu_external_d81_signature[] = "\xFF\xFE<{[(XemuExternalDiskMagic)]}>"

Definition at line 84 of file sdcard.c.