I am starting to code for the Sega Genesis and am following the Big Evil Corporation Tutorials with some modifications from the friendly people at SonicRetro. Sadly i made it up to where it says the screen should turn pink, but so far i haven't been able to do that as it's still black like the last 2 tutorials. I am posting my code in hopes someone can figure out what i'm doing wrong. Any assistance in this matter would be greatly appreciated. Sincerely, SegaDev
Sorry for double posting but, it seems my original message has mysteriously vanished(Not deleted by a mod cause if it was there wouldn't a link to the thread on the Sega Discussions forums) so i'm reposting it. I am starting to code for the Sega Genesis and am following the Big Evil Corporation Tutorials with some modifications from the friendly people at SonicRetro. Sadly i made it up to where it says the screen should turn pink, but so far i haven't been able to do that as it's still black like the last 2 tutorials. I am posting a link to my code in hopes someone can figure out what i'm doing wrong. Any assistance in this matter would be greatly appreciated. Sincerely, SegaDev Source Code: Link
Hello! The first couple of posts contained many (many!) mistakes which caused some spurious results, mainly the VDP register settings. It's taken around two years to find them all Here's a fully working example which runs on real hardware, it'll be a better codebase to get started with: http://www.mediafire.com/download/h4qmqf65eoki7yb/MD_PongTest.zip I intend to do some housekeeping on my early blog posts soon to correct the mistakes I've found and clarify any confusion. Let me know how you get on
Hi, i have fixed my code so it is on par with the source code you have provided me. However it still isn't working for me and i get a checksum failed error and a black screen instead of a pink one. I have double checked my code to make sure there were no typos. I am lining to the latest revision of my code in hopes you can figure out what i am doing wrong. Any assistance in this matter would be greatly appreciated. Sincerely, SegaDev Source Code: Link
Ok, managed to find the issues. Seems to be a problem mixing old and new code from the blog, I changed quite a lot over time and a few things don't square up. I'll see if I can find some time this weekend to correct the articles. 1. CRAM address doesn't match the VDP register value Set up the VDP to write to CRAM using 0xF0000000: move.l #0xF0000000, 0x00C00004 2. Only writing 10 VDP registers (#11 is decimal, -1 for counter), there are 24: move.l #0x17, d0 3. Writing the registers a longword at a time, I think it needs to be a word at a time (no autoincrement on control bus? I can't find anything to confirm this): move.w (a0)+, ($C00004) 4. The register cleanup code is wrong, I've just commented it out for now Granted, some of the comments in the code don't match up to what it actually does. Maybe one day I'll write an article with no mistakes Source: http://www.mediafire.com/download/wcr5n8lnd6c2amj/md_pink.zip
Oh, about the checksum fail, that's a feature of some emulators and isn't required to be correct on real hardware (I have tested the code above running on a devkit). It's up to the programmer to implement their own checksum test. If you'd like to fix up the checksum for completeness, have a look at the batch file in the Sonic 1 disassembly for ASM68K, on SonicRetro.