DC-SWAT Forum
Development of a new menu - Версия для печати

+- DC-SWAT Forum (http://www.dc-swat.ru/forum)
+-- Форум: DreamShell (/forum-3.html)
+--- Форум: Programming (/forum-28.html)
+--- Тема: Development of a new menu (/thread-4089.html)

Страниц: 1 2 3


Development of a new menu - VeraBecker - 05.06.2024 04:09

Hi Swat,

I made a menu with tsunami libraries by Dan Potter, I can create the cdi and test it in the emulator but when I try to create an application in DreamShell it hits and errors, because they are "cpp" files that I have not been able to compile it, I do it with:

kos-c++ -o $(TARGET) $(OBJS) -ltsunami -lstdc++ -lparallax -lpng -ljpeg -lkmg -lz -lkosutils -lm

(I put the tsunami library and compiled it inside the libs folder, I had no problems with this, it was fast.)

but dreamshell only uses C Sad, can you help me?

I already moved it to the Makefile application and Makefile.loadable many times.

This is the menu, it is a prototype.
https://youtu.be/cdckXFmu0Mg


RE: Development of a new menu - SWAT - 05.06.2024 06:16

Nice! Try link -lstdc++ to application module.

Add to module Makefile:
PHP код:
LIBS=-ltsunami -lstdc++ 

Other libs already linked to Core.


RE: Development of a new menu - VeraBecker - 05.06.2024 22:08

(05.06.2024 06:16)SWAT писал(а):  Nice! Try link -lstdc++ to application module.

Add to module Makefile:
PHP код:
LIBS=-ltsunami -lstdc++ 

Other libs already linked to Core.

Thanks, I was already scared, I thought you deleted the message, ok, I'll try it today.


RE: Development of a new menu - VeraBecker - 06.06.2024 05:42

Hi Swat, I was already able to compile it but I had to add an argument -r -Wl (I really don't know what it's for), here:

Код:
ifndef NO_LD_DEBUG
    #$(KOS_CC) -g -ml -m4-single-only -O2 -g -Wl, -Ttext=0x00000000 -e _start -nostartfiles -nodefaultlibs -o dbg-$(TARGET) $(OBJS) $(KOS_LIB_PATHS) - Wl,--start-group $(LIBS) $(DBG_LIBS) $(DBG_GCC_LIB) -Wl,--end-group
     $(KOS_CC) -g -ml -m4-single-only -O2 -g -Wl,-r -Wl,-Ttext=0x00000000 -e _start -nostartfiles -nodefaultlibs -o dbg-$(TARGET) $(OBJS) $ (KOS_LIB_PATHS) -Wl,--start-group $(LIBS) $(DBG_LIBS) $(DBG_GCC_LIB) -Wl,--end-group
endif

But now it shows this error when opening the app:
symbol '___cxa_atexit' is undefined

what is that?

I made a video
https://youtu.be/XgMAMO5B7Io


RE: Development of a new menu - SWAT - 06.06.2024 15:08

-r seems just ignore this error on link test of module.
Try add to module Makefile:
PHP код:
GCC_LIB=-lgcc 



RE: Development of a new menu - VeraBecker - 06.06.2024 17:16

(06.06.2024 15:08)SWAT писал(а):  -r seems just ignore this error on link test of module.
Try add to module Makefile:
PHP код:
GCC_LIB=-lgcc 


I already set the variable in makefile
GCC_LIB=-lgcc

But I went back to the beginning, I removed the "-r" and I got all those errors, here comes the _atexit one

It doesn't let me use std::string and so on, I can define it in the class but when I use it in the constructor it shows me all these errors:

Inside the class:
std::string image_file;

Inside the constructor
image_file = "ok";

If I remove the line from image_file = "ok"; build correctly.

Video:
https://youtu.be/Ujw685Koubc

Код:
/opt/toolchains/dc/sh-elf/bin/sh-elf-gcc -g -ml -m4-single-only -O2 -g -Wl,-Ttext=0x00000000 -e _start -nostartfiles -nodefaultlibs -o dbg-app_games.klf module.o ItemMenuFake.o exports.o -L/usr/local/dc/kos/kos/lib/dreamcast -L/usr/local/dc/kos/kos/addons/lib/dreamcast -L/usr/local/dc/kos/kos/../kos-ports/lib -L/usr/local/dc/kos/kos/ds/sdk/lib -L/usr/local/dc/kos/kos/ds/sdk/lib -Wl,--start-group -lstdc++ -ltsunami -lds -lkallisti_exports -lgcc -Wl,--end-group
/opt/toolchains/dc/sh-elf/lib/gcc/sh-elf/13.2.0/../../../../sh-elf/bin/ld: /opt/toolchains/dc/sh-elf/lib/gcc/sh-elf/13.2.0/../../../../sh-elf/lib/libstdc++.a(eh_globals.o): in function `_GLOBAL__sub_I__ZN17__eh_globals_init7_S_initE':
(.text.startup._GLOBAL__sub_I__ZN17__eh_globals_init7_S_initE+0x34): undefined reference to `__dso_handle'
/opt/toolchains/dc/sh-elf/lib/gcc/sh-elf/13.2.0/../../../../sh-elf/bin/ld: (.text.startup._GLOBAL__sub_I__ZN17__eh_globals_init7_S_initE+0x3c): undefined reference to `__cxa_atexit'
/opt/toolchains/dc/sh-elf/lib/gcc/sh-elf/13.2.0/../../../../sh-elf/bin/ld: /opt/toolchains/dc/sh-elf/lib/gcc/sh-elf/13.2.0/../../../../sh-elf/lib/libstdc++.a(random.o): in function `std::(anonymous namespace)::__libc_getentropy(void*)':
(.text._ZNSt12_GLOBAL__N_117__libc_getentropyEPv+0x24): undefined reference to `getentropy'
/opt/toolchains/dc/sh-elf/lib/gcc/sh-elf/13.2.0/../../../../sh-elf/bin/ld: /opt/toolchains/dc/sh-elf/lib/gcc/sh-elf/13.2.0/../../../../sh-elf/lib/libstdc++.a(random.o): in function `std::(anonymous namespace)::__libc_arc4random(void*)':
(.text._ZNSt12_GLOBAL__N_117__libc_arc4randomEPv+0x8): undefined reference to `arc4random'
/opt/toolchains/dc/sh-elf/lib/gcc/sh-elf/13.2.0/../../../../sh-elf/bin/ld: /opt/toolchains/dc/sh-elf/lib/gcc/sh-elf/13.2.0/../../../../sh-elf/lib/libstdc++.a(random.o): in function `std::random_device::_M_init(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
(.text._ZNSt13random_device7_M_initERKNSt7__cxx1112basic_stringIcSt11char_traits​IcESaIcEEE+0xa4): undefined reference to `getentropy'
/opt/toolchains/dc/sh-elf/lib/gcc/sh-elf/13.2.0/../../../../sh-elf/bin/ld: dbg-app_games.klf: hidden symbol `___dso_handle' isn't defined
/opt/toolchains/dc/sh-elf/lib/gcc/sh-elf/13.2.0/../../../../sh-elf/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make[1]: *** [../../../sdk/Makefile.loadable:116: app_games.klf] Error 1
make[1]: Leaving directory '/usr/local/dc/kos/kos/ds/applications/games/modules'
make: *** [/usr/local/dc/kos/kos/Makefile.rules:57: _dir_modules] Error 2



RE: Development of a new menu - SWAT - 06.06.2024 19:24

Well, apparently still need to work with the Core.
I've never used C++ in modules so it’s not surprising that there are issues with this.


RE: Development of a new menu - VeraBecker - 06.06.2024 19:50

(06.06.2024 19:24)SWAT писал(а):  Well, apparently still need to work with the Core.
I've never used C++ in modules so it’s not surprising that there are issues with this.


What alternative can be done?

In the LIB folder include tsunami (I already have it) and include my project to export only the methods to use them in C in applications?


RE: Development of a new menu - SWAT - 08.06.2024 08:22

Yes you can link libtsunami to Core and add new export functions in C style as I do for SDL GUI library that used in applications.
Or just doesn't use C++ and tsunami, look on it implementation and write the same on C and PVR or Parallax API.
But really, if you do C-style API for libtsunami it will be great for future usage in another apps. Also I will try to solve the C++ issues in modules someday.


RE: Development of a new menu - VeraBecker - 08.06.2024 08:55

Excellent, a few hours ago I started transferring it to C, based on SDL, I saw that you had already created something similar.

I started making the menu with parallax but when I found tsunami I saw that it was much simpler and already had functions for making animations and drawing.

These days I will tell you how the conversion to C was.

thanks Swat!


RE: Development of a new menu - VeraBecker - 16.06.2024 08:23

Hi Swat,

I already passed the tsunami libraries, but something strange happens, there is a flicker on the screen, do I have to deactivate the SDL or something like that?

Here video:
https://youtu.be/BvOLpi46UWE

Thanks!


RE: Development of a new menu - VeraBecker - 16.06.2024 19:38

(16.06.2024 08:23)VeraBecker писал(а):  Hi Swat,

I already passed the tsunami libraries, but something strange happens, there is a flicker on the screen, do I have to deactivate the SDL or something like that?

Here video:
https://youtu.be/BvOLpi46UWE

Thanks!


Swat, I already could, but I think I did it wrong, execute the function ShutdownVideoThread(); , and now the flickering is removed and it works very well, can I use that function or what is the right way?

New Video:
https://youtu.be/umXoVucuZeM


RE: Development of a new menu - SWAT - 17.06.2024 07:39

Great!
Look for DrawHandler, EventHandler and AddEvent here:
https://github.com/DC-SWAT/DreamShell/blob/master/modules/dreameye/preview.c

In DreamShell video in separate thread, so you need shutdown DS video or integrate.
Preview of Dreameye as an example as it is integrated into DS video.
You can made base UI in XML and use tsunami for covers and animation only, as I do in Dreameye app for camera preview.


RE: Development of a new menu - VeraBecker - 17.06.2024 08:27

Swat, look at please,

Big Grin !!! very happy!!

https://youtu.be/BmPtrp4BELg

Yes, in DreamEye I saw what you told me about the events, but due to the free time I have I think I will do it later Wink


RE: Development of a new menu - SWAT - 17.06.2024 09:53

Good job, keep up the good work!
If you need immediate help, you can get it on Discord.


RE: Development of a new menu - VeraBecker - 24.06.2024 01:01

Hi Swat!,

I already have the new menu ready, but now I need tests, please check:

https://youtu.be/0OeT9N7UlQs?si=RUp30_4RLtmHRpKV


RE: Development of a new menu - pcwzrd13 - 24.06.2024 01:33

The menu looks really nice!

A couple suggestions:

One thing that would be cool is if you could have it play the CDDA music when a game is selected like with the regular ISO Loader. Video previews like RetroDream would be cool too but I'm sure that would be a lot more work.

One other thing would be the ability to set "favorite" games. Maybe press a button on a game to add it to favorites and you can have a view that only shows favorite games. You could put a star icon on the cover to show that the game is favorited.

If you're looking for testers, I'll be happy to help. Smile


RE: Development of a new menu - VeraBecker - 24.06.2024 01:48

(24.06.2024 01:33)pcwzrd13 писал(а):  The menu looks really nice!

A couple suggestions:

One thing that would be cool is if you could have it play the CDDA music when a game is selected like with the regular ISO Loader. Video previews like RetroDream would be cool too but I'm sure that would be a lot more work.

One other thing would be the ability to set "favorite" games. Maybe press a button on a game to add it to favorites and you can have a view that only shows favorite games. You could put a star icon on the cover to show that the game is favorited.

If you're looking for testers, I'll be happy to help. Smile

Thank you, very good ideas, little by little I will incorporate what I can.


RE: Development of a new menu - VeraBecker - 24.06.2024 08:09

(24.06.2024 01:48)VeraBecker писал(а):  Thank you, very good ideas, little by little I will incorporate what I can.


Look at please:
https://youtu.be/J7PfA45wNYs?si=OO6JRPKSLfkNw6Zj


RE: Development of a new menu - pcwzrd13 - 24.06.2024 16:36

That was quick! Haha! Very nice!