Set NPOT textures with CLAMP_TO_EDGE so they are WebGL friendly.
Switch from RED to LUMINANCE textures.
Port shaders to GLESSL
* version 100 instead of 140
* prepend precision qualifiers for int and float
* in, out -> attribute, varying (depending on shader)
* color -> gl_FragColor
* perform % by subtract x divided and multiplied by modulus
* use int instead of uint
* use an if-else chain instead of switch (ugh, should use dependend texture)
Wrap vertex array code in !defined(EMSCRIPTEN)
Wrap glfwSetDropCallback and glfwJoystickPresent in !defined(EMSCRIPTEN)
so that they don't kick out of execution with a JavaScript exception.
Rename initialize_texture to initialize_texture_integer.
New function initialize_texture that loads a GL_RED texture, and
use it for hires and image shaders.
Don't scale texture values back to 0.0-1.0 in image and hires shaders.
Rename "texture" to "opengl_texture" for a touch more readability
and less ambiguity.
Switch hires and image textures to "opengl_texture".
Use coordinate scale for image textures and hires textures in shaders
and pass in as Uniforms
Change initialize_texture to return an object containing width and
height, since the GUI uses textport textures of various sizes.
Add scale factors to text, text80, and lores shaders and set them as Uniforms.
Make new texture function for making 2D textures instead of RECTANGLE
textures.
Pass in scale factor from texel coordinates to UV coordinates.
Change text and text80 fragment shaders to scale texel coordinates
to UV for sampler for font_texture.
Use sampler2D instead of sampler2DRect for font_texture
instructions_by_first_appearance_clock.csv is emitted from branch
"cpu_progression". It contains the number of instructions processed
before the first time a particular instruction was encountered.
graph_cycles_before_new_insn.py emits an ASCII graph from that data,
linear or algorithmic depending on variable in the source.
(Serve with "python -m SimpleHTTPServer" or similar)
Bundle apple2e.rom into served filesystem
Compile with emcc
Break main loop out of main() for web browser event handling using emscripten_set_main_loop_arg()
Move all libao operation into interface.cpp
This should have the result of removing all AV and GUI code from apple2e.cpp
OS code remaining in apple2e.cpp should basically be only file I/O, console I/O, and chrono.
Store all text and hgr writes in write() in a map.
Later, in apply_writes(), actually download all writes from the map.
This has the effect of downloading only the most recent write.
After implementation, this has the effect in FAST mode on my Mac of only reducing writes by between 0% and 4% in both QUADRADOODLE and LodeRunner. So probably not worth it. But maybe worth an interation on this which would mark rows and try to coalesce adjacent writes in X and Y to single texture updates.