Discuss Scratch

  • Discussion Forums
  • » Advanced Topics
  • » Wave Multi-Emulator Collaboration- Emulating CHIP-8, GBC, NES, NDS, Intel 8080, and more all in one Scratch Project. - V1.1.0 out now! [RSS Feed]
oxiti8
Scratcher
1000+ posts

Wave Multi-Emulator Collaboration- Emulating CHIP-8, GBC, NES, NDS, Intel 8080, and more all in one Scratch Project. - V1.1.0 out now!

I've finally published V0.7.9 as a GitHub release, which means it's time to start working on V0.8.

Thinking of names for this version- I was thinking something like “Infinite edition” or something along those lines since 8 turned on its side looks like Infinity, but now that I think about it that doesn't really make much sense considering it has nothing else to do with this version's contents…
ScratchcatandGobo
Scratcher
1000+ posts

Wave Multi-Emulator Collaboration- Emulating CHIP-8, GBC, NES, NDS, Intel 8080, and more all in one Scratch Project. - V1.1.0 out now!

Hey I was thinking… maybey you can make a built-in ide for chip-8.

Yeah, but at least we've learned something today… that every moment of our life should be lived to the fullest because it can be very long or very short, my friend. - Gumball
I felt like I wanted to develop games on here, so I won't leave! (for now)
(last edited 2/8/24)





























kccuber
Scratcher
1000+ posts

Wave Multi-Emulator Collaboration- Emulating CHIP-8, GBC, NES, NDS, Intel 8080, and more all in one Scratch Project. - V1.1.0 out now!

ScratchcatandGobo wrote:

Hey I was thinking… maybey you can make a built-in ide for chip-8.
that would be a bit of a bloat added to an emulator, a seperate project would be better off


Made using Nord Theme & Inkscape
oxiti8
Scratcher
1000+ posts

Wave Multi-Emulator Collaboration- Emulating CHIP-8, GBC, NES, NDS, Intel 8080, and more all in one Scratch Project. - V1.1.0 out now!

kccuber wrote:

ScratchcatandGobo wrote:

Hey I was thinking… maybey you can make a built-in ide for chip-8.
that would be a bit of a bloat added to an emulator, a seperate project would be better off
I agree. I've thought about this before and then decided it was out of the scope of Wave.

That being said, if I do make one in scratch, It's going to use WAVE-8.

Last edited by oxiti8 (Jan. 27, 2022 15:07:54)

oxiti8
Scratcher
1000+ posts

Wave Multi-Emulator Collaboration- Emulating CHIP-8, GBC, NES, NDS, Intel 8080, and more all in one Scratch Project. - V1.1.0 out now!

V0.8 is out!


After 4 months, I've finally finished V0.8. While not as major of a leap in design as V0.7 was, V0.8 brings some much needed updates to the ROM importer, DualGB, and CoolNES.

The ROM importer now utilizes the main menu tiles for choosing which emulator to import a rom into- finally moving past the remnants of the old and convoluted rom importer that hadn't fundamentally changed since V0.1.1.

DualGB has been updated to the latest version, now having full Game Boy Color support, a new backdrop and ui.

Wave's version of CoolNES finally got an update to 2.4, bringing new mapper support and audio support.

I've also fixed typos and whatnot.

I wasn't exactly sure what to call this version, so i just went with V0.8. I was going to call this version “Infinite Edition”, but it's technically still a beta and thus isn't forever.

Go check it out here!
ScratchcatandGobo
Scratcher
1000+ posts

Wave Multi-Emulator Collaboration- Emulating CHIP-8, GBC, NES, NDS, Intel 8080, and more all in one Scratch Project. - V1.1.0 out now!

Whats new in 0.8? Also remove the part saying “0.8 is in dev” because it just got released.

Yeah, but at least we've learned something today… that every moment of our life should be lived to the fullest because it can be very long or very short, my friend. - Gumball
I felt like I wanted to develop games on here, so I won't leave! (for now)
(last edited 2/8/24)





























oxiti8
Scratcher
1000+ posts

Wave Multi-Emulator Collaboration- Emulating CHIP-8, GBC, NES, NDS, Intel 8080, and more all in one Scratch Project. - V1.1.0 out now!

ScratchcatandGobo wrote:

Whats new in 0.8? Also remove the part saying “0.8 is in dev” because it just got released.
- new rom importing system that uses a more uniform graphical interface than the old text based one. While this does mean importing GB, CHIP-8, and Bytepusher roms isn’t quite as fast as it was, the new system should make it easier for newcomers.

- DualGB is updated to the latest build, adding full Game Boy Color support and a new GUI.

- CoolNES was updated to 2.4. This one was a bit of a pain to do as i spent a good hour or so trying to figure out why audio wasn’t working (always initialize the size of lists before you use the replace command if you want your code to be portable)

- WAVE-8 got some more Mega-Chip features. Mega Chip emulation is still not in a fully functional state, but fully implementing megachip would require so many if then cases it’d probably hurt performance.

- changed some grammar.

I’ve already updated the top post for V0.8.
oxiti8
Scratcher
1000+ posts

Wave Multi-Emulator Collaboration- Emulating CHIP-8, GBC, NES, NDS, Intel 8080, and more all in one Scratch Project. - V1.1.0 out now!

Time for the first major addition in a while- MegaChip support! (mostly)

With V0.8.4, I've made major strides in adding support for the MegaChip CHIP-8 extension- adding a 256 entry pallette table, Implementing Megachip's 24-bit I pointer, etc.

The results of these efforts speak for themselves:

Wave V0.8.4 running Mega Twister Demo:


Revival Studios' MegaChip emulator running Mega Twister Demo:


I haven't been able to get the background to appear yet (likely due to sprite blending not being implemented), and there's no audio, but this makes Wave one of if not the first CHIP-8 emulators ever to have both XO-CHIP and MegaChip support. More updates to come as I continue to work on this.
country_kid
Scratcher
100+ posts

Wave Multi-Emulator Collaboration- Emulating CHIP-8, GBC, NES, NDS, Intel 8080, and more all in one Scratch Project. - V1.1.0 out now!

Nicee!!

:0 -*gasp*
his name is Bob the Evil Kumquat…
he is gasping
because I ate the signature.
when green flag clicked
if <gamedeveloper> then
Make [ Game]
end
oxiti8
Scratcher
1000+ posts

Wave Multi-Emulator Collaboration- Emulating CHIP-8, GBC, NES, NDS, Intel 8080, and more all in one Scratch Project. - V1.1.0 out now!



After several consecutive hours of work and lots of documentation writing, Mega-Chip8 support is done (I'm not doing audio. It has more channels than XO-CHIP and pretty much involves making an mp3 player in scratch which is just no).

I had to deal with some undocumented instructions like 09NN to get this done- the existing docs for MegaChip kinda suck and are missing some things. I've been writing new docs for Mega-Chip that I have yet to publish- I'll post the opcode table and feature list portions of it below just to get it out on the internet for people looking to implement MegaChip themselves:

Here are the features of MegaChip mode once you trigger it:

- 256x192 resolution
- Index based 32-bit color palettes in ARGB8 format (256 entries total, when a sprite references palette 0 it is drawing a transparent sprite)
- Drawing is synced to CLS(0xEE), meaning that you only update the screen when CLS is called, and after updating the screen you clear the screen buffer like normal.
– This effectively means that MegaChip programs redraw the whole screen between every update, which is useful because Megachip mode removes the XOR functionality of normal DXYN
- Sprite Height/Sprite Width values are now used for sprites and override the value of N in DXYN, both values can be anywhere from 0 to 255
– Setting one of the Sprite Height or Sprite Width values to 0 actually sets that value to 256- this is commonly used for background sprites that fill the whole screen
- the addition of LDHI, which allows you to set Long I to a 24-bit value, allowing you to address 16MB of memory.
– This is essentially just a 24-bit version of XO-CHIP's 16-bit Long I.
– This means that MegaChip roms CANNOT BE 32MB LONG LIKE THE DEVKIT SAYS. YOU CAN ONLY ADDRESS UP TO 16MB OF MEMORY.
- LDPAL, which Will load 32-bit colors (Represented by 4 bytes in memory) to an internal mchip8 pallete at position 1.
– Palette color 0 is always black/transparent and cannot be changed.
- an Alpha/Fade effect for the screen buffer, this is a strange inclusion that affects the whole window, it's never been used and still needs to be tested.
- MegaChip sprites are Byte per pixel as opposed to bit per pixel- the value of the byte points to which color from the mchip8 palette to use.


LIST OF UPDATED AND NEW OPCODES:

Opcodes with “+” next to them are new to MegaChip. Opcodes without + are modified in MegaChip. Opcodes with “*” in front of them are undocumented.
  • 0010+ Disable Megachip mode (MEGAOFF): This disables MegaChip mode putting the emulator back in standard mode (64x32 resolution, normal DXYN, etc.)

  • 0011+ Enable Megachip mode (MEGAON): This enables MegaChip mode, activating all the features listed above.
    – NOTE: If you have XO-CHIP implemented in your emulator, you should set your plane to 1 upon enabling MegaChip mode.
    – As a general rule don't do any graphics or audio stuff from the XO-CHIP or HYPERCHIP-64 extensions while in MegaChip mode. We don't need more quirk toggles.

  • 01nn+ I = (nn<<16)+nnnn (LDHI I,nnnnnn): This works like XO-CHIP's Long I instruction (F000), except the lower byte of the opcode is also used along with the next two bytes.
    – Like F000 in XO-CHIP, this instruction increments the PC by 2.
    – In the devkit, the author advises you to always follow this instruction with a NOP so it can be skipped over. However, this prevents you from accessing addresses that happen to equal the same value as opcodes.
    Therefore, I would advise anyone implementing this to have all the skip instructions that double skip over F000 in XO-CHIP to also double skip over
    01nn- This works perfectly fine with all existing MegaChip software and is much more developer friendly.

  • 02nn+ Load NN-colors palette at I (LDPAL I,nn): This loads a 4 byte color palette located at I in memory into the mchip8 palette nn times. Palettes are stored sequentially in memory- think of this instruction like Fx65 but with up to 255 palettes instead of 16 registers. Does not increment I.
    – Palettes are stored in AARRGGBB format (ARGB8). This similar to HyperWaveChip-64's Fn03 instruction, but with the addition of the alpha value in byte 1 and with more palettes.

  • 03nn+ Set Sprite Width to nn (SPRW nn): Set the sprite width value to nn.

  • 04nn+ Set Sprite Height to nn (SPRH nn): Set the sprite height value to nn.

  • 05nn+ Set screen alpha to nn (ALPHA nn): Sets the screen's alpha value to nn.
    – This one assembles properly but doesn't actually do anything. Feel free to stub it out as it's basically a NOP.

  • 060n+ Play digitized sound at I (DIGISND): Plays “mono 8-bit” audio (8 channels???) on loop
    – Audio always loops once it starts regardless of the value of n
    – This is not affected by the Sound Timer in any way and can only be stopped by 0700
    – first two bytes are for the frequency, next 3 bytes is the size

  • 0700+ Stop digitized sound (STOPSND): Stops the digitized sound.

  • 080n+ Set sprite blend mode (BMODE n) (0=normal,1=25%,2=50%,3=75%,4=additive,5=multiply)
    – No roms use this one to my knowledge. Need to look into this one more. Ready4Next/Mega8 has this implemented but not sure if t

  • *09nn+ Set Collision Color (CCOL nn): UNDOCUMENTED. Sets The Collision Color to NN.
    – Because DXYN always overwrites the pixel in MegaChip and the pixels can be more than one color, a specified color pallette is used for collisions. More info avaliable in the DXYN instruction.

  • 00BN+ Scroll display N lines up (SCRU n): Scrolls up 0-15 lines based on the value of N
    – Literally the exact same as XO-CHIP's 00DN instruction

  • 00FE Disable extended screen mode
    – Doesn't work in MegaChip mode

  • 00FF Enable extended screen mode for full-screen graphics
    – Doesn't work in MegaChip mode

  • DXYN (MegaChip mode) Show sprite from M(I) at coords (VX,VY), VF := collision with CCOL. DO NOT XOR.
    – One pixel in DXYN is one byte, with the value of the byte pointing to the mchip8 color palette that should be used to render said color.
    – a value of 0 is transparent.
    – Set VF to 1 if the following two conditions are met:
    - The value of the pixel about to be changed is equal to the value of the Collision Color value (set by 09NN, is a value from 0 to 255 as it points to the color palette and does not contain the actual AARRGGBB color)
    - The value of of the pixel you are about to write to the screen buffer is nonzero
    – VF is set BEFORE the pixel is changed, not after.
    – N is completely ignored
    – Supposedly this special DXYN only applies to “non-character” sprites. This might mean that when I is pointing to the built in font sprites the normal DXYN is used? Needs testing.


WEIRD STUFF:

- F0nn is listed as an opcode that sets I to a 28-bit address in the devkit- this seems to be a mistake as it's unused, eats the entire Fxxx range, and seems like an early version of 01nn- don't implement it
- The resolution changing opcodes (00FE and 00FF) don't work properly in MegaChip mode. Don't use them in MegaChip mode.
- A lot of the MegaChip extension additions (Sprite Blending, window transparency(even though this one doesn't even work), digitized audio) seem to be based on SDL functions suggesting that the original MegaChip emulator likely uses SDL 1.x of some kind


I'll publish the full document later on.

Last edited by oxiti8 (Oct. 13, 2022 03:04:35)

oxiti8
Scratcher
1000+ posts

Wave Multi-Emulator Collaboration- Emulating CHIP-8, GBC, NES, NDS, Intel 8080, and more all in one Scratch Project. - V1.1.0 out now!

After receiving reports of Super Mario Land's scrolling not working properly in DualGB, I decided to investigate.

Turns out it was a result of LY=LYC not triggering an interrupt in mode 2. That's been fixed in V0.8.7, and you can now play SML as normal again:


Last edited by oxiti8 (Oct. 14, 2022 17:33:53)

Bouncy_Ninja0fiicial
Scratcher
23 posts

Wave Multi-Emulator Collaboration- Emulating CHIP-8, GBC, NES, NDS, Intel 8080, and more all in one Scratch Project. - V1.1.0 out now!

interesting that emulators have been made using a limiting programing language like scratch, some even with sound!
this is very interesting.
keep up the work
oxiti8
Scratcher
1000+ posts

Wave Multi-Emulator Collaboration- Emulating CHIP-8, GBC, NES, NDS, Intel 8080, and more all in one Scratch Project. - V1.1.0 out now!

I'm making plans for V0.9- the changes I'm working on in Wave V0.8.8 (primarily MegaChip audio) have turned out to be a bit more radical than initially planned, plus there are a bunch of major features I've been wanting to introduce:

For one, universal remappable controls. CoolNES already has support for remappable controls, but using that functionality in Wave is…difficult to say the least. In Wave V0.9, I'm planning on introducing a new button on the main menu: “Remap controls”. This button will replace the “Random Theme” button.(That functionality will be moved to the main “Import Theme” button, and to generate a random theme you will type “?” instead of a theme code.)
Remapping controls will function similarly to importing a Rom. Select the “Remap Controls” button, then select the icon of the emulator you want to change the controls in. From here, you will enter the keys that you want to use for that specific emulator.

I'm also considering making a new emulator to add to Wave: Chip-16. Chip-16 is a virtual computer separate from CHIP-8 that uses an NES-style control layout, and it seems like a good target for me to write my own emulator from scratch in scratch.

There's also going to be a couple removals though:

- I'm going to cut some copyrighted music from Wave- their inclusions has made putting versions of Wave on GitHub arduous as I have to remove these songs from the GitHub releases, meaning Wave versions take a good while to reach GitHub after they're released on scratch. This should make that a bit easier.

- I'm also going to cut the Goddess A from the lineup of emulators. There have been numerous issues behind the scenes with it, and as much as I'd like to finish it, it's just not looking like it's ever getting completed. There's also the lack of software and interest for the platform compared to the other unfinished emulators (particularly GBA and DS) in Wave. The sprite for it will likely be replaced by Chip-16 or some other emulator.


I'm still on the fence on addingsavestates. It's definitely possible, but it would require basically creating a whole new blanket “Wave savestate” format (Think like the .ISO format), and then have the data contained in the savestate be targeted for the specific emulator it is for. The savestate files would have to be extremely long hex strings for them to be exportable from scratch. Basically, it would need a lot of work.


If anyone has any features they want to see in Wave V0.9 (Console suggestions, new features, designs, etc.), no matter how big or how small, feel free to post them here.
oxiti8
Scratcher
1000+ posts

Wave Multi-Emulator Collaboration- Emulating CHIP-8, GBC, NES, NDS, Intel 8080, and more all in one Scratch Project. - V1.1.0 out now!

oxiti8
Scratcher
1000+ posts

Wave Multi-Emulator Collaboration- Emulating CHIP-8, GBC, NES, NDS, Intel 8080, and more all in one Scratch Project. - V1.1.0 out now!



I'm working on some tweaks to the menu for Wave V0.9- The menu now has wider backdrops and the ability for the “wave” in the background to dynamically scale based on the stage width. This is effectively a 16:9 widescreen mode. I'm not sure if I want the project to automatically default to a 640x360 stage size in turbowarp though, as it can make it harder to work on the project due to the increased stage size. This will make Wave look better when running it in other scratch mods that do default to widescreen.
NFlex23
Scratcher
1000+ posts

Wave Multi-Emulator Collaboration- Emulating CHIP-8, GBC, NES, NDS, Intel 8080, and more all in one Scratch Project. - V1.1.0 out now!

This is so cool! It runs GB games extremely well.


Last edited by NFlex23 (Oct. 23, 2022 18:06:02)


Help improve the Advanced Topics (Really!)
Before you create a topic:
Always search for duplicates or other similar topics before making an umbrella topic, e.g., “The Mac Topic”.
  • Is it about something you are planning on making but haven't made yet? If so, please wait to post until you have created a working prototype. This is a key factor to keeping the ATs as clean as possible.
  • The ATs aren't technical support. It is perfectly valid to ask questions about things related to programming, but not issues with external websites, apps, or devices. Most sites have their own support system; try asking there!
  • Is it related to something you are making in Scratch? (This includes OSes and other Scratch projects) If so, please post in Collaboration, Show and Tell, or another similar forum.
  • Is your topic questionably “advanced”? Try browsing the other forums to see if your topic fits better in one of those.
  • Issues with Scratch itself should be put in Bugs and Glitches.
Before you post: Is what you're posting likely to start an argument or derail the thread (e.g., browsers, operating systems)? If so, please re-think your post!





oxiti8
Scratcher
1000+ posts

Wave Multi-Emulator Collaboration- Emulating CHIP-8, GBC, NES, NDS, Intel 8080, and more all in one Scratch Project. - V1.1.0 out now!

Some more updates on V0.9:
Cool NES's Bitwise op tables are now generated only once, at first time boot of WAVE. What does this mean? it means that when you initially click the green flag, the bitwise tables are all generated. This takes about 3 seconds on scratch, but happens instantly on Turbowarp. You only need to do this once the tables will stay generated until you reload the page. This means you no longer need for the tables to wait every time you launch CoolNES.
I also now use these bitwise tables in WAVE-8, heavily increasing the speed of 8XY1, 8XY2, and 8XY3.

I've also finished control remapping for CHIP-8, GB, and NES. More systems will be added to this list in the future.

I'm thinking Wave V0.9 will be released this Saturday, assuming everything goes to plan.
oxiti8
Scratcher
1000+ posts

Wave Multi-Emulator Collaboration- Emulating CHIP-8, GBC, NES, NDS, Intel 8080, and more all in one Scratch Project. - V1.1.0 out now!

oxiti8
Scratcher
1000+ posts

Wave Multi-Emulator Collaboration- Emulating CHIP-8, GBC, NES, NDS, Intel 8080, and more all in one Scratch Project. - V1.1.0 out now!

Here's a look at the control remapping in Wave V0.9:


Currently, you can remap controls for 3 systems: CHIP-8, GB, and NES. Remapping works the same for all of them- press space or tap the screen, type the number of the entry in the list you want to edit, and then type the name of the key you want to use for that button. Pretty simple.

I've also fixed a bug with importing a theme that caused so many menu icons to be created each time you did it that the project would exceed the clone limit and thus not display them properly if you did it multiple times.
oxiti8
Scratcher
1000+ posts

Wave Multi-Emulator Collaboration- Emulating CHIP-8, GBC, NES, NDS, Intel 8080, and more all in one Scratch Project. - V1.1.0 out now!

Wave V0.9 is now finally out! There's been work done on almost every aspect of Wave- remappable controls on several emulators, better clone management in the menus, more color options for themes (up to 256!), a new WIP emulator made for Wave called SI8080 for the 1978 Space Invaders arcade cabinet (currently early in development), too many WAVE-8 updates to list here, improved audio in DualGB, and new universal bitwise tables that generate only once upon initially starting the project rather than every time you start DualGB or Cool NES.

Go check it out!
  • Discussion Forums
  • » Advanced Topics
  • » Wave Multi-Emulator Collaboration- Emulating CHIP-8, GBC, NES, NDS, Intel 8080, and more all in one Scratch Project. - V1.1.0 out now! [RSS Feed]

Powered by DjangoBB