Palette on MSX1 ? (Development MSX Fora)MSX Resource Center PassionMSX MSX2 contest           
            
English Nederlands Español Português Russian         
 Nieuws
   Voorpagina
  Nieuws archief
  Nieuws onderwerpen

 Informatie
   MSX Fora
  Artikelen
  Recensies
  Beursverslagen
  Fotoreportages
  Beurzen en meetings
  Enquêtes
  Links
  Zoek

 Software
   Downloads
  Webshop

 MRC
   Wie we zijn
  Kom bij ons team
  Doneren
  Policies
  Contact met het MRC
  Link naar Ons
  Statistieken

 Zoek
 
  

  

 Login
 

Gebruikersnaam

Wachtwoord




Ben je nog niet lid? Klik hier en word MSX vriend!


 Statistieken
 

Er zijn 137 gasten en 2 MSX vrienden online

Je bent een anonieme bezoeker.
 

MSX Fora


MSX Fora

Development - Palette on MSX1 ?

Schrijver

Palette on MSX1 ?

ARTRAG
msx master
Berichten: 1592
Geplaatst: 07 December 2007, 21:02   
This code ON BLUEMSX gives very strange colors....
How can it happen ?
I was expecting that any msx1 whould just ignore any
access to ports 9ah and to non existing registers...
Any hint ?

vdpport1 equ 0x99
vdpport2 equ 0x9a


levelcolors:
        db 18,1  ; rg,b
        db 0,0
        db 33,4
        db 50,6
        db 37,2
        db 55,3
        db 97,2
        db 38,6
        db 113,1
        db 114,3
        db 98,5
        db 115,6
        db 33,3
        db 84,2
        db 85,5
        db 119,7

global _SetPalet

_SetPalet:   
        xor a ;Set pointer to zero.
        out (vdpport1),a        
        ld  a,16 | 010000000B
        out (vdpport1),a
        
        ld  hl,levelcolors
        ld c,vdpport2
        rept 32
        outi
        endm
        ret


Edwin
msx professional
Berichten: 594
Geplaatst: 07 December 2007, 21:13   
It ignores writes to port 9A, but it does not ignore the writes to $99. In this case, it writes to register 0.
ARTRAG
msx master
Berichten: 1592
Geplaatst: 07 December 2007, 21:24   
What is the ID value returned by S#1
in MSX2 and in MSX2+ and in TR ?
Testing that should solve...
ARTRAG
msx master
Berichten: 1592
Geplaatst: 07 December 2007, 22:12   
How can I be sure that the msx where I am is actually supporting palette ?
NYYRIKKI
msx master
Berichten: 1503
Geplaatst: 08 December 2007, 01:13   
IIRC ID number for V9938 is 0 and for V9958 it is 2. As TMS chips don't have S#1 trying to read it will return S#0.

Maybe you could set up sprite collision, then try to read S#1 and check what you get...


mohai
msx lover
Berichten: 118
Geplaatst: 08 December 2007, 18:14   
Try to read BIOS variables. Tere is one value at the first bytes that says which MSX version it is. I think it was address 20h or something...

Maybe another way is to check if port 9Ah exists...

manuel
msx guru
Berichten: 3381
Geplaatst: 08 December 2007, 18:46   
MSX version doesn't tell you which VDP you're dealing with. There are several MSX1 machines with a V9938.
dvik
msx master
Berichten: 1302
Geplaatst: 08 December 2007, 20:43   
The following routine is pretty good and we used it in MSX Unleashed and Utopia. Its probably a little bit more than you need but you can take only the part that tests for TMS (MSX1) and V9938/58. It compiles with tniasm but should be easy to get compiling on other assemblers too.



;--------------------------------------------------------------------
;
;                           VDP TEST ROUTINES
;
;--------------------------------------------------------------------

VDP_WRITE_DATA:     equ  $98
VDP_WRITE_LATCH:    equ  $99
VDP_READ_DATA:      equ  $98
VDP_READ_STATUS:    equ  $99

;----------------------------------------------
CHECK_VDP:
;   Out:
;       a   0  - TMS9929A
;           1  - TMS99x8A
;           2  - V9938 50Hz
;           3  - V9938 50Hz Fast
;           4  - V9938 60Hz
;           5  - V9938 60Hz Fast
;           6  - V9958 50Hz
;           7  - V9958 50Hz Fast
;           8  - V9958 50Hz TR/WSX
;           9  - V9958 60Hz
;           10 - V9958 60Hz Fast
;           11 - V9958 60Hz TR/WSX
;----------------------------------------------
        ei
        ei
        halt
        di
        
        in      a,[VDP_READ_STATUS]
        nop
        nop
        in      a,[VDP_READ_STATUS]
        push    af
        
        ld      bc,$010f
        call    LIB_WRTVDP
        nop
        in      a,[VDP_READ_STATUS]
        push    af
        
        ld      bc,$000f
        call    LIB_WRTVDP
        
        pop     af
        pop     bc
        
        cp      b
        jr      nz,.NO_TMS
        
        call    CHECK_VDP_FREQUENCY
        jr      .END
        
.NO_TMS:
        and     $1e
        jr      nz,.NO_V9938
        
        call    CHECK_VDP_FREQUENCY
        cp      0
        jr      nz,.NO_V9938_50Hz
        
        ld      bc,$0396
        call    TEST_SLOW_VDP_OUT
        add     2
        jr      .END
        
.NO_V9938_50Hz:
        ld      bc,$0296
        call    TEST_SLOW_VDP_OUT
        add     4
        jr      .END
        
.NO_V9938:
        call    CHECK_VDP_FREQUENCY
        cp      0
        jr      nz,.NO_V9958_50Hz
        
        ld      bc,$0378
        call    TEST_SLOW_VDP_OUT
        cp      0
        jp      nz,.NO_V9958_50Hz_TR
        ld      a,8
        jr      .END
        
.NO_V9958_50Hz_TR:
        ld      bc,$0396
        call    TEST_SLOW_VDP_OUT
        add     6
        jr      .END
        
.NO_V9958_50Hz:
        ld      bc,$02e8
        call    TEST_SLOW_VDP_OUT
        cp      0
        jp      nz,.NO_V9958_60Hz_TR
        ld      a,11
        jr      .END
        
.NO_V9958_60Hz_TR:
        ld      bc,$02ff
        call    TEST_SLOW_VDP_OUT
        add     9
        jr      .END

.END:
        ret
        
        
;----------------------------------------------
CHECK_VDP_FREQUENCY:
;   Out:
;       a   zero if 50Hz, non-zero if 60Hz
;----------------------------------------------
        di
        ; Sync to vblank
        in      a,[VDP_READ_STATUS]
        nop
        nop
.SYNC:
        in      a,[VDP_READ_STATUS]
        and     $80
        jr      z,.SYNC
        
        ld      hl,$900
.LOOP:
        dec     hl
        ld      a,h
        or      l
        jr      nz,.LOOP
        
        ; read vblank status to determine vdp frequency
        in      a,[VDP_READ_STATUS]
        rlca
        and     1
        
        ei
        ret

;------------------------------------------
;   Out:
;       bc  cut off that determines style
;       a   zero if below cut off
;           one if above cut off
;------------------------------------------
TEST_SLOW_VDP_OUT:
        push    bc
        di
        in      a,[VDP_READ_STATUS]
        nop
        nop
        
.LOOP1:
        in      a,[VDP_READ_STATUS]
        or      a
        jp      p,.LOOP1
        
.LOOP2:
        in      a,[VDP_READ_STATUS]
        or      a
        jp      p,.LOOP2
        
        ld      hl,0
        ld      de,$0040
        ld      bc,$0099
        
.LOOP:
        out     (c),d
        nop
        nop
        nop
        out     (c),e
        inc     hl
        nop
        nop
        in      a,[VDP_READ_STATUS]
        or      a
        jp      p,.LOOP
        
        pop     bc
        xor     a
        sbc     hl,bc
        
        jr      nc,.NO_SLOW_OUT
        inc     a
.NO_SLOW_OUT:
        ei
        xor     1
        ret

 
 







(c) 1994 - 2008 Stichting MSX Resource Center. MSX is een trademark van MSX Licensing Corporation.