MaPa Posted February 18, 2014 Share Posted February 18, 2014 Mapa, I can't get yours to work in either Altirra or Atari800Win. Code and executables below: detect.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 Quote Link to comment Share on other sites More sharing options...
MaPa Posted February 18, 2014 Share Posted February 18, 2014 Fixed version I hope org $2000 sei loop lda vcount cmp vcount beq *-3 bcc loop cmp #132 ... 3 Quote Link to comment Share on other sites More sharing options...
MaPa Posted February 18, 2014 Share Posted February 18, 2014 (edited) Double post... Edited February 18, 2014 by MaPa Quote Link to comment Share on other sites More sharing options...
pfeuh Posted February 18, 2014 Author Share Posted February 18, 2014 Does it work for you? For me it works. Black for both 130XE & 800XL PAL machines, black in Altirra PAL and red in Altirra NTSC. Quote Link to comment Share on other sites More sharing options...
Xuel Posted February 18, 2014 Share Posted February 18, 2014 Fixed version I hope Awesome! Only six instructions! 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 Quote Link to comment Share on other sites More sharing options...
pfeuh Posted February 18, 2014 Author Share Posted February 18, 2014 (edited) Which one? I was talking about xuel.xex Awesome! Only six instructions! Yes. But what if CARRY is already setted before entering loop? Edited February 18, 2014 by pfeuh Quote Link to comment Share on other sites More sharing options...
Xuel Posted February 18, 2014 Share Posted February 18, 2014 Yes. But what if CARRY is already setted before entering loop? It wouldn't matter. MaPa's code guarantees carry will be set for PAL and clear for NTSC regardless of the initial carry flag status. 1 Quote Link to comment Share on other sites More sharing options...
falcon_ Posted February 27, 2014 Share Posted February 27, 2014 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 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.