RAD-X8 / Breaker style scrolling

Page 1/2
| 2

By Geniclé

Supporter (14)

Geniclé's picture

10-07-2008, 21:57

Hi all,

To me it has been a frustration since about '88. Pretty sure I was very close to creating a scrolling game using VDP(24), but there was one big problem: sprite definition area in the video memory.
Games like Rad-X8 were to obfuscated for me at that time. A while ago I read an article explaining how to write your own vertical scroller game. But I don't have the sourcecode / library that should come along.

My question: what is the big secret to move the sprite definition area to another video page so all lines are available for scrolling? That's all... I remember that I also figured out to copy 4 8x8 images at each lined I scrolled to make a smooth scroll.

My psych advised me to ask this question... I was about 15 at the time. Now I'm 35 and still puzzled... Even though I probably have forgotten some registers and bitz.

A simple answer would suffice, TIA!

Login or register to post comments

By Maggoo

Paragon (1216)

Maggoo's picture

10-07-2008, 22:06

Ah that's an easy one. MSX2 can have multiple pages so you just need to set the VDP register so that your sprites attributes are stored in another page than the page which is currently displayed. This can be confusing in basic, but that's how it is usually done for most games.

By Geniclé

Supporter (14)

Geniclé's picture

10-07-2008, 22:19

That I know. But I remember not being able to move the table of the screen - for some odd reason. Btw, I did program the stuff in ASM using the timer-hook for a constant speed. I admit... Maybe I am looking for a simple demonstration/description of how to set up the VDP registers.

Thanx for the amazing quick reply!! MSX is still alive, I see Smile

By Guillian

Prophet (3507)

Guillian's picture

10-07-2008, 22:41

You need to set R#5, R#11 (attributes) and R#6 (patterns)
I.e.:
LD A,&H10
OUT (&H99),A
LD A,&H86
OUT (&H99),A
LD A,1
OUT (&H99),A
LD A,&H80+11
OUT (&H99),A
LD A,&HEF
OUT (&H99),A
LD A,&H85
OUT (&H99),A

By Geniclé

Supporter (14)

Geniclé's picture

10-07-2008, 23:02

Thanks a lot! I have to dive into the documentation to verify this, but believe me... This is really that has had my attention for the last years. I will not code a game or anyting, but just to have the answer... Thanx!

By ARTRAG

Enlighted (6866)

ARTRAG's picture

11-07-2008, 18:21

Read this site:

http://map.tni.nl/sources/vdp_rout.php

there are tons of useful asm routines for msx 2

By Geniclé

Supporter (14)

Geniclé's picture

11-07-2008, 23:36

Hi Guillian,

First of all: thank you for your code fragment. It kept me busy Smile
I've seriously spend quite a few hours on some 'ol time research. But I seem to be stuck where I was stuck back than...
You're writing 0x10 to R6 and 0x1EF for the hi/lo to R11 and R5. Referring to some VDP info I found, this is:

R6: 0 0 0 1 0 0 0 0
0 0 A16 A15 A14 A13 A12 A11

R11: 0 0 0 0 0 0 0 1
0 0 0 0 0 0 A16 A15

R5: 1 1 1 0 1 1 1 1
A14 A13 A12 A11 A10 1 1 1

When the Ax refers to address bits, R6 would point to VRAM address 0x4000 which is in visible range for the 32Kb SCREEN 5 page. The sprite attributes would lay on 0x7C00 which is also under 0x8000.
I assume I'm making a thinking error here. Are the addresses multiplied with a certain factor?

Cool. Never expected to spend a friday night on this old frustration Smile
If someone has some simple code example, I'd be happy.

By Geniclé

Supporter (14)

Geniclé's picture

11-07-2008, 23:45

ARTRAG, I've read the routines but my problem is specifically pointed at the use of the VDP regs 6, 11 and 5. Don't understand how the address. There must be some kind of multiply factor to be able to move the sprite definition area through the 128Kb video memory.

By multi

Expert (74)

multi's picture

12-07-2008, 00:17

Maybe you forgot that you need A0 - A15 to access 64kb, since the video ram is 128kb the A16 line is also there. No multiply needed there... (however I thought there was 192kb possible as vram in an MSX, and how that works is a mistery to me also)

By Edwin

Paragon (1182)

Edwin's picture

12-07-2008, 00:20

R6 at $10 is rather curious as this would indeed point to 0x4000. It should point somewhere between $6A00 and $8000. The second address sounds correct, $7C00 is between line 212 and the next page in vram (line 256 or $8000).

Of course, when you start using the R23 scroll register, the whole page becomes visible area and you should move those tables somewhere else.

By Guillian

Prophet (3507)

Guillian's picture

12-07-2008, 10:36

R#6 at #10 points to #8000, so if you are working in SCREEN 5, you can use page 0 (#0000-#7FFF) as visible area and page 1 (#8000-#FFFF) for storing different sprite banks, graphics or whatever you need.

About 192K VRAM. To access those extra 64K you need to set R#45 bits 4 and 5 to select expanded memory as source and/or destination when using VDP commands. It can't be accessed directly as normal VRAM.

Page 1/2
| 2