Commit 56d75f9b authored by Erik Faye-Lund's avatar Erik Faye-Lund
Browse files

cleaned up the repo a bit

git-svn-id: https://pimpmobile.svn.sourceforge.net/svnroot/pimpmobile/trunk@125 3d5ecaf0-f903-0410-b953-c2c1a4d75763
parent 3bd30208
......@@ -39,12 +39,12 @@ ifeq ($(DEBUG), 1)
CPPFLAGS += -DDEBUG
CXXFLAGS += -g3 -ggdb
CFLAGS += -g3 -ggdb
OBJS += src/mixer_portable.o
OBJS += src/pimp_mixer_portable.o
else
CPPFLAGS += -DRELEASE -DNDEBUG
CXXFLAGS += -O3 -fomit-frame-pointer
CFLAGS += -O3 -fomit-frame-pointer
OBJS += src/mixer_arm_asm.o
OBJS += src/pimp_mixer_arm.o
endif
......
......@@ -15,7 +15,7 @@
#include "../include/pimpmobile.h"
#include "../src/pimp_mixer.h"
#include "../src/config.h"
#include "../src/pimp_config.h"
#include "gbfs.h"
int fade = 0;
......
......@@ -2,7 +2,7 @@
#define PIMP_INTERNAL_H
#include "pimp_types.h"
#include "config.h"
#include "pimp_config.h"
STATIC INLINE void *get_ptr(const unsigned int *offset)
{
......
#ifndef PIMP_MATH_H
#define PIMP_MATH_H
#include "config.h"
#include "pimp_config.h"
extern const unsigned char __pimp_clz_lut[256];
......
......@@ -2,7 +2,7 @@
#define PIMP_MIXER_H
#include "pimp_types.h"
#include "config.h"
#include "pimp_config.h"
typedef enum
{
......@@ -32,7 +32,15 @@ typedef struct
void __pimp_mixer_reset(pimp_mixer *mixer);
void __pimp_mixer_mix(pimp_mixer *mixer, s8 *target, int samples);
extern "C" u32 __pimp_mixer_mix_samples(s32 *target, u32 samples, const u8 *sample_data, u32 vol, u32 sample_cursor, s32 sample_cursor_delta);
extern "C" void __pimp_mixer_clip_samples(s8 *target, s32 *source, u32 samples, u32 dc_offs);
#ifdef __cplusplus
extern "C" {
#endif
u32 __pimp_mixer_mix_samples(s32 *target, u32 samples, const u8 *sample_data, u32 vol, u32 sample_cursor, s32 sample_cursor_delta);
void __pimp_mixer_clip_samples(s8 *target, s32 *source, u32 samples, u32 dc_offs);
#ifdef __cplusplus
}
#endif
#endif /* PIMP_MIXER_H */
@ samples to align = 3 - (DST & 3)
.clipper_align_jumptable: @ used to align the pointer
.word .clip0
.word .clip3
.word .clip2
.word .clip1
.clipper_jumptable:
.word .clip0
.word .clip1
.word .clip2
.word .clip3
@@ void __pimp_mixer_clip_samples(s8 *target, s32 *source, u32 samples, u32 dc_offs);
#define DST r0
#define SRC r1
#define COUNT r2
#define BIAS r3
.global __pimp_mixer_clip_samples
__pimp_mixer_clip_samples:
stmfd sp!, {r4-r12, lr} @ store all registers but parameters and stack
@ fixup, jump to the correct position
and r4, COUNT, #3
adr r5, .clipper_jumptable
ldr pc, [r5, r4, lsl #2]
clip_single_loop: @ 8.5 cycles pr sample
clip3:
ldr r4, [SRC], #4 @ 3 cycles
add r4, BIAS, r4, asr #8 @ 1 cycle
movs TEMP, r4, asr #8 @ 1 cycle
mvnnz r4, TEMP, lsr #24 @ 1 cycles
strb r4, [DST], #1 @ 2 cycles
clip2:
ldr r4, [SRC], #4
add r4, BIAS, r4, asr #8
movs TEMP, r4, asr #8
mvnnz r4, TEMP, lsr #24
strb r4, [DST], #1
clip1:
ldr r4, [SRC], #4
add r4, BIAS, r4, asr #8
movs TEMP, r4, asr #8
mvnnz r4, TEMP, lsr #24
strb r4, [DST], #1
clip0:
subs COUNT, COUNT, #1
bne .clip_single_loop
bx lr
.clip_loop: @ 6.5 cycles pr sample
ldmia r1!, {r4-r7} @ 6 cycles
add r4, BIAS, r4, asr #8 @ 1 cycle
movs TEMP, r4, asr #8 @ 1 cycle
mvnnz r4, TEMP, lsr #24 @ 1 cycle
add r5, BIAS, r4, asr #8
movs TEMP, r5, asr #8
mvnnz r5, TEMP, lsr #24
add r6, BIAS, r4, asr #8
movs TEMP, r6, asr #8
mvnnz r6, TEMP, lsr #24
add r7, BIAS, r4, asr #8
movs TEMP, r7, asr #8
mvnnz r7, TEMP, lsr #24
orr r4, r4, r5, asl #8 @ 1 cycle
orr r4, r4, r6, asl #16 @ 1 cycle
orr r4, r4, r7, asl #24 @ 1 cycle
eor r4, r4, FLIP_SIGN @ 1 cycle
str r4, [r0], #4 @ 2 cycles
subs COUNT, COUNT, #1
bne .clip_loop
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment