mirror of
https://github.com/switchbrew/libnx.git
synced 2025-07-04 02:22:15 +02:00
Some corrections
This commit is contained in:
parent
9e0f259f6c
commit
17d297dcda
@ -113,7 +113,7 @@ typedef struct {
|
||||
u8 unk_x57;
|
||||
} MiiCharInfo;
|
||||
|
||||
/// Initialize mii (mii:e).
|
||||
/// Initialize mii.
|
||||
Result miiInitialize(MiiServiceType service_type);
|
||||
|
||||
/// Exit mii.
|
||||
@ -133,25 +133,25 @@ Result miiOpenDatabase(MiiDatabase *out, MiiSpecialKeyCode key_code);
|
||||
* @brief Returns whether the mii database is updated.
|
||||
* @param[in] db Database.
|
||||
* @param[in] flag Source flag.
|
||||
* @param[out] out Out boolean.
|
||||
* @param[out] out_updated Whether the mii database is updated.
|
||||
*/
|
||||
Result miiDatabaseIsUpdated(MiiDatabase *db, u8 *out, MiiSourceFlag flag);
|
||||
Result miiDatabaseIsUpdated(MiiDatabase *db, bool *out_updated, MiiSourceFlag flag);
|
||||
|
||||
/**
|
||||
* @brief Returns whether the mii database is full.
|
||||
* @param[in] db Database.
|
||||
* @param[in] flag Source flag.
|
||||
* @param[out] out Out boolean.
|
||||
* @param[out] out_full Whether the mii database is updated.
|
||||
*/
|
||||
Result miiDatabaseIsFull(MiiDatabase *db, u8 *out);
|
||||
Result miiDatabaseIsFull(MiiDatabase *db, bool *out_full);
|
||||
|
||||
/**
|
||||
* @brief Returns number of miis in the database with the specified source flag.
|
||||
* @param[in] db Database.
|
||||
* @param[in] flag Source flag.
|
||||
* @param[out] out Out count.
|
||||
* @param[out] out_count Out mii count.
|
||||
*/
|
||||
Result miiDatabaseGetCount(MiiDatabase *db, u32 *out, MiiSourceFlag flag);
|
||||
Result miiDatabaseGetCount(MiiDatabase *db, s32 *out_count, MiiSourceFlag flag);
|
||||
|
||||
/**
|
||||
* @brief Reads mii charinfo data from the specified source flag.
|
||||
@ -161,7 +161,7 @@ Result miiDatabaseGetCount(MiiDatabase *db, u32 *out, MiiSourceFlag flag);
|
||||
* @param[in] out_infos_count Amount of mii chainfos to read.
|
||||
* @param[out] out_count Number of mii charinfos which were read.
|
||||
*/
|
||||
Result miiDatabaseGetCharInfo(MiiDatabase *db, MiiSourceFlag flag, MiiCharInfo *out_infos, size_t out_infos_count, u32 *out_count);
|
||||
Result miiDatabaseGet1(MiiDatabase *db, MiiSourceFlag flag, MiiCharInfo *out_infos, s32 count, s32 *total_out);
|
||||
|
||||
/**
|
||||
* @brief Generates a random mii charinfo (doesn't register it in the console database).
|
||||
|
@ -5,7 +5,7 @@
|
||||
* @copyright libnx Authors
|
||||
*/
|
||||
#pragma once
|
||||
#include "mii.h"
|
||||
#include "../services/mii.h"
|
||||
|
||||
/// Image ID.
|
||||
typedef struct {
|
||||
@ -32,38 +32,38 @@ Service* miiimgGetServiceSession(void);
|
||||
/**
|
||||
* @brief Reloads the image database.
|
||||
*/
|
||||
Result miiimgReload();
|
||||
Result miiimgReload(void);
|
||||
|
||||
/**
|
||||
* @brief Gets the number of mii images in the database.
|
||||
* @param[out] out_count Mii image count.
|
||||
*/
|
||||
Result miiimgGetCount(u32 *out_count);
|
||||
Result miiimgGetCount(s32 *out_count);
|
||||
|
||||
/**
|
||||
* @brief Gets whether the image database is empty.
|
||||
* @param[out] out_empty Whether the database is empty.
|
||||
*/
|
||||
Result miiimgIsEmpty(u8 *out_empty);
|
||||
Result miiimgIsEmpty(bool *out_empty);
|
||||
|
||||
/**
|
||||
* @brief Gets whether the image database is full.
|
||||
* @param[out] out_empty Whether the database is full.
|
||||
*/
|
||||
Result miiimgIsFull(u8 *out_full);
|
||||
Result miiimgIsFull(bool *out_full);
|
||||
|
||||
/**
|
||||
* @brief Gets the image attribute for the specified image index.
|
||||
* @param[in] index Image index.
|
||||
* @param[out] out_attr Out image attribute.
|
||||
*/
|
||||
Result miiimgGetAttribute(u32 index, MiiimgImageAttribute *out_attr);
|
||||
Result miiimgGetAttribute(s32 index, MiiimgImageAttribute *out_attr);
|
||||
|
||||
/**
|
||||
* @brief Loads the image data (raw RGBA8) for the specified image ID.
|
||||
* @note Server doesn't seem to check the image buffer size, but 0x40000 is the optimal size.
|
||||
* @param[in] id Input image ID.
|
||||
* @param[out] out_image Out iamge buffer.
|
||||
* @param[in] out_image_size Out image buffer size.
|
||||
* @note Server doesn't seem to check the image buffer size, but 0x40000 is the optimal size.
|
||||
*/
|
||||
Result miiimgLoadImage(MiiimgImageId id, void *out_image, size_t out_image_size);
|
||||
Result miiimgLoadImage(MiiimgImageId id, void* out_image, size_t out_image_size);
|
||||
|
@ -6,7 +6,9 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "mii.h"
|
||||
#include "../types.h"
|
||||
#include "../sf/service.h"
|
||||
#include "../services/mii.h"
|
||||
|
||||
/// NfpServiceType
|
||||
typedef enum {
|
||||
|
@ -39,24 +39,30 @@ Result miiOpenDatabase(MiiDatabase *out, MiiSpecialKeyCode key_code) {
|
||||
);
|
||||
}
|
||||
|
||||
Result miiDatabaseIsUpdated(MiiDatabase *db, u8 *out, MiiSourceFlag flag) {
|
||||
Result miiDatabaseIsUpdated(MiiDatabase *db, bool *out_updated, MiiSourceFlag flag) {
|
||||
u32 in = (u32)flag;
|
||||
return serviceDispatchInOut(&db->s, 0, in, *out);
|
||||
u8 tmp = 0;
|
||||
Result rc = serviceDispatchInOut(&db->s, 0, in, tmp);
|
||||
if (R_SUCCEEDED(rc) && out_updated) *out_updated = tmp & 1;
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result miiDatabaseIsFull(MiiDatabase *db, u8 *out) {
|
||||
return serviceDispatchOut(&db->s, 1, *out);
|
||||
Result miiDatabaseIsFull(MiiDatabase *db, bool *out_full) {
|
||||
u8 tmp = 0;
|
||||
Result rc = serviceDispatchOut(&db->s, 1, tmp);
|
||||
if (R_SUCCEEDED(rc) && out_full) *out_full = tmp & 1;
|
||||
return rc;
|
||||
}
|
||||
Result miiDatabaseGetCount(MiiDatabase *db, u32 *out, MiiSourceFlag flag) {
|
||||
Result miiDatabaseGetCount(MiiDatabase *db, s32 *out_count, MiiSourceFlag flag) {
|
||||
u32 in = (u32)flag;
|
||||
return serviceDispatchInOut(&db->s, 2, in, *out);
|
||||
return serviceDispatchInOut(&db->s, 2, in, *out_count);
|
||||
}
|
||||
|
||||
Result miiDatabaseGetCharInfo(MiiDatabase *db, MiiSourceFlag flag, MiiCharInfo *out_infos, size_t out_infos_count, u32 *out_count) {
|
||||
Result miiDatabaseGet1(MiiDatabase *db, MiiSourceFlag flag, MiiCharInfo *out_infos, s32 count, s32 *total_out) {
|
||||
u32 in = (u32)flag;
|
||||
return serviceDispatchInOut(&db->s, 4, in, *out_count,
|
||||
return serviceDispatchInOut(&db->s, 4, in, *total_out,
|
||||
.buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_Out },
|
||||
.buffers = { { out_infos, out_infos_count * sizeof(MiiCharInfo) } },
|
||||
.buffers = { { out_infos, count * sizeof(MiiCharInfo) } },
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -30,27 +30,33 @@ Service* miiimgGetServiceSession(void) {
|
||||
return &g_miiimgSrv;
|
||||
}
|
||||
|
||||
Result miiimgReload() {
|
||||
Result miiimgReload(void) {
|
||||
return serviceDispatch(&g_miiimgSrv, 10);
|
||||
}
|
||||
|
||||
Result miiimgGetCount(u32 *out_count) {
|
||||
Result miiimgGetCount(s32 *out_count) {
|
||||
return serviceDispatchOut(&g_miiimgSrv, 11, *out_count);
|
||||
}
|
||||
|
||||
Result miiimgIsEmpty(u8 *out_empty) {
|
||||
return serviceDispatchOut(&g_miiimgSrv, 12, *out_empty);
|
||||
Result miiimgIsEmpty(bool *out_empty) {
|
||||
u8 tmp = 0;
|
||||
Result rc = serviceDispatchOut(&g_miiimgSrv, 12, tmp);
|
||||
if (R_SUCCEEDED(rc) && out_empty) *out_empty = tmp & 1;
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result miiimgIsFull(u8 *out_full) {
|
||||
return serviceDispatchOut(&g_miiimgSrv, 13, *out_full);
|
||||
Result miiimgIsFull(bool *out_full) {
|
||||
u8 tmp = 0;
|
||||
Result rc = serviceDispatchOut(&g_miiimgSrv, 13, tmp);
|
||||
if (R_SUCCEEDED(rc) && out_full) *out_full = tmp & 1;
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result miiimgGetAttribute(u32 index, MiiimgImageAttribute *out_attr) {
|
||||
Result miiimgGetAttribute(s32 index, MiiimgImageAttribute *out_attr) {
|
||||
return serviceDispatchInOut(&g_miiimgSrv, 14, index, *out_attr);
|
||||
}
|
||||
|
||||
Result miiimgLoadImage(MiiimgImageId id, void *out_image, size_t out_image_size) {
|
||||
Result miiimgLoadImage(MiiimgImageId id, void* out_image, size_t out_image_size) {
|
||||
return serviceDispatchIn(&g_miiimgSrv, 15, id,
|
||||
.buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_Out },
|
||||
.buffers = { { out_image, out_image_size } },
|
||||
|
Loading…
Reference in New Issue
Block a user