From a2ae2487d55a9bb97f0a509b02251f56dd3ede88 Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Sat, 28 Oct 2023 13:52:37 +1000 Subject: [PATCH] zesarux: bump version --- .../zesarux/patches/zesarux-10.1.patchset | 309 --------------- .../zesarux/patches/zesarux-10.10.patchset | 374 ++++++++++++++++++ ...sarux-10.1.recipe => zesarux-10.10.recipe} | 32 +- 3 files changed, 395 insertions(+), 320 deletions(-) delete mode 100644 app-emulation/zesarux/patches/zesarux-10.1.patchset create mode 100644 app-emulation/zesarux/patches/zesarux-10.10.patchset rename app-emulation/zesarux/{zesarux-10.1.recipe => zesarux-10.10.recipe} (71%) diff --git a/app-emulation/zesarux/patches/zesarux-10.1.patchset b/app-emulation/zesarux/patches/zesarux-10.1.patchset deleted file mode 100644 index 44751ede6..000000000 --- a/app-emulation/zesarux/patches/zesarux-10.1.patchset +++ /dev/null @@ -1,309 +0,0 @@ -From 06ab6ce44d1248abc7b30394d89cfebbb9be0600 Mon Sep 17 00:00:00 2001 -From: Gerasim Troeglazov <3dEyes@gmail.com> -Date: Sat, 14 May 2022 21:40:16 +1000 -Subject: Fixes for Haiku - - -diff --git a/src/configure b/src/configure -index fc9e4a0..e6b4f59 100755 ---- a/src/configure -+++ b/src/configure -@@ -1691,7 +1691,7 @@ clean: - rm -f ZEsarUX_windows-\$(EMULATOR_VERSION).zip - rm -f ZEsarUX_extras-\$(EMULATOR_VERSION).zip - --COMMONFILES=ACKNOWLEDGEMENTS LICENSE LICENSES_info licenses Changelog TODO* README HISTORY FEATURES FEATURES_es EXCLUSIVEFEATURES INSTALL INSTALLWINDOWS ALTERNATEROMS INCLUDEDTAPES DONATE FAQ *.odt mantransfev3.bin *.rom zxuno.flash tbblue.mmc speech_filters my_soft docs zesarux.mp3 zesarux.xcf editionnamegame.* bin_sprite_to_c.sh keyboard_*.bmp zesarux.pdf -+COMMONFILES=ACKNOWLEDGEMENTS LICENSE LICENSES_info licenses Changelog TODO* README HISTORY FEATURES FEATURES_es EXCLUSIVEFEATURES INSTALL INSTALLWINDOWS ALTERNATEROMS INCLUDEDTAPES DONATE FAQ *.odt mantransfev3.bin *.rom zxuno.flash tbblue.mmc speech_filters my_soft docs zesarux.mp3 zesarux.xcf editionnamegame.* bin_sprite_to_c.sh keyboard_*.bmp cursor.bmp zesarux.pdf - - ONLYSOURCEFILES=macos *.c *.m *.h *.tpl DEVELOPMENT CHECKLIST configure generate_install_sh.sh join_tzx.sh testsound.sh txt_to_basic_lines.sh automatic_tests.sh zxuno_roms_bin_a_flash.sh *.asm benchmark_*.txt current_checklist.txt patches prism_change_boot.txt - -diff --git a/src/cpu.c b/src/cpu.c -index 7f20066..9f1b6fc 100644 ---- a/src/cpu.c -+++ b/src/cpu.c -@@ -272,8 +272,13 @@ driver_struct audio_driver_array[MAX_SCR_INIT]; - int num_audio_driver_array=0; - - //Los inicializamos a cadena vacia... No poner NULL, dado que hay varios strcmp que se comparan contra esto -+#ifdef __HAIKU__ -+char *driver_screen="sdl"; -+char *driver_audio="sdl"; -+#else - char *driver_screen=""; - char *driver_audio=""; -+#endif - - - //porcentaje de velocidad de la cpu -diff --git a/src/cpu.h b/src/cpu.h -index e81d144..b40fa83 100644 ---- a/src/cpu.h -+++ b/src/cpu.h -@@ -187,7 +187,7 @@ extern z80_int get_im2_interrupt_vector(void); - - - //Para haiku --#ifdef HAIKU_OS -+#ifdef __HAIKU__ - //Para incluir PATH_MAX - #include - #endif -diff --git a/src/cursor.bmp b/src/cursor.bmp -new file mode 100644 -index 0000000000000000000000000000000000000000..9841220b84366bb7024d3a0a18b4c6afca45290b -GIT binary patch -literal 1306 -zcmd7Qv8~-Y3;<9E$OTgTE?p)F(h|r3zt0-niG9Xl{}#v|%%SY}W{8X<(6lVklK=np -z?RA~@^Ye9m7yZXqK3!i<{*V6mkDKH^I4$%^(F~VlkQB|Z1B0Y!hJ86mie}gegQRGN -zT_i|~W{^Es>WgOBVuGY-hAl8iie}iNgQRGN{g5CjnqfaKNQ!2#fYtL{rEiAagdi!J -zVK*j7ie}i&3X-B3b_0W?XolU?ASs%`MC#c}>RhcKcJqUzXofwIASs$*4=G5BX4r!Z -zlA;;*FoUFM1}~^*cV#Q-bB%rvJxGdX*dHNCie}iKBS?y7*dHcHie}KMN1mb?JW$V` -z(C*4sGUqZ_J@ORIU;_2XQ#6A~)gw>Q3>H$4JVi5D+!FE>&G4_c*WIq`30|-3?aj@d -zc;b^d>HF!O-uUeaPrSFM37&TCn7du?WA6DsvS-D;J0;xX?`lr`6t?jb-Zi`z{*isJ -M`T3xa?|Hrc0-Q97Gynhq - -literal 0 -HcmV?d00001 - -diff --git a/src/generate_install_sh.sh b/src/generate_install_sh.sh -index 6270201..a1fb15b 100755 ---- a/src/generate_install_sh.sh -+++ b/src/generate_install_sh.sh -@@ -14,7 +14,7 @@ mkdir -p $INSTALLPREFIX - mkdir -p $INSTALLPREFIX/bin - mkdir -p $INSTALLPREFIX/share/zesarux/ - --COMMONFILES="ACKNOWLEDGEMENTS LICENSE LICENSES_info licenses Changelog TODO* README HISTORY FEATURES FEATURES_es EXCLUSIVEFEATURES INSTALL INSTALLWINDOWS ALTERNATEROMS INCLUDEDTAPES DONATE FAQ *.odt mantransfev3.bin *.rom zxuno.flash tbblue.mmc speech_filters my_soft docs zesarux.mp3 zesarux.xcf $EDITION_NAME_GAME $EDITION_NAME_GAME.config bin_sprite_to_c.sh keyboard_*.bmp zesarux.pdf" -+COMMONFILES="ACKNOWLEDGEMENTS LICENSE LICENSES_info licenses Changelog TODO* README HISTORY FEATURES FEATURES_es EXCLUSIVEFEATURES INSTALL INSTALLWINDOWS ALTERNATEROMS INCLUDEDTAPES DONATE FAQ *.odt mantransfev3.bin *.rom zxuno.flash tbblue.mmc speech_filters my_soft docs zesarux.mp3 zesarux.xcf $EDITION_NAME_GAME $EDITION_NAME_GAME.config bin_sprite_to_c.sh keyboard_*.bmp cursor.bmp zesarux.pdf" - - # -f to force overwrite already existing share files which are set to 444 - cp -f -a \$COMMONFILES $INSTALLPREFIX/share/zesarux/ -diff --git a/src/m68kcpu.h b/src/m68kcpu.h -index 4a6e9a7..70d92a9 100644 ---- a/src/m68kcpu.h -+++ b/src/m68kcpu.h -@@ -75,7 +75,7 @@ - - - //Para haiku --#ifdef HAIKU_OS -+#ifdef __HAIKU__ - typedef unsigned int uint; - - #else -diff --git a/src/scrsdl2.c b/src/scrsdl2.c -index 020f950..4de4a7b 100644 ---- a/src/scrsdl2.c -+++ b/src/scrsdl2.c -@@ -66,10 +66,14 @@ int scrsdl_debe_redimensionar=0; - unsigned char *scrsdl_pixeles; - - SDL_Texture *scrsdl_texture; -- -+SDL_Texture *cursor_texture; - - SDL_Renderer *renderer; - -+float zoom_width = 1.0; -+float zoom_height = 1.0; -+Uint32 mouse_timer = 0; -+ - //#define screen_get_window_size_width_zoom_border_en() screen_get_window_size_width_zoom_border_en() - #define SDL_ALTO_VENTANA screen_get_window_size_height_zoom_border_en() - -@@ -85,7 +89,7 @@ int scrsdl_crea_ventana(void) - flags=SDL_WINDOW_RESIZABLE; - - if (ventana_fullscreen) { -- flags |=SDL_WINDOW_FULLSCREEN; -+ flags |=SDL_WINDOW_FULLSCREEN_DESKTOP; - } - - -@@ -113,6 +117,7 @@ int scrsdl_crea_ventana(void) - - SDL_SetWindowTitle(window,"ZEsarUX "EMULATOR_VERSION); - -+ SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "1"); - - scrsdl_texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STATIC, ancho, SDL_ALTO_VENTANA); - //Uint32 *pixels = new Uint32[screen_get_window_size_width_zoom_border_en() * SDL_ALTO_VENTANA]; -@@ -123,7 +128,7 @@ int scrsdl_crea_ventana(void) - - scr_reallocate_layers_menu(ancho,alto); - -- if (mouse_pointer_shown.v==0) SDL_ShowCursor(0); -+ SDL_ShowCursor(SDL_DISABLE); - - modificado_border.v=1; - -@@ -131,7 +136,15 @@ int scrsdl_crea_ventana(void) - - menu_init_footer(); - -- -+#ifdef __HAIKU__ -+ SDL_Surface *cursor = SDL_LoadBMP(INSTALL_PREFIX "/data/cursor.bmp"); -+#else -+ SDL_Surface *cursor = SDL_LoadBMP(INSTALL_PREFIX "/share/zesarux/cursor.bmp"); -+#endif -+ SDL_SetColorKey(cursor, SDL_TRUE, SDL_MapRGB(cursor->format, 0, 0, 255)); -+ cursor_texture = SDL_CreateTextureFromSurface(renderer, cursor); -+ SDL_SetTextureBlendMode(cursor_texture, SDL_BLENDMODE_BLEND); -+ SDL_FreeSurface(cursor); - - return 0; - -@@ -284,13 +297,39 @@ void scrsdl_refresca_border(void) - - void scrsdl_refresca_pantalla_solo_driver(void) - { -+ int window_width, window_height; -+ int texture_width, texture_height; -+ SDL_Rect texture_frame; - - int ancho=screen_get_window_size_width_zoom_border_en(); - ancho +=screen_get_ext_desktop_width_zoom(); - - SDL_UpdateTexture(scrsdl_texture, NULL, scrsdl_pixeles, ancho * 4); -+ SDL_GetWindowSize(window, &window_width, &window_height); -+ SDL_QueryTexture(scrsdl_texture, NULL, NULL, &texture_width, &texture_height); -+ -+ zoom_width = (float)window_width / (float)texture_width; -+ zoom_height = (float)window_height / (float)texture_height; -+ -+ if (window_width >= window_height) { -+ texture_frame.w = (float)texture_width * zoom_height; -+ texture_frame.h = (float)texture_height * zoom_height; -+ texture_frame.x = (window_width - texture_frame.w) / 2; -+ texture_frame.y = 0; -+ } else { -+ texture_frame.w = (float)texture_width * zoom_width; -+ texture_frame.h = (float)texture_height * zoom_width; -+ texture_frame.x = 0; -+ texture_frame.y = (window_height - texture_frame.h) / 2; -+ } - SDL_RenderClear(renderer); -- SDL_RenderCopy(renderer, scrsdl_texture, NULL, NULL); -+ SDL_RenderCopy(renderer, scrsdl_texture, NULL, &texture_frame); -+ if (mouse_pointer_shown.v != 0 && cursor_texture!=NULL) { -+ if (SDL_GetTicks() - mouse_timer < 2000) { -+ SDL_Rect mouse_rect = {mouse_x * zoom_width, mouse_y * zoom_height, 12, 19}; -+ SDL_RenderCopy(renderer, cursor_texture, NULL, &mouse_rect); -+ } -+ } - SDL_RenderPresent(renderer); - } - -@@ -1447,23 +1486,11 @@ See the SDL documentation. Scancodes represent the physical position of the keys - - } - -- -- -- //resize -- //if (event.type==SDL_WINDOWEVENT_SIZE_CHANGED) { -- if (scrsdl_recibido_resize(&event)) { -- -- scrsdl_resize(event.window.data1, event.window.data2); -- -- } -- -- - //mouse motion - if (event.type==SDL_MOUSEMOTION) { -- mouse_x=event.motion.x; -- mouse_y=event.motion.y; -- -- -+ mouse_timer = SDL_GetTicks(); -+ mouse_x=(float)event.motion.x / zoom_width; -+ mouse_y=(float)event.motion.y / zoom_height; - - kempston_mouse_x=mouse_x/zoom_x; - kempston_mouse_y=255-mouse_y/zoom_y; -@@ -1475,7 +1502,7 @@ See the SDL documentation. Scancodes represent the physical position of the keys - - //mouse button - if (event.type==SDL_MOUSEBUTTONDOWN) { -- -+ mouse_timer = SDL_GetTicks(); - debug_printf (VERBOSE_PARANOID,"Mouse Button Press. x=%d y=%d", event.button.x, event.button.y); - - if ( event.button.button == SDL_BUTTON_LEFT ) { -@@ -1500,6 +1527,7 @@ See the SDL documentation. Scancodes represent the physical position of the keys - } - - if (event.type==SDL_MOUSEBUTTONUP) { -+ mouse_timer = SDL_GetTicks(); - debug_printf (VERBOSE_PARANOID,"Mouse Button release. x=%d y=%d", event.button.x, event.button.y); - if ( event.button.button == SDL_BUTTON_LEFT ) { - //mouse_left=0; -diff --git a/src/utils.c b/src/utils.c -index 6a8d427..25a2d80 100644 ---- a/src/utils.c -+++ b/src/utils.c -@@ -1187,7 +1187,11 @@ void old_open_sharedfile(char *archivo,FILE **f) - - //sino, en INSTALLPREFIX/share/zesarux - if (!(*f)) { -+#ifdef __HAIKU__ -+ sprintf(buffer_nombre,"%s/%s/%s",INSTALL_PREFIX,"/data/",archivo); -+#else - sprintf(buffer_nombre,"%s/%s/%s",INSTALL_PREFIX,"/share/zesarux/",archivo); -+#endif - debug_printf(VERBOSE_INFO,"Looking for file %s",buffer_nombre); - *f=fopen(buffer_nombre,"rb"); - } -@@ -1222,7 +1226,11 @@ int find_sharedfile(char *archivo,char *ruta_final) - - //sino, en INSTALLPREFIX/share/zesarux - if (!existe) { -+#ifdef __HAIKU__ -+ sprintf(buffer_nombre,"%s/%s/%s",INSTALL_PREFIX,"/data/",archivo); -+#else - sprintf(buffer_nombre,"%s/%s/%s",INSTALL_PREFIX,"/share/zesarux/",archivo); -+#endif - debug_printf(VERBOSE_INFO,"Looking for file %s",buffer_nombre); - existe=si_existe_archivo(buffer_nombre); - } -@@ -1293,7 +1301,11 @@ void open_sharedfile_write(char *archivo,FILE **f) - - //sino, en INSTALLPREFIX/share/zesarux - if (!(*f)) { -+#ifdef __HAIKU__ -+ sprintf(buffer_nombre,"%s/%s/%s",INSTALL_PREFIX,"/data/",archivo); -+#else - sprintf(buffer_nombre,"%s/%s/%s",INSTALL_PREFIX,"/share/zesarux/",archivo); -+#endif - debug_printf(VERBOSE_INFO,"Looking for file %s",buffer_nombre); - open_sharedfile_write_open(buffer_nombre,f); - } -diff --git a/src/utils.h b/src/utils.h -index 2f51e6e..94e47eb 100644 ---- a/src/utils.h -+++ b/src/utils.h -@@ -22,7 +22,7 @@ - #ifndef UTILS_H - #define UTILS_H - --#ifdef __FreeBSD__ -+#if defined(__FreeBSD__) || defined(__HAIKU__) - #include - #endif - -@@ -624,7 +624,11 @@ extern void convert_numeros_letras_puerto_teclado_continue(z80_byte tecla,int pr - - extern int util_tape_tap_get_info(z80_byte *tape,char *texto,int origin_tap); - -+#ifdef __HAIKU__ -+#define DEFAULT_ZESARUX_CONFIG_FILE "config/settings/zesaruxrc" -+#else - #define DEFAULT_ZESARUX_CONFIG_FILE ".zesaruxrc" -+#endif - - extern char *customconfigfile; - --- -2.30.2 - diff --git a/app-emulation/zesarux/patches/zesarux-10.10.patchset b/app-emulation/zesarux/patches/zesarux-10.10.patchset new file mode 100644 index 000000000..4052ac367 --- /dev/null +++ b/app-emulation/zesarux/patches/zesarux-10.10.patchset @@ -0,0 +1,374 @@ +From 84a451cf67f6f4fd068c4bc1ea829bca3b46b91e Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Sat, 28 Oct 2023 13:05:20 +1000 +Subject: Fixes for Haiku + + +diff --git a/compileoptions.h b/compileoptions.h +index ad084d3..40bcb8c 100644 +--- a/compileoptions.h ++++ b/compileoptions.h +@@ -5,41 +5,30 @@ + + #define COMPILE_STDOUT + #define COMPILE_SIMPLETEXT +-#define COMPILE_CURSES +-#define COMPILE_XWINDOWS + #define COMPILE_SDL +-#define COMPILE_FBDEV ++#define COMPILE_SDL2 + #define COMPILE_SSL +-#define USE_XEXT +-#define USE_XVIDMODE + #define USE_PTHREADS +-#define COMPILE_DSP +-#define COMPILE_ONEBITSPEAKER +-#define COMPILE_ALSA +-#define COMPILE_PULSE +-#define EMULATE_MEMPTR +-#define EMULATE_VISUALMEM +-#define EMULATE_CPU_STATS ++#define USE_SNDFILE + #define EMULATE_CONTEND + #define PUTPIXELCACHE +-#define USE_LINUXREALJOYSTICK +- +-#define COMPILATION_DATE "Tue Sep 5 18:26:21 CEST 2023" +-#define COMPILATION_SYSTEM "GNU/Linux" +-#define COMPILATION_SYSTEM_RELEASE "Debian GNU/Linux 11 (bullseye)" +-#define CONFIGURE_OPTIONS "./configure --enable-memptr --enable-visualmem --enable-cpustats --enable-ssl --disable-caca --disable-aa --disable-cursesw --prefix /usr" +-#define COMPILE_VARIABLES " COMPILE_STDOUT COMPILE_SIMPLETEXT COMPILE_CURSES COMPILE_XWINDOWS COMPILE_SDL COMPILE_FBDEV COMPILE_SSL USE_XEXT USE_XVIDMODE USE_PTHREADS COMPILE_DSP COMPILE_ONEBITSPEAKER COMPILE_ALSA COMPILE_PULSE EMULATE_MEMPTR EMULATE_VISUALMEM EMULATE_CPU_STATS EMULATE_CONTEND PUTPIXELCACHE USE_LINUXREALJOYSTICK" +-#define COMPILE_INITIALCFLAGS "-O3" +-#define COMPILE_INITIALLDFLAGS "-O3" +-#define COMPILE_FINALCFLAGS "-O3 -fsigned-char -D_FILE_OFFSET_BITS=64" +-#define COMPILE_FINALLDFLAGS "-O3 -lncurses -lssl -lcrypto -lX11 -L/usr/X11R6/lib -L/opt/X11/lib -lXext -lXxf86vm -lpthread -lasound -lpulse -lpulse-simple -lSDL -lpthread" +-#define INSTALL_PREFIX "/usr" +- +-#define LINES_SOURCE 342956 ++ ++#define COMPILATION_DATE "Sat Oct 28 12:48:46 GMT+10 2023" ++#define COMPILATION_SYSTEM "Haiku" ++#define COMPILATION_SYSTEM_RELEASE "Haiku" ++#define CONFIGURE_OPTIONS "./configure --prefix=/packages/zesarux-10.10-1/.self/apps/ZEsarUX --enable-sdl2 --enable-ssl" ++#define COMPILE_VARIABLES " COMPILE_STDOUT COMPILE_SIMPLETEXT COMPILE_SDL COMPILE_SDL2 COMPILE_SSL USE_PTHREADS USE_SNDFILE EMULATE_CONTEND PUTPIXELCACHE" ++#define COMPILE_INITIALCFLAGS "-DHAIKU_OS -O3" ++#define COMPILE_INITIALLDFLAGS "-lnetwork" ++#define COMPILE_FINALCFLAGS "-DHAIKU_OS -O3 -fsigned-char" ++#define COMPILE_FINALLDFLAGS "-lnetwork -lssl -lcrypto -lpthread -lSDL2 -lsndfile" ++#define INSTALL_PREFIX "/packages/zesarux-10.10-1/.self/apps/ZEsarUX" ++ ++#define LINES_SOURCE 343030 + #define TOTAL_COMMENTS 56568 + #define TOTAL_TODO_ITEMS 1824 + +-#define BUILDNUMBER "1693931179" ++#define BUILDNUMBER "1698461324" + + + #endif +diff --git a/configure b/configure +index 6fde55b..64f5efd 100755 +--- a/configure ++++ b/configure +@@ -1783,7 +1783,7 @@ clean: + rm -f ZEsarUX_win-\$(EMULATOR_VERSION).zip + rm -f ZEsarUX_extras-\$(EMULATOR_VERSION).zip + +-COMMONFILES=ACKNOWLEDGEMENTS LICENSE LICENSES_info Changelog Cambios TODO* README HISTORY FEATURES FEATURES_es EXCLUSIVEFEATURES INSTALL INSTALLWINDOWS ALTERNATEROMS INCLUDEDTAPES DONATE DONORS FAQ *.odt mantransfev3.bin *.rom zxuno.flash tbblue.mmc pcw_8x_boot*dsk zesarux.mp3 zesarux.xcf editionnamegame.* bin_sprite_to_c.sh keyboard_*.bmp z88_shortcuts.bmp zesarux.pdf docs licenses my_soft speech_filters text_image_filters ++COMMONFILES=ACKNOWLEDGEMENTS LICENSE LICENSES_info Changelog Cambios TODO* README HISTORY FEATURES FEATURES_es EXCLUSIVEFEATURES INSTALL INSTALLWINDOWS ALTERNATEROMS INCLUDEDTAPES DONATE DONORS FAQ *.odt mantransfev3.bin *.rom zxuno.flash tbblue.mmc pcw_8x_boot*dsk zesarux.mp3 zesarux.xcf editionnamegame.* bin_sprite_to_c.sh keyboard_*.bmp z88_shortcuts.bmp zesarux.pdf docs licenses my_soft speech_filters text_image_filters cursor.bmp + + ONLYSOURCEFILES=icons_buttons macos patches tests *.c *.m *.h *.tpl DEVELOPMENT CHECKLIST configure *.sh *.asm benchmark_*.txt current_checklist.txt prism_change_boot.txt Dockerfile* + +diff --git a/cursor.bmp b/cursor.bmp +new file mode 100644 +index 0000000000000000000000000000000000000000..9841220b84366bb7024d3a0a18b4c6afca45290b +GIT binary patch +literal 1306 +zcmd7Qv8~-Y3;<9E$OTgTE?p)F(h|r3zt0-niG9Xl{}#v|%%SY}W{8X<(6lVklK=np +z?RA~@^Ye9m7yZXqK3!i<{*V6mkDKH^I4$%^(F~VlkQB|Z1B0Y!hJ86mie}gegQRGN +zT_i|~W{^Es>WgOBVuGY-hAl8iie}iNgQRGN{g5CjnqfaKNQ!2#fYtL{rEiAagdi!J +zVK*j7ie}i&3X-B3b_0W?XolU?ASs%`MC#c}>RhcKcJqUzXofwIASs$*4=G5BX4r!Z +zlA;;*FoUFM1}~^*cV#Q-bB%rvJxGdX*dHNCie}iKBS?y7*dHcHie}KMN1mb?JW$V` +z(C*4sGUqZ_J@ORIU;_2XQ#6A~)gw>Q3>H$4JVi5D+!FE>&G4_c*WIq`30|-3?aj@d +zc;b^d>HF!O-uUeaPrSFM37&TCn7du?WA6DsvS-D;J0;xX?`lr`6t?jb-Zi`z{*isJ +M`T3xa?|Hrc0-Q97Gynhq + +literal 0 +HcmV?d00001 + +diff --git a/generate_install_sh.sh b/generate_install_sh.sh +index 9433341..7d63644 100755 +--- a/generate_install_sh.sh ++++ b/generate_install_sh.sh +@@ -14,7 +14,7 @@ mkdir -p $INSTALLPREFIX + mkdir -p $INSTALLPREFIX/bin + mkdir -p $INSTALLPREFIX/share/zesarux/ + +-COMMONFILES="ACKNOWLEDGEMENTS LICENSE LICENSES_info licenses Changelog Cambios TODO* README HISTORY FEATURES FEATURES_es EXCLUSIVEFEATURES INSTALL INSTALLWINDOWS ALTERNATEROMS INCLUDEDTAPES DONATE DONORS FAQ *.odt mantransfev3.bin *.rom zxuno.flash tbblue.mmc pcw_8x_boot*dsk speech_filters text_image_filters my_soft docs zesarux.mp3 zesarux.xcf $EDITION_NAME_GAME* bin_sprite_to_c.sh keyboard_*.bmp z88_shortcuts.bmp zesarux.pdf" ++COMMONFILES="ACKNOWLEDGEMENTS LICENSE LICENSES_info licenses Changelog Cambios TODO* README HISTORY FEATURES FEATURES_es EXCLUSIVEFEATURES INSTALL INSTALLWINDOWS ALTERNATEROMS INCLUDEDTAPES DONATE DONORS FAQ *.odt mantransfev3.bin *.rom zxuno.flash tbblue.mmc pcw_8x_boot*dsk speech_filters text_image_filters my_soft docs zesarux.mp3 zesarux.xcf $EDITION_NAME_GAME* bin_sprite_to_c.sh keyboard_*.bmp z88_shortcuts.bmp zesarux.pdf cursor.bmp" + + # -f to force overwrite already existing share files which are set to 444 + cp -f -a \$COMMONFILES $INSTALLPREFIX/share/zesarux/ +diff --git a/install.sh b/install.sh +deleted file mode 100755 +index 69354b1..0000000 +--- a/install.sh ++++ /dev/null +@@ -1,28 +0,0 @@ +-#!/usr/bin/env bash +- +-echo "Installing ZEsarUX under /usr ..." +- +-mkdir -p /usr +-mkdir -p /usr/bin +-mkdir -p /usr/share/zesarux/ +- +-COMMONFILES="ACKNOWLEDGEMENTS LICENSE LICENSES_info licenses Changelog Cambios TODO* README HISTORY FEATURES FEATURES_es EXCLUSIVEFEATURES INSTALL INSTALLWINDOWS ALTERNATEROMS INCLUDEDTAPES DONATE DONORS FAQ *.odt mantransfev3.bin *.rom zxuno.flash tbblue.mmc pcw_8x_boot*dsk speech_filters text_image_filters my_soft docs zesarux.mp3 zesarux.xcf editionnamegame.dsk* bin_sprite_to_c.sh keyboard_*.bmp z88_shortcuts.bmp zesarux.pdf" +- +-# -f to force overwrite already existing share files which are set to 444 +-cp -f -a $COMMONFILES /usr/share/zesarux/ +- +-cp zesarux /usr/bin/ +- +- +-# Default permissions for files: read only +-find /usr/share/zesarux/ -type f -print0| xargs -0 chmod 444 +- +-#set permissions to all writable for disk images +-chmod 666 /usr/share/zesarux/zxuno.flash +-chmod 666 /usr/share/zesarux/tbblue.mmc +- +-# Speech filters can be run +-chmod +x /usr/share/zesarux/speech_filters/* +- +-echo "Install done" +- +diff --git a/scrsdl2.c b/scrsdl2.c +index 4e52418..e9daf49 100644 +--- a/scrsdl2.c ++++ b/scrsdl2.c +@@ -68,6 +68,13 @@ unsigned char *scrsdl_pixeles; + + SDL_Texture *scrsdl_texture; + ++#ifdef __HAIKU__ ++SDL_Texture *cursor_texture; ++ ++float zoom_width = 1.0; ++float zoom_height = 1.0; ++Uint32 mouse_timer = 0; ++#endif + + SDL_Renderer *renderer; + +@@ -82,7 +89,11 @@ int scrsdl_crea_ventana(void) + flags=SDL_WINDOW_RESIZABLE; + + if (ventana_fullscreen) { ++#ifdef __HAIKU__ ++ flags |=SDL_WINDOW_FULLSCREEN_DESKTOP; ++#else + flags |=SDL_WINDOW_FULLSCREEN; ++#endif + } + + +@@ -111,6 +122,9 @@ int scrsdl_crea_ventana(void) + + SDL_SetWindowTitle(window,"ZEsarUX "EMULATOR_VERSION); + ++#ifdef __HAIKU__ ++ SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "1"); ++#endif + + scrsdl_texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STATIC, ancho, alto); + //Uint32 *pixels = new Uint32[screen_get_window_size_width_zoom_border_en() * screen_get_window_size_height_zoom_border_en()]; +@@ -121,7 +135,11 @@ int scrsdl_crea_ventana(void) + + scr_reallocate_layers_menu(ancho,alto); + ++#ifdef __HAIKU__ ++ SDL_ShowCursor(SDL_DISABLE); ++#else + if (mouse_pointer_shown.v==0) SDL_ShowCursor(0); ++#endif + + modificado_border.v=1; + +@@ -131,6 +149,13 @@ int scrsdl_crea_ventana(void) + + scr_set_pending_redraw_desktop_windows(); + ++#ifdef __HAIKU__ ++ SDL_Surface *cursor = SDL_LoadBMP(INSTALL_PREFIX "/data/cursor.bmp"); ++ SDL_SetColorKey(cursor, SDL_TRUE, SDL_MapRGB(cursor->format, 0, 0, 255)); ++ cursor_texture = SDL_CreateTextureFromSurface(renderer, cursor); ++ SDL_SetTextureBlendMode(cursor_texture, SDL_BLENDMODE_BLEND); ++ SDL_FreeSurface(cursor); ++#endif + + return 0; + +@@ -289,13 +314,46 @@ void scrsdl_refresca_border(void) + + void scrsdl_refresca_pantalla_solo_driver(void) + { ++#ifdef __HAIKU__ ++ int window_width, window_height; ++ int texture_width, texture_height; ++ SDL_Rect texture_frame; ++#endif + + int ancho=screen_get_window_size_width_zoom_border_en(); + ancho +=screen_get_ext_desktop_width_zoom(); + + SDL_UpdateTexture(scrsdl_texture, NULL, scrsdl_pixeles, ancho * 4); ++#ifdef __HAIKU__ ++ SDL_GetWindowSize(window, &window_width, &window_height); ++ SDL_QueryTexture(scrsdl_texture, NULL, NULL, &texture_width, &texture_height); ++ ++ zoom_width = (float)window_width / (float)texture_width; ++ zoom_height = (float)window_height / (float)texture_height; ++ ++ if (window_width >= window_height) { ++ texture_frame.w = (float)texture_width * zoom_height; ++ texture_frame.h = (float)texture_height * zoom_height; ++ texture_frame.x = (window_width - texture_frame.w) / 2; ++ texture_frame.y = 0; ++ } else { ++ texture_frame.w = (float)texture_width * zoom_width; ++ texture_frame.h = (float)texture_height * zoom_width; ++ texture_frame.x = 0; ++ texture_frame.y = (window_height - texture_frame.h) / 2; ++ } ++ SDL_RenderClear(renderer); ++ SDL_RenderCopy(renderer, scrsdl_texture, NULL, &texture_frame); ++ if (mouse_pointer_shown.v != 0 && cursor_texture!=NULL) { ++ if (SDL_GetTicks() - mouse_timer < 2000) { ++ SDL_Rect mouse_rect = {mouse_x * zoom_width, mouse_y * zoom_height, 12, 19}; ++ SDL_RenderCopy(renderer, cursor_texture, NULL, &mouse_rect); ++ } ++ } ++#else + SDL_RenderClear(renderer); + SDL_RenderCopy(renderer, scrsdl_texture, NULL, NULL); ++#endif + SDL_RenderPresent(renderer); + } + +@@ -1474,18 +1532,24 @@ See the SDL documentation. Scancodes represent the physical position of the keys + + //resize + //if (event.type==SDL_WINDOWEVENT_SIZE_CHANGED) { ++#ifndef __HAIKU__ + if (scrsdl_recibido_resize(&event)) { + + scrsdl_resize(event.window.data1, event.window.data2); + + } +- ++#endif + + //mouse motion + if (event.type==SDL_MOUSEMOTION) { ++#ifdef __HAIKU__ ++ mouse_timer = SDL_GetTicks(); ++ mouse_x=(float)event.motion.x / zoom_width; ++ mouse_y=(float)event.motion.y / zoom_height; ++#else + mouse_x=event.motion.x; + mouse_y=event.motion.y; +- ++#endif + + + kempston_mouse_x=mouse_x/zoom_x; +@@ -1498,7 +1562,9 @@ See the SDL documentation. Scancodes represent the physical position of the keys + + //mouse button + if (event.type==SDL_MOUSEBUTTONDOWN) { +- ++#ifdef __HAIKU__ ++ mouse_timer = SDL_GetTicks(); ++#endif + debug_printf (VERBOSE_PARANOID,"Mouse Button Press. x=%d y=%d", event.button.x, event.button.y); + + if ( event.button.button == SDL_BUTTON_LEFT ) { +@@ -1525,6 +1591,9 @@ See the SDL documentation. Scancodes represent the physical position of the keys + + + if (event.type==SDL_MOUSEBUTTONUP) { ++#ifdef __HAIKU__ ++ mouse_timer = SDL_GetTicks(); ++#endif + debug_printf (VERBOSE_PARANOID,"Mouse Button release. x=%d y=%d", event.button.x, event.button.y); + if ( event.button.button == SDL_BUTTON_LEFT ) { + //mouse_left=0; +diff --git a/utils.c b/utils.c +index d17d292..d79666b 100644 +--- a/utils.c ++++ b/utils.c +@@ -1271,7 +1271,11 @@ void old_open_sharedfile(char *archivo,FILE **f) + + //sino, en INSTALLPREFIX/share/zesarux + if (!(*f)) { ++#ifdef __HAIKU__ ++ sprintf(buffer_nombre,"%s/%s/%s",INSTALL_PREFIX,"/data/",archivo); ++#else + sprintf(buffer_nombre,"%s/%s/%s",INSTALL_PREFIX,"/share/zesarux/",archivo); ++#endif + debug_printf(VERBOSE_INFO,"Looking for file %s",buffer_nombre); + *f=fopen(buffer_nombre,"rb"); + } +@@ -1306,7 +1310,11 @@ int find_sharedfile(char *archivo,char *ruta_final) + + //sino, en INSTALLPREFIX/share/zesarux + if (!existe) { ++#ifdef __HAIKU__ ++ sprintf(buffer_nombre,"%s/%s/%s",INSTALL_PREFIX,"/data/",archivo); ++#else + sprintf(buffer_nombre,"%s/%s/%s",INSTALL_PREFIX,"/share/zesarux/",archivo); ++#endif + debug_printf(VERBOSE_INFO,"Looking for file %s",buffer_nombre); + existe=si_existe_archivo(buffer_nombre); + } +@@ -1377,7 +1385,11 @@ void open_sharedfile_write(char *archivo,FILE **f) + + //sino, en INSTALLPREFIX/share/zesarux + if (!(*f)) { ++#ifdef __HAIKU__ ++ sprintf(buffer_nombre,"%s/%s/%s",INSTALL_PREFIX,"/data/",archivo); ++#else + sprintf(buffer_nombre,"%s/%s/%s",INSTALL_PREFIX,"/share/zesarux/",archivo); ++#endif + debug_printf(VERBOSE_INFO,"Looking for file %s",buffer_nombre); + open_sharedfile_write_open(buffer_nombre,f); + } +diff --git a/utils.h b/utils.h +index 1160ee7..adfbbaa 100644 +--- a/utils.h ++++ b/utils.h +@@ -22,7 +22,7 @@ + #ifndef UTILS_H + #define UTILS_H + +-#ifdef __FreeBSD__ ++#if defined(__FreeBSD__) || defined(__HAIKU__) + #include + #endif + +@@ -636,7 +636,11 @@ extern void convert_numeros_letras_puerto_teclado_continue(z80_byte tecla,int pr + + extern int util_tape_tap_get_info(z80_byte *tape,char *texto,int origin_tap); + ++#ifdef __HAIKU__ ++#define DEFAULT_ZESARUX_CONFIG_FILE "config/settings/zesaruxrc" ++#else + #define DEFAULT_ZESARUX_CONFIG_FILE ".zesaruxrc" ++#endif + + extern char *customconfigfile; + +-- +2.42.0 + diff --git a/app-emulation/zesarux/zesarux-10.1.recipe b/app-emulation/zesarux/zesarux-10.10.recipe similarity index 71% rename from app-emulation/zesarux/zesarux-10.1.recipe rename to app-emulation/zesarux/zesarux-10.10.recipe index 499244fc1..a8d7c2afb 100644 --- a/app-emulation/zesarux/zesarux-10.1.recipe +++ b/app-emulation/zesarux/zesarux-10.10.recipe @@ -9,29 +9,34 @@ including all the Sinclair computers: * Z88 And also: -* Timex TS 2068 +* Microdigital TK80, TK82, TK82C, TK83, TK85, TK90X (Portuguese and Spanish), TK95 (Portuguese and Spanish) +* Timex Sinclair 1000, 1500, 2068 +* Timex Computer 2048, 2068 +* Inves Spectrum + * Sam Coupe * Pentagon * Chloe 140 SE, 280 SE * Chrome * Prism * ZX-Uno -* ZX-Evolution BaseConf +* ZX-Evolution BaseConf (beta) * ZX-Evolution TS-Conf -* TBBlue/ZX Spectrum Next +* ZX Spectrum Next * Jupiter Ace -* Amstrad CPC 464, CPC 4128 +* Amstrad CPC 464, CPC 4128, CPC 664, CPC 6128 +* Amstrad PCW 8256, PCW 8512 * MSX1 * Spectravideo 318/328 * Colecovision -* Sega SG1000." +* Sega SG1000 +* Sega Master System" HOMEPAGE="https://github.com/chernandezba/zesarux" COPYRIGHT="Cesar Hernandez Bano" LICENSE="GNU GPL v2" REVISION="1" -SOURCE_URI="https://github.com/chernandezba/zesarux/archive/refs/tags/ZEsarUX-$portVersion.tar.gz" -CHECKSUM_SHA256="445425396ff52d597bc07c395cd0322a4612b4e923863fc6ad6991b0dea764ba" -SOURCE_DIR="zesarux-ZEsarUX-$portVersion" +SOURCE_URI="https://github.com/chernandezba/zesarux/releases/download/ZEsarUX-X/ZEsarUX_src-X.tar.gz" +CHECKSUM_SHA256="1c01520e55a85a114bbf6553cffb9f25e781ac8de3d1db89f2f59396cc6c4124" +SOURCE_DIR="ZEsarUX-X" PATCHES="zesarux-$portVersion.patchset" ADDITIONAL_FILES="zesarux.rdef.in" @@ -49,17 +54,21 @@ REQUIRES=" cmd:sox$secondaryArchSuffix cmd:tar cmd:unrar + lib:libcrypto$secondaryArchSuffix lib:libGL$secondaryArchSuffix lib:libSDL2_2.0$secondaryArchSuffix lib:libsndfile$secondaryArchSuffix + lib:libssl$secondaryArchSuffix lib:libz$secondaryArchSuffix " BUILD_REQUIRES=" haiku${secondaryArchSuffix}_devel + devel:libcrypto$secondaryArchSuffix devel:libpng16$secondaryArchSuffix devel:libSDL2_2.0$secondaryArchSuffix devel:libsndfile$secondaryArchSuffix + devel:libssl$secondaryArchSuffix devel:libz$secondaryArchSuffix " BUILD_PREREQUIRES=" @@ -76,14 +85,15 @@ BUILD_PREREQUIRES=" BUILD() { - cd src - LDFLAGS="-lnetwork" ./configure --prefix=$appsDir/ZEsarUX --enable-sdl2 + export CFLAGS="-DHAIKU_OS -O3" + export LDFLAGS="-lnetwork" + + ./configure --prefix=$appsDir/ZEsarUX --enable-sdl2 --enable-ssl make $jobArgs } INSTALL() { - cd src make install mv $appsDir/ZEsarUX/bin/zesarux $appsDir/ZEsarUX/ZEsarUX mv $appsDir/ZEsarUX/share/zesarux $appsDir/ZEsarUX/data