Amiga.org

Amiga computer related discussion => Amiga Software Issues and Discussion => Topic started by: Super TWiT on November 10, 2010, 02:35:32 PM

Title: PAL/NTSC Check?
Post by: Super TWiT on November 10, 2010, 02:35:32 PM
I am trying to sort out whether I truly have a pal or ntsc amiga and test different emulated conditions as well.  As it turns out, sysinfo always says I am operating under a pal setup (both with my real amiga and an emulated ntsc amiga 500).  Anyway, I found this assembler code from here (http://www.mways.co.uk/amiga/howtocode/text/video.php).  When trying to assemble the topmost example with vasmm68k for linux, I get these errors
Quote
error 4 in line 1 of "code": no current section specified

error 4 in line 2 of "code": no current section specified

error 4 in line 3 of "code": no current section specified

warning 1022 in line 5 of "code": missing '

error 4 in line 5 of "code": no current section specified

error 4 in line 6 of "code": no current section specified

***maximum number of errors reached!***
Anyone have any ideas as to why the example code won't work?  Is it the way my text editor saves unix-type line returns?
Title: Re: PAL/NTSC Check?
Post by: Franko on November 10, 2010, 02:45:49 PM
Quote from: Super TWiT;590725
I am trying to sort out whether I truly have a pal or ntsc amiga and test different emulated conditions as well.  As it turns out, sysinfo always says I am operating under a pal setup (both with my real amiga and an emulated ntsc amiga 500).  Anyway, I found this assembler code from here (http://www.mways.co.uk/amiga/howtocode/text/video.php).  When trying to assemble the topmost example with vasmm68k for linux, I get these errorsAnyone have any ideas as to why the example code won't work?  Is it the way my text editor saves unix-type line returns?


While I only use DevPac myself and not in the standard way (ie: with includes etc...), after a quick look at the code your using, is the assembler package you use setting up the proper assign & includes for assembling. Otherwise things like the line...

cmp.b   #50,VBlankFrequency(a6)

The label VBlankFrequency would not be recognised...

I could quickly Assemble the code myself for you into a 68k prog and email you it if you really need it... :)
Title: Re: PAL/NTSC Check?
Post by: Super TWiT on November 10, 2010, 02:55:42 PM
I have no idea, I am completely new to assembly, and just was using vasm because it was free.  This is how I executed vasm from my terminal:
Quote
./vasmm68k_mot -o test code
The ./ is just launching an executable in linux.  I tried to run this
Quote
./vasmm68k_mot -Fhunkexe -o test -nosym code
as suggested by their tutorial (http://sun.hasenbraten.de/vasm/index.php?view=tutorial) to compile a CLI application, but I got this back
Quote
fatal error 17: could not initialize output module
Title: Re: PAL/NTSC Check?
Post by: Super TWiT on November 10, 2010, 03:09:37 PM
Okay, now we are getting somewhere.  I recompiled the application from source, and now the hunkexe module IS found.  Now, the compile errors I get are
Quote
warning 7 in line 5 of "code": ' expected

error 1 in line 5 of "code": illegal operand types

warning 7 in line 6 of "code": ' expected

error 1 in line 6 of "code": illegal operand types
I looked and there doesn't appear to be a produced output file.
Title: Re: PAL/NTSC Check?
Post by: Franko on November 10, 2010, 03:14:35 PM
Sorry I don't have a clue about Linux, but a quick look at the code your trying to assemble...

   move.l   4.w,a6          ; execbase
   cmp.b   #50,VBlankFrequency(a6)
   beq.s   .pal

     jmp   I'm NTSC
.pal   jmp   I'm PAL

   move.l  GfxBase,a6
     btst      #2,gb_DisplayFlags(a6)  ; Check for PAL
   bne.s   .pal

     jmp   I'm NTSC
.pal   jmp   I'm PAL


Firstly this would not assemble into anything useable even from the cli/shell. It needs routine's to print out on the cli/shell the result ie: PAL or NTSC. All this bit of code is for is to show you which bit's of the exec.library & graphics.library you would need to check in order to find out whether your Amiga is running in PAL or NTSC mode.

So unless you have the source code for the rest of the routines their is not much point in trying to assemble it at all, sorry... :(
Title: Re: PAL/NTSC Check?
Post by: Super TWiT on November 10, 2010, 03:24:06 PM
I don't, I just saw it online....:(  Do you know of any program that will tell me if I'm operating in ntsc or pal mode?  I tried sysinfo, but it always (no matter on my real amiga or on an emulated amiga which definitely is set to ntsc) that I'm running in PAL mode.
Title: Re: PAL/NTSC Check?
Post by: mechy on November 10, 2010, 03:37:54 PM
Quote from: Super TWiT;590746
I don't, I just saw it online....:(  Do you know of any program that will tell me if I'm operating in ntsc or pal mode?  I tried sysinfo, but it always (no matter on my real amiga or on an emulated amiga which definitely is set to ntsc) that I'm running in PAL mode.


Try whichamiga from aminet, it will tell you just about everything i think.
Title: Re: PAL/NTSC Check?
Post by: Karlos on November 10, 2010, 03:44:19 PM
Instead of this test:

cmp.b   #50,VBlankFrequency(a6)

You could  write a few lines of C:
Code: [Select]
#include <stdio.h>
#include <exec/execbase.h>
#include <proto/exec.h>

int main(int argn, char** argv)
{
printf(&quot;VBlankFrequency is %u Hz\n&quot;, (unsigned)SysBase->VBlankFrequency);
return 0;
}

This will just print out the frequency, it won't do anything else. You should probably do it via GfxBase if using 2.x or higher.

Pretty sure that can be trimmed down if you use dos.library print rather than C stdio.
Title: Re: PAL/NTSC Check?
Post by: Zac67 on November 11, 2010, 07:35:10 AM
Why, the easiest way to find out is to disable startup-sequence in Early Bootmenu and then ask your monitor what it's running on.