Index: tools/configure
===================================================================
--- tools/configure	(revision 27942)
+++ tools/configure	(working copy)
@@ -1467,6 +1467,7 @@
     target_id=15
     modelname="ipodvideo"
     target="-DIPOD_VIDEO"
+    memory=64 # always. This is reduced at runtime if needed
     arm7tdmicc
     tool="$rootdir/tools/scramble -add=ipvd"
     bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
Index: apps/debug_menu.c
===================================================================
--- apps/debug_menu.c	(revision 27942)
+++ apps/debug_menu.c	(working copy)
@@ -1601,12 +1601,10 @@
                 lcd_putsf(0, 7, "Headphone: %s",
                          headphone ? "connected" : "disconnected");
 #ifdef IPOD_VIDEO
-                x = (adc_read(ADC_4066_ISTAT) * 2400) /
-#if MEM == 64
-                (1024 * 2);
-#else
-                (1024 * 3);
-#endif
+                if(probed_ramsize == 64)
+                    x = (adc_read(ADC_4066_ISTAT) * 2400) / (1024 * 2);
+                else
+                    x = (adc_read(ADC_4066_ISTAT) * 2400) / (1024 * 3);
                 lcd_putsf(0, 8, "Ibat: %d mA", x);
                 lcd_putsf(0, 9, "Vbat * Ibat: %d mW", x * y / 1000);
 #endif
Index: apps/main.c
===================================================================
--- apps/main.c	(revision 27942)
+++ apps/main.c	(working copy)
@@ -422,6 +422,13 @@
 #endif
 
     system_init();
+#if defined(IPOD_VIDEO)
+    audiobufend=(unsigned char *)audiobufend_lds;
+    if(MEM==64 && probed_ramsize!=64)
+    {
+        audiobufend -= (32<<20);
+    }
+#endif
     kernel_init();
 
 #ifdef HAVE_ADJUSTABLE_CPU_FREQ
Index: firmware/export/buffer.h
===================================================================
--- firmware/export/buffer.h	(revision 27942)
+++ firmware/export/buffer.h	(working copy)
@@ -24,7 +24,12 @@
 #include "config.h"
 /* defined in linker script */
 #if (CONFIG_PLATFORM & PLATFORM_NATIVE)
+#if defined(IPOD_VIDEO)
+extern unsigned char *audiobufend_lds[];
+unsigned char *audiobufend;
+#else
 extern unsigned char audiobufend[];
+#endif
 #else
 extern unsigned char *audiobufend;
 #endif
Index: firmware/export/config/ipodvideo.h
===================================================================
--- firmware/export/config/ipodvideo.h	(revision 27942)
+++ firmware/export/config/ipodvideo.h	(working copy)
@@ -136,15 +136,10 @@
 #define HAVE_HEADPHONE_DETECTION
 
 /* Type of mobile power */
-#if (MEM==32)  /* this is the 30GB-model */
-# define BATTERY_CAPACITY_DEFAULT 400 /* default battery capacity for the 30GB model */
-# define BATTERY_CAPACITY_MIN     300 /* min. capacity selectable */
-# define BATTERY_CAPACITY_MAX    1000 /* max. capacity selectable */
-#else          /* these are the 60/80GB-models */
-# define BATTERY_CAPACITY_DEFAULT 600 /* default battery capacity for the 60/80GB model */
-# define BATTERY_CAPACITY_MIN     500 /* min. capacity selectable */
-# define BATTERY_CAPACITY_MAX    1400 /* max. capacity selectable */
-#endif
+#define BATTERY_CAPACITY_DEFAULT  400 /* default battery capacity for the   */
+                                      /* 30GB model. 60/80GB would have 600 */
+#define BATTERY_CAPACITY_MIN      300 /* min. capacity selectable */
+#define BATTERY_CAPACITY_MAX     1400 /* max. capacity selectable */
 #define BATTERY_CAPACITY_INC       50 /* capacity increment */
 #define BATTERY_TYPES_COUNT         1 /* only one type */
 
Index: firmware/target/arm/ipod/app.lds
===================================================================
--- firmware/target/arm/ipod/app.lds	(revision 27942)
+++ firmware/target/arm/ipod/app.lds	(working copy)
@@ -192,7 +192,11 @@
     
     .audiobufend ENDAUDIOADDR (NOLOAD) :
     {
+#ifdef IPOD_VIDEO
+        audiobufend_lds = .;
+#else
         audiobufend = .;
+#endif
         _audiobufend = .;
     } > DRAM
 
