Mode 128x128

Got a programming project in mind? Tell everyone about it!
Post Reply
jubber
Posts: 49
Joined: Sat May 14, 2016 12:05 pm
Contact:

Mode 128x128

Post by jubber » Wed Dec 05, 2018 6:54 am

Hi there - I've just bought a copy of the Advanced User Guide and at some point I'm going to try fiddling with the video display. I'm after a mode that is 16 colour, square, but as low res as possible - but will still work on a standard Beeb with any type of monitor. Before I reinvent the wheel however (or fail to) has anybody managed to make a 16 colour 128 by 128 mode? A full colour 8k mode would be very useful for something like an RPG (my long term plan) otherwise I will have to use Mode 7.

Cheers,

Robin

RobC
Posts: 2366
Joined: Sat Sep 01, 2007 9:41 pm
Contact:

Re: Mode 128x128

Post by RobC » Wed Dec 05, 2018 8:22 am

For a long time, I would have said that it's not possible to change the vertical resolution on a Beeb but, amazingly, it was demonstrated recently in this thread: viewtopic.php?f=53&t=15707.

I'm not sure whether anyone has used the technique to produce a 128x128 mode yet but it should give you a useful starting point. Also, I don't know whether any of the emulators support this yet.

User avatar
Richard Russell
Posts: 544
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: Mode 128x128

Post by Richard Russell » Wed Dec 05, 2018 9:26 am

RobC wrote:
Wed Dec 05, 2018 8:22 am
For a long time, I would have said that it's not possible to change the vertical resolution on a Beeb but, amazingly, it was demonstrated recently in this thread: viewtopic.php?f=53&t=15707.
What's described in that thread relies entirely on the TV/monitor accepting a 'half rate' (or lower) horizontal sync (i.e. a sync pulse only on alternate lines). So it's not so much creating a new mode on the Beeb as defining an entirely non-standard video waveform which some TVs and monitors seem to lock to. But there's no guarantee that they will, and no guarantee that a CRT monitor/TV won't be damaged in the attempt. Personally I would advise against it.

jubber
Posts: 49
Joined: Sat May 14, 2016 12:05 pm
Contact:

Re: Mode 128x128

Post by jubber » Wed Dec 05, 2018 11:57 am

Ah - so is 256 the safe limit on vertical resolution? Essentially I'm after the smallest size with 16 colours (or 4 at a push). It seems therefore that Mode 8 (horribly wide pixels) from the AUG is the safe minimum.

That explains why the solution of storing graphics in the screen itself, and chasing the raster to turn off the colours, was such a popular option.

Cheers,

Robin.

RobC
Posts: 2366
Joined: Sat Sep 01, 2007 9:41 pm
Contact:

Re: Mode 128x128

Post by RobC » Wed Dec 05, 2018 12:31 pm

jubber wrote:
Wed Dec 05, 2018 11:57 am
Essentially I'm after the smallest size with 16 colours (or 4 at a push). It seems therefore that Mode 8 (horribly wide pixels) from the AUG is the safe minimum.
If you don't want to risk things, it's entirely possible to reduce the number of vertical pixels safely as you just reduce the value in the vertical displayed register of the CRTC (R6) to show fewer rows. However, this doesn't change the resolution/pixel size so the 128 displayed scanlines would only take up half of the screen.

You can use R4 to centralise things vertically and you can use the horizontal registers to reduce the number of horizontal pixels to 128 and centralise things horizontally.

By adjusting R12 and R13 so that screen memory starts at 0x6000 rather than 0x3000, you can claim back the unused screen memory.

Chapter 18 of the Advanced User Guide covers all the CRTC registers if you want more details.
Last edited by RobC on Wed Dec 05, 2018 6:55 pm, edited 2 times in total.

jubber
Posts: 49
Joined: Sat May 14, 2016 12:05 pm
Contact:

Re: Mode 128x128

Post by jubber » Wed Dec 05, 2018 2:21 pm

Well that's great information Rob - thanks very much. I'll give it a try

Cheers,

Robin

User avatar
tricky
Posts: 2951
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: Mode 128x128

Post by tricky » Wed Dec 05, 2018 5:56 pm

For part of the screen, you can trick the beeb into using MODE 7 addressing, where the same set of addresses are presented many times to the ULA, allowing the same row of data to be replicated.
Unfortunately, this comes in two separate chunks of 1K on a beeb (&3C00 and &7C00) and one chunk of 1K (&7C00) on the master appearing twice, once in shadow memory (requires an interrupt to swap and possibly vertical rupture).
So you can have very chunky graphics, but only for part of the screen, that is 1/4 of your 8K screen.
This was discussed in a thread about drawing a chess board, where the screen could be made narrower to make the 2K go a little further.
It might be used in the mode infinity demo, but I can't remember!
Some of the effects in the bitshifters demos use vertical rupture to display the same line several times. This will work on any beeb, but does burn most of the available CPU cycles while that part of the screen is being displayed. It also has the nasty side effect of using one byte in 8, so unless you can pack your data in chunks of 7 bytes it costs more than it saves!

Post Reply