mirror of
https://github.com/Polprzewodnikowy/N64FlashcartMenu.git
synced 2024-11-29 14:04:14 +01:00
cleanups
This commit is contained in:
parent
2670c84cb6
commit
6a278bbd0a
@ -7,16 +7,14 @@
|
|||||||
#include "../utils/fs.h"
|
#include "../utils/fs.h"
|
||||||
#include "cpak_handler.h"
|
#include "cpak_handler.h"
|
||||||
|
|
||||||
uint8_t pak_data[128 * MEMPAK_BLOCK_SIZE];
|
#define PAK_BLOCKS 128
|
||||||
|
uint8_t pak_data[PAK_BLOCKS * MEMPAK_BLOCK_SIZE];
|
||||||
|
|
||||||
int clone_pak_content_to_file(char *path, uint8_t jpad_port) {
|
int clone_pak_content_to_file(char *path, uint8_t port) {
|
||||||
// get the pak content
|
|
||||||
int err;
|
int err;
|
||||||
for (int i = 0; i < 128; i++) {
|
for (int i = 0; i < PAK_BLOCKS; i++) {
|
||||||
err = read_mempak_sector(jpad_port, i, &pak_data[i * MEMPAK_BLOCK_SIZE]);
|
err = read_mempak_sector(port, i, &pak_data[i * MEMPAK_BLOCK_SIZE]);
|
||||||
if (err) {
|
if (err) {
|
||||||
// there was an issue reading the content (-1 if the sector was out of bounds or sector_data was null
|
|
||||||
// -2 if there was an error reading part of a sector
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,6 @@
|
|||||||
#ifndef CPAK_HANDLER_H__
|
#ifndef CPAK_HANDLER_H__
|
||||||
#define CPAK_HANDLER_H__
|
#define CPAK_HANDLER_H__
|
||||||
|
|
||||||
int clone_pak_content_to_file(char *path, uint8_t jpad_port);
|
int clone_pak_content_to_file(char *path, uint8_t port);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user