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

Pikachuk

Well-Known Member
OP
Member
Joined
Mar 19, 2016
Messages
768
Trophies
0
Age
23
Location
Bordeaux
XP
753
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
768
Trophies
0
Age
23
Location
Bordeaux
XP
753
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
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • K3Nv2 @ K3Nv2:
    Waste of the 128kb they take
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Tiger handhelds are good for one thing.... Occupying space in a landfill
  • K3Nv2 @ K3Nv2:
    They make good burning plastic
  • BigOnYa @ BigOnYa:
    Makes me wonder if the Pi5 can play PS2? If there's even a core for it yet.
  • K3Nv2 @ K3Nv2:
    Pi5 should be able to do ps2
  • Psionic Roshambo @ Psionic Roshambo:
    Try Dragon Quest VIII it ran perfectly on a core 2 Duo I had
  • Psionic Roshambo @ Psionic Roshambo:
    Easiest game to run I found
  • K3Nv2 @ K3Nv2:
    Ps2 emulation is cake compared to 3 years ago
  • Psionic Roshambo @ Psionic Roshambo:
    Hardest is probably Gran Turismo 4
  • Psionic Roshambo @ Psionic Roshambo:
    It's much better now yes but Gran Turismo 4 is still the hardest one to emulate that I have in my collection
  • Psionic Roshambo @ Psionic Roshambo:
    Runs perfectly fine but it's as if I can feel it always on the boarder line of dropping a frame lol
  • BigOnYa @ BigOnYa:
    I ordered a spin ball couple days ago to add to my arcade cabinet, will be nice for games like golden tee, or bowling
  • Psionic Roshambo @ Psionic Roshambo:
    I always wanted a controller for like Ikari Warriors, Time Soldiers, Heavy Barrel, Forgotten Worlds games like those
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Not even sure what to call that controller
  • Xdqwerty @ Xdqwerty:
    an online friend I've known since 2021 left me :( bc my attitude is "cutty"
  • Psionic Roshambo @ Psionic Roshambo:
    Sylvester Stallone should have played Kyle Reese lol Arnold still as the Terminator
  • BakerMan @ BakerMan:
    TF DOES "CUTTY" EVEN MEAN?
  • Xdqwerty @ Xdqwerty:
    @BakerMan, he is peruvian so it's probably an idiom
  • BigOnYa @ BigOnYa:
    I thought Cutty was a west coast rapper
  • K3Nv2 @ K3Nv2:
    Cutter
  • Psionic Roshambo @ Psionic Roshambo:
    Dr Cutty
  • Psionic Roshambo @ Psionic Roshambo:
    It's from House MD lol
  • K3Nv2 @ K3Nv2:
    I took too much viagra Dr cutty oh wait
    +1
  • Ligudink @ Ligudink:
    What in the goddamn
    Ligudink @ Ligudink: What in the goddamn