🔒 Locked
emulator help
Advertisement
Original Post
You'll have to count CPU cycles and keep track of the emulated video "beam's" position on the LCD in relation to the CPU clock, otherwise you won't be able to handle raster effects properly. The easiest method is probably to run the CPU and render to the back buffer in synchronization, scanline-per-scanline. And then you can just flip it all to screen when the emulated video chip reaches the vertical blanking period, in 60 Hz or so IIRC.
A more exact method is to track any display IO writes from the CPU and this together with the current CPU cycle to the display emulator. Thus the display can draw all pixels between the previous write and the new one. Horiziontal blanking interrupts complicates this a little though.
A more exact method is to track any display IO writes from the CPU and this together with the current CPU cycle to the display emulator. Thus the display can draw all pixels between the previous write and the new one. Horiziontal blanking interrupts complicates this a little though.
can I ask why? There are several excellent GB emulators available already.
hmmm it won't...make you look good with the ladies :)
but as for learning GB, I'm prety sure some of the old emulators may be opensource, and were mostly written in C.
Sounds like a fun if not entierly productive project...enjoy
but as for learning GB, I'm prety sure some of the old emulators may be opensource, and were mostly written in C.
Sounds like a fun if not entierly productive project...enjoy
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement