From 185b833929ed526511021b1eb551f82d5637a517 Mon Sep 17 00:00:00 2001 From: optixx Date: Wed, 21 Oct 2009 21:09:45 +0200 Subject: [PATCH] try to reduce code size --- avr/usbload/checksize | 2 +- avr/usbload/command.c | 18 +++++++++++++++++- avr/usbload/debug.c | 15 --------------- avr/usbload/inflate.c | 12 +++++++----- avr/usbload/info.c | 18 ------------------ avr/usbload/main.c | 9 +++++++-- avr/usbload/pwm.c | 3 +++ avr/usbload/rle.c | 4 ++++ avr/usbload/shell.c | 10 +++------- 9 files changed, 42 insertions(+), 49 deletions(-) diff --git a/avr/usbload/checksize b/avr/usbload/checksize index 4a23d76..1f0d4a8 100755 --- a/avr/usbload/checksize +++ b/avr/usbload/checksize @@ -8,7 +8,7 @@ # Revision: $:Id: checksize 83 2006-01-05 22:20:53Z cs $ error=0 -codelimit=65536 # default value +codelimit=61440 # default value datalimit=4064 # default value; leave 32 bytes for stack if [ $# -gt 1 ]; then diff --git a/avr/usbload/command.c b/avr/usbload/command.c index 811f4c1..73cd9da 100644 --- a/avr/usbload/command.c +++ b/avr/usbload/command.c @@ -33,6 +33,9 @@ #include "loader.h" #include "system.h" +#include "neginf/neginf.h" +#include "inflate.h" + extern usb_transaction_t usb_trans; extern system_t system; @@ -93,7 +96,11 @@ void set_rom_mode() void boot_startup_rom(uint16_t init_delay) { uint8_t i; + uint8_t c; + uint16_t j; uint32_t addr = 0x000000; + PGM_VOID_P p_addr; + info_P(PSTR("Fetch loader rom\n")); system_set_bus_avr(); @@ -108,8 +115,17 @@ void boot_startup_rom(uint16_t init_delay) //snes_irq_off(); //snes_lorom(); + inflate_init(); for (i=0; iSwitch TO AVR\n")); shared_memory_init(); diff --git a/avr/usbload/pwm.c b/avr/usbload/pwm.c index 024a1c4..0568cfd 100644 --- a/avr/usbload/pwm.c +++ b/avr/usbload/pwm.c @@ -31,6 +31,8 @@ #define PWM_SINE_MAX 64 #define PWM_OVERFLOW_MAX 1024 +#if 0 + uint8_t pwm_sine_table[] = { 0x7f,0x8b,0x97,0xa4,0xaf,0xbb,0xc5,0xcf,0xd9,0xe1,0xe8,0xef,0xf4,0xf8,0xfb,0xfd, 0xfd,0xfd,0xfb,0xf8,0xf3,0xee,0xe7,0xe0,0xd7,0xce,0xc4,0xb9,0xae,0xa2,0x96,0x89, @@ -99,3 +101,4 @@ void pwm_init(void) { TIMSK2 |= (1<