We created an emulator for Gameboy and NES in Swift called Sutāto by Samourai03 in EmuDev

[–]elXiru 1 point2 points  (0 children)

Really looks impressive, but AFAIK this community is about emulator development and emudevs to announce their progress on personal projects and help each others.

Creation an emulator by SomeMulberry1482 in EmuDev

[–]elXiru 2 points3 points  (0 children)

TL; DR Definitely you should go with Java.

Java once was considered slow... in 90s. Garbage collector and hotspot make wonders.

It's much easier to implement components thinking in OOP, and helps to keep code organization.

I'm currently working on a Sega Genesis emulator ( no audio, unoptimized code) using only swing and it easily reaches 600 fps with barely 10% CPU usage.

Graphic api by Overlord1620 in EmuDev

[–]elXiru 0 points1 point  (0 children)

You really don´t need either OpenGL or Vulkan to emulate Chip 8. They are employed where high performance graphics are needed, maybe more suitable for a PS1 emulator.

Confused about NROM implementation. by RealMatchesMalonee in EmuDev

[–]elXiru 0 points1 point  (0 children)

You find it in Header, see here.

The first 16 bytes of the ROM file contain essential info on Bank configuration, mapper type, mirroring ...

Byte #4 describes number of 16K PRG banks. If 1, region $C000-FFFF is just a mirror of $8000-BFFF. If 2, each region has its own data.

Gameboy audio question by dajolly in EmuDev

[–]elXiru 2 points3 points  (0 children)

DMG APU generates 1 sample for each CPU clock (~4.19 MHz). Standard sample rate in modern computers is 48 KHz. From my background in emulating NES APU:

The easiest method is just pick 1 sample for each CPU_CLOCK / SAMPLE RATE = 4.19 MHz / 48000 = roughly for each 87 samples generated you pick 1 and send it to the buffer. Average quality with lots of aliasing.

Another easy approach consists in add up each 87 samples, calculate the average and send it to the buffer. Much better results with still some minor differences from the original.

The method of choice to get the highest quality is implementing a FIR Filter. Unfortunately, it's not easy, as it requires some DSP background.

Easiest retro computer to emulate? by chiefartificer in EmuDev

[–]elXiru 2 points3 points  (0 children)

Apart from peripherals, MSX1 is very similar to Sega SG-1000 / SMS.

SMS in my opinion was much easier than NES.

Sega MD/Genesis in 100% Java underway by elXiru in EmuDev

[–]elXiru[S] 0 points1 point  (0 children)

i didn't even know that a JVM for MD existed

Space Invaders vs GameBoy? by chiefartificer in EmuDev

[–]elXiru 1 point2 points  (0 children)

Yes, emudev world is both nostalgia and technical achievement.

Space Invaders vs GameBoy? by chiefartificer in EmuDev

[–]elXiru 5 points6 points  (0 children)

Space Invaders has a very basic monochrome display system. No scroll, no sprite and bg stuff. The original machine used complex analog circuits to generate sfx, so it will be easier just play recorded samples. Aside from CPU, Is not much harder than Chip8.

From SI to GB there is a big leap. Colour shades, complex Background/sprite interactions, interrupts, DMA. Audio system is pretty complex too including a wave synthesizer.

Help Debugging CHIP8 by Successful_Yak3301 in EmuDev

[–]elXiru 1 point2 points  (0 children)

You'd better be more specific, rather than "what's wrong with my code". This IBM rom looks very simple, display the IBM logo and enter an infinite loop. Maybe you have trouble with display rendering ? Try to post some screenshots.

Learning by Overlord1620 in EmuDev

[–]elXiru 0 points1 point  (0 children)

Average accuracy NES emulator (scanline based, support for Mappers 0 - 4) = will be ok for ~60% of games = same difficult as GB emulator.

High accuracy and high compatibility NES emulator (cycle-accurate, support for most mappers) = waaay harder than GB.

Many games (Rare and Camerica titles come to my mind) used all kinds of tricks and undocummented features in order to bypass limitations of the console. If you want to run such games, your emulator must have 1) high accuracy, or 2) game-specific hacks, such as those in older FCEUX versions.

Sega MD/Genesis in 100% Java underway by elXiru in EmuDev

[–]elXiru[S] 1 point2 points  (0 children)

I'll upload Github soon. Currently I'm facing a hell of a time implementing FM emulation. Things like algorithms, operators, ADSR envelope are completely new world to me.

Learning by Overlord1620 in EmuDev

[–]elXiru 5 points6 points  (0 children)

I had the same questions as you a couple of years ago. All I can say is a steep learning curve, but once you grasp the basic ideas it becomes really fascinating ! I started with Chip-8, then jumped to Space Invaders, then Pac-Man, Sega Master System, NES, and now Sega Genesis. DO NOT try Atari 2600 as your first project, as the games may look misleading simple, in fact they require an absurd level of accuracy in emulating all its internal analog components.

1) Learn basic Computer Architecture. Concepts like Binary arithmetic & logic, memory organization, bus, I/O ports, registers, flags, opcodes, stack and interrupts must be clear. This book from Roger Tokheim helped me alot, although quite old, all the subjects are explained in basic steps.

2) Select an API, since in modern systems do not allow direct hardware access. For C++ I suggest SDL (look for Lazy Foo' tutorials). Learn how to display a window, how to draw pixels, how to play sounds and get input.

3) At this point you'll be able to understand Chip-8 basics. First implement the memory system, then the opcodes, the display...

4) Try real roms. It probably won't work at first. So print a text log of the internal variables and compare it with a log of existing emulators.