Putting an image in the screen?

Page 4/5
1 | 2 | 3 | | 5

Par commodorejohn

Expert (92)

Portrait de commodorejohn

19-01-2011, 14:24

I'd have to look over the documentation again, but I thought there was a way to select which "page" of VRAM the command reads from or writes to...be pretty useless if there wasn't.

Par commodorejohn

Expert (92)

Portrait de commodorejohn

19-01-2011, 16:21

Okay, looked over the VDP guide - it looks from the section on VDP commands like the whole VRAM area is just chained together vertically. That's the reason the Y coordinate for commands is 10 bits wide. So page 0 takes the space from Y = 0 to Y = 255 (although only 192 or 212 lines are displayed,) page 1 is from Y = 256-511, etc. In that case, all you need to do is set up "pages" of tile and object graphics in the extra space and copy into the display page as needed.

Par Metalion

Paragon (1622)

Portrait de Metalion

19-01-2011, 16:33

Display page 1 - Clear page 0 - Draw on page 0
Display page 0 - Clear page 1 - Draw on page 1
Display page 1 - Clear page 0 - Draw on page 0
Display page 0 - Clear page 1 - Draw on page 1
...

WinkWinkWink

Par Daemos

Paragon (2044)

Portrait de Daemos

19-01-2011, 17:05

oO I think I get the point and all the sudden the whole Idea of VDP commands just falls apart in my head.

I just wonder that in this case, where we are prerendering the data into another page, it still remains possible to use the logical move commands because I can't find any reference that tells me to execute the command for example in another page. Or fetch the data from another page.

For now I have solved the problem by drawing the block on the outer edge of page 0, outside the visible area. That piece of data is constantly being copied into the new VRAM position AFTER another call fills the old position with backround color pixels. It is almost what Metalion is suggesting but perhaps just not as effective as.

What I really love about these VDP commands is the fact they get executed while in the meanwhile you can continue doing other stuff. So once in a while you poll for ready and shoot the next command in.

This pages of tile concept is what I see in most PC map editors right? Basicly all the things I want to make visible on the screen or better say all the pieces of the puzzle are hidden inside a page of VRAM so that the user cannot see what happens underneath the hood?

This means that when I need to expand my VDP skills in the future I propably have to forget about these VDP commands and come up with something more effective? I am starting to get a feeling that I have very much to learn Wink

Par commodorejohn

Expert (92)

Portrait de commodorejohn

19-01-2011, 17:40

I just wonder that in this case, where we are prerendering the data into another page, it still remains possible to use the logical move commands because I can't find any reference that tells me to execute the command for example in another page. Or fetch the data from another page.
Well, that's what I was trying to get across - there's no selector for pages because the Y coordinate stretches across all pages. In effect, VRAM becomes a 256x1024 bitmap of which only 256x192 is visible, but you can copy data freely within it.

As far as metalion's suggestion, that's for double-buffering, so that you can do all the drawing for one frame in a page that's not being displayed, while you're displaying the previous frame in another page. That'll take more VRAM, but it means that the player won't see half-drawn frames if the drawing operations extend past the vertical blank area.

Par Daemos

Paragon (2044)

Portrait de Daemos

19-01-2011, 17:54

omg stupid me. Yes I see it now. I was thinking in a wrong direction here. Both VRAM writes and VDP commands stretch over the entire memory by using and additional higher bit register just as you described. That means that I was allready going into the right direction after all Smile Well now that I got these things straight the time has come draw a second block into the VRAM

Par Daemos

Paragon (2044)

Portrait de Daemos

19-01-2011, 23:30

Strange. So I have managed to write something into the other page but somehow I only manage to do it right when I write into page 2 and copy it from there. When I put something into page 1 I still see the image on the screen. I expected that any VRAM write above the 32 KB region would into a non visible image. Any explanation for this?

Using screen 5 which uses 32KB for the screen in the VRAM I have to set the 17th adress bit to 1 so that is the 64KB region and above. What is happening here?

Par Edwin

Paragon (1182)

Portrait de Edwin

19-01-2011, 23:53

That's how it should be. Assuming you're looking at the first page in sc5. So if something is visible, you have made a mistake somewhere.

Par Metalion

Paragon (1622)

Portrait de Metalion

20-01-2011, 09:12

No offense, but it seems to me that before trying to write such a program in machine code, you should try first to better understand the graphic architecture of the MSX2.

IMHO, you should try to make your first steps in BASIC, and then, when you have fully understood how it works, switch to machine code (or maybe a mix of both).

Tongue

Par Daemos

Paragon (2044)

Portrait de Daemos

20-01-2011, 20:45

I try to understand the graphic architecture by talking to the machine in a direct way. When I would do this in basic I still won't learn what the VDP IC exactly does and how because some interpreter does all the translation for me. I learn by doing and I am making big progress. I now understand the Z80 to a very high extend and now try the same for the V9958. Step by step I try to learn to talk to every piece of hardware word by word. There seem to be many mistakes in the V9938 guide which (thnx to all of your help) have been pointed out by now. I will list these errors soon and post them in the apropriate place.

By now I have learned how to make proper calls and more efficient, writable code. The block on the screen can resize with key presses, move around, change color, collide against the side of the screen and even paint things in color on my screen.

By no means and not by any time soon Ill be writing something big like space manbow Tongue but I will dream forward to it. Smile2

Another problem is that assembly has an extremely high addictive value Smile When something works I feel a rush. Knowing that you are actually really saying the right things to the machine. I have never had so much fun in programming a machine before. When working in assembly I understand why I had bought that MSX Wink

Offcourse just to make sure: absolutely no offense taken. I 100% understand your words and I would have said the same to newbies too. I am the idiot that stepped on the bike and hit every pole on the roadside before finally holding the steerwheel straight. Big smile

Page 4/5
1 | 2 | 3 | | 5