Ported some PCjs drawing code to PC8080, still needs work though

This commit is contained in:
Jeff Parsons 2016-05-02 09:01:06 -07:00
commit 59b6dd3be6
23 changed files with 781 additions and 499 deletions

View file

@ -9,7 +9,9 @@ PCjs Video Component
Format
---
<video>...</video>
```xml
<video>...</video>
```
Purpose
---
@ -22,24 +24,6 @@ Creates an instance of the Video component. This component is responsible for:
Attributes
---
* *addr* (required)
The ROM starting address (e.g., 0xfe000).
* *size* (required)
The length of ROM, in bytes (e.g., 0x02000 for an 8Kb ROM). This must match the length of the ROM image file.
* *file* (required)
URL of the ROM image file to load at the specified addr.
* *notify* (optional)
The *id* of a component to notify when *file* has been loaded. For example, the Video component may need
to know when an external video ROM has been loaded. Any component can load its own files, including ROM image files,
but it's simpler to use the ROM component and request notification.
* *model* (optional)
* "mda" (Monochrome Display Adapter)
@ -49,17 +33,13 @@ Attributes
If *model* is not set, the SW1 switch block settings from the [ChipSet](/docs/pcjs/chipset/) component will
determine the video model to use ("mda" or "cga" only).
* *scale* (optional; default is false)
true scales text modes to fill the canvas;
false centers text modes on the canvas (this generally provides the sharpest rendering).
* *screenwidth*, *screenheight* (required)
* *screenWidth*, *screenHeight* (required)
The width and height of the canvas, in pixels (these are numbers, not style attributes, so do not include
a "px" suffix).
a "px" suffix); the canvas resolution does not need to match the *model* resolution (in fact, it should probably
be closer to the resolution of modern monitors, but still proportional to the resolution of the *model* being used).
* *fontrom* (formerly *charset*; required for models "mda" and "cga")
* *fontROM* (formerly *charset*; required for models "mda" and "cga")
The name of a character generator (font ROM) file. The MDA and CGA adapters did not contain a separate
system ROM, but they did contain on-board font data in ROM that the adapter used internally to generate character
@ -67,6 +47,11 @@ Attributes
The EGA uses font data stored in its system ROM, which is loaded by the ROM component, so do not use this
setting with model "ega".
* *scale* (optional; default is false)
true scales text modes to fill the canvas;
false centers text modes on the canvas (this generally provides the sharpest rendering).
Also supports the attributes of *[Component](/docs/pcjs/component/)*.
@ -79,17 +64,22 @@ Bindings
Example
---
<video id="videoMDA" screenwidth="720" screenheight="350" scale="true" fontrom="ibm-mda-cga.json">
<name>Monochrome Display</name>
</video>
```xml
<video id="videoMDA" screenWidth="720" screenHeight="350" fontROM="ibm-mda-cga.json" scale="true">
<name>Monochrome Display</name>
</video>
```
Output
---
<div id="..." class="pc-video pc-component">
<div class="pc-container">
<div class="pcjs-video" data-value="id:'...',name:'...',addr:'...',size:'...',test:'...'"></div>
</div>
</div>
```html
<div id="..." class="pc-video pc-component">
<div class="pc-container">
<div class="pcjs-video" data-value="...">
</div>
</div>
</div>
```
Also, if any controls are defined, another &lt;div&gt; of class="pc-controls" is created in the container &lt;div&gt;,
with each control inside a &lt;div&gt; of class="pc-control".