Looking for all ninjHax versions between 1.1b and 2.6 gamma

Discussion in '3DS - Homebrew Development and Emulators' started by DiscostewSM, Mar 15, 2016.

  1. DiscostewSM
    OP

    DiscostewSM GBAtemp Guru

    Member
    5,028
    2,663
    Feb 10, 2009
    United States
    Sacramento, California
    I am doing a test of the different versions because a test program is not working correctly on the latest version of *hax, but does work on 1.1b. It's important that I know when it breaks so I can contact the top dogs about it, as what is being used in the test program could benefit blargSNES and possibly other emulators.

    I am running an o3DS 9.2.0.20 U (using Cubic Ninja for my tests, as my default environment is the HBL Loader via cia under emuNAND, loaded from rxTools via HomemenuHax)
     
    SLiV3R likes this.
  2. SLiV3R

    SLiV3R 3DS Friend Code: 0473-9069-2206

    Member
    2,202
    1,044
    Jan 9, 2006
    I cant help unfortunately. But this is a very good initiative! Most of the homebrews I have tried are compatible in one hax, but not in the other. And it hasn't only to do with different audio like DSP or CSND...

    Personally I have hax 1.1b, 2.1 and 2.6 atm. So a standardization is much welcomed! :)
     
  3. DiscostewSM
    OP

    DiscostewSM GBAtemp Guru

    Member
    5,028
    2,663
    Feb 10, 2009
    United States
    Sacramento, California
    This one in particular has to do with the GPU.
     
  4. UltiNaruto

    UltiNaruto GBAtemp Regular

    Member
    178
    55
    Sep 4, 2015
    France
    The reset function seems to have changed a lot. Maybe it could be this.

    ctrulib 0.2.0 :
    Code:
    void GPU_Reset(u32* gxbuf, u32* gpuBuf, u32 gpuBufSize)
    {
        int i;
        static u32 param[0x80];
        static u32 zero[0x80];
        memset(zero,  0x00, 0x80*4);
    
        GPUCMD_SetBuffer(gpuBuf, gpuBufSize, 0);
    
        GPUCMD_AddSingleParam(0x000D0080, 0x00011000);
    
        for(i=0x1;i<0xC;i++)GPUCMD_AddSingleParam(0x000F0080+i, 0x00000000);
        GPUCMD_AddSingleParam(0x000F008C, 0x00FF0000);
        GPUCMD_AddSingleParam(0x000F008D, 0x00000000);
        GPUCMD_AddSingleParam(0x000F008E, 0x00000000);
    
        for(i=0x0;i<0xF;i++)GPUCMD_AddSingleParam(0x000F0090+i, 0x00000000);
    
        GPUCMD_AddSingleParam(0x00010245, 0x00000001);
        GPUCMD_AddSingleParam(0x00010244, 0x00000000);
        GPUCMD_AddSingleParam(0x00080289, 0x80000000);
        GPUCMD_AddSingleParam(0x000B0229, 0x00000000);
    
        GPUCMD_AddSingleParam(0x000F0252, 0x00000000);
        GPUCMD_AddSingleParam(0x000F0251, 0x00000000);
        GPUCMD_AddSingleParam(0x000F0254, 0x00000000);
        GPUCMD_AddSingleParam(0x00010253, 0x00000000);
    
        GPUCMD_AddSingleParam(0x000F0242, 0x00000000);
        GPUCMD_AddSingleParam(0x000F024A, 0x00000000);
    
        GPUCMD_AddSingleParam(0x0005025E, 0x00000000);
    
        GPUCMD_Add(0x800F0101, zero, 0x00000007);
    
        GPUCMD_AddSingleParam(0x000F011F, 0x00010140);
        GPUCMD_AddSingleParam(0x000F0100, 0x00E40100);
        GPUCMD_AddSingleParam(0x000F0101, 0x01010000);
        GPUCMD_AddSingleParam(0x000F0107, 0x00001F40);
        GPUCMD_AddSingleParam(0x000F0105, 0xFF00FF10);
    
        GPUCMD_AddSingleParam(0x00010061, 0x00000003);
        GPUCMD_AddSingleParam(0x00010062, 0x00000000);
    
        GPUCMD_AddSingleParam(0x000F0065, 0x00000000);
        GPUCMD_AddSingleParam(0x000F0066, 0x00000000);
        GPUCMD_AddSingleParam(0x000F0067, 0x00000000);
    
        GPUCMD_AddSingleParam(0x00010118, 0x00000000);
        GPUCMD_AddSingleParam(0x000F011B, 0x00000000);
    
        GPUCMD_AddSingleParam(0x0007006A, 0x00FFFFFF);
    
        GPUCMD_AddSingleParam(0x000F0102, 0x00000003);
    
        GPUCMD_AddSingleParam(0x00080126, 0x03000000);
    
        GPUCMD_Add(0x800F0040, zero, 0x00000010);
    
        param[0x0]=0x1F1F1F1F;
        param[0x1]=0x1F1F1F1F;
        param[0x2]=0x1F1F1F1F;
        param[0x3]=0x1F1F1F1F;
        param[0x4]=0x1F1F1F1F;
        param[0x5]=0x1F1F1F1F;
        param[0x6]=0x1F1F1F1F;
        GPUCMD_Add(0x800F0050, param, 0x00000007);
    
        GPUCMD_AddSingleParam(0x000F0058, 0x00000100);
        GPUCMD_AddSingleParam(0x000F004C, 0x00000001);
        GPUCMD_AddSingleParam(0x000F006F, 0x00000000);
    
        GPUCMD_AddSingleParam(0x00020060, 0x00000000);
        GPUCMD_AddSingleParam(0x000C0069, 0x00020000);
    
        GPUCMD_AddSingleParam(0x000F0113, 0x0000000F);
        GPUCMD_AddSingleParam(0x000F0112, 0x0000000F);
        GPUCMD_AddSingleParam(0x000F0114, 0x00000003);
        GPUCMD_AddSingleParam(0x000F0115, 0x00000003);
    
        GPUCMD_AddSingleParam(0x000F01C5, 0x00000000);
        for(i=0;i<32;i++)GPUCMD_Add(0x800F01C8, zero, 0x00000008);
        GPUCMD_AddSingleParam(0x000F01C5, 0x00000100);
        for(i=0;i<32;i++)GPUCMD_Add(0x800F01C8, zero, 0x00000008);
        GPUCMD_AddSingleParam(0x000F01C5, 0x00000200);
        for(i=0;i<32;i++)GPUCMD_Add(0x800F01C8, zero, 0x00000008);
        GPUCMD_AddSingleParam(0x000F01C5, 0x00000300);
        for(i=0;i<32;i++)GPUCMD_Add(0x800F01C8, zero, 0x00000008);
        GPUCMD_AddSingleParam(0x000F01C5, 0x00000400);
        for(i=0;i<32;i++)GPUCMD_Add(0x800F01C8, zero, 0x00000008);
        GPUCMD_AddSingleParam(0x000F01C5, 0x00000500);
        for(i=0;i<32;i++)GPUCMD_Add(0x800F01C8, zero, 0x00000008);
        GPUCMD_AddSingleParam(0x000F01C5, 0x00000600);
        for(i=0;i<32;i++)GPUCMD_Add(0x800F01C8, zero, 0x00000008);
           
        GPUCMD_AddSingleParam(0x000F0290, 0x80000000);
        for(i=0;i<48;i++)GPUCMD_Add(0x800F0291, zero, 0x00000008);
        GPUCMD_AddSingleParam(0x000F02CB, 0x00000000);
        for(i=0;i<4;i++)GPUCMD_Add(0x000F02CC, zero, 0x00000080);
        GPUCMD_AddSingleParam(0x000F029B, 0x00000200);
    
        for(i=0;i<28;i++)GPUCMD_Add(0x000F029C, zero, 0x00000080);
    
        GPUCMD_AddSingleParam(0x000F02BF, 0x00000000);
        GPUCMD_AddSingleParam(0x000F02B1, 0x00000000);
        GPUCMD_AddSingleParam(0x000F02B2, 0x00000000);
        GPUCMD_AddSingleParam(0x000F02B3, 0x00000000);
        GPUCMD_AddSingleParam(0x000F02B4, 0x00000000);
    
        param[0x0]=0xFFFFFFFF;
        param[0x1]=0xFFFFFFFF;
        GPUCMD_Add(0x800F028B, param, 0x00000002);
    
        GPUCMD_Add(0x800F0205, zero, 0x00000024);
    
        for(i=0;i<gpuResetSequenceLength;i++)GPUCMD_AddSingleParam(gpuResetSequence[i*2],gpuResetSequence[i*2+1]);
    
        GPUCMD_Finalize();
        GPUCMD_Run(gpuBuf);
    }
    ctrulib-1.1.0 :
    Code:
    void GPU_Reset(u32* gxbuf, u32* gpuBuf, u32 gpuBufSize)
    {
        GPUCMD_SetBuffer(gpuBuf, gpuBufSize, 0);
    }
     
  5. DiscostewSM
    OP

    DiscostewSM GBAtemp Guru

    Member
    5,028
    2,663
    Feb 10, 2009
    United States
    Sacramento, California
    I'm not talking about ctrulib. I'm talking about the actual *hax that allow the homebrew in the first place, which differ in results of a binary compiled back on November 2015. However, what I will do just to make sure (when I get home today) is compile against the latest stuff, then test on *hax 1.1b. I had already tried it with 2.6 gamma, and the result were the same as with the old compile on 2.6 gamma.
     
  6. UltiNaruto

    UltiNaruto GBAtemp Regular

    Member
    178
    55
    Sep 4, 2015
    France
    I just pointed out that. I knew you weren't talking about ctrulib. But seeing how the source changed maybe *hax 2.6 handle the gpu reset differently causing the crash on *hax 2.6.
     
  7. DiscostewSM
    OP

    DiscostewSM GBAtemp Guru

    Member
    5,028
    2,663
    Feb 10, 2009
    United States
    Sacramento, California
    But it's not crashing. It's just not giving the result that is shown when running with *hax 1.1b. The result is supposed to show a cube with each of its 6 sides an arrangement of 4 colors. On 2.6 gamma, it's completely black.
     
  8. UltiNaruto

    UltiNaruto GBAtemp Regular

    Member
    178
    55
    Sep 4, 2015
    France
    But blargSnes has no problems with colors, has it? Except that some games are having black screen on boot.
     
  9. DiscostewSM
    OP

    DiscostewSM GBAtemp Guru

    Member
    5,028
    2,663
    Feb 10, 2009
    United States
    Sacramento, California
    This is a test program completely separate from blargSNES, meant to test an aspect of the 3DS's GPU. But what it works with "could" be used for blargSNES if the problematic area could be determined (which as far as I'm aware is within how the *hax accesses the hardware).

    Again, I'll test with the latest libraries when I get home and try it with the old ninjHax 1.1b to see whether it's any different from the old compiled build.
     
  10. Psi-hate

    Psi-hate GBATemp's Official Psi-Hater

    Member
    1,649
    1,047
    Dec 14, 2014
    United States
    Houston
    Looking at smealum's ninjhax 2.x source code, you should notice that it dates back since June 2014 that was back when ninjhax one was being worked on so perhaps you should look there as ninjhax 2.x is just updated 1.x . You could look at the dates and compare. Hope that helps.
     
  11. DiscostewSM
    OP

    DiscostewSM GBAtemp Guru

    Member
    5,028
    2,663
    Feb 10, 2009
    United States
    Sacramento, California
    Well, used a new compile of the test program against 1.1b, and it showed the same problem as if on 2.6 gamma, so...

    1.1b + old test = correct
    1.1b + new test = not correct
    2.6g + old test = not correct
    2.6g + new test = not correct

    The test program was made in early November of 2015, and I have the source, so I guess what I'll do next is use libraries dated from back then (including ctrulib), and try compiling it. If it works (as the 1.1b + old test shows), then I'll go through each commit made to the libraries by each new date, and see when it changes from displaying correctly to displaying incorrectly. That should give me an indication of what the problem might be, and a point of reference, where I can then refer it to the higher-ups of *hax and see if it's something that might have been overlooked in later builds of the homebrew exploit.
     
    SLiV3R likes this.