View topic - [Community effort request] Help discover how the VDP handles the leftmost pixels when scrolling - Forums - SMS Power! Forums Sega Master System / Mark III / Game Gear SG-1000 / SC-3000 / SF-7000 / OMV Home - Forums - Games - Scans - Maps - Cheats - Credits Music - Videos - Development - Hacks - Translations - Homebrew View topic - [Community effort request] Help discover how the VDP handles the leftmost pixels when scrolling Log in Search Membermap Register Forum Index Development [Community effort request] Help discover how the VDP handles the leftmost pixels when scrolling Author Message sverx Joined: 05 Sep 2013 Posts: 4655 Location: Stockholm, Sweden [Community effort request] Help discover how the VDP handles the leftmost pixels when scrolling Posted: Tue Sep 15, 2015 9:46 am I'm spending a lot of time these days to understand how to correctly handle the 1-7 pixels that appear on the leftmost part of the screen when scrolling horizontally... let me explain from the beginning. Charles' VDP doc says: Quote Most video display hardware will show part of the column that appears in the left 1-7 pixels of the display as the fine scroll value is increased (such as the NES, Genesis, TurboGrafx-16). However, the SMS VDP does not, and instead this area is filled with the backdrop color (and sometimes pattern data from sprite #0, but exactly how this is selected is unknown). but we already know this isn't true, and in this topic they corrected it with 'background color 0' instead of 'backdrop color'. Now, according to my tests, neither the 1st or the 2nd are correct, even if sometimes either one or the other seems correct... but I couldn't set the color of that area correctly even if I change the background color 0 or the backdrop color, so I have built a test ROM. What I found out so far is that what's shown there, in the far left pixels, seems to always depend on all the following - the background color #0 - the sprite color #0 (not the backdrop color!) - the pattern stored at sprite #0 (or at VRAM $2000? - or just some bits from there?) somehow it seems that it's showing some bit pattern using these two colors, but this is probably still not conclusive, or at least I could not understand properly how this all happens... also because there's absolutely no way on my TV to show the leftmost 5 pixels. :| So I'm asking you guys to test my test ROM too, on your hardware, and tell me what you can see there on the left. Using the keys you can change some settings: - LEFT changes background color #0 - RIGHT changes sprite color #0 - UP/DOWN to change which color entry is used for backdrop - 1 and 2 load two different tiles into sprite #0 (at $2000) - the first tile seems to trigger the 'weird' behavior while the second seems not (is it because its first byte is $00?) Every feedback 100% welcome. Thanks! test01.rar (31.43 KB) test ROM with C source Kjell Joined: 27 Nov 2011 Posts: 26 Posted: Wed Sep 16, 2015 1:36 am Last edited by Kjell on Wed Sep 16, 2015 11:56 am; edited 2 times in total Just tried your ROM on a MegaDrive ( connected using RF to a B&O CRT ), so this probably doesn't help ... but just in case. On the left side of the 64 color bars seem to be 8 additional pixels. Of those pixels the last 5 ( right-hand side ) are the selected background color as you'd expect, but the first 3 ( left-hand side ) are a grayscale color that seems to be linked to the green value of the background color. So when the background is red those pixels are black, and when the background is yellow those pixels are white. Alternating the tile loaded in VRAM doesn't appear to change anything. sverx.jpg (92.99 KB) Had to adjust the image size in the TV settings quite a bit for all pixels to become visible. sverx Joined: 05 Sep 2013 Posts: 4655 Location: Stockholm, Sweden Posted: Wed Sep 16, 2015 8:09 am Last edited by sverx on Wed Sep 16, 2015 11:10 am; edited 2 times in total Thanks for your test :) I'm very puzzled, the object of my tests should be a 7-pixels wide rectangle on the leftmost edge of the screen, on the lower half of the screen only (I change the h-scroll value at line 98 and reset it at vblank...) edit: image added. the circled 'HERE' area (black in the image) is what it's been tested instructions.png (4.22 KB) sample image (from emulator) Maxim Site Admin Joined: 19 Oct 1999 Posts: 15781 Location: London Posted: Wed Sep 16, 2015 8:27 am Photos would help. sverx Joined: 05 Sep 2013 Posts: 4655 Location: Stockholm, Sweden Posted: Thu Sep 24, 2015 3:07 pm A few more people trying this would help too... :| l_oliveira Joined: 29 Jan 2014 Posts: 95 Location: Brasilia, Brazil Posted: Thu Sep 24, 2015 5:40 pm Some samples for you. Hopefully these are of help. Sorry about the oversaturated color on the Master System sample but the MC1377 as how Tec Toy implemented it is pretty poor at the video output quality department. Particularly for computer generated video. Edit: Just for clarification purposes, the VDP on the Master System is the early 315-5124 VDP and Mega drive VDP is FC1001 (315-5313A-01, third revision of discrete MD1 VDP ) MegaDrive.PNG (451.27 KB) Tec Toy VA4 Mega Drive (S-Video, CXA1145, NTSC) MasterSystem.PNG (503.97 KB) 1st model Master System Tec Toy (CVBS, MC1377, NTSC) sverx Joined: 05 Sep 2013 Posts: 4655 Location: Stockholm, Sweden Posted: Thu Sep 24, 2015 7:03 pm mmm... I should have explained better. The test consists in changing BG color #0, sprite color #0 and sprite tile #0 to see if something appears on that area on the lower left of the screen... or did you try that? Quote - LEFT changes background color #0 - RIGHT changes sprite color #0 - UP/DOWN to change which color entry is used for backdrop - 1 and 2 load two different tiles into sprite #0 (at $2000) l_oliveira Joined: 29 Jan 2014 Posts: 95 Location: Brasilia, Brazil Posted: Thu Sep 24, 2015 7:24 pm Ah I should have read the description carefully. Any particular order you would want me to push the buttons? Pushing buttons 1 and 2 have no effect whatsoever on Mega Drive... On Master System pushing buttons 1 and 2 causes the area to have that pattern with stripes or not. Edited for better clarity. TV2015092416133100.jpg (20.07 KB) Master System (button 1 pressed) TV2015092416222600.jpg (19.34 KB) Master System (button 2 pressed) TV2015092416180200.jpg (15.73 KB) Mega Drive l_oliveira Joined: 29 Jan 2014 Posts: 95 Location: Brasilia, Brazil Posted: Thu Sep 24, 2015 7:56 pm Two more from SMS, this time taking them with the same color values for everything TV2015092416544700.jpg (19.99 KB) pushed 1 TV2015092416545000.jpg (19.39 KB) pushed 2 Charles MacDonald Joined: 28 Sep 1999 Posts: 1200 Posted: Fri Sep 25, 2015 4:50 am Are you trying to figure out how it works to display meaningful data there in a homebrew program? Or for emulation accuracy? sverx Joined: 05 Sep 2013 Posts: 4655 Location: Stockholm, Sweden Posted: Fri Sep 25, 2015 8:02 am Charles MacDonald wrote Are you trying to figure out how it works to display meaningful data there in a homebrew program? Or for emulation accuracy? Both, but it all started because I found 'garbage' there on my SMS II and I still can't make it disappear (!!!) l_oliveira: your SMS tests seems to confirm my suspects, so I'll probably prepare a different test... (you're lucky you can see so many pixels there on the left, I can barely see one...) On your MegaDrive anyway it's curious to notice half the bar is of BG color #0 (upper half) and the second half (lower half) is of sprite color #0... which leads me to think that on a MegaDrive it checks which palette is used by the first tile of the row... maybe (???) l_oliveira Joined: 29 Jan 2014 Posts: 95 Location: Brasilia, Brazil Posted: Fri Sep 25, 2015 12:58 pm It's possible that the 315-5246 SMS VDP has yet another behavior on that situation. But I don't have a working system with that VDP to test. :\ About the pixels at the screen corners: It's a TV capture card so it doesn't have problems with "overscan" areas. Overscan is always visible here. Charles MacDonald Joined: 28 Sep 1999 Posts: 1200 Posted: Sat Sep 26, 2015 12:00 am But I mean isn't the point of the left column blanking to hide that? What's shown in the left column is a limitation of the VDP design and not something that is likely easily controllable, in terms of homebrew. I get the point of emulating it accurately for emulation, though IIRC no commercial or homebrew games show that part of the screen either. hang-on Joined: 23 Mar 2013 Posts: 613 Location: Copenhagen, Denmark Posted: Sun Sep 27, 2015 7:07 pm Hi sverx! I get the garbled tiles too when pressing button 1. I also get the vram writing 'snow' at the bottom. My system is an SMS II, modded for 60 hz. RGB output via an upscaler to a monitor. IMG_1814.JPG (339.78 KB) sverx Joined: 05 Sep 2013 Posts: 4655 Location: Stockholm, Sweden Posted: Mon Sep 28, 2015 8:43 am hang-on: Thanks! I'm actually running some tests these days to understand how exactly VRAM contents at $2000 drive the on screen garbage... no dice until now, but will hopefully post news soon :) Forum Index Development [Community effort request] Help discover how the VDP handles the leftmost pixels when scrolling Script phpBB © 2001, 2005 phpBB Group Back to the top of this page Back to SMS Power!