Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PoroCYon
pimpmobile
Commits
175e7134
Commit
175e7134
authored
May 20, 2009
by
Erik Faye-Lund
Browse files
rename SAMPLERATE to PIMP_SAMPLERATE
Signed-off-by:
Erik Faye-Lund
<
kusmabite@gmail.com
>
parent
d4c29627
Changes
4
Show whitespace changes
Inline
Side-by-side
src/pimp_config.h
View file @
175e7134
...
...
@@ -11,8 +11,8 @@
/* check the sample-rate calculator at http://www.pineight.com/gba/samplerates/ for more glitch-free samplerates */
/* 0x4000100 = 0xFFFF, 0x4000102 = 0x0083 */
#define SAMPLERATE (18157.16)
/* #define SAMPLERATE (31536.12) */
#define
PIMP_
SAMPLERATE (18157.16)
/* #define
PIMP_
SAMPLERATE (31536.12) */
/* enable / disable assert */
/* #define DEBUG_PRINT_ENABLE */
...
...
src/pimp_gba.c
View file @
175e7134
...
...
@@ -21,7 +21,7 @@ static struct pimp_mod_context pimp_gba_ctx EWRAM_DATA;
/* setup some constants */
#define CYCLES_PR_FRAME 280896
#define CYCLES_PR_SAMPLE ((int)((1 << 24) / ((float)SAMPLERATE)))
#define CYCLES_PR_SAMPLE ((int)((1 << 24) / ((float)
PIMP_
SAMPLERATE)))
#define SOUND_BUFFER_SIZE ((int)((float)CYCLES_PR_FRAME / CYCLES_PR_SAMPLE))
/* mix and playback-buffers */
...
...
src/pimp_math.c
View file @
175e7134
...
...
@@ -46,7 +46,7 @@ unsigned pimp_get_linear_period(int note, int fine_tune)
#include
"linear_delta_lut.h"
unsigned
pimp_get_linear_delta
(
unsigned
period
)
{
const
unsigned
int
scale
=
(
unsigned
int
)((
1
.
0
/
(
SAMPLERATE
))
*
(
1
<<
3
)
*
(
1ULL
<<
32
));
const
unsigned
int
scale
=
(
unsigned
int
)((
1
.
0
/
(
PIMP_
SAMPLERATE
))
*
(
1
<<
3
)
*
(
1ULL
<<
32
));
unsigned
p
=
(
12
*
16
*
4
*
14
)
-
period
;
unsigned
octave
=
p
/
(
12
*
16
*
4
);
...
...
@@ -94,7 +94,7 @@ unsigned pimp_get_amiga_period(int note, int fine_tune)
#define AMIGA_DELTA_LUT_FRAC_BITS (15 - AMIGA_DELTA_LUT_LOG2_SIZE)
unsigned
pimp_get_amiga_delta
(
unsigned
period
)
{
const
unsigned
int
scale
=
(
unsigned
int
)(((
1
.
0
/
(
SAMPLERATE
))
*
(
1
<<
6
))
*
(
1LL
<<
32
));
const
unsigned
int
scale
=
(
unsigned
int
)(((
1
.
0
/
(
PIMP_
SAMPLERATE
))
*
(
1
<<
6
))
*
(
1LL
<<
32
));
int
d1
,
d2
;
unsigned
int
delta
;
...
...
src/pimp_mod_context.c
View file @
175e7134
...
...
@@ -142,7 +142,7 @@ void pimp_mod_context_set_next_pos(struct pimp_mod_context *ctx, int row, int or
void
pimp_mod_context_set_bpm
(
struct
pimp_mod_context
*
ctx
,
int
bpm
)
{
/* we're using 8 fractional-bits for the tick-length */
const
int
temp
=
(
int
)(((
SAMPLERATE
)
*
5
)
*
(
1
<<
8
));
const
int
temp
=
(
int
)(((
PIMP_
SAMPLERATE
)
*
5
)
*
(
1
<<
8
));
ASSERT
(
ctx
!=
NULL
);
ASSERT
(
bpm
>
0
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment