From 37330b50468a5afd5b250c70c85678f19bbf1d91 Mon Sep 17 00:00:00 2001 From: dimok789 Date: Tue, 11 Oct 2016 19:17:18 +0200 Subject: [PATCH] - 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 --- include/coreinit/title.h | 14 ++++++++++++++ include/gx2/enum.h | 23 +++++++++++++++++------ include/nsysnet/socket.h | 24 +++++++++++++++++++++++- include/sndcore2/core.h | 3 +++ rpl/libcoreinit/exports.h | 3 +++ rpl/libnsysnet/exports.h | 8 ++++++-- rpl/libsndcore2/exports.h | 1 + 7 files changed, 67 insertions(+), 9 deletions(-) create mode 100644 include/coreinit/title.h diff --git a/include/coreinit/title.h b/include/coreinit/title.h new file mode 100644 index 0000000..c37a15a --- /dev/null +++ b/include/coreinit/title.h @@ -0,0 +1,14 @@ +#pragma once +#include + +#ifdef __cplusplus +extern "C" { +#endif + +u64 OSGetTitleID(void); + +#ifdef __cplusplus +} +#endif + +/** @} */ diff --git a/include/gx2/enum.h b/include/gx2/enum.h index 7a63180..605aeb3 100644 --- a/include/gx2/enum.h +++ b/include/gx2/enum.h @@ -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 diff --git a/include/nsysnet/socket.h b/include/nsysnet/socket.h index 4f3c5e6..d70825a 100644 --- a/include/nsysnet/socket.h +++ b/include/nsysnet/socket.h @@ -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 diff --git a/include/sndcore2/core.h b/include/sndcore2/core.h index c9b61ab..1cfd1bd 100644 --- a/include/sndcore2/core.h +++ b/include/sndcore2/core.h @@ -54,6 +54,9 @@ CHECK_SIZE(AXInitParams, 0x0C); void AXInit(); +void +AXQuit(); + void AXInitWithParams(AXInitParams *params); diff --git a/rpl/libcoreinit/exports.h b/rpl/libcoreinit/exports.h index 61417f1..04b7bb9 100644 --- a/rpl/libcoreinit/exports.h +++ b/rpl/libcoreinit/exports.h @@ -368,5 +368,8 @@ EXPORT(MEMFreeToUnitHeap); EXPORT(MEMCountFreeBlockForUnitHeap); EXPORT(MEMCalcHeapSizeForUnitHeap); +// coreinit/title.h +EXPORT(OSGetTitleID); + // coreinit/internal.h EXPORT(__os_snprintf); diff --git a/rpl/libnsysnet/exports.h b/rpl/libnsysnet/exports.h index ed4743b..2845be4 100644 --- a/rpl/libnsysnet/exports.h +++ b/rpl/libnsysnet/exports.h @@ -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); +*/ diff --git a/rpl/libsndcore2/exports.h b/rpl/libsndcore2/exports.h index a607459..3fd26c1 100644 --- a/rpl/libsndcore2/exports.h +++ b/rpl/libsndcore2/exports.h @@ -8,6 +8,7 @@ EXPORT(AXSetDefaultMixerSelect); EXPORT(AXRegisterAppFrameCallback); EXPORT(AXGetInputSamplesPerFrame); EXPORT(AXGetInputSamplesPerSec); +EXPORT(AXQuit); // sndcore2/device.h EXPORT(AXGetDeviceMode);