giz menu works

git-svn-id: file:///home/notaz/opt/svn/PicoDrive@231 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2007-09-01 11:07:03 +00:00
parent b39bf06ad7
commit e5f426aa2e
35 changed files with 2507 additions and 432 deletions

View file

@ -21,7 +21,6 @@
#define USE_CACHE
extern unsigned char *framebuff; // in format (8+320)x(8+224+8) (eights for borders)
int currpri = 0;
static int HighCache2A[41*(TILE_ROWS+1)+1+1]; // caches for high layers
@ -139,7 +138,7 @@ static void DrawWindowFull(int start, int end, int prio)
{
struct PicoVideo *pvid=&Pico.video;
int nametab, nametab_step, trow, tilex, blank=-1, code;
unsigned char *scrpos = framebuff;
unsigned char *scrpos = PicoDraw2FB;
int tile_start, tile_end; // in cells
// parse ranges
@ -239,7 +238,7 @@ static void DrawLayerFull(int plane, int *hcache, int planestart, int planeend)
if (plane==0) nametab=(pvid->reg[2]&0x38)<< 9; // A
else nametab=(pvid->reg[4]&0x07)<<12; // B
scrpos = framebuff;
scrpos = PicoDraw2FB;
scrpos+=8*328*(planestart-START_ROW);
// Get vertical scroll value:
@ -317,7 +316,7 @@ static void DrawTilesFromCacheF(int *hc)
// unsigned short *pal;
unsigned char pal;
short blank=-1; // The tile we know is blank
unsigned char *scrpos = framebuff, *pd = 0;
unsigned char *scrpos = PicoDraw2FB, *pd = 0;
// *hcache++ = code|(dx<<16)|(trow<<27); // cache it
scrpos+=(*hc++)*328 - START_ROW*328*8;
@ -380,7 +379,7 @@ static void DrawSpriteFull(unsigned int *sprite)
// goto first vertically visible tile
while(sy <= START_ROW*8) { sy+=8; tile+=tdeltay; height--; }
scrpos = framebuff;
scrpos = PicoDraw2FB;
scrpos+=(sy-START_ROW*8)*328;
for (; height > 0; height--, sy+=8, tile+=tdeltay)
@ -481,7 +480,7 @@ static void DrawAllSpritesFull(int prio, int maxwidth)
static void BackFillFull(int reg7)
{
unsigned int back, i;
unsigned int *p=(unsigned int *)framebuff;
unsigned int *p=(unsigned int *)PicoDraw2FB;
// Start with a background color:
// back=PicoCramHigh[reg7&0x3f];

View file

@ -8,7 +8,7 @@
.extern Pico
.extern framebuff
.extern PicoDraw2FB
@ define these constants in your include file:
@ .equiv START_ROW, 1
@ -22,7 +22,7 @@
BackFillFull:
stmfd sp!, {r4-r9,lr}
ldr lr, =framebuff @ lr=framebuff
ldr lr, =PicoDraw2FB @ lr=PicoDraw2FB
ldr lr, [lr]
add lr, lr, #328*8
@ -394,7 +394,7 @@ DrawLayerFull:
and r4, r4, #7
orr lr, lr, r4, lsl #13 @ lr|=nametab_bits{3}<<13
ldr r11, =framebuff @ r11=framebuff
ldr r11, =PicoDraw2FB @ r11=PicoDraw2FB
ldr r11, [r11]
sub r4, r9, #(START_ROW<<24)
mov r4, r4, asr #24
@ -572,7 +572,7 @@ DrawTilesFromCacheF:
mov r9, #0xff000000 @ r9=prevcode=-1
mvn r6, #0 @ r6=prevy=-1
ldr r4, =framebuff @ r4=framebuff
ldr r4, =PicoDraw2FB @ r4=PicoDraw2FB
ldr r4, [r4]
ldr r1, [r0], #4 @ read y offset
mov r7, #328
@ -696,7 +696,7 @@ DrawWindowFull:
mov r9, #0xff000000 @ r9=prevcode=-1
ldr r11, =framebuff @ r11=scrpos
ldr r11, =PicoDraw2FB @ r11=scrpos
ldr r11, [r11]
add r11, r11, #328*8
add r11, r11, #8
@ -896,7 +896,7 @@ DrawSpriteFull:
ldr r10, =(Pico+0x10000) @ r10=Pico.vram
ldr r11, =framebuff @ r11=scrpos
ldr r11, =PicoDraw2FB @ r11=scrpos
ldr r11, [r11]
sub r1, r12, #(START_ROW*8)
mov r0, #328

View file

@ -118,6 +118,7 @@ void *blockcpy(void *dst, const void *src, size_t n);
// Draw2.c
// stuff below is optional
extern unsigned char *PicoDraw2FB; // buffer for fasr renderer in format (8+320)x(8+224+8) (eights for borders)
extern unsigned short *PicoCramHigh; // pointer to CRAM buff (0x40 shorts), converted to native device color (works only with 16bit for now)
extern void (*PicoPrepareCram)(); // prepares PicoCramHigh for renderer to use

View file

@ -315,7 +315,8 @@ extern int z80startCycle, z80stopCycle; // in 68k cycles
PICO_INTERNAL int CheckDMA(void);
// cd/Pico.c
PICO_INTERNAL int PicoInitMCD(void);
PICO_INTERNAL int PicoInitMCD(void);
PICO_INTERNAL void PicoExitMCD(void);
PICO_INTERNAL int PicoResetMCD(int hard);
PICO_INTERNAL int PicoFrameMCD(void);

View file

@ -1,6 +1,7 @@
// Some misc stuff
// (c) Copyright 2007, Grazvydas "notaz" Ignotas
#include "../PicoInt.h"
unsigned char formatted_bram[4*0x10] =
{