]> hydra-www.ietfng.org Git - acmetensortoys-chiptunes/commitdiff
Song init on target now in own function
authorNathaniel Wesley Filardo <nwf@pf.priv.oc.ietfng.org>
Tue, 2 Mar 2010 22:00:47 +0000 (17:00 -0500)
committerNathaniel Wesley Filardo <nwf@pf.priv.oc.ietfng.org>
Tue, 2 Mar 2010 22:00:47 +0000 (17:00 -0500)
target/main.c

index cfa207d63652a26cb101c894eaa026961877b686..5a5f74e365d5914d44164d42ffd5db9fc2079193 100644 (file)
@@ -333,16 +333,7 @@ void initresources() {
        initup(&songup, resources[0]);
 }
 
-int main() {
-       asm("cli");
-       CLKPR = 0x80;
-       CLKPR = 0x80;
-
-       TARGET_LIGHT_DDR = TARGET_LIGHT_ZERO | TARGET_LIGHT_ONE;
-       TARGET_AUDIO_DDR = 0xff;
-
-       TARGET_AUDIO_PORT = 0;
-
+void initsong() {
        timetoplay = 0;
        trackwait = 0;
        trackpos = 0;
@@ -357,7 +348,19 @@ int main() {
        channel[2].inum = 0;
        osc[3].volume = 0;
        channel[3].inum = 0;
+}
+
+int main() {
+       asm("cli");
+       CLKPR = 0x80;
+       CLKPR = 0x80;
+
+       TARGET_LIGHT_DDR = TARGET_LIGHT_ZERO | TARGET_LIGHT_ONE;
+       TARGET_AUDIO_DDR = 0xff;
+
+       TARGET_AUDIO_PORT = 0;
 
+       initsong();
        initresources();
 
        TCCR0A = 0x02;