add texture_memory_alloc9

This commit is contained in:
Zack Buhman 2025-06-25 12:43:43 -05:00
parent ab153f2c43
commit 729ffba90f
3 changed files with 45 additions and 7 deletions

View File

@ -275,14 +275,20 @@ void main()
ta_polygon_converter_transfer(writer.buf, writer.offset); ta_polygon_converter_transfer(writer.buf, writer.offset);
ta_wait_opaque_list(); ta_wait_opaque_list();
int framebuffer_size = framebuffer_width * framebuffer_height * bytes_per_pixel; //int framebuffer_size = framebuffer_width * framebuffer_height * bytes_per_pixel;
int framebuffer_address = (0x10000000 - (framebuffer_size / 2)); //int framebuffer_address = (0x10000000 - (framebuffer_size / 2));
//int framebuffer_address = texture_memory_alloc.framebuffer[1].start; //int framebuffer_address = texture_memory_alloc.framebuffer[1].start;
//holly.FB_W_SOF1 = framebuffer_address & 0x1ffffff;
//holly.STARTRENDER = 1;
int framebuffer_address = texture_memory_alloc.framebuffer[0].start;
test_pattern();
holly.FB_W_SOF1 = framebuffer_address & 0x1ffffff;
holly.STARTRENDER = 1;
holly.FB_R_SOF1 = framebuffer_address & 0x0ffffff; holly.FB_R_SOF1 = framebuffer_address & 0x0ffffff;
printf("fb_w_sof1 0x%08x\n", holly.FB_W_SOF1); printf("fb_w_sof1 0x%08x\n", holly.FB_W_SOF1);
printf("fb_r_sof1 0x%08x\n", holly.FB_R_SOF1); printf("fb_r_sof1 0x%08x\n", holly.FB_R_SOF1);
while (1) {
}
} }

View File

@ -0,0 +1,32 @@
#pragma once
#include <cstdint>
#include <cstddef>
struct texture_memory_alloc__start_end {
uint32_t start;
uint32_t end;
};
struct texture_memory_alloc {
struct texture_memory_alloc__start_end isp_tsp_parameters;
struct texture_memory_alloc__start_end object_list;
struct texture_memory_alloc__start_end region_array;
struct texture_memory_alloc__start_end framebuffer[3];
struct texture_memory_alloc__start_end background[2];
struct texture_memory_alloc__start_end texture;
};
constexpr texture_memory_alloc texture_memory_alloc = {
// 32-bit addresses start end start end
.isp_tsp_parameters = {0x000000, 0x21bfe0},
.object_list = {0x400000, 0x495fe0},
.region_array = {0x21c000, 0x22c000},
.framebuffer = {{0x496000, 0x53ec00},
{0x22c000, 0x2d4c00},
{0x53ec00, 0x5e7800}},
.background = {{0x2d4c00, 0x2d4c20},
{0x5e7800, 0x5e7820}},
// 64-bit addresses
.texture = {0x5a9840, 0x800000}
};

View File

@ -40,10 +40,10 @@ allocations = {
"object_list" : (0x09_6000 , 32 ), "object_list" : (0x09_6000 , 32 ),
"region_array" : (0x01_0000 , 0 ), "region_array" : (0x01_0000 , 0 ),
"framebuffer0" : (0x09_6000 , 0 ), "framebuffer0" : (0x0a_8c00 , 0 ),
"framebuffer1" : (0x09_6000 , 0 ), "framebuffer1" : (0x0a_8c00 , 0 ),
"framebuffer2" : (0x09_6000 , 0 ), "framebuffer2" : (0x0a_8c00 , 0 ),
"background0" : (0x00_0040 , 32 ), "background0" : (0x00_0040 , 32 ),
"background1" : (0x00_0040 , 32 ), "background1" : (0x00_0040 , 32 ),