Dumb question -- is there anything like the NetLoader/3dslink pair from the Homebrew Launcher but runs as a CIA (from EmuNAND or A9LHax...NAND)
You mean for developing homebrew? Probably the closest is this: https://github.com/Cpasjuste/libctrshell
For developing homebrew, yes, but basically something to load the code over the network like one can do with Netloader/3dslink. Network printfs sound neat, but loading code without yanking my sdcard out constantly is more interesting to me XD
If I'm not mistaken, that library has code to push new CIAs over the currently running one for testing purposes.
#include <3ds.h>
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/iosupport.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <fcntl.h>
/* Correct buffer size? */
#define SOCBUF_SIZE 128 * 1024
/*
* If set, this will also write to the default console device as set up by libctru.
*/
#define ALSO_PRINT_CONSOLE
/*
* If set, sets the socket to non-blocking I/O mode.
* I have no idea if this matters or not.
*/
#define DONT_BLOCK
/*
* con_write From libctru.
* Are we even supposed to be able to access this?
*/
extern ssize_t con_write(struct _reent *r,int fd,const char *ptr, size_t len);
static int DebugMsgSocket = -1;
static void* SOCBuffer = NULL;
static struct sockaddr_in ServerAddr;
/*
* Our device descriptor.
* Maybe one day implement stdin over UDP?
*/
static const devoptab_t MyDevOpTab = {
"con",
0,
NULL,
NULL,
Netcon_Write,
NULL,
NULL,
NULL
};
static ssize_t Netcon_Write( struct _reent* r, int fd, const char* ptr, size_t len ) {
ssize_t Count = 0;
#ifdef ALSO_PRINT_CONSOLE
/*
* Only care about the number of characters written to the console.
*/
Count = con_write( r, fd, ptr, len );
sendto( DebugMsgSocket, ptr, len, 0, ( const struct sockaddr* ) &ServerAddr, sizeof( struct sockaddr_in ) );
#else
Count = sendto( DebugMsgSocket, ptr, len, 0, ( const struct sockaddr* ) &ServerAddr, sizeof( struct sockaddr_in ) );
#endif
return Count;
}
/*
* TODO:
* This is awful.
* Just awful.
*/
int netprintf_Init( int Port ) {
int Flags = 0;
u32 Status = 0;
if ( acInit( ) == 0 ) {
ACU_GetWifiStatus( &Status );
if ( Status > 0 ) {
SOCBuffer = memalign( 0x1000, SOCBUF_SIZE );
if ( SOCBuffer ) {
if ( socInit( ( u32* ) SOCBuffer, SOCBUF_SIZE ) == 0 ) {
DebugMsgSocket = socket( AF_INET, SOCK_DGRAM, 0 );
if ( DebugMsgSocket != -1 ) {
memset( &ServerAddr, 0, sizeof( ServerAddr ) );
#ifdef DONT_BLOCK
Flags = fcntl( DebugMsgSocket, F_GETFL, 0 );
Flags|= O_NONBLOCK;
fcntl( DebugMsgSocket, F_SETFL, Flags );
#else
/* Keep compiler from bitchin' */
Flags++;
#endif
ServerAddr.sin_family = AF_INET;
ServerAddr.sin_addr.s_addr = INADDR_BROADCAST;
ServerAddr.sin_port = htons( Port );
devoptab_list[ STD_OUT ] = &MyDevOpTab;
devoptab_list[ STD_ERR ] = &MyDevOpTab;
setvbuf( stdout, NULL, _IONBF, 0 );
setvbuf( stderr, NULL, _IONBF, 0 );
return 1;
}
}
linearFree( SOCBuffer );
}
}
}
return 0;
}
/*
* same
*/
void netprintf_Close( void ) {
if ( DebugMsgSocket )
closesocket( DebugMsgSocket );
socExit( );
acExit( );
if ( SOCBuffer )
free( SOCBuffer );
}
Setup toolchains and libraries. Compile/run examples. Edit examples. Then either contribute to an existing project or start something new.Where would future homebrew devs start (after learning C/C++)?
Most likely not. I did at the time contribute to making it and have learned lot's more since if you have any questions just ask them here, I'm sure I or someone else will be willing to help you out!Anyone know if @xem will update this: https://github.com/xem/3DShomebrew/wiki
You could use the constant texenv color to set one channel to 0 and interpolate or modulate ops. That would remove all red for instance - maybe not what you where looking for though.Is it possible to use texture combiners to cull out a particular color?
Double buffer and offload it to the system core. From doing that I saved 5ms but increased complexity, so I reverted back to the original code.Indexed->RGB conversion is slow as balls but I wondered if anyone had figured out some kind of witchcraft to speed it up or hax around it?
Only updating dirty regions is the best solution so far but a full screen update on the o3ds is still not great.
You could use the constant texenv color to set one channel to 0 and interpolate or modulate ops. That would remove all red for instance - maybe not what you where looking for though.
Double buffer and offload it to the system core. From doing that I saved 5ms but increased complexity, so I reverted back to the original code.
What were your times like on o3ds on the syscore?
From what I read we only have ~80MHz worth of CPU time there and I found on my end a 512x384 framebuffer took ~10ms to complete on the main thread.
Curse that damn pica200 for not having any indexed modes.
-_-
Thats how I timed it, simple and accurate enough.Yeah, I'll take free linear scaling any day
The texture upload is nothing, it's the indexed->rgb that seems to be the slowest part, unless I've been timing it wrong?
I've been using osGetTime before and after the framebuffer conversions and getting the difference.
The GPU supports procedural textures, which includes a color LUT, but it's not completely documented and I don't know of anyone who has successfully achieved it. I will be toying with it this week though for usage in ScummVM.Indexed->RGB conversion is slow as balls but I wondered if anyone had figured out some kind of witchcraft to speed it up or hax around it?
Only updating dirty regions is the best solution so far but a full screen update on the o3ds is still not great.