Homebrew Can't figure out the cause of this Citro3D crash

Pikachuk

Well-Known Member
OP
Member
Joined
Mar 19, 2016
Messages
767
Trophies
0
Age
22
Location
Bordeaux
XP
689
Country
France
Hi,
I have been working on getting the old godot 2.1 port for 3ds updated and continuing the port for it to become usable. I have been able to upgrade it to Godot 2.1.7 RC and to build it for 3DS, however I am having some trouble, and while I am not yet too experienced with Citro3D, I don't really see anything that could be the issue

here's the part where the code crashes

C++:
VertexArray *varray = memnew(VertexArray(4));
  
    Vertex v[4] = {
        {
            Vector3( p_rect.pos.x, p_rect.pos.y, 0.5f),
            Vector2( p_src_region.pos.x/p_tex_size.width, p_src_region.pos.y/p_tex_size.height)
        },{
            Vector3( p_rect.pos.x+p_rect.size.width, p_rect.pos.y, 0.5f),
            Vector2((p_src_region.pos.x+p_src_region.size.width)/p_tex_size.width, p_src_region.pos.y/p_tex_size.height)
        },{
            Vector3( p_rect.pos.x+p_rect.size.width, p_rect.pos.y+p_rect.size.height, 0.5f),
            Vector2( (p_src_region.pos.x+p_src_region.size.width)/p_tex_size.width, (p_src_region.pos.y+p_src_region.size.height)/p_tex_size.height)
        },{
            Vector3( p_rect.pos.x,p_rect.pos.y+p_rect.size.height, 0.5f),
            Vector2( p_src_region.pos.x/p_tex_size.width, (p_src_region.pos.y+p_src_region.size.height)/p_tex_size.height)
        },
    };
  
    memcpy(varray->vertices, v, sizeof(v));
  
    C3D_BufInfo* bufInfo = C3D_GetBufInfo();
    BufInfo_Init(bufInfo);
    BufInfo_Add(bufInfo, varray->vertices, sizeof(Vertex), 2, 0x10);
  
    C3D_DrawArrays(GPU_TRIANGLE_FAN, 0, 4);

the code seems to crash on C3D_DrawArrays and more specifically when C3D_DrawArrays ends up internally calling GPUCMD_AddSingleParam
Do you have any idea of the possible cause ?

if you want to see more of the code and check, the github repository is public : https://github.com/SeleDreams/godot-3ds/blob/3ds_update/drivers/3ds/citro3d/rasterizer_citro3d.cpp
 
Last edited by Pikachuk,

Pikachuk

Well-Known Member
OP
Member
Joined
Mar 19, 2016
Messages
767
Trophies
0
Age
22
Location
Bordeaux
XP
689
Country
France
I was able to fix it, I can't tell if it was due to C3D_FrameBegin or due to the C3D_Init that used a wrong value but I changed both and it doesn't crash anymore
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • SylverReZ @ SylverReZ:
    Hope they made lots of spaget
  • K3N1 @ K3N1:
    Chill dog
  • SylverReZ @ SylverReZ:
    Chilli dog
  • Skelletonike @ Skelletonike:
    Damn, I'm loving the new zelda.
  • xtremegamer @ xtremegamer:
    loving the new zelda, i started a game, it was so fucking good, so i
    am waiting on my friend to get home so we can start a new one together
  • Skelletonike @ Skelletonike:
    I just dislike that they don't let me choose the voices before the game starts. Happened with botw as well, had to change to japanese and restart.
  • K3N1 @ K3N1:
    But the important question is can you choose gender
  • Skelletonike @ Skelletonike:
    Same way you can choose Gerald's gender.
  • Skelletonike @ Skelletonike:
    *Geralt, damn autocorrect.
  • Psionic Roshambo @ Psionic Roshambo:
    But can he be trans? Lol
  • K3N1 @ K3N1:
    Zelda transforms into link
  • Psionic Roshambo @ Psionic Roshambo:
    Link I'm not the princess your looking for.... *Pulls a crying game*
  • K3N1 @ K3N1:
    *skirt up* it's exactly what I always wanted
  • Skelletonike @ Skelletonike:
    Just scanned all my zelda amiibos, took a while but didn't get anything that cool, did get the lon lon ranch hylian fabrics though.
  • Skelletonike @ Skelletonike:
    It was pretty funny when I scanned wolf link and got a shit load of meat.
  • K3N1 @ K3N1:
    @Skelletonike, btw I ran that custom for mgs4 on the deck I'm amazed it got that far in game
  • K3N1 @ K3N1:
    Plug in*
  • K3N1 @ K3N1:
    Your favorite activity
  • BentlyMods @ BentlyMods:
    My fav actvity is:

    mario-dancing.gif
  • Psionic Roshambo @ Psionic Roshambo:
    Do the Mario lol
  • K3N1 @ K3N1:
    🍑
  • K3N1 @ K3N1:
    Whoever developed Bramble was smoking that good shit fucking gnomes
    K3N1 @ K3N1: Whoever developed Bramble was smoking that good shit fucking gnomes