Fix ACLS
This commit is contained in:
@@ -135,6 +135,15 @@ class BG
|
|||||||
}
|
}
|
||||||
void screen(int w, int h)
|
void screen(int w, int h)
|
||||||
{
|
{
|
||||||
|
rot = 0;
|
||||||
|
scalex = 0;
|
||||||
|
scaley = 0;
|
||||||
|
homex = 0;
|
||||||
|
homey = 0;
|
||||||
|
chipWidth = 16;
|
||||||
|
chipHeight = 16;
|
||||||
|
offsetx = offsety = offsetz = 0;
|
||||||
|
//BGCLIP is not initialized
|
||||||
this.width = w;
|
this.width = w;
|
||||||
this.height = h;
|
this.height = h;
|
||||||
this.clear();
|
this.clear();
|
||||||
|
|||||||
@@ -2465,10 +2465,11 @@ class BuiltinFunction
|
|||||||
}
|
}
|
||||||
static void ACLS(PetitComputer p)
|
static void ACLS(PetitComputer p)
|
||||||
{
|
{
|
||||||
p.console.cls;
|
p.acls(true, true, true);
|
||||||
SPCLR(p, DefaultValue!(int, false)(true));
|
}
|
||||||
BGCLR(p, DefaultValue!(int, false)(true));
|
static void ACLS(PetitComputer p, int gr, int sp, int fn)
|
||||||
GCLS(p);
|
{
|
||||||
|
p.acls(cast(bool)gr, cast(bool)sp, cast(bool)fn);
|
||||||
}
|
}
|
||||||
static int CHKCALL(PetitComputer p, wstring func)
|
static int CHKCALL(PetitComputer p, wstring func)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -114,8 +114,8 @@ class Graphic
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool[2] visibles = [true, true];
|
bool[2] visibles = [true, true];
|
||||||
protected int[2] showPage = [0, 1];
|
int[2] showPage = [0, 1];
|
||||||
protected int[2] usePage = [0, 1];
|
int[2] usePage = [0, 1];
|
||||||
bool visible()
|
bool visible()
|
||||||
{
|
{
|
||||||
return visibles[petitcom.displaynum];
|
return visibles[petitcom.displaynum];
|
||||||
@@ -323,7 +323,7 @@ class Graphic
|
|||||||
}
|
}
|
||||||
abstract void gcopy(int srcpage, int x, int y, int x2, int y2, int x3, int y3, int cpmode);
|
abstract void gcopy(int srcpage, int x, int y, int x2, int y2, int x3, int y3, int cpmode);
|
||||||
abstract void gtri(int x1, int y1, int x2, int y2, int x3, int y3, int color);
|
abstract void gtri(int x1, int y1, int x2, int y2, int x3, int y3, int color);
|
||||||
int[2] gprios = [511, 511];
|
int[2] gprios = [512, 512];
|
||||||
|
|
||||||
@property ref gprio()
|
@property ref gprio()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1634,6 +1634,51 @@ class PetitComputer
|
|||||||
|
|
||||||
Program program;
|
Program program;
|
||||||
|
|
||||||
|
void acls(bool gclsAndSpriteImageBGImageInit, bool spdef, bool fontdef)
|
||||||
|
{
|
||||||
|
xscreen(0, 512, 4);
|
||||||
|
backcolor = 0;
|
||||||
|
console.width(8);
|
||||||
|
console.foreColors[] = 15;
|
||||||
|
console.backColors[] = 0;
|
||||||
|
console.CSRXs[] = 0;
|
||||||
|
console.CSRYs[] = 0;
|
||||||
|
console.CSRZs[] = 0;
|
||||||
|
console.attrs[] = ConsoleAttribute.TROT0;
|
||||||
|
if (gclsAndSpriteImageBGImageInit)
|
||||||
|
{
|
||||||
|
//TODO:sprite,bg
|
||||||
|
for (int i = 0; i <= 3; i++)
|
||||||
|
{
|
||||||
|
this.graphic.useGRP = i;
|
||||||
|
graphic.gcls(0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.graphic.usePage = [0, 1];
|
||||||
|
this.graphic.showPage = [0, 1];
|
||||||
|
this.graphic.gprios = [512, 512];/*reference:GPRIO 1024*/
|
||||||
|
this.graphic.visibles = [1, 1];
|
||||||
|
this.sprite.sppage = [4, 4];
|
||||||
|
this.sprite.allclear();
|
||||||
|
this.sprite.visibles = [true, true];
|
||||||
|
this.bgpage = [5, 5];
|
||||||
|
this.BGvisibles = [true, true];
|
||||||
|
foreach (b; bg)
|
||||||
|
{
|
||||||
|
b.screen(25, 15);
|
||||||
|
b.clip();
|
||||||
|
}
|
||||||
|
if (spdef)
|
||||||
|
{
|
||||||
|
this.sprite.spdef();
|
||||||
|
}
|
||||||
|
if (fontdef)
|
||||||
|
{
|
||||||
|
//TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//プチコン内部表現はRGB5_A1
|
//プチコン内部表現はRGB5_A1
|
||||||
static uint toGLColor(GLenum format, ubyte r, ubyte g, ubyte b, ubyte a)
|
static uint toGLColor(GLenum format, ubyte r, ubyte g, ubyte b, ubyte a)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -978,6 +978,13 @@ class Sprite
|
|||||||
sprites[i].clear;
|
sprites[i].clear;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void allclear()
|
||||||
|
{
|
||||||
|
synchronized (this) for(int i = 0; i < sprites.length; i++)
|
||||||
|
{
|
||||||
|
sprites[i].clear;
|
||||||
|
}
|
||||||
|
}
|
||||||
void sphome(int i, int hx, int hy)
|
void sphome(int i, int hx, int hy)
|
||||||
{
|
{
|
||||||
i = spid(i);
|
i = spid(i);
|
||||||
|
|||||||
Reference in New Issue
Block a user