vince Posted March 26, 2012 Share 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 Link to comment Share on other sites More sharing options...
sage Posted March 26, 2012 Share Posted March 26, 2012 Write Stereo register, re-read register. if =0 => lynx 1 Quote Link to comment Share on other sites More sharing options...
vince Posted March 27, 2012 Author Share Posted March 27, 2012 Thanks a lot ! I'll try it. Quote Link to comment Share on other sites More sharing options...
vince Posted May 4, 2012 Author Share 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 Link to comment Share on other sites More sharing options...
vince Posted May 9, 2012 Author Share 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 Link to comment Share on other sites More sharing options...
Shawn Jefferson Posted May 11, 2012 Share 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 Link to comment Share on other sites More sharing options...
vince Posted May 11, 2012 Author Share 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 Link to comment Share on other sites More sharing options...
Shawn Jefferson Posted May 12, 2012 Share Posted May 12, 2012 Ah, that's why. Is that K&R syntax? Quote Link to comment Share on other sites More sharing options...
vince Posted May 12, 2012 Author Share Posted May 12, 2012 Yes it is 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.