Working on a 3DS Port

hm, Is maybe not the real japanese Version, but it has japanese filenames ;).

Yeah, then it’s just strange because they work for me.

You can send me the link next evening. It’s late, going to bed now.

Since the current stage of the port looks quite good, what about merging the code in your main repository?

Little O.T.: I’ve found some unofficial releases of EasyRPG for PSP and NDS. Why these ones are not even mentioned in your HomePage? (And also how could it be that the PSP port works pretty good when we had so many issues with the 3DS/Wii ones?) It looks a bit strange to me.

Also, since i’m waiting for MIDI/MP3 support, what do you think about an ipotetic port to Rejuvenate hack for PSVITA? Shouldn’t be too hard to adapt the 3DS port since there is vita2dlib which has the same syntax then sf2dlib for 3DS for graphics purposes. ( wololo.net/talk/viewtopic.php?f=114&t=44763 ) and it’s quite good even if it has some minor bugs probably caused by PSVITA double buffering.

I already tried merging your code last weekend but the result was a crash and “Invalid read” in Citra. We made some big code base changes since you started working, e.g. the complete boost dependency is gone and uses C++11 stdlib instead. So I have to go step by step from 0.4.1 to HEAD what could be causing the crash.

I will finish the mp3/midi support first before working on this again.

We will of course make an official announcement on the blog & on twitter and integrate the 3DS build into our Jenkins nightly build service, will get the same love as the Wii port :smiley:

The PSP port is unmaintained since years. We made more porting attempts but it usually works (often) in PPSSPP but crashes on real hardware. The SDL2 port is also not very mature, so this probably needs a native solution like for the 3DS.
Here is the code with changes for the PSP port, just for reference: github.com/carstene1ns/easyrpg- … 2bbcd2d488
So I guess you would make some people happy with a port. I can help with cross-compiling libs as for the 3DS.

The DS port was “before my time” and it was only a map viewer. We will never see the player running on the DS, the 4 MB memory limit will be reached before the title screen.

Take note that PSP != Rejuvenate. Rejuvenate is a “native” hack for PSVITA that runs under PSM application (it enables access to 444 MHZ mode and 512 MB RAM, native 960x544 resolution, touchscreen, retrotouch etc etc). ( wololo.net/2015/06/21/vita-hack- … -homebrew/ )
Also the SDK is different (but very similar to pspsdk): github.com/vitasdk/vita-headers … clude/psp2

Opened a poll on wololo’s forum, it seems the PSVITA scene is more dead then i thought <.< : wololo.net/talk/viewtopic.php?f=113&t=45719

The main problem with Rejuvenate is that it’s locked on FW 3.51 and under. That’s maybe why it’s not used much. And you always need a PC or a phone nearby. I would however be interested on PS Vita port since the screen is a lot better + we have touch screen directly on the same screen which makes keyboard easier to use. It would be good to think about a new “native” hack that would be available for FW 3.52 and higher. I know it’s not easy but I don’t think people will wait till they can get a PSVita on 3.51 FW.

You’re completely right, me too i think PSVITA scene is dead just cause Rejuvenate is a pretty “uncomfortable” hack but, differently to 3DS, Sony learned by PSP mistakes and PSVITA it’s a really good locked console.
Rejuvenate cannot be considered also a really “full” native hack since it’s locked to 444 mhz (PSVITA CPU is much more powerful then this for what i know).

PSVita can handle Minecraft much better than the PS3 does so it should be around the PS3 specs.
Minecraft on PS3 crashes more than the PSVita version which is quite strange since it should almost be the same power.
As of 1.24 though. I didn’t test the new update.

EDIT: I got maybe a way to load ROP code but I’m pretty sure it’s already patched or that it wouldn’t even work. And since we can’t write directly to memory card like on 3DS that makes it even more useless. And it would be a bit like Rejuvenate I think.

Is there a test in TestGame for BGM_Pitch feature?

Bump

Don’t be so impatient, we have all time of the world :wink: (or at least until May when 0.4.2 comes g)

No, unfortunately there is no Pitch test in TestGame.
The simplest way to do pitching as RPG Maker wants it is to change the sample frequency (samplerate) (e.g. 44100) with the following formula: (frequency * 100.0 / pitch)

[quote=“Ghabry”]Don’t be so impatient, we have all time of the world :wink: (or at least until May when 0.4.2 comes g)

No, unfortunately there is no Pitch test in TestGame.
The simplest way to do pitching as RPG Maker wants it is to change the sample frequency (samplerate) (e.g. 44100) with the following formula: (frequency * 100.0 / pitch)[/quote]

Yeah, that was what i wanted to test infact :P, at least for ndsp it should be quite simple to implement.

https://www.sendspace.com/file/p8uutn

Replace Map0030 of the testgame and talk with the guy left to the bridge. You need a Music/Battle1.wav audio file, just rename any music you have ^^.

[quote=“Ghabry”]https://www.sendspace.com/file/p8uutn

Replace Map0030 of the testgame and talk with the guy left to the bridge. You need a Music/Battle1.wav audio file, just rename any music you have ^^.[/quote]

Is BGM_Pitch called for 50% before BGM starts? Cause i assumed this wasn’t possible.

EDIT: Ok there are A LOT of problems with Pitch:

dsp::DSP wrapper: Apparently running the test just causes a secondary thread crash meanings audio streaming get broke (so looping audio for a certain amount of samples) and you’ll be unable to close easyRPG (since CtrAudio destructor will wait for termStream becaming false and this will never happens).

csnd:SND: Even if i recalculate the starttick to be sure to not mess up with audio streaming, audio streaming is “random” (don’t know how to explain, maybe i just should make a video, i’ll do it later probably).

This is the code, maybe you can find some broken procedure i used and potentially fix this: github.com/Rinnegatamante/easyr … #L324-L346

The audio speed is correctly changed on both dsp::DSP and csnd:SND however.

EDIT2: Here’s the video: youtube.com/watch?v=dTnQ61x … e=youtu.be
And this is the original music (if you don’t know it/need it): youtube.com/watch?v=jzQTkDYuyBg

BGM_Pitch is called when the Music stays the same, this allows pitch changing during playback.
Otherwise BGM_Play is called.

I will check teh videos and code later, too busy currently.

EDIT:
Does the DSP accept all frequencies? Maybe it only allows specific ones that make sense like 22050? and crashes when you want special ones like 61500. If this is the case we will need a software resampler. Don’t worry, I need a resampler anyway to handle this at desktop systems…

EDIT2:
Your locking via “criticalPhase” is wrong. “volatile” does not guarantee atomic access. Use a mutex (svcCreateMutex, svcReleaseMutex, svcWaitSynchronisation) and check if this helps.

EDIT3: User mode locking is available through github.com/smealum/ctrulib/blob … nization.h Lightlock

DSP technically outputs at 32768 hz as samplerate but it should work with any frequency (also the problem appears with 22050 as samplerate since the original samplerate is 44100).
As for the mutual exclusion, i know it’s a pretty bad way to do so, going to change it with mutex but i’m pretty sure that’s not what causes such problem.

At least for csnd, still same problem even using a mutex for mutual exclusion. Going to push the modification right now so you can take a look to the modified ones if you find more issues.

EDIT: github.com/Rinnegatamante/easyr … 69a8520096

EDIT2: Looks like the starttick patch was broken (i was tired when i wrote it :P), i partially patched it but it isn’t really affidable yet.

EDIT3: Here’s the working patch to starttick: github.com/Rinnegatamante/easyr … ed43c2fca9

It works fine for low samplerates but with high samplerates probably audio streaming became too slow and so it get broke.
Also don’t know why, every time BGM_Pitch is called audio pause/resume. For example if BGM_Pitch is called 3 times you get:

1 call: BGM paused
2 call: BGM resumed
3 call: BGM paused

Latest build here: glassrom.5gbfree.com/3ds/easyrpg-player.3dsx

cuz I guess some people want to try it without compiling.

I’ll update at least once a day (if there is a new commit, ofc)

to see what commit the 3DSX is, check glassrom.5gbfree.com/3ds/commit.txt

@Rinnegatamante
I will think about this during the weekend, don’t have enough time for this during the week.

@gnmmarechal
That’s a good service for the WIP state of the 3DS branch, when I’m finished with merging the 3DS code into the main repo, Jenkins will offer automatic compilation & downloads.

[quote=“Ghabry”]@Rinnegatamante
I will think about this during the weekend, don’t have enough time for this during the week.

@gnmmarechal
That’s a good service for the WIP state of the 3DS branch, when I’m finished with merging the 3DS code into the main repo, Jenkins will offer automatic compilation & downloads.[/quote]
does jenkins offer direct links? Because I made a script for LPP-3DS to update the 3dsx directly on the 3DS, and it gets it from my server. It’d be awesome if the file had a static link. Or, I could keep updating the file on my server myself even after it’s merged (?). If it had a static link I’d be able to just point the updater to the 3DSX file.

I don’t think the unofficial test build really works, under any case.