| 1 | //============================================================================ |
|---|---|
| 2 | // |
| 3 | // SSSS tt lll lll |
| 4 | // SS SS tt ll ll |
| 5 | // SS tttttt eeee ll ll aaaa |
| 6 | // SSSS tt ee ee ll ll aa |
| 7 | // SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" |
| 8 | // SS SS tt ee ll ll aa aa |
| 9 | // SSSS ttt eeeee llll llll aaaaa |
| 10 | // |
| 11 | // Copyright (c) 1995-2019 by Bradford W. Mott, Stephen Anthony |
| 12 | // and the Stella Team |
| 13 | // |
| 14 | // See the file "License.txt" for information on usage and redistribution of |
| 15 | // this file, and for a DISCLAIMER OF ALL WARRANTIES. |
| 16 | //============================================================================ |
| 17 | |
| 18 | #include "DrawCounterDecodes.hxx" |
| 19 | |
| 20 | // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| 21 | const uInt8* const* DrawCounterDecodes::playerDecodes() const |
| 22 | { |
| 23 | return myPlayerDecodes; |
| 24 | } |
| 25 | |
| 26 | // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| 27 | const uInt8* const* DrawCounterDecodes::missileDecodes() const |
| 28 | { |
| 29 | return myMissileDecodes; |
| 30 | } |
| 31 | |
| 32 | // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| 33 | DrawCounterDecodes& DrawCounterDecodes::DrawCounterDecodes::get() |
| 34 | { |
| 35 | return myInstance; |
| 36 | } |
| 37 | |
| 38 | // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| 39 | DrawCounterDecodes::DrawCounterDecodes() |
| 40 | { |
| 41 | uInt8 *decodeTables[] = {myDecodes0, myDecodes1, myDecodes2, myDecodes3, myDecodes4, myDecodes6}; |
| 42 | |
| 43 | for (uInt8 *decodes : decodeTables) |
| 44 | { |
| 45 | memset(decodes, 0, 160); |
| 46 | decodes[156] = 1; |
| 47 | } |
| 48 | |
| 49 | myDecodes1[12] = 1; |
| 50 | myDecodes2[28] = 1; |
| 51 | myDecodes3[12] = myDecodes3[28] = 1; |
| 52 | myDecodes4[60] = 1; |
| 53 | myDecodes6[28] = myDecodes6[60] = 1; |
| 54 | |
| 55 | myPlayerDecodes[0] = myDecodes0; |
| 56 | myPlayerDecodes[1] = myDecodes1; |
| 57 | myPlayerDecodes[2] = myDecodes2; |
| 58 | myPlayerDecodes[3] = myDecodes3; |
| 59 | myPlayerDecodes[4] = myDecodes4; |
| 60 | myPlayerDecodes[5] = myDecodes0; |
| 61 | myPlayerDecodes[6] = myDecodes6; |
| 62 | myPlayerDecodes[7] = myDecodes0; |
| 63 | |
| 64 | myMissileDecodes[0] = myDecodes0; |
| 65 | myMissileDecodes[1] = myDecodes1; |
| 66 | myMissileDecodes[2] = myDecodes2; |
| 67 | myMissileDecodes[3] = myDecodes3; |
| 68 | myMissileDecodes[4] = myDecodes4; |
| 69 | myMissileDecodes[5] = myDecodes0; |
| 70 | myMissileDecodes[6] = myDecodes6; |
| 71 | myMissileDecodes[7] = myDecodes0; |
| 72 | } |
| 73 | |
| 74 | // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| 75 | DrawCounterDecodes DrawCounterDecodes::myInstance; |
| 76 |