* NoNTSC - Just for fun written by Thorsten Stocksmeier - Freeware Sept. 1993

 INCLUDE "startup.i"

OpenLibrary  	equ -552
CloseLibrary 	equ -414
AllocMem	equ -198
SetFunction	equ -420
CopyMem 	equ -624
OpenScreen	equ -198
Open		equ -30

 dc.b "$VER: NoNTSC1.3 (27.09.93) written by Thorsten Stocksmeier",0
 even

Programm
 lea Graph(PC),a1
 move.l 4,a6
 clr.l d0
 jsr OpenLibrary(a6)
 tst.l d0
 beq NoLib
 lea GraphB(PC),a0
 move.l d0,(a0)
ODos
 lea Dos(PC),a1
 move.l 4,a6
 clr.l d0
 jsr OpenLibrary(a6)
 tst.l d0
 beq NoLib
 lea DosB(PC),a0
 move.l d0,(a0)
OpenWindow
 move.l DosB(PC),a6
 lea WindowName(PC),a0
 move.l a0,d1
 move.l #1005,d2
 jsr Open(a6)
 tst.l d0
 beq CloseIt
 lea WindowB(PC),a0
 move.l d0,(a0)
 move.l d0,d1
 lea Hello(PC),a0
 move.l a0,d2
 move.l #NexTex-Hello,d3
 jsr -48(a6)
OLib
 lea Int(PC),a1
 move.l 4,a6
 moveq #0,d0
 jsr OpenLibrary(a6)
 tst.l d0
 beq CloseIt
 move.l d0,a5
 lea IntB(PC),a0
 move.l d0,(a0)
Allocate
 move.l #3000,d0
 move.l #1,d1
 jsr AllocMem(a6)
 tst.l d0
 beq NoLib
 move.l d0,d7
LinkIn
 move.l a5,a1
 move.l #OpenScreen,a0
 move.l d7,a2
 move.l a2,d0
 move.l 4,a6
 jsr SetFunction(a6)
 tst.l d0
 beq NoLib
 lea LinkAdd(PC),a0
 move.l d0,(a0)
Copy
 lea DoIt(PC),a0
 move.l d7,a1
 move.l #3000,d0
 jsr CopyMem(a6)
CloseIt
NoLib
 moveq #0,d0
 rts

DoIt
 movem.l a0-a7/d0-d7,-(sp)
 lea Transformed(PC),a1
 move.l #0,(a1)
ByeBye
 btst #6,$bfe001
 bne Weiter
 move.l DosB(PC),a6
 move.l WindowB(PC),d1
 jsr -36(a6)
 move.l LinkAdd(PC),d0
 move.l IntB(PC),a1
 move.l #OpenScreen,a0
 move.l 4,a6
 jsr SetFunction(a6)
 lea DoIt(PC),a1
 move.l #3000,d0
 jsr -210(a6)
 move.l DosB(PC),a1
 jsr -414(a6)
 move.l IntB(PC),a1
 jsr -414(a6)
 bra GetOldLock  
Weiter
 move.w 6(a0),d0
 cmp.w #256,d0
 bls NochMa
 bra ShowUnk
NochMa
 cmp.w #200,d0
 bls TestNow
 cmp.w #256,d0
 bge TestNow
 bra ShowIrr
TestNow
 move.w 6(a0),d0
 cmp.w #200,d0
 bne keins
 move.w #256,6(a0)
 move.l WindowB(PC),d1
 lea AnotherTex(PC),a0
 move.l a0,d2
 move.l #AndBye-AnotherTex,d3
 move.l DosB(PC),a6
 jsr -48(a6)
 lea Transformed(PC),a0
 move.l #1,(a0)
 bra GetOldLock
keins
 move.l WindowB(PC),d1
 lea NexTex(PC),a0
 move.l a0,d2
 move.l #AnotherTex-NexTex,d3
 move.l DosB(PC),a6
 jsr -48(a6)
GetOldLock
 movem.l (sp)+,a0-a7/d0-d7
 move.l LinkAdd(PC),a1
 jsr (a1)
 movem.l a0-a7/d0-d7,-(sp)
 tst.l d0
 beq Nanana
 add.l #84,d0
 move.l d0,a5
 move.l Transformed(PC),d0
 tst.l d0
 beq Nanana
 move.l a5,a1
 move.w #0,d0
 move.w #230,d1
 move.l GraphB(PC),a6
 jsr -240(a6)
 move.l a5,a1
 lea AndBye(PC),a0
 move.l #HowLong-AndBye,d0
 jsr -60(a6)
Nanana
 movem.l (sp)+,a0-a7/d0-d7
 rts

ShowIrr
 move.l WindowB(PC),d1
 lea HowLong(PC),a0
 move.l a0,d2
 move.l #AllFinish-HowLong,d3
 move.l DosB(PC),a6
 jsr -48(a6)
 bra GetOldLock

ShowUnk
 move.l WindowB(PC),d1
 lea AllFinish(PC),a0
 move.l a0,d2
 move.l #NowReally-AllFinish,d3
 move.l DosB(PC),a6
 jsr -48(a6)
 bra GetOldLock

Transformed	ds.l 1
OK 		dc.l 0
Int		dc.b "intuition.library",0
IntB		ds.l 1
LinkAdd 	ds.l 1
Dos 		dc.b "dos.library",0
DosB 		ds.l 1
Graph		dc.b "graphics.library",0
GraphB		ds.l 1
WindowB 	dc.l 0
WindowName	dc.b "RAW:0/201/640/55/NoNTSC © 1993 by Thorsten Stocksmeier --- This program is FREEWARE!!!",0
Hello		dc.b 10,$9b,"1;33;42m*** NoNTSC V1.3 activated ***",10
		dc.b 10,$9b,"1;32;43mBreak by pressing left button while opening any screen.",10
		dc.b 10,$9b,"1;31;42m"
NexTex		dc.b "OpenScreen, but no NTSC!                             ",10
AnotherTex	dc.b "Openscreen, NTSC transformed to PAL!!                ",10
AndBye		dc.b "Transformed NTSC-Screen - NoNTSC © 1993 by Thorsten Stocksmeier!"
HowLong		dc.b "Openscreen, something between NTSC and PAL!          ",10
AllFinish	dc.b "Openscreen, but unknown screenmode used! (Interlace?)",10
		dc.b "NOTE: Those should only be used by OpenScreenTags.   ",10
NowReally
 end               
