DS: Remove old audio code

This commit is contained in:
Cameron Cawley 2020-07-23 14:22:16 +01:00 committed by Eugene Sandulenko
parent 95ec266795
commit aa3b16e88e
11 changed files with 5 additions and 586 deletions

5
.gitignore vendored
View File

@ -69,12 +69,7 @@ lib*.a
/backends/platform/dc/SCUMMVM.BIN
/backends/platform/dc/*.PLG
/backends/platform/ds/arm7/arm7.bin
/backends/platform/ds/arm7/build
/backends/platform/ds/arm7/source/libcartreset/*.bak
/backends/platform/ds/arm7/source/libcartreset/*.d
/backends/platform/ds/arm9/data/*.h
/backends/platform/ds/arm9/scummvm-?
/backends/platform/maemo/scummvm

View File

@ -1,273 +0,0 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
//////////////////////////////////////////////////////////////////////
// Simple ARM7 stub (sends RTC, TSC, and X/Y data to the ARM 9)
// -- joat
// -- modified by Darkain and others
//////////////////////////////////////////////////////////////////////
#include <nds.h>
#include <bios.h>
#include <arm7/touch.h>
#include <arm7/clock.h>
#include <arm7/audio.h>
#include <system.h>
#include <stdlib.h>
#include <string.h>
#include <registers_alt.h> // Needed for SOUND_CR
#include <NDS/scummvm_ipc.h>
//////////////////////////////////////////////////////////////////////
#ifdef USE_DEBUGGER
#include <dswifi7.h>
#endif
vu8 *soundData;
vu8 *soundBuffer;
vu8 *arm9Buffer;
bool soundFilled[4];
int playingSection;
int temp;
int adpcmBufferNum = 0;
s8 getFreeSoundChannel() {
for (int i = 0; i < 16; i++) {
if ( (SCHANNEL_CR(i) & SCHANNEL_ENABLE) == 0 )
return i;
}
return -1;
}
void startSound(int sampleRate, const void *data, uint32 bytes, u8 channel = 0, u8 vol = 0x7F, u8 pan = 63, u8 format = 0) {
channel = getFreeSoundChannel();
if (channel > 1)
channel = 1;
bytes &= ~7; // Multiple of 4 bytes!
SCHANNEL_CR(channel) = 0;
SCHANNEL_TIMER(channel) = SOUND_FREQ(sampleRate);
SCHANNEL_SOURCE(channel) = (uint32)data;
SCHANNEL_LENGTH(channel) = (bytes & 0x7FFFFFFF) >> 2;
SCHANNEL_REPEAT_POINT(channel) = 0;
SCHANNEL_CR(channel + 2) = 0;
SCHANNEL_TIMER(channel + 2) = SOUND_FREQ(sampleRate);
SCHANNEL_SOURCE(channel + 2) = (uint32)data;
SCHANNEL_LENGTH(channel + 2) = (bytes & 0x7FFFFFFF) >> 2;
SCHANNEL_REPEAT_POINT(channel + 2) = 0;
uint32 flags = SCHANNEL_ENABLE | SOUND_VOL(vol) | SOUND_PAN(pan);
switch (format) {
case 1: {
flags |= SOUND_FORMAT_8BIT;
flags |= SOUND_REPEAT;
break;
}
case 0: {
flags |= SOUND_FORMAT_16BIT;
flags |= SOUND_REPEAT;
break;
}
case 2: {
flags |= SOUND_FORMAT_ADPCM;
flags |= SOUND_ONE_SHOT;
SCHANNEL_SOURCE(channel) = (unsigned int)IPC->adpcm.buffer[0];
SCHANNEL_LENGTH(channel) = ((bytes + 4) & 0x7FFFFFFF) >> 2;
SCHANNEL_CR(channel + 1) = 0;
SCHANNEL_SOURCE(channel + 1) = (unsigned int)IPC->adpcm.buffer[0];
SCHANNEL_LENGTH(channel + 1) = ((bytes + 4) & 0x7FFFFFFF) >> 2;
SCHANNEL_TIMER(channel + 1) = SOUND_FREQ(sampleRate);
SCHANNEL_REPEAT_POINT(channel + 1) = 0;
SCHANNEL_CR(channel + 1) = flags;
temp = bytes;
adpcmBufferNum = 0;
break;
}
}
soundData = (vu8 *)data;
SCHANNEL_CR(channel) = flags;
SCHANNEL_CR(channel + 2) = flags;
if (channel == 0) {
for (volatile int i = 0; i < 16384 * 2; i++) {
// Delay loop - this makes everything stay in sync!
}
TIMER0_CR = 0;
TIMER0_DATA = SOUND_FREQ(sampleRate) * 2;
TIMER0_CR = TIMER_ENABLE | TIMER_DIV_1;
TIMER1_CR = 0;
TIMER1_DATA = 65536 - ((bytes & 0x7FFFFFFF) >> 3); // Trigger four times during the length of the buffer
TIMER1_CR = TIMER_ENABLE | TIMER_IRQ_REQ | TIMER_CASCADE;
playingSection = 0;
} else {
for (volatile int i = 0; i < 16384 * 2; i++) {
// Delay loop - this makes everything stay in sync!
}
TIMER2_CR = 0;
TIMER2_DATA = SOUND_FREQ(sampleRate) * 2;
TIMER2_CR = TIMER_ENABLE | TIMER_DIV_1;
TIMER3_CR = 0;
TIMER3_DATA = 65536 - ((bytes & 0x7FFFFFFF) >> 3); // Trigger four times during the length of the buffer
TIMER3_CR = TIMER_ENABLE | TIMER_IRQ_REQ | TIMER_CASCADE;
IPC->streamPlayingSection = 0;
}
}
void stopSound(int chan) {
SCHANNEL_CR(chan) = 0;
}
void InterruptTimer1() {
IPC->fillNeeded[playingSection] = true;
soundFilled[playingSection] = false;
if (playingSection == 3) {
playingSection = 0;
} else {
playingSection++;
}
IPC->playingSection = playingSection;
}
void InterruptTimer3() {
while (IPC->adpcm.semaphore); // Wait for buffer to become free if needed
IPC->adpcm.semaphore = true; // Lock the buffer structure to prevent clashing with the ARM7
IPC->streamFillNeeded[IPC->streamPlayingSection] = true;
if (IPC->streamPlayingSection == 3) {
IPC->streamPlayingSection = 0;
} else {
IPC->streamPlayingSection++;
}
IPC->adpcm.semaphore = false;
}
void VblankHandler() {
// sound code :)
TransferSound *snd = IPC->soundData;
IPC->soundData = 0;
if (snd) {
for (int i = 0; i < snd->count; i++) {
s8 chan = getFreeSoundChannel();
if (snd->data[i].rate > 0) {
if (chan >= 0) {
startSound(snd->data[i].rate, snd->data[i].data, snd->data[i].len, chan, snd->data[i].vol, snd->data[i].pan, snd->data[i].format);
}
} else {
stopSound(-snd->data[i].rate);
}
}
}
}
//---------------------------------------------------------------------------------
void VcountHandler() {
//---------------------------------------------------------------------------------
inputGetAndSend();
}
volatile bool exitflag = false;
//---------------------------------------------------------------------------------
void powerButtonCB() {
//---------------------------------------------------------------------------------
exitflag = true;
}
int main(int argc, char ** argv) {
// enable sound
SOUND_CR = SOUND_ENABLE | SOUND_VOL(0x7F);
IPC->soundData = 0;
for (int r = 0; r < 8; r++) {
IPC->adpcm.arm7Buffer[r] = (u8 *)malloc(512);
}
for (int r = 0; r < 4; r++) {
soundFilled[r] = false;
}
readUserSettings();
ledBlink(0);
irqInit();
// Start the RTC tracking IRQ
initClockIRQ();
fifoInit();
touchInit();
// mmInstall(FIFO_MAXMOD);
SetYtrigger(80);
// installWifiFIFO();
// installSoundFIFO();
installSystemFIFO();
irqSet(IRQ_VCOUNT, VcountHandler);
irqSet(IRQ_VBLANK, VblankHandler);
irqEnable(IRQ_VBLANK | IRQ_VCOUNT | IRQ_NETWORK);
irqSet(IRQ_TIMER1, InterruptTimer1);
irqEnable(IRQ_TIMER1);
irqSet(IRQ_TIMER3, InterruptTimer3);
irqEnable(IRQ_TIMER3);
setPowerButtonCB(powerButtonCB);
// Keep the ARM7 mostly idle
while (!exitflag) {
if ( 0 == (REG_KEYINPUT & (KEY_SELECT | KEY_START | KEY_L | KEY_R))) {
exitflag = true;
}
swiWaitForVBlank();
}
return 0;
}

View File

@ -80,7 +80,6 @@
#include <stdlib.h>
#include <string.h>
#include "NDS/scummvm_ipc.h"
#include "dsmain.h"
#include "osystem_ds.h"
#include "icons_raw.h"
@ -144,26 +143,11 @@ static int subScreenHeight = SCUMM_GAME_HEIGHT;
static int subScreenScale = 256;
// Sound
static int bufferSize;
static s16 *soundBuffer;
static int bufferFrame;
static int bufferRate;
static int bufferSamples;
static bool soundHiPart;
static int soundFrequency;
// Events
static int lastEventFrame;
static bool indyFightState;
static bool indyFightRight;
static OSystem_DS::SoundProc soundCallback;
static int lastCallbackFrame;
static bool bufferFirstHalf;
static bool bufferSecondHalf;
// Saved buffers
static bool highBuffer;
static bool displayModeIs8Bit = false;
@ -185,7 +169,6 @@ static int storedMouseY = 0;
// Sprites
static SpriteEntry sprites[128];
static SpriteEntry spritesMain[128];
static int tweak;
// Shake
static int s_shakeXOffset = 0;
@ -295,8 +278,6 @@ void setIcon(int num, int x, int y, int imageNum, int flags, bool enable);
void setIconMain(int num, int x, int y, int imageNum, int flags, bool enable);
void uploadSpriteGfx();
static TransferSound soundControl;
static bool isScrollingWithDPad() {
return (getKeysHeld() & (KEY_L | KEY_R)) != 0;
}
@ -339,31 +320,6 @@ controlType getControlType() {
return s_currentGame->control;
}
//plays an 8 bit mono sample at 11025Hz
void playSound(const void *data, u32 length, bool loop, bool adpcm, int rate) {
if (!IPC->soundData) {
soundControl.count = 0;
}
soundControl.data[soundControl.count].data = data;
soundControl.data[soundControl.count].len = length | (loop ? 0x80000000 : 0x00000000);
soundControl.data[soundControl.count].rate = rate; // 367 samples per frame
soundControl.data[soundControl.count].pan = 64;
soundControl.data[soundControl.count].vol = 127;
soundControl.data[soundControl.count].format = adpcm ? 2 : 0;
soundControl.count++;
DC_FlushAll();
IPC->soundData = &soundControl;
}
void stopSound(int channel) {
playSound(NULL, 0, false, false, -channel);
}
void updateOAM() {
DC_FlushAll();
@ -419,44 +375,6 @@ void saveGameBackBuffer() {
OSystem_DS::instance()->unlockScreen();
}
void startSound(int freq, int buffer) {
bufferRate = freq * 2;
bufferFrame = 0;
bufferSamples = 4096;
bufferFirstHalf = false;
bufferSecondHalf = true;
int bytes = (2 * (bufferSamples)) + 100;
soundBuffer = (s16 *) malloc(bytes * 2);
if (!soundBuffer)
consolePrintf("Sound buffer alloc failed\n");
soundHiPart = true;
for (int r = 0; r < bytes; r++) {
soundBuffer[r] = 0;
}
soundFrequency = freq;
swiWaitForVBlank();
swiWaitForVBlank();
playSound(soundBuffer, (bufferSamples * 2), true, false, freq * 2);
swiWaitForVBlank();
swiWaitForVBlank();
swiWaitForVBlank();
}
int getSoundFrequency() {
return soundFrequency;
}
void exitGame() {
s_currentGame = NULL;
}
@ -889,38 +807,6 @@ u16 *get8BitBackBuffer() {
return BG_GFX + 0x10000; // 16bit qty!
}
// The sound system in ScummVM seems to always return stereo interleaved samples.
// Here, I'm treating an 11Khz stereo stream as a 22Khz mono stream, which works sorta ok, but is
// a horrible bodge. Any advice on how to change the engine to output mono would be greatly
// appreciated.
void doSoundCallback() {
#ifdef HEAVY_LOGGING
consolePrintf("doSoundCallback...");
#endif
if (OSystem_DS::instance())
if (OSystem_DS::instance()->getMixerImpl()) {
lastCallbackFrame = frameCount;
for (int r = IPC->playingSection; r < IPC->playingSection + 4; r++) {
int chunk = r & 3;
if (IPC->fillNeeded[chunk]) {
IPC->fillNeeded[chunk] = false;
DC_FlushAll();
OSystem_DS::instance()->getMixerImpl()->mixCallback((byte *) (soundBuffer + ((bufferSamples >> 2) * chunk)), bufferSamples >> 1);
IPC->fillNeeded[chunk] = false;
DC_FlushAll();
}
}
}
#ifdef HEAVY_LOGGING
consolePrintf("done\n");
#endif
}
void doTimerCallback() {
if (callback) {
if (callbackTimer <= 0) {
@ -930,13 +816,6 @@ void doTimerCallback() {
}
}
void soundUpdate() {
bufferFrame++;
if (bufferFrame == bufferSize) {
bufferFrame = 0;
}
}
void memoryReport() {
int r = 0;
int *p;
@ -1649,19 +1528,6 @@ void updateStatus() {
}
void soundBufferEmptyHandler() {
REG_IF = IRQ_TIMER2;
// TIMER0
if ((callback) && (callbackTimer > 0)) {
callbackTimer--;
}
currentTimeMillis++;
// TIMER0 end
soundHiPart = !soundHiPart;
}
void setMainScreenScroll(int x, int y) {
BG3_CX = x + (((frameCount & 1) == 0)? 64: 0);
BG3_CY = y;
@ -1715,9 +1581,6 @@ void setZoomedScreenScale(int x, int y) {
}
void VBlankHandler(void) {
soundUpdate();
if ((!gameScreenSwap) && !isScrollingWithDPad()) {
if (s_currentGame) {
if (s_currentGame->control != CONT_SCUMM_SAMNMAX) {
@ -2051,7 +1914,6 @@ void initHardware() {
//irqs are nice
irqSet(IRQ_VBLANK, VBlankHandler);
irqSet(IRQ_TIMER0, timerTickHandler);
irqSet(IRQ_TIMER2, soundBufferEmptyHandler);
irqEnable(IRQ_VBLANK);
irqEnable(IRQ_TIMER0);
@ -2490,8 +2352,6 @@ void dsExceptionHandler() {
int main(void) {
soundCallback = NULL;
initHardware();
setExceptionHandler(dsExceptionHandler);
@ -2499,9 +2359,6 @@ int main(void) {
// Let arm9 read cartridge
*((u16 *) (0x04000204)) &= ~0x0080;
lastCallbackFrame = 0;
tweak = 0;
indyFightState = false;
indyFightRight = true;
@ -2578,8 +2435,6 @@ int main(void) {
g_system = new OSystem_DS();
assert(g_system);
IPC->adpcm.semaphore = false;
#if defined(DS_BUILD_A)
const char *argv[] = {"/scummvmds"};
#elif defined(DS_BUILD_B)

View File

@ -93,14 +93,6 @@ void setTimerCallback(OSystem_DS::TimerProc proc, int interval); // Setup a ca
int getMillis(bool skipRecord = false); // Return the current runtime in milliseconds
void doTimerCallback(); // Call callback function if required
// Sound
void doSoundCallback();
void startSound(int freq, int buffer); // Start sound hardware
// Call function if sound buffers need more data
void playSound(const void *data, u32 length, bool loop, bool adpcm = false, int rate = 22050); // Start a sound
void stopSound(int channel);
int getSoundFrequency();
// Event queue
void addEventsToQueue();
void VBlankHandler();

View File

@ -118,7 +118,6 @@ DSOptionsDialog::DSOptionsDialog() : GUI::Dialog(0, 0, 320 - 10, 230 - 40) {
_tab->addTab(_("General"), "");
_highQualityAudioCheckbox = new GUI::CheckboxWidget(_tab, 5, 5, 250, 20, _("High quality audio (slower) (reboot)"), U32String(), 0, 'T');
_disablePowerOff = new GUI::CheckboxWidget(_tab, 5, 20, 200, 20, _("Disable power off"), U32String(), 0, 'T');
_tab->setActiveTab(0);
@ -172,7 +171,6 @@ DSOptionsDialog::DSOptionsDialog() : GUI::Dialog(0, 0, 320 - 10, 230 - 40) {
_gammaCorrection->setValue(0);
}
_highQualityAudioCheckbox->setState(confGetBool("22khzaudio", false));
_disablePowerOff->setState(confGetBool("disablepoweroff", false));
#ifdef ALLOW_CPU_SCALER
@ -208,7 +206,6 @@ DSOptionsDialog::~DSOptionsDialog() {
void DSOptionsDialog::updateConfigManager() {
ConfMan.setBool("lefthanded", _leftHandedCheckbox->getState(), "ds");
ConfMan.setBool("unscaled", _unscaledCheckbox->getState(), "ds");
ConfMan.setBool("22khzaudio", _highQualityAudioCheckbox->getState(), "ds");
ConfMan.setBool("disablepoweroff", _disablePowerOff->getState(), "ds");
#ifdef ALLOW_CPU_SCALER
ConfMan.setBool("cpu_scaler", _cpuScaler->getState(), "ds");

View File

@ -63,7 +63,6 @@ protected:
GUI::CheckboxWidget *_150PercentCheckbox;
GUI::CheckboxWidget *_200PercentCheckbox;
GUI::CheckboxWidget *_indyFightCheckbox;
GUI::CheckboxWidget *_highQualityAudioCheckbox;
GUI::CheckboxWidget *_disablePowerOff;
GUI::CheckboxWidget *_showCursorCheckbox;
GUI::CheckboxWidget *_snapToBorderCheckbox;

View File

@ -111,13 +111,7 @@ void OSystem_DS::initBackend() {
_timerManager = new DefaultTimerManager();
DS::setTimerCallback(&OSystem_DS::timerHandler, 10);
if (ConfMan.hasKey("22khzaudio", "ds") && ConfMan.getBool("22khzaudio", "ds")) {
DS::startSound(22050, 8192);
} else {
DS::startSound(11025, 4096);
}
_mixer = new Audio::MixerImpl(DS::getSoundFrequency());
_mixer = new Audio::MixerImpl(11025);
_mixer->setReady(true);
EventsBaseBackend::initBackend();
@ -428,7 +422,6 @@ void OSystem_DS::updateScreen() {
}
DS::displayMode16BitFlipBuffer();
DS::doSoundCallback();
DS::addEventsToQueue();
// FIXME: Evil game specific hack.
@ -558,10 +551,7 @@ void OSystem_DS::delayMillis(uint msecs) {
int st = getMillis();
DS::addEventsToQueue();
DS::doSoundCallback();
while (st + msecs >= getMillis()) {
DS::doSoundCallback();
}
while (st + msecs >= getMillis());
DS::doTimerCallback();
DS::addEventsToQueue();

View File

@ -69,7 +69,6 @@ protected:
int _gammaValue;
public:
typedef void (*SoundProc)(byte *buf, int len);
typedef int (*TimerProc)(int interval);
OSystem_DS();
@ -137,7 +136,6 @@ public:
virtual void unlockScreen();
virtual Audio::Mixer *getMixer() { return _mixer; }
Audio::MixerImpl *getMixerImpl() { return _mixer; }
static int timerHandler(int t);

View File

@ -1,86 +0,0 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef SCUMMVM_IPC_INCLUDE
#define SCUMMVM_IPC_INCLUDE
//////////////////////////////////////////////////////////////////////
#include <nds/ndstypes.h>
#include <nds/ipc.h>
//////////////////////////////////////////////////////////////////////
typedef struct {
const void *data;
u32 len;
u32 rate;
u8 vol;
u8 pan;
u8 format;
u8 PADDING;
} TransferSoundData;
//---------------------------------------------------------------------------------
typedef struct {
TransferSoundData data[16];
u8 count;
u8 PADDING[3];
} TransferSound;
typedef struct {
u8 *buffer[8];
bool filled[8];
u8 *arm7Buffer[8];
bool arm7Dirty[8];
bool semaphore;
} adpcmBuffer;
//////////////////////////////////////////////////////////////////////
typedef struct scummvmTransferRegion {
TransferSound *soundData;
adpcmBuffer adpcm;
// These are used for ScummVMs sound output
bool fillNeeded[4];
int playingSection;
// Streaming sound
bool streamFillNeeded[4];
int streamPlayingSection;
} scummTransferRegion;
//////////////////////////////////////////////////////////////////////
#undef IPC
#define IPC ((scummTransferRegion volatile *)(0x027FF000))
#endif

View File

@ -93,15 +93,15 @@ all: scummvm.nds
clean: dsclean
dsclean:
$(RM) $(addprefix $(ndsdir)/, $(ARM7_MODULE_OBJS)) scummvm.nds
$(RM) scummvm.nds
$(RM_REC) romfs
.PHONY: dsclean
# TODO: Add a 'dsdist' target ?
%.nds: %.elf $(ndsdir)/arm7/arm7.elf romfs
ndstool -c $@ -9 $< -7 $(ndsdir)/arm7/arm7.elf -b $(srcdir)/$(ndsdir)/logo.bmp "$(@F);ScummVM $(VERSION);DS Port" -d romfs
%.nds: %.elf romfs
ndstool -c $@ -9 $< -b $(srcdir)/$(ndsdir)/logo.bmp "$(@F);ScummVM $(VERSION);DS Port" -d romfs
romfs: $(DIST_FILES_THEMES) $(DIST_FILES_ENGINEDATA) $(DIST_FILES_NETWORKING) $(DIST_FILES_VKEYBD) $(PLUGINS)
@rm -rf romfs
@ -121,48 +121,6 @@ ifeq ($(DYNAMIC_MODULES),1)
@for i in $(PLUGINS); do $(STRIP) --strip-debug $$i -o romfs/plugins/`basename $$i`; done
endif
#############################################################################
#############################################################################
#############################################################################
#############################################################################
#
# ARM7 rules.
# For ARM7 files, we need different compiler flags, which leads to the
# extra rules for .o files below
#
#############################################################################
#
# Set various flags
#
ARM7_ARCH := -mthumb-interwork
# note: arm7tdmi isn't the correct CPU arch, but anything newer and LD
# *insists* it has a FPU or VFP, and it won't take no for an answer!
ARM7_CFLAGS := -g -Wall -O2\
-mcpu=arm7tdmi -mtune=arm7tdmi -fomit-frame-pointer\
-ffast-math \
$(ARM7_ARCH) \
-I$(srcdir)/$(ndsdir)/commoninclude \
-I$(DEVKITPRO)/libnds/include \
-I$(DEVKITPRO)/libnds/include/nds \
-DARM7
ARM7_CXXFLAGS := $(ARM7_CFLAGS) -fno-exceptions -fno-rtti
ARM7_LDFLAGS := -g $(ARM7_ARCH) -mfloat-abi=soft
# Set custom build flags for main.o
$(ndsdir)/arm7/source/main.o: CXXFLAGS=$(ARM7_CXXFLAGS)
$(ndsdir)/arm7/source/main.o: CPPFLAGS=
# Rule for creating ARM7 .elf files by linking .o files together with a special linker script
$(ndsdir)/arm7/arm7.elf: \
$(ndsdir)/arm7/source/main.o
+$(LD) $(ARM7_LDFLAGS) -specs=ds_arm7.specs $+ -L$(DEVKITPRO)/libnds/lib -lnds7 -o $@
# Command to build libmad is:
# ./configure --host=arm-elf --enable-speed --enable-sso -enable-fpm=arm CFLAGS='-specs=ds_arm9.specs -mthumb-interwork'

View File

@ -1,8 +1,5 @@
MODULE := backends/platform/ds
ARM7_MODULE_OBJS := \
arm7/source/main.o
PORT_OBJS := \
arm9/source/blitters_arm.o \
arm9/source/dsmain.o \
@ -73,9 +70,6 @@ $(MODULE)/arm9/source/touchkeyboard.o: \
$(MODULE)/arm9/data/8x8font_tga_raw.h
MODULE_DIRS += \
backends/platform/ds/arm7/source/
# We don't use rules.mk but rather manually update OBJS and MODULE_DIRS.
MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS))
OBJS := $(MODULE_OBJS) $(OBJS)