Homebrew Homebrew Development

daxtsu

Well-Known Member
Member
Joined
Jun 9, 2007
Messages
5,627
Trophies
2
XP
5,194
Country
Antarctica
Yeah thats exactly what I wanted to do(with CIA). Would you mind to give me the code? If yes, you can PM me. I will only use it for personal use and won't share it with any one else, without your permission.


https://gist.github.com/thedax/a02eb93dcd1e0ce533cd

I don't mind making it public. I just wish I could figure out why the UTF-16 strings I try to display are corrupted. Anyway, the paste above simply passes null for the title and text, so the notification will be entirely empty. The 3DS doesn't seem to care if a notification has no title or not.
 

josamilu

Well-Known Member
Member
Joined
Feb 1, 2015
Messages
383
Trophies
0
Location
Saturn is better than Jupiter :P
XP
319
Country
Gambia, The
https://gist.github.com/thedax/a02eb93dcd1e0ce533cd
Thanks. This is awsome. Cause of this i can make a lot of progress in my project.

I don't mind making it public. I just wish I could figure out why the UTF-16 strings I try to display are corrupted. Anyway, the paste above simply passes null for the title and text, so the notification will be entirely empty. The 3DS doesn't seem to care if a notification has no title or not.
 

daxtsu

Well-Known Member
Member
Joined
Jun 9, 2007
Messages
5,627
Trophies
2
XP
5,194
Country
Antarctica
Thanks. This is awsome. Cause of this i can make a lot of progress in my project.


No problem. I might make a pull request to see if I can get it added to libctru later, if I can figure out the corruption issue.

Edit: Oops, I think I found the corruption issue. I'm using the wrong offsets in the header. That's embarassing. Time for more tests..and I'll correct the paste above in a little while.

A few corrections, and...

2y7z1km.png

I'm still having issues with title being corrupted (hence "otification world!") but I can control the message text now.

The title isn't actually being corrupted in that picture, there are 24 bytes of padding or other junk before the title string begins. Not really sure why 3DBrew fails to mention that, but I have the title part working now. Now it's just a matter of making this friendly to use (I have a bunch of stuff hardcoded).
 

josamilu

Well-Known Member
Member
Joined
Feb 1, 2015
Messages
383
Trophies
0
Location
Saturn is better than Jupiter :P
XP
319
Country
Gambia, The
No problem. I might make a pull request to see if I can get it added to libctru later, if I can figure out the corruption issue.

Edit: Oops, I think I found the corruption issue. I'm using the wrong offsets in the header. That's embarassing. Time for more tests..and I'll correct the paste above in a little while.

A few corrections, and...

2y7z1km.png

I'm still having issues with title being corrupted (hence "otification world!") but I can control the message text now.

The title isn't actually being corrupted in that picture, there are 24 bytes of padding or other junk before the title string begins. Not really sure why 3DBrew fails to mention that, but I have the title part working now. Now it's just a matter of making this friendly to use (I have a bunch of stuff hardcoded).

Ok, so I donloaded your code, but still have a problem. I wanted to compile it but then I got that error :
Code:
d:/ctrulib/3DSPong-master/source/main.cpp: In function 'Result NEWSU_AddNotifica
tion()':
d:/ctrulib/3DSPong-master/source/main.cpp:66:12: error: invalid conversion from
'newsu_header_t*' to 'u32 {aka long unsigned int}' [-fpermissive]
  cmdbuf[7] = &header;
            ^
d:/ctrulib/3DSPong-master/source/main.cpp:68:12: warning: converting to non-poin
ter type 'u32 {aka long unsigned int}' from NULL [-Wconversion-null]
  cmdbuf[9] = NULL; // Text pointer
            ^
d:/ctrulib/3DSPong-master/source/main.cpp:70:13: warning: converting to non-poin
ter type 'u32 {aka long unsigned int}' from NULL [-Wconversion-null]
  cmdbuf[11] = NULL; // Image buffer pointer
            ^
I don't know if it's a problem with my setup, because other things compile fine. I hope you can help me with this.
 

Aurelio

Well-Known Member
Newcomer
Joined
Jun 25, 2008
Messages
64
Trophies
0
XP
834
Country
Italy
Ok, so I donloaded your code, but still have a problem. I wanted to compile it but then I got that error :
Code:
d:/ctrulib/3DSPong-master/source/main.cpp: In function 'Result NEWSU_AddNotifica
tion()':
d:/ctrulib/3DSPong-master/source/main.cpp:66:12: error: invalid conversion from
'newsu_header_t*' to 'u32 {aka long unsigned int}' [-fpermissive]
  cmdbuf[7] = &header;
            ^
d:/ctrulib/3DSPong-master/source/main.cpp:68:12: warning: converting to non-poin
ter type 'u32 {aka long unsigned int}' from NULL [-Wconversion-null]
  cmdbuf[9] = NULL; // Text pointer
            ^
d:/ctrulib/3DSPong-master/source/main.cpp:70:13: warning: converting to non-poin
ter type 'u32 {aka long unsigned int}' from NULL [-Wconversion-null]
  cmdbuf[11] = NULL; // Image buffer pointer
            ^
I don't know if it's a problem with my setup, because other things compile fine. I hope you can help me with this.

You just need to add some typecastings:
cmdbuf[7] = (u32)&header;
cmdbuf[9] = (u32)NULL; // Text pointer
cmdbuf[11] = (u32)NULL; // Image buffer pointer
 
  • Like
Reactions: josamilu

Rinnegatamante

Well-Known Member
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy
Ok, so I donloaded your code, but still have a problem. I wanted to compile it but then I got that error :
Code:
d:/ctrulib/3DSPong-master/source/main.cpp: In function 'Result NEWSU_AddNotifica
tion()':
d:/ctrulib/3DSPong-master/source/main.cpp:66:12: error: invalid conversion from
'newsu_header_t*' to 'u32 {aka long unsigned int}' [-fpermissive]
  cmdbuf[7] = &header;
            ^
d:/ctrulib/3DSPong-master/source/main.cpp:68:12: warning: converting to non-poin
ter type 'u32 {aka long unsigned int}' from NULL [-Wconversion-null]
  cmdbuf[9] = NULL; // Text pointer
            ^
d:/ctrulib/3DSPong-master/source/main.cpp:70:13: warning: converting to non-poin
ter type 'u32 {aka long unsigned int}' from NULL [-Wconversion-null]
  cmdbuf[11] = NULL; // Image buffer pointer
            ^
I don't know if it's a problem with my setup, because other things compile fine. I hope you can help me with this.

C++ doesn't allow implicit casting so you have to explicit all of them.
 

josamilu

Well-Known Member
Member
Joined
Feb 1, 2015
Messages
383
Trophies
0
Location
Saturn is better than Jupiter :P
XP
319
Country
Gambia, The
You just need to add some typecastings:
cmdbuf[7] = (u32)&header;
cmdbuf[9] = (u32)NULL; // Text pointer
cmdbuf[11] = (u32)NULL; // Image buffer pointer

Thanks, compiling it now gives no errors anymore. But now there is another problem. I get
Code:
d:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-e
abi/bin/ld.exe: cannot find 3dsx_crt0.o: No such file or directory
collect2.exe: error: ld returned 1 exit status
this, after it tries to Link the .elf file.

EDIT: I googled around a bit and i found out that i have to change -mfloat-abi=softfp to -mfloat-abi=hard but I still get the same error :/

EDIT 2: Ok, now I fixed the error myself, I just tried a bit with the makefile.
 

daxtsu

Well-Known Member
Member
Joined
Jun 9, 2007
Messages
5,627
Trophies
2
XP
5,194
Country
Antarctica
Ok, so I donloaded your code, but still have a problem. I wanted to compile it but then I got that error :

I don't know if it's a problem with my setup, because other things compile fine. I hope you can help me with this.


I tend to code in C on the 3DS, not C++, so I'm not surprised that C++ didn't like a few things. :P
 

Cid2mizard

Well-Known Member
Member
Joined
Aug 16, 2007
Messages
401
Trophies
1
Age
43
Location
Maubeuge
XP
2,456
Country
France
The more I work with libctru , and I realize that he has very little possibility using the CPU frameskip . A simple 16 pixel display tilemap causes a drop in FPS.
It is essential to simplify the use of the GPU, if not many projects are doomed to failure ...​
 

Rinnegatamante

Well-Known Member
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy
The more I work with libctru , and I realize that he has very little possibility using the CPU frameskip . A simple 16 pixel display tilemap causes a drop in FPS.​
It is essential to simplify the use of the GPU, if not many projects are doomed to failure ...​

sf2dlib is really easy to use, porting them on lpp-3ds took me few minutes.
 

DiscostewSM

Well-Known Member
Member
Joined
Feb 10, 2009
Messages
5,484
Trophies
2
Location
Sacramento, California
Website
lazerlight.x10.mx
XP
5,505
Country
United States
Has anyone been able to use definable uniforms with the geometry shader? I'm attempting to improve BlargSNES by using less input for rendering each tile from 2 vertices to 1. When using a constant uniform with the needed information, it works, but when I take it out and put it in the program code alongside other uniform functions (those which are used for the vertex shader), I get a blank screen, even when using the same values used for when the uniform was constant within the shader.
 

Aurelio

Well-Known Member
Newcomer
Joined
Jun 25, 2008
Messages
64
Trophies
0
XP
834
Country
Italy
How would one go about cutting an image?
im thinking memcpy from the u8* just dont know how I would actually do it.

It depends on how the image buffer is made and also on how you want to crop your image.
For example, let's say that you have a row-major order buffer and you want to do a horizontal cut you can do something like this:
Code:
u8 *buffer; //Let's assume that it is already filled and it is a 24bit/pixel buffer
u16 width, height; //Already assigned to a certain value. Height isn't really necessary, but could be useful to check if we want to cut more than we can
u16 startRow; //The starting row from where you want to start your cut
u16 cutHeight; //The number of rows that you want to cut from your buffer
u8 *newBuffer; //The buffer containing the new image
 
newBuffer = (u8 *)malloc(width * cutHeight * 3); //Allocate the new buffer
 
memcpy(newBuffer, &buffer[width * startRow * 3], width * cutHeight * 3); //Copy the cropped image in the new buffer
Please note that you should do some checks to ensure to you are not trying to make a cut outside of the image buffer.
The same code can be easily modified to made vertical cut on a column-major order buffer.

In the case of vertical cuts on row-major order buffers (or horizontal ones on column-major order buffers) you should cycle through the buffer using two nested for loops and copy one pixel at a time
 
  • Like
Reactions: filfat

KingOfHell

Well-Known Member
Newcomer
Joined
Mar 15, 2015
Messages
74
Trophies
0
Age
36
XP
83
Country
United States
is the image tiled for the GPU or not? And what exactly do you mean by cutting? Grabbing a small sub-section of the pixels of the image?
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • Quincy @ Quincy:
    Usually when such a big title leaks the Temp will be the first to report about it (going off of historical reports here, Pokemon SV being the latest one I can recall seeing pop up here)
  • K3Nv2 @ K3Nv2:
    I still like how a freaking mp3 file hacks webos all that security defeated by text yet again
  • BigOnYa @ BigOnYa:
    They have simulators for everything nowdays, cray cray. How about a sim that shows you playing the Switch.
  • K3Nv2 @ K3Nv2:
    That's called yuzu
    +1
  • BigOnYa @ BigOnYa:
    I want a 120hz 4k tv but crazy how more expensive the 120hz over the 60hz are. Or even more crazy is the price of 8k's.
  • K3Nv2 @ K3Nv2:
    No real point since movies are 30fps
  • BigOnYa @ BigOnYa:
    Not a big movie buff, more of a gamer tbh. And Series X is 120hz 8k ready, but yea only 120hz 4k games out right now, but thinking of in the future.
  • K3Nv2 @ K3Nv2:
    Mostly why you never see TV manufacturers going post 60hz
  • BigOnYa @ BigOnYa:
    I only watch tv when i goto bed, it puts me to sleep, and I have a nas drive filled w my fav shows so i can watch them in order, commercial free. I usually watch Married w Children, or South Park
  • K3Nv2 @ K3Nv2:
    Stremio ruined my need for nas
  • BigOnYa @ BigOnYa:
    I stream from Nas to firestick, one on every tv, and use Kodi. I'm happy w it, plays everything. (I pirate/torrent shows/movies on pc, and put on nas)
  • K3Nv2 @ K3Nv2:
    Kodi repost are still pretty popular
  • BigOnYa @ BigOnYa:
    What the hell is Kodi reposts? what do you mean, or "Wut?" -xdqwerty
  • K3Nv2 @ K3Nv2:
    Google them basically web crawlers to movie sites
  • BigOnYa @ BigOnYa:
    oh you mean the 3rd party apps on Kodi, yea i know what you mean, yea there are still a few cool ones, in fact watched the new planet of the apes movie other night w wifey thru one, was good pic surprisingly, not a cam
  • BigOnYa @ BigOnYa:
    Damn, only $2.06 and free shipping. Gotta cost more for them to ship than $2.06
    +1
  • BigOnYa @ BigOnYa:
    I got my Dad a firestick for Xmas and showed him those 3rd party sites on Kodi, he loves it, all he watches anymore. He said he has got 3 letters from AT&T already about pirating, but he says f them, let them shut my internet off (He wants out of his AT&T contract anyways)
  • K3Nv2 @ K3Nv2:
    That's where stremio comes to play never got a letter about it
  • BigOnYa @ BigOnYa:
    I just use a VPN, even give him my login and password so can use it also, and he refuses, he's funny.
  • BigOnYa @ BigOnYa:
    I had to find and get him an old style flip phone even without text, cause thats what he wanted. No text, no internet, only phone calls. Old, old school.
  • Psionic Roshambo @ Psionic Roshambo:
    @BigOnYa, Lol I bought a new USB card reader thing on AliExpress last month for I think like 87 cents. Free shipping from China... It arrived it works and honestly I don't understand how it was so cheap.
    Psionic Roshambo @ Psionic Roshambo: @BigOnYa, Lol I bought a new USB card reader thing on AliExpress last month for I think like 87...