Moved boot sprites and tiles to the top of RAM

This commit is contained in:
Peter Weingartner 2024-11-15 19:54:44 -05:00
parent dd97ce82b9
commit 27e352727b
9 changed files with 28 additions and 10 deletions

View file

@ -442,6 +442,17 @@ void boot_screen() {
long jiffies_target = 0; long jiffies_target = 0;
char message[80]; char message[80];
// Locate the tile maps based on the top of ram
uint32_t ram_index = mem_get_ramtop();
ram_index -= 8 * 272;
tile_set_memory_base = ram_index;
ram_index -= 2 * 42 * 32;
tile_map_memory_base = ram_index;
// Locate the sprites
ram_index -= 5 * (32 * 32);
sprite_ram_base = ram_index;
// Check the DIP switches to see if we should include RAM booting // Check the DIP switches to see if we should include RAM booting
// Choose the correct boot chain accordingly // Choose the correct boot chain accordingly

View file

@ -19,7 +19,7 @@
static t_sprite sprite_shadow[SPRITE_MAX]; static t_sprite sprite_shadow[SPRITE_MAX];
const uint32_t sprite_ram_base = 0x000000; uint32_t sprite_ram_base = 0x000000;
/** /**
* @brief Update a sprite's hardware registers from the shadow registers * @brief Update a sprite's hardware registers from the shadow registers

View file

@ -15,6 +15,8 @@
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
extern uint32_t sprite_ram_base;
/** /**
* @brief Set the basic information about the sprite * @brief Set the basic information about the sprite
* *

View file

@ -7,8 +7,8 @@
static t_tile_set tile_set_shadow[VKY_TILESET_MAX]; static t_tile_set tile_set_shadow[VKY_TILESET_MAX];
static t_tile_map tile_map_shadow[VKY_TILEMAP_MAX]; static t_tile_map tile_map_shadow[VKY_TILEMAP_MAX];
const uint32_t tile_set_memory_base = 0x002000; uint32_t tile_set_memory_base = 0x002000;
const uint32_t tile_map_memory_base = 0x003000; uint32_t tile_map_memory_base = 0x003000;
/** /**
* @brief Setup a tile set * @brief Setup a tile set

View file

@ -15,6 +15,9 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
extern uint32_t tile_set_memory_base;
extern uint32_t tile_map_memory_base;
/** /**
* @brief Setup a tile set * @brief Setup a tile set
* *

View file

@ -13,6 +13,7 @@
*/ */
#include "memory.h" #include "memory.h"
#include "sys_general.h"
unsigned long mem_top_of_ram = 0; unsigned long mem_top_of_ram = 0;
@ -21,8 +22,10 @@ unsigned long mem_top_of_ram = 0;
* *
* @param top_of_ram initial value for the top of system RAM * @param top_of_ram initial value for the top of system RAM
*/ */
void mem_init(unsigned long top_of_ram) { void mem_init() {
mem_top_of_ram = top_of_ram; #if MODEL == MODEL_FOENIX_F256 || MODEL == MODEL_FOENIX_F256K || MODEL == MODEL_FOENIX_F256K2
mem_top_of_ram = 0x06ffff;
#endif
} }
/** /**

View file

@ -17,12 +17,11 @@
#include "sys_macros.h" #include "sys_macros.h"
/* /**
* Initialize the memory management system * Initialize the memory management system
* *
* @param top_of_ram initial value for the top of system RAM
*/ */
extern void mem_init(unsigned long top_of_ram); extern void mem_init();
/** /**
* Return the top of system RAM... the user program must not use any * Return the top of system RAM... the user program must not use any

View file

@ -90,7 +90,7 @@ void initialize() {
sys_get_information(&info); sys_get_information(&info);
/* Initialize the memory system */ /* Initialize the memory system */
mem_init(0x3d0000); mem_init();
// /* Hide the mouse */ // /* Hide the mouse */
// mouse_set_visible(0); // mouse_set_visible(0);

View file

@ -7,6 +7,6 @@
#define VER_MAJOR 1 #define VER_MAJOR 1
#define VER_MINOR 0 #define VER_MINOR 0
#define VER_BUILD 38 #define VER_BUILD 39
#endif #endif