Previous Thread
Next Thread
Print Thread
Page 1 of 4 1 2 3 4
#110356 07/19/17 11:37 AM
Joined: Apr 2012
Posts: 344
Likes: 63
Pernod Offline OP
Senior Member
OP Offline
Senior Member
Joined: Apr 2012
Posts: 344
Likes: 63
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.
Pernod #110357 07/19/17 11:41 AM
Joined: Mar 2001
Posts: 17,234
Likes: 259
R
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 17,234
Likes: 259
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.

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

crazyc #110359 07/19/17 05:05 PM
Joined: Apr 2012
Posts: 344
Likes: 63
Pernod Offline OP
Senior Member
OP Offline
Senior Member
Joined: Apr 2012
Posts: 344
Likes: 63
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.
Pernod #110360 07/19/17 05:57 PM
Joined: Mar 2001
Posts: 17,234
Likes: 259
R
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 17,234
Likes: 259
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.
Pernod #113207 04/24/18 10:36 AM
Joined: Apr 2012
Posts: 344
Likes: 63
Pernod Offline OP
Senior Member
OP Offline
Senior Member
Joined: Apr 2012
Posts: 344
Likes: 63
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 from i.imgur.com] [Linked Image from i.imgur.com]

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

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

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


BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Pernod #113208 04/24/18 11:03 AM
Joined: May 2004
Posts: 1,007
Likes: 118
D
Very Senior Member
Offline
Very Senior Member
D
Joined: May 2004
Posts: 1,007
Likes: 118
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

Duke #113209 04/24/18 11:13 AM
Joined: Apr 2012
Posts: 344
Likes: 63
Pernod Offline OP
Senior Member
OP Offline
Senior Member
Joined: Apr 2012
Posts: 344
Likes: 63
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.
Pernod #113210 04/24/18 11:35 AM
Joined: Apr 2004
Posts: 1,563
Likes: 12
J
Very Senior Member
Offline
Very Senior Member
J
Joined: Apr 2004
Posts: 1,563
Likes: 12
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.

Pernod #113212 04/24/18 04:50 PM
Joined: Apr 2012
Posts: 344
Likes: 63
Pernod Offline OP
Senior Member
OP Offline
Senior Member
Joined: Apr 2012
Posts: 344
Likes: 63
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 from i.imgur.com]
but for Carnival that re-configures multiple 6845 screens during the update I'm inadvertently clearing the playing area:
[Linked Image from i.imgur.com]
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.
Page 1 of 4 1 2 3 4

Link Copied to Clipboard
Who's Online Now
1 members (Dorando), 196 guests, and 1 robot.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,328
Posts122,128
Members5,074
Most Online1,283
Dec 21st, 2022
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Forum hosted by www.retrogamesformac.com