Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bin/**
build/**
projects/buildPSP/**
tracks/**
tracks/**
4 changes: 4 additions & 0 deletions projects/BUILD_HOW_TO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ GP2X: Compile under minsys
PSP: Compile under minsys

DINGOO: Compile under Linux

RS97: Compile under Linux and type make PLATFORM=RS97

Bittboy: Compile under Linux and type make PLATFORM=BITTBOY
60 changes: 60 additions & 0 deletions projects/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,32 @@ DINGOODIRS := . \
../sources/Adapters/SDL/GUI \
../sources/Adapters/SDL/Timer

RS97DIRS := . \
../sources/Adapters/DINGOO/Main \
../sources/Adapters/Unix/FileSystem \
../sources/System/Process \
../sources/Adapters/Unix/Process \
../sources/Adapters/DINGOO/System \
../sources/Adapters/DINGOO/Midi \
../sources/Adapters/DINGOO/Audio \
../sources/Adapters/SDL/Audio \
../sources/Adapters/SDL/Process \
../sources/Adapters/SDL/GUI \
../sources/Adapters/SDL/Timer

BITTBOYDIRS := . \
../sources/Adapters/DINGOO/Main \
../sources/Adapters/Unix/FileSystem \
../sources/System/Process \
../sources/Adapters/Unix/Process \
../sources/Adapters/DINGOO/System \
../sources/Adapters/DINGOO/Midi \
../sources/Adapters/DINGOO/Audio \
../sources/Adapters/SDL/Audio \
../sources/Adapters/SDL/Process \
../sources/Adapters/SDL/GUI \
../sources/Adapters/SDL/Timer

PSPDIRS := . \
../sources/Adapters/PSP/Main \
../sources/Adapters/PSP/FileSystem \
Expand Down Expand Up @@ -199,6 +225,40 @@ DINGOOFILES := GPSDLMain.o \
SDLEventManager.o \
SDLGUIWindowImp.o

RS97FILES := GPSDLMain.o \
UnixFileSystem.o \
DINGOOAudio.o \
Process.o \
UnixProcess.o \
SDLAudioDriver.o \
DINGOOAudioDriver.o \
DINGOOSystem.o \
DINGOOEventQueue.o \
SDLProcess.o \
SDLTimer.o \
GUIFactory.o \
SDLEventManager.o \
DINGOOSerialMidiDevice.o \
DINGOOMidiService.o \
SDLGUIWindowImp.o

BITTBOYFILES := GPSDLMain.o \
UnixFileSystem.o \
DINGOOAudio.o \
Process.o \
UnixProcess.o \
SDLAudioDriver.o \
DINGOOAudioDriver.o \
DINGOOSystem.o \
DINGOOEventQueue.o \
SDLProcess.o \
SDLTimer.o \
GUIFactory.o \
SDLEventManager.o \
DINGOOSerialMidiDevice.o \
DINGOOMidiService.o \
SDLGUIWindowImp.o

PSPFILES := PSPmain.o \
PSPFileSystem.o \
Process.o \
Expand Down
19 changes: 19 additions & 0 deletions projects/Makefile.BITTBOY
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

DEVKIT=/opt/bittboy-toolchain

TARGET = lgpt.elf

TOOLPATH=$(DEVKIT)/usr/bin
PREFIX := arm-linux-
SDL_BASE = /opt/bittboy-toolchain/usr/arm-miyoo-linux-musleabi/sysroot/usr/bin/

include $(PWD)/bittboy_rules

CFLAGS := `$(SDL_BASE)sdl-config --cflags` -O3 -D_NDEBUG -D_NO_JACK_ -Wall -DPLATFORM_DINGOO -I$(PWD)/../sources -D__LINUX_ALSA__ -DCPP_MEMORY -DRS97

CXXFLAGS:= $(CFLAGS) -fpermissive -std=gnu++03

EXTENSION:= elf

LIBS := -lSDL -lasound -lpthread
LIBDIRS := $(DEKVIT)/usr/lib
19 changes: 19 additions & 0 deletions projects/Makefile.RS97
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

DEVKIT=/opt/rs97-toolchain

TARGET = lgpt.dge

TOOLPATH=$(DEVKIT)/usr/bin
PREFIX := mipsel-linux-
SDL_BASE = /opt/rs97-toolchain/usr/mipsel-buildroot-linux-musl/sysroot/usr/bin/

include $(PWD)/rs97_rules

CFLAGS := `$(SDL_BASE)sdl-config --cflags` -O3 -D_NDEBUG -D_NO_JACK_ -Wall -DPLATFORM_DINGOO -I$(PWD)/../sources -D__LINUX_OSS__ -DCPP_MEMORY -DRS97 -DUSB_TTY

CXXFLAGS:= $(CFLAGS) -fpermissive -std=gnu++03

EXTENSION:= dge

LIBS := -lSDL -lpthread
LIBDIRS := $(DEKVIT)/usr/lib
9 changes: 9 additions & 0 deletions projects/bittboy_rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-include $(PWD)/base_rules

#STRIP = arm-linux-strip
STRIP = ls

#---------------------------------------------------------------------------------
%.elf: $(OFILES)
$(CXX) $(LDFLAGS) -o $@ $(OFILES) $(LIBS)
@$(STRIP) $@
9 changes: 9 additions & 0 deletions projects/rs97_rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-include $(PWD)/base_rules

#STRIP = mipsel-linux-strip
STRIP = ls

#---------------------------------------------------------------------------------
%.dge: $(OFILES)
$(CXX) $(LDFLAGS) -o $@ $(OFILES) $(LIBS)
@$(STRIP) $@
2 changes: 1 addition & 1 deletion sources/Adapters/DINGOO/Midi/DINGOOMidiService.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

#include "DINGOOMidiService.h"
#include "DINGOOSerialMidiDevice.h"
#include "System/io/Trace.h"
//#include "System/io/Trace.h"

DINGOOMidiService::DINGOOMidiService() {
} ;
Expand Down
31 changes: 20 additions & 11 deletions sources/Adapters/DINGOO/Midi/DINGOOSerialMidiDevice.cpp
Original file line number Diff line number Diff line change
@@ -1,30 +1,39 @@

#include "DINGOOSerialMidiDevice.h"
#include "System/io/Trace.h"
//#include "System/io/Trace.h"
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/signal.h>
#include <signal.h>
#include <sys/types.h>
#include <memory.h>

const char *port="/dev/ttyS0" ;
//const char *port="/dev/usb/tts/0" ;
#define BAUDRATE B38400
#ifdef USB_TTY
const char *port="/dev/usb/tts/0" ;
#else
const char *port="/dev/ttyS1" ;
#endif

//#define BAUDRATE B38400
#define BAUDRATE B57600

#ifdef RS97
DINGOOSerialMidiDevice::DINGOOSerialMidiDevice():MidiOutDevice("RS-97 Serial") {
#else
DINGOOSerialMidiDevice::DINGOOSerialMidiDevice():MidiOutDevice("DINGOO Serial") {
#endif
fd_=0 ;
} ;

bool DINGOOSerialMidiDevice::Init(){

struct termios newtio;

Trace::Debug("about to open port") ;
printf("about to open port\n") ;
fd_ = open(port, O_RDWR /*| O_NOCTTY | O_NDELAY*/ );
if (fd_ <=0) {Trace::Dump("Failed to open %",port); fd_=0 ;return false ; }
Trace::Dump("opened serial successfully %x",fd_) ;
if (fd_ <=0) {printf("Failed to open %s",port); fd_=0 ;return false ; }
//Trace::Dump("opened serial successfully %x",fd_) ;
printf("opened serial successfully");
tcgetattr(fd_,&oldtio_); /* save current port settings */

memset(&newtio,0,sizeof(newtio)) ;
Expand All @@ -40,9 +49,9 @@ bool DINGOOSerialMidiDevice::Init(){
tcflush(fd_, TCIFLUSH);
int code=tcsetattr(fd_,TCSANOW,&newtio);
if (code<0) {
Trace::Dump("Failed to set attributes") ;
printf("Failed to set attributes\n") ;
} else {
Trace::Debug("Serial attributes set") ;
printf("Serial attributes set\n") ;
}

return (code>=0) ;
Expand Down Expand Up @@ -77,7 +86,7 @@ void DINGOOSerialMidiDevice::SendMessage(MidiMessage &msg) {
len=3 ;
}
write(fd_,buffer,len);
Trace::Debug("Sending 0x%x 0x%x 0x%x",buffer[0],buffer[1],buffer[2]) ;
printf("Sending 0x%x 0x%x 0x%x\n",buffer[0],buffer[1],buffer[2]) ;
}

} ;
16 changes: 12 additions & 4 deletions sources/Adapters/DINGOO/System/DINGOOSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "Adapters/SDL/GUI/SDLEventManager.h"
#include "Adapters/SDL/Process/SDLProcess.h"
#include "Adapters/DINGOO/Audio/DINGOOAudio.h"
#include "Adapters/Dummy/Midi/DummyMidi.h"
#include "Adapters/DINGOO/Midi/DINGOOMidiService.h"
#include "Externals/TinyXML/tinyxml.h"
#include "Application/Model/Config.h"
#include "Application/Controllers/ControlRoom.h"
Expand All @@ -22,6 +22,9 @@
#include <sys/time.h>
#include <malloc.h>
#include <stdlib.h>
#include <malloc.h>
#include <stdlib.h>
#include <string.h>

EventManager *GPSDLSystem::eventManager_ = NULL ;
bool GPSDLSystem::invert_=false ;
Expand Down Expand Up @@ -76,7 +79,7 @@ void GPSDLSystem::Boot(int argc,char **argv) {
Audio::Install(new DINGOOAudio(hint)) ;

// Install Midi
MidiService::Install(new DummyMidi()) ;
MidiService::Install(new DINGOOMidiService()) ;

// Install Threads

Expand Down Expand Up @@ -200,6 +203,11 @@ void GPSDLSystem::PostQuitMessage()

unsigned int GPSDLSystem::GetMemoryUsage()
{
struct mallinfo m=mallinfo();
return m.uordblks ;
#ifdef RS97
return 1000000;
#else
struct mallinfo mi;
mi = mallinfo();
return mi.uordblks ;
#endif
}
10 changes: 10 additions & 0 deletions sources/Adapters/SDL/GUI/SDLGUIWindowImp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,21 @@ SDLGUIWindowImp::SDLGUIWindowImp(GUICreateWindowParams &p)
int screenWidth = 480;
int screenHeight = 272;
windowed_ = false;
#elif defined(RS97)
int screenWidth = 320;
int screenHeight = 240;
windowed_ = false;
#else
int screenWidth = videoInfo->current_w;
int screenHeight = videoInfo->current_h;
#endif

#if defined(RS97)
/* Pick the best bitdepth for the RS97 as it will select 32 as its default, even though that's slow */
bitDepth_ = 16;
#else
bitDepth_ = videoInfo->vfmt->BitsPerPixel;
#endif

char driverName[64] ;
SDL_VideoDriverName(driverName,64);
Expand Down
15 changes: 14 additions & 1 deletion sources/Adapters/SDL/Input/SDLInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "SDLInput.h"
#include "Application/Model/Config.h"


/*
int keyMapping[]={
SDLK_a,
SDLK_s,
Expand All @@ -14,6 +14,19 @@ int keyMapping[]={
SDLK_LCTRL,
SDLK_SPACE
} ;
*/

int keyMapping[]={
SDLK_LCTRL,
SDLK_LALT,
SDLK_LEFT,
SDLK_RIGHT,
SDLK_UP,
SDLK_DOWN,
SDLK_SPACE,
SDLK_LSHIFT,
SDLK_RETURN
} ;

int eventMapping[]={
SDLI_BUTTON_A,
Expand Down