#include "swis.h"
#include "Task.h"

/*
 * Screen properties
 */

static Mode_Info	Task_ModeInfo;

const Mode_Info* Task_GetModeInfo(void)
{
	return &Task_ModeInfo;
}

void Task_SetModeInfo(void)
{
	int inv[6];
	int outv[6];

	inv[0] = 4;
	inv[1] = 5;
	inv[2] = 11;
	inv[3] = 12;
	inv[4] = 9;
	inv[5] = -1;

	_swix(OS_ReadVduVariables, _INR(0,1), inv, outv);

	Task_ModeInfo.shiftx = outv[0];
	Task_ModeInfo.shifty = outv[1];
	Task_ModeInfo.dx = 1 << outv[0];
	Task_ModeInfo.dy = 1 << outv[1];
	Task_ModeInfo.bpp = 1 << outv[4];
	Task_ModeInfo.resx = 180 >> outv[0];
	Task_ModeInfo.resy = 180 >> outv[1];
	Task_ModeInfo.millix = 400;
	Task_ModeInfo.milliy = 400;
	Task_ModeInfo.box.x0 = 0;
	Task_ModeInfo.box.y0 = 0;
	Task_ModeInfo.box.x1 = (outv[2] + 1) << outv[0];
	Task_ModeInfo.box.y1 = (outv[3] + 1) << outv[1];
}
