Jump to content
vince

Lynx I vs Lynx II

Recommended Posts

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 ?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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.

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