Add files via upload

This commit is contained in:
TimothyLottes
2016-11-10 21:48:17 -05:00
committed by GitHub
parent 726ced4e6c
commit 78058fbdab
4 changed files with 186 additions and 0 deletions
+65
View File
@@ -0,0 +1,65 @@
<html><head><link rel="stylesheet" href="style.css"></head><body><div class="page">
<h1>20140816 - Vintage Programming</h1>
<br>
A photo (not a screenshot) of one of my home vintage development environments running on modern fast PCs. Shot shows colored syntax highlighted source to the compiler of the language I use most often (specifically the part which generates the ELF header for Linux). More on this below.<br>
<br>
<center><img src="20140816-A.png"></center>
<br>
This is running 640x480 on a small mid 90's VGA CRT which supports around 1000 lines. So no garbage double scan and no horrible squares for pixels. Instead a high quality analog display running at 85 Hz. The font is my 6x11 fixed size programming font.<br>
<br>
<center><img src="20140816-B.png"></center>
<br>
This specific compiler binary on x86-64 Linux is under 1700 bytes.<br>
<br>
<b>A Language</b>
<br>
The language is ultra primitive, it does not include a linker, or anything to do code generation, there is no debugger (and it frankly is not needed as debuggers are slower than instant run-time recompile/reload style development). Instead the ELF (or platform) header for the binary, and the assembler or secondary language which actually describes the program, is written in the language itself.<br>
<br>
Over the years I've been playing with either languages which are in classic text form, and languages which require custom editors and are in a binary form. This A language is the classic text source form. All the variations of languages I've been interested in are heavily influenced by <a href="http://www.colorforth.com/">Color Forth</a>.<br>
<br>
This A compiler works in 2 passes, the first both parses and translates the source into x86-64 machine code. Think of this as factoring out the interpreter into the parser. The second pass simply calls the entry point of the source code to interpret the source (by running the existing generated machine code). After that whatever is written in the output buffer gets saved to a file.<br>
<br>
Below is the syntax for the A language. A symbol is an untyped 64-bit value in memory. Like Forth there is a separate data and return stack.<br>
<br>
<tt>
\comment\<br>
012345- \compile: push -0x12345 on the data stack\<br>
,c3 \write a literal byte into the compile stream\<br>
symbol \compile: call to symbol, symbol value is a pointer to function\<br>
'symbol \compile: pop top of data stack, if value is true, call symbol\<br>
`symbol \copy the symbol data into the compile stream, symbol is {32-bit pointer, 32-bit size}\<br>
:symbol \compile: pop data stack into symbol value\<br>
.symbol \compile: push symbol value onto data stack\<br>
%symbol \compile: push address of symbol value onto data stack\<br>
"string" \compile: push address of string, then push size of string on the data stack\<br>
{ symbol ... } \define a function, symbol value set to head of compile stream\</tt><br>
<br>
And that is the A language. The closing "}" writes out the 32-bit size to the packed {32-bit pointer, 32-bit size} symbol value, and also adds an extra RET opcode to avoid needing to add one at the end of every define. There is one other convention missing in the above description, there is a hidden register used for the pointer to the output buffer.<br>
<br>
<b>Writing Parts of the Language in the Language</b>
<br>
The first part of any source file is a collection of opcodes, like the <i>{ xor ,48 ... }</i> at the top of the image which is the raw x86-64 machine code to do the following in traditional assembly language (rax = top of data stack, rbx points to second data stack entry),<br>
<br>
<tt>
XOR rax, [rbx]<br>
SUB rbx, 8</tt><br>
<br>
These collection of opcodes generate symbols which form the stack based language the interpreter uses. They would get used like <i>`xor</i> in the code (the copy symbol to compile stream syntax). For instance <i>`long</i> pops the top of the data stack and writes out 8-bytes to the output buffer, and <i>`asm</i> pushes the output buffer pointer onto the data stack.<br>
<br>
I use this stack based language to then define an assembler (in the source code), and then I write code in the assembler using the stack based language as effectively the ultimate macro language. For instance if I was to describe the <i>`xor</i> command in the assembly it would look like follows,<br>
<br>
<tt>
{ xor .top .stk$ 0 X@^ .stk$ 8 #- }</tt><br>
<br>
Which is really hard to read without syntax coloring (sorry my HTML is lazy). For naming, the "X" = 64-bit extended, the "@" = load, and the "#" = immediate. So the "X@^" means assemble "XOR reg,[mem+imm]". The symbols "top" and "stk$" contain the numbers of the registers for the top of the stack and the pointer to the second item on the stack respectively.<br>
<br>
<b>Compiler Parser</b>
<br>
The compiler parsing pass is quite easy, just a character jump table based on prefix character to a function which parses the {symbol, number, comment, white space, etc}. These functions don't return, they simply jump to the next thing to parse. As symbol strings are read they are hashed into a register and bit packed into two extra 64-bit registers (lower 4-bits/character in one register, upper 3-bits/character in another register). This packing makes string compare easy later when probing. Max symbol string is 16 characters. Hash table is a simple linear probing style, but with an array 2 of entries per hash value filling one cacheline. Each hash table entry has the following 8-byte values {lower bits of string, upper bits of string, pointer to symbol storage, unused}. The symbol storage is allocated from another stack (which only grows). Upon lookup, if a symbol isn't in the hash table it is added with new storage. Symbols never get deleted.<br>
</div></body></html>
+40
View File
@@ -0,0 +1,40 @@
<html><head><link rel="stylesheet" href="style.css"></head><body><div class="page">
<h1>20150220 - The Order 1886!</h1>
<br>
<i>This review contains no spoilers...</i>
<br>
<br>
The Order 1886 is a fantastic game, one of my personal favorite games of all time.
<br>
<br>
Initially I was caught off guard by the doubt cast by various critics out to smear the game. They ended up doing me a favor, in that I now have a great list of online publications which I know to avoid spending any future time reading.
<br>
<br>
My quest started with a pre-order roughly 16 hours prior to launch. Followed by a playthrough on easy, beginning in early morning then wrapping a regular working Friday.
<br>
<br>
<b>Why Easy? And a Word on "Replay Value"</b>
<br>
When I want a gaming challenge, aka something on "hard", and something with "replay value", I take on the best humans I can find in competitive multiplayer: often in Call of Duty or Killzone. It is the people who bring you back, not specifically the game. The Order 1886 serves a different purpose in my eye, to provide a self-contained story experience which can be consumed, enjoyed, and remembered, and in this regard The Order 1886 excels. There is no expectation or need for replay value in this kind of game, just like there is no need for shoes to double as a toaster oven.
<br>
<br>
<b>Quality Over Quantity</b>
<br>
The game had the right length for me: not too long paired with high production value. To experience the ultimate in a given art form, to be immersed in attention to detail so fine that the mind is transplanted into the scene: this is where The Order takes you. The Order is a ride, part film, part cover shooter, with time inbetween to get absorbed in the style, sound, material and environment of years past. Gunplay feels refined, with fantastic audio/visual feedback expressed in the technology of the era. The focus on quality pixels brings The Order to a place no other game has yet to venture visually.
<br>
<br>
<b>Thanks</b>
<br>
Too all those at Ready At Dawn, your hard work is much appreciated. Look forward to whatever you have in store next!
<br>
</div></body></html>
+56
View File
@@ -0,0 +1,56 @@
<html><head><link rel="stylesheet" href="style.css"></head><body><div class="page">
<h1>20160126 - Local/Global Dimming, Blooming, Contrast Ratios - CRT/LCD/Plasma/OLED</h1>
<br>
<b>Global Dimming</b>
<br>
OLED HDTVs drop to about 33% of peak brightness on a full white screen.
My Samsung Plasma HDTV has similar issues.
The random made-in-1996 CRT I just profiled at home drops to about 60% of peak brightness on a full white screen.
Global dimming has been around for a long time.
<br>
<br>
<b>LCD Local Dimming vs CRT Blooming</b>
<br>
LCD TVs often have LED back-lights split into zones (on the order of dozens for poor quality and low hundreds for better quality),
with individual control of the brightness per zone.
This zone brightness control simultaneously moves up or down the {black level, peak brightness} as a joined pair.
A single-pixel thickness peak brightness line on a black background
forces black level high in a blooming pattern of where the line intersects zones.
For this reason I always turn off local dimming if it is an option on a LCD TV display.
ANSI contrasts can still reach 4000:1 with the best LCD panels without any local dimming.
<br>
<br>
CRTs in contrast have local blooming (talking about the large diffuse effect, not the shadow-mask-scale effect).
Lets look at some measured numbers from my Sony Wega CRT TV,
with ANSI contrast being the standard 4x4 rectangle checkerboard pattern of black and white boxes.
<br>
<br>
<ul>
<li>317 nits on a small white box on a black screen.</li>
<li>302 nits on a ANSI contrast white test rectangle (50% APL).</li>
<li>1.91 nits on a ANSI contrast black test rectangle.</li>
<li>0.12 nits on the bottom of a black background with a large white bar up top.</li>
<li>0.01 nits on a black background with only a mouse on screen.</li>
</ul>
<br>
ANSI contrast ratio for this Wega is a poor 158:1 (my random 1996 CRT gets 265:1 in comparison).
And if one stops here and compares to the great LCD, the LCD has over 4 extra stops of dynamic range?
But this isn't the full story.
For the Wega as Average Picture Level (APL) drops from 50% with ANSI contrast test,
to something more natural to look at, contrast ratio improves.
Seeing 2500:1 for black with the large white bar case,
and then almost up to 32000:1 measuring a black screen with only a white mouse away from the sensor.
And all these tests done in a room at night lit by a few bright lamps.
<br>
<br>
The CRT does not suffer from the LCD local dimming problem,
a single pixel line won't cause blooming as it does not add enough energy (APL stays low).
The CRTs blooming looks totally natural in comparison.
</div></body></html>
+25
View File
@@ -34,6 +34,7 @@ O OOO ||..||OO||||||||||OOo || ||||||||||||| ||||OO|| |o| ||||||||OO||OOO
<a href="20161103.html">20161103 - Game List</a><br>
<a href="20161102.html">20161102 - Frequent Web Travels</a><br>
<a href="20161101.html">20161101 - Linear Dithering Before Transfer Function</a><br>
<br>
<a href="20161031.html">20161031 - FPGA Links</a><br>
<a href="20161030.html">20161030 - Demo Tube Mega List</a><br>
<a href="20161029.html">20161029 - Program Per Clock</a><br>
@@ -57,12 +58,15 @@ Below this is active random migration (373 prior posts still to filter through)
<a href="20161004.html">20161004 - T4K Try 3</a><br>
<a href="20161003.html">20161003 - T4K Try 2</a><br>
<a href="20161001.html">20161001 - T4K Try 1</a><br>
<br>
<a href="20160921.html">20160921 - Parallel Noise Generation</a><br>
<a href="20160912.html">20160912 - The Great MacOS 9</a><br>
<a href="20160909.html">20160909 - Thinking "Clearly" About 4K</a><br>
<a href="20160908.html">20160908 - Transistor Count Thoughts</a><br>
<a href="20160905.html">20160905 - GPU Parking Lot</a><br>
<br>
<a href="20160806.html">20160806 - Uber Shader Unrolling</a><br>
<br>
<a href="20160731.html">20160731 - Vulkan From Scratch Part 2</a><br>
<a href="20160728.html">20160728 - Blink Mechanic for Fast View Switch for VR</a><br>
<a href="20160727.html">20160727 - Vulkan - How to Deal With the Layouts of Presentable Images</a><br>
@@ -75,7 +79,9 @@ Below this is active random migration (373 prior posts still to filter through)
<a href="20160706.html">20160706 - Low Cost Branching to Factoring Out Loop Exit Check</a><br>
<a href="20160705.html">20160705 - CPU Threading to Hide Pipelining</a><br>
<a href="20160704.html">20160704 - Relative Addressing With XOR - Removing an Adder</a><br>
<br>
<a href="20160127.html">20160127 - Temporal AA Neighborhood Clamp</a><br>
<a href="20160126.html">20160126 - Local/Global Dimming, Blooming, Contrast Ratios - CRT/LCD/Plasma/OLED</a><br>
<br>
<b>2015</b><br>
<a href="20151222.html">20151222 - Random Holiday 2015</a><br>
@@ -133,35 +139,49 @@ Below this is active random migration (373 prior posts still to filter through)
<a href="20150308.html">20150308 - CRTs</a><br>
<br>
<a href="20150221.html">20150221 - Great Example of Horrible API Interface Design</a><br>
<a href="20150220.html">20150220 - The Order 1886!</a><br>
<br>
<a href="20150111.html">20150111 - Leaving Something for the Imagination</a><br>
<br>
<b>2014</b><br>
<a href="20140926.html">20140926 - Post Depth Coverage</a><br>
<br>
<a href="20140826.html">20140826 - Scifi Reading Suggestion List From Twitters</a><br>
<a href="20140823.html">20140823 - MinWM</a><br>
<a href="20140819.html">20140819 - Scanlines</a><br>
<a href="20140816.html">20140816 - Vintage Programming</a><br>
<br>
<a href="20140723.html">20140723 - Body Hacking Running on Oil</a><br>
<a href="20140715.html">20140715 - Infinte Projection Matrix Notes</a><br>
<br>
<a href="20140506.html">20140506 - The Other Project</a><br>
<br>
<a href="20140328.html">20140328 - Related to Filtering for VR</a><br>
<br>
<a href="20140110.html">20140110 - Portable Read-Only Thumb Linux</a><br>
<br>
<b>2013</b><br>
<a href="20131126.html">20131126 - Random Next Generation Notes</a><br>
<br>
<a href="20130825.html">20130825 - Modern Memory Mapping</a><br>
<a href="20130808.html">20130808 - Runtime Recompile Reloaded</a><br>
<br>
<a href="20130707.html">20130707 - Slab Hash</a><br>
<br>
<a href="20130325.html">20130325 - Understanding WIN32 GetRawInputBuffer()</a><br>
<br>
<b>2012</b><br>
<a href="20121203.html">20121203 - Simple Custom Web Server Tricks</a><br>
<br>
<a href="20121001.html">20121001 - Linux Distros and Compression</a><br>
<br>
<a href="20120903.html">20120903 - Linux Threading Via Syscalls</a><br>
<br>
<a href="20120513.html">20120513 - Frame Stutter Reduction Via Time Smoothing</a><br>
<br>
<b>2011</b><br>
<a href="20111031.html">20111031 - Exclusive Core Access</a><br>
<br>
<a href="20110907.html">20110907 - Parallel Programming With Clones</a><br>
<br>
<b>2010</b><br>
@@ -169,18 +189,22 @@ Below this is active random migration (373 prior posts still to filter through)
<br>
<b>2009</b><br>
<a href="20090605.html">20090605 - SIMD Binning And Caches</a><br>
<br>
<a href="20090519.html">20090519 - GPU REYES</a><br>
<a href="20090513.html">20090513 - Gaussian KD Trees</a><br>
<a href="20090506.html">20090506 - Electromagnetic Spectrum and Rendering</a><br>
<a href="20090505.html">20090505 - Compute Mega Post</a><br>
<a href="20090501.html">20090501 - 32bpp HDR Blending Idea</a><br>
<br>
<a href="20090422.html">20090422 - WFA Image Compression</a><br>
<a href="20090407.html">20090407 - DXT Tip</a><br>
<br>
<a href="20090318.html">20090318 - Reattachable Code</a><br>
<br>
<b>2007</b><br>
<a href="20070910.html">20070910 - 2 4th | !2 4th</a><br>
<br>
<a href="20070822.html">20070822 - New Pipeline Progress</a><br>
<a href="20070819.html">20070819 - High Dynamic Range</a><br>
<a href="20070818.html">20070818 - Deferred Fractal Environment Shading</a><br>
@@ -188,6 +212,7 @@ Below this is active random migration (373 prior posts still to filter through)
<a href="20070816.html">20070816 - CFD Videos</a><br>
<a href="20070810.html">20070810 - Graphics Engine Lighting</a><br>
<a href="20070809.html">20070809 - Graphics Engine Videos</a><br>
<br>
<a href="20070731.html">20070731 - High Resolution Screen Shots</a><br>
<a href="20070730.html">20070730 - Computational Fluid Dynamics Code</a><br>
<a href="20070715.html">20070715 - Self Healing</a><br>