Giter VIP home page Giter VIP logo

Comments (19)

MrHuu avatar MrHuu commented on July 30, 2024 1

I've only looked at the OJ side thus far. I did look trough the SDL code.

OJ seems to heavily rely on the usage of HWPALETTE's with it's SDL_PHYSPAL and LOGPAL functions.

These don't seem to work properly on the 3DS. Not implemented or functional.

All SDL 3DS rendering is done, then copied to libctru which displays it.
Does this mean we have no valid HWSURFACE and HWPALETTE?

It seems like it. Judging on the first images, we've lost the full logical palette. No greyscale at all.

When SDL_DOUBLEBUF is enabled, only the logical (greyscale) palette is shown.
The menu is greyscale but the plasma is rendered correct, same as the sky effect in-game and the planet in the arrival scene.

The one frame drawn correct, was before 'WhiteInPaletteEffect' was called. With SDL_DOUBLEBUF enabled.

from openjazz.

carstene1ns avatar carstene1ns commented on July 30, 2024 1

I have fixed it in the SDL port. Video: https://p.f4ke.de/oNeWqX6f93-OJ-3DS-test.webm
Only needed change was telling SDL it had this capability... 😁
https://github.com/carstene1ns/devkitPro-SDL/commit/9942ec10beb0fa15f6f47aed4030f5d4dce9dac6?w=1#diff-e5c3e0072788ffbca23421fc0b9332a8R410

from openjazz.

MrHuu avatar MrHuu commented on July 30, 2024 1

It would have taken me a long time to figure that part out!
Thank you so much. This not only benefits OJ, but every HWPALETTE dependent code.

I was able to compile SDL with the changes, and OJ is working fine now!

One strange thing, when i run it through citra the planet arrival scenes are showing up fine.
However, on a real new3DS they're not shown. It goes straight to the game after the loading message.

Thanks for looking into this again!

from openjazz.

carstene1ns avatar carstene1ns commented on July 30, 2024 1

I like them, however, I do not want to use original artwork, because it is still copyrighted.
There is some fanart at least which might be used instead, since they could be licensed for inclusion in OJ, e.g.: 1, 2.

About .cia builds: I am not experienced with them, but we also provide some for EasyRPG Player.
There should not really be differences code-wise, so crash reason can be debugged.

from openjazz.

carstene1ns avatar carstene1ns commented on July 30, 2024 1

Ok, crash reason was found, debugging with rosalina is really a breeze.
I will update the 3ds branch soon.

Edit: 7b1fe71

from openjazz.

carstene1ns avatar carstene1ns commented on July 30, 2024 1

I need to investigate the slowness in menu and planet arrival scenes, but this particular issue is solved. Thanks!

from openjazz.

carstene1ns avatar carstene1ns commented on July 30, 2024

3DS port was still an experiment, that is why the Makefile has not been adapted yet to recent structure changes (e.g. removing xmp support).
SDL on 3DS is a bit hacky and unfortunately incomplete, i was never able to get it to look correctly. I had done some internal changes as well, but to no avail.
You are right about the slowness in some scenes, this can be seen on PSP as well and is some engine limitation (e.g. redrawing too much, tight loops, etc.). This is noticeable in episode selection screen as well.

from openjazz.

MrHuu avatar MrHuu commented on July 30, 2024

I've been looking into this before.. unfortunately i lost the source i was working on.
But i'm on the right track now.. i think..

At least i got the first frame to display correct, after which it goes blank. It's a start.

jazz

from openjazz.

carstene1ns avatar carstene1ns commented on July 30, 2024

@MrHuu: great 👍, do you remember if you changed SDL code or OJ code back then?

from openjazz.

carstene1ns avatar carstene1ns commented on July 30, 2024

For debugging I have disabled the palette effects, so it is easier to see actual changes.
You seem right about the lack of hardware palette, I will again dig into the SDL port.
It should be possible without hardware palette when using software surfaces, but there might be a bug somewhere.

Btw. double buffering is not needed, but you can observe the same, when you just use the HWSURFACE.

from openjazz.

MrHuu avatar MrHuu commented on July 30, 2024

As a token of appreciation, here are some assets.

A transparent icon doesn't work well, so i created these.
This actually looks nice on my 3DS. Although a .cia build crashes for me.

OJ_icon

OJ_banner

https://github.com/MrHuu/openjazz/commit/fabaac35b633d25d8b62063db3ad2b72e6cee251
This is my makefile, to use the assets and create a cia build.

Edit:
Replaced the assets, for community created content. Looks nice.

from openjazz.

MrHuu avatar MrHuu commented on July 30, 2024

Somehow GDB encounters an error connecting to my 3ds.. makes debugging quite hard for me.
Can i ask you which software you're using to debug?

I love to be able to be able to debug more efficently.

from openjazz.

carstene1ns avatar carstene1ns commented on July 30, 2024

Would be nice to have the exact error message.

I do it as follows:

  • Enable debugger in rosalina menu
  • Launch homebrew
  • Attach debugger to process (need to be quick, if it crashes early or add a breakpoint)
  • open arm-none-eabi-gdb
    • target remote <3ds-ip>:4000
    • file <brew.elf>

from openjazz.

MrHuu avatar MrHuu commented on July 30, 2024

Thanks a bunch again! After the big 'crash' where i lost most code i was working on, i somehow started to use gdb-multiarch. Which doesn't recognize arm-none-eabi correct.

With a recent luma, you're able to force debug on the next launch.
This way you don't have to be quick, if an application crashes on boot. Like we've encounterd here.

When i try to do it mannually on boot, the screens are not initialized and you have to find the debug menu on a black screen, atleast for 3dsx.

A few things which needs to be adressed for a proper 3ds port:

  • Redefine the default controls
  • Fix not dying when time has run out (is this the case on other platforms?)
  • Try to make the menu's more responsive (affects some other platforms as-well)
  • Figure out why i don't see the planet arrival scenes, on real hardware. (citra does show them).

I'll also update the assets on my git, i kind of worried the audio sample may be copywrited also.. my apologies.

from openjazz.

carstene1ns avatar carstene1ns commented on July 30, 2024

Redefine the default controls

3DS SDL port has the feature, that all buttons have also keycodes.
I need to make sure to just use the joystick api and disable keyboard.

from openjazz.

MrHuu avatar MrHuu commented on July 30, 2024

To my understanding the dpad binds to the arrow keys, and the circlepad to joystick.

So maybe disable joystick and bind the circlepad to the arrow keys.
Like nop90 explained:

SDL_N3DSKeyBind(KEY_CPAD_UP|KEY_CSTICK_UP, SDLK_UP);
SDL_N3DSKeyBind(KEY_CPAD_DOWN|KEY_CSTICK_DOWN, SDLK_DOWN);
SDL_N3DSKeyBind(KEY_CPAD_LEFT|KEY_CSTICK_LEFT, SDLK_LEFT);
SDL_N3DSKeyBind(KEY_CPAD_RIGHT|KEY_CSTICK_RIGHT, SDLK_RIGHT);

from openjazz.

carstene1ns avatar carstene1ns commented on July 30, 2024

Ideally, I should add hat support to 3DS SDL (or add d-pad as buttons), but for now I just inverted the logic: e1c3379
This uses the joystick api for all (o3ds) buttons and keyboard for the d-pad. Changing keyboard settings is disabled.

from openjazz.

MrHuu avatar MrHuu commented on July 30, 2024

When i tried to run a .3dsx compiled from the latest 3ds branch, OpenJazz failed to find the gamefiles.
It now looks for the gamefiles (datapath) in the root of the 'OpenJazz' folder, instead of 'OpenJazz/Data'.

Is this the intended behavior?

Otherwise:

  • .cia is running fine
  • network..
  • controls are fine
    nice approach btw. For me not having much experience with SDL, it give me a good insight on how to be able to use it.

Wait.. network? Didn't expect that one!
What an amazing feature from OJ, does this also work multi-platform (once finished)?

from openjazz.

MrHuu avatar MrHuu commented on July 30, 2024

While i'm already having tons of fun with OJ in it's current state. I'll eagerly await your future updates.
Your patch to the SDL lib has been merged, and it's proven to work wonderfully.

For now, i think this particular issue can be closed. Since is definitely fixed.

@carstene1ns
You're doing an amazing job, keep it up!

from openjazz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.