Changing TEXT / HIRES display size?

The Oric video chip is not an easy beast to master, so any trick or method that allows to achieve nice visual results is welcome. Don't hesitate to comment (nicely) other people tricks and pictures :)
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Changing TEXT / HIRES display size?

Post by Symoon »

Hi,

I'm struggling with TEXT/HIRES attibutes, so I'm requesting wizards help there.

What I'm trying to do is, in HIRES mode, having one two extra TEXT lines displayed at the bottom. That would mean reducing the HIRES screen by 16 lines as I would be replacing them by two TEXT lines.
I won't be using the TEXT lines, my goal is actually to have 14 lines not displayed (16 Hires - 2 Text lines), so I can use them as data storage without displaying garbage on screen.

Do you think it can be done? I've been trying again and again but each time I think I understood the way it works, I ended up with strange displays exactly where I don't want :-D

Thanks!
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Changing TEXT / HIRES display size?

Post by Dbug »

Not sure that works 100%, but here is an attempt:
image_2022-08-06_134923756.png
image_2022-08-06_134923756.png (8.53 KiB) Viewed 16800 times

Code: Select all

10 PAPER 0:INK 3:HIRES
20 PRINT"LINE1":PRINT"LINE2":PRINT"LINE3";

50 POKE #A000+40*184,26      ' TEXT

100 FOR J=0 TO 1:FOR I=0 TO 40
110 POKE #BB80+40*(23+J)+I,16+1+(I AND 3)+J  ' Some patterns in TEXT
120 NEXT I:NEXT J

200 POKE #BB80+40*25,31       ' HIRES

305 CURSET 120,100,3
310 FOR I=1 TO 99 STEP 25   ' Draw some circles
320   CIRCLE I,2
330 NEXT I

400 FOR I=1 TO 40*14
410 POKE #A000+40*184+I,42    ' Fill with some stuff
420 NEXT I

10000 GET K$
User avatar
Chema
Game master
Posts: 3013
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Changing TEXT / HIRES display size?

Post by Chema »

Not sure if it will help, but I did something similar in Oricium: scorepanel in HIRES, then TEXT for the play area (alternating character sets), then HIRES again to get the two last lines as TEXT with another character set for the radar.

You can check the sources here https://osdn.net/projects/oricsdk/scm/s ... m/common.s

Routine _prepare_play_area calls (line 269) does all the work, but first calls set_graphic_attributes (line 249) HIRES is switched to TEXT.

EDIT: Dbug already answered providing all the relevant information :lol:
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: Changing TEXT / HIRES display size?

Post by Symoon »

You guys are amazing. Thanks A LOT for the prompt replies!
I'm all over the place thinking about various things and have hard times focusing on things, this will be very helpful :)
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Changing TEXT / HIRES display size?

Post by Dbug »

Ultimately it's not very complicated, but you need to remember things like:
- The HIRES and TEXT modes overlap, so some addresses ends up being the same
- To switch to HIRES you need to put the attribute in some TEXT area which is going to be read by the ULA
- To switch to TEXT you need to put the attribute in some HIRES area which is going to be read by the ULA
- Depending if you are in TEXT or HIRES/TEXT, the charset will not be read from the same location
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: Changing TEXT / HIRES display size?

Post by Symoon »

For the fun: it turns out that I was poking the right addresses, but... In direct mode, so when pressing enter and displaying Ready, the HIRES attribute was scrolling and everything got scrambled ;)
Thanks again!
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Changing TEXT / HIRES display size?

Post by Dbug »

Symoon wrote: Sat Aug 06, 2022 1:57 pm For the fun: it turns out that I was poking the right addresses, but... In direct mode, so when pressing enter and displaying Ready, the HIRES attribute was scrolling and everything got scrambled ;)
Thanks again!
When using direct mode in HIRES, POKE #1A,96 is your friend
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: Changing TEXT / HIRES display size?

Post by Symoon »

Dbug wrote: Sat Aug 06, 2022 1:12 pm - To switch to HIRES you need to put the attribute in some TEXT area which is going to be read by the ULA
- To switch to TEXT you need to put the attribute in some HIRES area which is going to be read by the ULA
I'm back with questions ;)
I'm tying to have the following, being at start in HIRES mode:
1- have the first 16 HIRES lines (on top) converted into 2 TEXT lines,
2- have the rest in HIRES, except...
3- have the last 23 HIRES lines + the "hidden" line (#BF40-#BF67) converted as 3 TEXT lines
4- have the last 3 TEXT lines back to "hires" so they are displayed with the right char definition

When I do (EDIT: that's BB80, not BB40) POKE#BB80,#1A:POKE#BBD0,#1F, this executes above steps 1, 2 and 3 since, by luck (?), the first line at point 3 is actually the address of the first TEXT screen line.
But step 4 is not (obviously, having done nothing about it), it keeps displaying scrambled text.
But I don't manage to find if step 4 is actually possible. It seems that as soon as I manage to do it, it cancels the two TEXT lines from step 1?
Last edited by Symoon on Thu Sep 08, 2022 1:57 pm, edited 1 time in total.
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Changing TEXT / HIRES display size?

Post by Dbug »

I need to think about it, and generally that involves taking a piece of paper and writing down the various section of screen and which address maps to what, knowing you have the charsets somewhere around the middle.

So if I understand well, you want:
2 lines in TEXT at the top of the 240x200 area
160 lines of HIRES
3 lines of TEXT at the end of the 240x200 area
plus the remaining last 3 lines of TEXT using the HIRES charsets

at first glance I don't think you can do that, because your 2 lines of TEXT at the top will need the TEXT charset which will be right around the middle of the HIRES screen
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: Changing TEXT / HIRES display size?

Post by Symoon »

Dbug wrote: Thu Sep 08, 2022 11:33 am So if I understand well, you want:
2 lines in TEXT at the top of the 240x200 area
160 lines of HIRES
3 lines of TEXT at the end of the 240x200 area
plus the remaining last 3 lines of TEXT using the HIRES charsets
That's it exactly.

To be clearer, inside the HIRES area, my main goal is to use each TEXT line to hide the corresponding 8 HIRES lines and re-use them as memory. So the TEXT lines there will remain black. This way, I'm "wasting" (2+3) lines * 40 bytes, ie 200 bytes (filled with black paper attribute for instance), to hide (2+3)*7*40 = 1400 bytes from the HIRES screen, which I will be able to use as standard RAM, not being displayed.

Regarding the very last 3 TEXT lines, I'm not sure yet if they'll be used or not. If not, problem solved: my 4th step is useless and I can fill them too with black paper attributes.
That just drove me curious to try and set two different zones.

I'm dividing it into two parts because of the Oric-1 bug which crushes some of the Hires screen from #BB80 (displaying "Loading" etc.). This just makes me wonder if this bug won't crush the HIRES/TEXT attribute... What a headache ^^
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: Changing TEXT / HIRES display size?

Post by Symoon »

Symoon wrote: Thu Sep 08, 2022 7:26 am When I do POKE#BB80,#1A:POKE#BBD0,#1F, this executes above steps 1, 2 and 3 since, by luck (?), the first line at point 3 is actually the address of the first TEXT screen line.
Ok, the "Searching/Loading" display in HIRES on Oric-1 will crush the #1A attribute in #BB80.
So I guess this "split solution" is dead.

I'm going to set my Hires "window" at the top, and simply hide the bottom of screen, avoiding to use the Oric-1 bug are which will be in the middle of the hidden zone.
This solves the problem (though not answering if we could have multiple splits, but there is no need behid this question anymore, for now at least ;) )
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: Changing TEXT / HIRES display size?

Post by Symoon »

Thinking more, I can set the #1A attribute after the Oric-1 bug area (it doesn't affect an entire line).
This line will remain visible, but that's OK since Oric-1 ROM fills its first 28 chars in black once it has finished "Loading .."
I'll try not to use the bottom text lines.
SCREEN90.png
SCREEN90.png (2.52 KiB) Viewed 16383 times
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: Changing TEXT / HIRES display size?

Post by Symoon »

That's funny, by doing like above, what is displayed on the line with $1A (HIRES line) is also displayed on the 1st line as a TEXT character (it's actually the status line).

So by changing a single byte value, two displayed bytes are affected. Really challenging for the brain ^^
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Changing TEXT / HIRES display size?

Post by Dbug »

Symoon wrote: Tue Aug 15, 2023 6:26 am So by changing a single byte value, two displayed bytes are affected. Really challenging for the brain ^^
It's exactly what is happening there:
image_2023-08-15_073452417.png
image_2023-08-15_073452417.png (1.77 KiB) Viewed 11331 times
The big scroll and the small scroll are the exact same area of memory, shown once as TEXT with 8x6 blocks, and then a second time as HIRES with 8x1 blocks, and that works because it's all drawn with PAPER color attributes which work the same in both TEXT and HIRES:
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: Changing TEXT / HIRES display size?

Post by Symoon »

Very smart! I know I'm a slow learner, I'm only something like 20 years late :mrgreen:

1st use case I'd see for that would be a magnify function in a drawing program.
Post Reply