Skip to content

Commit

Permalink
M.
Browse files Browse the repository at this point in the history
  • Loading branch information
yuan committed Aug 13, 2019
1 parent ea942b4 commit 568d154
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions user/Player.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ extern unsigned char Score[];
void Player32kProc(Player *player)
{
SynthAsm(&(player->mainSynthesizer));
UpdateTick(player);
player->currentTick++;
}

void PlayerProcess(Player *player)
{

uint8_t temp;

if (player->decayGenTick >= 150)
{
GenDecayEnvlopeAsm(&(player->mainSynthesizer));
player->decayGenTick = 0;
}
if (player->status == STATUS_PLAYING)
{
if(PlayNoteTimingCheck(player))
if ((player->currentTick >> 8) >= player->lastScoreTick)
{
do
{
Expand All @@ -39,11 +39,26 @@ void PlayerProcess(Player *player)
NoteOnAsm(&(player->mainSynthesizer), temp);
}
} while ((temp & 0x80) == 0);

PlayUpdateNextScoreTick(player);
}
}
}

void PlayUpdateNextScoreTick(Player *player)
{
uint32_t tempU32;
uint8_t temp;
tempU32 = player->lastScoreTick;
do
{
temp = *(player->scorePointer);
player->scorePointer++;
tempU32 += temp;
} while (temp == 0xFF);
player->lastScoreTick = tempU32;
}

void PlayerPlay(Player *player)
{
player->currentTick = 0;
Expand Down

0 comments on commit 568d154

Please sign in to comment.