From: Nathaniel Wesley Filardo Date: Mon, 1 Mar 2010 00:56:48 +0000 (-0500) Subject: Move target/ to avr-libc built in progmem.h X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=9e4aeae669d5046804933ae864c0766531369db8;p=acmetensortoys-chiptunes Move target/ to avr-libc built in progmem.h --- diff --git a/target/asm.S b/target/asm.S index 7f9c5dc..8289b5f 100644 --- a/target/asm.S +++ b/target/asm.S @@ -2,24 +2,12 @@ #include #include - .global readsongbyte .global watchdogoff .global __vector_14 .extern lastsample .extern noiseseed .extern osc - .extern songdata - -readsongbyte: - ldi r30, lo8(songdata) - add r30, r24 - ldi r31, hi8(songdata) - adc r31, r25 - lpm - mov r24, r0 - mov r25, r1 - ret watchdogoff: wdr diff --git a/target/main.c b/target/main.c index cd2b668..3b1690f 100644 --- a/target/main.c +++ b/target/main.c @@ -1,5 +1,6 @@ #include #include +#include #define TRACKLEN 32 @@ -75,8 +76,9 @@ u16 resources[16 + MAXTRACK]; struct unpacker songup; -u8 readsongbyte(u16 offset); void watchdogoff(); +extern u8 songdata[] __ATTR_PROGMEM__; +#define readsongbyte(x) pgm_read_byte_near(&songdata[x]); static void initup(struct unpacker *up, u16 offset) { up->nextbyte = offset;