Jump to content
IGNORED

Detecting the video system


pfeuh

Recommended Posts

Mapa, I can't get yours to work in either Altirra or Atari800Win. Code and executables below:

 

attachicon.gifdetect.zip

 

The screen should turn black for PAL and red for NTSC. xuel.xex works, but mapa.xex just goes into an infinite loop and the screen stays blue. Does it work for you? Maybe I made a mistake?

 

Ops, sorry, it can not work. I was watching A reg and it has the topmost val;ue for the system but it's due to breaking into emulator monitor in vbi :)

Link to comment
Share on other sites

Fixed version I hope ;)

Awesome! Only six instructions! :thumbsup:

 

For me it works. Black for both 130XE & 800XL PAL machines, black in Altirra PAL and red in Altirra NTSC.

Which one? I assume you mean xuel.xex and not the old mapa.xex which I don't think can work?

 

Here is MaPa's latest version (mapa2.xex) which should now work:

 

detect2.zip

Link to comment
Share on other sites

  • 2 weeks later...

I also worked on this a bit, checked a few things, then rechecked, ohya, Rybags said

the VCOUNT can differ sometimes for one clock cycle... So taking that into effect, I offer

for your amusement :-)

 

Technically I did not test this routine....

;
;  ntsc/pal detect on atari gtia
;
; uses A X and Carry
;

detectgtiamode

.stage1
    lda VCOUNT    ; does not interfere with DLI's!
    rol        ;  waits for VCOUNT => 128, shifting msb to carry for looping.
    bcc .stage1

    sei        ; interrupts off when beam almost off screen, VCOUNT=128+, no more DLI

.stage2
    tax        ; store old vcount in X
    lda VCOUNT    ; load new vcount
    bne .stage2    ; if zero,then X contains max vcount value and drop out of loop

    cli        ; interrupts on ... DLI back

    txa        ; X should be aprox 131 or 156 decimal
    sbc #16        ; even out the #'s. allows for tiny variations!!
    rol        ; we can use msb into carry to tell video mode 

    rts        ; assuming a jsr?
;
; on exit
; carry 0 = ntsc,  carry 1 = pal,  X contains max VCOUNT aprox 131 or 156

; end detectgtiamode



  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...