Jump to content

Photo

Lynx I vs Lynx II


8 replies to this topic

#1 vince OFFLINE  

vince

    Star Raider

  • 77 posts
  • Location:PARIS (FRANCE)

Posted Mon Mar 26, 2012 9:52 AM

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 ?

#2 sage OFFLINE  

sage

    Dragonstomper

  • 921 posts
  • Location:Germany

Posted Mon Mar 26, 2012 2:12 PM

Write Stereo register, re-read register. if =0 => lynx 1

#3 vince OFFLINE  

vince

    Star Raider

  • Topic Starter
  • 77 posts
  • Location:PARIS (FRANCE)

Posted Tue Mar 27, 2012 11:55 AM

Thanks a lot !

I'll try it.

#4 vince OFFLINE  

vince

    Star Raider

  • Topic Starter
  • 77 posts
  • Location:PARIS (FRANCE)

Posted Fri May 4, 2012 4:38 PM

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

#5 vince OFFLINE  

vince

    Star Raider

  • Topic Starter
  • 77 posts
  • Location:PARIS (FRANCE)

Posted Wed May 9, 2012 3:32 PM

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 by vince, Wed May 9, 2012 3:33 PM.


#6 Shawn Jefferson OFFLINE  

Shawn Jefferson

    Stargunner

  • 1,987 posts
  • Location:Victoria, Canada

Posted Fri May 11, 2012 12:48 AM

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).

#7 vince OFFLINE  

vince

    Star Raider

  • Topic Starter
  • 77 posts
  • Location:PARIS (FRANCE)

Posted Fri May 11, 2012 2:47 AM

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...=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"...

#8 Shawn Jefferson OFFLINE  

Shawn Jefferson

    Stargunner

  • 1,987 posts
  • Location:Victoria, Canada

Posted Fri May 11, 2012 7:53 PM

Ah, that's why. Is that K&R syntax?

#9 vince OFFLINE  

vince

    Star Raider

  • Topic Starter
  • 77 posts
  • Location:PARIS (FRANCE)

Posted Sat May 12, 2012 1:59 AM

Yes it is ;)




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users