-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added stubs for homebrew #26
Open
psxdev
wants to merge
4
commits into
ps4dev:master
Choose a base branch
from
psxdev:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#pragma once | ||
|
||
#include <stdint.h> | ||
#include <types/kernel.h> | ||
#include <types/userservice.h> | ||
|
||
|
||
|
||
int sceAudioOutInit(); | ||
int sceAudioOutOpen(SceUserServiceUserId userId,unsigned int channel,int unknown ,unsigned int samples, unsigned int frequency, unsigned int format); | ||
int sceAudioOutClose(int handle); | ||
int sceAudioOutOutput(int handle, void *buf); | ||
int sceAudioOutSetVolume(int handle, int filter, int *value); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#pragma once | ||
#include <stdint.h> | ||
|
||
|
||
int sceGnmFlushGarlic(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,12 @@ | ||
#pragma once | ||
|
||
#include <stdint.h> | ||
#include <inttypes.h> | ||
#include <sce/types/pad.h> | ||
#include <sce/types/userservice.h> | ||
|
||
int scePadInit(void); | ||
int scePadOpen(int userID, int, int, void *); | ||
int scePadOpen(SceUserServiceUserId userId,int type,int index,uint8_t *param); | ||
int scePadClose(int handle); | ||
int scePadRead(int handle, void *data, int count); | ||
int scePadReadState(int handle, void *data); | ||
int scePadRead(int handle, ScePadData *data, int count); | ||
int scePadReadState(int handle, ScePadData *data); | ||
|
||
/* unreversed */ | ||
int64_t scePadResetOrientation(); | ||
int64_t scePadSetAngularVelocityDeadbandState(); | ||
int64_t scePadSetLightBar(); | ||
int64_t scePadSetMotionSensorState(); | ||
int64_t scePadSetTiltCorrectionState(); | ||
int64_t scePadSetVibration(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#pragma once | ||
|
||
#include <stdint.h> | ||
int sceSystemServiceHideSplashScreen(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#pragma once | ||
|
||
#include <stdint.h> | ||
|
||
typedef struct vec_float3 | ||
{ | ||
float x; | ||
float y; | ||
float z; | ||
}vec_float3; | ||
|
||
typedef struct vec_float4 | ||
{ | ||
float x; | ||
float y; | ||
float z; | ||
float w; | ||
}vec_float4; | ||
|
||
typedef struct ScePadData { | ||
unsigned int buttons; | ||
uint8_t lx; | ||
uint8_t ly; | ||
uint8_t rx; | ||
uint8_t ry; | ||
uint8_t l2; | ||
uint8_t r2; | ||
uint16_t padding; | ||
vec_float4 quat; | ||
vec_float3 vel; | ||
vec_float3 acell; | ||
uint8_t touch[24]; | ||
uint8_t connected; | ||
uint64_t timestamp; | ||
uint8_t ext[16]; | ||
uint8_t count; | ||
uint8_t unknown[15]; | ||
}ScePadData; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#pragma once | ||
|
||
#include <stdint.h> | ||
|
||
|
||
typedef int SceUserServiceUserId; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#pragma once | ||
|
||
#include <stdint.h> | ||
|
||
|
||
typedef struct SceVideoOutBufferAttribute { | ||
int32_t format; | ||
int32_t tmode; | ||
int32_t aspect; | ||
uint32_t width; | ||
uint32_t height; | ||
uint32_t pixelPitch; | ||
uint64_t reserved[2]; | ||
} SceVideoOutBufferAttribute; | ||
|
||
typedef struct SceVideoOutFlipStatus { | ||
uint64_t num; | ||
uint64_t ptime; | ||
uint64_t stime; | ||
int64_t flipArg; | ||
uint64_t reserved[2]; | ||
int32_t numGpuFlipPending; | ||
int32_t numFlipPending; | ||
int32_t currentBuffer; | ||
uint32_t reserved1; | ||
} SceVideoOutFlipStatus; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#pragma once | ||
|
||
#include <stdint.h> | ||
#include <sce/types/userservice.h> | ||
int sceUserServiceInitialize(int *params); | ||
int sceUserServiceTerminate(); | ||
int sceUserServiceGetInitialUser(SceUserServiceUserId *userId); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#pragma once | ||
|
||
#include <stdint.h> | ||
#include <types/kernel.h> | ||
#include <types/userservice.h> | ||
#include <types/videoout.h> | ||
|
||
|
||
|
||
int sceVideoOutOpen(SceUserServiceUserId userId, int type, int index, const void *param); | ||
int sceVideoOutClose(int handle); | ||
int sceVideoOutRegisterBuffers(int handle, int initialIndex, void * const *addr, int numBuf, const SceVideoOutBufferAttribute *attr); | ||
int sceVideoOutUnregisterBuffers(int handle, int indexAttr); | ||
int sceVideoOutSubmitFlip(int handle, int indexBuf, unsigned int flipMode, int64_t flipArg); | ||
void sceVideoOutSetBufferAttribute(SceVideoOutBufferAttribute *attr, unsigned int format, unsigned int tmode,unsigned int aspect, unsigned int width, unsigned int height, unsigned int pixelPitch); | ||
int sceVideoOutSetFlipRate(int handle, int flipRate); | ||
int sceVideoOutAddFlipEvent(SceKernelEqueue eq, int handle, void *data); | ||
int sceVideoOutGetFlipStatus(int handle, SceVideoOutFlipStatus *status); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I just declare
struct knote
in my sample, this header give me error due forwarding declaration of struct knote;Also, ps4sdk-examples/posix/stdio-redirect need 1 line change to compile fine now;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @masterzorag! Thanks for the feedback and help! The example can be fixed by adding
#define __BSD_VISIBLE 1
before the includes.But I would like to avoid including this header into the user-space as well. Instead of adding the include, can we use a
void pointer
to defineSceKernelEvent
? I see getter symbols for the fields of the structs, which suggests that this is the intended way of using the type. E.g.sceKernelGetEventData: SceKernelEvent -> intptr_t
.So, I would remove the
sys/event.h
include and usetypedef void * SceKernelEvent
instead. Then add the additional getters likesceKernelGetEventData
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@psxdev if you can fix the above issue I will merge the PR. Alternatively we can close it and you could add it to the libs directly (but there it should not be in /include/sce but in /include) so you will have to refactor your code. If that is ok we can close the PR - otherwise lets add the headers (after the fix above) so that for now you do not need to port your code to the new header locations.