don't click here

Control Port VDP

Discussion in 'Engineering & Reverse Engineering' started by cokyen, Jul 24, 2016.

  1. cokyen

    cokyen

    Member
    24
    0
    0
    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?

    Code (Text):
    1.  
    2. 267:
    3. 268: |==============================================================================
    4. 269: | Initialize VDP registers
    5. 270: |==============================================================================
    6. 271: InitVDP:
    7. 272:    moveq   #18, %d0        | 24 registers, but we set only 19
    8. 273:    lea     VDPRegs, %a0    | start address of register values
    9. 274:    
    10. 275: 1: move.b  (%a0)+, %d5     | load lower byte (register value)
    11. 276:    move.w  %d5, (%a4)      | write register
    12. 277:    add.w   %d7, %d5        | next register
    13. 278:    dbra    %d0, 1b         | loop
    14. 279:    
    15. 280:    rts                     | Jump back to caller
    16.  
    17.  
     
  2. MarkeyJester

    MarkeyJester

    Original, No substitute Resident Jester
    2,200
    430
    63
    Japan
    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. flamewing

    flamewing

    Emerald Hunter Tech Member
    1,161
    65
    28
    France
    Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
    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. cokyen

    cokyen

    Member
    24
    0
    0
    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. flamewing

    flamewing

    Emerald Hunter Tech Member
    1,161
    65
    28
    France
    Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
    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. cokyen

    cokyen

    Member
    24
    0
    0
    How does and or can the vdp,or any chip perform actions on stuff without being instructed with code?
     
  7. MarkeyJester

    MarkeyJester

    Original, No substitute Resident Jester
    2,200
    430
    63
    Japan
    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. flamewing

    flamewing

    Emerald Hunter Tech Member
    1,161
    65
    28
    France
    Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
    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.