	* --------------------------------
	* 3rd Day Intro - © 1991 SECTION 9
	* --------------------------------
	* 8*8 Font mit 2 Planes
	* LOGO 3 Planes
	* Noise-Replay
	* --------------------------------
	* LMB - next page
	* RMB - quit
	* JOYB - slower scroll

	* INCDIRs are at INCBINs !!
	* Die Inc-Daten sind die selben wie bei der GRMBLWRZ-Intro!!

COL_VERZ = 140		internal system-data
PAGE_VERZ = 1000	don't change

	SECTION		another_small_masterpiece_bla_bla,CODE
prg	movem.l		d0-a6,-(a7)
	bsr.b		init
	bsr.w		kill_system
	bsr.w		INIT_MUSIC
	lea		$dff000,a6
	lea		dummy(pc),a5
	bsr.w		print
loop	btst		#1,(a5)
	beq.b		.mouse
	bra.b		.print
.mouse	btst		#6,$bfe001
	bne.b		.next
.print	bsr.w		print
	lea		page_cnt(pc),a0
	move.w		#PAGE_VERZ,(a0)
	bclr		#1,(a5)
.next	btst		#2,$16(a6)
	bne.s		loop
	bsr.w		END_MUSIC
	bsr.w		awake_system
	bsr.w		END_MUSIC
	movem.l		(a7)+,d0-a6
	rts

init	bsr.w		fill		copper colors
	lea		page_ptr(pc),a0
	lea		pages(pc),a1
	move.l		a1,(a0)
	lea		star_p+2,a0
	lea		stars,a1
	move.l		a1,d0
	move.w		d0,4(a0)
	swap		d0
	move.w		d0,(a0)
	lea		scrptr(pc),a0
	lea		scrtext(pc),a1
	move.l		a1,(a0)
	lea		planes+2,a0
	lea		logo,a1
	moveq		#3-1,d7
.lp	bsr.w		init_it
	addq.l		#8,a0
	lea		2464(a1),a1
	dbf		d7,.lp
	lea		txtcop+2,a0
	lea		txtdat,a1
	bsr.b		init_it
	addq.l		#8,a0
	lea		[352/8]*150(a1),a1
	bsr.b		init_it
	lea		back,a1
	lea		backcop+2,a0
	bsr.b		init_it
	lea		empty,a1
	lea		emp1cop+2,a0
	bsr.b		init_it
	lea		emp2cop+2,a0
	bsr.b		init_it
	lea		emp3cop+2,a0
	bsr.b		init_it
	lea		emp4cop+2,a0
	bsr.b		init_it
	lea		scrcop+2,a0
	lea		scrdat+[368/8],a1
	bsr.b		init_it
	addq.l		#8,a0
	lea		368(a1),a1
	*bsr.b		init_it
	*rts
init_it	move.l		a1,d0
	move.w		d0,4(a0)
	swap		d0
	move.w		d0,(a0)
	rts

newirq	movem.l		d0-a6,-(a7)
	lea.l		$dff000,a6		base-reg
	lea		dummy(pc),a5
	bset		#0,(a5)			als irq_sync in 'loop'
	lea		page_cnt(pc),a0
	subq.w		#1,(a0)
	bne.b		.lame
	bset		#1,(a5)
	move.w		#PAGE_VERZ,(a0)
.lame	
	btst		#7,$bfe001
	beq.b		.slow
	bsr.b		scroll
.slow	bsr.b		scroll

	bsr.w		colors
	bsr.w		move_stars
	bsr.w		PLAY_MUSIC
	move.w		#$4020,$9c(a6)		see ya'
	movem.l		(a7)+,d0-a6
	rte

scroll	lea		counter(pc),a2		immer in a2
	tst.b		(a2)
	bne.b		.scroll_only
	move.l		scrptr(pc),a1
	move.b		(a1),d2			char in d2
	lea		fontlst(pc),a1
	moveq		#0,d1
.search	move.b		0(a1,d1.w),d0
	beq.b		.unknwn			end of fontlst = 0
	cmp.b		d2,d0
	beq.b		.found
	addq.w		#1,d1
	bra.b		.search
.unknwn	moveq		#26,d1			offset für 'SPACE'
.found	lea		proplst(pc),a1
	move.b		0(a1,d1.w),(a2)		char-breite neu in counter
	lea		font,a0
	add.l		d1,a0			a0 -> char in font
	lea		scrdat+[368/8]+[[368-8]/8],a1
	moveq		#0,d0
	moveq		#0,d1
	moveq		#[640/8],d2
	moveq		#[368/8],d3
	moveq		#16-1,d7
.wblit2	btst		#14,2(a6)
	bne.s		.wblit2
.copy	move.b		0(a0,d0.w),0(a1,d1.w)	copy char in scroll-area
	add.l		d2,d0
	add.l		d3,d1
	dbf		d7,.copy
	lea		scrptr(pc),a0		increase scroll-ptr
	addq.l		#1,(a0)
	move.l		(a0),a1
	tst.b		(a1)
	bne.b		.no_scrtext_end
	lea		scrtext(pc),a1
	move.l		a1,(a0)		
.no_scrtext_end
.scroll_only
	subq.b		#1,(a2)			a2 = counter von oben
	lea		scrdat,a1
	lea		2(a1),a0		scrdat+2
	moveq		#-1,d0
	moveq		#0,d1
	move.w		#%1111100111110000,d2
.wblit	btst		#14,2(a6)
	bne.s		.wblit
	move.l		a0,$50(a6)			A-PT (source)
	move.l		a1,$54(a6)			D-PT (dest)
	move.l		d0,$44(a6)			BLTAMASK
	move.w		d1,$42(a6)			BLTCON1
	move.w		d1,$64(a6)			A-MOD
	move.w		d1,$66(a6)			D-MOD
	move.w		d2,$40(a6)			BLTCON0
	move.w		#[[16+1]*64]+[368/16],$58(a6)	BLTSIZE/START
	rts

print	lea		page_ptr(pc),a0
	move.l		(a0),a2
	moveq		#2,d4			pos in line
	moveq		#15-1,d6		15 lines/page
.loop2	moveq		#40-1,d7		40 chars/line
.loop	move.b		(a2)+,d2		char in d2
	lea		fontlst(pc),a1
	moveq		#0,d1
.search	move.b		0(a1,d1.w),d0
	beq.b		.unknwn			end of fontlst = 0
	cmp.b		d2,d0
	beq.b		.found
	addq.w		#1,d1
	bra.b		.search
.unknwn	moveq		#26,d1			offset für 'SPACE'
.found	lea		font,a0
	add.l		d1,a0			a0 -> char in font
	lea		txtdat,a1
	add.l		d4,a1
	moveq		#0,d0
	moveq		#0,d1
	moveq		#[640/8],d2
	moveq		#[352/8],d3
	moveq		#8-1,d5
.copy	move.b		0(a0,d0.w),0(a1,d1.w)	copy char 1st plane
	add.l		d2,d0
	add.l		d3,d1
	dbf		d5,.copy
	add.l		#[[352/8]*[150-8]],d1
	moveq		#8-1,d5
.copy2	move.b		0(a0,d0.w),0(a1,d1.w)	copy char 2nd plane
	add.l		d2,d0
	add.l		d3,d1
	dbf		d5,.copy2
	addq.l		#1,d4			next char
	cmp.b		#" ",(a2)
	beq.b		.no_wait
	bclr		#0,(a5)			dummy
.wait	btst		#0,(a5)
	beq.b		.wait
.no_wait
	lea		$dff000,a6
	btst		#2,$16(a6)
	beq.b		.out
	dbf		d7,.loop		char loop
	add.l		#[[352/8]*9]+4,d4
	dbf		d6,.loop2		line loop

	lea		page_ptr(pc),a0
	tst.b		(a2)
	bne.b		.next
	lea		pages(pc),a2
.next	move.l		a2,(a0)
.out	rts

colors	lea		col_cnt(pc),a0
	subq.w		#1,(a0)
	bne.b		col_out
	move.w		#COL_VERZ,(a0)
	lea		cols(pc),a0
	lea		30(a0),a1
	lea		60(a0),a2
	move.w		(a0),d0
	move.w		(a1),d1
	move.w		(a2),d2
	moveq		#15-1,d7
.loop	move.w		2(a0),(a0)+
	move.w		2(a1),(a1)+
	move.w		2(a2),(a2)+
	dbf		d7,.loop
	move.w		d0,-(a0)
	move.w		d1,-(a1)
	move.w		d2,-(a2)
fill	lea		colscop+2,a0		fill in cols
	lea		cols(pc),a1
	moveq		#15-1,d7
.loop2	move.w		(a1),(a0)
	move.w		30(a1),4(a0)
	move.w		60(a1),8(a0)	
	lea		16(a0),a0
	addq.l		#2,a1
	dbf		d7,.loop2
col_out	rts

move_stars
	lea		stars+1,a0
	moveq		#[[[end_stars-stars]/8]/3]-1,d7
.st_lp	addq.b		#1,(a0)
	addq.b		#2,8(a0)
	addq.b		#3,16(a0)
	lea		24(a0),a0
	dbf		d7,.st_lp
	rts

kill_system
	move.l		$4.w,a6
	lea		gfxname(pc),a1
	jsr		-408(a6)
	move.l		d0,a1
	lea		oldcop1(pc),a0
	move.l		$26(a1),(a0)
	lea		oldcop2(pc),a0
	move.l		$32(a1),(a0)
	jsr		-414(a6)
	lea		$dff000,a6
	lea		intena(pc),a0
	move.w		$1c(a6),(a0)
	lea		dmacon(pc),a0
	move.w		$2(a6),(a0)
	lea		adkcon(pc),a0
	move.w		$10(a6),(a0)
	move.w		#$7fff,$9a(a6)
	bsr.b		wait_vert_blank
	move.w		#$7fff,$96(a6)
	lea		newcop,a0
	move.l		a0,$80(a6)
	move.w		#[%1000000111100000!$8200],$96(a6)
	lea		oldirq(pc),a0
	move.l		$6c.w,(a0)
	lea		newirq(pc),a0
	move.l		a0,$6c.w
	move.w		#$7fff,$9c(a6)
	move.w		#$c020,$9a(a6)
	rts
wait_vert_blank
	btst		#0,$5(a6)
	beq.s		wait_vert_blank
.loop	btst		#0,$5(a6)
	bne.s		.loop
	rts
awake_system
	move.w		#$7fff,$9a(a6)		$dff000 in a6 !!!
	bsr.b		wait_vert_blank
	move.w		#$7fff,$96(a6)
	move.l		oldcop1(pc),$80(a6)
	move.l		oldcop2(pc),$84(a6)
	move.l		oldirq(pc),$6c.w
	move.w		dmacon(pc),d0
	or.w		#$8000,d0
	move.w		d0,$96(a6)		
	move.w		adkcon(pc),d0
	or.w		#$8000,d0
	move.w		d0,$9e(a6)
	move.w		intena(pc),d0
	or.w		#$c000,d0
	move.w		#$7fff,$9c(a6)
	move.w		d0,$9a(a6)
	rts
oldirq	dc.l	" by "
oldcop1	dc.l	"Thom"
oldcop2	dc.l	"as K"
intena	dc.w	"es"
dmacon	dc.w	"sl"
adkcon	dc.w	"er"
scrptr	dc.l	$20000000
col_cnt dc.w	COL_VERZ
page_cnt dc.w	PAGE_VERZ
page_ptr dc.l	0
counter	dc.b	0
dummy	dc.b	0
gfxname	dc.b	"graphics.library",0
fontlst	dc.b	"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	dc.b	" 0123456789"
	dc.b	"!?.,:;()"
	dc.b	"#/'+-&*$©"
	dc.b	"abcdefghijklmnopqrstuvwxyz",0
proplst	dc.b	8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8
	dc.b	7,8,8,8,8,8,8,8,8,8,8
	dc.b	4,8,4,5,4,5,8,8
	dc.b	8,8,5,8,8,8,8,7,8
	dc.b	8,8,8,8,8,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8


	* AB HIER IST DEIN SCROLLTEXT ...

scrtext	dc.b	"AMIGA INDUSTRIES & SPREADPOINT present in 1991: "
	dc.b	" * 3rd Day II *                              "
	dc.b	"Coded as lots of our high quality utilities by " 
	dc.b	"SECTION 9/AI for AISP !!! So this fine piece finally"
	dc.b	" released on the fucking Crystal - Anarchy - Silents"
	dc.b	" party in Denmark on 27th December 1991 !!! This was our"
	dc.b	" year... We joined our powers together on friendship "
	dc.b	"and not to be the fastest or the best or anything like "
	dc.b	"this shit.. So Munster and me also did some hard critics "
	dc.b	"on the scene - and so lots of guys dislike us - but we "
	dc.b	"are against the business... So no matter what will happen -"
	dc.b	" Amiga Industries & Spreadpoint will stay forever in Co-"
	dc.b	"Opperation - until our crews are alive ...   'signed: Ai & Sp"
	dc.b	" - '86 till no end...  So greet us only as aisp in the  "
	dc.b	"future ....  wait for our soon comging demos from tip "
	dc.b	"and amicom - and of course always some nice utilities...    "
	dc.b	" Andy over to Section 9...                                "
	dc.b	" By the way: this small piece is called "
	dc.b	"'GRMBLWRZ!' ... You want to know what that "
	dc.b	"means ...              We don't know!                   "
	dc.b	"When Section 9 coded this, suddenly "
	dc.b	"some Lemmings jumped out of "
	dc.b	"his monitor (with parachutes), climbed his keyboard "
	dc.b	"(some were climbers) and walked around on the keys. "
	dc.b	" That's where this name came from ........ We guess.               "
	dc.b	"                            "
	dc.b	"Press right mouse-button to quit.                           "
	dc.b	"Now restarting ...                         "
	dc.b	"            "
	dc.b	0	* <- END OF SCROLLTEXT


	* AB HIER DIE PAGES (JEWEILS GENAU 15 ZEILEN MIT 40 ZEICHEN!!)
	* es ist egal, wieviele pages angehängt werden, Hauptsache die
	* Länge und die Breite stimmen (15*40)                   [SEC]

pages	dc.b	"  ************************************  "
	dc.b	"  *                                  *  "
	dc.b	"  *  AMIGA INDUSTRIES & SPREADPOINT  *  "
	dc.b	"  *                                  *  "
	dc.b	"  ************************************  "
	dc.b	"                                        "
	dc.b	"    present in the last days of 1991:   "	; first/1992 ?!
	dc.b	"                                        "
	dc.b	"        3rd Day II - Gfx-Ripper         "
	dc.b	"        -----------------------         "
	dc.b	"                                        "
	dc.b	"      Now working also with OS2.0       "
	dc.b	"    and with 1 MB CHIP-Ram machines.    "
	dc.b	"                                        "
	dc.b	"      * Press left mouse-button *       "

	dc.b	"                                        "
	dc.b	"  The 3rd Day GFX-Ripper was originally "
	dc.b	"   made by SvEinstein of Action Force   "
	dc.b	" and adapted to OS 2.0 and 1MB CHIP-Ram "
	dc.b	"        by Section 9 of AI/SP.          "
	dc.b	"                                        "
	dc.b	" Note to all Coders:                    "
	dc.b	" -------------------                    "
	dc.b	" The ECS isn't 100 percent compatible   "
	dc.b	" to the 'old' (v1.3) system.            "
	dc.b	" If you have an own copperlist, you     "
	dc.b	" must set the DIWSTRT ($008e) at the    "
	dc.b	" beginning of your coppercrap, other-   "
	dc.b	" wise there will be shown NO planes.    "
	dc.b	"                                        "

	dc.b	"                                        " * DIE
	dc.b	"  * AMIGA INDUSTRIES & SPREADPOINT *    " * SEITE
	dc.b	"     SEND FRIENDLY HANDSHAKES TO:       " * BLEIBT
	dc.b	"                                        " * SO
	dc.b	"  SUBWAY (GEORGE & MARC) - TRSI (ALL)   " * !!
	dc.b	"  FAIRLIGHT - LEGEND - SCOOPEX - SR     "
	dc.b	"  PRISONERS - QUARTEX - CRYSTAL - HQC   "
	dc.b	"  THE WIZARDS - PHENOMENA - CRUSADERS   "
	dc.b	"  UNITED FORCES - NEMESIS - BLACK MONKS "
	dc.b	"  THE SILENTS - ANARCHY - INV. CRIME    "
	dc.b	"  SWITCH - SKYLINE - AGILE - QUADLITE   "
	dc.b	"  SUPPLEX - FACTOR 5 - STARFRONTIERS    "
	dc.b	"  BRAINSTORM - THE COMPANY - ALCATRAZ   "
	dc.b	"  VENTURE - ALPHA FLIGHT - BEERMACHT    "
	dc.b	"                                        "

	dc.b	"                                        " * DIE
	dc.b	"                                        " * SEITE
	DC.B	"                                        "
	dc.b	"  ORACLE - AVENGER - VISION FACTORY     " * BLEIBT
	dc.b	"  DEFJAM & CCS - HORIZON - SCROOGE      " * SO
	dc.b	"  INFINITVE PERFECTION - POWER -        " * !!
	dc.b	"  FCKW - BYTERAPERS - ACCESSION - IBB   "
	dc.b	"  SETROX - D-TECT - PURE METAL CODERS   "
	dc.b	"  RAZOR 1911 - DIGITAL - LEPROSY        "
	dc.b	"  IMPACT INC. - COMA - CYTAX - DEFCON 1 "
	dc.b	"  PBA - VISION - REBELS - SANITY        "
	dc.b	"  PROMAX & KEFRENS - NETWORK - FLASH    "
	dc.b	"                                        "
	dc.b	"                                        "
	dc.b	"                                        "

	dc.b	"                                        " * DIE
	dc.b	"                                        " * SEITE
	dc.b	"  SCAMPY - HOMEBOY & THUNDERCAT         " * BLEIBT
	dc.b	"  SAURON - PHIL DOUGLAS - DEPECHE       " * AUCH
	dc.b	"  JOE - TIP & MANTRONIX - PANTHER       " * SO
	dc.b	"  CHAOS - LOWTEC - E605 - JOE PANIC     " * !!
	dc.b	"  N.O.I.S.E. - RADWAR - MR. ZEROPAGE    " * !!!!!
	dc.b	"  VOGUE - THOMAS LANDBOURG - ULTIMAX    "
	dc.b	"  PHIL/THRUST - PARADISE - KRISTALL/SR  "
	dc.b	"  BLACK GHOST & STARGROOVE - WHITEHEAD  "
	dc.b	"  MAHONEY - WIZLER - JOHN PLAYER -      "
	dc.b	"  IRATA - FLYNN - HAMSTER - DDT - E$G   "
	dc.b	"  ICS - AND ALL OUR OTHER FRIENDS...    "
	dc.b	"                                        "
	dc.b	"                                        "

	dc.b	"                                        " * DIE
	dc.b	"           * THE CREDITS *              " * SEITE
	dc.b	"           ---------------              " * BLEIBT
	dc.b	"                                        " * SO
	dc.b	"    GRMBLWRZ!CODE ........ SECTION 9    " * !!
	dc.b	"    GRMBLWRZ!TEXTS ............ ANDY    "
	dc.b	"    GRMBLWRZ!GFX ... SECTION 9 & TOM    "
	dc.b	"    GRMBLWRZ!MUZAK ............ EDDY    "
	dc.b	"                                        "
	dc.b	"                                        "
	dc.b	"  This small masterpiece is of course   "
	dc.b	" 100 percent OS2.0 compatible and will  "
	dc.b	"     work on every 'normal' Amiga.      "
	dc.b	"  There is NO absolut adress in here!   "
	dc.b	"                                        "

	dc.b	"       **************************       " * DIE
	dc.b	"       * SECTION 9 special PAGE *       " * SEITE
	dc.b	"       **************************       " * BLEIBT
	dc.b	"                                        " * AUCH
	dc.b	"This small GRMBLWRZ! was written in half" * SO
	dc.b	"an hour by me, myself & some lemmings!  " * !!
	dc.b	"                                        " * !!!!!
	dc.b	"       Special Greeetix fly to:         "
	dc.b	"                                        "
	dc.b	"Alex - MaC! - Biggi - Christine - Simone"
	dc.b	"Astrid (2x) - Sybille - Claudia - Steffi"
	dc.b	"all A500+ Freax - Ray Cokes (MTV Europe)"
	dc.b	"Nils & Frank (N.O.I.S.E. Produktions)   "
	dc.b	"my dog - my mouse - my phone - and to a "
	dc.b	"special person (D.) who will know.   ;-)"


	dc.b	0	* <- END OF PAGES

	cnop	0,2
cols	dc.w	$ffc,$fec,$fdc,$fcc,$fce,$fcf,$dcf,$ccf,$cdf,$cff
	dc.w	$cfd,$cfc,$efc,$ffc,$ffe
	dc.w	$886,$776,$876,$766,$767,$767,$768,$668,$678,$788
	dc.w	$687,$686,$776,$776,$887
	dc.w	$443,$443,$433,$433,$433,$434,$334,$334,$334,$344
	dc.w	$344,$343,$443,$443,$444

	* Amiga Noise/ProTracker (32 Instr.) Replayroutine
	* ------------------------------------------------
	* fixed as ASM-Reloc-Code by SECTION 9 in 1991
INIT_MUSIC
	movem.l	d0-a6,-(a7)
	lea	nt_data,a0
	move.l	a0,a1
	lea	$3b8(a1),a1
	moveq	#$7f,d0
	moveq	#0,d1
nt_loop move.l	d1,d2
	subq.w	#1,d0
nt_lop2 move.b	(a1)+,d1
	cmp.b	d2,d1
	bgt.s	nt_loop
	dbf	d0,nt_lop2
	addq.b	#1,d2
	lea	nt_samplestarts(pc),a1
	asl.l	#8,d2
	asl.l	#2,d2
	add.l	#$43c,d2
	add.l	a0,d2
	move.l	d2,a2
	moveq	#$1e,d0
nt_lop3	moveq	#0,d7
	move.l	d7,(a2)
	move.l	a2,(a1)+
	moveq	#0,d1
	move.w	42(a0),d1
	asl.l	#1,d1
	add.l	d1,a2
	lea	$1e(a0),a0
	dbf	d0,nt_lop3
	lea	nt_speed(pc),a0
	move.b	#6,(a0)
	lea	$dff0a8,a0
	moveq	#0,d0
	move.w	d0,(a0)
	move.w	d0,$10(a0)
	move.w	d0,$20(a0)
	move.w	d0,$30(a0)
	lea	nt_songpos(pc),a0
	move.b	d0,(a0)+
	move.w	d0,(a0)+		nt_pattpos
	move.b	d0,(a0)			nt_counter
	bset	#1,$bfe001
	bra.b	nt_silence
END_MUSIC
	movem.l	d0-a6,-(a7)
	moveq	#0,d0
	bclr	#1,$bfe001
nt_silence
	lea	$dff000,a0
	move.w	d0,$a8(a0)
	move.w	d0,$b8(a0)
	move.w	d0,$c8(a0)
	move.w	d0,$d8(a0)
	move.w	#$f,$96(a0)
	movem.l	(a7)+,d0-a6
	rts
PLAY_MUSIC
	movem.l	d0-a6,-(a7)
	moveq	#0,d0
	lea	logo+[[352/8]*51]+2,a0
	move.l	d0,(a0)
	lea	logo+[[352/8]*52]+2,a0
	move.l	d0,(a0)
	lea	logo+[[352/8]*53]+2,a0
	move.l	d0,(a0)
	lea	logo+[[352/8]*54]+2,a0
	move.l	d0,(a0)
	lea	logo+[[352/8]*55]+2,a0
	move.l	d0,(a0)
	lea	nt_data,a0
	lea	nt_counter(pc),a1
	addq.b	#$1,(a1)
	move.b	(a1),D0
	cmp.b	nt_speed(pc),D0
	blt.s	nt_nonew
	moveq	#0,d7
	move.b	d7,(a1)
	bra.w	nt_getnew
nt_nonew 
	lea	nt_voice1(pc),a6
	lea	$dff0a0,a5
	bsr.w	nt_checkcom
	lea	nt_voice2(pc),a6
	lea	$dff0b0,a5
	bsr.w	nt_checkcom
	lea	nt_voice3(pc),a6
	lea	$dff0c0,a5
	bsr.w	nt_checkcom
	lea	nt_voice4(pc),a6
	lea	$dff0d0,a5
	bsr.w	nt_checkcom
	bra.w	nt_endr
nt_arpeggio 
	moveq	#0,d0
	move.b	nt_counter(pc),d0
	divs	#$3,d0
	swap	d0
	cmp.w	#$0,d0
	beq.s	nt_arp2
	cmp.w	#$2,d0
	beq.s	nt_arp1
	moveq	#0,d0
	move.b	$3(a6),d0
	lsr.b	#4,d0
	bra.s	nt_arp3
nt_arp1 moveq	#0,d0
	move.b	$3(a6),d0
	and.b	#$f,d0
	bra.s	nt_arp3
nt_arp2 move.w	$10(a6),d2
	bra.s	nt_arp4
nt_arp3 asl.w	#1,d0
	moveq	#0,d1
	move.w	$10(a6),d1
	lea	nt_periods(pc),a0
	moveq	#$24,d7
nt_arploop 
	move.w	(a0,d0.w),d2
	cmp.w	(a0),d1
	bge.s	nt_arp4
	addq.l	#2,a0
	dbf	d7,nt_arploop
	rts
nt_arp4 move.w	d2,$6(a5)
	rts
nt_getnew 
	lea	nt_data,a0
	move.l	a0,a3
	move.l	a0,a2
	lea	$c(a3),a3
	lea	$3b8(a2),a2
	lea	$43c(a0),a0
	moveq	#0,d0
	move.l	d0,d1
	move.b	nt_songpos(pc),d0
	move.b	(a2,d0.w),d1
	asl.l	#8,d1
	asl.l	#2,d1
	add.w	nt_pattpos(pc),d1
	lea	nt_dmacon(pc),a1
	moveq	#0,d7
	move.w	d7,(a1)
	lea	$dff0a0,a5
	lea	nt_voice1(pc),a6
	bsr.s	nt_playvoice
	lea	$dff0b0,a5
	lea	nt_voice2(pc),a6
	bsr.s	nt_playvoice
	lea	$dff0c0,a5
	lea	nt_voice3(pc),a6
	bsr.s	nt_playvoice
	lea	$dff0d0,a5
	lea	nt_voice4(pc),a6
	bsr.s	nt_playvoice
	bra.w	nt_setdma
nt_playvoice 
	move.l	(a0,d1.l),(a6)
	addq.l	#4,d1
	moveq	#0,d2
	move.b	$2(a6),d2
	and.b	#$f0,d2
	lsr.b	#4,d2
	move.b	(a6),d0
	and.b	#$f0,d0
	or.b	d0,d2
	tst.b	d2
	beq.w	nt_setregs
	movem.l	d0/a5,-(a7)		© SECTION 9
	sub.l	#$dff0a0,a5
	move.w	a5,d0
	lsr.w	#4,d0
	lea	logo+[[352/8]*51]+2,a5
	move.b	#$70,0(a5,d0.w)
	lea	logo+[[352/8]*52]+2,a5
	move.b	#$f8,0(a5,d0.w)
	lea	logo+[[352/8]*53]+2,a5
	move.b	#$f8,0(a5,d0.w)
	lea	logo+[[352/8]*54]+2,a5
	move.b	#$f8,0(a5,d0.w)
	lea	logo+[[352/8]*55]+2,a5
	move.b	#$70,0(a5,d0.w)
	movem.l	(a7)+,d0/a5
	moveq	#0,d3
	lea	nt_samplestarts(pc),a1
	move.l	d2,d4
	subq.l	#$1,d2
	asl.l	#2,d2
	mulu	#$1e,d4
	move.l	(a1,d2.l),$4(a6)
	move.w	(a3,d4.l),$8(a6)
	move.w	$2(a3,d4.l),$12(a6)
	move.w	$4(a3,d4.l),d3
	tst.w	d3
	beq.s	nt_noloop
	move.l	$4(a6),d2
	asl.w	#1,d3
	add.l	d3,d2
	move.l	d2,$a(a6)
	move.w	$4(a3,d4.l),d0
	add.w	$6(a3,d4.l),d0
	move.w	d0,8(a6)
	move.w	$6(a3,d4.l),$e(a6)
	move.w	$12(a6),$8(a5)
	bra.s	nt_setregs
nt_noloop 
	move.l	$4(a6),d2
	add.l	d3,d2
	move.l	d2,$a(a6)
	move.w	$6(a3,d4.l),$e(a6)
	move.w	$12(a6),$8(a5)
nt_setregs 
	move.w	(a6),d0
	and.w	#$fff,d0
	beq.w	nt_checkcom2
	move.b	$2(a6),d0
	and.b	#$F,d0
	cmp.b	#$3,d0
	bne.s	nt_setperiod
	bsr.w	nt_setmyport
	bra.w	nt_checkcom2
nt_setperiod 
	move.w	(a6),$10(a6)
	and.w	#$fff,$10(a6)
	move.w	$14(a6),d0
	move.w	d0,$dff096
	moveq	#0,d7
	move.b	d7,$1b(a6)
	move.l	$4(a6),(a5)
	move.w	$8(a6),$4(a5)
	move.w	$10(a6),d0
	and.w	#$fff,d0
	move.w	d0,$6(a5)
	move.w	$14(a6),d0
	lea	nt_dmacon(pc),a1
	or.w	d0,(a1)
	bra.w	nt_checkcom2
nt_setdma 
	move.w	#$12c,d0
nt_wait dbf	d0,nt_wait
	move.w	nt_dmacon(pc),d0
	or.w	#$8000,d0
	move.w	d0,$dff096
	move.w	#$12c,d0
nt_wai2 dbf	d0,nt_wai2
	lea	$dff000,a5
	lea	nt_voice4(pc),a6
	move.l	$a(a6),$d0(a5)
	move.w	$e(a6),$d4(a5)
	lea	nt_voice3(pc),a6
	move.l	$a(a6),$c0(a5)
	move.w	$e(a6),$c4(a5)
	lea	nt_voice2(pc),a6
	move.l	$a(a6),$b0(a5)
	move.w	$e(a6),$b4(a5)
	lea	nt_voice1(pc),a6
	move.l	$a(a6),$a0(a5)
	move.w	$e(a6),$a4(a5)
	lea	nt_pattpos(pc),a1
	add.w	#$10,(a1)
	cmp.w	#$400,(a1)
	bne.s	nt_endr
nt_nex	lea	nt_pattpos(pc),a1
	moveq	#0,d7
	move.w	d7,(a1)
	lea	nt_break(pc),a1
	moveq	#0,d7
	move.b	d1,(a1)
	lea	nt_songpos(pc),a1
	addq.b	#1,(a1)
	and.b	#$7f,(a1)
	move.b	(a1),d1
	cmp.b	nt_data+$3b6,d1
	bne.s	nt_endr
	move.b	nt_data+$3b7,(a1)
nt_endr lea	nt_break(pc),a1
	tst.b	(a1)
	bne.s	nt_nex
	movem.l	(a7)+,d0-a6
	rts
nt_setmyport 
	move.w	(a6),d2
	and.w	#$fff,d2
	move.w	d2,$18(a6)
	move.w	$10(a6),d0
	moveq	#0,d7
	move.b	d7,$16(a6)
	cmp.w	d0,d2
	beq.s	nt_clrport
	bge.s	nt_rt
	move.b	#$1,$16(a6)
	rts
nt_clrport 
	moveq	#0,d7
	move.w	d7,$18(a6)
nt_rt 	rts
nt_myport 
	move.b	$3(a6),d0
	beq.s	nt_myslide
	move.b	d0,$17(a6)
	moveq	#0,d7
	move.b	d7,$3(a6)
nt_myslide 
	tst.w	$18(a6)
	beq.s	nt_rt
	moveq	#0,d0
	move.b	$17(a6),d0
	tst.b	$16(a6)
	bne.s	nt_mysub
	add.w	d0,$10(a6)
	move.w	$18(a6),d0
	cmp.w	$10(a6),d0
	bgt.s	nt_myok
	move.w	$18(a6),$10(a6)
	moveq	#0,d7
	move.w	d7,$18(a6)
nt_myok move.w	$10(a6),$6(a5)
	rts
nt_mysub 
	sub.w	d0,$10(a6)
	move.w	$18(a6),d0
	cmp.w	$10(a6),d0
	blt.s	nt_myok
	move.w	$18(a6),$10(a6)
	moveq	#0,d7
	move.w	d7,$18(a6)
	move.w	$10(a6),$6(a5)
	rts
nt_vib 	move.b	$3(a6),d0
	beq.s	nt_vi
	move.b	d0,$1a(a6)
nt_vi 	move.b	$1b(a6),d0
	lea	nt_sin(pc),a4
	lsr.w	#$2,d0
	and.w	#$1f,d0
	moveq	#0,d2
	move.b	(a4,d0.w),d2
	move.b	$1a(a6),d0
	and.w	#$f,d0
	mulu	d0,d2
	lsr.w	#$6,d2
	move.w	$10(a6),d0
	tst.b	$1b(a6)
	bmi.s	nt_vibmin
	add.w	d2,d0
	bra.s	nt_vib2
nt_vibmin 
	sub.w	d2,d0
nt_vib2 move.w	d0,$6(a5)
	move.b	$1a(a6),d0
	lsr.w	#$2,d0
	and.w	#$3c,d0
	add.b	d0,$1b(a6)
	rts
nt_nop 	move.w	$10(a6),$6(a5)
	rts
nt_checkcom 
	move.w	$2(a6),d0
	and.w	#$fff,d0
	beq.s	nt_nop
	move.b	$2(a6),d0
	and.b	#$f,d0
	tst.b	d0
	beq.w	nt_arpeggio
	cmp.b	#$1,d0
	beq.s	nt_portup
	cmp.b	#$2,d0
	beq.w	nt_portdown
	cmp.b	#$3,d0
	beq.w	nt_myport
	cmp.b	#$4,d0
	beq.w	nt_vib
	move.w	$10(a6),$6(a5)
	cmp.b	#$a,d0
	beq.s	nt_volslide
	rts
nt_volslide 
	moveq	#0,d0
	move.b	$3(a6),d0
	lsr.b	#4,d0
	tst.b	d0
	beq.s	nt_voldown
	add.w	d0,$12(a6)
	cmp.w	#$40,$12(a6)
	bmi.s	nt_vol2
	move.w	#$40,$12(a6)
nt_vol2 move.w	$12(a6),$8(a5)
	rts
nt_voldown 
	moveq	#0,d0
	move.b	$3(a6),d0
	and.b	#$f,d0
	sub.w	d0,$12(a6)
	bpl.s	nt_vol3
	moveq	#0,d7
	move.w	d7,$12(a6)
nt_vol3 move.w	$12(a6),$8(a5)
	rts
nt_portup 
	moveq	#0,d0
	move.b	$3(a6),d0
	sub.w	d0,$10(a6)
	move.w	$10(a6),d0
	and.w	#$fff,d0
	cmp.w	#$71,d0
	bpl.s	nt_por2
	and.w	#$f000,$10(a6)
	or.w	#$71,$10(a6)
nt_por2 move.w	$10(a6),d0
	and.w	#$fff,d0
	move.w	d0,$6(a5)
	rts
nt_portdown 
	moveq	#0,d0
	move.b	$3(a6),d0
	add.w	d0,$10(a6)
	move.w	$10(a6),d0
	and.w	#$fff,d0
	cmp.w	#$358,d0
	bmi.s	nt_por3
	and.w	#$f000,$10(a6)
	or.w	#$358,$10(a6)
nt_por3 move.w	$10(a6),d0
	and.w	#$fff,d0
	move.w	d0,$6(a5)
	rts
nt_checkcom2 
	move.b	$2(a6),d0
	and.b	#$f,d0
	cmp.b	#$e,d0
	beq.s	nt_setfilt
	cmp.b	#$d,d0
	beq.s	nt_pattbreak
	cmp.b	#$b,d0
	beq.s	nt_posjmp
	cmp.b	#$c,d0
	beq.s	nt_setvol
	cmp.b	#$f,d0
	beq.s	nt_setspeed
	rts
nt_setfilt 
	move.b	$3(a6),d0
	and.b	#$1,d0
	asl.b	#$1,d0
	and.b	#$fd,$bfe001
	or.b	d0,$bfe001
	rts
nt_pattbreak 
	lea	nt_break(pc),a1
	not.b	(a1)
	rts
nt_posjmp 
	move.b	$3(a6),d0
	subq.b	#$1,d0
	lea	nt_songpos(pc),a1
	move.b	d0,(a1)
	lea	nt_break(pc),a1
	not.b	(a1)
	rts
nt_setvol 
	cmp.b	#$40,$3(a6)
	ble.s	nt_vol4
	move.b	#$40,$3(a6)
nt_vol4 move.b	$3(a6),$8(a5)
	rts
nt_setspeed 
	cmp.b	#$1f,$3(a6)
	ble.s	nt_sets
	move.b	#$1f,$3(a6)
nt_sets move.b	$3(a6),d0
	beq.s	nt_rts2
	lea	nt_speed(pc),a1
	move.b	d0,(a1)
	lea	nt_counter(pc),a1
	moveq	#0,d7
	move.b	d7,(a1)
nt_rts2 rts
nt_sin 		dc.b	$00,$18,$31,$4a,$61,$78,$8d,$a1
		dc.b	$b4,$c5,$d4,$e0,$eb,$f4,$fa,$fd
		dc.b	$ff,$fd,$fa,$f4,$eb,$e0,$d4,$c5
		dc.b	$b4,$a1,$8d,$78,$61,$4a,$31,$18
nt_periods 	dc.w	$0358,$0328,$02fa,$02d0,$02a6,$0280
		dc.w	$025c,$023a,$021a,$01fc,$01e0
		dc.w	$01c5,$01ac,$0194,$017d,$0168,$0153
		dc.w	$0140,$012e,$011d,$010d,$00fe
		dc.w	$00f0,$00e2,$00d6,$00ca,$00be,$00b4
		dc.w	$00aa,$00a0,$0097,$008f,$0087
		dc.w	$007f,$0078,$0071,$0000,$0000
nt_speed 	dc.b	0
nt_songpos 	dc.b	0
nt_pattpos 	dc.w	0
nt_counter 	dc.b	0
nt_break 	dc.b	0
nt_dmacon 	dc.w	0
nt_samplestarts dcb.l	31,0
nt_voice1 	dcb.w	10,0
		dc.w	1
		dcb.w	3,0
nt_voice2 	dcb.w	10,0
		dc.w	2
		dcb.w	3,0
nt_voice3 	dcb.w	10,0
		dc.w	4
		dcb.w	3,0
nt_voice4 	dcb.w	10,0
		dc.w	8
		dcb.w	3,0

	SECTION	this_is_chip,DATA_C
newcop	dc.w	$008e,$2479,$0090,$34c9
	dc.w	$0092,$0030,$0094,$00d8
	dc.w	$0102,$0000,$0104,$0000
	dc.w	$0100,$0000
	dc.w	$0180,$0000,$0182,$0eef,$0184,$0cce,$0186,$0bbc
	dc.w	$0188,$099a,$018a,$0778,$018c,$0556,$018e,$0334
	dc.w	$01a2,$0445,$01a4,$0667,$01a6,$0889
star_p	dc.w	$0120,$0000,$0122,$0000,$0124,$0000,$0126,$0000
	dc.w	$0128,$0000,$012a,$0000,$012c,$0000,$012e,$0000
	dc.w	$0130,$0000,$0132,$0000,$0134,$0000,$0136,$0000
	dc.w	$0138,$0000,$013a,$0000,$013c,$0000,$013e,$0000
	dc.w	$2401,$fffe
emp1cop	dc.w	$e0,0,$e2,0,$e4,0
	dc.w	$0100,$1200
	dc.w	$2c01,$fffe,$0108,$0000,$010a,$0000,$0100,$3200
planes	dc.w	$e0,0,$e2,0,$e4,0,$e6,0,$e8,0,$ea,0
	dc.w	$5f01,$fffe,$0182,$0724,$5f51,$fffe,$0182,$0eef
	dc.w	$6001,$fffe,$0182,$0724,$6051,$fffe,$0182,$0eef
	dc.w	$6101,$fffe,$0182,$0724,$6151,$fffe,$0182,$0eef
	dc.w	$6201,$fffe,$0182,$0724,$6251,$fffe,$0182,$0eef
	dc.w	$6301,$fffe,$0182,$0724,$6351,$fffe,$0182,$0eef

	dc.w	$6401,$fffe
emp2cop	dc.w	$e0,0,$e2,0,$e4,0
	dc.w	$0100,$1200

	dc.w	$6909,$fffe,$0180,$001
	dc.w	$6a09,$fffe,$0180,$003
	dc.w	$6b09,$fffe,$0180,$005
	dc.w	$6c09,$fffe,$0180,$006,$0100,$0000
	dc.w	$6d09,$fffe,$0180,$007
	dc.w	$6e09,$fffe,$0180,$008
	dc.w	$6f09,$fffe,$0180,$007
	dc.w	$7009,$fffe,$0180,$006
	dc.w	$7109,$fffe,$0180,$005
	dc.w	$7201,$fffe
txtcop	dc.w	$e0,0,$e2,0,$e8,0,$ea,0
backcop	dc.w	$e4,0,$e6,0
	dc.w	$0190,$0005,$0192,$0004
	dc.w	$7401,$fffe,$0108,$0000,$010a,$0000,$0100,$3400
colscop	dc.w	$0182,$0000,$0184,$0000,$0186,$0000
	dc.w	$7e01,$fffe,$0182,$0000,$0184,$0000,$0186,$0000
	dc.w	$8801,$fffe,$0182,$0000,$0184,$0000,$0186,$0000
	dc.w	$9201,$fffe,$0182,$0000,$0184,$0000,$0186,$0000
	dc.w	$9c01,$fffe,$0182,$0000,$0184,$0000,$0186,$0000
	dc.w	$a601,$fffe,$0182,$0000,$0184,$0000,$0186,$0000
	dc.w	$b001,$fffe,$0182,$0000,$0184,$0000,$0186,$0000
	dc.w	$ba01,$fffe,$0182,$0000,$0184,$0000,$0186,$0000
	dc.w	$c401,$fffe,$0182,$0000,$0184,$0000,$0186,$0000
	dc.w	$ce01,$fffe,$0182,$0000,$0184,$0000,$0186,$0000
	dc.w	$d801,$fffe,$0182,$0000,$0184,$0000,$0186,$0000
	dc.w	$e201,$fffe,$0182,$0000,$0184,$0000,$0186,$0000
	dc.w	$ec01,$fffe,$0182,$0000,$0184,$0000,$0186,$0000
	dc.w	$f601,$fffe,$0182,$0000,$0184,$0000,$0186,$0000
	dc.w	$ffdf,$fffe,$0182,$0000,$0184,$0000,$0186,$0000

	dc.w	$0a01,$fffe,$0100,$0000

	dc.w	$0b09,$fffe,$0180,$006
	dc.w	$0c09,$fffe,$0180,$007
	dc.w	$0d09,$fffe,$0180,$008
	dc.w	$0e09,$fffe,$0180,$007
	dc.w	$0f09,$fffe,$0180,$006
emp3cop	dc.w	$e0,0,$e2,0,$e4,0
	dc.w	$0100,$1200
	dc.w	$1009,$fffe,$0180,$005
	dc.w	$1109,$fffe,$0180,$003
	dc.w	$1209,$fffe,$0180,$001
	dc.w	$1309,$fffe,$0180,$000

	dc.w	$1c01,$fffe,$0182,$0ccd,$0184,$0889,$0186,$0444,$0100,$000
scrcop	dc.w	$e0,0,$e2,0,$e4,0,$e6,0
	dc.w	$1d01,$fffe,$0108,$0002,$010a,$0002,$0100,$2200
	dc.w	$2501,$fffe
emp4cop	dc.w	$e0,0,$e2,0,$e4,0
	dc.w	$0100,$1200
	dc.l	$fffffffe

	INCDIR	"dh1:IncGfx/"
font	INCBIN	"Font.GRMBL.RAW"	; 'Font2Ext.RAW'
logo	INCBIN	"LOGO.GRMBL.RAW"	; 'Logo.RAW'
back	INCBIN	"BACK.GRMBL.RAW"	; 'Back.RAW'
	INCDIR	"dh1:modules/"
nt_data	INCBIN	"mod.GRMBLWRZ!"		; 'mod.dang'
	dc.l	0
	cnop	0,4
stars	dc.l	$1e891f00,$80000000,$20a12100,$00008000
	dc.l	$22662300,$80008000,$24d02500,$80000000
	dc.l	$26562700,$00008000,$282c2900,$80008000
	dc.l	$2a692b00,$80000000,$2cd32d00,$00008000
	dc.l	$2efe2f00,$80008000,$30603100,$80000000
	dc.l	$32493300,$00008000,$34663500,$80008000
	dc.l	$369f3700,$80000000,$38c43900,$00008000
	dc.l	$3a413b00,$80008000,$3c603d00,$80000000
	dc.l	$3ec23f00,$00008000,$40574100,$80008000
	dc.l	$42c44300,$80000000,$44614500,$00008000
	dc.l	$46524700,$80008000,$484e4900,$80000000
	dc.l	$4a6e4b00,$00008000,$4c0d4d00,$80008000
	dc.l	$4e894f00,$80000000,$50a15100,$00008000
	dc.l	$52665300,$80008000,$54d05500,$80000000
	dc.l	$56565700,$00008000,$585c5900,$80008000
	dc.l	$5ad05b00,$80000000,$5c895d00,$00008000
	dc.l	$5e715f00,$80008000,$60886100,$80000000
	dc.l	$629d6300,$00008000,$646b6500,$80008000
	dc.l	$66a86700,$80000000,$68746900,$00008000
	dc.l	$6ab46b00,$80008000,$6ccc6d00,$80000000
	dc.l	$10af1106,$00008000
	dc.l	$12ed1306,$80008000,$14561506,$80000000
	dc.l	$164f1706,$00008000,$188d1906,$80008000
	dc.l	$1a7c1b06,$80000000,$1ca11d06,$00008000
	dc.l	$1ed21f06,$80008000,$20d22106,$80000000
	dc.l	$22c22306,$00008000,$24b32506,$80008000
	dc.l	$26562706,$80000000,$282c2906,$80000000
	dc.l	$2a692b06,$80008000,$2cd32d06,$80000000
	dc.l	$2efe2f06,$00008000,$30603106,$80008000
	dc.l	$32493306,$80000000,$34663506,$00008000
	dc.l	$369f3706,$80008000,$38c43906,$80000000
	dc.l	$3a413b06,$00008000,$3cd33d06,$80008000
	dc.l	$00000000
end_stars
	

	SECTION	this_is_guess_what,BSS_C
scrdat	ds.b	368/8*[16+1]
txtdat	ds.b	[[352/8]*150]*2
empty	ds.b	[352/8]*30
