From 609a1879cc9a3e701e8f4bab26f0fd9df19a508d Mon Sep 17 00:00:00 2001 From: NinjaWeedle <37186521+NinjaWeedle@users.noreply.github.com> Date: Thu, 13 Oct 2022 09:42:05 -0400 Subject: [PATCH 1/4] Begin work on HWC-64 docs --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index 0c3f682..c750690 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ The list builds on these modern documents, in addition to historical sources: * [CHIP‐8 Extensions Reference](https://github.com/mattmikolay/chip-8/wiki/CHIP%E2%80%908-Extensions-Reference) * [SCHIP Compatibility](https://github.com/Chromatophore/HP48-Superchip) * [xChip manual](https://github.com/mehcode/xchip/blob/master/docs/manual.md) +* [HWC-64 Docs](https://github.com/NinjaWeedle/HyperWaveCHIP-64) ### Commonalities and notation @@ -1058,6 +1059,34 @@ Octo is a CHIP-8 interpreter that supports regular CHIP-8, SUPER-CHIP and XO-CHI * Switching resolution mode erases the screen, like XO-CHIP dictates, but Octo does so even with SCHIP games. +## HyperWaveCHIP-64 + +An extension for XO-CHIP 1.1 created by Oxiti8 in 2021. + +HWC-64 allows easier access + +Note that XO-CHIP is mainly supported by John Earnest's own Octo assembler, which supports "macros" for comparison operators (less than (or equal), greater than (or equal)) but which assemble down to regular CHIP-8 bytecode instead of dedicated instructions. + +

New instructions

+ +* `00E1`: INVERT - NOT the contents of the the currently selected bit plane. +* `00F1`: OR MODE - Enable OR mode drawing. (Pixels are not erased during DXYN if collision. VF is still set to 1 if collision and 0 otherwise) +* `00F2`: ERASE MODE - Enable ERASE mode drawing. (Only erases pixels during DXYN if collision. VF is still set to 1 if collision and 0 otherwise) +* `00F3`: XOR MODE - Enable XOR mode drawing. (XOR is the default drawing mode.) +* `5XY1`: SKIP VX > VY - Skip if VX > VY. Will also double skip over the `F000`, `F100`, `F200`, and `F300` instructions like other skip instructions. Inherited from CHIP8E. +* `F100 NNNN`: Long Jump - Load PC with 16-bit address NNNN +* `F200 NNNN`: Long call - Store current PC in stack, then Load PC with 16-bit address NNNN +* `F300 NNNN`: Long Jump + V0 - Store current PC in stack, then Load PC with 16-bit address NNNN + V0 +* `FN03`: Palette swap - Set RGB8 color used for plane # N to 24-bit (3-byte) RGB8 color palette located at I in memory + +

Altered instructions

+ +* Skip instructions that double skip over `F000` in XO-CHIP will also double skip over `F100`, `F200`, and `F300`. + +

Compatibility notes

+ +* Draw mode is set to XOR by default. + ## CHIP-8 Classic / Color The CHIP-8 Classic and CHIP-8 Color is a microcontroller computer created by StandAloneComputers in 2019. It's inspired by the DREAM 6800 interpreter, and includes a similar monitor program, also called CHIPOS. It also adds an ASCII character set, I/O, and color support. See https://chip-8.com. From 39ddc98f45c0c2db8549f82601841229a21ed451 Mon Sep 17 00:00:00 2001 From: NinjaWeedle <37186521+NinjaWeedle@users.noreply.github.com> Date: Thu, 13 Oct 2022 17:11:13 -0400 Subject: [PATCH 2/4] More information on the Font exception in MegaChip --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c750690..40cd068 100644 --- a/README.md +++ b/README.md @@ -991,11 +991,13 @@ A superset of SCHIP created by Revival Studios in 2007.

Altered instructions

-Same as SCHIP except `BNNN` jumps properly, and: +Same as SCHIP except: -* `DXYN` is completely different in MegaChip mode, using SPRH/SPRW for Sprite height and width and ignoring N, using a byte per pixel as opposed to a bit per pixel, always overwriting the contents of the screen buffer rather than XORing, and only setting VF if the value of the pixel about to be overwritten is equal to the Collision Color value set by 09NN. Supposedly "non-character" sprites don't use this special DXYN? +* `BNNN` uses VIP behavior (NNN+V0) instead of the bugged SCHIP behavior (VX+XNN) +* `DXYN` is completely different in MegaChip mode, using SPRH/SPRW for Sprite height and width and ignoring N, using a byte per pixel as opposed to a bit per pixel, always overwriting the contents of the screen buffer rather than XORing, and only setting VF if the value of the pixel about to be overwritten is equal to the Collision Color value set by 09NN. If I is pointing to a non-character sprite (the built in font data), the normal DXYN behavior is used instead. * `00FE` and `00FF` do not work properly in MegaChip mode * `00EE` is the only instruction that actually updates the screen while MegaChip mode is active, and clears the screen buffer as normal after updating +* `FX30` is missing from the original MegaChip emulator.

Compatibility notes

From defc2ddc5165fe5c9128c24c54ab94b6291d4d03 Mon Sep 17 00:00:00 2001 From: NinjaWeedle <37186521+NinjaWeedle@users.noreply.github.com> Date: Thu, 13 Oct 2022 18:25:02 -0400 Subject: [PATCH 3/4] Apologize to FX30 (it very much exists) --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 40cd068..3090510 100644 --- a/README.md +++ b/README.md @@ -997,7 +997,6 @@ Same as SCHIP except: * `DXYN` is completely different in MegaChip mode, using SPRH/SPRW for Sprite height and width and ignoring N, using a byte per pixel as opposed to a bit per pixel, always overwriting the contents of the screen buffer rather than XORing, and only setting VF if the value of the pixel about to be overwritten is equal to the Collision Color value set by 09NN. If I is pointing to a non-character sprite (the built in font data), the normal DXYN behavior is used instead. * `00FE` and `00FF` do not work properly in MegaChip mode * `00EE` is the only instruction that actually updates the screen while MegaChip mode is active, and clears the screen buffer as normal after updating -* `FX30` is missing from the original MegaChip emulator.

Compatibility notes

From 423dce0ad6d3df5bf1ac9770bfad28392ac9bf34 Mon Sep 17 00:00:00 2001 From: NinjaWeedle <37186521+NinjaWeedle@users.noreply.github.com> Date: Thu, 13 Oct 2022 19:03:32 -0400 Subject: [PATCH 4/4] Add remaining HWC-64 opcodes --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3090510..3061f92 100644 --- a/README.md +++ b/README.md @@ -994,7 +994,7 @@ A superset of SCHIP created by Revival Studios in 2007. Same as SCHIP except: * `BNNN` uses VIP behavior (NNN+V0) instead of the bugged SCHIP behavior (VX+XNN) -* `DXYN` is completely different in MegaChip mode, using SPRH/SPRW for Sprite height and width and ignoring N, using a byte per pixel as opposed to a bit per pixel, always overwriting the contents of the screen buffer rather than XORing, and only setting VF if the value of the pixel about to be overwritten is equal to the Collision Color value set by 09NN. If I is pointing to a non-character sprite (the built in font data), the normal DXYN behavior is used instead. +* `DXYN` is completely different in MegaChip mode, using SPRH/SPRW for Sprite height and width and ignoring N, using a byte per pixel as opposed to a bit per pixel, always overwriting the contents of the screen buffer rather than XORing, and only setting VF if the value of the pixel about to be overwritten is equal to the Collision Color value set by 09NN. If I is pointing to a non-character sprite (the built in font data), the normal DXYN behavior is used instead. Wrapping on the Y axis actually occurs at Row 256 and not Row 192. * `00FE` and `00FF` do not work properly in MegaChip mode * `00EE` is the only instruction that actually updates the screen while MegaChip mode is active, and clears the screen buffer as normal after updating @@ -1075,6 +1075,9 @@ Note that XO-CHIP is mainly supported by John Earnest's own Octo assembler, whic * `00F2`: ERASE MODE - Enable ERASE mode drawing. (Only erases pixels during DXYN if collision. VF is still set to 1 if collision and 0 otherwise) * `00F3`: XOR MODE - Enable XOR mode drawing. (XOR is the default drawing mode.) * `5XY1`: SKIP VX > VY - Skip if VX > VY. Will also double skip over the `F000`, `F100`, `F200`, and `F300` instructions like other skip instructions. Inherited from CHIP8E. +* `8XYC`: MULT VX, VY - Set VX to VX * VY. Set VF to higher 8 bits of the product, and set VX to (result of the multiplication % 256). If the result is below 256, set VF to 0. +* `8XYD`: DIV VX, VY - VX = VX // VY. VF = VX % VY. If VY = 0 at the start of the opcode, set BOTH VX and VF to 0. Prevents division by zero. +* `8xyF`: DIV VX, VY - VX = vY // vX. VF = vY % vX. If VX = 0 at the start of the opcode, set BOTH VX and VF to 0. Prevents division by zero. * `F100 NNNN`: Long Jump - Load PC with 16-bit address NNNN * `F200 NNNN`: Long call - Store current PC in stack, then Load PC with 16-bit address NNNN * `F300 NNNN`: Long Jump + V0 - Store current PC in stack, then Load PC with 16-bit address NNNN + V0