Re: X11 video scaling

2012-08-03 Thread Andrew Flegg
On 27 July 2012 20:41, Jeffrey Lee m...@phlamethrower.co.uk wrote:
 On Fri, 27 Jul 2012, Andrew Flegg wrote:

 Is there something I've missed which'd allow video scaling (say 2x)
 for modes  640x480.

 For the X11 port, the place to start looking is the
 SDD_Name(Host_ChangeMode)() function, which is actually implemented in two
 places - X/pseudo.c for pseudocolour displays and X/true.c for truecolour
 displays.

Attached is the start of the patch - if the screen is smaller than
640px wide, the scale factors are increased (though with a limit due
to the maximum horizontal scaling being 2x because of the fast render
routines previously discussed).

I've tested this in the desktop; BASIC and games like Cannon Fodder
(rectangular pixels, I think); Lemmings; Stib; Hopper; Chuckie Egg and
a few others.

 However, it looks like I didn't fix the mouse pointer image code to take
 into account the scale factors, so you'll be wanting to change that.

This version of the patch doesn't contain that code (given games tend
not to use the hardware mouse pointer), however I'll look into it.

Cheers,

Andrew

-- 
Andrew Flegg -- mailto:and...@bleb.org  |  http://www.bleb.org/


small-scaling.patch
Description: Binary data
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/-- 
arcem-devel mailing list
arcem-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/arcem-devel

Re: X11 video scaling

2012-07-29 Thread Andrew Flegg
On 27 July 2012 20:41, Jeffrey Lee m...@phlamethrower.co.uk wrote:
 On Fri, 27 Jul 2012, Andrew Flegg wrote:

 Is there something I've missed which'd allow video scaling (say 2x)
 for modes  640x480.

 For the X11 port, the place to start looking is the
 SDD_Name(Host_ChangeMode)() function, which is actually implemented in two
 places - X/pseudo.c for pseudocolour displays and X/true.c for truecolour
 displays. As you can see there's code in there to set HD.XScale and
 HD.YScale to take into account rectangular pixel modes. So adding support
 for 2x, 3x, 4x, etc. upscaling is just a case of changing HD.XScale,
 HD.YScale, width, and height to the appropriate values.

Thanks for the pointer. However, I'm getting a weird effect when
XScale  2. Effectively, it acts like XScale = 1 (although YScale
works).

To reproduce:
  1) In true.c's SDD_Name(Host_ChangeMode) add the following after HD.XScale
 and HD.YScale are initialised to 1:
  int origWidth = width, origHeight = height;

  2) Add the following above the calculation of HD.Width and HD.Height:

  while (width  800) {
HD.XScale *= 2;
HD.YScale * =2;
height = origHeight * HD.YScale;
width = origWidth * HD.XScale;
  }

  3) Make  run `arcem'

In the default mode of 28, this works (although 2x zoom on 640px is a
bit too large for my tastes). Press F12 and enter `wimpmode 13'.

At this point, the vertical scaling is as you'd expect, but despite
HD.YScale being set to 3, and the window being set to the correct
size, the screen display within the window only takes up a third of
the width.

Setting it to a power of 2 doesn't help either.

What happens to 'HD' after its been initialised? What actually does
the pixel blatting and how could this be getting confused with a 2
XScale, but not a 2 YScale?

Cheers,

Andrew

-- 
Andrew Flegg -- mailto:and...@bleb.org  |  http://www.bleb.org/

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
-- 
arcem-devel mailing list
arcem-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/arcem-devel


Re: X11 video scaling

2012-07-29 Thread Andrew Flegg
On 29 July 2012 20:09, Andrew Flegg and...@bleb.org wrote:

 What happens to 'HD' after its been initialised? What actually does
 the pixel blatting and how could this be getting confused with a 2
 XScale, but not a 2 YScale?

Ah, it seems that SDD_Name(RowFunc) dispatches to an explicit set of
functions which only support 1X and 2X. Hmm.

-- 
Andrew Flegg -- mailto:and...@bleb.org  |  http://www.bleb.org/

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
-- 
arcem-devel mailing list
arcem-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/arcem-devel


Re: X11 video scaling

2012-07-29 Thread Andrew Flegg
On 29 July 2012 20:18, Andrew Flegg and...@bleb.org wrote:

 Ah, it seems that SDD_Name(RowFunc) dispatches to an explicit set of
 functions which only support 1X and 2X. Hmm.

These 16 functions (1bpp, 2bpp, 4bpp, 8bpp @ 1x. 2x with flags and
without flags) are all *very* similar and look like they should be
very abstractable.

However, it's not something I've got time to do right now - and a
pretty boring task at the best of times ;-)


-- 
Andrew Flegg -- mailto:and...@bleb.org  |  http://www.bleb.org/

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
-- 
arcem-devel mailing list
arcem-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/arcem-devel


Re: X11 video scaling

2012-07-29 Thread Andrew Flegg
On 29 July 2012 20:31, Jeffrey Lee m...@phlamethrower.co.uk wrote:
 On Sun, 29 Jul 2012, Andrew Flegg wrote:

 Ah, it seems that SDD_Name(RowFunc) dispatches to an explicit set of
 functions which only support 1X and 2X. Hmm.

 Yes, I guess I forgot about that!

:-)

 Are you planning on using  2x horizontal scaling? I can add an extra set
 of functions to deal with arbitrary scale factors. Or you can try it
 yourself, if you're feeling brave enough.

320x256 is common for games, but blowing these up by 3x to 960x768
seems sensible (on my setup at least). Adding another set for 3x would
be the easiest option, but adding support for arbitrary scaling
factors would be more flexible and also *reduce* the amount of code
(when the different variants of BPP  flags are taken into account).

Cheers,

Andrew

-- 
Andrew Flegg -- mailto:and...@bleb.org  |  http://www.bleb.org/

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
-- 
arcem-devel mailing list
arcem-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/arcem-devel


Re: X11 video scaling

2012-07-29 Thread Andrew Flegg
On 29 July 2012 20:41, Jeffrey Lee m...@phlamethrower.co.uk wrote:

 Abstractable, yes. Abstractable without impacting performance? Doubtful.
 Remember that I fought long and hard to get ArcEm to run at ARM2 speeds on
 an Iyonix, so I don't really want us to start doing things that will harm
 performance unless we've got a good reason!

Fair point, the first pass I'd do is to have a single method which
always calls through to Write_Pixels (which might then have special
casing when n = 1). Is the additional method calling overhead the
concern?

Of course, X/true.c isn't used on the Iyonix (i.e. RISC OS port) is it?

Cheers,

Andrew

-- 
Andrew Flegg -- mailto:and...@bleb.org  |  http://www.bleb.org/

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
-- 
arcem-devel mailing list
arcem-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/arcem-devel


Re: X11 video scaling

2012-07-29 Thread Andrew Flegg
On 29 July 2012 20:50, Ian Jeffray i...@jeffray.co.uk wrote:
 On 29/07/2012 20:34, Andrew Flegg wrote:

 320x256 is common for games, but blowing these up by 3x to 960x768
 seems sensible (on my setup at least). Adding another set for 3x would
 be the easiest option, but adding support for arbitrary scaling
 factors would be more flexible and also *reduce* the amount of code
 (when the different variants of BPP  flags are taken into account).

 So long as we don't lose performance... lots of separately optimised
 functions are good for performance.   And they're not /quite/ as
 similar as you may think at first glance.

I admit I didn't diff all 16 ;-)

But the differences between RowFunc8bpp2X and RowFunc8bpp1X seemed to be:

  * VIDEO_STAT(DisplayRedrawForced) - 'flags  ROWFUNC_FORCE' vs. 'force'
(is that a mistake?)

  * Shifting of Available (2 vs. 3) - is that (4-HD.XScale)?
  * Host_WritePixels vs. Host_WritePixel - could use a macro to avoid additional
function call overhead.

There was more difference between RowFunc8bpp2X and RowFunc4bpp2X, but
mostly power of two shifting; although the differences between the
palette and the cleverness around Shift may be harder to commonise.

Cheers,

Andrew

-- 
Andrew Flegg -- mailto:and...@bleb.org  |  http://www.bleb.org/

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
-- 
arcem-devel mailing list
arcem-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/arcem-devel


Re: X11 video scaling

2012-07-29 Thread Andrew Flegg
On 29 July 2012 20:58, Jeffrey Lee m...@phlamethrower.co.uk wrote:
 On Sun, 29 Jul 2012, Andrew Flegg wrote:

 Anything that could conceivably make things slower is a concern ;)

Fair enough. My day job makes me think that anything that makes such a
dent on maintainability is also a concern - but I don't write
emulators where the priorities are different :-) [Fasterer is
definitely betterer, agreed!]

 X/true.c isn't, but arch/stddisplaydev.c is (which as you've spotted
 contains the guts of the display code).

Oh yeah. I'll blame trying to get familiar with a new codebase, rather
than a complete failure of memory or reading ability ;-)

Cheers,

Andrew

-- 
Andrew Flegg -- mailto:and...@bleb.org  |  http://www.bleb.org/

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
-- 
arcem-devel mailing list
arcem-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/arcem-devel


X11 video scaling

2012-07-27 Thread Andrew Flegg
Hi,

Is there something I've missed which'd allow video scaling (say 2x)
for modes  640x480.

It looks like the other ports have something like it, so are there any
pointers for where to start hacking on it? Presumably, the scaling
factor and size at which to do scaling should be configurable. Perhaps
as a minimum size option? Anything smaller than that gets (integer)
scaled to get as close as possible?

Full screen would be best, but I've found emulators and Compiz don't
seem to like not FUBARing my desktop after finishing with them.

Cheers,

Andrew

-- 
Andrew Flegg -- mailto:and...@bleb.org  |  http://www.bleb.org/

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
-- 
arcem-devel mailing list
arcem-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/arcem-devel