Previous Thread
Next Thread
Print Thread
Page 1 of 3 1 2 3
BBC Video WIP #110356
07/19/17 11:37 AM
07/19/17 11:37 AM
Joined: Apr 2012
Posts: 208
UK
Pernod Offline OP
Senior Member
Pernod  Offline OP
Senior Member
Joined: Apr 2012
Posts: 208
UK
All bbc machines are currently tagged with MACHINE_IMPERFECT_GRAPHICS due to incorrect rendering when anything unusual is written to the 6845. To improve this I'm using bbcb_flop:froggerr as a test case as it really pushes the bbc video system to it's limits by using the 6845 in innovative ways. See it in action at http://bbcmicro.co.uk//jsbeeb/play.php?autoboot&disc=http://bbcmicro.co.uk//gameimg/discs/Disc108-FroggerRSCB.ssd

Many games change the screen size to reduce video RAM usage, and this game runs at 224x256. It doesn't set the 6845 to this size though, it defines multiple 'screens' as the screen is being updated. So R4 is set to 0x00 (1 character row/8 scanlines) and R12/13 point to RAM, and these are updated during HSYNC? This allows the same area of RAM to be repeated in different parts of the overall screen.

The bbc currently uses MCFG_MC6845_UPDATE_ROW_CB for rendering but due to all these 'screens' being defined at 224x8 then we only see the first 8 scanlines stretched full height of our output. How should I handle this?

I'm thinking I need to use a fixed size canvas and introduce MC6845_RECONFIGURE to stop the 6845 from resizing my screen, then rewrite MC6845_UPDATE_ROW to render in the active area only.


BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Re: BBC Video WIP [Re: Pernod] #110357
07/19/17 11:41 AM
07/19/17 11:41 AM
Joined: Mar 2001
Posts: 15,964
USA
R
R. Belmont Offline
Very Senior Member
R. Belmont  Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 15,964
USA
That sounds like the tricks 8088 Corruption does to the 6845 on the CGA card. Carl might have some insight, he has that kind of working.

Re: BBC Video WIP [Re: Pernod] #110358
07/19/17 01:27 PM
07/19/17 01:27 PM
Joined: Jan 2012
Posts: 782
C
crazyc Offline
Senior Member
crazyc  Offline
Senior Member
C
Joined: Jan 2012
Posts: 782
Yup, I added MC6845_RECONFIGURE for that. Just use MCFG_VIDEO_SET_SCREEN(nullptr) to prevent the 6845 from calling screen_device::reconfigure itself.

Re: BBC Video WIP [Re: crazyc] #110359
07/19/17 05:05 PM
07/19/17 05:05 PM
Joined: Apr 2012
Posts: 208
UK
Pernod Offline OP
Senior Member
Pernod  Offline OP
Senior Member
Joined: Apr 2012
Posts: 208
UK
Originally Posted by crazyc
Yup, I added MC6845_RECONFIGURE for that. Just use MCFG_VIDEO_SET_SCREEN(nullptr) to prevent the 6845 from calling screen_device::reconfigure itself.

Thanks, I did look at that but didn't realise the significance of MCFG_VIDEO_SET_SCREEN.

Am now thinking a different approach is required and not use MCFG_MC6845_UPDATE_ROW_CB but instead implement MCFG_SCREEN_UPDATE_DRIVER in a similar way as the amstrad driver. The 6845 feeds a Video ULA that generates RGB (like Amstrad) and using MCFG_SCREEN_UPDATE_DRIVER should give me more control over the timing that's required to get this right.


BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Re: BBC Video WIP [Re: Pernod] #110360
07/19/17 05:57 PM
07/19/17 05:57 PM
Joined: Mar 2001
Posts: 15,964
USA
R
R. Belmont Offline
Very Senior Member
R. Belmont  Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 15,964
USA
MCFG_SCREEN_UPDATE_DRIVER basically means you're ignoring the 6845. It works well for a lot of cases, but I can't imagine it's the right solution to software playing tricks with the 6845 smile

Last edited by R. Belmont; 07/19/17 05:57 PM.
Re: BBC Video WIP [Re: Pernod] #113207
04/24/18 10:36 AM
04/24/18 10:36 AM
Joined: Apr 2012
Posts: 208
UK
Pernod Offline OP
Senior Member
Pernod  Offline OP
Senior Member
Joined: Apr 2012
Posts: 208
UK
After the significant Electron improvements I'm now back into BBC video.

Simply setting MCFG_MC6845_SHOW_BORDER_AREA(true) improved things and now realise why I need to use MC6845_UPDATE_ROW, to have access to hbp and vbp to ensure the active area is positioned correctly. It's preferable to show the border as software can and does move the active area around, I guess artwork will need updating.

In all of my new screenshots there are remnants of previous screens in the non-active areas, Boffin shows CAVE 1, E-Type should be just the game in the center and not E-Type in the borders. I realise in MC6845_UPDATE_ROW I'm only plotting the active area, should I be blanking everything else in here, any examples?

It's definitely heading in the right direction but need to look into interrupt timing for anything that uses split-modes such as Elite.

There are a couple of recent games that re-configure the 6845 during a scanline, and must be timed to the pixel. Is this currently possible to implement in MAME, or should I ignore for now?

Boffin: was originally stretched to fit screen, now correct size into overscan.
[Linked Image] [Linked Image]

Carnival: was stretched and bad timing, now correct size and palette changes.
[Linked Image] [Linked Image]

Icarus: was stretched to fit screen, now correct size.
[Linked Image] [Linked Image]

E-Type: was stretched to fit screen, now correct size but palette changes not 100%.
[Linked Image] [Linked Image]


BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Re: BBC Video WIP [Re: Pernod] #113208
04/24/18 11:03 AM
04/24/18 11:03 AM
Joined: May 2004
Posts: 854
Germany
D
Duke Online content
Senior Member
Duke  Online Content
Senior Member
D
Joined: May 2004
Posts: 854
Germany
Are you drawing when the display is disabled? For the cgenie I have:

Code
	// don't need to do anything in vblank
	if (!de)
		return;


From https://git.redump.net/mame/tree/src/mame/drivers/cgenie.cpp#n335

Re: BBC Video WIP [Re: Duke] #113209
04/24/18 11:13 AM
04/24/18 11:13 AM
Joined: Apr 2012
Posts: 208
UK
Pernod Offline OP
Senior Member
Pernod  Offline OP
Senior Member
Joined: Apr 2012
Posts: 208
UK
Originally Posted by Duke
Are you drawing when the display is disabled? For the cgenie I have:

That makes no difference. In mc6845_device::screen_update it only calls draw_scanline (which calls m_update_row_cb) for the visible region, yet I have remnants all around this region.

Maybe I need to use m_begin_update_cb to clear the bitmap?

Edit: I see you use MC6845_BEGIN_UPDATE in cgenie to clear the bitmap smile

Last edited by Pernod; 04/24/18 11:16 AM.

BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Re: BBC Video WIP [Re: Pernod] #113210
04/24/18 11:35 AM
04/24/18 11:35 AM
Joined: Apr 2004
Posts: 1,553
J
judge Offline
Very Senior Member
judge  Offline
Very Senior Member
J
Joined: Apr 2004
Posts: 1,553
Originally Posted by Pernod
There are a couple of recent games that re-configure the 6845 during a scanline, and must be timed to the pixel. Is this currently possible to implement in MAME, or should I ignore for now?


Internally the 6845 just uses emu_timers which get calculated based on whatever is configured in the registers so it does support updating those while the screen is being drawn. This is used on other platforms for doing split screen tricks.

Re: BBC Video WIP [Re: Pernod] #113212
04/24/18 04:50 PM
04/24/18 04:50 PM
Joined: Apr 2012
Posts: 208
UK
Pernod Offline OP
Senior Member
Pernod  Offline OP
Senior Member
Joined: Apr 2012
Posts: 208
UK
Using
Code
MC6845_BEGIN_UPDATE(bbc_state::crtc_begin_update)
{
	bitmap.fill(rgb_t::black(), cliprect);
}

certainly fixes my blanking issues in Boffin, where the 6845 is not re-configured during the screen update:
[Linked Image]
but for Carnival that re-configures multiple 6845 screens during the update I'm inadvertently clearing the playing area:
[Linked Image]
For another game that creates multiple 6845 'screens' during a single scanline I'm failing to see how MC6845_UPDATE_ROW could ever be called more than once per scanline, as each 'screen' is configured. These 'screens' are configured as 1 character high so would need MC6845_RECONFIGURE to force drawing all scanlines. But in MC6845_RECONFIGURE I can't just ignore changes in visarea.min_y/max_y as in isa8_cga_device because it has to change between teletext and graphics modes. Due to these limitations I'm again considering switching to MCFG_SCREEN_UPDATE_DRIVER where I should have full control of what I plot on the whole scanline.


BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Re: BBC Video WIP [Re: Pernod] #113213
04/24/18 05:10 PM
04/24/18 05:10 PM
Joined: May 2004
Posts: 854
Germany
D
Duke Online content
Senior Member
Duke  Online Content
Senior Member
D
Joined: May 2004
Posts: 854
Germany
Doing your own is a solution of course, but I would love to see some generic improvements to the 6845 so that all drivers benefit.

Re: BBC Video WIP [Re: Pernod] #113214
04/24/18 05:52 PM
04/24/18 05:52 PM
Joined: Mar 2001
Posts: 15,964
USA
R
R. Belmont Offline
Very Senior Member
R. Belmont  Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 15,964
USA
I'm going to put that harder: fix the 6845 to work. Abandoning it is both cowardice and poor documentation value, and I will not look kindly upon any change lists that do so.

Re: BBC Video WIP [Re: Pernod] #113215
04/24/18 06:30 PM
04/24/18 06:30 PM
Joined: Apr 2012
Posts: 208
UK
Pernod Offline OP
Senior Member
Pernod  Offline OP
Senior Member
Joined: Apr 2012
Posts: 208
UK
I'm not saying there's anything wrong with the current 6845, the real device doesn't output the video yet we have MC6845_UPDATE_ROW to do just that. The BBC has a VideoULA to output video RGB which takes the various 6845 outputs MA, RA, CURSOR, DE to generate video for the whole screen, not just the last area the 6845 was configured for. The amstrad driver uses the 6845 in a similar way and doesn't use MC6845_UPDATE_ROW, is that wrong?

I need to do some more testing but will probably submit current progress with borders and fixed blanking using MC6845_UPDATE_ROW. I'm not expecting this to break anything (apart from artwork) and will certainly improve many games that simply reduce the screen size to save video RAM.


BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Re: BBC Video WIP [Re: Pernod] #113217
04/24/18 10:02 PM
04/24/18 10:02 PM
Joined: Mar 2013
Posts: 252
I
ICEknight Offline
Senior Member
ICEknight  Offline
Senior Member
I
Joined: Mar 2013
Posts: 252
Originally Posted by Pernod
The amstrad driver uses the 6845 in a similar way and doesn't use MC6845_UPDATE_ROW, is that wrong?

Could it be related to this display bug in the CPC driver? -> http://mametesters.org/view.php?id=6864


LCD artwork cleanups: https://mega.nz/#F!uFYSzK7S!U-lJon9jsqyoCX_3y7_KLA
Re: BBC Video WIP [Re: ICEknight] #113218
04/24/18 10:21 PM
04/24/18 10:21 PM
Joined: Dec 2006
Posts: 524
New Zealand
M
mahlemiut Offline
Senior Member
mahlemiut  Offline
Senior Member
M
Joined: Dec 2006
Posts: 524
New Zealand
Originally Posted by ICEknight
Could it be related to this display bug in the CPC driver? -> http://mametesters.org/view.php?id=6864

I think that's related more to setting up for differing frame rates, where the driver just bases the frame rate on a machine config setting.


- Barry Rodewald
Re: BBC Video WIP [Re: R. Belmont] #113229
04/25/18 03:18 PM
04/25/18 03:18 PM
Joined: Apr 2012
Posts: 208
UK
Pernod Offline OP
Senior Member
Pernod  Offline OP
Senior Member
Joined: Apr 2012
Posts: 208
UK
Originally Posted by R. Belmont
I'm going to put that harder: fix the 6845 to work.

If this is referring to improving mc6845_device::screen_update then I agree.

Out of curiosity, why would Machine Information report different Video resolutions depending on whether MCFG_MC6845_SHOW_BORDER_AREA is true or false?
false:
[Linked Image]
true:
[Linked Image]


BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Re: BBC Video WIP [Re: Pernod] #113230
04/25/18 04:08 PM
04/25/18 04:08 PM
Joined: May 2004
Posts: 1,500
H
Haze Offline
Very Senior Member
Haze  Offline
Very Senior Member
H
Joined: May 2004
Posts: 1,500
because it shows the current visible area size, which is obviously different if borders are showing..

Re: BBC Video WIP [Re: Haze] #113614
06/27/18 04:22 PM
06/27/18 04:22 PM
Joined: Apr 2012
Posts: 208
UK
Pernod Offline OP
Senior Member
Pernod  Offline OP
Senior Member
Joined: Apr 2012
Posts: 208
UK
Originally Posted by Haze
because it shows the current visible area size, which is obviously different if borders are showing..

Obviously, was a case of typing before thought.

Do any other drivers handle changing of the pixel clock during a scanline? This will be required to handle split modes vertically rather than the more commonly used horizontally split.

So the 6845 currently has a scanline_timer but I really need a pixel_timer. Would it makes sense to implement this in my MC6845_UPDATE_ROW or would a new MC6845_UPDATE_PIXEL be the way to go?

Again just thinking out loud for guidance.


BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Re: BBC Video WIP [Re: Pernod] #113616
06/27/18 10:53 PM
06/27/18 10:53 PM
Joined: Feb 2004
Posts: 1,968
Sydney, Australia
Vas Crabb Online content
Very Senior Member
Vas Crabb  Online Content
Very Senior Member
Joined: Feb 2004
Posts: 1,968
Sydney, Australia
MAME doesn't really support "horizontal partial updates" at the moment, and it definitely doesn't support changing resolution within a line. If you've got horizontal resolution changes within a line, you need to render at lowest common multiple. A per-pixel timer would kill performance. If you need to render per-pixel, you'd be better off making the video chip implement device_execute_interface and letting the scheduler deal with it.

Re: BBC Video WIP [Re: Pernod] #113617
06/28/18 12:37 AM
06/28/18 12:37 AM
Joined: Mar 2001
Posts: 15,964
USA
R
R. Belmont Offline
Very Senior Member
R. Belmont  Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 15,964
USA
Yeah, I need to get back to the horizontal partial update thing after my current large project lands. Gotta get those French Touch demos perfect.

Re: BBC Video WIP [Re: Vas Crabb] #113628
06/29/18 11:39 AM
06/29/18 11:39 AM
Joined: Apr 2012
Posts: 208
UK
Pernod Offline OP
Senior Member
Pernod  Offline OP
Senior Member
Joined: Apr 2012
Posts: 208
UK
Originally Posted by Vas Crabb
If you've got horizontal resolution changes within a line, you need to render at lowest common multiple. A per-pixel timer would kill performance.

I now think a per-pixel timer would be overkill. The CRTC registers are defined in characters, so a per-character timer should be sufficient. Typical values would be 128 horizontal characters of which 80 are displayed. Would this appease your performance concerns?

Originally Posted by Vas Crabb
If you need to render per-pixel, you'd be better off making the video chip implement device_execute_interface and letting the scheduler deal with it.

If I need to take this option could you elaborate on what it would involve, any examples of it's usage?

I'd prefer to implement something like MC6845_UPDATE_CHAR that enhances the use of the 6845, but doesn't affect machines using MC6845_UPDATE_ROW that don't make changes during scanline.

Last edited by Pernod; 06/29/18 11:41 AM.

BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Re: BBC Video WIP [Re: Pernod] #113629
06/29/18 02:10 PM
06/29/18 02:10 PM
Joined: Feb 2004
Posts: 1,968
Sydney, Australia
Vas Crabb Online content
Very Senior Member
Vas Crabb  Online Content
Very Senior Member
Joined: Feb 2004
Posts: 1,968
Sydney, Australia
I still think a timer per character cell is going to be a lot of overhead. All the CPUs and various other things like the POKEY sound chip implement device_execute_interface. If you go this way, you can cause synchronisation when things actually change rather than running a pessimistic timer.

Alternatively you could use a timer that triggers at the end of a scanline, but trigger partial updates when something happens that affects rendering. You can check the time in the current executable device's domain at the point where you get a register change etc. to work out how far through the line you are. This would work well enough if only a single executable device (e.g. CPU) can cause register changes,

Page 1 of 3 1 2 3

Who's Online Now
3 registered members (Duke, Vas Crabb, robcfg), 29 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Shout Box
Forum Statistics
Forums9
Topics8,553
Posts111,744
Members4,800
Most Online225
May 26th, 2014
Powered by UBB.threads™ PHP Forum Software 7.6.1.1
(Release build 20180111)
Page Time: 0.032s Queries: 14 (0.007s) Memory: 5.8457 MB (Peak: 6.1266 MB) Zlib enabled. Server Time: 2018-07-17 13:47:14 UTC