diff options
author | Sébastien Leduc | 2015-07-13 11:04:55 +0200 |
---|---|---|
committer | Sébastien Leduc | 2015-07-13 11:04:55 +0200 |
commit | a0e15b4117d674f5814a509dc4b6706d2299a318 (patch) | |
tree | 935d2c3bf344bcfa018e6ae1054474de1da14d64 | |
download | aur-a0e15b4117d674f5814a509dc4b6706d2299a318.tar.gz |
initial commit for osmose (from AUR3)
-rw-r--r-- | .SRCINFO | 21 | ||||
-rw-r--r-- | PKGBUILD | 43 | ||||
-rw-r--r-- | osmose.desktop | 10 | ||||
-rw-r--r-- | osmose.patch | 472 | ||||
-rw-r--r-- | osmose.png | bin | 0 -> 9089 bytes |
5 files changed, 546 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..0abe6fdc7a17 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,21 @@ +pkgbase = osmose + pkgdesc = A Sega Master System / Gamegear console emulator + pkgver = 0.9.96 + pkgrel = 4 + url = http://bcz.asterope.fr + arch = i686 + arch = x86_64 + license = GPL + makedepends = mesa + depends = qt4 + source = http://bcz.asterope.fr/osmose/Osmose-0-9-96-QT.zip + source = osmose.desktop + source = osmose.png + source = osmose.patch + md5sums = 256b393d83270620e98f39e0cfb11359 + md5sums = 8189b6d17735eab45cace7723eb574f7 + md5sums = ed9aed5b68cbe81bc69ede1893958750 + md5sums = 403cc66c15528d75615f4f2cf3438873 + +pkgname = osmose + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..ba18f9535363 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,43 @@ +# Maintainer: Sebastien Leduc <sebastien@sleduc.fr> +# Contributor: Laurent Carlier <lordheavym@gmail.com> +# Contributor: Christoph Zeiler <rabyte*gmail> +# Contributor: Scott Cassidy <scottlc@cpan.org> +# Contributor: Benjamin Robin <benjarobin> + +pkgname=osmose +pkgver=0.9.96 +pkgrel=4 +pkgdesc="A Sega Master System / Gamegear console emulator" +arch=('i686' 'x86_64') +url="http://bcz.asterope.fr" +license=('GPL') +makedepends=('mesa') +depends=('qt4') +source=("http://bcz.asterope.fr/osmose/Osmose-${pkgver//./-}-QT.zip" + 'osmose.desktop' 'osmose.png' 'osmose.patch') + +md5sums=('256b393d83270620e98f39e0cfb11359' + '8189b6d17735eab45cace7723eb574f7' + 'ed9aed5b68cbe81bc69ede1893958750' + '403cc66c15528d75615f4f2cf3438873') + +build() { + cd "$srcdir/Osmose-${pkgver//./-}-QT" + patch -p1 < ../osmose.patch + + rm -Rf ../build + mkdir ../build + cd ../build + + qmake-qt4 ../Osmose-${pkgver//./-}-QT + make +} + +package() { + cd "$pkgdir" + + install -D -m755 ${srcdir}/build/osmose usr/bin/osmose + + install -D -m644 ${srcdir}/osmose.desktop usr/share/applications/osmose.desktop + install -D -m644 ${srcdir}/osmose.png usr/share/pixmaps/osmose.png +} diff --git a/osmose.desktop b/osmose.desktop new file mode 100644 index 000000000000..0fb783394295 --- /dev/null +++ b/osmose.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=Osmose +GenericName=A Sega Master System emulator +Exec=osmose +Icon=/usr/share/pixmaps/osmose.png +Type=Application +Categories=System;Emulator; +Encoding=UTF-8 + + diff --git a/osmose.patch b/osmose.patch new file mode 100644 index 000000000000..8c3ea59e2698 --- /dev/null +++ b/osmose.patch @@ -0,0 +1,472 @@ +diff -U 3 -b -B -r -N -- a/Joystick.cpp b/Joystick.cpp +--- a/Joystick.cpp 2013-02-15 21:03:34.651799381 +0100 ++++ b/Joystick.cpp 2013-02-15 21:02:58.125330595 +0100 +@@ -33,6 +33,8 @@ + */ + + #include "Joystick.h" ++#include <sys/types.h> ++#include <unistd.h> + + /** + * Constructor. Throw an exception in case of failure. +@@ -41,10 +43,8 @@ + * Param2 : The JoystickListener that will be notified with jostick events + * + */ +-Joystick::Joystick(char *dev_name, JoystickListener *lstnr) ++Joystick::Joystick(const char *dev_name, JoystickListener *lstnr) + { +- mutex = PTHREAD_MUTEX_INITIALIZER; +- + // Try to open the device. + joystickFD = ::open(dev_name, O_RDONLY | O_NONBLOCK); + if (joystickFD < 0) +@@ -118,7 +118,7 @@ + { + int bytes_read; + +- bytes_read = read(joystickFD, jse, sizeof(*jse)); ++ bytes_read = ::read(joystickFD, jse, sizeof(*jse)); + + // Handle errors !!! + if (bytes_read == -1) +diff -U 3 -b -B -r -N -- a/Joystick.h b/Joystick.h +--- a/Joystick.h 2013-02-15 21:03:34.648466066 +0100 ++++ b/Joystick.h 2013-02-15 21:02:58.121997280 +0100 +@@ -68,7 +68,7 @@ + { + public: + +- Joystick(char *dev_name, JoystickListener *l); ++ Joystick(const char *dev_name, JoystickListener *l); + const char * getStrID() { return joystickID; } + const char * getDeviceName() { return deviceName; } + void setListener(JoystickListener *lstnr) { listener = lstnr; } +@@ -95,7 +95,6 @@ + JoystickListener *listener; + int pollingPeriod; + bool done; +- pthread_mutex_t mutex; + + bool readDevice(struct js_event *jse); + +diff -U 3 -b -B -r -N -- a/Osmose-0-9-96-QT.pro b/Osmose-0-9-96-QT.pro +--- a/Osmose-0-9-96-QT.pro 2013-02-15 21:03:34.651799381 +0100 ++++ b/Osmose-0-9-96-QT.pro 2013-02-15 21:02:58.125330595 +0100 +@@ -1,13 +1,16 @@ +-###################################################################### +-# Automatically generated by qmake (2.01a) sam. avr. 30 07:19:19 2011 +-###################################################################### + ++QT += core gui opengl ++TARGET = osmose + TEMPLATE = app +-TARGET = ++ + DEPENDPATH += . cpu osmose unzip + INCLUDEPATH += . cpu osmose unzip ++ + LIBS += -lz -lasound +-QT+=opengl ++ ++FLAGS = -Wall -Wextra -Wunused -Wcast-qual ++QMAKE_CXXFLAGS += -std=c++11 $$FLAGS ++QMAKE_CFLAGS += -Wmissing-prototypes -Wshadow $$FLAGS + + # Input + HEADERS += EmulationThread.h \ +@@ -48,7 +51,7 @@ + unzip/crypt.h \ + unzip/ioapi.h \ + unzip/unzip.h +-FORMS += Configuration.ui LogWindow.ui ++ + SOURCES += EmulationThread.cpp \ + Joystick.cpp \ + KeyMapper.cpp \ +@@ -86,3 +89,5 @@ + osmose/WaveWriter.cpp \ + unzip/ioapi.c \ + unzip/unzip.c ++ ++FORMS += Configuration.ui LogWindow.ui +diff -U 3 -b -B -r -N -- a/OsmoseGUI.cpp b/OsmoseGUI.cpp +--- a/OsmoseGUI.cpp 2013-02-15 21:03:34.651799381 +0100 ++++ b/OsmoseGUI.cpp 2013-02-15 21:02:58.125330595 +0100 +@@ -350,7 +350,7 @@ + js0 = NULL; + try + { +- js0 = new Joystick((char *)configuration->getJoystickDevice().c_str(), this); ++ js0 = new Joystick(configuration->getJoystickDevice().c_str(), this); + string msg = "Found Joystick :"; + msg = msg + js0->getStrID(); + QLogWindow::getInstance()->appendLog(msg); +@@ -683,7 +683,7 @@ + void OsmoseGUI::saveState() + { + if (osmoseCore == NULL) return; +- bool success = osmoseCore->saveSaveState(saveStateSlot); ++ osmoseCore->saveSaveState(saveStateSlot); + } + + /** +@@ -691,7 +691,7 @@ + void OsmoseGUI::loadState() + { + if (osmoseCore == NULL) return; +- bool success = osmoseCore->loadSaveState(saveStateSlot); ++ osmoseCore->loadSaveState(saveStateSlot); + } + + /** +@@ -719,7 +719,7 @@ + void OsmoseGUI::saveVDPGFX() + { + if (osmoseCore == NULL) return; +- bool success = osmoseCore->captureTiles(); ++ osmoseCore->captureTiles(); + } + + /** +diff -U 3 -b -B -r -N -- a/Pthreadcpp.cpp b/Pthreadcpp.cpp +--- a/Pthreadcpp.cpp 2013-02-15 21:03:34.651799381 +0100 ++++ b/Pthreadcpp.cpp 2013-02-15 21:02:58.125330595 +0100 +@@ -95,7 +95,7 @@ + void *Thread::entryPoint(void *instance) + { + Thread *myself = (Thread *)instance; +- myself->run( myself->getArg()); ++ return myself->run( myself->getArg()); + } + + /** +diff -U 3 -b -B -r -N -- a/QLogWindow.cpp b/QLogWindow.cpp +--- a/QLogWindow.cpp 2013-02-15 21:03:34.651799381 +0100 ++++ b/QLogWindow.cpp 2013-02-15 21:02:58.125330595 +0100 +@@ -43,7 +43,7 @@ + return self; + } + +-void QLogWindow::appendLog(char *str) ++void QLogWindow::appendLog(const char *str) + { + QString msg(str); + QString time = getTimePrefix(); +diff -U 3 -b -B -r -N -- a/QLogWindow.h b/QLogWindow.h +--- a/QLogWindow.h 2013-02-15 21:03:34.651799381 +0100 ++++ b/QLogWindow.h 2013-02-15 21:02:58.125330595 +0100 +@@ -46,7 +46,7 @@ + ~QLogWindow(); + static QLogWindow *getInstance(QWidget *parent = 0); + void appendLog(string &); +- void appendLog(char *); ++ void appendLog(const char *); + void addSeparator(); + + protected slots: +diff -U 3 -b -B -r -N -- a/QOsmoseConfiguration.cpp b/QOsmoseConfiguration.cpp +--- a/QOsmoseConfiguration.cpp 2013-02-15 21:03:34.651799381 +0100 ++++ b/QOsmoseConfiguration.cpp 2013-02-15 21:02:58.125330595 +0100 +@@ -689,8 +689,6 @@ + /* JoystickListener interface */ + void QOsmoseConfiguration::buttonChanged(unsigned int button, bool pressed) + { +- QLabel *label; +- + switch(button) + { + case 0: +@@ -722,10 +720,12 @@ + + void QOsmoseConfiguration::xAxisChanged(int value) + { ++ Q_UNUSED(value) + } + + void QOsmoseConfiguration::yAxisChanged(int value) + { ++ Q_UNUSED(value) + } + + void QOsmoseConfiguration::joystickError() +diff -U 3 -b -B -r -N -- a/TGAWriter.cpp b/TGAWriter.cpp +--- a/TGAWriter.cpp 2013-02-15 21:03:34.758465470 +0100 ++++ b/TGAWriter.cpp 2013-02-15 21:02:58.128663911 +0100 +@@ -32,7 +32,7 @@ + + #include "TGAWriter.h" + +-TGAWriter::TGAWriter(char *filename, int width, int height) ++TGAWriter::TGAWriter(const char *filename, int width, int height) + { + /* Initialise TGA Header with the given informations.*/ + header.identsize = 0; +diff -U 3 -b -B -r -N -- a/TGAWriter.h b/TGAWriter.h +--- a/TGAWriter.h 2013-02-15 21:03:34.651799381 +0100 ++++ b/TGAWriter.h 2013-02-15 21:02:58.125330595 +0100 +@@ -60,7 +60,7 @@ + { + public: + +- TGAWriter(char *fn, int width, int height); ++ TGAWriter(const char *fn, int width, int height); + ~TGAWriter(); + bool isOk() {return isOk_;} + void writePixel(unsigned char r, unsigned char g,unsigned char b); +diff -U 3 -b -B -r -N -- a/osmose/MemoryMapper.cpp b/osmose/MemoryMapper.cpp +--- a/osmose/MemoryMapper.cpp 2013-02-15 21:03:34.758465470 +0100 ++++ b/osmose/MemoryMapper.cpp 2013-02-15 21:02:58.125330595 +0100 +@@ -764,7 +764,7 @@ + + ostringstream oss; + oss << "Cartdrige contains " << (int)bank16Ko_nbr << " 16Ko banks."; +- QLogWindow::getInstance()->appendLog((char *)oss.str().c_str()); ++ QLogWindow::getInstance()->appendLog(oss.str().c_str()); + // Allocate RAM for the whole cartridge. + if (rom_size < 65536) + { +@@ -833,7 +833,7 @@ + + ostringstream oss; + oss << "Cartdrige contains " << (int)bank16Ko_nbr << " 16Ko banks."; +- QLogWindow::getInstance()->appendLog((char *)oss.str().c_str()); ++ QLogWindow::getInstance()->appendLog(oss.str().c_str()); + + // Allocate RAM for the whole cartridge. + if (rom_size < 65536) +@@ -877,7 +877,7 @@ + { + oss << "ROM size is " << rom_size << " bytes (" << ((rom_size * 8)/1024)<< " kbits)."; + } +- QLogWindow::getInstance()->appendLog((char *)oss.str().c_str()); ++ QLogWindow::getInstance()->appendLog(oss.str().c_str()); + } + + /*------------------------------------------------------------*/ +diff -U 3 -b -B -r -N -- a/osmose/OsmoseCore.cpp b/osmose/OsmoseCore.cpp +--- a/osmose/OsmoseCore.cpp 2013-02-15 21:03:34.758465470 +0100 ++++ b/osmose/OsmoseCore.cpp 2013-02-15 21:02:58.125330595 +0100 +@@ -251,7 +251,6 @@ + // Draw tiles there. + for (int o=0; o<28;o++) + { +- int tile = 0; + for (int i=0; i<16;i++) + { + int tile = map_p; +@@ -261,7 +260,7 @@ + } + + /* Save the buffer. */ +- TGAWriter tgaFile((char *)oss.str().c_str(), 128, 224); ++ TGAWriter tgaFile(oss.str().c_str(), 128, 224); + if (tgaFile.isOk() == true) + { + for (int y=223; y>=0; y--) +@@ -350,7 +349,7 @@ + oss << configuration->getScreenshotPath() << "/" << game_name << "-" << screenshotNbr << ".tga"; + screenshotNbr++; + +- TGAWriter tgaFile((char *)oss.str().c_str(), 256, 192); ++ TGAWriter tgaFile(oss.str().c_str(), 256, 192); + if (tgaFile.isOk() == true) + { + for (int y=191; y>=0; y--) +@@ -431,7 +430,7 @@ + + save_state_name << configuration->getSaveStatePath() << "/" << mem->getROMName() << "_slot_" << slot <<".sta"; + +- ofstream output_file((char *)save_state_name.str().c_str(), ios::out | ios::binary ); ++ ofstream output_file(save_state_name.str().c_str(), ios::out | ios::binary ); + if (output_file.is_open() == false ) + { + string msg = "Cannot create save state file:" + save_state_name.str(); +@@ -487,7 +486,7 @@ + ostringstream load_state_name; + load_state_name << configuration->getSaveStatePath() << "/" << mem->getROMName() << "_slot_" << slot <<".sta"; + +- ifstream input_file((char *)load_state_name.str().c_str(), ios::in | ios::binary); ++ ifstream input_file(load_state_name.str().c_str(), ios::in | ios::binary); + if (input_file.is_open() == false ) + { + string msg = "Fail to load state from file : " + load_state_name.str(); +diff -U 3 -b -B -r -N -- a/osmose/SoundThread.cpp b/osmose/SoundThread.cpp +--- a/osmose/SoundThread.cpp 2013-02-15 21:03:34.758465470 +0100 ++++ b/osmose/SoundThread.cpp 2013-02-15 21:02:58.125330595 +0100 +@@ -61,6 +61,8 @@ + */ + void* SoundThread::run(void *p) + { ++ (void)p; ++ + SoundThreadState local_state_copy; + + { +diff -U 3 -b -B -r -N -- a/unzip/crypt.h b/unzip/crypt.h +--- a/unzip/crypt.h 2013-02-15 21:03:34.755132155 +0100 ++++ b/unzip/crypt.h 2013-02-15 21:02:58.125330595 +0100 +@@ -38,6 +38,8 @@ + * unpredictable manner on 16-bit systems; not a problem + * with any known compiler so far, though */ + ++ (void)pcrc_32_tab; ++ + temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; + return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); + } +diff -U 3 -b -B -r -N -- a/unzip/ioapi.c b/unzip/ioapi.c +--- a/unzip/ioapi.c 2013-02-15 21:03:34.755132155 +0100 ++++ b/unzip/ioapi.c 2013-02-15 21:02:58.125330595 +0100 +@@ -70,6 +70,8 @@ + const char* filename; + int mode; + { ++ (void)opaque; ++ + FILE* file = NULL; + const char* mode_fopen = NULL; + if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) +@@ -93,6 +95,8 @@ + void* buf; + uLong size; + { ++ (void)opaque; ++ + uLong ret; + ret = fread(buf, 1, (size_t)size, (FILE *)stream); + return ret; +@@ -105,6 +109,8 @@ + const void* buf; + uLong size; + { ++ (void)opaque; ++ + uLong ret; + ret = fwrite(buf, 1, (size_t)size, (FILE *)stream); + return ret; +@@ -114,6 +120,8 @@ + voidpf opaque; + voidpf stream; + { ++ (void)opaque; ++ + long ret; + ret = ftell((FILE *)stream); + return ret; +@@ -125,6 +133,8 @@ + uLong offset; + int origin; + { ++ (void)opaque; ++ + int fseek_origin=0; + long ret; + switch (origin) +@@ -149,6 +159,8 @@ + voidpf opaque; + voidpf stream; + { ++ (void)opaque; ++ + int ret; + ret = fclose((FILE *)stream); + return ret; +@@ -158,6 +170,8 @@ + voidpf opaque; + voidpf stream; + { ++ (void)opaque; ++ + int ret; + ret = ferror((FILE *)stream); + return ret; +diff -U 3 -b -B -r -N -- a/unzip/unzip.c b/unzip/unzip.c +--- a/unzip/unzip.c 2013-02-15 21:03:34.755132155 +0100 ++++ b/unzip/unzip.c 2013-02-15 21:02:58.125330595 +0100 +@@ -607,12 +607,12 @@ + + + /* we check the magic */ +- if (err==UNZ_OK) ++ if (err==UNZ_OK) { + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) + err=UNZ_ERRNO; + else if (uMagic!=0x02014b50) + err=UNZ_BADZIPFILE; +- ++ } + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.version) != UNZ_OK) + err=UNZ_ERRNO; + +@@ -687,14 +687,16 @@ + else + uSizeRead = extraFieldBufferSize; + +- if (lSeek!=0) ++ if (lSeek!=0) { + if (ZSEEK(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) + lSeek=0; + else + err=UNZ_ERRNO; +- if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0)) ++ } ++ if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0)) { + if (ZREAD(s->z_filefunc, s->filestream,extraField,uSizeRead)!=uSizeRead) + err=UNZ_ERRNO; ++ } + lSeek += file_info.size_file_extra - uSizeRead; + } + else +@@ -712,14 +714,16 @@ + else + uSizeRead = commentBufferSize; + +- if (lSeek!=0) ++ if (lSeek!=0) { + if (ZSEEK(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) + lSeek=0; + else + err=UNZ_ERRNO; +- if ((file_info.size_file_comment>0) && (commentBufferSize>0)) ++ } ++ if ((file_info.size_file_comment>0) && (commentBufferSize>0)) { + if (ZREAD(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead) + err=UNZ_ERRNO; ++ } + lSeek+=file_info.size_file_comment - uSizeRead; + } + else +@@ -975,12 +979,12 @@ + return UNZ_ERRNO; + + +- if (err==UNZ_OK) ++ if (err==UNZ_OK) { + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) + err=UNZ_ERRNO; + else if (uMagic!=0x04034b50) + err=UNZ_BADZIPFILE; +- ++ } + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) + err=UNZ_ERRNO; + /* +@@ -1163,7 +1167,7 @@ + if (password != NULL) + { + int i; +- s->pcrc_32_tab = get_crc_table(); ++ s->pcrc_32_tab = (const unsigned long *)get_crc_table(); + init_keys(password,s->keys,s->pcrc_32_tab); + if (ZSEEK(s->z_filefunc, s->filestream, + s->pfile_in_zip_read->pos_in_zipfile + +@@ -1519,7 +1523,6 @@ + char *szComment; + uLong uSizeBuf; + { +- int err=UNZ_OK; + unz_s* s; + uLong uReadThis ; + if (file==NULL) diff --git a/osmose.png b/osmose.png Binary files differnew file mode 100644 index 000000000000..9ca9f4171766 --- /dev/null +++ b/osmose.png |