Menu

#268 "Vertical bar" in openMSX doesn't look like such on real MSX

Next_release
open
nobody
Graphics (138)
2
2014-09-21
2007-05-16
No

The attached program fills the VRAM with a regular pattern while having the mode bits set to specific values. This looks quite different in openMSX compared to real MSX: in real MSX, you see a messy pattern, while on openMSX there are nice vertical bars. See also http://www.msx.org/forumtopicl7331.html

Discussion

  • Manuel Bilderbeek

    Logged In: YES
    user_id=78178
    Originator: YES

    Oh, this is what Giavotto says about the code:
    > Here, there is a lot of code bloat... look at main and fillvram.... (not
    > the assembly version, the C one)

     
  • Manuel Bilderbeek

    Disk with program that demonstrates the bug

     
  • Manuel Bilderbeek

    Logged In: YES
    user_id=78178
    Originator: YES

    File Added: modetest.dsk.gz

     
  • Manuel Bilderbeek

    Logged In: YES
    user_id=78178
    Originator: YES

    A correction form the author:
    > It's not true that "undocumented mode looks badly"..... should be:
    > "Vertical bar looks different in sc5 mode with this test program compared with a real msx2."
    > the problem arise BEFORE i set the illegal mode, not after

     
  • Manuel Bilderbeek

    • summary: Undocumented VDP modes look wrong in openMSX --> "Vertical bar" in openMSX doesn't look like such on real MSX
     
  • Manuel Bilderbeek

    Attached how it looks on real MSX and on openMSX (now):

    So, openMSX is ALMOST there!

     

    Last edit: Manuel Bilderbeek 2014-09-18
  • Manuel Bilderbeek

    • Group: --> Next_release
    • Priority: 5 --> 2
     
  • Manuel Bilderbeek

    Lowering priority, because openMSX is really close to the real thing here (except for those vertical stripes).

     
  • Manuel Bilderbeek

    This is the routine that makes the screen output (after setting up screen 5):

    0354  ld     bc,#0000     01 00 00
    0357  ld     l,c          69
    0358  ld     h,b          60
    0359  srl    h            CB 3C
    035B  rr     l            CB 1D
    035D  srl    h            CB 3C
    035F  rr     l            CB 1D
    0361  srl    h            CB 3C
    0363  rr     l            CB 1D
    0365  ld     a,l          7D
    0366  and    #0f          E6 0F
    0368  ld     (#305f),a    32 5F 30
    036B  sla    a            CB 27
    036D  sla    a            CB 27
    036F  sla    a            CB 27
    0371  sla    a            CB 27
    0373  ld     e,a          5F
    0374  ld     a,(#305f)    3A 5F 30
    0377  or     e            B3
    0378  ld     (#305f),a    32 5F 30
    037B  out    (#98),a      D3 98
    037D  out    (#98),a      D3 98
    037F  out    (#98),a      D3 98
    0381  out    (#98),a      D3 98
    0383  out    (#98),a      D3 98
    0385  out    (#98),a      D3 98
    0387  out    (#98),a      D3 98
    0389  out    (#98),a      D3 98
    038B  ld     hl,#0008     21 08 00
    038E  add    hl,bc        09
    038F  push   hl           E5
    0390  pop    bc           C1
    0391  ld     de,#6a00     11 00 6A
    0394  ld     l,c          69
    0395  ld     h,b          60
    0396  or     a            B7
    0397  sbc    hl,de        ED 52
    0399  jr     c,#0357      38 BC
    

    In C it boils down to:

    void fillvideoram()
    {
            unsigned int j;
            static char b;
            SetVRMWR(0, 0);
            for (j=0;j<27136;j+=8)
            {
                    b=(j/8) & 15;
                    b|=b<<4;
                    outp(0x98,b);
                    outp(0x98,b);
                    outp(0x98,b);
                    outp(0x98,b);
                    outp(0x98,b);
                    outp(0x98,b);
                    outp(0x98,b);
                    outp(0x98,b);
    
            }
    
    }
    

    This is SetVRMWR:

    01D9  push   de           D5
    01DA  ld     a,c          79
    01DB  rlc    d            CB 02
    01DD  rla                 17
    01DE  rlc    d            CB 02
    01E0  rla                 17
    01E1  srl    d            CB 3A
    01E3  out    (#99),a      D3 99
    01E5  ld     a,#8e        3E 8E
    01E7  out    (#99),a      D3 99
    01E9  ld     a,e          7B
    01EA  srl    d            CB 3A
    01EC  out    (#99),a      D3 99
    01EE  ld     a,d          7A
    01EF  or     #40          F6 40
    01F1  out    (#99),a      D3 99
    01F3  pop    de           D1
    01F4  ret                 C9
    

    Attached a version of the program that has the actual mode test NOPed out (the last 3 vdpsetreg calls in main are removed). This is for easier testing on MSX2 without pause button :)

     
MongoDB Logo MongoDB