Discuss Scratch
- oxiti8
- Scratcher
1000+ posts
Cool NES emulator
Awesome! Didn't expect you to actually add mapper 90 but I guess this means you can technically now play super mario world in scratch!
- Kouzeru
- Scratcher
22 posts
Cool NES emulator
Those are lovely!
Would you plan for C64? The CPU is mostly identical with NES
Would you plan for C64? The CPU is mostly identical with NES
Last edited by Kouzeru (Jan. 6, 2022 21:50:21)
- Ultimate-XP
- Scratcher
6 posts
Cool NES emulator
late new year, everyone!Happy
Introducing: Cool NES 2.4!
First, here's some new mappers:
- Mapper 206: This is the simple predecessor of the MMC3, which only supports bankswitching. The chip has lots of different names like Tengen MIMIC-1, Namcot 118 etc.
And yes, 4-screen mirroring is supported now, so you can play Gauntlet- Mapper 90: Known as the J.Y. ASIC, this chip is popular among pirates and bootleggers alike!
Note that it's probably only gonna work with Super Mario World, since that's the only game I tested- Mapper 69: Known as the FME-7 (or 5A/5B) this one was used for a handful of games in Japan (plus Batman in the US), but it's also the mapper used for one of my favorite games (Gimmick!) so of course I had to add it!
Speaking of gimmicks, the expansion audio is supported too, so the soundtrack won't be missing any channels!
That's it for the mappers, now here's some other cool stuff:
- CHR bankswitching has been revamped, now it's faster and more accurate! The code behind the banking has been revised too, to (try) and reduce all of the duplicated blocks.
Also, ROM in the WRAM region works now (otherwise Gimmick would be broken! )- As mentioned earlier, 4-screen mirroring is supported now, so enjoy playing the three games that uses it
- CPU cycle-based IRQ's work now, this should be useful for other mappers in the future (like Konami's VRC series)
- Speaking of, the MMC3's scanline IRQ is a lot better now. Still not perfect, but more games work now!
(after looking at the old code, im shocked that smb3 even worked in the first place…)- The APU's length counter has been fixed. Long story short, I got the genius idea to add 1 to all of the length counter values… don't ask how.
- The DMC sort of works now! Right now it's kinda useless, since it requires you to rip every sample a game uses… but if anyone's interested, I could post some instructions
- Fester's Quest no longer has silent square channels. I failed to notice a tiny paragraph at the bottom of a NESdev wiki page regarding the sweep units… oops
- APU channel volumes have been changed a bit. I'm no expert at audio mixing, but it should be a bit more accurate now.
- Now the emulator warns you if you try to load a UNIF-based ROM file. Should make the errors a bit less confusing now
That's it for the new features! (hopefully i didnt forget anything…)
I've still got plenty of mappers to add, like the VRC's, Color Dreams, and MMC5…
Though, the MMC5 will be a really big pain, because of how complicated it is. But it might work for games that don't take advantage of all its features, like Castlevania 3. We'll have to see
At the same time, I'm wondering if there's any point in adding mappers besides Nintendo's MMC chips, since most were only used for a handful of games, or really obscure games… Adding every mapper out there would result in loads of extra code. What do you guys think?
In other news, I'm gonna be releasing a NSF player version soon, keep an eye out for that!
I've also tried making an emulator for the Atari 2600, but as it turns out, that system is WAAAAAY more complicated than you'd think… so it probably won't go anywhere. Maybe I should try another system…
I've also built up a collection of idle skipping codes now. Not sure where to post them though… maybe I should just make another post in this thread?
That's all, see you later!
It would be cool to see a emulator of the SNES or the GBA (though their impossible for scratch probley) I suggest the Sega Master System though, It's somewhat easy to learn
- oxiti8
- Scratcher
1000+ posts
Cool NES emulator
GBA is possible. Maybe not at full speed, but it's possible. ARM is a lot more grueling to implement than the 6502 of the NES, and it would never run full speed .snip
It would be cool to see a emulator of the SNES or the GBA (though their impossible for scratch probley) I suggest the Sega Master System though, It's somewhat easy to learn
SNES…might be possible? Would still be as hard if not harder than GBA for different reasons and SNES emulators are infamous for being slow on underpowered hardware- I don't think this one would be worth it given just how slow it would be…
Sega Master System is definitely possible. Hardest part from what I hear is just the grind of emulating its full blown Z80 CPU.
- GenericHeroGuy
- Scratcher
19 posts
Cool NES emulator
Welp, it's been 2 weeks and still no NSF version… guess I shouldn't be making any promises
I've been meaning to release it for a while now, but I keep having problems with the timing… either it runs too fast or it's too slow. I'm probably just missing something, it's always a dumb mistake which breaks everything. That's how it usually goes
I haven't even started working on the GUI yet!
And on top of that, I just installed a new OS on my laptop, replacing my old OS which has been discontinued for half a year now! So it's gonna take a while before I can use TurboWarp again… and don't worry, the project files are safe on my encrypted external hard drive
I also think the NSF player version could be useful for more than just music. Since it's been stripped down to just the CPU and APU, it could be a nice testing ground for CPU/APU changes, since there's much less code to work with. Maybe others could experiment with the CPU code?
Anyways, that's all for this short status update. See you later!
(If anyone's wondering, the OS I installed is called Arch Linux)
I've been meaning to release it for a while now, but I keep having problems with the timing… either it runs too fast or it's too slow. I'm probably just missing something, it's always a dumb mistake which breaks everything. That's how it usually goes
I haven't even started working on the GUI yet!
And on top of that, I just installed a new OS on my laptop, replacing my old OS which has been discontinued for half a year now! So it's gonna take a while before I can use TurboWarp again… and don't worry, the project files are safe on my encrypted external hard drive
I also think the NSF player version could be useful for more than just music. Since it's been stripped down to just the CPU and APU, it could be a nice testing ground for CPU/APU changes, since there's much less code to work with. Maybe others could experiment with the CPU code?
Anyways, that's all for this short status update. See you later!
(If anyone's wondering, the OS I installed is called Arch Linux)
- kccuber
- Scratcher
1000+ posts
Cool NES emulator
And on top of that, I just installed a new OS on my laptop, replacing my old OS which has been discontinued for half a year now! So it's gonna take a while before I can use TurboWarp again… and don't worry, the project files are safe on my encrypted external hard drive
(If anyone's wondering, the OS I installed is called Arch Linux)Install “turbowarp-desktop-bin” package from the AUR
pacman -S --needed git base-devel
git clone https://aur.archlinux.org/yay-bin.git
cd yay-bin
makepkg -si
yay -S turbowarp-desktop-bin
- GenericHeroGuy
- Scratcher
19 posts
Cool NES emulator
Welp, I still can't figure out why the NSF player isn't syncing properly… so instead of keeping everyone waiting, I'll just upload what I have so far:
https://turbowarp.org/635973623
It has some cool stuff like DMC samples and expansion audio, pretty awesome for a Scratch project eh?
I tried restoring just a little bit of PPU code and using that to sync the emulator… but that seemingly didn't help at all.
Now I'm starting to wonder if something's wrong with the timing of the IRQ that triggers the audio player code… I haven't bothered checking that yet. Hopefully that should help me get rid of this problem once and for all!
(I can't believe I just got that idea now…)
https://turbowarp.org/635973623
It has some cool stuff like DMC samples and expansion audio, pretty awesome for a Scratch project eh?
I tried restoring just a little bit of PPU code and using that to sync the emulator… but that seemingly didn't help at all.
Now I'm starting to wonder if something's wrong with the timing of the IRQ that triggers the audio player code… I haven't bothered checking that yet. Hopefully that should help me get rid of this problem once and for all!
(I can't believe I just got that idea now…)
- The_Mad_Punter
- Scratcher
100+ posts
Cool NES emulator
Can you make an NES dev kit? Im sick of balloon man
my github is github.com/familycomicsstudios
stop [hammer time v]
Sticky: TMP Programming Language by The_Mad_Punter (New Posts)
Sticky: Scratch Extensions - Math, Utilities by The_Mad_Punter (New Posts)
But then I had a very good idea. I used F5. See, using F5 gave me a whole new perspective and I was able to see a chest I couldn't have seen before.
- elgooGmirror
- Scratcher
26 posts
Cool NES emulator
This IS super cool! It's kina slow, but by Scratch standards, this is awesome! Keep up the great work!
say [Wow! This is awesome!] for (2) secs
- oxiti8
- Scratcher
1000+ posts
Cool NES emulator
I've decided to take a shot at porting Cool NES V2.4 to Wave V0.8 myself.
After an hour or so of fiddling, (Updating the importer for the new mappers took a bit) I've gotten it working! Was about to ask if there was anything I was missing with audio as it wasn't working but then i realized i forgot to set the “Enable APU” Flag.
Still doesnt work due to some local variable nonsense scratch has
Turns out it actually didnt work because Cool NES 2.4 never actually creates blank entries in the APU list for the replace commands to use…
After an hour or so of fiddling, (Updating the importer for the new mappers took a bit) I've gotten it working! Was about to ask if there was anything I was missing with audio as it wasn't working but then i realized i forgot to set the “Enable APU” Flag.
Still doesnt work due to some local variable nonsense scratch has
Turns out it actually didnt work because Cool NES 2.4 never actually creates blank entries in the APU list for the replace commands to use…
Last edited by oxiti8 (April 5, 2022 20:49:02)
- elgooGmirror
- Scratcher
26 posts
Cool NES emulator
You've inspired me to try to make emulators of my own!
- -EMULATOREN-
- Scratcher
5 posts
Cool NES emulator
According to @SpinningCube, your renderer isn't optimized at all. I think optimization of the renderer will be more than enough to speed up the emulation. It's gonna be really difficult to make it run at full speed, while still maintaning accuracy. Not sure if it'll ever go faster
There's a few improvements I can think of that might speed it up a bit, but I wonder if it will be enough?
- EBWW
- Scratcher
46 posts
Cool NES emulator
The DMC sort of works now! Right now it's kinda useless, since it requires you to rip every sample a game uses… but if anyone's interested, I could post some instructions
Maybe you could use Fourier transform to emulate the samples using only sine waves!
Look it up.
Hello. I'm EBWW! I make games, animations, and help the community! I'm an absolute Kirby fanatic, if you couldn't tell.
- EBWW
- Scratcher
46 posts
Cool NES emulator
This seems amazing, but where can I find other games to load?
I can't tell you where exactly on the interntet because downloading games…. that would be piracy (unless you once owned the game). Get a legal ROM and dump it. (but you can get it off the internet if you once owned the game…. or not idk.)
Hello. I'm EBWW! I make games, animations, and help the community! I'm an absolute Kirby fanatic, if you couldn't tell.
- EBWW
- Scratcher
46 posts
Cool NES emulator
According to @SpinningCube, your renderer isn't optimized at all. I think optimization of the renderer will be more than enough to speed up the emulation. It's gonna be really difficult to make it run at full speed, while still maintaning accuracy. Not sure if it'll ever go faster
There's a few improvements I can think of that might speed it up a bit, but I wonder if it will be enough?
Setup: 13-Inch 2020 M1 MacBook Pro, Safari Version 16.5.1 (18615.2.9.11.7)
Actually, I think it's the Audio Processing Unit, because when I turn it off it runs full speed, no frameskip when I have 250 FPS and Turbo Mode on.
The APU makes it slow to a crawl.
Hello. I'm EBWW! I make games, animations, and help the community! I'm an absolute Kirby fanatic, if you couldn't tell.
- elgooGmirror
- Scratcher
26 posts
Cool NES emulator
Yeah I thought of the Fourier transform as well. I'm using it for my Schism Snes Emulator.The DMC sort of works now! Right now it's kinda useless, since it requires you to rip every sample a game uses… but if anyone's interested, I could post some instructions
Maybe you could use Fourier transform to emulate the samples using only sine waves!
Look it up.
- EBWW
- Scratcher
46 posts
Cool NES emulator
Yeah I thought of the Fourier transform as well. I'm using it for my Schism Snes Emulator.The DMC sort of works now! Right now it's kinda useless, since it requires you to rip every sample a game uses… but if anyone's interested, I could post some instructions
Maybe you could use Fourier transform to emulate the samples using only sine waves!
Look it up.
According to this very thread, SNES will be painfully hard to emulate.
Edit: Start with SEGA Master System
Last edited by EBWW (Aug. 16, 2023 14:03:55)
Hello. I'm EBWW! I make games, animations, and help the community! I'm an absolute Kirby fanatic, if you couldn't tell.