Commit 33655eff authored by Erik Faye-Lund's avatar Erik Faye-Lund
Browse files

prefixed all routines in pimp_gba.c with pimp_gba_

git-svn-id: https://pimpmobile.svn.sourceforge.net/svnroot/pimpmobile/trunk@421 3d5ecaf0-f903-0410-b953-c2c1a4d75763
parent fc56be42
......@@ -29,8 +29,8 @@ void mix()
REG_TM2CNT_L = 0;
REG_TM2CNT_H = 0;
REG_TM2CNT_H = TIMER_START;
pimp_vblank();
pimp_frame();
pimp_gba_vblank();
pimp_gba_frame();
u32 value = REG_TM2CNT_L;
accum += value;
}
......@@ -101,8 +101,8 @@ int main()
return 1;
}
pimp_init(mod, sb.data);
pimp_set_callback(callback);
pimp_gba_init(mod, sb.data);
pimp_gba_set_callback(callback);
irqSet(IRQ_TIMER3, timer3);
irqEnable(IRQ_TIMER3);
......@@ -117,10 +117,13 @@ int main()
VBlankIntrWait();
scanKeys();
int keys = keysDown();
if (keys & KEY_RIGHT) pimp_set_pos(0, pimp_get_order() + 1);
if (keys & KEY_LEFT) pimp_set_pos(pimp_get_row() + 8, pimp_get_order());
if (keys & KEY_UP) pimp_gba_set_pos(0, pimp_gba_get_order() - 1);
if (keys & KEY_DOWN) pimp_gba_set_pos(0, pimp_gba_get_order() + 1);
if (keys & KEY_RIGHT) pimp_gba_set_pos(pimp_gba_get_row() + 8, pimp_gba_get_order());
if (keys & KEY_LEFT) pimp_gba_set_pos(pimp_gba_get_row() - 8, pimp_gba_get_order());
iprintf("%d %d\n", pimp_gba_get_order(), pimp_gba_get_row());
}
pimp_close();
pimp_gba_close();
return 0;
}
......@@ -26,8 +26,8 @@ the following restrictions:
*/
#ifndef PIMPMOBILE_H
#define PIMPMOBILE_H
#ifndef PIMP_GBA_H
#define PIMP_GBA_H
#ifdef __cplusplus
extern "C"
......@@ -36,22 +36,22 @@ extern "C"
#include "pimp_types.h"
void pimp_init(const struct pimp_module *module, const void *sample_bank);
void pimp_close(void);
void pimp_gba_init(const struct pimp_module *module, const void *sample_bank);
void pimp_gba_close(void);
void pimp_vblank(void); /* call this on the beginning of each vsync */
void pimp_frame(void); /* call once each frame. doesn't need to be called in precious vblank time */
void pimp_gba_vblank(void); /* call this on the beginning of each vsync */
void pimp_gba_frame(void); /* call once each frame. doesn't need to be called in precious vblank time */
/* get information about playback */
int pimp_get_row(void);
int pimp_get_order(void);
void pimp_set_pos(int row, int order);
int pimp_gba_get_row(void);
int pimp_gba_get_order(void);
void pimp_gba_set_pos(int row, int order);
/* callback system (for music sync) */
void pimp_set_callback(pimp_callback callback);
void pimp_gba_set_callback(pimp_callback callback);
#ifdef __cplusplus
}
#endif
#endif /* PIMPMOBILE_H */
#endif /* PIMP_GBA_H */
......@@ -29,7 +29,7 @@ static s8 pimp_gba_sound_buffers[2][SOUND_BUFFER_SIZE] IWRAM_DATA;
static u32 pimp_gba_sound_buffer_index = 0;
static s32 pimp_gba_mix_buffer[SOUND_BUFFER_SIZE] IWRAM_DATA;
void pimp_init(const struct pimp_module *module, const void *sample_bank)
void pimp_gba_init(const struct pimp_module *module, const void *sample_bank)
{
u32 zero = 0;
pimp_gba_mixer.mix_buffer = pimp_gba_mix_buffer;
......@@ -46,12 +46,12 @@ void pimp_init(const struct pimp_module *module, const void *sample_bank)
REG_TM0CNT_H = TIMER_START;
}
void pimp_close()
void pimp_gba_close()
{
REG_SOUNDCNT_X = 0;
}
void pimp_vblank()
void pimp_gba_vblank()
{
if (pimp_gba_sound_buffer_index == 0)
{
......@@ -63,27 +63,27 @@ void pimp_vblank()
pimp_gba_sound_buffer_index ^= 1;
}
void pimp_set_callback(pimp_callback in_callback)
void pimp_gba_set_callback(pimp_callback in_callback)
{
pimp_gba_ctx.callback = in_callback;
}
void pimp_set_pos(int row, int order)
void pimp_gba_set_pos(int row, int order)
{
pimp_mod_context_set_pos(&pimp_gba_ctx, row, order);
}
int pimp_get_row()
int pimp_gba_get_row()
{
return pimp_mod_context_get_row(&pimp_gba_ctx);
}
int pimp_get_order()
int pimp_gba_get_order()
{
return pimp_mod_context_get_order(&pimp_gba_ctx);
}
void pimp_frame()
void pimp_gba_frame()
{
static volatile BOOL locked = FALSE;
if (TRUE == locked) return; /* whops, we're in the middle of filling. sorry. you did something wrong! */
......
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