You should make an HTML languageWe've discussed how hard it would be to port full html language support into SmileBasic. It's not going to happen. With SmileNet 2.0 though, it will be documented fully on how it works and why. That will allow us to fully blow SmileBasic open networking wise, and if someone ELSE wants to figure out how to utilize what SmileNet provides for an html viewer/parser then they can feel free to go right ahead, there is technically nothing stopping a pc-side application from sending the html data from a page request into SmileBasic as array data, and nothing stopping a user from making SmileBasic parse that data. I would reccomend importing a full html web page into a file in SmileBasic first, and trying to parse it that way it's already working. Then it's just a matter of feeding the data into the parser from a DIFFERENT source, than say, the projects/files that SB can access. For info on how to get files into SB , look at petitmodem or SBFileManager. You certainly won't be typing advanced html by hand into SmileBasic.
SmileNet 2.0 Is maybe happening soon (Don't burn me if it doesn't)
Root / Talk About Programs / [.]
CoinzReturnsCreated:
Will there be Net Neutrality?Depends if it influences your ability to run p2p like applications or not. and connect directly to servers using programs (not web browsers) I'm going to go out on a limb and say no effect for now but don't quote me and also, it depends on your ISP and country / region.
I've opened up a discord server for discussing SmileNet Development.
Please join if you feel like it. Not much happening yet but instead of continuing to flood the forum here I've created a #news channel.
Anything important will be posted there. If you don't have discord, then you'll have to wait to hear more news.
https://discord.gg/WGuMWw
I've opened up a discord server for discussing SmileNet Development. Please join if you feel like it. Not much happening yet but instead of continuing to flood the forum here I've created a #news channel. Anything important will be posted there. If you don't have discord, then you'll have to wait to hear more news. https://discord.gg/WGuMWwInvite's broken
Permanent invite link here: https://discord.gg/PcuJC5TI've opened up a discord server for discussing SmileNet Development. Please join if you feel like it. Not much happening yet but instead of continuing to flood the forum here I've created a #news channel. Anything important will be posted there. If you don't have discord, then you'll have to wait to hear more news. https://discord.gg/WGuMWwInvite's broken
So, I have a request. Could you please release ALL the code you have created so far? Even the 3ds side? It would help a lot, and would let us analyze it to see if improvements can be made.Sure I can do that no problem let me update the SmileNet 2.0 thing on github.. yeahh.
SmileNet 2.0 C# project for visual studio 2015 PC TO 3ds CLIENT TCP/IP test code. (yes it connects it works etc but some things don't work yet): https://github.com/ToshieCosed/SmileNet-2.0-Pc-Test Luma3DS modification to Rosalina main repo here: https://github.com/ToshieCosed/Luma3DS_RosalinaSmileHook The actual .c file which you'll want to look at which handles SmileNet IN Rosalina: https://github.com/ToshieCosed/Luma3DS_RosalinaSmileHook/blob/master/sysmodules/rosalina/source/petithookthread.c The 3ds-Side SmileBasic code:So, I have a request. Could you please release ALL the code you have created so far? Even the 3ds side? It would help a lot, and would let us analyze it to see if improvements can be made.Sure I can do that no problem let me update the SmileNet 2.0 thing on github.. yeahh.
Spoiler
OPTION DEFINT 'THE BELOW LINES MUST EXECUTE FIRST FOR SMILENET 2.0 TO EVEN WORK DIM MYVARS[9000] 'DO NOT CHANGE THIS FILL MYVARS, 555555 'DO NOT CHANGE THIS FOR N=270 TO 270+255 MYVARS[N] =255 NEXT 'MYVARS[4] =1 'NOT USED FOR NOW @LOOP OUTS$ = "" 'DOUBLE QUOTE INCASE HARD TO SEE 'SIZE = MYVARS[4] 'NOT USED IF MYVARS[256] == 0 THEN MYVARS[256] = 255 'SET TO TRUE FOR ONE OF SMILENET'S INTERNAL FLAGS FOR T=0 TO 255 ' THIS IS SUPPOSED TO READ THAT DATA HAS BEEN SENT D$ = CHR$(MYVARS[T]) OUTS$ = OUTS$ + CHR$(MYVARS[T]) NEXT MYVARS[256] = 0 'SET THE READ READY FLAG TO FALSE AGAIN SO THE WRITE CAN OCCUR AGAIN ' THE SMILENET PROCESS RUNNING IN ROSALINA CAN ACTUALLY SEE ALL THESE VARIABLES IN THE ARRAY CALLED MYVARS[] THAT'S HOW IT TALKS TO SMILEBASIC AND SETS/UNSETS FLAGS ENDIF IF OLDS$!=OUTS$ THEN OLDS$ = OUTS$ PRINT OUTS$ 'PRINT WHAT WE GOT FROM SMILENET ONTO THE SMILEBASIC SCREEN PRINT "SIZE WAS " + STR$(SIZE) 'SIZE ISN'T USED NOW BUT DID WORK IN GETTING THE LENGTH OF A STRING BY HAVING SMILENET SEND THE LENGTH AS THE FIRST BYTE ON THE MESSAGE LINE MYVARS[256] = 0' ENDIF GOTO @LOOP
Spoiler
I haven't tested it yet but I now have the 3ds-side layer almost done. The server can check on if the send or recieve buffer is free, and if it is, it can request the buffer be sent or send a data write over. This is some pretty rudimentary foolery and voodoo with networking I've never done before.(edited) SmileNet Messaging format. PC CLIENT To 3DS Messaging System: RAW: To send raw data format the first byte of your tcp message to always 0 and a length of 255/256 bytes. Requests: Message requests coming from the PC side are formatted by the first byte being 255 always. Byte 1: 255, Byte 2: Message type, Byte 3: usually not needed on 1st message. Send a length of 255 bytes to the SmileNet Thread anyway, even though the first two are only used. Message types: Message type 0: Request result of CAN_WRITE (basically check this before sending data please) Message type 2: Check SmileNet SEND BUFFER. YES the PC Client must ask the SmileNet thread if it has data ready to send. Message type 4: Request to send the SEND BUFFER to the PC side. Message type 1: Response sent to PC SIDE from 3ds, means RESULT of CAN_WRITE check. Will be 0 or 1.(True/false) The format for this type of response is Byte[0] =255, Byte[1] = MSGTYPE in this case 1, and Byte[2] = Result, in this case True/False Check your results on the PC side. Message type 3: PC Side Result of Does 3DS side have data for sending. Format is: Byte[0] =255, Byte[1] = 3 (MSGTYPE), Byte[2] = Result (0 or 1) (True/False) It seems I made a small error that needs correcting and just assumed to send the send_buffer. This will be corrected by always setting the first byte of raw data with a byte value of 0. Thanks. On the PC side a message coming in with first byte of 0 will always mean this is raw data. You should check if you requested data first on the PC side, before allowing to process a message with a first byte of 0 since we have a format to conform to. Thanks. That's it for now. SmileNet Builds will likely be released later ~Where is the github?I literally just linked it. XP
let me know how it goes :DThanks! Can't wait to try it out!Where is the github?I literally just linked it. XP
You don't paste the 3ds code anywhere... you need to use github tools and stuff to clone luma3ds yourself and build the boot.firm yourself.. follow the same steps here but do it for the smilenet files i've offered you on github (aka Luma3DS): https://github.com/AuroraWright/Luma3DS you'll need to do things like run python install certain scripts, download certain tools, place said tools inside the DevkitPro folder.. do you not have devkitpro? You need to go through the whole setup process to install devkitPro as well if you don't have it: https://sourceforge.net/projects/devkitpro/ Anymore questions let me know. REALLY IMPORTANT: BEFORE You REPLACE boot.firm on your 3ds, RENAME the boot.firm you get from building THIS version of Luma3ds to SmileNet_O3DS. DO NOT replace boot.firm on your SD card. Then you'll select a different boot.firm by holding start and selecting the SmileNet_O3DS.firmThis might sound dumb, but where do I paste the 3ds-side code to? The root? Payloads? Thank you for all of your support, you should work at Sony.let me know how it goes :DThanks! Can't wait to try it out!Where is the github?I literally just linked it. XP
Is there a way for you to just release the pre-compiled firm? Like 3dsguide provides?if I do that you won't be able to modify any of the internal code found in: https://github.com/ToshieCosed/Luma3DS_RosalinaSmileHook/blob/master/sysmodules/rosalina/source/petithookthread.c I can release the boot.firm for it if you want, just tell me what 3ds do you use Old or new? If you wanted the boot.firm you should have asked for that and not the sources to it all. btw the boot.firm requires changes before it's actually useful. For instance, SmileNet on the 3ds side doesn't send anything back to the pc yet properly. only message replies and those are partly not working right now (for reasons I still must investigate when i'm not suffering from this cold ! ick)
I can get you the old3ds firm in a second, no problem. You still need to install visual studio 2015 or higher for this to work btw. You will only be able to send data into SmileBasic (for now)I use the old 3ds. Sorry about all of the trouble, I'm just not the most technology-fluent person in the world. Windows 8.1 sure isn't helping me.Is there a way for you to just release the pre-compiled firm? Like 3dsguide provides?if I do that you won't be able to modify any of the internal code found in: https://github.com/ToshieCosed/Luma3DS_RosalinaSmileHook/blob/master/sysmodules/rosalina/source/petithookthread.c I can release the boot.firm for it if you want, just tell me what 3ds do you use Old or new? If you wanted the boot.firm you should have asked for that and not the sources to it all. btw the boot.firm requires changes before it's actually useful. For instance, SmileNet on the 3ds side doesn't send anything back to the pc yet properly. only message replies and those are partly not working right now (for reasons I still must investigate when i'm not suffering from this cold ! ick)
ok so here is the firm file: https://drive.google.com/open?id=1SFYpAHLW1O9R_z1CRVzE-Vdu-209FuT5 this only works on OLD 3DS. If anything goes wrong please let me know right away so I can try to issue a fix. Next, you need to load it by holding down start at boot , it goes in your Luma/Payloads folder on your SD. now.. very important youll want to set your luma menu to another button Uhm I can't remember which option it is but you wont be able to press the luma menu while a smilebasic program is running if the luma menu is select and up and A which I think is their default button combo. Finally.. the smilebasic program I posted? Yeah you need that. So what you'll do is you'll load smilebasic after boot not even touching the Rosalina menu yet. You will then type in the program for the SmileBasic side of things exactly as it was posted. After that (sorry I'm too lazy to get a key ) You will just get Visual Studio open. Load the project files I posted for that. change the line of code that says your ip here to your local 3ds ip address. In the Rosalina menu it actually tells you your local ip for 3ds. Lastly. Then start SmileNet rampdumper. it's in misc in the Rosalina menu.It's actually SmileNet. Finally. If all went well you have the 3ds program running and the SmileNet process running attempting to hijack the memory of the SmileBasic process for a net injection. Now. you can run tcp/ip test.. and attempt to send data. It's a bit glitchy and right now there's a freeze/wait problem with how I coded it. If you want to get around that delete everything in the main C# code except for the send raw part.. I can't help you out with this because i'm sick but if you get stuck or have questions let me know I just can't do it all for you.Okay, I already have visual studio. Thanks for all the help!I can get you the old3ds firm in a second, no problem. You still need to install visual studio 2015 or higher for this to work btw. You will only be able to send data into SmileBasic (for now)I use the old 3ds. Sorry about all of the trouble, I'm just not the most technology-fluent person in the world. Windows 8.1 sure isn't helping me.Is there a way for you to just release the pre-compiled firm? Like 3dsguide provides?if I do that you won't be able to modify any of the internal code found in: https://github.com/ToshieCosed/Luma3DS_RosalinaSmileHook/blob/master/sysmodules/rosalina/source/petithookthread.c I can release the boot.firm for it if you want, just tell me what 3ds do you use Old or new? If you wanted the boot.firm you should have asked for that and not the sources to it all. btw the boot.firm requires changes before it's actually useful. For instance, SmileNet on the 3ds side doesn't send anything back to the pc yet properly. only message replies and those are partly not working right now (for reasons I still must investigate when i'm not suffering from this cold ! ick)
I've finally done it.
I fixed most of the problems with SmileNet and have achieved reliable formatted messaging between the PC side and the 3ds Side, and also have more insight as to how I need to code the SmileNet platform on the PC side to get properly compliant responses.
It's looking like SmileNet could be good for games that are turn based as well as games or applications such as chat applications.
SmileNet is also looking like it would be good for file transfer from PC to 3ds though how reliably I don't know yet, but we can definitely set something up.
Further interpretation on the SmileBasic side of your packets is required for SmileNet to be of any use.
I still need to modify some flags and such, for the Base SmileNet program to be fully usable but it's looking more and more like real time online multiplayer networking is achievable.
I don't know if there will be any lag, but it should still be quick despite small lag spikes, I have not tested this with larger data streaming but there is no reason why it won't or can't work.
Again, I've gotten rid of all the soft locks and bugs now and it's possible to send your choice data from SmileBasic over SmileNet.
Here's how it will most likely work.
Step 1: You will fill your send buffer with data, and then turn the variable in the Array which will be something like index 257, to a value of 32 to indicate that the send buffer is ready for reading.
Step 2: After the read is completed, you will in your loop somewhere be waiting for the SmileNet process to poke a ram value inside Smilebasic (probably the array index 269) and have that set to another value.
Step 3: Once that's set to another value, you the programmer will know it's safe to change the ram value 257 to an off state (Causing the SmileNet process to read it as "no data on send buffer")
Step 4: Once you know SmileNet is not getting any data from YOUR send Buffer on the PC side, it is safe to go ahead, and change data in the Send Buffer once more, then set the SendBuffer flag back on so SmileNet once again sends your send buffer out over the network.
Step 5: One more thing, SmileNet is always recieving data from the PC side, so it can be as real-time as possible. You, the SmileBasic programmer will have to make sure the data coming into your recieve buffer is also handled.
Since it's as real time as it can be, you'll have to prioritize data coming in ASAP, before you deal with sending data back out.
So in summary: Recieving data is fast.
Sending data back out is slightly slower but no less reliable.
Lastly, You the SmileBasic programmer will also have to ensure that you are formatting your outgoing and incoming data packets in a way that once they reach another 3DS, the program on that 3DS will know what to do with them.
So you'll still have to set up your own kind of messaging format within SmileNet, and find yourself dealing with the raw data yourself. But more or less, The process is automatic.
You fill the send buffer, set a flag, and POOF POOF data goes OUT.
You check the recieve buffer, AND POOF, data that came in is right there ready for you to work with in your program.
The only hassle is that sometimes SmileNet can hang or take a while to accept a connection from the PC side.
Lastly, I still have to set up a proper server, and a non blocking TCP/IP system in C# that allows multiple communications between SmileNet Clients.
A great example of how to format your send buffer would be to set it up so that the first 4-5 bytes represent a client ID, all 3ds will recieve all data for all clients.
The 3ds should ignore data that isn't for itself and should know it's own Client ID.
The 3ds should format outgoing messages, either for all clients, or for only some clients.
The next few bytes of your message should include details about what type of message it is.
Message typing is up to you. Entirely. You could choose to always put the same type of data in your messages or you could choose to put different data following an identifier token for the data type.
IE MAPDATA VS TRADE_DATA. or whatever. You'd have to convert those chars to their corresponding byte values first, send them over the network and convert them back on the other 3ds.
HUZZAH after nearly 8 months of development (with alot of long breaks and tons of headaches)
SMILENET almost lives!!
I look foreward to any questions, and to giving help and advice on how to develop applications that are internet-enabled with SmileBasic from here on out.
Expect a release soon, but not too soon.
Update to Repo and several issues
Also join the SmileNet development group if you want updates, info, news, or to discuss: https://discord.gg/PcuJC5T
I'm having some minor and major issues with SmileNet, so I've updated the repo, see issues if you want to contribute, If you want to make a contribution post here, or you can reach me through github.
https://github.com/ToshieCosed/Luma3DS_RosalinaSmileHook if you want to build SmileNet from the repo follow all instructions, the URL in the instructions will not be the same as the one listed, they were copied from the official Luma3ds sources.
This build is 100% safe and I do not modify any kernel level code at all. Some unpredictable crashes may still happen.
Do not replace your normal boot.firm file if you are running Luma3ds
Lastly IF you are going to build from my source, go into Petithookthread.c which is located in SysModules, Rosalina, Source, Petithookthread.c, and find where it says magicoffset = and change all instances to the one commented out IF you have a NEW 3ds, if you have an OLD 3ds, or a NEW 2ds XL, leave petithookthread.c alone, future changes will allow selecting which 3ds model you have from a menu but for now that's how it is.
ANY questions post here.
Or in the discord group.
Do you have the udp-based code?I prepared the UDP based code, you might have to modify some C code to get it to send data back to the computer. Anyhow the boot.firm is built for you so here is the pc side and 3ds side code: https://drive.google.com/open?id=1T6GuGfOf0j0UehKVdj3kj-PGIpwJyTtn Sorry I didn't see you in chat because you kept leaving. If you need help respond here, we can discuss it.