diff -Nru xsystem35-1.7.3-pre5/debian/changelog xsystem35-1.7.3-pre5/debian/changelog --- xsystem35-1.7.3-pre5/debian/changelog 2018-11-05 21:22:04.000000000 +0000 +++ xsystem35-1.7.3-pre5/debian/changelog 2019-11-27 18:14:40.000000000 +0000 @@ -1,3 +1,13 @@ +xsystem35 (1.7.3-pre5-8) unstable; urgency=low + + * Bump debhelper version to 11. + * Add 04_esd_to_pulseaudio.patch and 04_sndcnv_64bit.patch + - Fix audio not playable. + * Update README.Debian + * Bump Standards-Version to 4.4.1: Nothing needs to be changed + + -- Ying-Chun Liu (PaulLiu) Thu, 28 Nov 2019 02:14:40 +0800 + xsystem35 (1.7.3-pre5-7) unstable; urgency=low * Bump debhelper version to 10. diff -Nru xsystem35-1.7.3-pre5/debian/compat xsystem35-1.7.3-pre5/debian/compat --- xsystem35-1.7.3-pre5/debian/compat 2018-11-05 19:55:11.000000000 +0000 +++ xsystem35-1.7.3-pre5/debian/compat 2019-11-27 18:14:40.000000000 +0000 @@ -1 +1 @@ -10 +11 diff -Nru xsystem35-1.7.3-pre5/debian/control xsystem35-1.7.3-pre5/debian/control --- xsystem35-1.7.3-pre5/debian/control 2018-11-05 20:08:11.000000000 +0000 +++ xsystem35-1.7.3-pre5/debian/control 2019-11-27 18:14:40.000000000 +0000 @@ -2,17 +2,26 @@ Section: games Priority: optional Maintainer: Ying-Chun Liu (PaulLiu) -Build-Depends: debhelper (>= 10), libgtk2.0-dev, - libvorbis-dev, libjpeg-dev, xsltproc, docbook-xsl, - libasound2-dev, libltdl-dev, - autopoint, chrpath, pkg-config -Standards-Version: 4.1.2 +Build-Depends: autopoint, + chrpath, + debhelper (>= 11), + docbook-xsl, + libasound2-dev, + libgtk2.0-dev, + libjpeg-dev, + libltdl-dev, + libpulse-dev, + libvorbis-dev, + pkg-config, + xsltproc +Standards-Version: 4.4.1 Homepage: http://8ne.sakura.ne.jp:20008/chika/unitbase/xsys35/ Package: xsystem35 Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} Recommends: fonts-takao-mincho +Suggests: timidity Description: System 3.5 games engine for X Window System xsystem35 is a free implementation of System 3.5, a games engine created by Alice Soft. It is able to run many existing System 3.5 games. diff -Nru xsystem35-1.7.3-pre5/debian/esd-config xsystem35-1.7.3-pre5/debian/esd-config --- xsystem35-1.7.3-pre5/debian/esd-config 1970-01-01 00:00:00.000000000 +0000 +++ xsystem35-1.7.3-pre5/debian/esd-config 2019-11-27 09:29:30.000000000 +0000 @@ -0,0 +1,3 @@ +#!/bin/sh + +pkg-config libpulse-simple "$@" diff -Nru xsystem35-1.7.3-pre5/debian/patches/01_change_conflict_define.patch xsystem35-1.7.3-pre5/debian/patches/01_change_conflict_define.patch --- xsystem35-1.7.3-pre5/debian/patches/01_change_conflict_define.patch 2010-08-31 14:45:10.000000000 +0000 +++ xsystem35-1.7.3-pre5/debian/patches/01_change_conflict_define.patch 2019-11-27 18:14:40.000000000 +0000 @@ -5,8 +5,8 @@ Last-Update: 2010-08-31 Index: xsystem35-1.7.3-pre5/src/counter.h =================================================================== ---- xsystem35-1.7.3-pre5.orig/src/counter.h 2010-08-26 22:09:35.000000000 +0800 -+++ xsystem35-1.7.3-pre5/src/counter.h 2010-08-26 22:10:01.000000000 +0800 +--- xsystem35-1.7.3-pre5.orig/src/counter.h ++++ xsystem35-1.7.3-pre5/src/counter.h @@ -21,8 +21,8 @@ */ /* $Id: counter.h,v 1.7 2000/11/25 13:09:03 chikama Exp $ */ @@ -18,7 +18,7 @@ #define EXTER_HIGHTCOUNTER_NUM 5 #define SYSTEMCOUNTER_MP3 (256 + 1) -@@ -36,4 +36,4 @@ +@@ -36,4 +36,4 @@ extern void reset_counter(int val); extern int get_high_counter(int num); extern void reset_counter_high(int num, int division, int val); diff -Nru xsystem35-1.7.3-pre5/debian/patches/02_use_utf8.patch xsystem35-1.7.3-pre5/debian/patches/02_use_utf8.patch --- xsystem35-1.7.3-pre5/debian/patches/02_use_utf8.patch 2011-07-21 18:00:34.000000000 +0000 +++ xsystem35-1.7.3-pre5/debian/patches/02_use_utf8.patch 2019-11-27 18:14:40.000000000 +0000 @@ -5,9 +5,9 @@ Last-Update: 2010-09-03 Index: xsystem35-1.7.3-pre5/src/font_x11.c =================================================================== ---- xsystem35-1.7.3-pre5.orig/src/font_x11.c 2010-09-03 23:08:49.000000000 +0800 -+++ xsystem35-1.7.3-pre5/src/font_x11.c 2010-09-03 23:57:06.000000000 +0800 -@@ -152,22 +152,51 @@ +--- xsystem35-1.7.3-pre5.orig/src/font_x11.c ++++ xsystem35-1.7.3-pre5/src/font_x11.c +@@ -152,22 +152,51 @@ static agsurface_t *get_drawn_glyph(cons return dst; } @@ -61,7 +61,7 @@ image_get_glyph(dst, &img_glyph); if (this->antialiase_on) { -@@ -180,26 +209,30 @@ +@@ -180,26 +209,30 @@ static void *font_x11_get_glyph(unsigned free(dst->pixel); g_free(dst); free(conv); @@ -94,7 +94,7 @@ if (DIB_DEPTH == dib_depth_candidate) { image_getGlyphImage(DIB, dst, x, y, PAL2PIC(col)); -@@ -209,7 +242,7 @@ +@@ -209,7 +242,7 @@ static int font_x11_draw_glyph(int x, in g_free(dst); } else { Xcore_setForeground(col); @@ -105,9 +105,9 @@ return w; Index: xsystem35-1.7.3-pre5/src/xcore_video.c =================================================================== ---- xsystem35-1.7.3-pre5.orig/src/xcore_video.c 2010-09-03 23:38:55.000000000 +0800 -+++ xsystem35-1.7.3-pre5/src/xcore_video.c 2010-09-03 23:44:09.000000000 +0800 -@@ -492,8 +492,11 @@ +--- xsystem35-1.7.3-pre5.orig/src/xcore_video.c ++++ xsystem35-1.7.3-pre5/src/xcore_video.c +@@ -492,8 +492,11 @@ void Xcore_setFontDevice(FONT *f) { /* name is EUC */ void Xcore_setWindowTitle(char *name) { diff -Nru xsystem35-1.7.3-pre5/debian/patches/03_remove_libltdl.patch xsystem35-1.7.3-pre5/debian/patches/03_remove_libltdl.patch --- xsystem35-1.7.3-pre5/debian/patches/03_remove_libltdl.patch 2011-07-21 19:10:01.000000000 +0000 +++ xsystem35-1.7.3-pre5/debian/patches/03_remove_libltdl.patch 2019-11-27 18:14:40.000000000 +0000 @@ -4,8 +4,8 @@ Last-Update: 2011-07-22 Index: xsystem35-1.7.3-pre5/Makefile.am =================================================================== ---- xsystem35-1.7.3-pre5.orig/Makefile.am 2011-07-22 02:12:57.872477003 +0800 -+++ xsystem35-1.7.3-pre5/Makefile.am 2011-07-22 02:17:02.230913738 +0800 +--- xsystem35-1.7.3-pre5.orig/Makefile.am ++++ xsystem35-1.7.3-pre5/Makefile.am @@ -1,7 +1,7 @@ ## Makefile.am for xsystem35 @@ -17,9 +17,9 @@ Index: xsystem35-1.7.3-pre5/configure.ac =================================================================== ---- xsystem35-1.7.3-pre5.orig/configure.ac 2011-07-22 02:12:57.840475195 +0800 -+++ xsystem35-1.7.3-pre5/configure.ac 2011-07-22 02:30:55.709687630 +0800 -@@ -66,13 +66,13 @@ +--- xsystem35-1.7.3-pre5.orig/configure.ac ++++ xsystem35-1.7.3-pre5/configure.ac +@@ -66,13 +66,13 @@ dnl AC_C_VAR_FUNC dnl dnl Check for libltdl dnl diff -Nru xsystem35-1.7.3-pre5/debian/patches/04_esd_to_pulseaudio.patch xsystem35-1.7.3-pre5/debian/patches/04_esd_to_pulseaudio.patch --- xsystem35-1.7.3-pre5/debian/patches/04_esd_to_pulseaudio.patch 1970-01-01 00:00:00.000000000 +0000 +++ xsystem35-1.7.3-pre5/debian/patches/04_esd_to_pulseaudio.patch 2019-11-27 18:14:40.000000000 +0000 @@ -0,0 +1,200 @@ +Description: Enlightened Sound Daemon is deprecated + Because ESD is deprecated, we use pulseaudio instead. Using + audio daemon is more stable than directly using ALSA. +Author: Ying-Chun Liu (PaulLiu) +Last-Update: 2019-11-28 +Index: xsystem35-1.7.3-pre5/src/audio_esd.c +=================================================================== +--- xsystem35-1.7.3-pre5.orig/src/audio_esd.c ++++ xsystem35-1.7.3-pre5/src/audio_esd.c +@@ -28,7 +28,7 @@ + #include + #include + #include +-#include ++#include + #include + + #include "system.h" +@@ -52,22 +52,8 @@ static int esd_exit(audiodevice_t *dev); + * stream source_id + */ + static int get_stream_id(int fd, char *sig) { +- esd_info_t *all_info = NULL; +- esd_player_info_t *p_list; + int id = -1; + +- all_info = esd_get_all_info(fd); +- p_list = all_info->player_list; +- +- while(p_list) { +- if (strcmp(p_list->name, sig) == 0) { +- id = p_list->source_id; +- break; +- } +- p_list = p_list->next; +- } +- esd_free_all_info(all_info); +- + return id; + } + +@@ -86,21 +72,44 @@ static int get_stream_id(int fd, char *s + */ + static int audio_open(audiodevice_t *audio, chanfmt_t fmt) { + audio_esd_t *esd = (audio_esd_t *)audio->data_pcm; +- esd_format_t efmt = ESD_STREAM; + +- efmt |= fmt.bit == 8 ? ESD_BITS8 : ESD_BITS16; +- efmt |= fmt.ch == 1 ? ESD_MONO : ESD_STEREO; +- +- esd->fds = esd_play_stream(efmt, fmt.rate, NULL, ESDNAME_BASE); +- +- if (esd->fds < 0) { ++ pa_sample_spec ss; ++ ++ if (fmt.bit == 8) { ++ // 8 bit ++ ss.format = PA_SAMPLE_U8; ++ } else { ++ // 16 bit ++ ss.format = PA_SAMPLE_S16NE; ++ } ++ if (fmt.ch == 1) { ++ // mono ++ ss.channels = 1; ++ } else { ++ // stereo ++ ss.channels = 2; ++ } ++ ++ ss.rate = fmt.rate; ++ ++ esd->s = pa_simple_new(NULL, // Use the default server. ++ "xsystem35", // Our application's name. ++ PA_STREAM_PLAYBACK, ++ NULL, // Use the default device. ++ "Music", // Description of our stream. ++ &ss, // Our sample format. ++ NULL, // Use default channel map ++ NULL, // Use default buffering attributes. ++ NULL // Ignore error code. ++ ); ++ ++ ++ if (!(esd->s)) { + WARNING("Opening audio server failed\n"); + return NG; + } +- +- esd->sid = get_stream_id(esd->fdh, ESDNAME_BASE); +- +- audio->fd = esd->fds; ++ ++ audio->fd = 2; + + return OK; + } +@@ -118,8 +127,9 @@ static int audio_close(audiodevice_t *au + audio_esd_t *esd = (audio_esd_t *)audio->data_pcm; + int ret = OK; + +- if (esd->fds > -1) { +- ret = close(esd->fds); ++ if (esd->s) { ++ pa_simple_free(esd->s); ++ esd->s = NULL; + } + + audio->fd = esd->fds = -1; +@@ -144,13 +154,14 @@ static int audio_write(audiodevice_t *au + + if (cnt == 0) return 0; + +- if (esd->fds > -1) { +- rt = write(esd->fds, buf, cnt); ++ if (esd->s) { ++ rt = pa_simple_write(esd->s, buf, cnt, NULL); + if (rt < 0) { + perror("write"); ++ return NG; + } + } +- return rt; ++ return cnt; + } + + int esd_exit(audiodevice_t *dev) { +@@ -160,7 +171,7 @@ int esd_exit(audiodevice_t *dev) { + + esd = (audio_esd_t *)dev->data_pcm; + +- esd_close(esd->fdh); ++ audio_close(dev); + + g_free(dev->data_pcm); + g_free(dev->data_mix); +@@ -169,11 +180,7 @@ int esd_exit(audiodevice_t *dev) { + + int esd_init(audiodevice_t *dev, char *host) { + audio_esd_t *esd; +- int fd; +- +- if (0 > (fd = esd_open_sound(host))) { +- return NG; +- } ++ int fd=2; + + esd = g_new0(audio_esd_t, 1); + esd->fdh = fd; /* socket to host */ +@@ -189,7 +196,7 @@ int esd_init(audiodevice_t *dev, char *h + dev->mix_set = mixer_set_level; + dev->mix_get = mixer_get_level; + dev->exit = esd_exit; +- dev->buf.len = ESD_BUF_SIZE; ++ dev->buf.len = 1024; + + NOTICE("ESD Initilize OK\n"); + return OK; +Index: xsystem35-1.7.3-pre5/src/audio_esd.h +=================================================================== +--- xsystem35-1.7.3-pre5.orig/src/audio_esd.h ++++ xsystem35-1.7.3-pre5/src/audio_esd.h +@@ -24,13 +24,14 @@ + #ifndef __AUDIO_ESD__ + #define __AUDIO_ESD__ + +-#include ++#include + + typedef struct { + int fdh; /* socket to host */ + int fds; /* stream socket discpriter */ + int sid; /* stream source id */ + int curvol; /* current volume setting */ ++ pa_simple *s; + } audio_esd_t; + + #define ESDNAME_BASE "xsystem35" +Index: xsystem35-1.7.3-pre5/src/mixer_esd.c +=================================================================== +--- xsystem35-1.7.3-pre5.orig/src/mixer_esd.c ++++ xsystem35-1.7.3-pre5/src/mixer_esd.c +@@ -24,7 +24,7 @@ + + #include + #include +-#include ++#include + #include + + #include "audio.h" +@@ -44,8 +44,6 @@ static void mixer_set_level(audiodevice_ + + lv = (level * 256) / 100; + +- esd_set_stream_pan(esd->fdh, esd->sid, lv, lv); +- + esd->curvol = lv; + } + diff -Nru xsystem35-1.7.3-pre5/debian/patches/04_sndcnv_64bit.patch xsystem35-1.7.3-pre5/debian/patches/04_sndcnv_64bit.patch --- xsystem35-1.7.3-pre5/debian/patches/04_sndcnv_64bit.patch 1970-01-01 00:00:00.000000000 +0000 +++ xsystem35-1.7.3-pre5/debian/patches/04_sndcnv_64bit.patch 2019-11-27 18:14:40.000000000 +0000 @@ -0,0 +1,27 @@ +Description: Fix 64-bit audio not working + On 64-bit architecture, all the sound effect is not working due to + LONG_MAX is too large for 32-bit integer. We fix it by using INT32_MAX + instead of LONG_MAX. +Author: Ying-Chun Liu (PaulLiu) +Last-Update: 2019-11-28 +Index: xsystem35-1.7.3-pre5/src/sndcnv.c +=================================================================== +--- xsystem35-1.7.3-pre5.orig/src/sndcnv.c ++++ xsystem35-1.7.3-pre5/src/sndcnv.c +@@ -23,6 +23,7 @@ + + #include + #include ++#include + #include + + #include "portab.h" +@@ -152,7 +153,7 @@ static int sndcnv_convert(pcmobj_t *pcm, + int len, i; + void *pr, *pl; + LONG isample = 0, osample = 0; +- LONG osampler = LONG_MAX, osamplel = LONG_MAX; ++ LONG osampler = INT32_MAX, osamplel = INT32_MAX; + + ibuf = g_malloc(outlen*2); + diff -Nru xsystem35-1.7.3-pre5/debian/patches/series xsystem35-1.7.3-pre5/debian/patches/series --- xsystem35-1.7.3-pre5/debian/patches/series 2018-11-05 19:56:37.000000000 +0000 +++ xsystem35-1.7.3-pre5/debian/patches/series 2019-11-27 18:00:18.000000000 +0000 @@ -2,3 +2,5 @@ 02_use_utf8.patch 02_modify_ttf_font_path.patch 03_remove_libltdl.patch +04_esd_to_pulseaudio.patch +04_sndcnv_64bit.patch diff -Nru xsystem35-1.7.3-pre5/debian/README.Debian xsystem35-1.7.3-pre5/debian/README.Debian --- xsystem35-1.7.3-pre5/debian/README.Debian 2018-11-05 20:33:13.000000000 +0000 +++ xsystem35-1.7.3-pre5/debian/README.Debian 2019-11-27 18:13:52.000000000 +0000 @@ -2,23 +2,23 @@ ----------------------- For most of the games, please run this command in the game directory. -"xsystem35 -no-shm -Os -devfont ttf" +"xsystem35 -no-shm -Oe -devfont ttf -Me -midiplayer timidity" -Please make sure you have mincho ttf font installed. +Because most of the games are in Japanese. So it actually needs some Japanese +fonts. Please make sure you have mincho ttf font installed. For example, +installing "fonts-takao-mincho" package in Debian. You don't need to change to another locale anymore. Just use any UTF-8 locales. +Some of the game content can be downloaded from http://retropc.net/alice/ -## The following are ancient and only works on Debian Stretch or - xsystem35 (<= 1.7.3-pre5-6) +## Audio parameters explanation. -Because most of the games are in Japanese. So it actually needs some Japanese -fonts and also need to be run in Japanese locales. Please make sure you -have generated ja_JP.UTF-8 locale. So you probabily need to run xsystem35 -inside the game directory by the following command: -"env LC_ALL=ja_JP.UTF-8 xsystem35 -no-shm -Os" -Just as an example, please modify the parameters according to your environment. +Example: "xsystem35 -no-shm -Oe -devfont ttf -Me -midiplayer timidity" -Some of the game content can be downloaded from http://retropc.net/alice/ + -Oe: Use *pulseaudio* as audio device. If you want to use ALSA, please change + it to -Os + -Me: Use external midi player. We need to assign it by -midiplayer. The + example shows that we are using timidity. -- Ying-Chun Liu (PaulLiu) Tue, 06 Nov 2018 04:20:10 +0800 diff -Nru xsystem35-1.7.3-pre5/debian/rules xsystem35-1.7.3-pre5/debian/rules --- xsystem35-1.7.3-pre5/debian/rules 2018-11-05 21:20:01.000000000 +0000 +++ xsystem35-1.7.3-pre5/debian/rules 2019-11-27 14:54:59.000000000 +0000 @@ -13,13 +13,15 @@ override_dh_auto_configure: dh_auto_configure -- --bindir=/usr/games \ --libdir=/usr/lib/games/xsystem35 \ - --enable-audio=default,alsa,oss \ + --enable-audio=default,alsa,oss,esd \ --enable-cdrom=default,linux,mp3 \ --enable-midi=extp,raw,seq \ --enable-pkg-config \ --enable-debug \ --with-ft-exec-prefix=$(CURDIR)/debian \ - LDFLAGS="$(LDFLAGS) -lX11 -lltdl" + LDFLAGS="$(LDFLAGS) -lX11 -lltdl" \ + ESD_CONFIG=$(CURDIR)/debian/esd-config \ + --disable-esdtest override_dh_auto_build: xsystem35.6 dh_auto_build diff -Nru xsystem35-1.7.3-pre5/debian/xsystem35.xml xsystem35-1.7.3-pre5/debian/xsystem35.xml --- xsystem35-1.7.3-pre5/debian/xsystem35.xml 2010-08-31 18:28:04.000000000 +0000 +++ xsystem35-1.7.3-pre5/debian/xsystem35.xml 2019-11-27 18:03:21.000000000 +0000 @@ -214,7 +214,7 @@ - Enlightened Sound Daemon mode + Pulseaudio Daemon mode