Master System Technical Document -Jason Starr 2001- This document is by no means an accurate portrayal of SMS hardware since I dont have all the information. If you know anything which is wrong or want to add then email me at jasonstarr@emuunlim.com A lot of the sections are incomplete but to encourage talk about these more obscurely documented things I have offered some of my own opinions and findings on some select things. Sorry for the english in this document not being very well grammatically corect and for my speling mustakes as Englush is my first language. [CODEMASTER GAMES] Codemaster games are different to normal Sega Licensed games. They use a different mapper which is accessed at $8000. This allows rompages to be paged in at 0x8000-0xC000 . The value written to $8000 is ANDed by the total number of pages in the rom, similar to the normal mappers. Im not sure that whatever written to $8000 is able to be read from anywhere. The codemaster games also utilize a 256x224 display (normal display is (256x192). The cartridge's themselves are also connected to the CLK line of the Z80. Most if not all other cartridges do not connect to the CLK line. Cosmic Spacehead sets VDP registers 0 and 1 like this, for its ingame VDP 0 Mode3 Bit VDP 0 Enable SMS screens VDP 0 LEFT MOST COLUMN BLANKED VDP 1 ENABLE DISPLAY VDP 1 Enable vertical retrace interrupts VDP 1 Mode 1 bit (TMS9918) This is from Charles Macdonalds Doc. In JON's doc, who might have some connections to CodeMasters himself(due to a comment he makes in his doc) he says the MODE1 bit of VDP register 1, is actually a stretch screen to 28 rows, from 24. This increases the screensize from 192 to 224, exactly what the codemaster games run in. Another thing in JON's doc is that he mentions the MODE1 bit in VDP 0 to be the ENABLER of "stretch" screens when it is set, and normal screens when it isnt set. What jon says actually seems to be the case in this instance, as I doubt all of the old TMS9918 modes would have been included in the SMS vdp. F16 fighter which is the only SMS game to use an old TMS9918 video mode doesnt set BIT 2 of VDP0, which apparently allows GAMES to use either SMS screen modes or TMS modes. CosMic Spacehead sets both the SMS mode bit and MODE3 bit, but so does Sonic and countless other games. This leads me to believe that BIT2 of VDP0 isnt actually a TMS mode bit, but just a setting which allows screens to be stretched as in JONS doc. The official TMS 9918 document states that different screen modes can be had by changing the mode bits but I dont think these mode bits were in the SMS vdp although if you can prove me wrong by using more then the ONE sms screen and ONE TMS screen mode then I'll be humble :). No matter my theory on mode bits and whatnot, what obviously happens is that by setting BIT4 of VDP1 (possibly in conjuction with other bits) the screen is set to 256x224 pixels from 256x192. So thats what we know. What else do we know. The SMS VDP stops drawing sprites when a sprite with Y position of 208 is found, so how do we allow sprites which obviously can be at a y position of 208 in a 224 size screen? Maybe they just miss the position of 208 and skip to 209 or 207, but its an interesting thing to find out. Another thing is that Cosmic Spacehead runs with corrupted graphics. Some of the graphics arent corrupted, but a lot are. Zoop has told me that when he modified Cosmic Spacehead to use a normal mapper that it "ran" on most emulators and on the master system. This tells me that they must only use $8000 to bankswitch as that is all Zoop modified in the cart and that the cart isnt a bad dump. So we know the only address they use to page roms, but what we dont know is fully how that mapper works. Some of you techies might say that itsthe VDP emulation causing the corruption, I beg to differ. If the VDP was the main cause of the problem then we wouldn't have as many "valid" tiles or sprites as we do. If as some people might be thinking that the VDP is used in a different way then why are we getting at least some results. I think myself that CosMic Spacehead is writing incorrect data to the VDP which is causing it to display the incorrect things on the screen. The possible reasons for this is 1->Its trying to write data from an incorrectly paged rom 2->the CLK line is somehow affecting VDP writes/read The rom runs fine in my emulator(with the paging emulation), ie I can play the subgames etc, itdoesnt crash at all, so the emulation must be correct "persay". So the program code is functioning fine and doesnt crash or lead to any black screens.The problem is the rom is doing something we aren't understanding, most probably in the paging area as thats the only non standard thing on it, apart from the different screen settings. Another thing which pops up is since the codemasters are using a 224 line display how does this affect vertical interupts. Normally the interupt would be generated at line 192, and I think it would still be generated on the real SMS with the codemaster games. But you cant write to VRAM when the display is still active so they must have to wait until line 224 to finish before updating the display. This would lead to very little time to update the display, so not as much could be updated //To be finished [LIGHTGUNS] The lightgun was a semi popular peripheral add-on for the Master System which never had many games made for it. It was bundled with some Master System 1's and also as an accessory you could buy. Here is a list of games which use the lightgun on the SMS :- Safari Hunt Operation Wolf Laser Ghost The lightgun itself is a black plastic gun, featuring one trigger. It uses a standard light diode receiver which when WHITE light hits it is triggered. The gun trigger is mapped to button 1 of the input ports and the light diode is mapped to bit(6) or bit(7) of $DC. Most games use the lightgun in the following way. -Trigger is pressed -Fill the next frame with white -Keep reading the input port ($DC)waiting for the lightgun signal to be sent(bit6) when WHITE light enters the diode -Input is received now find out where the gun was pointing by getting current scanline($7E) and Horizontal Positions($7F) of the pixel The last 3 methods are done 2 or 3 times for accuracy. The game can pinpoint where the player was pointing his gun and see if it should do anything based on values it got from Vpos and Hpos. If it doesnt receive a signal from the lightgun when it blanks the screen white, nothing happens. Also if the values returned by the VPOS and HPOS counters are outside of the active display area (256x192) then nothing happens. I am not sure whether or not bit6 and bit7 of $DC are LOW(ie 0) when a lightgun is plugged in or HIGH(ie 1). //To be finished [PADDLE] The paddle was a peripheral addon for the Master System which allowed the player to use a ball for movement instead of a D-PAD. Outrun and AlexKidd BMX Trial used the paddle, with only Alex Kidd BMX TRIAL requiring one. //To be finished [3D GLASSES] The 3D Glasses was another addon for the Master System which allowed games to display a pseudo 3d display through stereoscopic LED lens. The 3d glasses only worked on the Master System 1 as it was a CARD based input. Master System 2, Gamegear, Genesis, etc didnt have the card slot. The Glasses worked by a game showing 2 slightly different screens on the TV one after the other. The glasses "BLACKED" the left LENS and displayed the first screen, then "UNBLACKED" the left lens at the same time as "BLACKING" the RIGHT LENS and displaying the second screen. This effectively halves the framerate as each FRAME must now be accompanied by a second frame which is almost exactly the same as the first, but slightly modified to give a depth effect. This same idea is used in many MODERN steroscopic glasses. Considering the SMS was made in 1985, this is quite an achievement. //To be finished