Skip to content

Commit

Permalink
optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
xrip committed Dec 20, 2023
1 parent 396e0df commit 4ab6d87
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions drivers/vga-nextgen/vga.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const struct pio_program pio_program_VGA = {
};


static uint32_t* lines_pattern[4];
static uint32_t* __scratch_y("lines_pattern") lines_pattern[4];
static uint32_t* lines_pattern_data = NULL;
static int _SM_VGA = -1;

Expand Down Expand Up @@ -56,9 +56,9 @@ static bool is_flash_line = false;
static bool is_flash_frame = false;

//буфер 1к графической палитры
static uint16_t palette[2][256];
static uint16_t __scratch_y("vga_driver_palette") palette[2][256];

static uint32_t bg_color[2];
static uint32_t __scratch_y("vga_driver_bgpalette") bg_color[2];
static uint16_t palette16_mask = 0;

static uint8_t* text_buffer;
Expand All @@ -67,7 +67,7 @@ static uint8_t* text_buf_color;
static uint text_buffer_width = 0;
static uint text_buffer_height = 0;

static uint16_t txt_palette[16];
static uint16_t __scratch_y("vga_driver_txtpalette") txt_palette[16];

//буфер 2К текстовой палитры для быстрой работы
static uint16_t* txt_palette_fast = NULL;
Expand All @@ -77,7 +77,7 @@ enum graphics_mode_t graphics_mode;
extern volatile bool manager_started;


void __not_in_flash_func(dma_handler_VGA)() {
void __scratch_y("vga_driver") dma_handler_VGA() {
dma_hw->ints0 = 1u << dma_chan_ctrl;
static uint32_t frame_number = 0;
static uint32_t screen_line = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/audio/sn76489.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
uint32_t clock = 3579545;
const uint16_t samplerate = SOUND_FREQUENCY;
uint8_t quality = 0;
#define quality 0

uint32_t base_incr = 0;

Expand Down
6 changes: 3 additions & 3 deletions src/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ INLINE void writerm8(uint8_t rmval, uint8_t value) {

uint8_t tandy_hack = 0;

static void intcall86(uint8_t intnum) {
static void __time_critical_func(intcall86)(uint8_t intnum) {
uint32_t tempcalc, memloc, n;
switch (intnum) {
#ifdef EMS_DRIVER
Expand Down Expand Up @@ -3982,7 +3982,7 @@ void exec86(uint32_t execloops) {
}

// array of function pointers separated by 800h (32K) pages (less gradation to be implemented by "if" conditions)
static write_fn_ptr write_funtions[256] = { 0 };
static write_fn_ptr __scratch_x("write_funcs") write_funtions[256] = { 0 };

static inline void write8video(uint32_t addr32, uint8_t v) {
VIDEORAM[(ega_plane_offset + addr32 - VIDEORAM_START32) % VIDEORAM_SIZE] = v;
Expand Down Expand Up @@ -4086,7 +4086,7 @@ static void write16low_swap(uint32_t addr32, uint16_t v) {
}

// array of function pointers separated by 800h (32K) pages (less gradation to be implemented by "if" conditions)
static read_fn_ptr read_funtions[256] = { 0 };
static read_fn_ptr __scratch_x("write16_funtions") read_funtions[256] = { 0 };

uint8_t read8nothng(uint32_t addr32) {
return 0;
Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ uint16_t true_covox = 0;

struct semaphore vga_start_semaphore;
/* Renderer loop on Pico's second core */
void __time_critical_func(render_core)() {
void __scratch_y("second_core") second_core() {
#ifdef SOUND_ENABLED
#ifdef I2S_SOUND
i2s_config.sample_freq = SOUND_FREQUENCY;
Expand Down Expand Up @@ -262,7 +262,7 @@ int main() {
keyboard_init();

sem_init(&vga_start_semaphore, 0, 1);
multicore_launch_core1(render_core);
multicore_launch_core1(second_core);
sem_release(&vga_start_semaphore);

sleep_ms(50);
Expand Down

0 comments on commit 4ab6d87

Please sign in to comment.