mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2026-10-25 00:02:16 +00:00
docs, presets tweak, removed atari8-800xl.mame (use atari8-800.xlmame)
This commit is contained in:
1 parent
c8c60154e9
commit
cce08ea254
6 files changed
+24
-33
No files matched your search
@@ -203,7 +203,6 @@ body {
|
||||
<li><a class="dropdown-item" href="?platform=atari8-5200.mame">Atari 5200 (MAME)</a></li>
|
||||
<hr>
|
||||
<li><a class="dropdown-item" href="?platform=vcs.stellerator">Atari 2600 (Stellerator)</a></li>
|
||||
<li><a class="dropdown-item" href="?platform=vcs.mame">Atari 2600 (MAME)</a></li>
|
||||
<li><a class="dropdown-item" href="?platform=coleco.mame">ColecoVision (MAME)</a></li>
|
||||
<li><a class="dropdown-item" href="?platform=nes.mame">NES (MAME)</a></li>
|
||||
<hr>
|
||||
|
||||
@@ -82,6 +82,7 @@ void draw_playfield() {
|
||||
cputsxy(20, 0, "Plyr2:");
|
||||
cputcxy( 7, 0, players[0].score+'0');
|
||||
cputcxy(27, 0, players[1].score+'0');
|
||||
cputsxy( 6, ROWS-1, "I/J/K/L - UP/LEFT/DOWN/RIGHT");
|
||||
}
|
||||
|
||||
typedef enum { D_RIGHT, D_DOWN, D_LEFT, D_UP } dir_t;
|
||||
@@ -129,8 +130,8 @@ void human_control(Player* p) {
|
||||
switch (key) {
|
||||
case 'I': dir = D_UP; break;
|
||||
case 'J': dir = D_LEFT; break;
|
||||
case 'K': dir = D_RIGHT; break;
|
||||
case 'M': dir = D_DOWN; break;
|
||||
case 'L': dir = D_RIGHT; break;
|
||||
case 'K': dir = D_DOWN; break;
|
||||
}
|
||||
// don't let the player reverse direction
|
||||
if (dir < 0x80 && dir != (p->dir ^ 2)) {
|
||||
|
||||
+20
-27
@@ -9,10 +9,10 @@ a comment, sitting right above the bytes:
|
||||
const byte tiles[] = { ... };
|
||||
```
|
||||
|
||||
From that short comment the editor knows the data is two 8×8, 1-bit
|
||||
images, most significant bit on the left. You write the header by hand
|
||||
once, and from then on the Asset Editor can draw and edit the data for
|
||||
you.
|
||||
The Asset Editor scans that comment and reads the JSON inside.
|
||||
It then knows how to convert the bytes inside the array to and from an image.
|
||||
|
||||
For example, the above comment represents two images, 8x8 pixels, 1 bit per pixel, most significant bit on the left.
|
||||
|
||||
## Header syntax
|
||||
|
||||
@@ -26,14 +26,14 @@ which depends on the language:
|
||||
| Assembly | `;;{w:8,h:8};;` | next `;;` |
|
||||
| Verilog | `/*{w:8,h:8}*/` | next `end` |
|
||||
|
||||
**Each number needs a radix prefix so the editor can read it.** It
|
||||
recognizes `0xNN`, `$NN`, `#$NN`, `%0101`, `0b0101`, `8'hNN`, `8'b0101`,
|
||||
and assembler `hex 1f20…` statements. It also remembers the notation you
|
||||
used and writes edits back the same way, so a file of `$`-prefixed bytes
|
||||
stays `$`-prefixed. The one thing it will *not* read is **plain
|
||||
decimal** — a block of `{24,60,126,…}` parses as zero values and reports
|
||||
*"Expected 8 value(s), found 0"*.
|
||||
**Each number needs a radix prefix.**
|
||||
It recognizes `0xNN`, `$NN`, `#$NN`, `%0101`, `0b0101`, `8'hNN`, `8'b0101`,
|
||||
and assembler `hex aabbcc…` statements.
|
||||
It remembers the notation you used and writes each number back the same way.
|
||||
It does *not* recognize **plain decimal** numbers
|
||||
— a block of `{24,60,126,…}` parses as zero values and reports an error.
|
||||
|
||||
Examples:
|
||||
```c
|
||||
/*{w:8,h:8,bpp:1,count:2,brev:1}*/
|
||||
const byte tiles[] = {
|
||||
@@ -45,15 +45,14 @@ const byte tiles[] = {
|
||||
```asm
|
||||
;;{w:8,h:8,count:1,brev:1,flip:1};;
|
||||
PlayerGfx:
|
||||
.byte $18,$3c,$7e,$ff,$ff,$7e,$3c,$18
|
||||
.byte $18,$3c,$7e,$ff
|
||||
hex ff7e3c18
|
||||
;;
|
||||
```
|
||||
|
||||
### Writing JSON loosely
|
||||
|
||||
You don't have to quote the keys. The scanner rewrites `([A-Za-z]+):` to
|
||||
`"$1":` before parsing, so `w:8` and `"w":8` mean the same thing. String
|
||||
*values* still need their quotes, though: `pal:"nes"`, `comp:"rletag"`.
|
||||
The JSON parser isn't strict, so you don't have to "quote" keys --
|
||||
`w:8` and `"w":8` mean the same thing.
|
||||
String *values* still need their quotes, though: `pal:"nes"`, `comp:"rletag"`.
|
||||
|
||||
### Things to watch out for
|
||||
|
||||
@@ -76,11 +75,6 @@ const char sprite[] = {
|
||||
};
|
||||
```
|
||||
|
||||
The path is resolved first exactly as written, then relative to the
|
||||
directory of the file containing the header (`sub/main.c` + `data.bin` →
|
||||
`sub/data.bin`). The file's byte length is validated against the format
|
||||
the same way inline data is.
|
||||
|
||||
### Overlapping arrays
|
||||
|
||||
The scanner decides where a data block ends from how the header starts,
|
||||
@@ -110,10 +104,10 @@ everything else falls back to a sensible default.
|
||||
| `h` | *required* | Height in pixels |
|
||||
| `count` | `1` | Number of images |
|
||||
| `bpp` | `1` | Bits per pixel |
|
||||
| `np` | `1` | Number of bitplanes (colors = 2<sup>bpp×np</sup>) |
|
||||
| `np` | `1` | Number of bitplanes (colors = 2<sup>bpp˙np</sup>) |
|
||||
| `bpw` | `8` | Bits per word (8, 16, 32) |
|
||||
| `sl` | `ceil(w*bpp/bpw)` | Words per scanline (stride) |
|
||||
| `wpimg` | `sl*h` | Words per image — use when hardware pads images |
|
||||
| `wpimg` | `sl*h` | Words per image (for padding) |
|
||||
| `pofs` | `sl*h*count` | Distance between bitplanes, in words |
|
||||
| `skip` | `0` | Words to skip at the start of the whole block |
|
||||
| `brev` | `false` | MSB is the leftmost pixel |
|
||||
@@ -149,10 +143,9 @@ A block with `pal` and no `w`/`h` describes a palette instead of an image.
|
||||
block holds.
|
||||
- **A name**: `"nes"`, `"vcs"`, `"c64"`, `"gb"`, `"ap2lores"`,
|
||||
`"astrocade"`, or `"pacman"`.
|
||||
These are the only recognized names — an
|
||||
unknown one reports `No palette named X`.
|
||||
An unknown name reports an error.
|
||||
|
||||
Bitmaps pick up their colors from palette blocks **anywhere in the open
|
||||
Bitmaps pick up their colors from palette blocks **anywhere in the current
|
||||
project**, matched by entry count — a 4-color bitmap offers every 4-entry
|
||||
palette (and every 4-entry slice named by a `layout`) in a dropdown.
|
||||
Projects fall back to a default palette when no palette block matches.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Asset Editor
|
||||
|
||||
The Asset Editor finds [Asset Headers](asset-headers.md) in your source — small JSON
|
||||
The Asset Editor finds [asset headers](asset-headers.md) in your source — small JSON
|
||||
descriptors inside comments — and turns the data block that follows into
|
||||
an editable bitmap, tilemap, or palette. Edits are written straight back
|
||||
into the source text, preserving the original number base and formatting
|
||||
|
||||
@@ -161,7 +161,6 @@ function atari8_showHelp() {
|
||||
///
|
||||
|
||||
PLATFORMS['atari8-800.xlmame'] = Atari800MAMEPlatform
|
||||
PLATFORMS['atari8-800xl.mame'] = Atari800MAMEPlatform // for dithertron
|
||||
PLATFORMS['atari8-5200.mame'] = Atari5200MAMEPlatform
|
||||
PLATFORMS['atari8-800'] = Atari800Platform
|
||||
PLATFORMS['atari8-5200'] = Atari5200Platform
|
||||
@@ -62,7 +62,6 @@ const DEFAULT_TIMEOUT = 120000;
|
||||
|
||||
// skip these platforms, they aren't ready yet or otherwise broken
|
||||
const SKIP_PLATFORMS = [
|
||||
'atari8-800xl.mame',
|
||||
'vector-ataribw',
|
||||
'williams-defender',
|
||||
'astrocade-arcade',
|
||||
|
||||
Reference in new issue
Block a user