1
0
mirror of https://github.com/lefticus/6502-cpp.git synced 2024-12-21 10:30:35 +00:00

Move the sprite declarations to the main() function.

This change does not affect the generated code, other than the
assembler labels for the data. The data will still be initialized
at compilation time.
This commit is contained in:
Marko Mäkelä 2016-10-09 21:05:01 +03:00
parent ee36c4c08f
commit 617e11244e

View File

@ -290,6 +290,29 @@ namespace {
}
int main()
{
const std::array<Color, 16> colors = {{
Color{0, 0x00, 0x00, 0x00},
Color{1, 0xFF, 0xFF, 0xFF},
Color{2, 0x88, 0x39, 0x32},
Color{3, 0x67, 0xB6, 0xBD},
Color{4, 0x8B, 0x3F, 0x96},
Color{5, 0x55, 0xA0, 0x49},
Color{6, 0x40, 0x31, 0x8D},
Color{7, 0xBF, 0xCE, 0x72},
Color{8, 0x8B, 0x54, 0x29},
Color{9, 0x57, 0x42, 0x00},
Color{10, 0xB8, 0x69, 0x62},
Color{11, 0x50, 0x50, 0x50},
Color{12, 0x78, 0x78, 0x78},
Color{13, 0x94, 0xE0, 0x89},
Color{14, 0x78, 0x69, 0xC4},
Color{15, 0x9F, 0x9F, 0x9F}
}};
VIC_II vic;
/// The ball image.
static const VIC_II::HighResSprite sBall
{{
@ -317,8 +340,7 @@ static const VIC_II::HighResSprite sBall
}};
/// The bat image.
static const VIC_II::MultiColorSprite sBat
{{
static const VIC_II::MultiColorSprite sBat = {{
0x000002200000,
0x000002200000,
0x000002200000,
@ -342,29 +364,6 @@ static const VIC_II::MultiColorSprite sBat
0x000003300000
}};
int main()
{
const std::array<Color, 16> colors = {{
Color{0, 0x00, 0x00, 0x00},
Color{1, 0xFF, 0xFF, 0xFF},
Color{2, 0x88, 0x39, 0x32},
Color{3, 0x67, 0xB6, 0xBD},
Color{4, 0x8B, 0x3F, 0x96},
Color{5, 0x55, 0xA0, 0x49},
Color{6, 0x40, 0x31, 0x8D},
Color{7, 0xBF, 0xCE, 0x72},
Color{8, 0x8B, 0x54, 0x29},
Color{9, 0x57, 0x42, 0x00},
Color{10, 0xB8, 0x69, 0x62},
Color{11, 0x50, 0x50, 0x50},
Color{12, 0x78, 0x78, 0x78},
Color{13, 0x94, 0xE0, 0x89},
Color{14, 0x78, 0x69, 0xC4},
Color{15, 0x9F, 0x9F, 0x9F}
}};
VIC_II vic;
vic.enable_sprite(0, sBall, true, false, false);
vic.enable_sprite(1, sBat, false, false, true);
vic.enable_sprite(2, sBat, false, false, true);