Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Sega Master System/GameGear emulator assistance - VDP
- CoolCode16
-
Scratcher
17 posts
Sega Master System/GameGear emulator assistance - VDP
https://scratch.mit.edu/projects/889057250
This is my first time making an emulator aside from chip-8. And while things have been pretty straightforward so far, I started having trouble when implementing the VDP:
The most important part of the VDP to implement first is the Line Counter (Vcnt), since most if not all ROMS get stuck in a loop waiting for it to return a certain value. But knowing what value it's currently on is a bit difficult, since the only thing in the emulator that represents elapsed time is the number of CPU cycled emulated. And most places that specify how many cycles correspond to 1 line seem to give slightly different values. They say 227.5, but when I did some math I ended up with a number closed to 204. And also what about cycles per pixel? cycles per frame? I remember someone said something about a half-line at the end of each frame at one point.
PS. I'm not going to snoop around in @Aart1256's code either. Not that I can read it anyway, that's half the reason I made my own.
This is my first time making an emulator aside from chip-8. And while things have been pretty straightforward so far, I started having trouble when implementing the VDP:
The most important part of the VDP to implement first is the Line Counter (Vcnt), since most if not all ROMS get stuck in a loop waiting for it to return a certain value. But knowing what value it's currently on is a bit difficult, since the only thing in the emulator that represents elapsed time is the number of CPU cycled emulated. And most places that specify how many cycles correspond to 1 line seem to give slightly different values. They say 227.5, but when I did some math I ended up with a number closed to 204. And also what about cycles per pixel? cycles per frame? I remember someone said something about a half-line at the end of each frame at one point.
PS. I'm not going to snoop around in @Aart1256's code either. Not that I can read it anyway, that's half the reason I made my own.
Last edited by CoolCode16 (Dec. 16, 2025 02:01:21)
- Discussion Forums
- » Help with Scripts
-
» Sega Master System/GameGear emulator assistance - VDP