Hello world on V9990

Page 1/2
| 2

By Metalion

Paragon (1101)

Metalion's picture

30-12-2019, 16:02

Hi,

So I'm toying with the V9990 for the first time, and I'd like to make at least something appear on screen.

So far, I have been :
. sending zero to output_ctrl port 6Fh
. selecting P1 mode by setting R#6 at 0000_0101b, R#7 at zero, and sending zero to P#7
. selecting palette mode PP by setting R#13 to zero
. writing 255 at VRAM address 00000h (which sets the first 2 pixels of pattern 0)

But nothing appears on screen (and I mean nothing).
I've checked the VRAM at 7C000h/7C001h, and it's already 0, so it should display pattern 0.

Maybe I have to set the palette ?
Or am I missing something ?

Login or register to post comments

By GhostwriterP

Hero (527)

GhostwriterP's picture

30-12-2019, 16:23

Just a guess here, after sending zero to 6fh, you need to wait a bit (1 or 2 ints), you doing that?
then enable v9990 with zero to P#7 followed by the rest screen setting etc.

edit: possibly just need to enable screen with 128 in R#8

See below code for reference.

start
  xor a
  out (6fh),a           ;gfx9000 dingetje
  halt
  halt
  di
  ld c,99h              ;v9938/58 uitschakelen!
  ld d,128
  out (c),a
  out (c),d
  inc d
  nop
  out (c),a
  out (c),d
  out (67h),a          ;v9990 inschakelen!
  ld a,6               ;p1 mode instellen!
  out (64h),a
  ld bc,23:63h
  ld hl,gfx9000inittable
  otir
  ...
gfx9000inittable
  byte 00000101b    ; 6  Screen mode (nu: p1)
  byte 0            ; 7
  byte 128+2        ; 8  Control
  byte 1            ; 9  Interrupt 
  byte 0            ;10  line
  byte 0            ;11
  byte 0            ;12  x
  byte 0000b        ;13  Palette control
  byte 0            ;14  Palette pointer
  byte 0            ;15  Back drop color
  byte 0            ;16  Display adjust
  byte 0            ;17  Scroll control plane A
  byte 0            ;18
  byte 0            ;19
  byte 0            ;20
  byte 0            ;21  Scroll control plane B
  byte 0            ;22
  byte 0            ;23
  byte 0            ;24
  byte 0            ;25 Sprite base adress
  byte 0            ;26 LCD control
  byte 0            ;27 Priority control A and B
  byte 0            ;28 

By Metalion

Paragon (1101)

Metalion's picture

30-12-2019, 16:38

Thanks for the initialization code, it looks a little bit less messy than mine.
Now what I need after that is an example of lighting up 1 pixel, or a pattern, to show me the way.

By Manel46

Hero (515)

Manel46's picture

30-12-2019, 16:40

I think you better start with bitmap mode. What is displayed on the screen begins in the 0 direction of the vram.
If they are 4-bit / pixel graphics (screen5), you have to write the palette. If they are 8-bit / pixel graphics, no.
Study the Teambomba library.

By GhostwriterP

Hero (527)

GhostwriterP's picture

30-12-2019, 17:03

Indeed, the palette is also all black a start. Anyway, I can point you to some example code: spritepriotest
Other than that the Teambomba library is good as any other.

By Metalion

Paragon (1101)

Metalion's picture

30-12-2019, 19:14

GhostwriterP wrote:

Indeed, the palette is also all black a start. Anyway, I can point you to some example code: spritepriotest
Other than that the Teambomba library is good as any other.

Thanks, I'll try with this example code.

By Grauw

Ascended (8734)

Grauw's picture

30-12-2019, 19:27

Are you using openMSX? You need to change the video source with the “set videosource GFX9000” command. What’s even better is to use the “video9000” extension, if you look in the Video9000 manual you will find the correct instruction for enabling the gfx9000, then the emulator (and the real MSX if it has a Video9000 or compatible) will automatically switch input source.

By Metalion

Paragon (1101)

Metalion's picture

30-12-2019, 20:50

Grauw wrote:

Are you using openMSX? You need to change the video source with the “set videosource GFX9000” command.

Yes, I had noticed the need to do this in OpenMSX.
But the problem is probably the palette which is not initialized, and I'm working on it.
My "Hello world" on V9990 is scheduled for tomorrow morning Wink

By Manel46

Hero (515)

Manel46's picture

30-12-2019, 21:01

In reference to P1 or bitmap 4 bits / pixel, the following occurs:
When writing the palette on the V9990, keep in mind that it is not the same as in MSX2.
In MSX2 the 16 colors are chosen with two bytes for each one, one contains the levels of red and blue, and the other the level of green. While in V9990 the color is chosen with 3 bytes, one for each niver of R, G, B.
With the BMP2G9B utility, you have the file with the correct palette. The bmp has to be 16 colors, of course.

By Metalion

Paragon (1101)

Metalion's picture

31-12-2019, 00:35

Well, it still does not work.
What bothers me is that I do not have a black screen, but a white screen with absolutely nothing on it.

. v9990 is initialized according to the libraries
. P1 mode is set according to the libraries
. I set the palette only with color 8 = 31,0,0 (red)
. I write 3 bytes of 88h at 00000h
. I write 0000h at 7C000h
. OpenMSX switches correctly to video9000 source

Nothing.

	call	v9990.on
	call	v9990.set_P1
	ld	hl,test
	ld	a,0
	ld	de,0
	ld	bc,3
	call	v9990.ldir_vram
	ld	hl,plt
	call	v9990.set_palette
	ld	a,7
	ld	hl,0C000h
	call	v9990.set_write
	ld	hl,0
	ld	c,v9990.vram
	out	(c),l
	out	(c),h
	
.loop	jp	.loop	
	
test	byte	8*16+8,8*16+8,8*16+8

plt	
	byte	0,0,0	; 0
	byte	0,0,0	; 1
	byte	0,0,0	; 2
	byte	0,0,0	; 3
	byte	0,0,0	; 4
	byte	0,0,0	; 5
	byte	0,0,0	; 6
	byte	0,0,0	; 7
	byte	31,0,0	; 8
	byte	0,0,0	
	byte	0,0,0	
	byte	0,0,0	
	byte	0,0,0	
	byte	0,0,0	
	byte	0,0,0	
	byte	0,0,0

By Metalion

Paragon (1101)

Metalion's picture

31-12-2019, 00:45

I've got something onscreen !!!

But I had to disable the interrupts permanently in order to do that.
Is there something special about the interruptions and the v9990 ?

In the example code, there a special ISR, but I thought it was because it was a dos program.
It is sending the value 7 to the interrupt port (66h) at every interruption. Do I have to do that ?

Page 1/2
| 2