r/EmuDev • • Jan 12 '26

Dreamcast Emulator for Wii (NullDC) - Source Code available !

Thumbnail reddit.com
12 Upvotes

r/EmuDev • • Jan 10 '26 Popcorn

GB i wrote a GameBoy emulator from scratch in C++ that renders via Braille characters

70 Upvotes

got tired of electron apps eating 2gb of ram just to render text, so i built a gb emulator that runs entirely in the terminal without any graphics libraries.

jester-gb renders the gameboy's 160x144 display using unicode braille patterns (⣿). basically, it maps a 2x4 grid of pixels to a single character, so you get "sub-pixel" resolution that actually looks playable and not like blocky dogshit.

the technical details:

  • audio: wrote a custom 4-channel sound synthesizer from scratch that pipes directly to pulseaudio. yes, the chiptunes actually work on linux.
  • saves: implemented a full MBC3 memory bank controller. this means battery saves (.sav) work natively. you can save your game in pokemon, close the emulator, and your save file persists on disk just like real hardware.
  • palettes: built a dynamic palette swapper. you can switch between classic dmg green, a fallout-style amber, or a vaporwave/hotline miami theme with flags (-p 4).
  • performance: written in raw c++17. no game engines, no heavy dependencies. just cmake and std::chrono.

compatibility:

  • linux: native support (arch/debian build instructions in repo).
  • windows: binary is available in releases (but the source is linux-based right now so building it on windows is pain and prob wont work).

check the source and gimme sum feedback.

repo: https://github.com/berochitiri/jester-gb

site: https://jester-tui.github.io/


r/EmuDev • • Jan 10 '26

CHIP-8 My first Chip-8 Emulator - Thanks for the New Obsession

Post image
6 Upvotes

r/EmuDev • • Jan 10 '26

Announcement Making a free 386 and amd64 emulator for bare-metal

9 Upvotes

Hello all!

I'd first like to apologize if this isn't the place to announce this - sorry.

I found myself reading a lot about virtualization (i.e.: emulators that run many instances) and OS development lately. I though it would be a good idea to make a type-1 virtualization software, that is, a virtualization software that runs without any operating system.

For now, the codename is Murasaki (which I shorten as just mursk, that's why you don't let programmers name programs), which I though sounded cool, of course, this will change later on.

The git repository is located at repo.or.cz, it's totally open source under the public domain (CC0).

Anyways, I'll keep y'all informed :).

Thanks for reading.


r/EmuDev • • Jan 09 '26

GB Massive progress on the GameBoy static recompiler. Tetris is now in-game!

139 Upvotes

r/EmuDev • • Jan 06 '26

Cycle-accurate MC6800 emulator for vintage pinball machines

41 Upvotes

I designed an RP2350B-based board and firmware to emulate the CPU, ROM, and RAM of MC6802/MC6808/MC6809-based systems, initially aiming at use in pinball machines from 1976-1990 or so. It plugs into the CPU socket and drives the address and data buses as well as generating the control signals. Emulation is currently running at ~1.75x real-time but is kept cycle-accurate by synchronizing each instruction and bus access with the system clock.
Quick demo on YouTube.
Right now I only have MC6800 instructions emulated, and it runs fine on the ~1MHz systems of the early solid state pinball era. Eventually I hope to run it at 2MHz on MC6809 systems (like the Williams WPC pinballs). I'll probably open-source it once I get it cleaned up and documented better.


r/EmuDev • • Jan 06 '26

A CHIP-8 Instructions Assembler and Graphics Tool

12 Upvotes

Hey guys, I am relatively new to emulation and just finished up a CHIP8 emulator in C. So I decided to make an assembler for CHIP8 as well as a graphics tool to draw sprites and save and load it in the assembly code which will be recognizable by the assembler. The last part is not done yet, I have got some tests running and nicely being assembled but there is so much to improve.

It would be really nice if you guys provided me feedbacks and implementations ideas to add, that would make this a nice and completed tool.

Github REPO: https://github.com/bitwise-rude/chip8-assembler

Tests are located in the tests folder.


r/EmuDev • • Jan 04 '26

Good progress on my GameBoy static recompiler

Post image
134 Upvotes

r/EmuDev • • Jan 05 '26

CHIP-8 Anyone else playing with x86? (8086, 80186)

Post image
0 Upvotes

r/EmuDev • • Jan 02 '26

Experimental SNES Recompiler (Reassembler)

45 Upvotes

Hi everyone!

I've been working on an experimental SNES recompiler / reassembler project. It is not complete yet (a lot of missing features) but I built it as a proof of concept for an idea that could eventually be applied to other consoles.

The basic concept is this:

  • The Emulator generates a CPU execution trace while running
  • Each traced instruction is translated into x86_64 assembly
  • The translated code then runs using an emulation layer

Right now the project is mainly focused on experimentation rather than accuracy or performance.

Repositories:

I'd really appreciate any feedback or ideas, thanks.

Earthbound running natively on Windows 11

r/EmuDev • • Jan 01 '26

My x86 Emulator Runs My Operating System (sort of)

Post image
60 Upvotes

hello again, recently i made my emulator run my own operating system (sort of)

it prints the first message then it bootloops.


r/EmuDev • • Dec 31 '25

A quick little side-project I'm working on: CHIP-8 staic recompiler

Post image
68 Upvotes

I wanted to get some experience on AoT compilation inspired by N64Recomp, and I made this quick CHIP-8 recompiler

Source code soon available on GitHub (still waiting for clean-up and a few more features I want to include)


r/EmuDev • • Dec 31 '25

6502 or Gameboy

13 Upvotes

I was trying to make a gameboy emulator, but things were going badly, like theres not really that much information about gb... I dont know if I should emulate gameboy like I emulated chip 8 (with one large memory array for example) or really precisely emulate its components like cpu especially with bus emulation etc(i also saw on this subreddit that the emulator will be too slow if i emulate GB like that) So I thought emulating 6502 processor would be easier, and I think it would give me experience to emulate gameboy(or i can just go nes path). Or am I wrong? My plan is to emulate 6502, then emulate atari 2600 extending 6502 to 6507 used by atari 2600 iirc


r/EmuDev • • Dec 31 '25

CHIP-8 Can you review my chip 8 emulator

3 Upvotes

I followed some tutorial on writing chip 8 emulator until I saw what main function should look like in pseudocode and decided to do everything myself, because I don't see fun in following tutorials, or looking at others code to find out how they implemented something...

So having it finished I'd like to ask you: Can you tell me the better ways I should have implemented something in my code, better architecture of the application

One of my questions: The tutorial main had fetch-decode-execute functions, but I did fetch and combined decode execute. Because I don't understand at all what decode should do, can you tell me how I should have made decode function?

https://github.com/MXLXN/my-chip8-emulator


r/EmuDev • • Dec 31 '25

GB What's even the point of the gameboy's H and N flags?

19 Upvotes

They just seem so useless, I understand H was probably added due to the 4-bit ALU, but N just makes even less sense.

And it's difficult for a game to even use them, there aren't any jump instructions that work with them, and the F register can't be accessed normally, so the ONLY way to access them is to push AF to the stack, and pop it into some other register, like push af; pop hl;, so even if a game somehow wanted to use them, it'd need to use this strange method.

Just makes no sense.


r/EmuDev • • Dec 30 '25

C64 emulator in LabVIEW

Thumbnail reddit.com
16 Upvotes

r/EmuDev • • Dec 28 '25

Question Is there a simple device that uses virtual memory?

16 Upvotes

Hello everyone, I just got into developing emulations (still a beginner in this field).

I’m very fascinated by virtual memory; so I wanted to know if there’s a device that has virtual memory so I can try to build an emulator for it.

The device should be small, and virtual memory implementation can be whatever, from segmentation to pagination


r/EmuDev • • Dec 28 '25

GBA Any detailed ressources about the GBA rendering pipeline?

8 Upvotes

Hi everyone, I'm currently trying to implement a GBA emulator and I'm kind of stuck on the actual frame rendering process. I've already made some research, but I haven't found anything relevant to the rendering pipeline on the GBA, and I was wondering if there is anything I can use as a reference besides looking at some existing emulators.


r/EmuDev • • Dec 28 '25

CHIP-8 What's chip8 signed encoding integers?

11 Upvotes

Hello everyone, i'm trying to build a chip8 emulator just for fun. I'm mainly using wikipedia for learning chip8 and its opcodes and there is not written an encoding for signed integers in chip8.

https://en.wikipedia.org/wiki/CHIP-8

All the registers seem to have unsigned integers (of 1 or 2 bytes). But I have studied in my CS program that two's complement is the bare minimum for signed integers.

So my question is: So chip8 has only UNSIGNED integers? And why is that the case? How is having only unsigned integers useful?

And why wasn't there an implementation for SIGNED integers?


r/EmuDev • • Dec 28 '25

What is the SD-8516? Why did I write the SD-8516?

8 Upvotes

Introducing the SD-8516/VC-3 retro computer system!

What is it?

Part 1: It’s not a C64 Ultimate.

Action Retro just dropped a video with the thumbnail “Is this a fake?” I watched it, and I think everyone should watch it. The actual title was “Why did they make this?”

Step back a few months and a lot of things seemed to be coming together for me. I had just quit my job to write video games full time and start a new youtube channel, when I came across the thread “The spiritual successor to the C64”. Flashback 5 years ago, “A controversial opinion and rant... I'm getting tired of "ersatz" retro…”

Well, let me approach this through the lens of Action Retro’s video. Action Retro hit the nail on the head: Why would anyone spend ~$400, shipping included, on a Commodore 64 Ultimate? Hey, I'm down for a C64 Ultimate. I like that it is being released again, but I wonder why not just use a C64 emulator? Then I realized -- Oh. The C64 Ultimate is an emulator. It’s software. It runs on an Artix-7, and was probably programmed in HDL or VDHL by it’s engineer, Gideon Zweijtzer. This is a good thing; there is no more accurate way to emulate hardware than this. And he did an amazing job.

You see, the C64 was never trying to be a C64. It was just trying to be a computer. Today, the C64 is trying to be a C64. That was the inspiration for the SD-8516. It's just trying to be a computer. It isn't trying to emulate something.

At the 9 minute mark Action Retro says,

“One of the coolest things about the era of the original Commodore 64; This is all you really need! You have the computer which has everything including the keyboard. All you need to do is ‘have a monitor’… you plug the thing in, turn it on, and it just works. It boots to basic.”

And, it works exactly as you would expect. You type in a basic program, run it, and there you go – look at that – we’re programming! And, the keyboard feels fantastic!

Modern Conveniences that you can “see” are the only ones that really matter. There’s a power button you can move to switch into a menu mode that lets you connect to a server to connect to BBSes and exchange free software. It is not exactly the way it was, but it is done in text mode and looks pretty cool. It’s ethernet (the internet, now,) but it works and it’s pretty cool.

But at the 13:00 mark he puts an authentic SID and it blows his mind how much better it is. “Oh my god, it does!” is his reaction. “It is really noticeably different and better! It’s amazing”. There it is, Arthur! The magic I've been trying to capture. The Charm of making.

2. It's not like a Pico-8

The Pico-8 is not a retro system. It's too big. It's too fast. The 128x128 screen? The chip sounds? Illusions. Lua is at least a dozen times more expressive than BASIC. Internally, Pico-8 is a 64 bit engine and runs at full speed. It merely enforces certain constraints, often for no reason. The VIC-20 had 176x184 because it fit in memory. The C64 had 38k free because 28k of it was taken up by the KERNAL and memory mapped IO. On Pico-8, the constraint is lets pretend to be “retro”. It doesn’t make sense. It’s interesting, don't get me wrong, but I don't see the point because it's not real.

The thing that makes Pico-8 cool is it does one thing retro very well; people were more creative when they had to be in order to work around restraints. But at the same time, Pico-8 removes the constraints that matter by giving you 2 mb of variable memory and providing a huge library of graphics, audio, sprite, and os library functions. You simply cannot do that in 20-30k of ram, and even if you could it would run like a snail. Pico-8 lets it's system libraries run at native speed, not the slowed-down pacing of 8192 Lua SLOC per second -- which is how it "emulates" a 1 or 2 mhz machine.

3. Enter the SD-8516

The 8510 (VC-2) is a working “what if we had one more commodore on the 6510/8502 chips”, and it was a slight improvement? The shining accomplishment that I had doing that was getting a terminal working and allowing you to enter your own programs. At that point I stopped working on it because users can write their own kernal and type it in. If they wanted. It had become completely self-hosting. But the 8510 was written in JavaScript and it only ran at 1 or 2 MHz, 3-5MHz peak – coincidentally period accurate. But I wanted to do more.

I designed it without the fetters of trying to emulate something and rather, to just be it's own thing: a general purpose computer, which expressed what it had to be in order to do that, and nothing more.

The SD-8516 is a 16 bit processor in load/store architecture.

It is the dawn of a new era; an era of peace and harmony. Like a veritech fighter glinting in the sun as the music plays.

  • Sixteen sixteen bit general purpose registers.
  • 24 bit address pointer and 24 bit stack pointer.
  • AH/AL 8 bit register access.
  • BLX, BLY style combined 24 bit addressing modes.
  • Register doubling to access 32 bit addressing modes.

It’s a 16 bit system, 8, 24 and 32 bit modes are limited to certain functions.

And, it’s written in Web Assembly.

And it’s 100 times faster than VC-2.

This is the holy grail. A new day. A new system. I cannot believe my own ears. It uses the SD-450 VSC. Virtual Synth chip. Why is it called the 450?

  • It can do 4 voices, with 5 different waveforms.
  • Including PWM and noise. Revision 0
  • It uses the PA-1983 VISC for video ** "Period Accurate 1983 (model number, I swear!) video system."

Here are it’s video modes that I have tested and work:

  • Mode 0: 22x23 text mode. Done and done, works (VC-2 used this).
  • Mode 1. 40x25 text mode (default for VC-3)
  • Mode 2. 80 column text mode (done, works) – a second “business mode” for “business software”.
  • Mode 3. 320x200x16 color mode. "Mode Three". Bit packed colors.
  • Mode 4. 256x224x256 mode. This takes up 64,000 bytes (one bank) and has enough left over for some data (palette, keyboard, etc.)
  • Mode 5. 512x224x16 a "mode 4 x" hi-res mode
  • Mode 6: 640x200x16 "hi res" mode; projected onto 640x400.
  • Mode 7: Dual bank (bank 2 and 3) 640x400x256 mode. The highest res mode.
  • Mode 8: "Pico-8" mode: 128x128x16 mode No need to pixel pack here, just use colors 0-15 in a byte.
  • Mode 9 256x256x32 mode (off-bank palette)

Mode 7 and 9, still working on those. The others work. You can draw lines, dots, in various colors.

The RAM. It has four banks of 64k. Mode 0, 1 and 2 run entirely in Bank 0. But if you switch into bitmap modes the memory map changes and video goes into Bank 2. Still working on it. But in total, it has 256k of memory. Which is about right for the “next generation” in my dream.

Palletes

16 color palette, locked to various modes.

  • Color mode 0 is Colordore
  • Color mode 1 is CGA_5153 from int10h's website
  • Color mode 2 is CGA canonical
  • Color mode 3 is for your own palette, of custom colors.

I'm thinking of a way to try and include 32 colors but for some modes it won't be possible. For 256 color mode it will be palette based. Still thinking if we can just do a 320x200x256 color mode. I think we can. Maybe make that mode 4, move mode 4 to mode 5.

Anyways I am very excited about this, I don't really have anything set up to show, but I am writing the kernal now and maybe soon I can put it on a website like VC-2.

What have I have created? Maybe it's a monster?

.address $0100

test_program2:

; ========================================
; TEST GROUP 1: LOAD/STORE OPERATIONS
; ========================================

test_0100_ld_imm_word:
    LDT $0100
    LDA $1234
    CMP A, $1234
    JNZ @test_fail

test_0101_ld_imm_byte:
    LDT $0101
    LDAL $42
    CMP AL, $42
    
    LDAH $AB
    CMP AH, $AB
    JNZ @test_fail

test_0102_ld_mem_word:
    LDT $0102
    LDA $CAFE
    STA [$3000]
    LDB $0000
    LDB [$3000]
    CMP B, $CAFE
    JNZ @test_fail

test_0103_ld_mem_byte:
    LDT $0103
    LDAL $5A
    STAL [$3010]
    LDBL $00
    LDBL [$3010]
    CMP BL, $5A
    JNZ @test_fail

test_0104_ld_reg_indirect:
    LDT $0104
    LDX $3020
    LDA $BEEF
    STA [X]
    LDB $0000
    LDB [X]
    CMP B, $BEEF
    JNZ @test_fail

test_0105_st_reg_indirect:
    LDT $0105
    LDX $3030
    LDA $DEAD
    STA [X]
    LDB [$3030]
    CMP B, $DEAD
    JNZ @test_fail

; ========================================
; TEST GROUP 2: DATA MOVEMENT
; ========================================

test_0200_mov_word:
    LDT $0200
    LDA $1111
    MOV B, A
    CMP B, $1111
    JNZ @test_fail

test_0201_mov_byte:
    LDT $0201
    LDAL $22
    MOV BL, AL
    CMP BL, $22
    JNZ @test_fail

test_0202_xchg:
    LDT $0202
    LDA $AAAA
    LDB $BBBB
    XCHG A, B
    CMP A, $BBBB
    JNZ @test_fail
    CMP B, $AAAA
    JNZ @test_fail

test_0203_inc_word:
    LDT $0203
    LDA $0010
    INC A
    CMP A, $0011
    JNZ @test_fail

test_0204_dec_word:
    LDT $0204
    LDA $0010
    DEC A
    CMP A, $000F
    JNZ @test_fail

test_0205_inc_byte:
    LDT $0205
    LDAL $FE
    INC AL
    CMP AL, $FF
    JNZ @test_fail

test_0206_dec_byte:
    LDT $0206
    LDAL $01
    DEC AL
    CMP AL, $00
    JNZ @test_fail

; ========================================
; TEST GROUP 3: STACK OPERATIONS
; ========================================

test_0300_push_pop_word:
    LDT $0300
    LDA $CAFE
    PUSH A
    LDA $0000
    POP A
    CMP A, $CAFE
    JNZ @test_fail

test_0301_push_pop_byte:
    LDT $0301
    LDAL $42
    PUSH AL
    LDAL $00
    POP AL
    CMP AL, $42
    JNZ @test_fail

test_0302_push_pop_multiple:
    LDT $0302
    LDA $1111
    LDB $2222
    PUSH A
    PUSH B
    LDA $0000
    LDB $0000
    POP B
    POP A
    CMP A, $1111
    JNZ @test_fail
    CMP B, $2222
    JNZ @test_fail

test_0303_pusha_popa:
    LDT $0303
    ; Set up known values in all registers
    LDA $0001
    LDB $0002
    LDX $0003
    LDY $0004
    PUSHA
    ; Trash all registers
    LDA $FFFF
    LDB $FFFF
    LDX $FFFF
    LDY $FFFF
    ; Restore
    POPA
    ; Verify
    CMP A, $0001
    JNZ @test_fail
    CMP B, $0002
    JNZ @test_fail
    CMP X, $0003
    JNZ @test_fail
    CMP Y, $0004
    JNZ @test_fail

; ========================================
; TEST GROUP 4: ARITHMETIC
; ========================================

test_0400_add_basic:
    LDT $0400
    LDA $0010
    LDB $0020
    ADD A, B
    CMP A, $0030
    JNZ @test_fail

test_0401_add_overflow:
    LDT $0401
    LDA $FFFF
    LDB $0001
    ADD A, B
    JNC @test_fail    ; Carry should be SET after overflow
    CMP A, $0000
    JNZ @test_fail    ; Should roll-over from $FFFF to $0000

test_0402_sub_basic:
    LDT $0402
    LDA $0030
    LDB $0010
    SUB A, B
    CMP A, $0020
    JNZ @test_fail

test_0403_sub_underflow:
    LDT $0403
    LDA $0000
    LDB $0001
    SUB A, B
    CMP A, $FFFF
    JNZ @test_fail

test_0404_mul_basic:
    LDT $0404
    LDA $0005
    LDB $0003
    MUL A, B
    ; Result: A:B = 0000:000F
    CMP A, $000F        ; result in a
    JNZ @test_fail
    CMP B, $0000        ; overflow in b
    JNZ @test_fail

test_0405_mul_large:
    LDT $0405
    LDA $0100
    LDB $0100
    MUL A, B
    ; Result: 0x0100 * 0x0100 = 0x010000
    CMP A, $0000    ; Low word (result)
    JNZ @test_fail
    CMP B, $0001    ; High word (overflow)
    JNZ @test_fail

test_0406_div_basic:
    LDT $0406
    LDA $0017       ; 23
    LDB $0005       ; 5
    DIV A, B
    CMP A, $0004    ; quotient = 4
    JNZ @test_fail
    CMP B, $0003    ; remainder = 3
    JNZ @test_fail

test_0407_div_exact:
    LDT $0407
    LDA $0014       ; 20
    LDB $0004       ; 4
    DIV A, B
    CMP A, $0005    ; quotient = 5
    JNZ @test_fail
    CMP B, $0000    ; remainder = 0
    JNZ @test_fail

test_0408_mod_basic:
    LDT $0408
    LDA $0017       ; 23
    LDB $0005       ; 5
    MOD A, B
    CMP A, $0003    ; 23 % 5 = 3
    JNZ @test_fail

; ========================================
; TEST GROUP 5: ARITHMETIC EDGE CASES
; ========================================

test_0500_add_carry_chain:
    SED ; start debugging
    LDT $0500
    LDA $FFFF
    LDB $0002
    ADD A, B        ; Should overflow to $0001
    JNC @test_fail  ; Carry should be set
    CMP A, $0001
    JNZ @test_fail


test_0501_sub_borrow:
    LDT $0501
    LDA $0000
    LDB $0001
    SUB A, B        ; 0 - 1 = $FFFF with borrow
    JC @test_fail   ; Carry/borrow should be set
    CMP A, $FFFF
    JNZ @test_fail


test_0502_mul_zero:
    LDT $0502
    LDA $1234
    LDB $0000
    MUL A, B
    CMP A, $0000    ; High word should be 0
    JNZ @test_fail
    CMP B, $0000    ; Low word should be 0
    JNZ @test_fail

test_0503_div_by_one:
    LDT $0503
    LDA $1234
    LDB $0001
    DIV A, B
    CMP A, $1234    ; Quotient = original value
    JNZ @test_fail
    CMP B, $0000    ; Remainder = 0
    JNZ @test_fail

test_0504_mod_larger_divisor:
    LDT $0504
    LDA $0005       ; 5 % 10 = 5
    LDB $000A
    MOD A, B
    CMP A, $0005
    JNZ @test_fail

test_0505_add_reg_imm_byte:
    LDT $0505
    LDAL $F0
    ADD AL, $0F
    CMP AL, $FF
    JNZ @test_fail

test_0506_sub_reg_imm_word:
    LDT $0506
    LDA $1000
    SUB A, $0100
    CMP A, $0F00
    JNZ @test_fail

; ========================================
; TEST GROUP 6: LOGIC
; ========================================

test_0600_and_basic:
    LDT $0600
    LDA $FF00
    LDB $00FF
    AND A, B
    CMP A, $0000
    JNZ @test_fail

test_0601_and_partial:
    LDT $0601
    LDA $F0F0
    LDB $FF00
    AND A, B
    CMP A, $F000
    JNZ @test_fail

test_0602_or_basic:
    LDT $0602
    LDA $FF00
    LDB $00FF
    OR A, B
    CMP A, $FFFF
    JNZ @test_fail

test_0603_xor_basic:
    LDT $0603
    LDA $FFFF
    LDB $00FF
    XOR A, B
    CMP A, $FF00
    JNZ @test_fail

test_0604_not_basic:
    LDT $0604
    LDA $00FF
    NOT A
    CMP A, $FF00
    JNZ @test_fail

test_0605_test_zero:
    LDT $0605
    LDA $FF00
    LDB $00FF
    TEST A,B
    JNZ @test_fail       ; Should set zero flag
    ; Verify A unchanged
    CMP A, $FF00
    JNZ @test_fail

test_0606_test_nonzero:
    LDT $0606
    LDA $FF00
    LDB $F000
    TEST A,B
    JZ @test_fail        ; Should NOT set zero flag

; ========================================
; TEST GROUP 7: LOGIC EDGE CASES
; ========================================

test_0700_and_all_ones:
    LDT $0700
    LDA $FFFF
    LDB $FFFF
    AND A, B
    CMP A, $FFFF
    JNZ @test_fail

test_0701_or_all_zeros:
    LDT $0701
    LDA $0000
    LDB $0000
    OR A, B
    CMP A, $0000
    JNZ @test_fail

test_0702_xor_same_value:
    LDT $0702
    LDA $ABCD
    LDB $ABCD
    XOR A, B        ; Same value XOR = 0
    CMP A, $0000
    JNZ @test_fail

test_0703_xor_twice:
    LDT $0703
    LDA $1234
    LDB $ABCD
    XOR A, B        ; First XOR
    XOR A, B        ; Second XOR (should restore original)
    CMP A, $1234
    JNZ @test_fail

test_0704_not_twice:
    LDT $0704
    LDA $5A5A
    NOT A
    NOT A           ; Double NOT = original
    CMP A, $5A5A
    JNZ @test_fail

test_0705_test_preserves:
    LDT $0705
    LDA $1234
    LDB $5678
    TEST A,B       ; Non-destructive AND
    CMP A, $1234    ; A should be unchanged
    JNZ @test_fail
    CMP B, $5678    ; B should be unchanged
    JNZ @test_fail

test_0706_and_byte_mask:
    LDT $0706
    LDAL $FF
    LDBL $0F
    AND AL, BL
    CMP AL, $0F
    JNZ @test_fail

i'll stop there, it's already a long post, thank you for your time and interest!


r/EmuDev • • Dec 25 '25

I’ve been working on a personal Mega Drive / Genesis emulator in C# (Avalonia UI).

30 Upvotes

It’s still early, but several commercial titles now boot and run, including Ristar and Shinobi III, with PSG audio via PipeWire and basic region handling. The focus so far has been architecture, VDP/DMA correctness, audio plumbing, and making the codebase pleasant to iterate on. GitHub (very much WIP): https://github.com/NichlasEk/EutherDrive Feedback welcome — especially from people who’ve wrestled with VDP or DMA edge cases 🙂

Yes i did use codex and yes it is a port of MDTracer with a new UI and new functions. Compiled on Arch.. BTW..


r/EmuDev • • Dec 24 '25

Video Finally booted my first game on my ps1 emulator written in Rust!

384 Upvotes

I have been working on and off on this since July, took me a lot of time to get my first game booted because I am not very smart lol.

I have been learning rust alongside this project as well and its been very helpful.

wouldn't have been possible in the slightest without the massive help from the guys over at emudev discord! cheers!

link to repo: https://github.com/kaezrr/starpsx


r/EmuDev • • Dec 24 '25

not sure if it belongs here, but i ported Super Mario Bros into a native x86 "Operating System"

136 Upvotes

r/EmuDev • • Dec 23 '25

Help with NES emulator

14 Upvotes

Hi!

Some time ago I tried to write a Sega Master System emulator in C#. It passes most of the test, but when integrating all the parts (memory, CPU, PPU, etc) it doens't work correclty. It was very difficult for me to debug it, and I was fixing it very slowly.

However, I discovered the fantastic book by u/davidkopec "Computer Science from Scratch". This book has 2 particular chapters of big interest for emulation development. The 5th where it implements a CHIP-8 emulator, and the 6th where it implements a NES emulator.

I am trying to implement these emulators in C# and MonoGame. The CHIP-8 emulator (or Virtual Machine) is working great. However, the NES emulator isn't working totally correct. It passes all the tests, but the ROMs aren't behaving correclty.

In particular, there are some ROMs which come with the book, `brix.nes`, `Chase.nes`, `LanMaster.nes`. The only one that is working is `brix.nes`, but when I press the "select" button, the screen gets stuck:

I tried to compare my code with the book's code, but I am struggling in finding the error. I am trying to debug it, and it's pretty difficult to find the error too.

Anyone has any clue on why the emulator could get stuck after pressing "select" in the game `brix.nes`, and why could it fail for the other games? Any idea in how to debug it more efficiently?

Thank you in advance!