- added gx2 aa 2x and 4 and some additional primitive and surface enums

- added some gx2 logical ORed enums as typdef enum does not allow OR operations without a cast in C++
- added AXQuit in sndcore2
- added OSGetTitleID in coreinit
- removed not existing functions from nsysnet and added inet_ntoa
This commit is contained in:
dimok789 2016-10-11 19:17:18 +02:00
parent be3bcba701
commit 37330b5046
7 changed files with 67 additions and 9 deletions
include
coreinit
gx2
nsysnet
sndcore2
rpl
libcoreinit
libnsysnet
libsndcore2

14
include/coreinit/title.h Normal file
View File

@ -0,0 +1,14 @@
#pragma once
#include <wut.h>
#ifdef __cplusplus
extern "C" {
#endif
u64 OSGetTitleID(void);
#ifdef __cplusplus
}
#endif
/** @} */

View File

@ -14,6 +14,8 @@ extern "C" {
typedef enum GX2AAMode
{
GX2_AA_MODE1X = 0,
GX2_AA_MODE2X = 1,
GX2_AA_MODE4X = 2
} GX2AAMode;
typedef enum GX2AlphaToMaskMode
@ -117,6 +119,7 @@ typedef enum GX2ClearFlags
{
GX2_CLEAR_FLAGS_DEPTH = 1,
GX2_CLEAR_FLAGS_STENCIL = 2,
GX2_CLEAR_FLAGS_BOTH = (GX2_CLEAR_FLAGS_DEPTH | GX2_CLEAR_FLAGS_STENCIL),
} GX2ClearFlags;
typedef enum GX2CompareFunction
@ -185,6 +188,9 @@ typedef enum GX2InvalidateMode
GX2_INVALIDATE_MODE_CPU = 1 << 6,
GX2_INVALIDATE_MODE_STREAM_OUT_BUFFER = 1 << 7,
GX2_INVALIDATE_MODE_EXPORT_BUFFER = 1 << 8,
GX2_INVALIDATE_MODE_CPU_ATTRIBUTE_BUFFER= GX2_INVALIDATE_MODE_CPU | GX2_INVALIDATE_MODE_ATTRIBUTE_BUFFER,
GX2_INVALIDATE_MODE_CPU_TEXTURE = GX2_INVALIDATE_MODE_CPU | GX2_INVALIDATE_MODE_TEXTURE,
GX2_INVALIDATE_MODE_CPU_SHADER = GX2_INVALIDATE_MODE_CPU | GX2_INVALIDATE_MODE_SHADER,
} GX2InvalidateMode;
typedef enum GX2InitAttributes
@ -218,7 +224,10 @@ typedef enum GX2LogicOp
typedef enum GX2PrimitiveMode
{
GX2_PRIMITIVE_MODE_LINES = 2,
GX2_PRIMITIVE_MODE_LINE_STRIP = 3,
GX2_PRIMITIVE_MODE_TRIANGLES = 4,
GX2_PRIMITIVE_MODE_TRIANGLE_FAN = 5,
GX2_PRIMITIVE_MODE_TRIANGLE_STRIP = 6,
GX2_PRIMITIVE_MODE_QUADS = 19,
GX2_PRIMITIVE_MODE_QUAD_STRIP = 20,
@ -384,10 +393,12 @@ typedef enum
typedef enum GX2SurfaceUse
{
GX2_SURFACE_USE_TEXTURE = 1 << 0,
GX2_SURFACE_USE_COLOR_BUFFER = 1 << 1,
GX2_SURFACE_USE_DEPTH_BUFFER = 1 << 2,
GX2_SURFACE_USE_SCAN_BUFFER = 1 << 3,
GX2_SURFACE_USE_TEXTURE = 1 << 0,
GX2_SURFACE_USE_COLOR_BUFFER = 1 << 1,
GX2_SURFACE_USE_DEPTH_BUFFER = 1 << 2,
GX2_SURFACE_USE_SCAN_BUFFER = 1 << 3,
GX2_SURFACE_USE_TV = 1 << 31,
GX2_SURFACE_USE_TEXTURE_COLOR_BUFFER_TV = (GX2_SURFACE_USE_TEXTURE | GX2_SURFACE_USE_COLOR_BUFFER | GX2_SURFACE_USE_TV)
} GX2SurfaceUse;
typedef enum GX2TessellationMode
@ -428,8 +439,8 @@ typedef enum GX2TexMipPerfMode
typedef enum GX2TexXYFilterMode
{
GX2_TEX_XY_FILLTER_MODE_POINT = 0,
GX2_TEX_XY_FILLTER_MODE_LINEAR = 1,
GX2_TEX_XY_FILTER_MODE_POINT = 0,
GX2_TEX_XY_FILTER_MODE_LINEAR = 1,
} GX2TexXYFilterMode;
typedef enum GX2TexAnisoRatio

View File

@ -12,6 +12,8 @@
#define SOL_SOCKET 0xFFFF
#define INADDR_ANY 0
#define PF_UNSPEC 0
#define PF_INET 2
#define PF_INET6 23
@ -35,6 +37,10 @@
#define SHUT_WR 1
#define SHUT_RDWR 2
#define IPPROTO_IP 0
#define IPPROTO_TCP 6
#define IPPROTO_UDP 17
/*
* SOL_SOCKET options
*/
@ -69,6 +75,16 @@ struct linger
int l_linger;
};
struct in_addr {
unsigned int s_addr;
};
struct sockaddr_in {
short sin_family;
unsigned short sin_port;
struct in_addr sin_addr;
char sin_zero[8];
};
#ifdef __cplusplus
extern "C" {
#endif
@ -87,7 +103,7 @@ bind(int sockfd,
socklen_t addrlen);
int
closesocket(int sockfd);
socketclose(int sockfd);
int
connect(int sockfd,
@ -166,6 +182,12 @@ select(int nfds,
fd_set *exceptfds,
struct timeval *timeout);
char *
inet_ntoa(struct in_addr in);
int
inet_aton(const char *cp, struct in_addr *inp);
#ifdef __cplusplus
}
#endif

View File

@ -54,6 +54,9 @@ CHECK_SIZE(AXInitParams, 0x0C);
void
AXInit();
void
AXQuit();
void
AXInitWithParams(AXInitParams *params);

View File

@ -368,5 +368,8 @@ EXPORT(MEMFreeToUnitHeap);
EXPORT(MEMCountFreeBlockForUnitHeap);
EXPORT(MEMCalcHeapSizeForUnitHeap);
// coreinit/title.h
EXPORT(OSGetTitleID);
// coreinit/internal.h
EXPORT(__os_snprintf);

View File

@ -17,23 +17,27 @@ EXPORT(sendto_multi);
EXPORT(sendto_multi_ex);
EXPORT(shutdown);
EXPORT(inet_aton);
EXPORT(inet_ntoa);
EXPORT(inet_ntoa_r);
EXPORT(inet_ntop);
EXPORT(inet_pton);
EXPORT(getpeername);
EXPORT(getsockname);
EXPORT(getsockopt);
EXPORT(setsocketlasterr);
EXPORT(select);
EXPORT(setsocklibopt);
EXPORT(getsocklibopt);
EXPORT(somemopt);
EXPORT(ntohl);
EXPORT(htonl);
EXPORT(ntohs);
EXPORT(htons);
/*
// Those are not in nsysnet.rpl - why are they linked o.O?
EXPORT(somemopt);
EXPORT(setsocketlasterr);
EXPORT(icmp_create_handle);
EXPORT(icmp_close_handle);
EXPORT(icmp_ping);
EXPORT(icmp_cancel);
EXPORT(icmp_last_code_type);
*/

View File

@ -8,6 +8,7 @@ EXPORT(AXSetDefaultMixerSelect);
EXPORT(AXRegisterAppFrameCallback);
EXPORT(AXGetInputSamplesPerFrame);
EXPORT(AXGetInputSamplesPerSec);
EXPORT(AXQuit);
// sndcore2/device.h
EXPORT(AXGetDeviceMode);