Previous Thread
Next Thread
Print Thread
Page 3 of 3 1 2 3
Re: BBC Video WIP [Re: Vas Crabb] #113628
06/29/18 11:39 AM
06/29/18 11:39 AM
Joined: Apr 2012
Posts: 222
UK
Pernod Online content OP
Senior Member
Pernod  Online Content OP
Senior Member
Joined: Apr 2012
Posts: 222
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: 2,012
Sydney, Australia
Vas Crabb Online content
Very Senior Member
Vas Crabb  Online Content
Very Senior Member
Joined: Feb 2004
Posts: 2,012
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,

Re: BBC Video WIP [Re: Pernod] #114389
12/03/18 08:11 PM
12/03/18 08:11 PM
Joined: Apr 2012
Posts: 222
UK
Pernod Online content OP
Senior Member
Pernod  Online Content OP
Senior Member
Joined: Apr 2012
Posts: 222
UK
Can someone explain what screen->update_partial(vpos) actual does, and when/how it should be used?


BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Re: BBC Video WIP [Re: Pernod] #114390
12/03/18 08:15 PM
12/03/18 08:15 PM
Joined: Mar 2001
Posts: 16,070
USA
R
R. Belmont Offline
Very Senior Member
R. Belmont  Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,070
USA
update_partial() draws the screen until the specified vertical position. You use it when video parameters change (e.g. on systems that can rewrite the palette per-line or something of that nature).

Re: BBC Video WIP [Re: Pernod] #114396
12/04/18 10:54 PM
12/04/18 10:54 PM
Joined: Apr 2012
Posts: 222
UK
Pernod Online content OP
Senior Member
Pernod  Online Content OP
Senior Member
Joined: Apr 2012
Posts: 222
UK
I simply don't have the understanding of the video hardware and timing, to tackle this properly yet.
I can mix the screen modes, as shown here in Elite, but the black band is constantly moving suggesting a timing issue. At this point I don't know whether the issue is with how I've setup the screen or something with how I'm using the 6845, or the 6845 itself.
I keep returning to it every few months in the hope that I'll get a little further with every fresh look.
[Linked Image] [Linked Image] [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] #114397
12/05/18 12:19 AM
12/05/18 12:19 AM
Joined: May 2004
Posts: 1,532
H
Haze Offline
Very Senior Member
Haze  Offline
Very Senior Member
H
Joined: May 2004
Posts: 1,532
I guess you need to study the game code to see how it's deciding when to change the parameters?

it could be some horrible case where it depends on precise emulation of waitstates etc. if the software has no real way to know the beam position from the hardware outside of manual cycle counting

it's also possible you're not forcing a partial update when the relevant video registers change (because really, using force partial updates is an optimization so that drivers don't have to draw the entire screen line by line in all cases) There are things like 'VIDEO_UPDATE_SCANLINE' if you want to force MAME to do a partial update for every single line (which is still really not 100% accurate to hardware, as some can update during the horizontal scan too, there's a SNES game that quite famously uses horizontal and vertical timing effects to change the palette for a handful of pixels in order to make a shadow, then changes it back, and no, MAME doesn't handle that case)

Accurate timing and video emulation built around it is hard on many levels tho, and for quite a few cases MAME isn't best suited to handle it.

Re: BBC Video WIP [Re: Haze] #114398
12/05/18 02:48 AM
12/05/18 02:48 AM
Joined: Apr 2012
Posts: 222
UK
Pernod Online content OP
Senior Member
Pernod  Online Content OP
Senior Member
Joined: Apr 2012
Posts: 222
UK
Originally Posted by Haze
Accurate timing and video emulation built around it is hard on many levels tho, and for quite a few cases MAME isn't best suited to handle it.

I realise that, but my lack of screen/video knowledge is not helping either smile I already use VIDEO_UPDATE_SCANLINE in the Electron driver which works great, but don't think this helps when using the mc6845 device.

In mc6845_device::recompute_parameters the last thing it does is to reset m_line_counter = 0. This is definitely not helping my use case, removing it gives me a stable image but I lose the lower part of the screen after the resolution change. Feels like a step in the right direction, not sure yet how this would affect any other machines.

Last edited by Pernod; 12/05/18 02:48 AM.

BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Page 3 of 3 1 2 3

Who's Online Now
2 registered members (Pernod, JonasP), 122 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Shout Box
Forum Statistics
Forums9
Topics8,606
Posts112,516
Members4,827
Most Online296
Dec 5th, 2018
Powered by UBB.threads™ PHP Forum Software 7.6.1.1
(Release build 20180111)
Page Time: 0.031s Queries: 15 (0.013s) Memory: 5.6939 MB (Peak: 5.8938 MB) Zlib enabled. Server Time: 2018-12-16 11:48:46 UTC