mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
get rid of port_config.h
This commit is contained in:
parent
5609d343e3
commit
9c9cda8c39
21 changed files with 73 additions and 288 deletions
|
@ -26,8 +26,8 @@
|
|||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "../../pico_int.h"
|
||||
#include "../../cpu/drc/cmn.h"
|
||||
#include <pico/pico_int.h>
|
||||
#include <cpu/drc/cmn.h>
|
||||
#include "compiler.h"
|
||||
|
||||
svp_t *svp = NULL;
|
||||
|
|
|
@ -14,6 +14,8 @@ static int prev_lba = 0x80000000;
|
|||
|
||||
static int hits, reads;
|
||||
|
||||
#undef dprintf
|
||||
#define dprintf(...)
|
||||
|
||||
void PicoCDBufferInit(void)
|
||||
{
|
||||
|
@ -114,7 +116,7 @@ PICO_INTERNAL void PicoCDBufferRead(void *dest, int lba)
|
|||
if (is_bin)
|
||||
{
|
||||
int i = 0;
|
||||
#if REDUCE_IO_CALLS
|
||||
#ifdef _PSP_FW_VERSION
|
||||
int bufs = (read_len*2048) / (2048+304);
|
||||
pm_read(cd_buffer, bufs*(2048+304), Pico_mcd->TOC.Tracks[0].F);
|
||||
for (i = 1; i < bufs; i++)
|
||||
|
|
|
@ -13,6 +13,16 @@
|
|||
|
||||
//#define cdprintf(f,...) printf(f "\n",##__VA_ARGS__) // tmp
|
||||
|
||||
static void to_upper(char *d, const char *s)
|
||||
{
|
||||
for (; *s != 0; d++, s++) {
|
||||
if ('a' <= *s && *s <= 'z')
|
||||
*d = *s - 'a' + 'A';
|
||||
else
|
||||
*d = *s;
|
||||
}
|
||||
}
|
||||
|
||||
static int audio_track_mp3(const char *fname, int index)
|
||||
{
|
||||
_scd_track *Tracks = Pico_mcd->TOC.Tracks;
|
||||
|
@ -27,7 +37,7 @@ static int audio_track_mp3(const char *fname, int index)
|
|||
fs = ftell(tmp_file); // used to calculate length
|
||||
fseek(tmp_file, 0, SEEK_SET);
|
||||
|
||||
#if DONT_OPEN_MANY_FILES
|
||||
#ifdef _PSP_FW_VERSION
|
||||
// some systems (like PSP) can't have many open files at a time,
|
||||
// so we work with their names instead.
|
||||
fclose(tmp_file);
|
||||
|
@ -38,10 +48,10 @@ static int audio_track_mp3(const char *fname, int index)
|
|||
if (ret != 0 || Tracks[index].KBtps <= 0)
|
||||
{
|
||||
elprintf(EL_STATUS, "track %2i: mp3 bitrate %i", index+1, Tracks[index].KBtps);
|
||||
#if !DONT_OPEN_MANY_FILES
|
||||
fclose(tmp_file);
|
||||
#else
|
||||
#ifdef _PSP_FW_VERSION
|
||||
free(tmp_file);
|
||||
#else
|
||||
fclose(tmp_file);
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
@ -62,15 +72,12 @@ PICO_INTERNAL int Load_CD_Image(const char *cd_img_name, cd_img_type type)
|
|||
{
|
||||
int i, j, num_track, Cur_LBA, index, ret, iso_name_len, missed, cd_img_sectors;
|
||||
_scd_track *Tracks = Pico_mcd->TOC.Tracks;
|
||||
char tmp_name[1024], tmp_ext[10];
|
||||
char tmp_name[1024], tmp_ext[10], tmp_ext_u[10];
|
||||
cue_data_t *cue_data = NULL;
|
||||
pm_file *pmf;
|
||||
static char *exts[] = {
|
||||
static const char *exts[] = {
|
||||
"%02d.mp3", " %02d.mp3", "-%02d.mp3", "_%02d.mp3", " - %02d.mp3",
|
||||
"%d.mp3", " %d.mp3", "-%d.mp3", "_%d.mp3", " - %d.mp3",
|
||||
#if CASE_SENSITIVE_FS
|
||||
"%02d.MP3", " %02d.MP3", "-%02d.MP3", "_%02d.MP3", " - %02d.MP3",
|
||||
#endif
|
||||
};
|
||||
|
||||
if (PicoCDLoadProgressCB != NULL)
|
||||
|
@ -187,21 +194,34 @@ PICO_INTERNAL int Load_CD_Image(const char *cd_img_name, cd_img_type type)
|
|||
for (j = 0; j < sizeof(exts)/sizeof(char *); j++)
|
||||
{
|
||||
int ext_len;
|
||||
sprintf(tmp_ext, exts[j], i);
|
||||
ext_len = strlen(tmp_ext);
|
||||
|
||||
memcpy(tmp_name, cd_img_name, iso_name_len + 1);
|
||||
tmp_name[iso_name_len - 4] = 0;
|
||||
strcat(tmp_name, tmp_ext);
|
||||
char *p;
|
||||
|
||||
index = num_track - 1;
|
||||
|
||||
sprintf(tmp_ext, exts[j], i);
|
||||
ext_len = strlen(tmp_ext);
|
||||
to_upper(tmp_ext_u, tmp_ext);
|
||||
|
||||
memcpy(tmp_name, cd_img_name, iso_name_len + 1);
|
||||
p = tmp_name + iso_name_len - 4;
|
||||
|
||||
strcpy(p, tmp_ext);
|
||||
ret = audio_track_mp3(tmp_name, index);
|
||||
if (ret != 0 && i > 1 && iso_name_len > ext_len) {
|
||||
tmp_name[iso_name_len - ext_len] = 0;
|
||||
strcat(tmp_name, tmp_ext);
|
||||
if (ret != 0) {
|
||||
strcpy(p, tmp_ext_u);
|
||||
ret = audio_track_mp3(tmp_name, index);
|
||||
}
|
||||
|
||||
if (ret != 0 && i > 1 && iso_name_len > ext_len) {
|
||||
p = tmp_name + iso_name_len - ext_len;
|
||||
strcpy(p, tmp_ext);
|
||||
ret = audio_track_mp3(tmp_name, index);
|
||||
if (ret != 0) {
|
||||
strcpy(p, tmp_ext_u);
|
||||
ret = audio_track_mp3(tmp_name, index);
|
||||
}
|
||||
}
|
||||
|
||||
if (ret == 0)
|
||||
{
|
||||
LBA_to_MSF(Cur_LBA, &Tracks[index].MSF);
|
||||
|
@ -248,7 +268,7 @@ PICO_INTERNAL void Unload_ISO(void)
|
|||
if (Pico_mcd->TOC.Tracks[i].F != NULL)
|
||||
{
|
||||
if (Pico_mcd->TOC.Tracks[i].ftype == TYPE_MP3)
|
||||
#if DONT_OPEN_MANY_FILES
|
||||
#ifdef _PSP_FW_VERSION
|
||||
free(Pico_mcd->TOC.Tracks[i].F);
|
||||
#else
|
||||
fclose(Pico_mcd->TOC.Tracks[i].F);
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
|
||||
#include "../pico_int.h"
|
||||
|
||||
#undef dprintf
|
||||
#define dprintf(...)
|
||||
|
||||
#define _rot_comp Pico_mcd->rot_comp
|
||||
|
||||
static const int Table_Rot_Time[] =
|
||||
|
|
|
@ -1505,18 +1505,14 @@ void PicoDrawSync(int to, int blank_last_line)
|
|||
|
||||
for (line = DrawScanline; line < to; line++)
|
||||
{
|
||||
#if !CAN_HANDLE_240_LINES
|
||||
if (line >= 224) break;
|
||||
#endif
|
||||
PicoLine(line, offs, sh, bgc);
|
||||
}
|
||||
|
||||
#if !CAN_HANDLE_240_LINES
|
||||
if (line >= 224) {
|
||||
DrawScanline = 240;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
// last line
|
||||
if (line <= to)
|
||||
|
|
|
@ -8,10 +8,8 @@
|
|||
|
||||
#include "pico_int.h"
|
||||
|
||||
// port_config.h include must define these 2 defines:
|
||||
// #define START_ROW 1 // which row of tiles to start rendering at?
|
||||
// #define END_ROW 27 // ..end
|
||||
// one row means 8 pixels. If above example was used, (27-1)*8=208 lines would be rendered.
|
||||
#define START_ROW 0 // which row of tiles to start rendering at?
|
||||
#define END_ROW 28 // ..end
|
||||
|
||||
#define TILE_ROWS END_ROW-START_ROW
|
||||
|
||||
|
|
|
@ -12,9 +12,6 @@
|
|||
|
||||
#include <stdlib.h> // size_t
|
||||
|
||||
// port-specific compile-time settings
|
||||
#include <port_config.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
|
|
@ -802,7 +802,11 @@ static __inline int isspace_(int c)
|
|||
|
||||
// emulation event logging
|
||||
#ifndef EL_LOGMASK
|
||||
#define EL_LOGMASK 0
|
||||
# ifdef __x86_64__ // HACK
|
||||
# define EL_LOGMASK (EL_STATUS|EL_IDLE|EL_ANOMALY)
|
||||
# else
|
||||
# define EL_LOGMASK (EL_STATUS|EL_IDLE)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define EL_HVCNT 0x00000001 /* hv counter reads */
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
#include "../cd/pcm.h"
|
||||
#include "mix.h"
|
||||
|
||||
#define SIMPLE_WRITE_SOUND 0
|
||||
|
||||
void (*PsndMix_32_to_16l)(short *dest, int *src, int count) = mix_32_to_16l_stereo;
|
||||
|
||||
// master int buffer to mix to
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue