News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

CRTC type detection code

Started by arnoldemu, 13:59, 30 March 16

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

arnoldemu

I am hoping to collect as many different bits of code that detect CRTC type together into one zip package for the benefit of testing on emulators.

So far I have the publically available code from Offset, Madram and Longshot.

I am thinking of extracting the detection code from various demos.

To the demo programmers who post here, is it ok for me to do that?

For each piece of code I will put which demo it came from and the authors of the demo in the source code.







PulkoMandy

They are most likely all copies from the 3 you have (or earlier versions).


I'd say no problem for my productions, but I don't remember including a CRTC test in any of them, and if I did, I'd have used OffseT's one.

Kris

Code from Ramlaid in the demo called " DTC" is to be considered as well; however, I'm not sure that he posted any messages here :(


Ast

You can use the code in AE2010 demo which only detects Cpc Plus and Cpc Old. Note that this code don't run properly on emulators, include winape.
It's based on gate array in/out bug on asic series.
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

roudoudou

Quote from: arnoldemu on 13:59, 30 March 16
I am hoping to collect as many different bits of code that detect CRTC type together into one zip package for the benefit of testing on emulators.


this one looks cool
Test CRTC [Quasar Net]




fgbrain

didnt you check the relevant wiki page??


http://www.cpcwiki.eu/imgs/9/99/Elmar_Krieger-SPECIAL_EFFECTS.dsk


there's a  CRTC check by ELMSOFT in Basic! (LISTING2.BAS)
_____

6128 (UK keyboard, Crtc type 0/2), 6128+ (UK keyboard), 3.5" and 5.25" drives, Reset switch and Digiblaster (selfmade), Inicron Romram box, Bryce Megaflash, SVideo & PS/2 mouse, , Magnum Lightgun, X-MEM, X4 Board, C4CPC, Multiface2 X4, RTC X4 and Gotek USB Floppy emulator.

arnoldemu

Quote from: fgbrain on 12:43, 08 April 16
didnt you check the relevant wiki page??


http://www.cpcwiki.eu/imgs/9/99/Elmar_Krieger-SPECIAL_EFFECTS.dsk


there's a  CRTC check by ELMSOFT in Basic! (LISTING2.BAS)
:-[ No.
I'll add that to the collection.


Rhino

This is the code I used for Batman Forever:



    ; Detect CRTC type

    ; Output

    ; a = CRTC type (0,1,2,3,4)

getCRTCType
    ld    bc,#bc0c        ; select reg 12 (R/W)
    out    (c),c
    ld    bc,#bd00+%0110100    ; write a value
    out    (c),c

;    call    wVb
    ld     b,#f5            ; wait Vbl
@vbLoop1
    in    a,(c)
    rra
    jr    c,@vbLoop1
@vbLoop2
    in    a,(c)
    rra
    jr    nc,@vbLoop2

    ld    b,#be            ; read from status register
    in    a,(c)
    ld    d,a

    inc    b            ; read from #bf (read register)
    in    a,(c)

    cp    d            ; #be == #bf?
    jr    z,@CRTC_3_4

    ; CRTC 0 1 or 2

    cp    c;%0110100        ; same value?
    jr    nz,@CRTC_1_2

    ; CRTC 0

    xor    a       
    ret

@CRTC_1_2
    ld    a,d
    and    a,%011111
    jr    nz,@CRTC_2

    ; CRTC 1

    ld    a,1
    ret

    ; CRTC 2

@CRTC_2
    ld    a,2
    ret

    ; CRTC 3 or 4

@CRTC_3_4
    ld     bc,&f782
    out     (c),c
    dec     b
    ld     a,&F
    out     (c),a
    inc     b
    out     (c),c
    dec     b
    in     c,(c)
    cp     c
    jr     nz,@CRTC_4

    ; CRTC 3

@CRTC_3
    ld    a,3
    ret

    ; CRTC 4

@CRTC_4
    ld    a,4
    ret



TotO

@arnoldemu
Are you interrested about testing CRTC compatible IC that are not used on CPC? (like KC Compact)
If yes, I can send you that.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

arnoldemu

Quote from: TotO on 13:47, 08 April 16
@arnoldemu
Are you interrested about testing CRTC compatible IC that are not used on CPC? (like KC Compact)
If yes, I can send you that.
Yes.

I have types 0-4 (4 is in a 464) and a KC Compact with a HD6845R (I call this type 5).

I would happily test other types if it was easy to plug them into a CPC.


Powered by SMFPacks Menu Editor Mod