diff --git a/src/config b/src/config index f1319e4..aa88b57 100644 --- a/src/config +++ b/src/config @@ -1,4 +1,4 @@ -CONFIG_VERSION=0.1.0 -#FWVER=000100 -CONFIG_FWVER=256 +CONFIG_VERSION=0.1.1 +#FWVER=000101 +CONFIG_FWVER=257 CONFIG_MCU_FOSC=12000000 diff --git a/src/config.h b/src/config.h index 6900ac2..03d5d0c 100644 --- a/src/config.h +++ b/src/config.h @@ -66,7 +66,7 @@ #define FPGA_MCU_RDY_BIT 9 #define QSORT_MAXELEM 2048 - +#define CLTBL_SIZE 100 #define SSP_REGS LPC_SSP0 #define SSP_PCLKREG PCLKSEL1 // 1: PCLKSEL0 diff --git a/src/ffconf.h b/src/ffconf.h index fb2757c..14551ed 100644 --- a/src/ffconf.h +++ b/src/ffconf.h @@ -48,7 +48,7 @@ /* To enable f_forward function, set _USE_FORWARD to 1 and set _FS_TINY to 1. */ -#define _USE_FASTSEEK 0 /* 0:Disable or 1:Enable */ +#define _USE_FASTSEEK 1 /* 0:Disable or 1:Enable */ /* To enable fast seek feature, set _USE_FASTSEEK to 1. */ diff --git a/src/msu1.c b/src/msu1.c index 6dc298f..3e1e884 100644 --- a/src/msu1.c +++ b/src/msu1.c @@ -13,6 +13,9 @@ #include "smc.h" FIL msufile; +DWORD msu_cltbl[CLTBL_SIZE] IN_AHBRAM; +DWORD pcm_cltbl[CLTBL_SIZE] IN_AHBRAM; + extern snes_romprops_t romprops; int msu1_check_reset(void) { @@ -40,6 +43,11 @@ int msu1_check(uint8_t* filename) { printf("MSU datafile not found\n"); return 0; } + msufile.cltbl = msu_cltbl; + msu_cltbl[0] = CLTBL_SIZE; + if(f_lseek(&msufile, CREATE_LINKMAP)) { + printf("Error creating FF linkmap for MSU file!\n"); + } romprops.fpga_features |= FEAT_MSU1; return 1; } @@ -128,6 +136,9 @@ int msu1_loop() { strcpy(strrchr((char*)file_buf, (int)'.'), suffix); printf("filename: %s\n", file_buf); f_open(&file_handle, (const TCHAR*)file_buf, FA_READ); + file_handle.cltbl = pcm_cltbl; + pcm_cltbl[0] = CLTBL_SIZE; + f_lseek(&file_handle, CREATE_LINKMAP); f_lseek(&file_handle, 4L); f_read(&file_handle, &msu_loop_point, 4, &bytes_read); printf("loop point: %ld samples\n", msu_loop_point);