Citra - Unofficial \ Chinese builds discussion

Discussion in '3DS - Homebrew Development and Emulators' started by masaki88, Jun 23, 2016.

  1. drwhojan

    drwhojan GBAtemp Psycho!

    Member
    8
    Jul 14, 2009
    United Kingdom
    Where I Am!
    @wwylele Sorry but my account was flagged, So Hidden.

    Just to cadge up.. Yes first you will need that Pipe3 three branch to do this + Some fixes..

    Like this Audio hle.cpp
    Code:
    void DspHle::Impl::PipeWrite(DspPipe pipe_number, const std::vector<u8>& buffer) {
        switch (pipe_number) {
        case DspPipe::Audio: {
            if (buffer.size() != 4) {
                std::copy(buffer.begin(), buffer.end(),
                          std::back_inserter(pipe_data[static_cast<std::size_t>(DspPipe::Audio)]));
                LOG_ERROR(Audio_DSP, "DspPipe::Audio: Unexpected buffer length {} was written",
                          buffer.size());
            case DspPipe::Binary: {
                if (buffer.size() != 8) {
                    std::copy(buffer.begin(), buffer.end(),
                              std::back_inserter(pipe_data[static_cast<std::size_t>(DspPipe::Binary)]));
                    return;
                }
            }
            }
    
    I wonder how we implement ?, This is for the Pro's side of it like yourself..
    Code:
    DSP_DSP::ReadPipeIfPossible:456: channel=3, peer=0, size=0x0020, pipe_readable_size=0x0020
    Into Citra Test

    Ok We Wright in dsp_dsp.cpp like this

    Code:
    void DSP_DSP::ReadPipeIfPossible(Kernel::HLERequestContext& ctx) {
        IPC::RequestParser rp(ctx, 0x10, 3, 0);
        const u32 channel = rp.Pop<u32>();
        const u32 peer = rp.Pop<u32>();
        const u16 size = rp.Pop<u16>();
        auto pipe_readable = rp.PopStaticBuffer();
    
        const DspPipe pipe = static_cast<DspPipe>(channel);
        const u16 pipe_readable_size = static_cast<u16>(Core:D SP().GetPipeReadableSize(pipe));
    
        std::vector<u8> pipe_buffer;
        if (pipe_readable_size >= size)
            pipe_buffer = Core:D SP().PipeRead(pipe, size);
    
        switch (pipe) {
        case DspPipe::Audio:
            ASSERT(pipe_readable.size() >= 4);
            pipe_readable[0020] = 0020;
            break;
        }
    
        Core:D SP().PipeRead(pipe, pipe_readable);
    
    ---------------------
    Leaving pipe_readable as error this needs to be written into Audio of hle.cpp and hle.h

    This was recorded of wwylele teakra from Pokemon X/Y

    Might be Audio as dsp_dsp.h says
    Code:
        /**
         * DSP_DSP::ReadPipeIfPossible service function
         *      A pipe is a means of communication between the ARM11 and DSP that occurs on
         *      hardware by writing to/reading from the DSP registers at 0x10203000.
         *      Pipes are used for initialisation. See also DspInterface:P ipeRead.
         *  Inputs:
         *      0 : Header Code[0x001000C0]
         *      1 : Channel (0 - 7 0D ebug from DSP 1D -DMA 2:audio 3:binary 4-7: free ?)
         *      2 : Peer (0 = from DSP, 1 = from ARM)
         *      3 : u16, Size
         *      0x41 : Virtual address of memory buffer to write pipe contents to
    
    Code:
    DSP_DSP::WriteProcessPipe:372: channel=3, size=0x20, buffer_size=20
    and
    DSP::DSP_DSP::WriteProcessPipe:372: channel=2, size=0x4, buffer_size=4
    
    So
    Code:
        switch (pipe) {
        case DspPipe::Binary:
            ASSERT(buffer.size() >= 8);
            buffer[4] = 4;
            buffer[5] = 0;
            buffer[6] = 0;
            buffer[7] = 0;
            buffer[20] = 20;
            break;
        }
    
    Is Correct, Strange how the size = the buffer numbers .

    Ps, Can you also please re-base you're teakra into latest master and thanks ?
     

    Attached Files:

    Last edited by drwhojan, Nov 6, 2018
    JPXZ and xmeee978 like this.
  2. warweeny

    warweeny GBAtemp Regular

    Member
    4
    Apr 25, 2011
    Netherlands
    The problem is, when i change that %, it does not change.
     
  3. wwylele

    wwylele GBAtemp Regular

    Member
    3
    Oct 17, 2015
    China
    @drwhojan You haven't answered my question: did you actually managed to pass the famous XY intro freeze, or you just assumed that you can?

    I won't read your non-sense until you answer this question.
     
    drwhojan likes this.
  4. drwhojan

    drwhojan GBAtemp Psycho!

    Member
    8
    Jul 14, 2009
    United Kingdom
    Where I Am!
    EDIT: It might not be the same intro you where thinking off, this bypass the freeze just where the music dose kick on you're branch, Not where both boy are girl walks into the window starting a new game.

    I was looking at your branch on the audio/music on this.. so its picking up what could be the music at 0020 , just like 4/1 are correct at 4/4 is the extra sounds at the start of this game..

    Found here between the two video with and without
    https://gbatemp.net/threads/citra-unofficial-chinese-builds-discussion.431974/page-445#post-8274023


    buffer[20] = 20; bypassed you're freeze after the EDIT "Start into the Freeze at Music Part", You only had one msvc that did get compiled as they was a mingw issue at the time, but other last PR you had merged with local gitgui and msvc2017 compile .

    BTW you will find only one
    size=0x0020, pipe_readable_size=0x0020

    Until you bypass the after EDIT "Start of game" into freeze then they will be "two lots of this" written into the citra log, where the Music dose kick in..

    I need a new PR into a new master as it was some time ago when I did this last, I need a new screen shot with cmd command in background.

    But that print in cmd can show the speed down some what.

    — Posts automatically merged - Please don't double post! —

    Ok it will bypass the freeze off ^
    https://ci.appveyor.com/project/wwylele/citra/build/1.0.870/job/0i8x38pppudsqprk/artifacts

    54345.

    — Posts automatically merged - Please don't double post! —

    And wtf is this non-sense shit ?.. lol well "can't make an omelette without breaking some eggs" as old saying goes..

    It was mentioned buy others from github that having the missing music should fix the freeze after intro..
     
    Last edited by drwhojan, Nov 7, 2018 - Reason: info added and image.
  5. drwhojan

    drwhojan GBAtemp Psycho!

    Member
    8
    Jul 14, 2009
    United Kingdom
    Where I Am!
    Last edited by drwhojan, Nov 8, 2018 - Reason: added info
    xmeee978 likes this.
  6. player594

    player594 GBAtemp Fan

    Member
    4
    Dec 25, 2006
    United States
    Dude, dev or not, that was an uncalled for insult to drwhojan. Give respect if you want respect in return. Stop acting like an elitist.

    Sent from my SM-G955U using Tapatalk
     
  7. drwhojan

    drwhojan GBAtemp Psycho!

    Member
    8
    Jul 14, 2009
    United Kingdom
    Where I Am!
    Yes true, but some what was my fault as I meant freeze by where the music kicks in on his branch and not where it starts a new game freeze, I should have worded it better.

    Not that its getting little hard for me to think correctly lately, 27 years of T1 Diabetes is starting to get at me a bit with the eyes / memory and goes a little down hill after over 40 for sure, Could possible go blandness in one, As have to go for eye laser surgery, O well is life.

    It just sends my mood down a little for a day are so, but will pick back up again this sort of thing from people.

    Thanks for you're kind words mate!.
     
    Last edited by drwhojan, Nov 9, 2018 - Reason: added info
    Sedhaild likes this.
  8. drwhojan

    drwhojan GBAtemp Psycho!

    Member
    8
    Jul 14, 2009
    United Kingdom
    Where I Am!
    Ok now not working ^ one of the new branches broke it..
     
  9. wwylele

    wwylele GBAtemp Regular

    Member
    3
    Oct 17, 2015
    China
    First of all, I need to clarify a point: I have already given up getting respect from drwhojan. If you look back the history of this thread, I, along with other devs, have been trying to pay respect to him (and everyone), but what I got is either equivocate reply, ignoring, and disrespect on the open source spirit. I do understand and highly agree with you on the truth of "Give respect if you want respect in return" - and also in turn, if I don't want ones respect, I don't have to pay respect to them any more.

    Second, even though I don't expect respect, I think my "anti-insult" subconscious functionality was still working when I made that post, because what I described, although probably too straight forward (because I figured euphemism didn't work for him), was merely describing and asking for facts. Let me analyze my own words for you:

    "You haven't answered my question"
    You probably didn't know this so I don't blame you. I have asked the same question below on github (probably twice) but he hadn't answered it; instead he kept turning aside from topic to something else

    "did you actually managed to pass the famous XY intro freeze, or you just assumed that you can"
    This was asking to clarify his previous (again) equivocate comment "this fixes the intro freeze", and I enumerated the two possibilities that I can think of when one seems like describing a "near-fact": tested or assumed.

    "I won't read your non-sense"
    OK I lied a little: because I indeed first read some of his other material on github, I already knew that what he wrote was non-sense. The word "non-sense" here describes a technical state, where what he said or did didn't make sense by logic, and/or by some simple hacking knowledge. I know the "hacking knowledge" is probably too much to say here (I can continue if you want to read), so let me just give one simple example of non-sense he did: he opened a PR on github to the master branch, in order to fix a bug that exists in MY fork but doesn't exist in the master branch. (See the post above https://gbatemp.net/threads/citra-unofficial-chinese-builds-discussion.431974/page-450#post-8366749)

    "until you answer this question"
    This is for the sake of fairness. He kept asking me to read (and accept) what he wrote, while refusing to directly answer my question (which came from me reading his stuff). It is unfair to me if I have to accept his thing without being able to question it.

    As you can see, I managed to make my words insult-free (even if I intended to insult). If one still call this insult and say I was acting like an elitist, then they are the one who find themselves weak and who admit that who lower themselves in front of me. If you are not such person, stop being hypocritical to help those who treat themselves weak, and do real talk with me. I am even fine if you "act like an elitist" over me. What I am not fine with is acting weak and attacking me from moral high ground.
     
    Last edited by wwylele, Nov 9, 2018
    Sedhaild and drwhojan like this.
  10. drwhojan

    drwhojan GBAtemp Psycho!

    Member
    8
    Jul 14, 2009
    United Kingdom
    Where I Am!
    @wwylele It did not bypass the famous freeze.

    Only the freeze on your Teakra branch where the "Music" kicks in, that gives a interesting read of

    DSP: : DSP_DSP::WriteProcessPipe:372: channel=2, size=0x4, buffer_size=4
    DSP_DSP::WriteProcessPipe:372: channel=3, size=0x20, buffer_size=20

    And
    DSP_DSP::ReadPipeIfPossible:456: channel=3, peer=0, size=0x0020, pipe_readable_size=0x0020

    By implementing in DSP_DSP

    buffer[4] = 4; = Extra sounds fix in pm x/y
    buffer[20] = 20; = Fixes the Freeze in your Teakra Branch where the "Music" kicks in

    Then they are two lots of
    DSP_DSP::ReadPipeIfPossible:456: channel=3, peer=0, size=0x0020, pipe_readable_size=0x0020

    pipe_readable[0020] = 0020; = Unknown..

    Written into the citra_log.txt log

    So its it possible on a test ?, If written into audio three locations,that ReadPipeIfPossible size and pipe_readable could fix the Music either Audio are Binary it seems to be mostly working on the Binary..

    I hope to try and make it clear ?

    PS: I Don't care if it's a Hack for Now, This is for only local Testing..
     
    Last edited by drwhojan, Nov 9, 2018 - Reason: Added Info.
  11. drwhojan

    drwhojan GBAtemp Psycho!

    Member
    8
    Jul 14, 2009
    United Kingdom
    Where I Am!
    EDIT: Removed.
     

    Attached Files:

    Last edited by drwhojan, Nov 10, 2018 - Reason: Not Needed.
  12. drwhojan

    drwhojan GBAtemp Psycho!

    Member
    8
    Jul 14, 2009
    United Kingdom
    Where I Am!
    @wwylele Fire Emblem Warriors Fixed and Broken by #4392
    https://github.com/citra-emu/citra/pull/4392

    Needs Investigating ? :wtf: , Must have been some think added much later time...

    Gone into Panic mode.
    ------

    When tested it on a Working Build it dose CreateMemoryBlock

    Code:
    Kernel.SVC <Warning> core\hle\kernel\svc.cpp:Kernel::CreateMemoryBlock:1169: called addr=0x005FC000
    Kernel.SVC <Warning> core\hle\kernel\svc.cpp:Kernel::CreateMemoryBlock:1169: called addr=0x005FE000
    Kernel.SVC <Warning> core\hle\kernel\svc.cpp:Kernel::CreateMemoryBlock:1169: called addr=0x005FD000
    Service.IR <Info> core\hle\service\ir\ir_user.cpp:Service::IR::IR_USER::InitializeIrNopShared:258: called, shared_buff_size=4096, recv_buff_size=82, recv_buff_packet_count=1, send_buff_size=18, send_buff_packet_count=1, baud_rate=4
    
    For This Game ^
     
    Last edited by drwhojan, Nov 10, 2018 - Reason: Added Info.
  13. player594

    player594 GBAtemp Fan

    Member
    4
    Dec 25, 2006
    United States
    Still sound like an elitist, but whatever.
     
  14. wwylele

    wwylele GBAtemp Regular

    Member
    3
    Oct 17, 2015
    China
    What is the working build number?
     
  15. drwhojan

    drwhojan GBAtemp Psycho!

    Member
    8
    Jul 14, 2009
    United Kingdom
    Where I Am!
    I need more time for checking, I gone though all citra canary builds from 10 days ago non worked.

    It was one of my local msvc builds with you're PR merged, The working one must have bean some think I added too it..

    Just ones of though's wtf I did sort of thing.. Will figure it out and post back soon.

    EDIT: Recompiling.
     
    Last edited by drwhojan, Nov 10, 2018
  16. drwhojan

    drwhojan GBAtemp Psycho!

    Member
    8
    Jul 14, 2009
    United Kingdom
    Where I Am!
    Forget it ^, It was still that old shit in there - That did fix it.

    kernal / memory.cpp Allocating memory o3ds 5 to 6 n3ds

    And adding new FCRAM_N3DS_SIZE

    Code:
        // New 3DS layouts
        {0x07C00000, 0x06400000, 0x02000000}, // 6
        {0x0B200000, 0x02E00000, 0x02000000}, // 7
    };
    
    void KernelSystem::MemoryInit(u32 mem_type) {
        // TODO(yuriks): On the n3DS, all o3DS configurations (<=5) are forced to 6 instead.
        ASSERT_MSG(mem_type <= 6, "New 3DS memory");
        ASSERT(mem_type != 1);
    
        // The kernel allocation regions (APPLICATION, SYSTEM and BASE) are laid out in sequence, with
        // the sizes specified in the memory_region_sizes table.
        VAddr base = 0;
        for (int i = 0; i < 3; ++i) {
            memory_regions[i].Reset(base, memory_region_sizes[mem_type][i]);
    
            base += memory_regions[i].size;
        }
    
        // We must've allocated the entire FCRAM by the end
        ASSERT(base == Memory::FCRAM_N3DS_SIZE);
    
    kernal / kernal.cpp -> Same Memory of 6 n3ds / Why can't we keep "system_mode" ? and place the 6 n3ds else where..

    EDIT: Yes we can / MemoryInit(system_mode = 6);

    Code:
    /// Initialize the kernel
    KernelSystem::KernelSystem(u32 system_mode) {
        MemoryInit(6);
    
     
    Last edited by drwhojan, Nov 11, 2018 - Reason: typo fix
    JPXZ and xmeee978 like this.
  17. dissidius

    dissidius Newbie

    Newcomer
    1
    Nov 25, 2009
    Albania
    hello everyone
    can anyone redirect me to the best build to play jrpgs like fire emblem awakening for excample???
    if possible obviously :)
    Best Regards!
     
  18. valentinvanelslande

    valentinvanelslande GBAtemp Regular

    Member
    4
    Jul 8, 2017
    Mexico
    use my fork: https://valentinvanelslande.github.io/citra/
    use the updater to always have the latest version.
     
    dissidius, JPXZ and Sedhaild like this.
  19. JPXZ

    JPXZ GBAtemp Regular

    Member
    2
    Dec 18, 2017
    Brazil
  20. Sedhaild

    Sedhaild Newbie

    Newcomer
    1
    Oct 30, 2018
    Ecuador
Loading...