V9958 two page horizontal scrolling

Page 1/3
| 2 | 3

By kanageddaamen

Rookie (25)

kanageddaamen's picture

31-03-2018, 16:27

I have been reading the V9958 Technical Data Book (http://map.grauw.nl/resources/video/yamaha_v9958_ocr.pdf) mainly with concerns to the two page horizontal scrolling when I came across this section at the top of page 7:

Quote:

When SP2=1, bit 5 (A15) of the pattern name table base address register (R#2) should be set to “1”.

The base address of each table will be as follows.
Pattern name table (PNT): 0 to 31 (when A15 is set to “0”)
32 to 63 (when A15 is set to “1”)

Which is very unclear to me. Is this just saying that the base address of the pattern name (layout) table for "Page 2" of the scroll must be the base address of the patter name (layout) table of "Page 1" just with A15 set to 1? (e.g. Page 1: 0x03800, Page 2:0x0B800)

Login or register to post comments

By Grauw

Ascended (8516)

Grauw's picture

31-03-2018, 16:42

I think if you want to scroll across two pages in screen 5, you can only do so between pages 0-1 and 2-3, you can’t scroll between pages 1-2. And the pattern name base address should to mask the six rightmost bits, setting A10-A15 to 1, otherwise you’ll get mirroring.

These details are a bit hard to understand for me too, but I think it may have to do when scrolling across two pages in screen modes lower than screen 5.

But I’ve never scrolled across two pages myself, or in modes other than screen 5, so this is just my interpretation. Best to just try it I suppose, I would like to know too if someone has further details.

By kanageddaamen

Rookie (25)

kanageddaamen's picture

31-03-2018, 16:48

Apologies, I should clarify that I will be interested in doing this in Graphics 3 (MSX Screen 4)

By Grauw

Ascended (8516)

Grauw's picture

31-03-2018, 17:22

Ah, ok, relevant Smile. I think it means that A15 must be set to 1 in all screen modes, and it considers the base address + 8000H to be the 2nd page? The phrasing “(when A15 is set to 0/1)” I think refers to that A15 will be controlled by the horizontal scroll amount.

I wonder though, if you’re using screen 4, why do you want to scroll across two pages? You only need to update 32 VRAM tiles every 8 pixels that scroll in… It seems easier to just work within the one screen. Well, unless your play area will be exactly 2 pages (512 pixels) wide, or if you just want to use it for quick scrolling transitions between otherwise non-scrolling pages.

By kanageddaamen

Rookie (25)

kanageddaamen's picture

04-04-2018, 17:43

So I did some testing and found the following (This was in screen 4, and the initial base address of 1800h for the pattern layout table):

  • If A15 was set to 0 and scrolling was set to 1 page, it acted as expected, with circular scrolling of the single page
  • if A15 was set to 0 and scrolling was set to 2 page, it behaved as if it was only set to 1 page scrolling, scrolling the page at 1800 circularly
  • if A15 was set to 1 (9800h) and scrolling was set to 1 page, it would scroll the page at 9800h as expected, with circular scrolling of the single page
  • if A15 was set to 1 (9800h) and scrolling was set to 2 page, it would get the pattern layout for page 1 from the base address with A15 cleared (1800h) and the pattern layout for page 2 from the base address as it was set (9800h), starting scrolling from page 1 and into page 2

It is a little counterintuitive that the base address you need to set for the pattern layout table is actually the base address for page 2, with the base address for page 1 being calculated from that, rather than the other way around, which is what caused my confusion.

I would also note that these pages share the same patter generator and color tables.

I didn't test for screen 5 but I imagine the behavior is the same.

The only real reason I can see for using 2 page scrolling at the moment is, since you can update the undisplayed page, you do not need to enable the mask bit, allowing you to effectively have 16 (32 in screen 6+) more pixels on the horizontal.

By Manel46

Champion (463)

Manel46's picture

04-04-2018, 17:30

I tried this a long time ago. In screen5 and 2 pages.
The boot is not good, but the scroll goes well
https://drive.google.com/open?id=12v6-gsxLEYKTjD9oYwLSHATbNG...

By Grauw

Ascended (8516)

Grauw's picture

04-04-2018, 17:57

Thanks for reporting back! That's clear then Smile. Good info!

The mask is only 8 pixels though, at least in screen 5. And if the mask is disabled, it doesn't give you 256 pixels unfortunately, rather you see the right border stay still while the left border moves and flips 8 pixels at a time. Or is it different in 2 page mode? Don't think so, right?

I think hiding that flipping is the primary reason for the mask. In screen 2 / 4 you can write 32 tiles easily in vblank, so the absence of a mask in itself needn't stop you...

By Manel46

Champion (463)

Manel46's picture

04-04-2018, 18:40

Grauw.
I understand that what you say is correct. 8 pixels are lost to the left.
For double page, bit 0 of R # 25 must be activated. And to mask the 8 pixels, you have to activate the 1.
That is to write 11b in R # 25.

By Grauw

Ascended (8516)

Grauw's picture

04-04-2018, 18:55

Yeah I just got home so I was able to try it, and indeed it is like that. Too bad, if it had shown the full 256 pixels in 2-page mode it would’ve been a reason for me to use it Smile.

By kanageddaamen

Rookie (25)

kanageddaamen's picture

04-04-2018, 19:00

Apologies, you are right, it is just the left 8 pixels (16 in Screen 6 and 7,) I mistakenly thought both sides were masked

By kanageddaamen

Rookie (25)

kanageddaamen's picture

04-04-2018, 19:06

In my testing with screen 4 I saw smooth scrolling without anything flipped with masking disabled in both single and double page. I assumed the masking was needed as if you updated a column of patterns for the incoming right side, but the column was still partially on the left side, you would see it get changed.

Page 1/3
| 2 | 3