Welcome, Guest. Please login or register.

Author Topic: Need help again, hehe, this time in asm  (Read 3475 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Steady

Re: Need help again, hehe, this time in asm
« on: May 11, 2004, 01:51:43 PM »
As far as I can see from your code, it does seem to be the problem you suspect.

You probably know, but to recap.

It's the classic problem:
Copper instructions need to be in CHIP RAM. If you have both CHIP and FAST ram in the the system and there is room in FAST RAM to load the program, it will be loaded there. Since you have not explicitly copied the copper list into CHIP RAM, it will not be able to be read by the copper. When you execute the program, the copper attempts to read instructions from a random area in CHIP, giving you garbage, sometimes even spectacular fireworks if you're lucky ;-)

As mentioned earlier, the other option is to flag the segment containing your COPPER list to be loaded into CHIP RAM. See your assembler/linker docs for details.

To prove if this is the problem, run NoFastMem and then see if the program works. If it does, that is your problem.
 

Offline Steady

Re: Need help again, hehe, this time in asm
« Reply #1 on: May 12, 2004, 01:41:34 PM »
Use AllocMem with the MEMF_CHIP flag in the attributes like so:

        move.l   #CopListSize,d0
        move.l   #2,d1      ;$00000002 is MEMF_CHIP
        move.l   4,a6      ;A saved copy of ExecBase will be faster on 68020+, but this will do.
        jsr   -198(a6)        ;AllocMem()
        move.l   d0,MemPtr   ;Save the result from D0 locally.

Sorry if I have made a couple of 68k assembly errors above. I've not programmed it for quite a while, but it is the general gist of what you want...

Any corrections welcome.