/r/EmuDev

Photograph via snooOG

Community of people building emulators.

Discord: https://discord.gg/dkmJAes

Rules

  • Follow Reddiquette
  • Try to keep all posts related to Emulation Development such as:

  • Emulators you've made
  • Cool Tricks/Resources
  • Questions
  • Blog Posts

Official Chat


DARK THEME

NORMAL THEME


For any questions/problems, please PM the moderator, /u/VeloCity666.

/r/EmuDev

22,643 Subscribers

4

python pc emulator help

idk if i should be posting abt this here but please help me i think i fucked up something

https://preview.redd.it/98avj1sjucyd1.png?width=805&format=png&auto=webp&s=47d0b577c8b963e8602a6ec8ec3cb65715c8fffb

its trying to boot windows nt 3.1 but it happens with any iso/img file if yall have any idea why this might happen let me know i can give code if requested thanks

15 Comments
2024/11/01
21:06 UTC

2

Emulate A PAK Firmware File - Reolink Home Hub

Hey there,

I was wondering if there is a way to emulate a PAK firmware file from r/reolink . This would be to emulate the home hub firmware: BASE_WUNNT6NA5 and I have used a tool called pakler to extract 5 files so far.

They consist of:

  • 00_loader.bin
  • 01_fdt.bin
  • 02_uboot.bin
  • 03_kernel.bin
  • 04_rootfs.bin
  • 05_app.bin

Tbh ChatGPT has and hasn't been much help, ive gotten to extracting what I believe are the key files, it is just now running it with Docker and QEMU. When trying to run it just first time with the command:

qemu-system-arm -M versatilepb -bios 02_uboot.bin -kernel 03_kernel.bin -dtb 01_fdt.bin -drive file=04_rootfs.bin,format=raw -append "console=ttyAMA0" -nographic

I get a audio driver error and again, I'm not sure what do to fix this, let alone make this work fully.

Any ideas and thoughts would be appreciated,

Thanks.

2 Comments
2024/11/01
20:17 UTC

16

Gameboy: Getting Started

Hello, So I did some research, and I want to get started on making my GameBoy emulator. My goal is to get something fast up on screen as fast as possible. I heard for this the bootrom should be easy, and it only uses around 40 of the opcodes.

  1. Is this the right approach of doing the bootrom first then Tetris and test roms?
  2. How would this work? What do I need to know in specific about some of the bootrom stuff (or the other options if you recommended that)
  3. Should be that I set up a simple MMU (im only planing to support MBC0 anyways) then CPU then PPU? What else would I have to make?

Thank you

8 Comments
2024/11/01
13:50 UTC

29

There is only one access to the memory location $0180 in nestest.log. How is it loading 33? I can't seem to figure out how 33 gets stored there.

2 Comments
2024/11/01
07:20 UTC

9

What is the explanation of this behaviour in nestest.log? Why does PLP set the empty flag?

2 Comments
2024/11/01
05:28 UTC

4

Help compiling an emulator on Xcode iOS Simulator SDK

Hi everyone! I’m not a programmer or developer by trade, but I do have a basic understanding of how it all works. That’s why I’ve decided to dive deeper into programming and development, focusing specifically on Apple platforms. Right now, I’m studying Objective-C and exploring Apple’s system structure, including the kernel, architecture, and other similar topics.

One area that really fascinates me is emulation, and I’m a big fan of what Apple has achieved with Rosetta. While browsing through some forums about cross-platform emulation, I came across this project, which immediately caught my attention: https://github.com/daeken/GrinningSoul

Basically, GrinningSoul enables arm64 iOS apps to run on the Xcode iOS/iPadOS Simulator (Intel version). Currently, on Apple Silicon Macs, you can run these apps either by swapping platforms in the app binary to run them in the Xcode ARM iOS Simulator or natively through the App Store/Sideloading, since both iOS and Apple Silicon Macs use arm64 they are compatible natively.

But, what’s intriguing about GrinningSoul is that it redirects the library calls required by arm64 apps to their x86 equivalents included in the x86 iOS Simulator. It also emulates the CPU using the Unicorn Engine framework (which is based on QEMU) or its own CPU emulator called Moonage: https://github.com/daeken/libmoonage

I’m looking for some help to build and test this project. Since it was created in late 2020, the developer used some tools that are now outdated, like LLVM 9, Boost, Clang and Python 2, so when I tried building it with latest version of the dependencies listed in the CMakeLists file, the build process failed.

So far, I’ve managed to build 3 out of the 5 executables and have made some adjustments, such as updating directory paths and tweaking certain Python scripts. However, I’m still not quite there—I'd say I’m about 70% of the way to getting the project fully functional. If anyone could take a look and share their thoughts, it would be greatly appreciated!

Thanks!

8 Comments
2024/10/31
00:02 UTC

51

My C# Chip-8 Emulator. There are many like it but this one is mine :)

This CHIP8 emulator is functional but not perfect.

Sound is implemented.

Most quirks are implemented.

Built in debugger and keypad feedback.

The main form defaults to running the chip8 test ROM linked below.
https://github.com/Skosulor/c8int/tree/master/test

It passes most other test ROMS but fails elements of others due
to the various implemetation quirks outlined at the link below.
https://games.gulrak.net/cadmium/chip8-opcode-table.html

...however mine plays/runs most standard CHP8 ROMS. 

https://preview.redd.it/tswk96t4xwxd1.jpg?width=1058&format=pjpg&auto=webp&s=d72e5b4127b0c0d3b8c2f68d77a9ba760bd66528

Edit: Migrated to .Net v8 -> https://github.com/Jim-Booth/Chip8Emu

32 Comments
2024/10/29
12:24 UTC

14

Starting to learn emulation

So, I'm just starting out with emulation and there are some things that bother me.

This question is not emulator specific, but I am also wanting some advice about emulator development.

I can understand the code and what it's doing to some extent, for example, code of 8080 Disassembler, but if I had to write it from scratch by myself I feel like I can't. I don't know how to feel about this. This has been a big hurdle for me for years in programming, where I might be understanding the code I'm writing following some guide, but I can't create anything but simple programs by myself. I guess it's also a bad habit, that I try to understand every piece of code I write instead of just using it for what I want done and this also makes me want to learn Assembly Language and learn Low-Level Languages and how it works and I kind of keep looping and never actually get to finish anything.

15 Comments
2024/10/29
10:55 UTC

34

bytepusher graphics lib test

2 Comments
2024/10/26
07:42 UTC

9

Gameboy: The PPU Question

Hello again, Ok so I'm still trying to wrap my head around the ticks and cycles and the two ways to do them (if have information on that, reply under that last post), but for now I have some question about the PPU.

  1. So I heard there is a few ways to go about making the PPU, I think I want to go about making the Scanline approach rather then FIFO approach since I'm not looking for accuracy, but something simple that would work. That all I pretty much know, but I actually don't know we can get the pixels to draw. Does anyone know how this works and how to go about this?

  2. Do we want to all our PPU logic essential in our "tick()" or something like that?

  3. I didn't ask this before, but how can we go about doing the DMA stuff? Is that part of MMU or PPU? What about the hardware registers?

Thank you for any help

5 Comments
2024/10/26
00:12 UTC

17

Gameboy: The Tick/Cycle Question

As the title suggested, I have a whole a lot of questions about Tick and Cycle. Context: Doing reaseach on how to go about make a DMG emulator, not looking for accuracy. This is kind of follow up to my previous question.

  1. I might make a whole a lot of people cringe, but what is exactly the difference of between tick and cycle?

  2. What is best to track M-cycle or T-cycle?

  3. The way I was thinking about tracking cycle was for each instruction just to return the number of cycle, but I got told that is not the best way. Instead I got suggested to "tick()" each part of instruction for read and write and internal. What is consensus on this?

  4. So, again, I am about to make the people cringe, but just in general I am confused about tracking ticks/cycles. What components have them? How do they work together? In general, I'm lost what tick() is supposed to do for all components of it even works like that. I need help with implementation ideas.

Thank you for keeping with me, and also thank you for the people on Discord trying to help me as well. And Thank you everyone on the last post that helped.

12 Comments
2024/10/25
01:08 UTC

4 Comments
2024/10/24
16:14 UTC

6

Gameboy: The Memory Question

Hello everyone,

As the title suggest, I have a whole a lot of questions on how to go about making the "MMU" or "Bus" as some may call it. I'm assuming this first thing I need so I can load up test roms and such. As for context, I haven't started development yet but I plan on using C#, planing no audio, support for noMBC/MBC0 for now, not trying to make it accurate, and I want to make sure I have the basics known.

  1. I heard memoary should not be a single array, rather multiple arrays. How many arrays would I really need?

  2. I also heard directly accessing our memoary array is not good, so I should read and write memoary methods. I want to know on why we do this? Also if I use muiltple arrays, only one read and write methods are needed, not pair for each right?

  3. Hardware registers, there in the memoary, how should they be handled? Should they be apart of my MMU object?

  4. The bootrom, is that located somewhere in memory? Do I even need it?

  5. Timing, do I need to do any sort of timing with memory? If I recall correctly, I just need to track number of cycles for CPU only so after a certain about my cycles then it can run the functions of the PPU I believe?

I know I just asked a lot of questions, and they may seem naive, but I am really trying to understand this the best I can, and any help is great.

Thank you

11 Comments
2024/10/22
23:44 UTC

18

Tiny CHIP-8 Emulator

I've just finished my CHIP-8 Emulator. Since this is my first time writing an emulator, i would really appreciate some feedback, especially on how to properly implement timers/CPU clocks. Also, is there any way to get the beeper working without having to deal with SDL's complicated audio interface?

15 Comments
2024/10/22
19:53 UTC

16

How is Chip-8's ROM structured?

The specs never list the ROM, I've read that it is generally smaller than the RAM, where does the program counter actually points to?

10 Comments
2024/10/20
20:48 UTC

15

Is there a standard way to code an emulator?

If I wanna have a full-adder, is it standard to just create a function that uses + or do people actually implement those kind of things in a way that represents the actual hardware (like in this case with multiple half-adders)?

8 Comments
2024/10/20
09:29 UTC

4

Need help building a bidirectional shift register?

Aim: To build a ping pong game, whith 8 LEDs and 2 push buttons. When the last LEDs light the push button signals the shift to the other direction.

Hi. I need some advice for my project, it needs a bidirectional shift register for 8 bits. The issue I'm facing is that some build need an 8 4x1 multiplexer which I dont have. Or using 16 and gates which I could try. Can someone please recommend me a method or resource to learn to try and find a method to solve it?

Was thinking of using 2 shift (74hct...) registers tho I'm not sure how to implement it. Or using 8x1 multiplexer into a 74hct695 shift register.

Also, I'm worried about the delays on the combination part and how that would affect the push button and clock. Could really use some advise on this as well.

Allowed components 74HCT574 - 8-bit 3-state D flip-flop 74HCT139 or 74HCT238 - 2-4 or 3-8 line decoder 74HCT151 - 8-input MUX 74HCT595 - 8-bit shift register

2 Comments
2024/10/20
03:54 UTC

23

Gameboy? Where to begin?

Hello, so I plan on making a GameBoy emulator. You guys probably get this question asked a lot, but I'm going to ask. I heard it's easier than NES, and I dabbled in CHIP-8 and Space Invaders. I just don't know where to get started, also how to even start off. It seems like something as loading in a ROM file could be hard compare to CHIP-8 or Space Invaders. Also I heard timing is important, and I never really done that before so I don't really know why I need that or how that works. I'm not looking to make a accurate emulator, just something that works. I also heard about MBC, I'm looking to start off with no MBC then do the others MBCs. Any advice or opinions or or resources or timeline you guys got in mind? I don't mind reading through a detailed post, thanks for any help in advance!

8 Comments
2024/10/19
01:47 UTC

10

Do I need to check the entire addressing mode of 6502 such as "abx" for page boundary crossed?

In my opinion, the "abx" addressing mode for all instructions has a chance to cross the page boundary and take a extra CPU cycle, but according to the opcode matrix, the first table shows some of them don't need to consider it, like "0x1E: ASL abx", why?

opcodes table

4 Comments
2024/10/16
17:50 UTC

8

Game Boy Color BIOS Question

I think I'm pretty much at the final stages of implementing color support for my Game Boy emulator. Everything appears to be working. Really all I need to do now is decide what I'm going to do when starting up a game in color mode. Currently I'm borrowing a custom color BIOS from an existing emulator as a temporary solution, but I don't want to keep it like that (because the logo that appears on the screen is obviously not from my own emulator).

I really wish I could just hard code the original BIOS into my emulator but for legal reasons obviously I can't. I know the chances of getting caught are astronomically low especially since very few people know about my emulator, but I'd rather not take that risk.

So, that leaves me with two options I suppose. I can just skip the color BIOS altogether, or I could customize my own BIOS.

For making a custom BIOS, I saw Boytacean (https://github.com/joamag/boytacean/tree/master/src/boot) forks the SameBoy BIOS implementation but tweaks it a bit and adds a different logo. Wasn't sure how complex it would be to head in this direction.

Skipping the BIOS would theoretically be easy, but I saw in Pan Docs that the color BIOS applies different color palettes depending on the loaded game (if I understood correctly?): https://gbdev.io/pandocs/Power\_Up\_Sequence.html#compatibility-palettes. So if I were to go down this route and try to skip the BIOS, I would not only need to update my emulator state to the state it would be after the BIOS would run, but also check what game is loaded and apply the correct palettes depending on the game?

How have you guys handled this in your own Game Boy Color emulators?

4 Comments
2024/10/16
01:17 UTC

11

C++ or Rust?

I'm a web developer, so I've mainly programmed in high-level languages like JS/TS, Python, and PHP. Although I've also had a brief exposure to C a few years ago when I was first learning programming by taking CS50.

Now I want to build emulators, starting with chip-8 and then the Game Boy. I know you could technically build emulators (especially simpler ones chip-8) in any language, but I want to expand my skill set by picking up a lower-level language. C++ and Rust seem like the best options.

From what I've gathered, the main selling point of Rust is that it has a thing called the borrow checker that enforces some standards on your code and eliminates a whole set of bugs that typically occur when dealing with memory management in C & C++.

C++, on the other hand, has long been the standard language for emulation development, which means there are probably much more resources available. It's also widely used in industry, so learning it could open up job opportunities.

I'm leaning towards C++, because of the amount of resources and libraries, but I'm open to be evangelized on the awesomeness of Rust!

I'm on Linux, if that changes anything.

Also, going from the chip-8 to the Game Boy seems like a pretty huge jump. Would building a chip-8 emulator give me most of the background knowledge necessary to build a Game Boy emulator, or are there additional stepping stones you can recommend?

36 Comments
2024/10/16
00:01 UTC

12

Emulator and Hardware project

Was wondering if anyone on here had tried to bring their emulator to their own hardware, to kind of recreate the console.

What i'm specifically thinking is a making a custom handheld, using perhaps a raspberry pi etc, incorporating a gameboy cart reader, and then linking it all up with my (to be written) GB/C emulator. From what i've seen on of the cart readers like joey jnr and GBxCart is that they dont really provide you live read/write, but rather will dump the rom, and then you can optionally write it back with the save data. So I dont think my approach would result in a handheld Gameboy knock off that would work as seemlessly as the original hardware, or an Analogue Pocket. [Edit: just to note this wasnt really a complaint, just an observation that it wouldnt really be functioning like the real hardware in terms of live read/write.]

But, there's something particularly exciting to me about the idea that I could put together (an incredibly inelegant) GB clone that works on my real carts.

I guess my question is, as I couldnt find any from a google, has any one here tried something similar even if for a different console? What was the experience like? any key takeaways from your experience?

19 Comments
2024/10/15
23:18 UTC

14

Begginer trying to program its first emulator

Hi, ive never programmed something similar and i would like to code my first (console) emulator, ive heard that nes emulators are easy to code, but i dont know where to start, is there any guide or resources i could use?

Note: I know python and c++

16 Comments
2024/10/14
14:22 UTC

29

Trying to extract compilation-related data from a PS2 ELF

8 Comments
2024/10/13
02:30 UTC

4

Game Boy Advance Link Cable Debugging

Is there a GBA emulator that lets me view input / output serial link cable bytes for debugging purposes? Im looking for a feature similar to how it works in BGB for gameboys.

0 Comments
2024/10/12
20:11 UTC

17

How does your emulation project look in your resume

Does it help you get hired more? I'm currently looking for a project that is fun to do and will benefit me in my job search. I can see emulation being super fun, especiallg on consoles that i play, but just wondering how has it helped you in your job search

15 Comments
2024/10/12
17:52 UTC

7

NES or GameBoy? (Best for beginners)

If you worked with both or one of NES or GameBoy, which one would you recommend? My goal is just to get a game running on screen in the shortest amount of time. (I don't care for accurate PPUs or timing or audio) Please vote, and then leave a reply on why. I want to this to be a reference for myself but also for other beginners. Thank you!

View Poll

9 Comments
2024/10/11
19:09 UTC

7

Test instructions from web gameboy emulation

I'm in the early stages of developing my gameboy emulator and I was wondering if any tools exist for testing specific instructions and verifying that proper flags and values are set? Maybe some website that contains the instructions and you can modify contents of registers for each operation? Thanks!

5 Comments
2024/10/11
14:03 UTC

Back To Top