MEMPAK folder is under ed64 now

This commit is contained in:
Travis Burtrum 2021-10-24 17:03:39 -04:00
parent 8368780f69
commit ba432bb8c8
3 changed files with 24 additions and 14 deletions

18
inc/constants.h Normal file
View File

@ -0,0 +1,18 @@
//
// Copyright (c) 2017 The Altra64 project contributors
// See LICENSE file in the project root for full license information.
//
#ifndef _CONSTANTS_H_
#define _CONSTANTS_H_
#define ED64PLUS
#define MAX_SUPPORTED_PATH_LEN 256
#ifdef ED64PLUS
#define ED64_FIRMWARE_PATH "ED64P"
#else
#define ED64_FIRMWARE_PATH "ED64"
#endif
#endif

View File

@ -40,6 +40,7 @@
// YAML parser
#include <yaml.h>
#include "constants.h"
#include "debug.h"
#include "mem.h"
#include "chksum64.h"
@ -49,22 +50,12 @@
#include "menu.h"
#include "cic.h"
#define ED64PLUS
#ifdef ED64PLUS
#define ED64_FIRMWARE_PATH "ED64P"
#else
#define ED64_FIRMWARE_PATH "ED64"
#endif
#ifdef USE_TRUETYPE
#define STB_TRUETYPE_IMPLEMENTATION
#include "stb_truetype.h"
#define MAX_LIST 20
#define MAX_SUPPORTED_PATH_LEN 256
struct glyph
{
int xoff;

View File

@ -7,6 +7,7 @@
#include <libdragon.h>
#include <string.h>
#include <stdio.h>
#include "constants.h"
#include "types.h"
#include "mempak.h"
#include "memorypak.h"
@ -382,14 +383,14 @@ void view_mpk(display_context_t disp)
//old function to dump a mempak to a file
void mpk_to_file(display_context_t disp, char *mpk_filename, int quick)
{
u8 buff[64];
u8 buff[MAX_SUPPORTED_PATH_LEN];
u8 v = 0;
u8 ok = 0;
if (quick)
sprintf(buff, "%s%s", mempak_path, mpk_filename);
sprintf(buff, "/"ED64_FIRMWARE_PATH"/%s/%s", mempak_path, mpk_filename);
else
sprintf(buff, "%s%s.MPK", mempak_path, mpk_filename);
sprintf(buff, "/"ED64_FIRMWARE_PATH"/%s/%s.MPK", mempak_path, mpk_filename);
FRESULT fr;
FILINFO fno;
@ -403,7 +404,7 @@ void mpk_to_file(display_context_t disp, char *mpk_filename, int quick)
else
while (fr == FR_OK)
{
sprintf(buff, "%s%s%i.MPK", mempak_path, mpk_filename, v);
sprintf(buff, "/"ED64_FIRMWARE_PATH"/%s/%s.%i.MPK", mempak_path, mpk_filename, v);
fr = f_stat(buff, &fno);
if (fr == FR_OK)