2009-01-19 16:52:32 +00:00
|
|
|
//============================================================================
|
|
|
|
//
|
|
|
|
// SSSS tt lll lll
|
|
|
|
// SS SS tt ll ll
|
|
|
|
// SS tttttt eeee ll ll aaaa
|
|
|
|
// SSSS tt ee ee ll ll aa
|
|
|
|
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
|
|
|
// SS SS tt ee ll ll aa aa
|
|
|
|
// SSSS ttt eeeee llll llll aaaaa
|
|
|
|
//
|
2014-01-12 17:23:42 +00:00
|
|
|
// Copyright (c) 1995-2014 by Bradford W. Mott, Stephen Anthony
|
2010-04-10 21:37:23 +00:00
|
|
|
// and the Stella Team
|
2009-01-19 16:52:32 +00:00
|
|
|
//
|
2010-01-10 03:23:32 +00:00
|
|
|
// See the file "License.txt" for information on usage and redistribution of
|
2009-01-19 16:52:32 +00:00
|
|
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
|
|
|
//
|
2009-05-13 13:55:40 +00:00
|
|
|
// $Id$
|
2009-01-19 16:52:32 +00:00
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
#include <cassert>
|
|
|
|
|
|
|
|
#include "bspf.hxx"
|
|
|
|
#include "TIATables.hxx"
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void TIATables::computeAllTables()
|
|
|
|
{
|
2012-07-14 18:56:57 +00:00
|
|
|
memset(DisabledMask, 0, 640);
|
2009-02-08 21:07:06 +00:00
|
|
|
buildCollisionMaskTable();
|
|
|
|
buildPxMaskTable();
|
|
|
|
buildMxMaskTable();
|
|
|
|
buildBLMaskTable();
|
|
|
|
buildPFMaskTable();
|
|
|
|
buildGRPReflectTable();
|
|
|
|
buildPxPosResetWhenTable();
|
2009-01-19 16:52:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2009-02-08 21:07:06 +00:00
|
|
|
void TIATables::buildCollisionMaskTable()
|
2009-01-19 16:52:32 +00:00
|
|
|
{
|
|
|
|
for(uInt8 i = 0; i < 64; ++i)
|
|
|
|
{
|
2009-02-08 21:07:06 +00:00
|
|
|
CollisionMask[i] = 0;
|
2009-01-19 16:52:32 +00:00
|
|
|
|
|
|
|
if((i & M0Bit) && (i & P1Bit)) // M0-P1
|
2009-07-31 19:01:20 +00:00
|
|
|
CollisionMask[i] |= Cx_M0P1;
|
2009-01-19 16:52:32 +00:00
|
|
|
|
|
|
|
if((i & M0Bit) && (i & P0Bit)) // M0-P0
|
2009-07-31 19:01:20 +00:00
|
|
|
CollisionMask[i] |= Cx_M0P0;
|
2009-01-19 16:52:32 +00:00
|
|
|
|
|
|
|
if((i & M1Bit) && (i & P0Bit)) // M1-P0
|
2009-07-31 19:01:20 +00:00
|
|
|
CollisionMask[i] |= Cx_M1P0;
|
2009-01-19 16:52:32 +00:00
|
|
|
|
|
|
|
if((i & M1Bit) && (i & P1Bit)) // M1-P1
|
2009-07-31 19:01:20 +00:00
|
|
|
CollisionMask[i] |= Cx_M1P1;
|
2009-01-19 16:52:32 +00:00
|
|
|
|
|
|
|
if((i & P0Bit) && (i & PFBit)) // P0-PF
|
2009-07-31 19:01:20 +00:00
|
|
|
CollisionMask[i] |= Cx_P0PF;
|
2009-01-19 16:52:32 +00:00
|
|
|
|
|
|
|
if((i & P0Bit) && (i & BLBit)) // P0-BL
|
2009-07-31 19:01:20 +00:00
|
|
|
CollisionMask[i] |= Cx_P0BL;
|
2009-01-19 16:52:32 +00:00
|
|
|
|
|
|
|
if((i & P1Bit) && (i & PFBit)) // P1-PF
|
2009-07-31 19:01:20 +00:00
|
|
|
CollisionMask[i] |= Cx_P1PF;
|
2009-01-19 16:52:32 +00:00
|
|
|
|
|
|
|
if((i & P1Bit) && (i & BLBit)) // P1-BL
|
2009-07-31 19:01:20 +00:00
|
|
|
CollisionMask[i] |= Cx_P1BL;
|
2009-01-19 16:52:32 +00:00
|
|
|
|
|
|
|
if((i & M0Bit) && (i & PFBit)) // M0-PF
|
2009-07-31 19:01:20 +00:00
|
|
|
CollisionMask[i] |= Cx_M0PF;
|
2009-01-19 16:52:32 +00:00
|
|
|
|
|
|
|
if((i & M0Bit) && (i & BLBit)) // M0-BL
|
2009-07-31 19:01:20 +00:00
|
|
|
CollisionMask[i] |= Cx_M0BL;
|
2009-01-19 16:52:32 +00:00
|
|
|
|
|
|
|
if((i & M1Bit) && (i & PFBit)) // M1-PF
|
2009-07-31 19:01:20 +00:00
|
|
|
CollisionMask[i] |= Cx_M1PF;
|
2009-01-19 16:52:32 +00:00
|
|
|
|
|
|
|
if((i & M1Bit) && (i & BLBit)) // M1-BL
|
2009-07-31 19:01:20 +00:00
|
|
|
CollisionMask[i] |= Cx_M1BL;
|
2009-01-19 16:52:32 +00:00
|
|
|
|
|
|
|
if((i & BLBit) && (i & PFBit)) // BL-PF
|
2009-07-31 19:01:20 +00:00
|
|
|
CollisionMask[i] |= Cx_BLPF;
|
2009-01-19 16:52:32 +00:00
|
|
|
|
|
|
|
if((i & P0Bit) && (i & P1Bit)) // P0-P1
|
2009-07-31 19:01:20 +00:00
|
|
|
CollisionMask[i] |= Cx_P0P1;
|
2009-01-19 16:52:32 +00:00
|
|
|
|
|
|
|
if((i & M0Bit) && (i & M1Bit)) // M0-M1
|
2009-07-31 19:01:20 +00:00
|
|
|
CollisionMask[i] |= Cx_M0M1;
|
2009-02-08 21:07:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
// [suppress mode:2][nusiz:8][pixel:320]
|
2009-07-31 19:01:20 +00:00
|
|
|
// suppress=1: suppress on
|
|
|
|
// suppress=0: suppress off
|
|
|
|
void TIATables::buildPxMaskTable()
|
2009-02-08 21:07:06 +00:00
|
|
|
{
|
2009-07-31 19:01:20 +00:00
|
|
|
Int32 x, suppress, nusiz;
|
2009-02-08 21:07:06 +00:00
|
|
|
|
|
|
|
// Set the player mask table to all zeros
|
2012-07-14 18:56:57 +00:00
|
|
|
for(nusiz = 0; nusiz < 8; ++nusiz)
|
|
|
|
for(x = 0; x < 160; ++x)
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
PxMask[0][nusiz][x] = PxMask[1][nusiz][x] = 0x00;
|
2009-02-08 21:07:06 +00:00
|
|
|
|
|
|
|
// Now, compute the player mask table
|
2009-07-31 19:01:20 +00:00
|
|
|
for(suppress = 0; suppress < 2; ++suppress)
|
2009-02-08 21:07:06 +00:00
|
|
|
{
|
2009-07-31 19:01:20 +00:00
|
|
|
for(nusiz = 0; nusiz < 8; ++nusiz)
|
2009-02-08 21:07:06 +00:00
|
|
|
{
|
|
|
|
for(x = 0; x < 160 + 72; ++x)
|
|
|
|
{
|
2009-07-31 19:01:20 +00:00
|
|
|
// nusiz:
|
|
|
|
// 0: one copy
|
|
|
|
// 1: two copies-close
|
|
|
|
// 2: two copies-med
|
|
|
|
// 3: three copies-close
|
|
|
|
// 4: two copies-wide
|
|
|
|
// 5: double size player
|
|
|
|
// 6: 3 copies medium
|
|
|
|
// 7: quad sized player
|
|
|
|
switch(nusiz)
|
2009-02-08 21:07:06 +00:00
|
|
|
{
|
|
|
|
case 0x00:
|
2009-07-31 19:01:20 +00:00
|
|
|
if((suppress == 0) && (x >= 0) && (x < 8))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
PxMask[suppress][nusiz][x % 160] = 0x80 >> x;
|
2009-02-08 21:07:06 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x01:
|
2009-07-31 19:01:20 +00:00
|
|
|
if((suppress == 0) && (x >= 0) && (x < 8))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
PxMask[suppress][nusiz][x % 160] = 0x80 >> x;
|
2009-02-08 21:07:06 +00:00
|
|
|
else if(((x - 16) >= 0) && ((x - 16) < 8))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
PxMask[suppress][nusiz][x % 160] = 0x80 >> (x - 16);
|
2009-02-08 21:07:06 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x02:
|
2009-07-31 19:01:20 +00:00
|
|
|
if((suppress == 0) && (x >= 0) && (x < 8))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
PxMask[suppress][nusiz][x % 160] = 0x80 >> x;
|
2009-02-08 21:07:06 +00:00
|
|
|
else if(((x - 32) >= 0) && ((x - 32) < 8))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
PxMask[suppress][nusiz][x % 160] = 0x80 >> (x - 32);
|
2009-02-08 21:07:06 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x03:
|
2009-07-31 19:01:20 +00:00
|
|
|
if((suppress == 0) && (x >= 0) && (x < 8))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
PxMask[suppress][nusiz][x % 160] = 0x80 >> x;
|
2009-02-08 21:07:06 +00:00
|
|
|
else if(((x - 16) >= 0) && ((x - 16) < 8))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
PxMask[suppress][nusiz][x % 160] = 0x80 >> (x - 16);
|
2009-02-08 21:07:06 +00:00
|
|
|
else if(((x - 32) >= 0) && ((x - 32) < 8))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
PxMask[suppress][nusiz][x % 160] = 0x80 >> (x - 32);
|
2009-02-08 21:07:06 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x04:
|
2009-07-31 19:01:20 +00:00
|
|
|
if((suppress == 0) && (x >= 0) && (x < 8))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
PxMask[suppress][nusiz][x % 160] = 0x80 >> x;
|
2009-02-08 21:07:06 +00:00
|
|
|
else if(((x - 64) >= 0) && ((x - 64) < 8))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
PxMask[suppress][nusiz][x % 160] = 0x80 >> (x - 64);
|
2009-02-08 21:07:06 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x05:
|
2009-07-31 19:01:20 +00:00
|
|
|
// For some reason in double size nusiz the player's output
|
2009-02-08 21:07:06 +00:00
|
|
|
// is delayed by one pixel thus we use > instead of >=
|
2009-07-31 19:01:20 +00:00
|
|
|
if((suppress == 0) && (x > 0) && (x <= 16))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
PxMask[suppress][nusiz][x % 160] = 0x80 >> ((x - 1)/2);
|
2009-02-08 21:07:06 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x06:
|
2009-07-31 19:01:20 +00:00
|
|
|
if((suppress == 0) && (x >= 0) && (x < 8))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
PxMask[suppress][nusiz][x % 160] = 0x80 >> x;
|
2009-02-08 21:07:06 +00:00
|
|
|
else if(((x - 32) >= 0) && ((x - 32) < 8))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
PxMask[suppress][nusiz][x % 160] = 0x80 >> (x - 32);
|
2009-02-08 21:07:06 +00:00
|
|
|
else if(((x - 64) >= 0) && ((x - 64) < 8))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
PxMask[suppress][nusiz][x % 160] = 0x80 >> (x - 64);
|
2009-02-08 21:07:06 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x07:
|
2009-07-31 19:01:20 +00:00
|
|
|
// For some reason in quad size nusiz the player's output
|
2009-02-08 21:07:06 +00:00
|
|
|
// is delayed by one pixel thus we use > instead of >=
|
2009-07-31 19:01:20 +00:00
|
|
|
if((suppress == 0) && (x > 0) && (x <= 32))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
PxMask[suppress][nusiz][x % 160] = 0x80 >> ((x - 1)/4);
|
2009-02-08 21:07:06 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Copy data into wrap-around area
|
|
|
|
for(x = 0; x < 160; ++x)
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
PxMask[suppress][nusiz][x + 160] = PxMask[suppress][nusiz][x];
|
2009-02-08 21:07:06 +00:00
|
|
|
}
|
2009-01-19 16:52:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
// [number:8][size:5][pixel:320]
|
2009-07-31 19:01:20 +00:00
|
|
|
void TIATables::buildMxMaskTable()
|
2009-01-19 16:52:32 +00:00
|
|
|
{
|
|
|
|
Int32 x, size, number;
|
|
|
|
|
|
|
|
// Clear the missle table to start with
|
|
|
|
for(number = 0; number < 8; ++number)
|
2009-08-28 21:53:31 +00:00
|
|
|
for(size = 0; size < 5; ++size)
|
2009-01-19 16:52:32 +00:00
|
|
|
for(x = 0; x < 160; ++x)
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][size][x] = false;
|
2009-01-19 16:52:32 +00:00
|
|
|
|
|
|
|
for(number = 0; number < 8; ++number)
|
|
|
|
{
|
2009-08-28 21:53:31 +00:00
|
|
|
for(size = 0; size < 5; ++size)
|
2009-01-19 16:52:32 +00:00
|
|
|
{
|
|
|
|
for(x = 0; x < 160 + 72; ++x)
|
|
|
|
{
|
2009-08-28 21:53:31 +00:00
|
|
|
// For the following, size index = 4 is almost exactly the same as
|
|
|
|
// index = 2; that is, 1 << 2, or 4 colour clocks wide
|
|
|
|
// To simulate the weirdness in the Cosmic Ark starfield effect,
|
|
|
|
// each group of 4 pixels has its 3rd pixel blanked
|
2009-07-31 19:01:20 +00:00
|
|
|
switch(number)
|
2009-01-19 16:52:32 +00:00
|
|
|
{
|
2009-07-31 19:01:20 +00:00
|
|
|
// Only one copy of the missle
|
|
|
|
case 0x00:
|
|
|
|
case 0x05:
|
|
|
|
case 0x07:
|
2009-08-28 21:53:31 +00:00
|
|
|
if(size != 4)
|
|
|
|
{
|
|
|
|
if((x >= 0) && (x < (1 << size)))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][size][x % 160] = true;
|
2009-08-28 21:53:31 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if((x >= 0) && (x < (1 << 2)))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][4][x % 160] = ((x - 2) % 4 == 0 ? false : true);
|
2009-08-28 21:53:31 +00:00
|
|
|
}
|
2009-07-31 19:01:20 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
// Two copies - close
|
|
|
|
case 0x01:
|
2009-08-28 21:53:31 +00:00
|
|
|
if(size != 4)
|
|
|
|
{
|
|
|
|
if((x >= 0) && (x < (1 << size)))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][size][x % 160] = true;
|
2009-08-28 21:53:31 +00:00
|
|
|
else if(((x - 16) >= 0) && ((x - 16) < (1 << size)))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][size][x % 160] = true;
|
2009-08-28 21:53:31 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if((x >= 0) && (x < (1 << 2)))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][4][x % 160] = ((x - 2) % 4 == 0 ? false : true);
|
2009-08-28 21:53:31 +00:00
|
|
|
else if(((x - 16) >= 0) && ((x - 16) < (1 << 2)))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][4][x % 160] = ((x - 2) % 4 == 0 ? false : true);
|
2009-08-28 21:53:31 +00:00
|
|
|
}
|
2009-07-31 19:01:20 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
// Two copies - medium
|
|
|
|
case 0x02:
|
2009-08-28 21:53:31 +00:00
|
|
|
if(size != 4)
|
|
|
|
{
|
|
|
|
if((x >= 0) && (x < (1 << size)))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][size][x % 160] = true;
|
2009-08-28 21:53:31 +00:00
|
|
|
else if(((x - 32) >= 0) && ((x - 32) < (1 << size)))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][size][x % 160] = true;
|
2009-08-28 21:53:31 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if((x >= 0) && (x < (1 << 2)))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][4][x % 160] = ((x - 2) % 4 == 0 ? false : true);
|
2009-08-28 21:53:31 +00:00
|
|
|
else if(((x - 32) >= 0) && ((x - 32) < (1 << 2)))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][4][x % 160] = ((x - 2) % 4 == 0 ? false : true);
|
2009-08-28 21:53:31 +00:00
|
|
|
}
|
2009-07-31 19:01:20 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
// Three copies - close
|
|
|
|
case 0x03:
|
2009-08-28 21:53:31 +00:00
|
|
|
if(size != 4)
|
|
|
|
{
|
|
|
|
if((x >= 0) && (x < (1 << size)))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][size][x % 160] = true;
|
2009-08-28 21:53:31 +00:00
|
|
|
else if(((x - 16) >= 0) && ((x - 16) < (1 << size)))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][size][x % 160] = true;
|
2009-08-28 21:53:31 +00:00
|
|
|
else if(((x - 32) >= 0) && ((x - 32) < (1 << size)))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][size][x % 160] = true;
|
2009-08-28 21:53:31 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if((x >= 0) && (x < (1 << 2)))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][4][x % 160] = ((x - 2) % 4 == 0 ? false : true);
|
2009-08-28 21:53:31 +00:00
|
|
|
else if(((x - 16) >= 0) && ((x - 16) < (1 << 2)))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][4][x % 160] = ((x - 2) % 4 == 0 ? false : true);
|
2009-08-28 21:53:31 +00:00
|
|
|
else if(((x - 32) >= 0) && ((x - 32) < (1 << 2)))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][4][x % 160] = ((x - 2) % 4 == 0 ? false : true);
|
2009-08-28 21:53:31 +00:00
|
|
|
}
|
2009-07-31 19:01:20 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
// Two copies - wide
|
|
|
|
case 0x04:
|
2009-08-28 21:53:31 +00:00
|
|
|
if(size != 4)
|
|
|
|
{
|
|
|
|
if((x >= 0) && (x < (1 << size)))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][size][x % 160] = true;
|
2009-08-28 21:53:31 +00:00
|
|
|
else if(((x - 64) >= 0) && ((x - 64) < (1 << size)))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][size][x % 160] = true;
|
2009-08-28 21:53:31 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if((x >= 0) && (x < (1 << 2)))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][4][x % 160] = ((x - 2) % 4 == 0 ? false : true);
|
2009-08-28 21:53:31 +00:00
|
|
|
else if(((x - 64) >= 0) && ((x - 64) < (1 << 2)))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][4][x % 160] = ((x - 2) % 4 == 0 ? false : true);
|
2009-08-28 21:53:31 +00:00
|
|
|
}
|
2009-07-31 19:01:20 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
// Three copies - medium
|
|
|
|
case 0x06:
|
2009-08-28 21:53:31 +00:00
|
|
|
if(size != 4)
|
|
|
|
{
|
|
|
|
if((x >= 0) && (x < (1 << size)))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][size][x % 160] = true;
|
2009-08-28 21:53:31 +00:00
|
|
|
else if(((x - 32) >= 0) && ((x - 32) < (1 << size)))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][size][x % 160] = true;
|
2009-08-28 21:53:31 +00:00
|
|
|
else if(((x - 64) >= 0) && ((x - 64) < (1 << size)))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][size][x % 160] = true;
|
2009-08-28 21:53:31 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if((x >= 0) && (x < (1 << 2)))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][4][x % 160] = ((x - 2) % 4 == 0 ? false : true);
|
2009-08-28 21:53:31 +00:00
|
|
|
else if(((x - 32) >= 0) && ((x - 32) < (1 << 2)))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][4][x % 160] = ((x - 2) % 4 == 0 ? false : true);
|
2009-08-28 21:53:31 +00:00
|
|
|
else if(((x - 64) >= 0) && ((x - 64) < (1 << 2)))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][4][x % 160] = ((x - 2) % 4 == 0 ? false : true);
|
2009-08-28 21:53:31 +00:00
|
|
|
}
|
2009-07-31 19:01:20 +00:00
|
|
|
break;
|
2009-01-19 16:52:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Copy data into wrap-around area
|
|
|
|
for(x = 0; x < 160; ++x)
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
MxMask[number][size][x + 160] =
|
|
|
|
MxMask[number][size][x];
|
2009-01-19 16:52:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
// [size:4][pixel:320]
|
2009-07-31 19:01:20 +00:00
|
|
|
void TIATables::buildBLMaskTable()
|
2009-01-19 16:52:32 +00:00
|
|
|
{
|
2009-02-08 21:07:06 +00:00
|
|
|
for(Int32 size = 0; size < 4; ++size)
|
|
|
|
{
|
|
|
|
Int32 x;
|
2009-01-19 16:52:32 +00:00
|
|
|
|
2009-02-08 21:07:06 +00:00
|
|
|
// Set all of the masks to false to start with
|
|
|
|
for(x = 0; x < 160; ++x)
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
BLMask[size][x] = false;
|
2009-01-19 16:52:32 +00:00
|
|
|
|
2009-02-08 21:07:06 +00:00
|
|
|
// Set the necessary fields true
|
|
|
|
for(x = 0; x < 160 + 8; ++x)
|
|
|
|
if((x >= 0) && (x < (1 << size)))
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
BLMask[size][x % 160] = true;
|
2009-02-08 21:07:06 +00:00
|
|
|
|
|
|
|
// Copy fields into the wrap-around area of the mask
|
|
|
|
for(x = 0; x < 160; ++x)
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
BLMask[size][x + 160] = BLMask[size][x];
|
2009-01-19 16:52:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
// [reflect:2][pixel:160]
|
2009-07-31 19:01:20 +00:00
|
|
|
// reflect=1: reflection on
|
|
|
|
// reflect=0: reflection off
|
|
|
|
void TIATables::buildPFMaskTable()
|
2009-02-08 21:07:06 +00:00
|
|
|
{
|
|
|
|
Int32 x;
|
|
|
|
|
|
|
|
// Compute playfield mask table for non-reflected mode
|
|
|
|
for(x = 0; x < 160; ++x)
|
|
|
|
{
|
|
|
|
if(x < 16)
|
2009-07-31 19:01:20 +00:00
|
|
|
PFMask[0][x] = 0x00001 << (x >> 2);
|
2009-02-08 21:07:06 +00:00
|
|
|
else if(x < 48)
|
2009-07-31 19:01:20 +00:00
|
|
|
PFMask[0][x] = 0x00800 >> ((x - 16) >> 2);
|
2009-02-08 21:07:06 +00:00
|
|
|
else if(x < 80)
|
2009-07-31 19:01:20 +00:00
|
|
|
PFMask[0][x] = 0x01000 << ((x - 48) >> 2);
|
2009-02-08 21:07:06 +00:00
|
|
|
else if(x < 96)
|
2009-07-31 19:01:20 +00:00
|
|
|
PFMask[0][x] = 0x00001 << ((x - 80) >> 2);
|
2009-02-08 21:07:06 +00:00
|
|
|
else if(x < 128)
|
2009-07-31 19:01:20 +00:00
|
|
|
PFMask[0][x] = 0x00800 >> ((x - 96) >> 2);
|
2009-02-08 21:07:06 +00:00
|
|
|
else if(x < 160)
|
2009-07-31 19:01:20 +00:00
|
|
|
PFMask[0][x] = 0x01000 << ((x - 128) >> 2);
|
2009-02-08 21:07:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Compute playfield mask table for reflected mode
|
|
|
|
for(x = 0; x < 160; ++x)
|
|
|
|
{
|
|
|
|
if(x < 16)
|
2009-07-31 19:01:20 +00:00
|
|
|
PFMask[1][x] = 0x00001 << (x >> 2);
|
2009-02-08 21:07:06 +00:00
|
|
|
else if(x < 48)
|
2009-07-31 19:01:20 +00:00
|
|
|
PFMask[1][x] = 0x00800 >> ((x - 16) >> 2);
|
2009-02-08 21:07:06 +00:00
|
|
|
else if(x < 80)
|
2009-07-31 19:01:20 +00:00
|
|
|
PFMask[1][x] = 0x01000 << ((x - 48) >> 2);
|
2009-02-08 21:07:06 +00:00
|
|
|
else if(x < 112)
|
2009-07-31 19:01:20 +00:00
|
|
|
PFMask[1][x] = 0x80000 >> ((x - 80) >> 2);
|
2009-02-08 21:07:06 +00:00
|
|
|
else if(x < 144)
|
2009-07-31 19:01:20 +00:00
|
|
|
PFMask[1][x] = 0x00010 << ((x - 112) >> 2);
|
2009-02-08 21:07:06 +00:00
|
|
|
else if(x < 160)
|
2009-07-31 19:01:20 +00:00
|
|
|
PFMask[1][x] = 0x00008 >> ((x - 144) >> 2);
|
2009-02-08 21:07:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void TIATables::buildGRPReflectTable()
|
|
|
|
{
|
|
|
|
for(uInt16 i = 0; i < 256; ++i)
|
|
|
|
{
|
|
|
|
uInt8 r = 0;
|
|
|
|
|
2009-07-31 19:01:20 +00:00
|
|
|
for(uInt16 t = 1; t <= 128; t <<= 1)
|
2009-02-08 21:07:06 +00:00
|
|
|
r = (r << 1) | ((i & t) ? 0x01 : 0x00);
|
|
|
|
|
|
|
|
GRPReflect[i] = r;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
// [nusiz:8][old pixel:160][new pixel:160]
|
2009-02-08 21:07:06 +00:00
|
|
|
void TIATables::buildPxPosResetWhenTable()
|
2009-01-19 16:52:32 +00:00
|
|
|
{
|
2009-07-31 19:01:20 +00:00
|
|
|
uInt32 nusiz, oldx, newx;
|
2009-01-19 16:52:32 +00:00
|
|
|
|
2009-07-31 19:01:20 +00:00
|
|
|
// Loop through all player nusizs, all old player positions, and all new
|
2009-01-19 16:52:32 +00:00
|
|
|
// player positions and determine where the new position is located:
|
|
|
|
// 1 means the new position is within the display of an old copy of the
|
|
|
|
// player, -1 means the new position is within the delay portion of an
|
|
|
|
// old copy of the player, and 0 means it's neither of these two
|
2009-07-31 19:01:20 +00:00
|
|
|
for(nusiz = 0; nusiz < 8; ++nusiz)
|
2009-01-19 16:52:32 +00:00
|
|
|
{
|
|
|
|
for(oldx = 0; oldx < 160; ++oldx)
|
|
|
|
{
|
|
|
|
// Set everything to 0 for non-delay/non-display section
|
|
|
|
for(newx = 0; newx < 160; ++newx)
|
2009-07-31 19:01:20 +00:00
|
|
|
PxPosResetWhen[nusiz][oldx][newx] = 0;
|
2009-01-19 16:52:32 +00:00
|
|
|
|
|
|
|
// Now, we'll set the entries for non-delay/non-display section
|
|
|
|
for(newx = 0; newx < 160 + 72 + 5; ++newx)
|
|
|
|
{
|
2009-07-31 19:01:20 +00:00
|
|
|
// nusiz:
|
|
|
|
// 0: one copy
|
|
|
|
// 1: two copies-close
|
|
|
|
// 2: two copies-med
|
|
|
|
// 3: three copies-close
|
|
|
|
// 4: two copies-wide
|
|
|
|
// 5: double size player
|
|
|
|
// 6: 3 copies medium
|
|
|
|
// 7: quad sized player
|
|
|
|
switch(nusiz)
|
2009-01-19 16:52:32 +00:00
|
|
|
{
|
2009-07-31 19:01:20 +00:00
|
|
|
case 0x00:
|
|
|
|
if((newx >= oldx) && (newx < (oldx + 4)))
|
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = -1;
|
2009-01-19 16:52:32 +00:00
|
|
|
|
2009-08-21 14:29:59 +00:00
|
|
|
else if((newx >= oldx + 4) && (newx < (oldx + 4 + 8)))
|
2009-07-31 19:01:20 +00:00
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = 1;
|
|
|
|
break;
|
2009-01-19 16:52:32 +00:00
|
|
|
|
2009-07-31 19:01:20 +00:00
|
|
|
case 0x01:
|
|
|
|
if((newx >= oldx) && (newx < (oldx + 4)))
|
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = -1;
|
|
|
|
else if((newx >= (oldx + 16)) && (newx < (oldx + 16 + 4)))
|
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = -1;
|
|
|
|
|
2009-08-21 14:29:59 +00:00
|
|
|
else if((newx >= oldx + 4) && (newx < (oldx + 4 + 8)))
|
2009-07-31 19:01:20 +00:00
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = 1;
|
|
|
|
else if((newx >= oldx + 16 + 4) && (newx < (oldx + 16 + 4 + 8)))
|
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x02:
|
|
|
|
if((newx >= oldx) && (newx < (oldx + 4)))
|
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = -1;
|
|
|
|
else if((newx >= (oldx + 32)) && (newx < (oldx + 32 + 4)))
|
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = -1;
|
|
|
|
|
2009-08-21 14:29:59 +00:00
|
|
|
else if((newx >= oldx + 4) && (newx < (oldx + 4 + 8)))
|
2009-07-31 19:01:20 +00:00
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = 1;
|
|
|
|
else if((newx >= oldx + 32 + 4) && (newx < (oldx + 32 + 4 + 8)))
|
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x03:
|
|
|
|
if((newx >= oldx) && (newx < (oldx + 4)))
|
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = -1;
|
|
|
|
else if((newx >= (oldx + 16)) && (newx < (oldx + 16 + 4)))
|
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = -1;
|
|
|
|
else if((newx >= (oldx + 32)) && (newx < (oldx + 32 + 4)))
|
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = -1;
|
|
|
|
|
2009-08-21 14:29:59 +00:00
|
|
|
else if((newx >= oldx + 4) && (newx < (oldx + 4 + 8)))
|
2009-07-31 19:01:20 +00:00
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = 1;
|
|
|
|
else if((newx >= oldx + 16 + 4) && (newx < (oldx + 16 + 4 + 8)))
|
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = 1;
|
|
|
|
else if((newx >= oldx + 32 + 4) && (newx < (oldx + 32 + 4 + 8)))
|
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x04:
|
|
|
|
if((newx >= oldx) && (newx < (oldx + 4)))
|
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = -1;
|
|
|
|
else if((newx >= (oldx + 64)) && (newx < (oldx + 64 + 4)))
|
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = -1;
|
|
|
|
|
2009-08-21 14:29:59 +00:00
|
|
|
else if((newx >= oldx + 4) && (newx < (oldx + 4 + 8)))
|
2009-07-31 19:01:20 +00:00
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = 1;
|
|
|
|
else if((newx >= oldx + 64 + 4) && (newx < (oldx + 64 + 4 + 8)))
|
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = 1;
|
|
|
|
break;
|
2009-01-19 16:52:32 +00:00
|
|
|
|
2009-07-31 19:01:20 +00:00
|
|
|
case 0x05:
|
|
|
|
if((newx >= oldx) && (newx < (oldx + 4)))
|
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = -1;
|
|
|
|
|
2009-08-21 14:29:59 +00:00
|
|
|
else if((newx >= oldx + 4) && (newx < (oldx + 4 + 16)))
|
2009-07-31 19:01:20 +00:00
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x06:
|
|
|
|
if((newx >= oldx) && (newx < (oldx + 4)))
|
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = -1;
|
|
|
|
else if((newx >= (oldx + 32)) && (newx < (oldx + 32 + 4)))
|
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = -1;
|
|
|
|
else if((newx >= (oldx + 64)) && (newx < (oldx + 64 + 4)))
|
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = -1;
|
|
|
|
|
2009-08-21 14:29:59 +00:00
|
|
|
else if((newx >= oldx + 4) && (newx < (oldx + 4 + 8)))
|
2009-07-31 19:01:20 +00:00
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = 1;
|
|
|
|
else if((newx >= oldx + 32 + 4) && (newx < (oldx + 32 + 4 + 8)))
|
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = 1;
|
|
|
|
else if((newx >= oldx + 64 + 4) && (newx < (oldx + 64 + 4 + 8)))
|
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x07:
|
|
|
|
if((newx >= oldx) && (newx < (oldx + 4)))
|
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = -1;
|
|
|
|
|
2009-08-21 14:29:59 +00:00
|
|
|
else if((newx >= oldx + 4) && (newx < (oldx + 4 + 32)))
|
2009-07-31 19:01:20 +00:00
|
|
|
PxPosResetWhen[nusiz][oldx][newx % 160] = 1;
|
|
|
|
break;
|
2009-01-19 16:52:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-02-07 21:50:05 +00:00
|
|
|
// Let's do a sanity check on table entries
|
2009-01-19 16:52:32 +00:00
|
|
|
uInt32 s1 = 0, s2 = 0;
|
|
|
|
for(newx = 0; newx < 160; ++newx)
|
|
|
|
{
|
2009-07-31 19:01:20 +00:00
|
|
|
if(PxPosResetWhen[nusiz][oldx][newx] == -1)
|
2009-01-19 16:52:32 +00:00
|
|
|
++s1;
|
2009-07-31 19:01:20 +00:00
|
|
|
if(PxPosResetWhen[nusiz][oldx][newx] == 1)
|
2009-01-19 16:52:32 +00:00
|
|
|
++s2;
|
|
|
|
}
|
|
|
|
assert((s1 % 4 == 0) && (s2 % 8 == 0));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2009-02-08 21:07:06 +00:00
|
|
|
const Int16 TIATables::PokeDelay[64] = {
|
Added logging capability and viewer. This is useful for those platforms that
don't normally use the commandline (mostly Windows, but in some cases OSX as
well). The 'showinfo' commandline argument has been renamed 'loglevel', but
it has the same purpose. A new option 'logtoconsole' has been added, which
determines whether log output should also be directed to the commandline/
console (previously, it was always printed to the console). All these items
are now accessible from Options -> System Logs.
For anyone reading this (and that cares), now I can finally move on to the
OpenGL rewrite. The plan is that the new code will use OpenGL ES, which
is a subset of OpenGL 1.5. The main advantages are that you won't need
an advanced OpenGL card, and OpenGL ES is supported on most new 'smaller'
systems (iPhone, Android, etc), making ports much easier.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2264 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2011-08-16 13:38:34 +00:00
|
|
|
0, // VSYNC
|
|
|
|
1, // VBLANK (0) / 1
|
|
|
|
0, // WSYNC
|
|
|
|
0, // RSYNC
|
2013-02-21 21:57:42 +00:00
|
|
|
0, // NUSIZ0
|
|
|
|
0, // NUSIZ1
|
Added logging capability and viewer. This is useful for those platforms that
don't normally use the commandline (mostly Windows, but in some cases OSX as
well). The 'showinfo' commandline argument has been renamed 'loglevel', but
it has the same purpose. A new option 'logtoconsole' has been added, which
determines whether log output should also be directed to the commandline/
console (previously, it was always printed to the console). All these items
are now accessible from Options -> System Logs.
For anyone reading this (and that cares), now I can finally move on to the
OpenGL rewrite. The plan is that the new code will use OpenGL ES, which
is a subset of OpenGL 1.5. The main advantages are that you won't need
an advanced OpenGL card, and OpenGL ES is supported on most new 'smaller'
systems (iPhone, Android, etc), making ports much easier.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2264 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2011-08-16 13:38:34 +00:00
|
|
|
0, // COLUP0
|
|
|
|
0, // COLUP1
|
|
|
|
0, // COLUPF
|
|
|
|
0, // COLUBK
|
|
|
|
0, // CTRLPF
|
|
|
|
1, // REFP0
|
|
|
|
1, // REFP1
|
|
|
|
-1, // PF0 (4) / -1
|
|
|
|
-1, // PF1 (4) / -1
|
|
|
|
-1, // PF2 (4) / -1
|
|
|
|
0, // RESP0
|
|
|
|
0, // RESP1
|
|
|
|
8, // RESM0 (0) / 8
|
|
|
|
8, // RESM1 (0) / 8
|
|
|
|
0, // RESBL
|
|
|
|
0, // AUDC0 (-1) / 0
|
|
|
|
0, // AUDC1 (-1) / 0
|
|
|
|
0, // AUDF0 (-1) / 0
|
|
|
|
0, // AUDF1 (-1) / 0
|
|
|
|
0, // AUDV0 (-1) / 0
|
|
|
|
0, // AUDV1 (-1) / 0
|
|
|
|
1, // GRP0
|
|
|
|
1, // GRP1
|
|
|
|
1, // ENAM0
|
|
|
|
1, // ENAM1
|
|
|
|
1, // ENABL
|
|
|
|
0, // HMP0
|
|
|
|
0, // HMP1
|
|
|
|
0, // HMM0
|
|
|
|
0, // HMM1
|
|
|
|
0, // HMBL
|
|
|
|
0, // VDELP0
|
|
|
|
0, // VDELP1
|
|
|
|
0, // VDELBL
|
|
|
|
0, // RESMP0
|
|
|
|
0, // RESMP1
|
|
|
|
3, // HMOVE
|
|
|
|
0, // HMCLR
|
|
|
|
0, // CXCLR
|
|
|
|
// remaining values are undefined TIA write locations
|
2012-07-14 18:56:57 +00:00
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
2009-01-19 16:52:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
const bool TIATables::HMOVEBlankEnableCycles[76] = {
|
|
|
|
true, true, true, true, true, true, true, true, true, true, // 00
|
|
|
|
true, true, true, true, true, true, true, true, true, true, // 10
|
|
|
|
true, false, false, false, false, false, false, false, false, false, // 20
|
|
|
|
false, false, false, false, false, false, false, false, false, false, // 30
|
|
|
|
false, false, false, false, false, false, false, false, false, false, // 40
|
|
|
|
false, false, false, false, false, false, false, false, false, false, // 50
|
|
|
|
false, false, false, false, false, false, false, false, false, false, // 60
|
|
|
|
false, false, false, false, false, true // 70
|
|
|
|
};
|
|
|
|
|
2009-08-21 14:29:59 +00:00
|
|
|
#if 0
|
2009-01-19 16:52:32 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2009-02-08 21:07:06 +00:00
|
|
|
const Int32 TIATables::CompleteMotion[76][16] = {
|
2009-01-19 16:52:32 +00:00
|
|
|
{ 0, -1, -2, -3, -4, -5, -6, -7, 8, 7, 6, 5, 4, 3, 2, 1}, // HBLANK
|
|
|
|
{ 0, -1, -2, -3, -4, -5, -6, -7, 8, 7, 6, 5, 4, 3, 2, 1}, // HBLANK
|
|
|
|
{ 0, -1, -2, -3, -4, -5, -6, -7, 8, 7, 6, 5, 4, 3, 2, 1}, // HBLANK
|
|
|
|
{ 0, -1, -2, -3, -4, -5, -6, -7, 8, 7, 6, 5, 4, 3, 2, 1}, // HBLANK
|
|
|
|
{ 0, -1, -2, -3, -4, -5, -6, -6, 8, 7, 6, 5, 4, 3, 2, 1}, // HBLANK
|
|
|
|
{ 0, -1, -2, -3, -4, -5, -5, -5, 8, 7, 6, 5, 4, 3, 2, 1}, // HBLANK
|
|
|
|
{ 0, -1, -2, -3, -4, -5, -5, -5, 8, 7, 6, 5, 4, 3, 2, 1}, // HBLANK
|
|
|
|
{ 0, -1, -2, -3, -4, -4, -4, -4, 8, 7, 6, 5, 4, 3, 2, 1}, // HBLANK
|
|
|
|
{ 0, -1, -2, -3, -3, -3, -3, -3, 8, 7, 6, 5, 4, 3, 2, 1}, // HBLANK
|
|
|
|
{ 0, -1, -2, -2, -2, -2, -2, -2, 8, 7, 6, 5, 4, 3, 2, 1}, // HBLANK
|
|
|
|
{ 0, -1, -2, -2, -2, -2, -2, -2, 8, 7, 6, 5, 4, 3, 2, 1}, // HBLANK
|
|
|
|
{ 0, -1, -1, -1, -1, -1, -1, -1, 8, 7, 6, 5, 4, 3, 2, 1}, // HBLANK
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 8, 7, 6, 5, 4, 3, 2, 1}, // HBLANK
|
|
|
|
{ 1, 1, 1, 1, 1, 1, 1, 1, 8, 7, 6, 5, 4, 3, 2, 1}, // HBLANK
|
|
|
|
{ 1, 1, 1, 1, 1, 1, 1, 1, 8, 7, 6, 5, 4, 3, 2, 1}, // HBLANK
|
|
|
|
{ 2, 2, 2, 2, 2, 2, 2, 2, 8, 7, 6, 5, 4, 3, 2, 2}, // HBLANK
|
|
|
|
{ 3, 3, 3, 3, 3, 3, 3, 3, 8, 7, 6, 5, 4, 3, 3, 3}, // HBLANK
|
|
|
|
{ 4, 4, 4, 4, 4, 4, 4, 4, 8, 7, 6, 5, 4, 4, 4, 4}, // HBLANK
|
|
|
|
{ 4, 4, 4, 4, 4, 4, 4, 4, 8, 7, 6, 5, 4, 4, 4, 4}, // HBLANK
|
|
|
|
{ 5, 5, 5, 5, 5, 5, 5, 5, 8, 7, 6, 5, 5, 5, 5, 5}, // HBLANK
|
|
|
|
{ 6, 6, 6, 6, 6, 6, 6, 6, 8, 7, 6, 6, 6, 6, 6, 6}, // HBLANK
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, 0, -1, -2, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, -1, -2, -3, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, 0, -1, -2, -3, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, 0, -1, -2, -3, -4, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, 0, -1, -2, -3, -4, -5, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, -1, -2, -3, -4, -5, -6, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, 0, -1, -2, -3, -4, -5, -6, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{ 0, -1, -2, -3, -4, -5, -6, -7, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{-1, -2, -3, -4, -5, -6, -7, -8, 0, 0, 0, 0, 0, 0, 0, 0},
|
|
|
|
{-2, -3, -4, -5, -6, -7, -8, -9, 0, 0, 0, 0, 0, 0, 0, -1},
|
|
|
|
{-2, -3, -4, -5, -6, -7, -8, -9, 0, 0, 0, 0, 0, 0, 0, -1},
|
|
|
|
{-3, -4, -5, -6, -7, -8, -9,-10, 0, 0, 0, 0, 0, 0, -1, -2},
|
|
|
|
{-4, -5, -6, -7, -8, -9,-10,-11, 0, 0, 0, 0, 0, -1, -2, -3},
|
|
|
|
{-5, -6, -7, -8, -9,-10,-11,-12, 0, 0, 0, 0, -1, -2, -3, -4},
|
|
|
|
{-5, -6, -7, -8, -9,-10,-11,-12, 0, 0, 0, 0, -1, -2, -3, -4},
|
|
|
|
{-6, -7, -8, -9,-10,-11,-12,-13, 0, 0, 0, -1, -2, -3, -4, -5},
|
|
|
|
{-7, -8, -9,-10,-11,-12,-13,-14, 0, 0, -1, -2, -3, -4, -5, -6},
|
|
|
|
{-8, -9,-10,-11,-12,-13,-14,-15, 0, -1, -2, -3, -4, -5, -6, -7},
|
|
|
|
{-8, -9,-10,-11,-12,-13,-14,-15, 0, -1, -2, -3, -4, -5, -6, -7},
|
|
|
|
{ 0, -1, -2, -3, -4, -5, -6, -7, 8, 7, 6, 5, 4, 3, 2, 1} // HBLANK
|
|
|
|
};
|
2009-08-21 14:29:59 +00:00
|
|
|
#endif
|
2009-01-19 16:52:32 +00:00
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
uInt8 TIATables::PxMask[2][8][320];
|
2009-01-19 16:52:32 +00:00
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
uInt8 TIATables::MxMask[8][5][320];
|
2009-01-19 16:52:32 +00:00
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
uInt8 TIATables::BLMask[4][320];
|
2009-01-19 16:52:32 +00:00
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2009-02-08 21:07:06 +00:00
|
|
|
uInt32 TIATables::PFMask[2][160];
|
Some work on the TIA class (I don't know how long the current code
will be used, but at least we can improve it a little).
Eliminated the 'alignment' dimension in the various TIATables masks,
reducing the size of the arrays by a factor of 4. I could never
figure out what alignment meant, until I looked at old TIA code in
the repo. It seems that originally, there was an optimization
in the code to fill the array on 32-bit boundaries, instead of the
current 8-bit boundary. As a result, the masks had to be defined
as 32-bits, or 4 groups of 8-bits. Ah, that's where the 'alignment'
comes from.
Related to this, the colors and pointers in the TIA class are now
8-bit as well. Essentially, the TIA class has been doing extra
work to align everything to 32-bit and never actually using the
results. And it's been this way for 4+ years.
Older state files will no longer work, so the version # has been
bumped.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2765 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-07-10 15:40:11 +00:00
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
uInt8 TIATables::GRPReflect[256];
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
uInt16 TIATables::CollisionMask[64];
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
uInt8 TIATables::DisabledMask[640];
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
Int8 TIATables::PxPosResetWhen[8][160][160];
|