Sonic and Sega Retro Message Board: Control Port VDP - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
Page 1 of 1
    Locked
    Locked Forum

Control Port VDP

#1 User is offline cokyen 

Posted 23 July 2016 - 10:50 PM

  • Posts: 24
  • Joined: 19-June 16
  • Gender:Male
When you move data to the control port memory adress 0x00c00004, how does the processor know what to do with this? For itnstande , this code puts the value 8 + register number + register valiue at address 00c00004 19 times . How does it know to look at and do something. with the value in address 00c00000 before we jump to the next loop and assign address 00c00000 to something else?

267: 
268: |==============================================================================
269: | Initialize VDP registers
270: |==============================================================================
271: InitVDP:
272:    moveq   #18, %d0        | 24 registers, but we set only 19
273:    lea     VDPRegs, %a0    | start address of register values
274:    
275: 1: move.b  (%a0)+, %d5     | load lower byte (register value)
276:    move.w  %d5, (%a4)      | write register
277:    add.w   %d7, %d5        | next register
278:    dbra    %d0, 1b         | loop
279:    
280:    rts                     | Jump back to caller



This post has been edited by cokyen: 23 July 2016 - 11:02 PM

#2 User is offline MarkeyJester 

Posted 24 July 2016 - 06:14 AM

  • The architect of the universe, didn't build a stairway, leading nowhere.
  • Posts: 1842
  • Joined: 22-July 08
  • Gender:Male
  • Location:Japan
  • Wiki edits:16
It has a 4 word sized FIFO, this ensures that the VDP collects and processes the words in the order in which they are written. If the FIFO is overflown (by which I mean you attempt to put more words in, that the FIFO can hold), then the 68k will be halted/locked. It will not continue until the VDP has freed up the FIFO.

#3 User is offline flamewing 

Posted 24 July 2016 - 06:26 AM

  • Emerald Hunter
  • Posts: 1135
  • Joined: 11-October 10
  • Gender:Male
  • Location:🇫🇷 France
  • Project:Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
  • Wiki edits:12
Once again I have to point it out to you the Basic Questions & Answers thread. It is a pinned thread in this very forum, intended to not pollute the forum with hundreds of threads of very basic questions. You should ask these questions there.

Anyway: the concept involved here is memory-mapped I/O: some addresses in the M68K's addressing space do not point to memory, but to control ports of other devices. For the case at hand, address $C00004 actually point to the VDP's control port. When the VDP receives a word with the higher two bits being %10, it interprets the word as being a command to write a register. The format of such a command word is $8000 + [register number]<<8 + [data byte].

For a lot of information on the VDP, check this page; it shows all VDP ports, as well as detailing what the VDP registers do.

#4 User is offline cokyen 

Posted 24 July 2016 - 10:39 AM

  • Posts: 24
  • Joined: 19-June 16
  • Gender:Male
So when the VDP coprocessor acts on these control ports , how can it do it without the programmer writing commands to tell how and when to perform actions? Does it do it depended of the flow of the main 68000 code ?

#5 User is offline flamewing 

Posted 24 July 2016 - 11:01 AM

  • Emerald Hunter
  • Posts: 1135
  • Joined: 11-October 10
  • Gender:Male
  • Location:🇫🇷 France
  • Project:Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
  • Wiki edits:12
After being (correctly) initialized, the VDP renders frames on its own using the data on VRAM and the configurations specified. Commands sent through the control port either change the VDP's configuration on how it renders things (VDP register writes), or change data in VRAM (e.g., by triggering a DMA).

#6 User is offline cokyen 

Posted 24 July 2016 - 12:39 PM

  • Posts: 24
  • Joined: 19-June 16
  • Gender:Male
How does and or can the vdp,or any chip perform actions on stuff without being instructed with code?
This post has been edited by cokyen: 24 July 2016 - 12:40 PM

#7 User is offline MarkeyJester 

Posted 24 July 2016 - 01:14 PM

  • The architect of the universe, didn't build a stairway, leading nowhere.
  • Posts: 1842
  • Joined: 22-July 08
  • Gender:Male
  • Location:Japan
  • Wiki edits:16
The VDP (Video Display Processor) is a misnomer, specifically the "P", it should be called a VDC (Video Display Controller).

A microchip (programmable or otherwise) is composed of circuitry connected to multiple components, most of which are transistors which control the on/off state of a line. When setup in a correct arrangement, logical gates can be performed such as AND, OR and XOR, a combination of these setups can produce more complicated functions, such as addition, subtractions, multiplication, and division. Given the diversity of complex setups, you can design a chip that can perform almost any complicated task, and entirely automatically like clockwork if necessary.

The problem is, the "code" is a misconception, it's all an illusion to begin with, so to explain how a chip works without code, is to assume that programmable chips work "with" code, and not another series of circuitry. There is likely to be a prefixed series of circuit connections that perform the actions necessary, these could be interpreted as instructions, but at this stage, you'd be getting into philosophy. I don't have the specific circuitry details of this particular VDP chip, so I cannot go into depth. Even if I did have it, my post would likely span pages of detailed information, and chances are, you still won't understand. I suspect you're looking at this from too much of a broad distance (the area of which is illusional), and therefore, are expecting an illusional response to your question (of which, doesn't exist, because it's an illusion).

You're asking a question that people go to college and university to learn about, it's a deep level of understanding that people get paid to teach, and people pay to learn. You will not learn it from this board.

#8 User is offline flamewing 

Posted 24 July 2016 - 02:48 PM

  • Emerald Hunter
  • Posts: 1135
  • Joined: 11-October 10
  • Gender:Male
  • Location:🇫🇷 France
  • Project:Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
  • Wiki edits:12
Let me ask you this rhetorical question instead: when you give code to any processor, how does it know what to do with it? That is, how does it know it has to read one instruction from RAM/ROM, read all of its additional parameters, execute it, then repeat for the next instruction?

A simplified answer: the hardware is designed to perform a series of actions in quick succession, then repeat them over, and over. In the case of the VDP, the actions performed will draw a frame according to specified settings in registers and data in VRAM, periodically polling data from the FIFO along the way, then repeat. In the case of a processor, it reads instructions and executes them, then reads the next instruction, and so on.

But as Markey said, if you want more detail than that, you should take some classes in computer architecture at your local college/university, or study some books on the subject.

Page 1 of 1
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users