Cursor on V9990

Page 1/2
| 2

By Juan Luis

Expert (71)

Juan Luis's picture

23-11-2019, 01:19

I am developing proof of concept software for V9990 in B3 mode and I wanted to use hardware cursor for mouse cursor. Is there any source code example?

I'm trying to display the cursor, but it don't appears, even changing memory and registers directly in OpenMSX debugger.

Login or register to post comments

By Manel46

Champion (459)

Manel46's picture

23-11-2019, 10:22

Take a look here.
http://msxbanzai.tni.nl/v9990/manual.html#cursor
For the patterns:

PATTERNS
 PUSH HL
 DI
 LD E,7
 LD HL,#FF00
 CALL G9kSetVramWrite
 ;LD HL,PATRO1  ;N0
 POP HL
 LD B,128
 LD C,60H
 OTIR      ;CURSOR 1
 LD B,128
 OTIR      ;CURSOR 2
 EI
 RET

For the attributes:

ATTRIBUTES
 DI
 LD E,7
 LD HL,#FE00
 CALL G9kSetVramWrite
 LD HL,ATRI_RAM  ;ATTRIBUTES IN RAM
 LD B,16         ;8 FIRST COURSOR ONLY
 LD C,60H
 OTIR
 EI
 RET

In bitmap modes, we can configure 2 cursors of 32x32 pixels.

By Manel46

Champion (459)

Manel46's picture

23-11-2019, 12:07

I forgot. Configuration of the registers, for the cursors:

 G9kWriteReg 8,00000111B
 G9kWriteReg 28,1

By Juan Luis

Expert (71)

Juan Luis's picture

23-11-2019, 13:20

Manel46, a couple of questions more.

- Were you one of the developers of Merry Christmas demo 2018 cartridge (MC2018.ROM)?
- If the answer is yes, is the upper message with the developers members of the demo implemented by V9990 hardware cursor?

By Manel46

Champion (459)

Manel46's picture

23-11-2019, 15:03

Yes, I am the programmer of this rom that you comment.
I do not understand very well what you say next. Fucked google translator.
You can ask via email if you want. Surely we speak the same language.

By Juan Luis

Expert (71)

Juan Luis's picture

23-11-2019, 17:48

Don't worry. I apologize for my poor english.

There is a message during MC2018.rom demo execution that says: "Code by Manel", "Graphics by Paco", "Music by Meits", "V9990 B3 Mode". This message is moved around a ellipse trajectory.

My question is if this message is implemented by the V9990 cursor. I could check that the answer is yes because I have attached OpenMSX Debugger during execution and I have enabled bit 6 of reg #8 in V9990 for disabling cursor and the message dissapeared, so the conclusion is the animated message you implemented is the V9990 cursor. I'm tracing the program with the Debugger.

Thanks for your help.

By Manel46

Champion (459)

Manel46's picture

23-11-2019, 19:06

What you say is correct. The two cursors together, form these writings, and move with an elliptical trajectory.
In addition, the EOR bit is activated, which achieves a pleasant effect. This can be seen in real HW, or in the Open msx, of versions later than 0.15.0, where it was implemented. If not, it looks black.

By Juan Luis

Expert (71)

Juan Luis's picture

30-11-2019, 20:24

Thanks Manel46. I was able to develop a code with hardware cursor. Here you can find a rom file:

https://drive.google.com/drive/folders/1a_CY1ZD8t5vYIuwDE3NH...

I hope the above link can be accessed.

I have some additional questions:
1.- Does this .rom file work fine on a real machine with GFX9990? I can't check it because I don't have a real machine.
2.- Why must I activate DMA channel? On OpenMSX, the code works fine without enabling DMA
3.- You use in register 8 VLS1 = 1 and VLS0=1 (undocumented memory configuration). I use VLS1 = 1 and VLS=0 (256k word x 4 bit VRAM, 4 units 512Kbytes), and it works fine, at least in OpenMSX.
4.- Is there any way of capture the mouse in OpenMSX when you are moving mouse pointer out of OpenMSX window? I'm trying to check if mouse cursor get to the borders of the screen and I can check it because mouse cursor stops when Windows mouse pointer leaves OpenMSX window.
5.- Why can't I see entire the image when OpenMSX is full screen? I can't see the right end of the image.

Manel, thanks again for your help.

By Manuel

Ascended (15815)

Manuel's picture

30-11-2019, 21:34

4. See the tips in the User's Manual here: http://openmsx.org/manual/user.html#mouse
5. Please try a recent development build, it has much better support for full screen than openMSX 0.15.0.

By Juan Luis

Expert (71)

Juan Luis's picture

30-11-2019, 22:31

Thanks Manuel for the mouse tips. Is there any precompiled nightly build of OpenMSX for Windows anywhere? It's hard to compile OpenMSX. It requires many 3rd parties.

By Manel46

Champion (459)

Manel46's picture

30-11-2019, 23:38

I can't see the rom in the Open msx. What configuration do you use? What kind of mapper is this rom?

Page 1/2
| 2