How to change the shape of the cursor?

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 :)
Brana
Flying Officer
Posts: 169
Joined: Fri Nov 30, 2007 8:30 pm
Contact:

How to change the shape of the cursor?

Post by Brana »

Hello,

I am wondering is it possible to change the shape of the Oric's cursor?

I know what, and how to "poke" in order to change the /example/ the appearance of the letter "A",

but is it possible to "poke" in order to change the Oric's cursor from it's basic square-shape into something else?

Example: instead of square-flashing cursor, to have a "lower-line"-flashing cursor? Or any other shape? It could be useful in some games?

Brana
mmu_man
Flight Lieutenant
Posts: 322
Joined: Thu Sep 21, 2006 7:45 pm
Location: 26000 Valence, FRANCE
Contact:

Post by mmu_man »

the manual gives some variables about the cursor but nothing alike.
CURON #270
CURINV #271
MOVE0 #26A (bit 0)
maybe CURON or CURINV is a list of lines to invert, but it doesn't seem so after testing.
User avatar
waskol
Flight Lieutenant
Posts: 414
Joined: Wed Jun 13, 2007 8:20 pm
Location: FRANCE, Paris

Re: How to change the shape of the cursor?

Post by waskol »

Brana wrote:Hello,

I am wondering is it possible to change the shape of the Oric's cursor?

I know what, and how to "poke" in order to change the /example/ the appearance of the letter "A",

but is it possible to "poke" in order to change the Oric's cursor from it's basic square-shape into something else?

Example: instead of square-flashing cursor, to have a "lower-line"-flashing cursor? Or any other shape? It could be useful in some games?

Brana
Yes it is possible !
But as far as I remember (so I can be very wrong !), you will not be able to use any shape. The only thing you can do is to setup the "height" of the cursor, thus sticking with a rectangular shape.
With a heigth of 1, for instance, you will get a "lower-line" cursor.
....
(searching data...)
....
found !

Anyway, the Graphic cursor mask resides at address #215, thus an instruction like this :
poke #215,I should do the trick, but I don't know exactly how.
mmu_man
Flight Lieutenant
Posts: 322
Joined: Thu Sep 21, 2006 7:45 pm
Location: 26000 Valence, FRANCE
Contact:

Post by mmu_man »

Ah I knew I've seen this before, oddly it's not mentionned in the atmos manual.
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Post by Dbug »

That's kind of strange it's possible to do that.

I was thinking that the "cursor" was only playing with the bit 7 of the character ot screen to set the video inversion ON and OFF.
Yicker
Pilot Officer
Posts: 97
Joined: Thu Jan 26, 2006 11:27 pm
Location: St. Helens, Merseyside, UK

Post by Yicker »

Don't know if this will help, it's taken from the Oric Advanced User Guide.

Code: Select all

F801 2D 6A 02  AND $026A     This routine turns the cursor
F804 4A        LSR A         on or off depending on value
F805 6A        ROR A         in A. 0 for off, 1 for on.
F806 8D 65 02  STA $0265     Cursor being turned on is
F809 AC 69 02  LDY $0269     subject to cursor flag being
F80C B1 12     LDA ($12),Y   enabled.
F80E 29 7F     AND #$7F
F810 0D 65 02  ORA $0265
F813 91 12     STA ($12),Y
F815 60        RTS
Scott
User avatar
waskol
Flight Lieutenant
Posts: 414
Joined: Wed Jun 13, 2007 8:20 pm
Location: FRANCE, Paris

Post by waskol »

mmu_man wrote:Ah I knew I've seen this before, oddly it's not mentionned in the atmos manual.
I am pretty sure too, but where ??? Most probably in a Theoric issue, but I cannot be sure.
Dbug wrote:That's kind of strange it's possible to do that.

I was thinking that the "cursor" was only playing with the bit 7 of the character ot screen to set the video inversion ON and OFF.
And the thing is that I don't think it is emulated by euphoric or any other Oric emulator !...


This is a nice challenge there, isn't it ? :P
mmu_man
Flight Lieutenant
Posts: 322
Joined: Thu Sep 21, 2006 7:45 pm
Location: 26000 Valence, FRANCE
Contact:

Post by mmu_man »

That's entirely done in ROM, nothing magical.
Page 2 contains ROM variables.
It certainly uses the DEL char or another one and changes its shape.

It's quite usual for terminals to allow changing the cursor shape, even ANSI (MSDOS) allows setting the start and end line for the cursor block.
mmu_man
Flight Lieutenant
Posts: 322
Joined: Thu Sep 21, 2006 7:45 pm
Location: 26000 Valence, FRANCE
Contact:

Post by mmu_man »

Hmm though it doesn't seem to work here :)
Brana
Flying Officer
Posts: 169
Joined: Fri Nov 30, 2007 8:30 pm
Contact:

Re: How to change the shape of the cursor?

Post by Brana »

waskol wrote: Yes it is possible !
But as far as I remember (so I can be very wrong !), you will not be able to use any shape. The only thing you can do is to setup the "height" of the cursor, thus sticking with a rectangular shape.
With a heigth of 1, for instance, you will get a "lower-line" cursor.
....
(searching data...)
....
found !

Anyway, the Graphic cursor mask resides at address #215, thus an instruction like this :
poke #215,I should do the trick, but I don't know exactly how.

RE: If I understood You correctly, then if I would do something like this:

10 FOR A=0 TO 255
20 POKE #215,A
30 WAIT 150
40 NEXT A
50 END

That should “show” me all the possibilities of the cursor’s shape, but – nothing happens; cursor just continues to “blinks” at it’s basic square shape regardless of the value of “A” in the example above.

Are You sure you gave to me the right address to poke to? :)

Is it #215 (?)

Brana
User avatar
waskol
Flight Lieutenant
Posts: 414
Joined: Wed Jun 13, 2007 8:20 pm
Location: FRANCE, Paris

Re: How to change the shape of the cursor?

Post by waskol »

Brana wrote:
Are You sure you gave to me the right address to poke to? :)
Nope !
No it seems to mee to be the graphical cursor address (for curset,Circle,... for instance) :
20 CURSET 120,100,1
What could be possible anyway is to write a little asm code that use the slow interupt of page 2 :

Code: Select all

1) disables the cursor
2) - intercept the press of key  
    - poke to the current cursor position the caracter of your choice (addresses #268 for X and #269 for Y position)
    - Goto 2)
Brana
Flying Officer
Posts: 169
Joined: Fri Nov 30, 2007 8:30 pm
Contact:

Re:

Post by Brana »

But, now - it seems to me that it can NOT be done from within the Oric Atmos' BASIC :(
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Post by Dbug »

Well, you can in BASIC, but it's just not trivial.
Basically (haha) you can do that:
* Disable the blinking cursor
* each time you move the cursor, you pick up and save the value which is on screen, and you save it somewhere else.
* you use a special reserved character (for example ASCII code 127) and you redefine it with the same values than you find for the other character you just saved, except that you force the two last lines to some _ pattern
* you poke this special character in the place of the previous one on screen
* when moving again, you replace the saved character on the screen
User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Post by Twilighte »

ok, The Oric cursor is simply the inverse of whatever it is currently over, so if you boot the Atmos, then type D then move cursor back left the D appears as inversed D. There are 3 ways to change the cursor shape..

1) Ensure the cursor lyes over a character that modifies its shape and colour as desired :P

2) Write a complicated asm routine to redefine one of the existing characters(like code 127) to the current character under the cursor position then use this in place of the cursor in some devious way :twisted:

3) Take some tipex or a black pen and mask out the parts of the cursor you don't want. it does limit you to keep the cursor in the same place tho :idea:

But in essence you cannot change the shape of the cursor since it must be able to travel over any background text attribute without corrupting its effect on the rest of the line.

Also note that disabling the cursor does not remove the inverse property at the cursor location but only serves to not display the cursor there :shock:

This can be demonstrated by poking an inverse character into the text line, disabing the cursor then moving it (blind folded) over the inversed character, the inversed character is reset to normal video!

For example, boot the oric then type..

Code: Select all

POKE #BBD2,129
Now press CTRL Q to disable cursor and move up to top of page :!:
Post Reply