@@ -29,14 +29,14 @@ typedef struct
Vect2D_f16 pos;
Vect2D_f16 mov;
u16 timer;
} Object;
} MovingObject;


fix16 baseposx;
fix16 baseposy;
fix16 gravity;

static Object objects[MAX_OBJECT];
static MovingObject objects[MAX_OBJECT];
static Sprite* sprites[MAX_OBJECT];
static u16 palette[64];
static u16 tileIndexes[64];
@@ -83,7 +83,7 @@ u16 executeSpritesTest(u16 *scores)
}

// set palette
VDP_setPalette(PAL1, flare_small.palette->data);
PAL_setPalette(PAL1, flare_small.palette->data, CPU);

// init positions
baseposx = FIX16((VDP_getScreenWidth() / 2) - 8);
@@ -122,7 +122,7 @@ u16 executeSpritesTest(u16 *scores)
}

// set palette
VDP_setPalette(PAL1, flare_small.palette->data);
PAL_setPalette(PAL1, flare_small.palette->data, CPU);

// init positions
baseposx = FIX16((VDP_getScreenWidth() / 2) - 8);
@@ -175,7 +175,7 @@ u16 executeSpritesTest(u16 *scores)
}

// set palette
VDP_setPalette(PAL1, flare_small.palette->data);
PAL_setPalette(PAL1, flare_small.palette->data, CPU);

// init positions
baseposx = FIX16((VDP_getScreenWidth() / 2) - 8);
@@ -216,7 +216,7 @@ u16 executeSpritesTest(u16 *scores)
}

// set palette
VDP_setPalette(PAL1, flare_small.palette->data);
PAL_setPalette(PAL1, flare_small.palette->data, CPU);

// init positions
baseposx = FIX16((VDP_getScreenWidth() / 2) - 8);
@@ -269,7 +269,7 @@ u16 executeSpritesTest(u16 *scores)
}

// set palette
VDP_setPalette(PAL1, flare_small.palette->data);
PAL_setPalette(PAL1, flare_small.palette->data, CPU);

// init positions
baseposx = FIX16((VDP_getScreenWidth() / 2) - 8);
@@ -310,7 +310,7 @@ u16 executeSpritesTest(u16 *scores)
}

// set palette
VDP_setPalette(PAL1, flare_big.palette->data);
PAL_setPalette(PAL1, flare_big.palette->data, CPU);

// init positions
baseposx = FIX16((VDP_getScreenWidth() / 2) - 16);
@@ -363,7 +363,7 @@ u16 executeSpritesTest(u16 *scores)
}

// set palette
VDP_setPalette(PAL1, flare_big.palette->data);
PAL_setPalette(PAL1, flare_big.palette->data, CPU);

// init positions
baseposx = FIX16((VDP_getScreenWidth() / 2) - 16);
@@ -390,7 +390,7 @@ u16 executeSpritesTest(u16 *scores)
SYS_enableInts();

// set palette
VDP_setPalette(PAL1, donut.palette->data);
PAL_setPalette(PAL1, donut.palette->data, CPU);

// execute donut bench
*scores = executeDonut(20, FALSE);
@@ -422,7 +422,7 @@ u16 executeSpritesTest(u16 *scores)
}

// set palette
VDP_setPalette(PAL1, donut.palette->data);
PAL_setPalette(PAL1, donut.palette->data, CPU);

// execute particle bench
*scores = executeDonut(20, TRUE);
@@ -488,7 +488,7 @@ u16 executeSpritesTest(u16 *scores)

// set palette
SYS_disableInts();
VDP_setPaletteColors(0, palette, 64);
PAL_setColors(0, palette, 64, CPU);
SYS_enableInts();

// execute sprite bench
@@ -537,7 +537,7 @@ static void initPartic(u16 num)
while(i--)
{
Sprite* s = *sprite;
Object* o = (Object*) s->data;
MovingObject* o = (MovingObject*) s->data;

o->mov.x = FIX16(2) - (random() & (FIX16_FRAC_MASK << 2));
o->mov.y = FIX16(2) + (random() & (FIX16_FRAC_MASK << 3));
@@ -566,7 +566,7 @@ static void updatePartic(u16 num, u16 preloadedTiles, u16 realloc)
while(i--)
{
Sprite* s = *sprite;
Object* o = (Object*) s->data;
MovingObject* o = (MovingObject*) s->data;

if ((o->pos.x < minx) || (o->pos.x > maxx) || (o->pos.y < miny))
{
@@ -826,7 +826,7 @@ static void initPos(u16 num)
while(i--)
{
Sprite* s = *sprite;
Object* o = (Object*) s->data;
MovingObject* o = (MovingObject*) s->data;

o->pos.x = FIX16(32 + (random() & 0xFF));
o->pos.y = FIX16((random() & 0x7F));
@@ -858,7 +858,7 @@ static void updatePos(u16 num)
while(i--)
{
Sprite* s = *sprite;
Object* o = (Object*) s->data;
MovingObject* o = (MovingObject*) s->data;

o->pos.x += o->mov.x;
o->pos.y += o->mov.y;
@@ -892,7 +892,7 @@ static void updateAnim(u16 num)
while(i--)
{
Sprite* s = *sprite;
Object* o = (Object*) s->data;
MovingObject* o = (MovingObject*) s->data;
fix16 mx = o->mov.x;

if ((mx != 0) || (o->mov.y != 0)) SPR_setAnim(s, 1);
@@ -943,7 +943,7 @@ static u16 execute(u16 time, u16 numSpr)
static void handleInput()
{
#ifdef TEST_SPR
Object* o = (Object*) sprites[0]->data;
MovingObject* o = (MovingObject*) sprites[0]->data;

u16 value = JOY_readJoypad(JOY_1);

@@ -235,8 +235,8 @@ static void vblank()

if (int_frame == 2)
{
VDP_setPalette(PAL0, pal_even);
fps = getFPS();
PAL_setPalette(PAL0, pal_even, CPU);
fps = SYS_getFPS();
}

// we have data to transfer --> start transfer
@@ -281,9 +281,9 @@ static void vblank()
}

// set first palette
VDP_setPalette(PAL0, pal_odd);
PAL_setPalette(PAL0, pal_odd, CPU);
int_frame = 4;
fps = getFPS();
fps = SYS_getFPS();

flip_done = TRUE;
}
@@ -99,7 +99,7 @@ static void fastStarFieldFX()
// first update
SPR_update();

VDP_setPalette(PAL2, donut.palette->data);
PAL_setPalette(PAL2, donut.palette->data, CPU);

SYS_enableInts();

@@ -101,7 +101,7 @@ int main()

// Setup VDP
VDP_setScrollingMode(HSCROLL_PLANE, VSCROLL_PLANE);
VDP_setPaletteColors(0, palette_black, 64);
PAL_setColors(0, palette_black, 64, CPU);

// Setup graphics
setupBackground();
@@ -22,8 +22,8 @@ void fadeInBlue(u16 fromcol, u16 tocol, const u16 *pal, u16 numframeBlue, u16 nu
palBlue[i] = pal[i] & 0xF00;

// First fade in blue part, then green and red
VDP_fadeIn(fromcol, tocol, palBlue, numframeBlue, FALSE);
VDP_fadeTo(fromcol, tocol, pal, numframeGreenRed, FALSE);
PAL_fadeIn(fromcol, tocol, palBlue, numframeBlue, FALSE);
PAL_fadeTo(fromcol, tocol, pal, numframeGreenRed, FALSE);
}

// -----------------------------------------------------------------------------
@@ -110,7 +110,7 @@ void initMenu(MenuItem* items, u16 num)

void initMenuEx(MenuItem* items, u16 num, char* pointer)
{

menuItems = items;
menuItemsNum = num;
menuPointer = pointer;
@@ -192,7 +192,7 @@ void updateMenuItems()
if (item->type == MIT_BOOL)
*item->vbool.value = FALSE;
}

menuButtonDelay = (menuJoyStateOld == 0) ? 20 : 5;
}
menuJoyStateOld = joyState;
@@ -261,7 +261,7 @@ int main()
// Setup VDP
VDP_setHilightShadow(1);
VDP_setScrollingMode(HSCROLL_PLANE, VSCROLL_PLANE);
VDP_setPaletteColors(0, palette_black, 64);
PAL_setColors(0, palette_black, 64, CPU);
VDP_loadFontData(tileset_Font_Namco_Gradient.tiles, 96, CPU);

// Setup graphics
@@ -126,7 +126,7 @@ int main()
VDP_setHilightShadow(1); // Hilight/shadow activation

// Loading tile stuff and color data into VRAM/CRAM
VDP_setPalette(PAL0, background_palette);
PAL_setPalette(PAL0, background_palette, CPU);
VDP_loadTileData(background_tileset, TILE_USER_INDEX, NUM_TILES_TILESET, 1);
VDP_loadTileData(sprite_tileset, TILE_USER_INDEX + 2, 2, 1);

@@ -24,7 +24,7 @@ int main()
{
// Setup VDP
VDP_setScrollingMode(HSCROLL_LINE, VSCROLL_PLANE);
VDP_setPaletteColors(0, palette_black, 64);
PAL_setColors(0, palette_black, 64, CPU);

// because we like to have it =)
SYS_showFrameLoad(TRUE);
@@ -15,9 +15,9 @@ int main()
VDP_setScreenWidth320();
VDP_setHInterrupt(0);
VDP_setHilightShadow(0);
VDP_setPaletteColor(15+16, 0x0222);
PAL_setColor(15+16, 0x0222);
VDP_setTextPalette(0);
VDP_setPaletteColor(0, 0x0882);
PAL_setColor(0, 0x0882);

value = JOY_getPortType(PORT_1);
switch (value)
@@ -132,8 +132,8 @@ int main()
for(j = 0, cur_cmd = cur_driver->cmds; j < MAX_CMD; j++, cur_cmd++)
params_value[i][j] = cur_cmd->params;

VDP_setPalette(PAL0, font_pal_lib.data);
VDP_setPaletteColor((PAL1 * 16) + 15, 0x0888);
PAL_setPalette(PAL0, font_pal_lib.data, CPU);
PAL_setColor((PAL1 * 16) + 15, 0x0888);
VDP_setTextPalette(PAL0);
VDP_drawText("Current Z80 driver", 10, 1);
VDP_drawText("DMA Method:", 1, 26);
@@ -196,7 +196,7 @@ int main()
SYS_disableInts();

// clear all palette
VDP_setPaletteColors(0, palette_black, 64);
PAL_setColors(0, palette_black, 64, CPU);

// initialization
VDP_setScreenWidth320();
@@ -343,7 +343,7 @@ int main()
palette[63] = 0x000;

// palette fading
VDP_fadeAll(palette_black, palette, 30, FALSE);
PAL_fadeAll(palette_black, palette, 30, FALSE);

JOY_setEventHandler(joyEvent);

@@ -367,7 +367,7 @@ int main()

xgmOffset = 0;
YM_init(&ym);
PSG_init(&psg);
PSGState_init(&psg);
}

SYS_enableInts();