Skip to content

Commit

Permalink
changed addresses for STM32F407VGT6 (PlusCart)
Browse files Browse the repository at this point in the history
I have not changed the addresses for the ARM functions that can be
called from Thumb code if required. for now they are still rooted at
address 0x00000000

this is because the current build of Gopher2600 (v0.15.0) will expect
them to be at that address origin. easy update to the emulator when
required
  • Loading branch information
JetSetIlly committed Dec 7, 2021
1 parent e7885ae commit 33d400d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion main/custom/custom.S
Expand Up @@ -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 */
Expand Down
16 changes: 8 additions & 8 deletions main/custom/custom.boot.lds
Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions main/defines_cdfj.h
Expand Up @@ -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) {
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions main/main.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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<columns;c++)
RAM[graphic48 + startingcolumn + c + r*6] = ((unsigned char *)( newgraphic ))[c + r*columns];
RAM[graphic48 + startingcolumn + c + r*6] = ((unsigned char *)( ROM+newgraphic ))[c + r*columns];
}

void ProcessGameJoystick()
Expand Down

0 comments on commit 33d400d

Please sign in to comment.