1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-07-04 16:30:01 +00:00

Tweak Atari 2600 visualizer

Changed "row duplication" to a straight "row thickness".  Feels more
intuitive.
This commit is contained in:
Andy McFadden 2019-12-06 17:54:18 -08:00
parent 5635a1e33a
commit 3c541089a7
3 changed files with 14 additions and 15 deletions

View File

@ -36,7 +36,7 @@ namespace RuntimeData.Atari {
private const string P_OFFSET = "offset";
private const string P_HEIGHT = "height";
private const string P_ROW_DUP = "rowDup";
private const string P_ROW_THICKNESS = "rowThickness";
private const string P_REFLECTED = "reflected";
private const int MAX_HEIGHT = 192;
@ -57,8 +57,8 @@ namespace RuntimeData.Atari {
P_OFFSET, typeof(int), 0, 0x00ffffff, VisParamDescr.SpecialMode.Offset, 0),
new VisParamDescr("Height",
P_HEIGHT, typeof(int), 1, 192, 0, 1),
new VisParamDescr("Row duplication",
P_ROW_DUP, typeof(int), 0, 10, 0, 3),
new VisParamDescr("Row thickness",
P_ROW_THICKNESS, typeof(int), 1, 20, 0, 4),
new VisParamDescr("Reflected",
P_REFLECTED, typeof(bool), 0, 0, 0, false),
}),
@ -143,11 +143,12 @@ namespace RuntimeData.Atari {
int offset = Util.GetFromObjDict(parms, P_OFFSET, 0);
int height = Util.GetFromObjDict(parms, P_HEIGHT, 1);
int rowDup = Util.GetFromObjDict(parms, P_ROW_DUP, 3);
int rowThick = Util.GetFromObjDict(parms, P_ROW_THICKNESS, 4);
bool isReflected = Util.GetFromObjDict(parms, P_REFLECTED, false);
if (offset < 0 || offset >= mFileData.Length ||
height <= 0 || height > MAX_HEIGHT) {
height <= 0 || height > MAX_HEIGHT ||
rowThick <= 0 || rowThick > MAX_HEIGHT) {
// the UI should flag these based on range (and ideally wouldn't have called us)
mAppRef.ReportError("Invalid parameter");
return null;
@ -160,10 +161,8 @@ namespace RuntimeData.Atari {
return null;
}
int rowHeight = rowDup + 1;
// Each half of the playfield is 20 bits wide.
VisBitmap8 vb = new VisBitmap8(40, height * rowHeight);
VisBitmap8 vb = new VisBitmap8(40, height * rowThick);
SetPalette(vb);
for (int row = 0; row < height; row++) {
@ -177,10 +176,10 @@ namespace RuntimeData.Atari {
int fwd = RevBits(rev, 20);
// Render the first part of the line forward.
RenderHalfField(vb, row * rowHeight, rowHeight, 0,
RenderHalfField(vb, row * rowThick, rowThick, 0,
fwd, Color.White);
// Render the second half forward or reversed, in grey.
RenderHalfField(vb, row * rowHeight, rowHeight, HALF_WIDTH,
RenderHalfField(vb, row * rowThick, rowThick, HALF_WIDTH,
isReflected ? rev : fwd, Color.Grey);
}
return vb;

View File

@ -152,8 +152,8 @@ generator works for data stored in a straightforward fashion.</p>
multiple entries following each other. Specify the number of
3-byte entries as the height.
Since most playfields aren't the full height of the screen,
it will tend to look squashed. Use the "row duplication" feature
to repeat each row N times to make it look more like it should.</li>
it will tend to look squashed. Use the "row thickness" feature
to repeat each row N times to adjust the proportions.</li>
</ul>
</div>

View File

@ -60,12 +60,12 @@
"68":{
"Items":[{
"Tag":"Black Maze 3","VisGenIdent":"atari2600-playfield","VisGenParams":{
"offset":68,"height":7,"rowDup":3,"reflected":false}}]},
"offset":68,"height":7,"rowThickness":4,"reflected":false}}]},
"89":{
"Items":[{
"Tag":"Red Maze (bottom)","VisGenIdent":"atari2600-playfield","VisGenParams":{
"offset":89,"height":7,"rowDup":3,"reflected":true}}]},
"offset":89,"height":7,"rowThickness":4,"reflected":true}}]},
"110":{
"Items":[{
"Tag":"Castle Def","VisGenIdent":"atari2600-playfield","VisGenParams":{
"offset":110,"height":7,"rowDup":3,"reflected":true}}]}}}
"offset":110,"height":7,"rowThickness":4,"reflected":true}}]}}}