|
What some people/companies don't get is that (metaphorically) it takes a suitable temperature, time and care to cook an egg properly for delivery to the consumer.
There is no arguing with this law of nature.
Ignore it at your own peril.
It will bite your behind without hesitation or remorse.
Cheers,
Mike Fidler
"I intend to live forever - so far, so good." Steven Wright
"I almost had a psychic girlfriend but she left me before we met." Also Steven Wright
"I'm addicted to placebos. I could quit, but it wouldn't matter." Steven Wright yet again.
|
|
|
|
|
Not long ago we had a question here, what interview questions concerning hexadecimal notation and logical operators have to do with 'real world programs'.
I must admit, I was a little shocked. In my 'real world' that's something so basic, it's not worth mentioning. It was, in fact, the first thing I ever did on a computer and last weekend I started to write some assembly code for my old computer.
It's going to be a game, a remake of a badly programmed game that fell into my hands 35 years ago. Not only did it use preposterous 8k memory, it also made no good use of the already spartan graphics.
Here are two of my main antagonists as bit patterns. Each pattern is 16 bits wide and each bit encodes a pixel directly. These pixels are twice as wide as they are high and (obviously) monochrome.
Can you take the hexadecimal patterns, draw them on a piece of paper and (hopefully) tell me what they are supposed to represent?
First pattern:
01 00
07 C0
1B B0 < Edit: Inserted those two bytes as improvement!
1A B0
39 38
40 04
80 02
80 02
80 02
Second pattern:
84 02 81 02
83 82
4F E4
3E F8
07 C0
I made the patterns without writing them down, so please tell me any errors or improvements you can find. And the logical operations will be needed to place them into the video buffer at any place I want to show them.
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
modified 6-Dec-16 7:04am.
|
|
|
|
|
.......*........
.....*****......
...**.*.*.**....
..***..*..***...
.*...........*..
*.............*.
*.............*.
*.............*.
*....*........*.
*.....***.....*.
.*..*******..*..
..*****.*****...
.....*****......
Um.
No, no idea.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
That was quick. I see one error in the first byte of the second pattern. It should be 81, not 82 84. My fault.
They are not easy to recognize this way. On graph paper with each pixel two boxes wide and one box high they should be better.
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
|
|
|
|
|
I wrote a quick program to do it:
**
**********
**** ** ** ****
****** ** ******
** **
** **
** **
** **
** ** **
** ****** **
** ************** **
********** **********
**********
Space invaders? Arms down for the first, arms up for the second?
Console.WriteLine(ToBits(0x01, 0x00));
Console.WriteLine(ToBits(0x07, 0xC0));
Console.WriteLine(ToBits(0x1A, 0xB0));
Console.WriteLine(ToBits(0x39, 0x38));
Console.WriteLine(ToBits(0x40, 0x04));
Console.WriteLine(ToBits(0x80, 0x02));
Console.WriteLine(ToBits(0x80, 0x02));
Console.WriteLine(ToBits(0x80, 0x02));
Console.WriteLine();
Console.WriteLine(ToBits(0x81, 0x02));
Console.WriteLine(ToBits(0x83, 0x82));
Console.WriteLine(ToBits(0x4F, 0xE4));
Console.WriteLine(ToBits(0x3E, 0xF8));
Console.WriteLine(ToBits(0x07, 0xC0));
}
private string ToBits(int a, int b)
{
StringBuilder sb = new StringBuilder(32);
GetBits(sb, a);
GetBits(sb, b);
return sb.ToString();
}
private void GetBits(StringBuilder sb, int a)
{
for (int i = 0; i < 8; i++)
{
sb.Append((a & 0x80) == 0 ? " " : "**");
a <<= 1;
}
}
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Invaders, yes, but not that kind. The aspect ratio of the pixels is really important.
This[^] is what #1 is supposed to be, and this is for #2[^].
Any perspective other than the frontal view would make them even less recognizable. Would it help to double the width to 32 pixels?
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
|
|
|
|
|
Now I know what I'm looking at, the Klingon is recognisable. The Bird Of Prey? Not so much.
I take it you're talking monochrome sprites here?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
OriginalGriff wrote: I take it you're talking monochrome sprites here? Yes, monochrome and an aspect ratio of 2 for the pixels.
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
|
|
|
|
|
Then I think you've got the Klingon about as close as you can.Pulling the "leg ends" inwards as they are on the original distorts them too much, I think:
**
**********
**** ** ** ****
****** ** ******
** **
** **
** **
** **
The TOS Romulan is so nondescript in front or rear elevation that there isn't much you can do at all at the kind of resolution you're talking - you need a side view to get the underside decoration visible before it's obviously Romulan. So what you have may work - given that it'll be distinctly different from the other sprites if not distinctly visible. The NG ships had a much more distinctive look D'deridex Class[^] (which worked well in the BotF game).
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
BotF. I liked blowing away a Borg cube without any losses. All you needed was to have at least six warbirds ready when the Borg came.
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
|
|
|
|
|
Runs like a stunned slug on Mogadon on Win10 - you have to load a Win 7 VM to actually play it.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I'm already grimly determined to stay on Win 7 as long as possible and this is just one more reason to stay.
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
|
|
|
|
|
Some members will goto any lengths to get their homework questions answered.
___ _ _ _ _ __
| \ ___ _ _ ___ _ _ _ _ ___ __ __ __ _ _ | |_ ___ _ __ ___ __ __ __ ___ _ _ | |__| | (_)___\ \
| |) |/ _ \ | || |/ _ \| || || '_| / _ \\ V V /| ' \ | ' \ / _ \| ' \ / -_)\ V V
|___/ \___/ \_, |\___/ \_,_||_| \___/ \_/\_/ |_||_| |_||_|\___/|_|_|_|\___| \_/\_/ \___/|_| |_\_\(_) (_) | |
|__/ /_/
|
|
|
|
|
Oh pleeez! It's urgents! Thankfully remove my doubts how to encode bit patterns and how to draw them in video buffer!
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
|
|
|
|
|
XX
XXXXXXXXXX
XXXX XX XX XXXX
XXXXXX XX XXXXXX
XX XX
XX XX
XX XX
XX XX
XX XX XX
XX XXXXXX XX
XX XXXXXXXXXXXXXX XX
XXXXXXXXXX XXXXXXXXXX
XXXXXXXXXX
No idea, some kind of nut?
|
|
|
|
|
Thanks, it gets even harder when you 'glue' them together.
This[^] is what #1 is supposed to be, and this is for #2[^].
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
|
|
|
|
|
Appears to be Kim Kardashian trying on new pantyhose...
Will Rogers never met me.
|
|
|
|
|
Why not knock up a quick utility - display a grid of cells the right size, click to set/unset the cells then a Go button to generate the Hex strings?
|
|
|
|
|
That would be no problem, but a piece of graph paper and a pencil also work fine.
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
|
|
|
|
|
Except to zoom out the graph paper you have to move across the room...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Not really. The the graphics chip displayed a constant horizontal resolution of 64 pixels (8 bytes) and 128 lines.
AT 64 x 128 the pixels are about four times wider than high and the video buffer took 1k. I think I have only one program that actually used this mode.
Fortunately you couls just repeat the same line twice, reducing the resolution to 64 x 64 and the video buffer to 1/2k. That also reduced the aspect ratio of the pixels to 2, which was far more usable.
The mostly used resolution of 64 x 32 was reached by repeating each line four times. The pixels were square, but huge. The video buffer was only 1/4k. This[^] was the test program I entered with the hex keyboard right after soldering together my computer. The image comes from an emulator, of course. The basic computer had only 1/4k memory, so the 'garbage' at the top is the program and the stack.
Anyway, drawing entire screens on graph paper was not really hard.
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
|
|
|
|
|
That one I recognise!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
You just gave me an idea. Why not steal the image from the old test program and use it in the title screen of the game?
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
|
|
|
|
|
Stewart Judson wrote: Hex strings?
Again with the Harry Potter?
Never knew he took on the klingons though... tribblesortia
Sin tack ear lol
Pressing the "Any" key may be continuate
|
|
|
|
|
|