|  |   
| Author | Message |  
	| Overflow Member
 | 
		FROMC	EQU	0
 Incdir	dh0:include/
 include "exec/types.i"
 include "exec/nodes.i"
 include "exec/ports.i"
 include "exec/lists.i"
 include "devices/input.i"
 include "devices/inputevent.i"
 include "graphics/gfxbase.i"
 include "dos/dosextens.i"
 include "dos/dos.i"
 
 _LVODisable		EQU	-120
 _LVOEnable		EQU	-126
 _LVOForbid		EQU	-132
 _LVOPermit		EQU	-138
 _LVOFindTask		EQU	-294
 _LVOAllocSignal		EQU	-330
 _LVOFreeSignal		EQU	-336
 _LVOGetMsg		EQU	-372
 _LVOReplyMsg		EQU	-378
 _LVOWaitPort		EQU	-384
 _LVOCloseLibrary	EQU	-414
 _LVOOpenDevice		EQU	-444
 _LVOCloseDevice		EQU	-450
 _LVODoIO		EQU	-456
 _LVOOpenLibrary		EQU	-552
 
 _LVOLoadView		EQU	-222
 _LVOWaitBlit		EQU	-228
 _LVOWaitTOF		EQU	-270
 
 IF	FROMC
 XREF	_main
 ENDC
 
 _entry:
 movem.l	d0/a0,_args
 move.l	4.w,a6
 moveq	#RETURN_FAIL,d7
 
 ; handle wb startup
 sub.l	a1,a1
 jsr	_LVOFindTask(a6)
 move.l	d0,a2
 tst.l	pr_CLI(a2)
 bne.s	.iscli
 lea	pr_MsgPort(a2),a0
 jsr	_LVOWaitPort(a6)
 lea	pr_MsgPort(a2),a0
 jsr	_LVOGetMsg(a6)
 move.l	d0,_WBenchMsg
 .iscli:
 ; init msgport
 moveq	#-1,d0
 jsr	_LVOAllocSignal(a6)
 move.b	d0,_sigbit
 bmi	.nosignal
 move.l	a2,_sigtask
 
 ; hide possible requesters since user has no way to
 ; see or close them.
 moveq	#-1,d0
 move.l	pr_WindowPtr(a2),_oldwinptr
 move.l	d0,pr_WindowPtr(a2)
 
 ; open input.device
 lea	.inputname(pc),a0
 moveq	#0,d0
 moveq	#0,d1
 lea	_ioreq(pc),a1
 jsr	_LVOOpenDevice(a6)
 tst.b	d0
 bne	.noinput
 
 ; install inputhandler
 lea	_ioreq(pc),a1
 move.w	#IND_ADDHANDLER,IO_COMMAND(a1)
 move.l	#_ih_is,IO_DATA(a1)
 jsr	_LVODoIO(a6)
 
 ; open graphics.library
 lea	.gfxname(pc),a1
 moveq	#33,d0			; Kickstart 1.2 or higher
 jsr	_LVOOpenLibrary(a6)
 move.l	d0,_GfxBase
 beq	.nogfx
 move.l	d0,a6
 
 ; save old view
 move.l	gb_ActiView(a6),_oldview
 
 ; flush view
 sub.l	a1,a1
 jsr	_LVOLoadView(a6)
 jsr	_LVOWaitTOF(a6)
 jsr	_LVOWaitTOF(a6)
 
 ; do the stuff
 movem.l	_args(pc),d0/a0
 bsr	_main
 move.l	d0,d7
 
 move.l	_GfxBase,a6
 
 ; restore view & copper ptr
 move.l	_oldview(pc),a1
 jsr	_LVOLoadView(a6)
 move.l	gb_copinit(a6),$DFF080
 jsr	_LVOWaitTOF(a6)
 jsr	_LVOWaitTOF(a6)
 
 ; close graphics.library
 move.l	a6,a1
 move.l	4.w,a6
 jsr	_LVOCloseLibrary(a6)
 
 .nogfx:
 ; remove inputhandler
 lea	_ioreq(pc),a1
 move.w	#IND_REMHANDLER,IO_COMMAND(a1)
 move.l	#_ih_is,IO_DATA(a1)
 jsr	_LVODoIO(a6)
 
 lea	_ioreq(pc),a1
 jsr	_LVOCloseDevice(a6)
 
 .noinput:
 move.l	_sigtask(pc),a0
 move.l	_oldwinptr(pc),pr_WindowPtr(a0)
 
 moveq	#0,d0
 move.b	_sigbit(pc),d0
 jsr	_LVOFreeSignal(a6)
 
 .nosignal:
 move.l	_WBenchMsg(pc),d0
 beq.s	.notwb
 move.l	a0,a1
 jsr	_LVOForbid(a6)
 jsr	_LVOReplyMsg(a6)
 
 .notwb:
 move.l	d7,d0
 rts
 
 
 .inputname:
 dc.b	'input.device',0
 .gfxname:
 dc.b	'graphics.library',0
 
 
 CNOP	0,4
 
 _args:
 dc.l	0,0
 _oldwinptr:
 dc.l	0
 _WBenchMsg:
 dc.l	0
 _GfxBase:
 dc.l	0
 _oldview:
 dc.l	0
 
 _msgport:
 dc.l	0,0		; LN_SUCC, LN_PRED
 dc.b	NT_MSGPORT,0	; LN_TYPE, LN_PRI
 dc.l	0		; LN_NAME
 dc.b	PA_SIGNAL	; MP_FLAGS
 _sigbit:
 dc.b	-1		; MP_SIGBIT
 _sigtask:
 dc.l	0		; MP_SIGTASK
 .head:
 dc.l	.tail		; MLH_HEAD
 .tail:
 dc.l	0		; MLH_TAIL
 dc.l	.head		; MLH_TAILPRED
 
 _ioreq:
 dc.l	0,0		; LN_SUCC, LN_PRED
 dc.b	NT_REPLYMSG,0	; LN_TYPE, LN_PRI
 dc.l	0		; LN_NAME
 dc.l	_msgport	; MN_REPLYPORT
 dc.w	IOSTD_SIZE	; MN_LENGTH
 dc.l	0		; IO_DEVICE
 dc.l	0		; IO_UNIT
 dc.w	0		; IO_COMMAND
 dc.b	0,0		; IO_FLAGS, IO_ERROR
 dc.l	0		; IO_ACTUAL
 dc.l	0		; IO_LENGTH
 dc.l	0		; IO_DATA
 dc.l	0		; IO_OFFSET
 
 _ih_is:
 dc.l	0,0		; LN_SUCC, LN_PRED
 dc.b	NT_INTERRUPT,127	; LN_TYPE, LN_PRI ** highest priority **
 dc.l	.ih_name	; LN_NAME
 dc.l	0		; IS_DATA
 dc.l	.ih_code	; IS_CODE
 
 .ih_code:
 move.l	a0,d0
 .loop:
 move.b	#IECLASS_NULL,ie_Class(a0)
 move.l	(a0),a0
 move.l	a0,d1
 bne.b	.loop
 
 ; d0 is the original a0
 rts
 
 .ih_name:
 dc.b	'eat-events inputhandler',0
 
 CNOP	0,4
 
 
 IF	FROMC
 
 XDEF	_WBenchMsg
 
 ELSE
 
 _main:
 move.l	#2000000-1,d0
 .delay:
 move.w	d0,$dff180
 subq.l	#1,d0
 bne.b	.delay
 
 moveq	#RETURN_OK,d0
 rts
 
 ENDC
 |  
	| Overflow Member
 | 
		In the old days I used to do it like this, but this wont work in the new world. In the SystemInit code above there is a _main and .delay loop that counts down from 2 000 000 to zero.
 The Old Skool loop below displays the Norwegain flag colors in the middle of the screen if i use my old Amiga, but when I put it into the _main segment it only gives me a grey screen....     And yes, I remove the 2 000 000 countdown delay code segement and insert the loop below.
 	Section	Maincode,Code_c	
 	move.w	#$01a0,$dff096
 	lea.l	copperlist,a1
 	move.l	a1,$dff080
 	move.w	#$8080,$dff096
 wait:	btst	#6,$bfe001
 	bne	wait
 	move.w	#$0080,$dff096
 	move.l	$04,a6
 	move.l	156(a6),a1
 	move.l	38(a1),$dff080
 	move.w	#$81a0,$dff096
 	rts
 copperlist:
 	dc.w	$9001,$fffe
 	dc.w	$0180,$0f00
 	dc.w	$a001,$fffe
 	dc.w	$0180,$0fff
 	dc.w	$a401,$fffe
 	dc.w	$0180,$000f
 	dc.w	$aa01,$fffe
 	dc.w	$0180,$0fff
 	dc.w	$ae01,$fffe
 	dc.w	$0180,$0f00
 	dc.w	$be01,$fffe
 	dc.w	$0180,$0000
 	dc.w	$ffff,$fffe
                 dc.w	$ffff,$fffe
   |  
	| rload Member
 | 
		do you get to exit from the grey screen or is it a crash?
Maybe something is running in an interrupt somewhere on the system.. copper interrupt (I think there is such a thing) which reloads the wb copper with its grey background when triggered or something...
 |  
	| rload Member
 | 
		you should save DMACON and INTENA then kill all DMA and interrupts.. Then start whatever DMA and interrupts you need. Restore DMACON and INTENA on exit..		 |  
	| Overflow Member
 | 
		I get to exit from the grey screen easy. It just waits for me to click the left mousebutton as you would expect.
 I run that code on my A1200 (the copperprogram) with a Blizzard 030 18 meg total of ram it wouldnt work until i forced it into chipmem with the Section maincode,code_c command...
 Then it worked nicely on my real computer.. i havent tried this Startup code on my Amiga thou...maybe i should... if the startupcode+copperprogram works on my A1200 there there is something funky with WinUAE....
 or that my coppercoding is too obsolete...
 Anyone that feels the urge to modify my code so it actually works are welcome..    |  
	| noname Member
 | 
		Had just a quick look at your code. And having read about your new world/old world it seems that you are expecting copperlists to work from fastram (new world) which is not the case! A copperlist has to be within reach of the copper and thus lie in the chip-ram. All custom chips demand their data to be in chip-ram. Fast-ram is good for fast code execution and generally for chunky to planar effects.
 Insert another section statement just before your copperlists (and then in future also for your bitplanes, etc.).
 Example: "section chip-stuff,data_c"
 |  
	| Overflow Member
 | 
		Hehe...Thanks. The reason why i was puzzled was coz it worked on my A1200 with Fastmem when i put that Section Stuff,code_c...but not when used in conjunction with that startup code...
 Anyhow..thanks for the tip, and if you have such an example of a "simple" coppercode lying around pliz post it. Something for me to play around with. Best way to learn i guess...
 |  
	| noname Member
 | 
		Sorry, don't have a simple example at hands. But I can recommend you to get your hands on a couple of documents if you should not already have them.
  - How to Code 7 
  - TFA AGA-Guide
  - Amiga Hardware Reference Manual 
  - any MC68000 Reference Manual
 Here are some links that I got from Google:
http://www.mways.co.uk/amiga/howtocode/
http://www.algonet.se/~chaozer/assembler.shtml  (AGA Guide and much more, think it has been mentioned before)
http://www.amigarealm.com/computing/knowledge/hardref/ch2.htm There was also a very nice (huge) tutorial by Rio/Ram Jam which came along with complete ready to assemble examples.		 |  
	| dalton Member
 | 
		About using a copperlist for setting the screen colors. This is not really necessary unless you wan't to change them while the screen is being drawn, right? Still it seems to be the conventional method to set the colours... including (or generating) a 2k copperlist instead of setting the colours once. Why is this?		 |  
	| Overflow Member
 | 
		hehe..thanks for not spoonfeeding me sources. That led me to open a book and read. I didnt know this, but Registers d0, d1, a0 and a1 are scratch registers and their contents must be considered lost after a system library call. And a OS friendly startup code sure got plenty of those calls! Changed the copper Adress register to a4 and volia...Damn im stupid :P Atleast I learned something!		 |  
	| Overflow Member
 | 
		_main: 
bsr Initcop
 
 wait: btst #6,$bfe001 ;wait until left mousebutton is clicked to exit
 bne wait
 
 moveq #RETURN_OK,d0
 rts
 
 Initcop:
 sub.l a3,a3 ;clears a3
 lea.l copper,a3 ;Loads the space for the copper.
 move.l #15-1,d4 ;loop 15 times. dbra loops until d4 is -1 so we set 15-1
 move.l #$8201fffe,d3 ;loads first copperposition into d3
 move.l #$018000f0,d5 ;loads colorregister 0 ($dff180) with a green color into d5
 
 docop: move.l d3,(a3)+ ;moves first vertical copperposition into our copperlist
 move.l d5,(a3)+ ;moves colorregister 0 and green color into the next line in copperlist
 
 add.l #$01000000,d3 ;adds #$0100 to $8201 changing copper position to $8301
 sub.l #$00000010,d5 ;subtracts #$0010 from #$00f0 making the green turn gradually darker
 
 dbra d4,docop ;loop until d4 equals -1
 
 move.l #copper,$dff080 ;moves the finished copperlist into CopperFirstLocationRegister
 rts
 
 
 Section Coplist,data_c
 copper:
 ds.l 30 ;Define Space. 30 longwords to room the result from the
 ;Initcop routine. The copperroutine loops 15 times but makes
 dc.w $0180,$0000 ;2 lines every loop. 2*15=30
 dc.w $ffff,$fffe
 dc.w $ffff,$fffe
 ENDC
 |  
	| Overflow Member
 | 
		Basically what this routine does it to create a copperlist, which saves you alot of typing. 
If you wanted to type the whole copperlist from scratch using dc.w commands it would be;
 
 dc.w $8201,$fffe
 dc.w $0180,$00f0
 dc.w $8201,$fffe
 dc.w $0180,$00e0
 dc.w $8201,$fffe
 dc.w $0180,$00d0
 dc.w $8201,$fffe
 dc.w $0180,$00c0
 dc.w $8201,$fffe
 dc.w $0180,$00b0
 dc.w $8201,$fffe
 dc.w $0180,$00a0
 dc.w $8201,$fffe
 dc.w $0180,$0090
 dc.w $8201,$fffe
 dc.w $0180,$0080
 dc.w $8201,$fffe
 dc.w $0180,$0070
 dc.w $8201,$fffe
 dc.w $0180,$0060
 dc.w $8201,$fffe
 dc.w $0180,$0050
 dc.w $8201,$fffe
 dc.w $0180,$0040
 dc.w $8201,$fffe
 dc.w $0180,$0030
 dc.w $8201,$fffe
 dc.w $0180,$0020
 dc.w $8201,$fffe
 dc.w $0180,$0010
 
 
 dc.w $0180,$0000
 dc.w $ffff,$fffe
 dc.w $ffff,$fffe
 
 Imagine if you wanted a 256 line copperlist :P
 
 With this routine all you need to do is to change 15-1 in the Loopcounter into 256-1 and ds.l 2*256 and the copperlist is made automatically.
 
 You could ofcourse make the color black $0000 and remove the sub.l #$00000010,d5 line and change move.l #$018000f0,d5 to #$01800000 if you wanted a clean copperlist which were loaded up with a premade colorpalette.
 
 Another way to make a looong copper automatically is using macro;
 
 copper:
 ccl SET $5e21
 cct SET 0
 REPT 120
 dc.w ccl,-2,$180,cct
 ccl SET ccl+2
 cct SET cct+16
 ENDR
 dc.w $180,$0
 |  
	| Overflow Member
 | 
		_main:	
bsr.w	colloop
 move.l	#copper,$dff080
 
 wait:
 btst	#6,$bfe001        ;wait for left mouse click to exit
 bne	wait
 
 moveq	#RETURN_OK,d0
 rts
 
 ;***********-colorLoop-******************
 ; a3 - counter
 ; a4 - color
 ; a5 - colcopper
 ; d3 - counterdata
 ; d4 - colloop counter
 
 counter:	dc.w	$0000
 
 colloop
 lea	counter,a3
 move.w	(a3),d3
 addq.w	#2,(a3)
 cmp.w	#134,d3      ;total number of colors=68*2=136.
 bne	notend       ;First color at 0 count so 134
 
 clr.l	(a3)
 clr.l	d3
 
 notend:
 lea	colors,a4
 lea	copper,a5
 
 move.w	#67,d4      ;colorloopcounter
 
 colorloop:
 move.w	(a4,d3.w),6(a5)  ;color into copper
 addq.w	#2,d3            ;increase colorcounter/offset
 addq.l	#8,a5            ;jump to next colorregister in copper
 dbra	d4,colorloop           ;branch until d4 -1
 rts
 ;************************************
 
 Section	Coplist,data_c
 
 copper:
 ccl	SET	$1e01           ;dc.w $1e01,$fffe
 cct	SET	0		    ;dc.w $0180,$0000
 REPT	68	          ;Vertical position increased by $0100 per repitition
 dc.w	ccl,-2,$180,cct ;COLOR00 black
 ccl	SET	ccl+$0100
 cct	SET	cct
 ENDR
 
 dc.w	$0180,$0000
 dc.w	$ffff,$fffe
 dc.w	$ffff,$fffe
 
 colors:	dc.w $0f00,$0e01,$0e01,$0c03,$0b04,$0a05,$0906,$0807
 dc.w $0708,$0609,$050a,$040b,$030c,$020d,$010e,$000f
 dc.w $000f,$011e,$022d,$033c,$044b,$055a,$0669,$0778
 dc.w $0887,$0996,$0aa5,$0bb4,$0cc3,$0dd2,$0ee1,$0ff0
 dc.w $0ff0,$0fe0,$0fd0,$0fc0,$0fb0,$0fa0,$0f90,$0f80
 dc.w $0f70,$0f60,$0f50,$0f40,$0f30,$0f20,$0f10,$0f00
 dc.w $0f00,$0e01,$0d02,$0c03,$0b04,$0a05,$0906,$0807
 dc.w $0708,$0609,$050a,$040b,$030c,$020d,$010e,$000f
 dc.w $000f,$011e,$022d,$033c
 |  
	| Overflow Member
 | 
		Another routine that makes coppercoding faster. This cycleroutine has a couple of addressingmodes that usually pose somewhat a challenge to get right the first couple of times.
 colorloop:
 move.w	(a4,d3.w),6(a5)
 addq.w	#2,d3
 addq.l	#8,a5
 dbra	d4,colorloop
 
 What color will be loaded into the copper?
 (a4,d3.w)  (a4) points to the color data "colors", but if we just
 use (a4) the only color you will get is $0f00 (red), so you need
 an offset; addq.w  #2,d3. This changes the instruction to
 (a4) the first round (a4+0) and (a4,d3.w) second round (a4+2) etc.
 
 Offset#                 0       2        4        6        8       10      12      14   etc
 colors:	dc.w $0f00,$0e01,$0e01,$0c03,$0b04,$0a05,$0906,$0807
 
 You can check this by removing addq.w   #2,d3 and putting in desired
 Numbers into "counter:	dc.w	$0000" like $16 or whateverand check
 the color you get VS the color table.
 
 So, were does these colors end up?
 
 The move.w (a4,d3.w),6(a5) command;
 
 6(a5)   a5 contains the copperlist.
 Offset    0     2
 Copper  $1e01,$fffe
 Offset    4     6
 $0180,$0000
 
 If you had only (a5) without the 6 as a offset the color would end up in
 The copperlist position value.
 
 This is atleast how my mind has gotten around the addressingmodes, but being
 A newbie I might have made my own rules to expain something incorrectly,
 So if you spot any crazyness in my code and explaination, pliz tell me.
 
 Below is the full working example with startup, "maincode" and shutdown. If your includes passes assembly, your good to go.....
 |  
	| Overflow Member
 | 
		FROMC	EQU	0
 incdir	dh0:include/
 include "exec/types.i"
 include "exec/nodes.i"
 include "exec/ports.i"
 include "exec/lists.i"
 include "devices/input.i"
 include "devices/inputevent.i"
 include "graphics/gfxbase.i"
 include "dos/dosextens.i"
 include "dos/dos.i"
 
 _LVODisable		EQU	-120
 _LVOEnable		EQU	-126
 _LVOForbid		EQU	-132
 _LVOPermit		EQU	-138
 _LVOFindTask		EQU	-294
 _LVOAllocSignal		EQU	-330
 _LVOFreeSignal		EQU	-336
 _LVOGetMsg		EQU	-372
 _LVOReplyMsg		EQU	-378
 _LVOWaitPort		EQU	-384
 _LVOCloseLibrary	EQU	-414
 _LVOOpenDevice		EQU	-444
 _LVOCloseDevice		EQU	-450
 _LVODoIO		EQU	-456
 _LVOOpenLibrary		EQU	-552
 
 _LVOLoadView		EQU	-222
 _LVOWaitBlit		EQU	-228
 _LVOWaitTOF		EQU	-270
 
 IF	FROMC
 XREF	_main
 ENDC
 
 _entry:
 movem.l	d0/a0,_args
 move.l	4.w,a6
 moveq	#RETURN_FAIL,d7
 
 ; handle wb startup
 sub.l	a1,a1
 jsr	_LVOFindTask(a6)
 move.l	d0,a2
 tst.l	pr_CLI(a2)
 bne.s	.iscli
 lea	pr_MsgPort(a2),a0
 jsr	_LVOWaitPort(a6)
 lea	pr_MsgPort(a2),a0
 jsr	_LVOGetMsg(a6)
 move.l	d0,_WBenchMsg
 .iscli:
 ; init msgport
 moveq	#-1,d0
 jsr	_LVOAllocSignal(a6)
 move.b	d0,_sigbit
 bmi	.nosignal
 move.l	a2,_sigtask
 
 ; hide possible requesters since user has no way to
 ; see or close them.
 moveq	#-1,d0
 move.l	pr_WindowPtr(a2),_oldwinptr
 move.l	d0,pr_WindowPtr(a2)
 
 ; open input.device
 lea	.inputname(pc),a0
 moveq	#0,d0
 moveq	#0,d1
 lea	_ioreq(pc),a1
 jsr	_LVOOpenDevice(a6)
 tst.b	d0
 bne	.noinput
 
 ; install inputhandler
 lea	_ioreq(pc),a1
 move.w	#IND_ADDHANDLER,IO_COMMAND(a1)
 move.l	#_ih_is,IO_DATA(a1)
 jsr	_LVODoIO(a6)
 
 ; open graphics.library
 lea	.gfxname(pc),a1
 moveq	#33,d0			; Kickstart 1.2 or higher
 jsr	_LVOOpenLibrary(a6)
 move.l	d0,_GfxBase
 beq	.nogfx
 move.l	d0,a6
 
 ; save old view
 move.l	gb_ActiView(a6),_oldview
 
 ; flush view
 sub.l	a1,a1
 jsr	_LVOLoadView(a6)
 jsr	_LVOWaitTOF(a6)
 jsr	_LVOWaitTOF(a6)
 
 ; do the stuff
 movem.l	_args(pc),d0/a0
 bsr	_main
 move.l	d0,d7
 
 move.l	_GfxBase,a6
 
 ; restore view & copper ptr
 move.l	_oldview(pc),a1
 jsr	_LVOLoadView(a6)
 move.l	gb_copinit(a6),$DFF080
 jsr	_LVOWaitTOF(a6)
 jsr	_LVOWaitTOF(a6)
 
 ; close graphics.library
 move.l	a6,a1
 move.l	4.w,a6
 jsr	_LVOCloseLibrary(a6)
 
 .nogfx:
 ; remove inputhandler
 lea	_ioreq(pc),a1
 move.w	#IND_REMHANDLER,IO_COMMAND(a1)
 move.l	#_ih_is,IO_DATA(a1)
 jsr	_LVODoIO(a6)
 
 lea	_ioreq(pc),a1
 jsr	_LVOCloseDevice(a6)
 
 .noinput:
 move.l	_sigtask(pc),a0
 move.l	_oldwinptr(pc),pr_WindowPtr(a0)
 
 moveq	#0,d0
 move.b	_sigbit(pc),d0
 jsr	_LVOFreeSignal(a6)
 
 .nosignal:
 move.l	_WBenchMsg(pc),d0
 beq.s	.notwb
 move.l	a0,a1
 jsr	_LVOForbid(a6)
 jsr	_LVOReplyMsg(a6)
 
 .notwb:
 move.l	d7,d0
 rts
 
 
 .inputname:
 dc.b	'input.device',0
 .gfxname:
 dc.b	'graphics.library',0
 
 
 CNOP	0,4
 
 _args:
 dc.l	0,0
 _oldwinptr:
 dc.l	0
 _WBenchMsg:
 dc.l	0
 _GfxBase:
 dc.l	0
 _oldview:
 dc.l	0
 
 _msgport:
 dc.l	0,0		; LN_SUCC, LN_PRED
 dc.b	NT_MSGPORT,0	; LN_TYPE, LN_PRI
 dc.l	0		; LN_NAME
 dc.b	PA_SIGNAL	; MP_FLAGS
 _sigbit:
 dc.b	-1		; MP_SIGBIT
 _sigtask:
 dc.l	0		; MP_SIGTASK
 .head:
 dc.l	.tail		; MLH_HEAD
 .tail:
 dc.l	0		; MLH_TAIL
 dc.l	.head		; MLH_TAILPRED
 
 _ioreq:
 dc.l	0,0		; LN_SUCC, LN_PRED
 dc.b	NT_REPLYMSG,0	; LN_TYPE, LN_PRI
 dc.l	0		; LN_NAME
 dc.l	_msgport	; MN_REPLYPORT
 dc.w	IOSTD_SIZE	; MN_LENGTH
 dc.l	0		; IO_DEVICE
 dc.l	0		; IO_UNIT
 dc.w	0		; IO_COMMAND
 dc.b	0,0		; IO_FLAGS, IO_ERROR
 dc.l	0		; IO_ACTUAL
 dc.l	0		; IO_LENGTH
 dc.l	0		; IO_DATA
 dc.l	0		; IO_OFFSET
 
 _ih_is:
 dc.l	0,0		; LN_SUCC, LN_PRED
 dc.b	NT_INTERRUPT,127	; LN_TYPE, LN_PRI ** highest priority **
 dc.l	.ih_name	; LN_NAME
 dc.l	0		; IS_DATA
 dc.l	.ih_code	; IS_CODE
 
 .ih_code:
 move.l	a0,d0
 .loop:
 move.b	#IECLASS_NULL,ie_Class(a0)
 move.l	(a0),a0
 move.l	a0,d1
 bne.b	.loop
 
 ; d0 is the original a0
 rts
 
 .ih_name:
 dc.b	'eat-events inputhandler',0
 
 CNOP	0,4
 
 
 IF	FROMC
 
 XDEF	_WBenchMsg
 
 ELSE
 
 ;
 ;  in: a0.l  UBYTE *argstr
 ;      d0.l  LONG   arglen
 ; out: d0.l  LONG   returncode
 ;
 
 
 _main:
 bsr.w	colloop
 move.l	#copper,$dff080
 
 
 wait:
 
 
 btst	#6,$bfe001
 bne	wait
 
 moveq	#RETURN_OK,d0
 rts
 
 ;***********-colorLoop-******************
 ; a3 - counter
 ; a4 - color
 ; a5 - colcopper
 ; d3 - counterdata
 ; d4 - colloop counter
 
 counter:	dc.w	$0000
 
 colloop
 lea	counter,a3
 move.w	(a3),d3
 addq.w	#2,(a3)
 cmp.w	#134,d3
 bne	notend
 
 clr.l	(a3)
 clr.l	d3
 
 notend:
 lea	colors,a4
 lea	copper,a5
 
 move.w	#67,d4
 
 colorloop:
 move.w	(a4,d3.w),6(a5)
 addq.w	#2,d3
 addq.l	#8,a5
 dbra	d4,colorloop
 rts
 ;************************************
 
 Section	Coplist,data_c
 
 copper:
 ccl	SET	$1e01
 cct	SET	0
 REPT	68
 dc.w	ccl,-2,$180,cct
 ccl	SET	ccl+$0100
 cct	SET	cct
 ENDR
 
 dc.w	$0180,$0000
 dc.w	$ffff,$fffe
 dc.w	$ffff,$fffe
 
 colors:		dc.w	$0f00,$0e01,$0e01,$0c03,$0b04,$0a05,$0906,$0807
 dc.w	$0708,$0609,$050a,$040b,$030c,$020d,$010e,$000f
 dc.w	$000f,$011e,$022d,$033c,$044b,$055a,$0669,$0778
 dc.w	$0887,$0996,$0aa5,$0bb4,$0cc3,$0dd2,$0ee1,$0ff0
 dc.w	$0ff0,$0fe0,$0fd0,$0fc0,$0fb0,$0fa0,$0f90,$0f80
 dc.w	$0f70,$0f60,$0f50,$0f40,$0f30,$0f20,$0f10,$0f00
 
 dc.w	$0f00,$0e01,$0d02,$0c03,$0b04,$0a05,$0906,$0807
 dc.w	$0708,$0609,$050a,$040b,$030c,$020d,$010e,$000f
 dc.w	$000f,$011e,$022d,$033c
 
 
 ENDC
 |    |  |