gpu_neon/psx_gpu: use external vram
authornotaz <notasas@gmail.com>
Tue, 20 Dec 2011 21:14:42 +0000 (23:14 +0200)
committernotaz <notasas@gmail.com>
Wed, 21 Dec 2011 20:42:20 +0000 (22:42 +0200)
plugins/gpu_neon/psx_gpu/psx_gpu.c
plugins/gpu_neon/psx_gpu/psx_gpu.h
plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S
plugins/gpu_neon/psx_gpu/psx_gpu_main.c

index 8d4b8b8..f29fa7e 100644 (file)
@@ -4315,7 +4315,7 @@ void initialize_reciprocal_table(void)
 #define dither_table_row(a, b, c, d)                                           \
  ((a & 0xFF) | ((b & 0xFF) << 8) | ((c & 0xFF) << 16) | ((d & 0xFF) << 24))    \
 
-void initialize_psx_gpu(psx_gpu_struct *psx_gpu)
+void initialize_psx_gpu(psx_gpu_struct *psx_gpu, u16 *vram)
 {
   vec_8x16u test_mask =
    { { { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 } } };
@@ -4345,7 +4345,7 @@ void initialize_psx_gpu(psx_gpu_struct *psx_gpu)
   psx_gpu->render_state_base = 0;
   psx_gpu->num_blocks = 0;
 
-  psx_gpu->vram_ptr = psx_gpu->_vram;
+  psx_gpu->vram_ptr = vram;
 
   psx_gpu->texture_page_ptr = psx_gpu->vram_ptr;
   psx_gpu->clut_ptr = psx_gpu->vram_ptr;
index 15d9469..49425ce 100644 (file)
@@ -186,7 +186,6 @@ typedef struct
   edge_data_struct span_edge_data[MAX_SPANS];
   u32 span_b_offset[MAX_SPANS];
 
-  u16 _vram[1024 * 512];
   u8 texture_4bpp_cache[32][256 * 256];
   u8 texture_8bpp_even_cache[16][256 * 256];
   u8 texture_8bpp_odd_cache[16][256 * 256];
@@ -232,7 +231,7 @@ u32 texture_region_mask(s32 x1, s32 y1, s32 x2, s32 y2);
 
 void flush_render_block_buffer(psx_gpu_struct *psx_gpu);
 
-void initialize_psx_gpu(psx_gpu_struct *psx_gpu);
+void initialize_psx_gpu(psx_gpu_struct *psx_gpu, u16 *vram);
 void gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size);
 
 void triangle_benchmark(psx_gpu_struct *psx_gpu);
index 381f3a9..3551b59 100644 (file)
@@ -76,8 +76,6 @@
 #define psx_gpu_span_edge_data_offset                     0x4100
 #define psx_gpu_span_b_offset_offset                      0x5100
 
-#define psx_gpu__vram_offset                              0x005900
-
 #define edge_data_left_x_offset                           0
 #define edge_data_num_blocks_offset                       2
 #define edge_data_right_mask_offset                       4
index 97f62ca..d610e8e 100644 (file)
@@ -64,6 +64,7 @@ typedef struct
 static gpu_dump_struct state;
 
 psx_gpu_struct __attribute__((aligned(256))) _psx_gpu;
+u16 __attribute__((aligned(256))) _vram[1024 * 512];
 
 #define percent_of(numerator, denominator)                                     \
   ((((double)(numerator)) / (denominator)) * 100.0)                            \
@@ -175,7 +176,7 @@ int main(int argc, char *argv[])
     screen = SDL_SetVideoMode(1024, 512, 32, 0);
   }
   
-  initialize_psx_gpu(psx_gpu);
+  initialize_psx_gpu(psx_gpu, _vram);
 
 #ifdef PANDORA_BUILD
   system("ofbset -fb /dev/fb1 -mem 6291456 -en 0");