diff --git a/main/custom/custom.S b/main/custom/custom.S index e285e7c..db19462 100644 --- a/main/custom/custom.S +++ b/main/custom/custom.S @@ -21,7 +21,7 @@ Custom: .thumb /* Fetch value from CU header */ - ldr r0, =0x40000024 + ldr r0, =0x10000024 ldr r2, [r0] /* Skip if data already copied */ diff --git a/main/custom/custom.boot.lds b/main/custom/custom.boot.lds index 1bf06a2..cdd0e3d 100644 --- a/main/custom/custom.boot.lds +++ b/main/custom/custom.boot.lds @@ -4,21 +4,21 @@ OUTPUT_ARCH(arm) /* Entry Point */ ENTRY(Custom) -/* LPC2103 memory areas */ +/* STM32F407VGT6 memory areas */ MEMORY { - boot (RX) : ORIGIN = 0x800 , LENGTH = 0x80 /* C-runtime booter */ - C_code (RX) : ORIGIN = 0x880 , LENGTH = 0x6780 /* C code (26K) */ + boot (RX) : ORIGIN = 0x20000800 , LENGTH = 0x80 /* C-runtime booter */ + C_code (RX) : ORIGIN = 0x20000880 , LENGTH = 0x6780 /* C code (26K) */ - ram : ORIGIN = 0x40001800, LENGTH = 0x800 /* 2K free RAM */ -/* ram : ORIGIN = 0x40001400, LENGTH = 0xC00 */ /* 3K free RAM, took 1K from Display Data */ -/* ram : ORIGIN = 0x40001300, LENGTH = 0xD00 */ /* 3.25K free RAM, took 1.25K from Display Data */ -/* ram : ORIGIN = 0x400012C0, LENGTH = 0xD40 */ /* 3392 bytes free RAM, took 1344 from Display Data */ + ram : ORIGIN = 0x10001800, LENGTH = 0x800 /* 2K free RAM */ +/* ram : ORIGIN = 0x10001400, LENGTH = 0xC00 */ /* 3K free RAM, took 1K from Display Data */ +/* ram : ORIGIN = 0x10001300, LENGTH = 0xD00 */ /* 3.25K free RAM, took 1.25K from Display Data */ +/* ram : ORIGIN = 0x100012C0, LENGTH = 0xD40 */ /* 3392 bytes free RAM, took 1344 from Display Data */ } /* Global symbol _stack_end */ -_stack_end = 0x40001FDC; +_stack_end = 0x10001FDC; /* Output sections */ SECTIONS diff --git a/main/defines_cdfj.h b/main/defines_cdfj.h index 0a46010..b59c13f 100755 --- a/main/defines_cdfj.h +++ b/main/defines_cdfj.h @@ -8,25 +8,25 @@ Description: CDF bankswitching utilities #define __CDFDEFINES_H // Start of C code in FLASH (uncomment to use) -// unsigned char * const _CBASE=(unsigned char*)0x800; +// unsigned char * const _CBASE=(unsigned char*)0x20000800; // Start of Atari banks in FLASH(uncomment to use) -// unsigned char * const _BANK0=(unsigned char*)0x1000; +// unsigned char * const _BANK0=(unsigned char*)0x20001000; // Raw queue pointers -void* DDR = (void*)0x40000800; +void* DDR = (void*)0x10000800; #define RAM ((unsigned char*)DDR) #define RAM_INT ((unsigned int*)DDR) #define RAM_SINT ((unsigned short int*)DDR) -#define ROM ((unsigned char*)0) -#define ROM_INT ((unsigned int*)0) -#define ROM_SINT ((unsigned short int*)0) +#define ROM ((unsigned char*)0x20000000) +#define ROM_INT ((unsigned int*)0x20000000) +#define ROM_SINT ((unsigned short int*)0x20000000) // Queue variables -unsigned int* const _QPTR=(unsigned int*)0x40000098; -unsigned int* const _QINC=(unsigned int*)0x40000124; -unsigned int* const _WAVEFORM=(unsigned int*)0x400001B0; +unsigned int* const _QPTR=(unsigned int*)0x10000098; +unsigned int* const _QINC=(unsigned int*)0x10000124; +unsigned int* const _WAVEFORM=(unsigned int*)0x100001B0; // Set fetcher pointer (offset from start of display data) inline void setPointer(int fetcher, unsigned int offset) { @@ -45,7 +45,7 @@ inline void setIncrement(int fetcher, unsigned char whole, unsigned char frac) { // Set waveform (32-byte offset in ROM) inline void setWaveform(int wave, unsigned char offset) { - _WAVEFORM[wave] = 0x40000800 + (offset << 5); + _WAVEFORM[wave] = 0x10000800 + (offset << 5); } // Set DA sample address diff --git a/main/main.c b/main/main.c index 1e6eb19..0260bd0 100644 --- a/main/main.c +++ b/main/main.c @@ -64,12 +64,12 @@ unsigned short int player_shape[2]; unsigned char is_7800; // 0 = 2600, non-zero = 7800 // Image Data -short int *image_graphics =(short int *)_IMAGE_GRAPHICS; -short int *image_colors =(short int *)_IMAGE_COLORS; -unsigned char *image_heights =(unsigned char *)_IMAGE_HEIGHTS; +short int *image_graphics =(short int *)(ROM+_IMAGE_GRAPHICS); +short int *image_colors =(short int *)(ROM+_IMAGE_COLORS); +unsigned char *image_heights =(unsigned char *)(ROM+_IMAGE_HEIGHTS); // Menu Data -short int *menu_graphics_offset =(short int *)_MENU_GRAPHICS_OFFSET; +short int *menu_graphics_offset =(short int *)(ROM+_MENU_GRAPHICS_OFFSET); unsigned char mm_selected_option; unsigned char mm_tv_type; // 0 = NTSC, 1 = PAL, 2 = SECAM unsigned char mm_joystick_timer; @@ -364,7 +364,7 @@ void ChangeMenuOption(unsigned int graphic48, // first byte of option grap int r, c; for (r=0;r<_MM_OPTION_HEIGHT;r++) for(c=0;c