View Single Post
Old 30 September 2010, 18:26   #33
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
Quote:
Originally Posted by Leffmann View Post
Definitely not intentional. Can you post your code?

Also, make sure you locate your code and related data in public memory when it's final and you release your stuff. It's the best place for it and enables it to run faster if you have fastmem. The only data that must reside in chipmem is data that is to be directly accessed by the hardware, such as sprites and bitplanes, copper programs, blitter data etc.
I know about chip and fast memory, but public memory always confuses me.

This is the code from the course (Part 2, page 16). I added the saving of the register values, but that doesn't make any difference. I tried compiling with them commented out (asterisks at start of both movem.l lines) and with them included.

Code:
;
; Danish Assembler Course: Example 2 (part 2, page 16)
; Saving/restoring register values added by ADB
; Always compile WITHOUT fast RAM, so copperlist is in chip memory.
;

    movem.l        a1/a6,-(sp)

    move.w        #$01A0,$DFF096    ;DMACON (all DMA off)
    lea.l        copperlist(pc),a1
    move.l        a1,$DFF080    ;COP1LCH

    move.w        #$8080,$DFF096    ;DMACON (was $8080)
wait:
    btst        #6,$BFE001    ;wait for LMB
    bne        wait

    move.w        $0080,$DFF096    ;DMACON
    move.l        $04,a6
    move.l        156(a6),a1
    move.l        38(a1),$DFF080    ;COP1LCH
    move.w        #$81A0,$DFF096    ;DMACON

    movem.l        (sp)+,a1/a6
    rts

copperlist:                ;Translation
    dc.w        $9001,$FFFE    ;wait for line $90 (144)
    dc.w        $0180,$0F00    ;Colour 0 to $F00 (red)
    dc.w        $A001,$FFFE    ;wait for line $A0 (160)
    dc.w        $0180,$0FFF    ;Colour 0 to $FFF (white)
    dc.w        $A401,$FFFE    ;wait for line $A4 (164)
    dc.w        $0180,$000F    ;Colour 0 to $00F (blue)
    dc.w        $AA01,$FFFE    ;wait for line $AA (170)
    dc.w        $0180,$0FFF    ;Colour 0 to $FFF (white)
    dc.w        $AE01,$FFFE    ;wait for line $AE (174)
    dc.w        $0180,$0F00    ;Colour 0 to $F00 (red)
    dc.w        $BE01,$FFFE    ;wait for line $BE (190)
    dc.w        $0180,$0000    ;Colour 0 to $000 (black)
    dc.w        $FFFF,$FFFE    ;wait forever (until next VBL)

Perhaps it's glitchy as it is designed to be used with K-Seka?


Regards,
Lonewolf10
Lonewolf10 is offline  
 
Page generated in 0.05286 seconds with 10 queries