switch file id to 32bit and get sram push working
This commit is contained in:
parent
dc8ed94279
commit
6edd54b092
@ -34,12 +34,12 @@ void dir_entry_start(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void dir_entry_dump(uint32_t addr, dir_ent_t* ent){
|
void dir_entry_dump(uint32_t addr, dir_ent_t* ent){
|
||||||
debug(DEBUG_FAT,"dir_entry_dump: addr=0x%06lx id=%i name=%s size=%li attr=%i\n", addr, ent->id, ent->file_name,
|
debug(DEBUG_FAT,"dir_entry_dump: addr=0x%06lx id=%li name=%s size=%li attr=%i\n", addr, ent->id, ent->file_name,
|
||||||
ent->file_size, ent->file_attr);
|
ent->file_size, ent->file_attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void dir_entry_add(uint16_t id, uint8_t* file_name,uint32_t file_size,uint8_t file_attr){
|
void dir_entry_add(uint32_t id, uint8_t* file_name,uint32_t file_size,uint8_t file_attr){
|
||||||
uint32_t addr;
|
uint32_t addr;
|
||||||
dir_ent_t ent;
|
dir_ent_t ent;
|
||||||
strncpy(ent.file_name,file_name,13);
|
strncpy(ent.file_name,file_name,13);
|
||||||
@ -59,3 +59,4 @@ void dir_entry_header(uint16_t position, uint8_t * header){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -32,15 +32,15 @@
|
|||||||
#define DIR_ENTRY_HEADER_OFF 20
|
#define DIR_ENTRY_HEADER_OFF 20
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint16_t id; // 2
|
uint32_t id; // 4
|
||||||
uint8_t file_name[13]; // 8.3 = 12 + 1 = 13
|
uint8_t file_name[13]; // 8.3 = 12 + 1 = 13
|
||||||
uint32_t file_size; // 4
|
uint32_t file_size; // 4
|
||||||
uint8_t file_attr; // 1
|
uint8_t file_attr; // 1
|
||||||
uint8_t snes_header[43]; // 44
|
uint8_t snes_header[41]; // 41
|
||||||
} dir_ent_t; // 64
|
} dir_ent_t; // 64
|
||||||
|
|
||||||
void dir_entry_start();
|
void dir_entry_start();
|
||||||
void dir_entry_add(uint16_t id, uint8_t* file_name,uint32_t file_size,uint8_t file_attr);
|
void dir_entry_add(uint32_t id, uint8_t* file_name,uint32_t file_size,uint8_t file_attr);
|
||||||
void dir_entry_header(uint16_t position, uint8_t * header);
|
void dir_entry_header(uint16_t position, uint8_t * header);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -205,7 +205,7 @@ void lsRowsOfClust_smc(uint32_t start_sec)
|
|||||||
fat_loadRowOfSector(row); // reihe eines sektors (auf dem puffer) laden
|
fat_loadRowOfSector(row); // reihe eines sektors (auf dem puffer) laden
|
||||||
if ((file.name[0] != 0xE5 && file.name[0] != 0x00)) {
|
if ((file.name[0] != 0xE5 && file.name[0] != 0x00)) {
|
||||||
if (file.attrib == 0x20)
|
if (file.attrib == 0x20)
|
||||||
dir_entry_add((uint16_t)file.firstCluster, file.name, file.length ,file.attrib);
|
dir_entry_add(file.firstCluster, file.name, file.length ,file.attrib);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (++sec < fat.secPerClust);
|
} while (++sec < fat.secPerClust);
|
||||||
|
|||||||
@ -51,7 +51,7 @@
|
|||||||
extern const char _rom[] PROGMEM;
|
extern const char _rom[] PROGMEM;
|
||||||
extern FILE uart_stdout;
|
extern FILE uart_stdout;
|
||||||
|
|
||||||
uint8_t debug_level = (DEBUG | DEBUG_USB | DEBUG_CRC | DEBUG_FAT | DEBUG_SRAM );
|
uint8_t debug_level = (DEBUG | DEBUG_USB | DEBUG_CRC | DEBUG_FAT);
|
||||||
|
|
||||||
uint8_t read_buffer[TRANSFER_BUFFER_SIZE];
|
uint8_t read_buffer[TRANSFER_BUFFER_SIZE];
|
||||||
uint32_t req_addr = 0;
|
uint32_t req_addr = 0;
|
||||||
@ -314,18 +314,25 @@ int main(void)
|
|||||||
uart_init();
|
uart_init();
|
||||||
stdout = &uart_stdout;
|
stdout = &uart_stdout;
|
||||||
|
|
||||||
test_sdcard();
|
|
||||||
|
|
||||||
info("Sytem start\n");
|
info("Sytem start\n");
|
||||||
system_init();
|
system_init();
|
||||||
|
|
||||||
#if 0
|
|
||||||
test_read_write();
|
#if 1
|
||||||
test_bulk_read_write();
|
avr_bus_active();
|
||||||
test_crc();
|
info("Activate AVR bus\n");
|
||||||
while (1);
|
info("IRQ off\n");
|
||||||
|
snes_irq_lo();
|
||||||
|
snes_irq_off();
|
||||||
|
info("Set Snes lowrom\n");
|
||||||
|
snes_lorom();
|
||||||
|
info("Disable snes WR\n");
|
||||||
|
snes_wr_disable();
|
||||||
|
test_sdcard();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
info("Boot startup rom\n");
|
info("Boot startup rom\n");
|
||||||
boot_startup_rom();
|
boot_startup_rom();
|
||||||
|
|
||||||
|
|||||||
@ -22,8 +22,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <avr/io.h>
|
#include <avr/io.h>
|
||||||
#include <util/delay.h> /* for _delay_ms() */
|
#include <util/delay.h>
|
||||||
|
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "sram.h"
|
#include "sram.h"
|
||||||
|
|||||||
@ -126,6 +126,7 @@ void test_sdcard(void){
|
|||||||
printf("Root dirlist\n");
|
printf("Root dirlist\n");
|
||||||
ffls_smc();
|
ffls_smc();
|
||||||
dump_memory(DIR_ENTRY_LOC , DIR_ENTRY_LOC + (64 * 2));
|
dump_memory(DIR_ENTRY_LOC , DIR_ENTRY_LOC + (64 * 2));
|
||||||
|
while(1);
|
||||||
|
|
||||||
#if (WRITE==1)
|
#if (WRITE==1)
|
||||||
char datei[12]="test.txt"; // hier muss platz für 11 zeichen sein (8.3), da fat_str diesen string benutzt !!
|
char datei[12]="test.txt"; // hier muss platz für 11 zeichen sein (8.3), da fat_str diesen string benutzt !!
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user