vince #1 Posted March 26, 2012 I'm searching a way to recognize in a program if it is executed on a Lynx I or Lynx II system. It could be a difference between register initialisation, or something like that... (this test would probably the first thing in the program) Any idea ? Quote Share this post Link to post Share on other sites
sage #2 Posted March 26, 2012 Write Stereo register, re-read register. if =0 => lynx 1 Quote Share this post Link to post Share on other sites
vince #3 Posted March 27, 2012 Thanks a lot ! I'll try it. Quote Share this post Link to post Share on other sites
vince #4 Posted May 4, 2012 I made a test with a write then a read into 0xFD50 adress (MSTEREO) and I confirm : it allows you to make distinction between Lynx I and Lynx II Quote Share this post Link to post Share on other sites
vince #5 Posted May 9, 2012 (edited) Here is my test sample : #include <lynx.h> #include <lynxlib.h> char SCREEN[8160] at (MEMTOP-16320); char RENDER[8160] at (MEMTOP-8160); char MSTEREO at 0xFD50; char pal[]={ 0x00,0x0F,0x00,0x0F,0x0F,0x00,0x0C,0x08,0x08,0x0F,0x08,0x08,0x08,0x08,0x04,0x0F, 0x00,0xFF,0x0F,0x0F,0x00,0xF0,0xCC,0x8C,0x88,0x8F,0xFF,0x4F,0x48,0xF0,0x08,0xFF }; void Vsync() { #asm vretrace: lda $fd0a bne vretrace #endasm } main() { unsigned char val; InitIRQ(); CLI; SetBuffers(SCREEN,RENDER,0); SetRGB(pal); MSTEREO=0x10; DrawFBox(0,0,160,102,0); val=MSTEREO; if (val==0x10) { DrawFBox(20,20,20,62,0x0F); DrawFBox(60,20,20,62,0x0F); } else { DrawFBox(20,20,20,62,0x0F); } SwapBuffers(); Vsync(); for( ; ; ){ } } source : http://devlynx.ti-fr.../?pag=9&cat=111 (with comments, in french) Edited May 9, 2012 by vince Quote Share this post Link to post Share on other sites
Shawn Jefferson #6 Posted May 11, 2012 Link isn't working. What programming environment are you using? I've never seen "char MSTEREO at 0xFD50;" in C before (that I can remember). Quote Share this post Link to post Share on other sites
vince #7 Posted May 11, 2012 Concerning the link, it was an error of DNS this morning. It must be updated now. I use the NEWCC65 environment. It does not includes reference to 0xFD50, wich is the adress of the MSTEREO register (http://devlynx.ti-fr.com/?pag=17&act=dtl&adr=0xFD50) so I added it in my code defining MSTEREO variable. It would probably be better if I specify "unsigned char" instead of "char"... Quote Share this post Link to post Share on other sites
Shawn Jefferson #8 Posted May 12, 2012 Ah, that's why. Is that K&R syntax? Quote Share this post Link to post Share on other sites