Commit Graph

175 Commits

Author SHA1 Message Date
Brad Grantham
caee8cdac0 Set main loop to freerun at Browser speed 2017-01-08 09:49:32 -08:00
Brad Grantham
14a8ee8dcc Notes checkpoint 2017-01-08 09:47:56 -08:00
Brad Grantham
daab1a26ae Replace LodeRunner with DOS 2017-01-07 23:06:52 -08:00
Brad Grantham
e8e2cb43b9 Add disk ROM and DOS image to boot 2017-01-07 23:03:36 -08:00
Brad Grantham
bcf103aca2 Workaround assertion causes with -O2
-O2 causes a weird assertion (incorrect function table?), so drop back to -O1

Embed "packaged" directory into HTML in emscripten
2017-01-07 23:01:55 -08:00
Brad Grantham
704b926a7d Make graphics work in Emscripten target
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.
2017-01-07 22:58:28 -08:00
Brad Grantham
4849ab2115 Add ROM, disk ROM, and DOS 3.3 for emscripten preload 2017-01-07 22:39:38 -08:00
Brad Grantham
6870e4f962 Merge branch 'master' into web_target 2017-01-07 15:53:20 -08:00
Brad Grantham
0075ee6b3f Change text and lores shaders from R8UI to RED
Last of the INTEGER textures.

Scale values up from textport so they can be interpreted as byte values.
2017-01-07 15:51:02 -08:00
Brad Grantham
6de05cefb2 Move font texture from R8UI to RED 2017-01-07 15:42:11 -08:00
Brad Grantham
7570a1c842 Move image and hires textures from R8UI to RED
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.
2017-01-07 15:38:54 -08:00
Brad Grantham
7ce091c23e Remove some unnecessary subtrations of 0 2017-01-07 15:27:41 -08:00
Brad Grantham
4460274b75 Fix hires color shader 2017-01-07 15:13:30 -08:00
Brad Grantham
be750dfac4 Use 2D for hires, images textures; not RECTANGLE
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
2017-01-07 14:51:29 -08:00
Brad Grantham
4a3dc4a9b7 Fix broken 80-column text 2017-01-07 14:35:00 -08:00
Brad Grantham
3863010d07 Move textport textures from RECTANGLE to 2D
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.
2017-01-07 14:00:46 -08:00
Brad Grantham
c9113ece86 Change font texture from RECTANGLE to 2D
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
2017-01-07 13:32:35 -08:00
Brad Grantham
8d7a649293 Merge branch 'master' into web_target 2017-01-05 15:20:51 -08:00
Brad Grantham
49f098f6dc Add counts and grapher for instruction progress
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.
2017-01-05 15:19:40 -08:00
Brad Grantham
4477878011 Use two 16-bit channels 2017-01-04 23:19:27 -08:00
Brad Grantham
442faa4677 Skip libAO when compiling with Emscripten 2017-01-04 23:19:00 -08:00
Brad Grantham
31455f053a Merge branch 'master' into web_target 2017-01-04 22:41:26 -08:00
Brad Grantham
2e7f809bc9 Fix compile errors caused by moving to range for 2017-01-04 22:09:31 -08:00
Brad Grantham
6d823f8764 Add Emscripten variant to testsdl 2017-01-03 10:27:35 -08:00
Brad Grantham
c981363b4d AO test file 2017-01-03 10:09:18 -08:00
Brad Grantham
6c72f1d21d SDL test file 2017-01-03 10:08:59 -08:00
Brad Grantham
30ec998252 Use range-for on containers 2017-01-03 09:41:38 -08:00
Brad Grantham
8020394556 Make input work, hide Emscripten canvas 2017-01-02 15:18:51 -08:00
Brad Grantham
1cfa131093 Add more characters and fix textport 2017-01-02 15:18:14 -08:00
Brad Grantham
9f6db28244 Add SINES printer program 2017-01-02 12:54:44 -08:00
Brad Grantham
6b0ee0145f Add preliminary keyboard input 2017-01-02 12:35:27 -08:00
Brad Grantham
453c90d4cf Fix buffer underrun in audio code 2017-01-02 12:02:44 -08:00
Brad Grantham
203dd3c92f Remove -fast and debugging from arguments 2017-01-02 12:02:01 -08:00
Brad Grantham
2d66e434b1 Fix keyboard junk error
By setting "next" audio element to 0 and not -1
Must have been stomping first byte of keyboard_buffer
2017-01-02 11:54:59 -08:00
Brad Grantham
ff941f7142 Remove special case ROM blob 2017-01-02 11:30:46 -08:00
Brad Grantham
fbb3fb3918 Add preliminary emscripten support
(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()
2017-01-02 11:25:57 -08:00
Brad Grantham
2d72b56e18 Add emscripten web interface implementation 2017-01-02 11:24:04 -08:00
Brad Grantham
cb60985ef0 Move audio implementation into interface.cpp
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.
2016-12-26 22:28:45 -08:00
Brad Grantham
bf7961855f Reduce OpenGL texture download overhead a touch
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.
2016-12-26 02:00:09 -08:00
Brad Grantham
8817b799b6 Make Lemmings start up (but wrong Lemmings...)
Implement EOR zpg,X
Implement ROL zpg,X (Thanks, Bart and Dad!)
2016-12-26 01:34:57 -08:00
Brad Grantham
4bd25b0cc1 Fixes formatting 2016-12-14 16:53:57 -08:00
Brad Grantham
702f0749f0 Add usage examples 2016-12-14 16:52:54 -08:00
Brad Grantham
33314406c0 use my CPU 2016-12-09 13:06:50 -08:00
Brad Grantham
920eb71e28 want BCD 2016-12-09 13:06:41 -08:00
Brad Grantham
bbf62836b3 use 1000Hz as audio cutoff 2016-12-07 14:42:28 -08:00
Brad Grantham
ab5ee6f1db my sound digitizer application disk 2016-12-07 14:41:39 -08:00
Brad Grantham
81a4ab26bd resize to window, fix #3 2016-12-06 20:02:18 -08:00
Brad Grantham
15e0c797bd resize to fit window 2016-12-06 18:58:34 -08:00
Brad Grantham
e95048d6e9 remove printf in waveform initialization 2016-12-06 18:58:25 -08:00
Brad Grantham
1d8a138123 Slightly better audio using a sine wave approximation
Choose a 2000Hz sine wave as a trade off between smoothing audio and preserving audio

Fix #14
2016-12-06 18:24:11 -08:00