Project

General

Profile

« Previous | Next » 

Revision 107

Added by markw about 11 years ago

Fixed alternative version of sd card access. Taken from petit fatfs. Supports > 1GB cards.

View differences:

firmware/Makefile
MINSTARTUP_OBJ = $(patsubst $(STARTUP_DIR)/%.s,$(BUILD_DIR)/%.o,$(MINSTARTUP_SRC))
DE1_PRJ = DE1
DE1_SRC = main.c regs.c freeze.c joystick.c fileutils.c fileselector.c atari_drive_emulator.c pokey/uart.c hexdump.c printf/printf.c fat/pff_file.c fat/pff.c common/utils.c sd_direct/diskio_mmc.c sd_direct/spi.c sd_direct/mmc.c de1/dirs.c
DE1_SRC = main.c regs.c freeze.c joystick.c fileutils.c fileselector.c atari_drive_emulator.c pokey/uart.c hexdump.c printf/printf.c fat/pff_file.c fat/pff.c common/utils.c sd_direct/diskio_mmc.c sd_direct/spi.c sd_direct/mmc2.c de1/dirs.c
DE1_OBJ = $(patsubst %.c,$(BUILD_DIR)/%.o,$(DE1_SRC))
MCC_PRJ = MCC216
MCC_SRC = main.c regs.c freeze.c joystick.c fileutils.c fileselector.c atari_drive_emulator.c pokey/uart.c hexdump.c printf/printf.c fat/pff_file.c fat/pff.c common/utils.c sd_direct/diskio_mmc.c sd_direct/spi.c sd_direct/mmc.c mcc/dirs.c
MCC_SRC = main.c regs.c freeze.c joystick.c fileutils.c fileselector.c atari_drive_emulator.c pokey/uart.c hexdump.c printf/printf.c fat/pff_file.c fat/pff.c common/utils.c sd_direct/diskio_mmc.c sd_direct/spi.c sd_direct/mmc2.c mcc/dirs.c
MCC_OBJ = $(patsubst %.c,$(BUILD_DIR)/%.o,$(MCC_SRC))
MIST_PRJ = MIST
firmware/sd_direct/mmc2.c
#include "pff.h"
#include "diskio.h"
//#include "printf.h"
/*-------------------------------------------------------------------------*/
/* Platform dependent macros and functions needed to be modified */
/*-------------------------------------------------------------------------*/
......
unsigned char mmc_sector_buffer[512];
extern u32 n_actual_mmc_sector;
/*--------------------------------------------------------------------------
Module Private Functions
......
BYTE CardType;
extern int debug_pos;
void disk_debug()
{
/* {
char buffer[512];
set_pause_6502(1);
freeze();
debug_pos = 0;
printf("Hello world 5");
debug_pos = 40;
printf("Di");
debug_pos = 80;
disk_initialize();
printf("Did:%02x",CardType);
debug_pos = 120;
n_actual_mmc_sector = -1;
printf(" PP");
disk_readp(&buffer[0],0,0,512);
printf(" DD");
hexdump_pure(&buffer[0],512);
wait_us(10000000);
restore();
}
*/
}
/*-----------------------------------------------------------------------*/
/* Send a command packet to the SDC/MMC */
/*-----------------------------------------------------------------------*/
......
BYTE rc;
UINT bc;
//printf("mr:%x",sector);
if (!(CardType & CT_BLOCK)) sector *= 512; /* Convert to byte address if needed */
if (send_cmd(CMD17, sector) == 0) { /* READ_SINGLE_BLOCK */
......
DESELECT();
spiTransferFF();
return 0;
}
......
DESELECT();
spiTransferFF();
}
return 0;
}

Also available in: Unified diff