Exemplo n.º 1
0
BOOL IsFixedPalette(Chunk_With_Children * parent)
{
	if (parent)
	{
		List<Chunk *> plist;
		parent->lookup_child("PRSETPAL",plist);
		
		LIF<Chunk *> plit(&plist);
		for (; !plit.done(); plit.next())
		{
			for (LIF<Preset_Palette> findconst(&((Preset_Palette_Chunk *)plit())->pplist); !findconst.done(); findconst.next())
			{
				if (findconst().flags & PrePalFlag_Reserved)
				{
					return TRUE;
				}
			}
		}
		parent->lookup_child("SETPALST",plist);
		for (plit = LIF<Chunk *> (&plist); !plit.done(); plit.next())
		{
			for (LIF<Preset_Palette> findconst(&((Preset_Palette_Store_Chunk *)plit())->pplist); !findconst.done(); findconst.next())
			{
				if (findconst().flags & PrePalFlag_Reserved)
				{
					return TRUE;
				}
			}
		}
	}
	return FALSE;
}
Exemplo n.º 2
0
void Palette_Outdated(Chunk_With_Children * parent)
{
	if (parent)
	{
		List<Chunk *> plist;
		parent->lookup_child("ENVPALET",plist);
		for (LIF<Chunk *> plit(&plist); !plit.done(); plit.next())
		{
			((Environment_Palette_Chunk *)plit())->flags &= ~EnvPalFlag_UpToDate;
		}
	}
}
Exemplo n.º 3
0
int main(void)
{
    init((CELL *)malloc(16384), 4096);

    start_ass(EP);
    plit(test); ass(O_LINK); ass(O_ZERO); ass(O_HALT);

    assert(single_step() == -259);   // load first instruction word
    CELL res = run();
    if (res != 0) {
        printf("Error in LINK tests: test aborted with return code %"PRId32"\n", res);
        exit(1);
    }

    printf("Top of stack is %d; should be %d\n", LOAD_CELL(SP), 37);
    show_data_stack();
    if (LOAD_CELL(SP) != 37) {
        printf("Error in LINK tests: incorrect value on top of stack\n");
        exit(1);
    }

    assert(exception == 0);
    printf("LINK tests ran OK\n");
    return 0;
}
Exemplo n.º 4
0
void FixedPalette_Outdated(Chunk_With_Children * parent)
{
	if (parent)
	{
		List<Chunk *> plist;
		parent->lookup_child("PRSETPAL",plist);
		for (LIF<Chunk *> plit(&plist); !plit.done(); plit.next())
		{
			for (LIF<Preset_Palette> findconst(&((Preset_Palette_Chunk *)plit())->pplist); !findconst.done(); findconst.next())
			{
				Preset_Palette temp = findconst();
				if (temp.flags & PrePalFlag_Reserved)
				{
					temp.flags &= ~PrePalFlag_UpToDate;
					findconst.change_current(temp);
				}
			}
		}
	}
}