mirror of
https://github.com/lscharen/iigs-sprite-compiler.git
synced 2024-09-27 08:54:50 +00:00
Fix bug in the first solid word search
This commit is contained in:
parent
53561fbcc8
commit
8850bec117
@ -48,6 +48,7 @@ namespace SpriteCompiler.Problem
|
|||||||
{
|
{
|
||||||
_.A = _.A.Add(offset);
|
_.A = _.A.Add(offset);
|
||||||
_.S = _.A;
|
_.S = _.A;
|
||||||
|
_.AllowModeChange = true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@
|
|||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return String.Format("A = {0:X4}, X = {1}, Y = {2}, S = {3}, D = {4}, P = {5:X2}", A, X, Y, S, D, P);
|
return String.Format("A = {0:X4}, X = {1}, Y = {2}, S = {3}, D = {4}, P = {5:X2}, Change? = {6}", A, X, Y, S, D, P, AllowModeChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveWord(ushort offset)
|
public void RemoveWord(ushort offset)
|
||||||
|
@ -108,7 +108,7 @@
|
|||||||
// a second stack adjustment.
|
// a second stack adjustment.
|
||||||
//
|
//
|
||||||
// 3. Set the stack to the first, right-most offset that end a sequence of solid bytes
|
// 3. Set the stack to the first, right-most offset that end a sequence of solid bytes
|
||||||
if (!state.S.IsScreenOffset && state.A.IsScreenOffset)
|
if (!state.S.IsScreenOffset && state.A.IsScreenOffset && state.LongA)
|
||||||
{
|
{
|
||||||
// If the first byte is within 255 bytes of the accumulator, propose setting
|
// If the first byte is within 255 bytes of the accumulator, propose setting
|
||||||
// the stack to the accumulator value
|
// the stack to the accumulator value
|
||||||
@ -136,7 +136,7 @@
|
|||||||
// If the first byte is 256 bytes or more ahead of the current stack location,
|
// If the first byte is 256 bytes or more ahead of the current stack location,
|
||||||
// then we need to advance
|
// then we need to advance
|
||||||
var firstByteDistance = firstByte.Offset - state.S.Value;
|
var firstByteDistance = firstByte.Offset - state.S.Value;
|
||||||
if (state.S.IsScreenOffset && firstByteDistance >= 256)
|
if (state.S.IsScreenOffset && firstByteDistance >= 256 && state.LongA)
|
||||||
{
|
{
|
||||||
// Go to the next byte, or the first solid edge
|
// Go to the next byte, or the first solid edge
|
||||||
yield return state.Apply(new MOVE_STACK(firstByteDistance));
|
yield return state.Apply(new MOVE_STACK(firstByteDistance));
|
||||||
@ -297,9 +297,6 @@
|
|||||||
yield return state.Apply(new SHORT_M());
|
yield return state.Apply(new SHORT_M());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Done:
|
|
||||||
var z = 0; z += 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool IsSolidPair(Tuple<SpriteByte, SpriteByte> pair)
|
private static bool IsSolidPair(Tuple<SpriteByte, SpriteByte> pair)
|
||||||
@ -340,7 +337,7 @@
|
|||||||
trigger = true;
|
trigger = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.Mask != 0x00 && trigger)
|
if ((item.Mask != 0x00 || (item.Offset - last.Offset) > 1) && trigger)
|
||||||
{
|
{
|
||||||
return new SolidRun(first, last);
|
return new SolidRun(first, last);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user