English Amiga Board

English Amiga Board (http://eab.abime.net/index.php)
-   Coders. Asm / Hardware (http://eab.abime.net/forumdisplay.php?f=112)
-   -   Moving a big banner behind a static object (http://eab.abime.net/showthread.php?t=92083)

Ozzyboshi 02 May 2018 09:12

Moving a big banner behind a static object
 
Hello Amiga coders,
As the title states, I am trying to move up and down on the screen a big banner behind a static object on top of it.
The big banner cant be a sprite because it's too large (sprites allow maximum 16px width X 8).
I can't use the double playfield mode because the front image has too many colors (16 colors in 4 bitplanes) and I dont want to reduce them to 8 as the double playfield mode requires.
At the end I come up with a simple trick, I activated playfield 5 and reserved it to the banner, that means that the banner could only contain background + 1 color, not a big issue for me.
Then I replicated the palette from color 1-15 to 17-31, in this way, when a pixel of the banner goes over the pixel of the picture, since it's the most significant bit, it adds 16 to the current value and because of the replication, the same color is used resulting in the static image displayed instead of the banner.
On the contrary, when there is no overlay, the color 16 is used to print the banner.
The animation is then performed working on bitplane 5 pointers, adding or subtracting "#1" everytime vhpos is FF.
The result is shown in my adf : http://adf.ozzyboshi.com/the_crows-inkazzato.adf
Do you know a better trick to achieve this behaviour? Palette duplication is a waste of resources and the superfrog head (which is a sprite) cant wander through the entire screen because when it leaves the top of the screen he's forced to share the 17-31 colors of the duplication.
Thanks in advance for your help.

ross 02 May 2018 11:02

The only viable alternative is a smart blitter usage (with a 4-bpl screen).
Foreground image is not spanning full screen, so you can make cookye-cut operation in the center and a store operation in the sides.
In this case, better if you use an interleaved bitmap to minimize blitter registers setup operations.

However I would not reject the dual-playfield mode. In that case you are full of opportunities.
Even if you only have 7 colors usable, you can changhe them every line with the copper, the effect could be very good.

dodke 02 May 2018 11:25

The image doesn't look like it would be too big to be drawn as a 'bob' / blitter object.
Although the background is moving you could actually make the background stay still but scroll the bitplane pointers to make it move. And you can draw the overground character with blitter in every frame at a position that makes it stay still.
With this approach it would make sense to use more colours in the background banner too since it's possible.

You can draw the character with one blitter call if you use interleaved bitplanes and then you use sprites and cpu for other things in the meantime.
Also if you use interleaved bitplanes the blitter should draw it fast enough to be ahead of the visible scanline and you don't necessarily need double buffering.

chb 03 May 2018 08:29

There's an undocumented feature that might be handy:
http://eab.abime.net/showthread.php?p=1145422

Basically it gives you a 5-bitplane mode where a 1 in the 5th plane gives you always color 16, regardless of the other 4 planes. So color 17-31 are free for sprites. But it involves setting an illegal playfield priority, you may want to check how it works with sprites, I've never tested it.

Oh, and OCS/ECS only, does not work on AGA - so you'd need to detect the chipset and for AGA use a different setup (but there's enough colors to do so, plus you can choose the sprite palette offset).

EDIT: I may have gotten wrong what you are trying to do - are you moving a 16-color pic behind a single bitplane one or the other way round? In the latter case the trick mentioned above probably isn't of much use.

mcgeezer 03 May 2018 19:47

Quote:

Originally Posted by Ozzyboshi (Post 1238299)
Hello Amiga coders,
As the title states, I am trying to move up and down on the screen a big banner behind a static object on top of it.
The big banner cant be a sprite because it's too large (sprites allow maximum 16px width X 8).
I can't use the double playfield mode because the front image has too many colors (16 colors in 4 bitplanes) and I dont want to reduce them to 8 as the double playfield mode requires.
At the end I come up with a simple trick, I activated playfield 5 and reserved it to the banner, that means that the banner could only contain background + 1 color, not a big issue for me.
Then I replicated the palette from color 1-15 to 17-31, in this way, when a pixel of the banner goes over the pixel of the picture, since it's the most significant bit, it adds 16 to the current value and because of the replication, the same color is used resulting in the static image displayed instead of the banner.
On the contrary, when there is no overlay, the color 16 is used to print the banner.
The animation is then performed working on bitplane 5 pointers, adding or subtracting "#1" everytime vhpos is FF.
The result is shown in my adf : http://adf.ozzyboshi.com/the_crows-inkazzato.adf
Do you know a better trick to achieve this behaviour? Palette duplication is a waste of resources and the superfrog head (which is a sprite) cant wander through the entire screen because when it leaves the top of the screen he's forced to share the 17-31 colors of the duplication.
Thanks in advance for your help.


You could probably get away with doing a straight copy blit of just one bit plane from the front image into the back ground scrolling image, you'd just need to adjust the Y source each frame. This way you only use four planes leaving the high colour registers for sprites.

Another way to do it which way you are doing it now but have your sprites with the attach bit set on - that way you only use 6 colours from the upper palette.

Ozzyboshi 04 May 2018 20:48

Quote:

Originally Posted by chb (Post 1238488)
EDIT: I may have gotten wrong what you are trying to do - are you moving a 16-color pic behind a single bitplane one or the other way round? In the latter case the trick mentioned above probably isn't of much use.

I am moving the 2 color banner behind the 16 cols man figure however I will give a look to your link, thanks

Ozzyboshi 11 May 2018 15:16

at the end the suggestion of ross was very good, i made another attempt using the dual playfield mode ad it wasn't so bad.
You can see the full code at
https://github.com/Ozzyboshi/AmigaDemo_the_crows

borchen 13 May 2018 11:06

@Ozzyboshi

Hi, I was just playing around with your code.
At first just to get it running and see what you made.
I had to replace the stopOS/startOS code with Photon(tm)'s code to stop it from crashing on exit.

Apparently you use the blitter to copy 14 words of jaw-data, which works fine. :great

But it uses 2 btst's, 7 move.w's and 2 move.l's to setup the blitter and then the blitter has to start doing it's job. Isn't this a bit overkill?

So (after some trial-and-error) I replaced the BLTCPY-MACRO/routine with the following CPUCPY-MACRO/routine:

Warning! This MACRO uses registers d1 to d7, so save it's contents if necessary (which is not a problem in this case)
Code:

CPUCPY:        MACRO
        movem.l        \1,d1-d7                ; 7 registers = 14 words
        movem.l        d1-d7,\2
        ENDM

To use this MACRO:
Code:

        ; open skull jaw - pasting data using the CPU
        CPUCPY        JAWLOPEN,JAW2                ; left
        CPUCPY        JAWROPEN,JAW3                ; right

and
Code:

        ; close skull jaw - pasting data using the CPU
        CPUCPY        JAWLCLOSED,JAW2                ; left
        CPUCPY        JAWRCLOSED,JAW3                ; right


Ozzyboshi 14 May 2018 08:29

Ok not I realized what you did, you use the cpu instead of the blitter to copy data because it's not a huge amount to be copied so the blitter is not so essential.
I used the blitter only because I just wanted to try this feature for the first time but probably your cpu macros is more appropriate. I think i will replace your macro and use the blitter for a scrolling text that I am about to implement.

Ozzyboshi 14 May 2018 21:06

where can i find the photon startos stopos code?
maybe you are referring to this https://www.youtube.com/watch?v=DrtIjvqruOI ?

borchen 16 May 2018 07:32

@Ozzyboshi

Yes, that's the Photon(tm) I was talking about!

The stop-OS code I use is:
Code:

Start:        movem.l        d1-a6,-(sp)                ; put registers on stack

;--- save machine state

        move.l        4.w,a6                        ; a6 = execbase
        move.l        #gfxname,a1                ; a1 = gfxname
        jsr        -408(a6)                ; open gfxlibrary with oldopenlibrary()
        move.l        d0,a1                        ; a1 = gfxlibrary
        move.l        38(a1),d4                ; d4 = copper state
        jsr        -414(a6)                ; close gfxlibrary with closelibrary()

        move.w        $dff01c,d5                ; d5 = INTENAR state
        move.w        $dff002,d3                ; d3 = DMACON  state

        movem.l        d3-d5,-(sp)                ; put registers on stack

;--- turn off OS

        move.w        #$7fff,$dff09a                ; disable all bits in INTENA
        move.w        #$7fff,$dff09c                ; disable all bits in INTREQ
        move.w        #$7fff,$dff09c                ; twice because of amiga4000 hw bug!
        move.w        #$7fff,$dff096                ; disable all bits in DMACON
        move.w        #$83a0,$dff096                ; enable necessary dma bits
                                        ; blitter off
                                        ; sprites on

P.S. I use this DMACON setup code for this particular program:
Code:

move.w        #$83a0,$dff096                ; enable necessary dma bits
which turns-off the blitter, because I removed the BLTCPY-MACRO...

- After this I have all the necessary Initialization-code for Bitplane pointers, sprite pointers, music etc...
- After the Init-code I have the Main-loop

The start-OS code is:
Code:

End:
        movem.l        (sp)+,d3-d5                ; pop registers from stack

                                        ;--- restore machine state
        move.w        #$7fff,$dff096                ; clear DMACON
        or.w        #$8200,d3                ; set bits of DMACON state (d3)
        move.w        d3,$dff096                ; restore original DMACON

        move.l        d4,$dff080                ; restore original copperlist (d4)

        or.w        #$c000,d5                ; set 2 high bits INTENAR state (d5)
        move.w        d5,$dff09a                ; restore INTENA state = turn on OS

        movem.l        (sp)+,d1-a6                ; pop registers from stack
        moveq        #0,d0                        ; nice clean
        rts                                ; exit

Because of the code above I could remove:
Code:

        include exec/types.i
        include exec/libraries.i
        include exec/exec_lib.i
        include graphics/graphics_lib.i

and a lot of MACRO's like:
Code:

        DISABLE        ; Disable interrupts
        OPENGRAPHICS        ; Got on GfxBase variable the base of graphics lib
        OWNBLITTER        ; Get exclusive use of the blitter

        DISOWNBLITTER
        CLOSEGRAPHICS
        ENABLE


Ozzyboshi 16 May 2018 19:45

I tried replacing my code with yours and the crash on exit is still there...

here's what happens when I launch the executable

http://adf.ozzyboshi.com/P_20180516_..._vHDR_Auto.jpg

I am not sure it's my fault, I suspect that producing an executable with devpac causes this problem regardlessly of the code.

The error message is in italian but it states that the program was interrupted and to wait the end of the disk activity.

This problem doesn't appear if executind in devpac with ctrl+x.

Do you have the same problem running this file under workbench?

https://github.com/Ozzyboshi/AmigaDe..._crows_dual_pf

Another thing, the instruction

move.w #$83a0,$dff096 ; enable necessary dma bits

was also in my code at line 119 and as you stated this instruction disables the blitter dma, however the subsequent bltcpy macro still works but it shouldn't because of the disabled blitter dma, how it's possible?

binary form is 1000001110100000 , the BLTEN bit is the 6th which is zero, the 15th is one so I am sure it's disabled.

borchen 16 May 2018 20:20

@Ozzyboshi


- I only execute the program directly from AsmTwo on WinUAE with kickstart1.3 and OCS chipset, so not from a standalone executable on workbench.


- Here's the complete code of my version:
Code:


    incdir    "SOURCES:ozzyboshi/the_crows/"

MUSIC                    ; music on/off

;--- Macros

WAITVEND MACRO
    cmpi.b    #$ff,$dff006
    bne.s    \1
    ENDM


WAITVOUT MACRO
    cmpi.b    #$ff,$dff006
    beq.s    \1
    ENDM


CPUCPY:    MACRO
    movem.l    \1,d1-d7        ; 7 registers = 14 words
    movem.l    d1-d7,\2
    ENDM


PAUSE    MACRO
.rmb\@    btst    #10,$dff016
    bne.s    .rmb\@
    ENDM


    SECTION CODE,CODE
   
Start:    movem.l    d1-a6,-(sp)        ; put registers on stack

;--- save machine state

    move.l    4.w,a6            ; a6 = execbase
    move.l    #gfxname,a1        ; a1 = gfxname
    jsr    -408(a6)        ; open gfxlibrary with oldopenlibrary()
    move.l    d0,a1            ; a1 = gfxlibrary
    move.l    38(a1),d4        ; d4 = copper state
    jsr    -414(a6)        ; close gfxlibrary with closelibrary()

    move.w    $dff01c,d5        ; d5 = INTENAR state
    move.w    $dff002,d3        ; d3 = DMACON  state

    movem.l    d3-d5,-(sp)        ; put registers on stack

;--- turn off OS

    move.w    #$7fff,$dff09a        ; disable all bits in INTENA
    move.w    #$7fff,$dff09c        ; disable all bits in INTREQ
    move.w    #$7fff,$dff09c        ; twice because of amiga4000 hw bug!
    move.w    #$7fff,$dff096        ; disable all bits in DMACON
    move.w    #$83a0,$dff096        ; enable necessary dma bits
                    ; blitter off
                    ; sprites on
;--- music init

    IFD    MUSIC
    bsr.w  mt_init
    ENDC

;--- bitplanes init

    ; Point front crowman to bitplanes 1-4
    move.l    #man,d0            ; source picture
    lea    BplPtrs,a1        ; destination in copperlist
    moveq    #4-1,d7            ; 4 bitplanes
.bpl_l
    move.w    d0,6(a1)        ; LO word
    swap    d0
    move.w    d0,2(a1)        ; HI word
    swap    d0
    add.l    #40*256,d0
    addq.w    #8,a1
        dbf    d7,.bpl_l

        ; Point the banner to the 5th bitplane
        move.l  #banner,d0        ; source picture
        move.w    d0,6(a1)        ; LO word
    swap    d0
    move.w    d0,2(a1)        ; HI word

;--- sprites init

    ; Sprite 0 init skull left
    move.l    #SkulLeft,d0       
    lea    SprPtrs,a1        ; in copperlist
    move.w    d0,6(a1)
    swap    d0
    move.w    d0,2(a1)

    ; Sprite 1 init skull right
    move.l    #SkulRight,d0       
    addq.w    #8,a1
    move.w    d0,6(a1)
    swap    d0
    move.w    d0,2(a1)

;--- copperlist init
   
    ; let's start our custom copperlist
    move.l    #Copperlist,$dff080    ; COP1LCH set and
    move.w    #0,$dff088        ; COPJMP1 activate

    move.w    #40,delta        ; init delta

Main:
    WAITVEND Main        ; Wait for 255th row

    bsr.w    MoveSprite    ; Move the skull sprite   

    move.w    #$511,Colors+2    ; background
    bsr.w    MoveBanner    ; Move the background banner up and down

    IFD    MUSIC
    bsr.w mt_music
    ENDC
   
vwait    WAITVEND vwait

    btst    #6,$bfe001        ; wait for left mouse click
    bne.s    Main

    IFD    MUSIC
    bsr.w  mt_end            ; end music
    ENDC

End:
    movem.l    (sp)+,d3-d5        ; pop registers from stack

                    ;--- restore machine state
    move.w    #$7fff,$dff096        ; clear DMACON
    or.w    #$8200,d3        ; set bits of DMACON state (d3)
    move.w    d3,$dff096        ; restore original DMACON

    move.l    d4,$dff080        ; restore original copperlist (d4)

    or.w    #$c000,d5        ; set 2 high bits INTENAR state (d5)
    move.w    d5,$dff09a        ; restore INTENA state = turn on OS

    movem.l    (sp)+,d1-a6        ; pop registers from stack
    moveq    #0,d0            ; nice clean
    rts                ; exit


gfxname    dc.b 'graphics.library',0,0    ; Name of the graphics library


MoveBanner:
    lea    BplPtr5,a1        ; bpl5 address
    move.w    2(a1),d0        ; into d0
    swap    d0
    move.w    6(a1),d0

    cmp.l    #banner-(40*46),d0    ; bottom?
    bne.w    .notbot            ; no!

    ; open skull jaw - pasting data using the CPU
    CPUCPY    JAWLOPEN,JAWL        ; left
    CPUCPY    JAWROPEN,JAWR        ; right

    bra.w    .reverse

.notbot:
    cmpi.l    #banner+(40*50),d0    ; top?
    bne.w    .setbpl5        ; no!

    ; Close skull jaw - pasting data using the CPU
    CPUCPY    JAWLCLOS,JAWL        ; left
    CPUCPY    JAWRCLOS,JAWR        ; right

.reverse
    move.w    #$fff,Colors+2        ; white flash
    neg.w    delta            ; change direction

.setbpl5:
    add.w    delta,d0        ; 40 or -40

    lea    BplPtr5,a1
    move.w    d0,6(a1)
    swap    d0
    move.w    d0,2(a1)
    rts

delta    dc.w    0

       
; Ruotine to move the skull according to a pre calculated path
MoveSprite:
    addq.l    #1,xtab_p
    move.l    xtab_p(PC),a0
    cmp.l    #xtab_end-1,a0        ; end of table?
    bne.s    .notend

    move.l    #xtab-1,xtab_p        ; yes! reset

.notend
    move.b  (a0),HSTARTL
        move.b  (a0),HSTARTR
        addi.b  #8,HSTARTR
    rts

xtab_p                    ;--- sprite x position table
    dc.l    xtab-1

xtab
        dc.b    $41,$43,$46,$48,$4A,$4C,$4f,$51,$53,$55,$58,$5a
        dc.b    $5C,$5E,$61,$63,$65,$67,$69,$6B,$6E,$70,$72,$74
        dc.b    $76,$78,$7A,$7C,$7E,$80,$82,$84,$86,$88,$8A,$8C
        dc.b    $8E,$90,$92,$94,$96,$97,$99,$9B,$9D,$9E,$A0,$A2
        dc.b    $A3,$A5,$A7,$A8,$AA,$AB,$AD,$AE,$B0,$B1,$B2,$B4
        dc.b    $B5,$B6,$B8,$B9,$BA,$BB,$BD,$BE,$BF,$C0,$C1,$C2
        dc.b    $C3,$C4,$C5,$C5,$C6,$C7,$C8,$C9,$C9,$CA,$CB,$CB
        dc.b    $CC,$CC,$CD,$CD,$CE,$CE,$CE,$CF,$CF,$CF,$CF,$D0
        dc.b    $d0,$d0,$d0,$d0,$d0,$d0,$d0,$d0,$d0,$d0,$d0,$d0
        dc.b    $d0,$d0,$d0,$d0,$CF,$CF,$CF,$CF,$CF,$CF,$CF,$CF
        dc.b    $CF,$CE,$CE,$CE,$CD,$CD,$CC,$CC,$CB,$CB,$CA,$C9
        dc.b    $C9,$C8,$C7,$C6,$C5,$C5,$C4,$C3,$C2,$C1,$C0,$BF
        dc.b    $BE,$BD,$BB,$BA,$B9,$B8,$B6,$B5,$B4,$B2,$B1,$B0
        dc.b    $AE,$AD,$AB,$AA,$A8,$A7,$A5,$A3,$A2,$A0,$9E,$9D
        dc.b    $9B,$99,$97,$96,$94,$92,$90,$8E,$8C,$8A,$88,$86
        dc.b    $84,$82,$80,$7E,$7C,$7A,$78,$76,$74,$72,$70,$6E
        dc.b    $6B,$69,$67,$65,$63,$61,$5E,$5C,$5A,$58,$55,$53
        dc.b    $51,$4F,$4C,$4A,$48,$46,$43,$41
xtab_end

    IFD    MUSIC
    include "music.s"    ; Code for playing a mod file
    ENDC


;--------------------------------------------------------------------
; --------- COPPERLIST START ----------------------------------------
;--------------------------------------------------------------------
    SECTION GRAPHIC,DATA_C

   
Copperlist:   
        dc.w $1fc,0        ; FMODE to slow       
        dc.w $8e,$2c81        ; DIWSTRT PAL
        dc.w $90,$2cc1        ; DIWSTOP PAL
        dc.w $92,$0038        ; DDFSTRT lowres
        dc.w $94,$00d0        ; DDFSTOP lowres
        dc.w $102,0
        dc.w $104,$0009
; replace $0009 here with $0039 to print the banner OVER the image
; (exploiting a well known bug that lets you print color 16 where
; in the fifth bitplane there's a 1 - works only on ocs/ecs (A500/A600)
        dc.w $106,$0c00
        dc.w $108,0
        dc.w $10a,0

SprPtrs        dc.w $120,0
        dc.w $122,0
        dc.w $124,0
        dc.w $126,0
        dc.w $128,0
        dc.w $12a,0
        dc.w $12c,0
        dc.w $12e,0
        dc.w $130,0
        dc.w $132,0
        dc.w $134,0
        dc.w $136,0
        dc.w $138,0
        dc.w $13a,0
        dc.w $13c,0
        dc.w $13e,0

BplPtrs        dc.w $e0,0        ; BPL1PTH (WORD) hi ptr
        dc.w $e2,0        ; BPL1PTL low ptr
        dc.w $e4,0        ; BPL2PTH/L
        dc.w $e6,0
        dc.w $e8,0        ; BPL3PTH/L
        dc.w $ea,0
        dc.w $ec,0        ; BPL4PTH/L
        dc.w $ee,0
BplPtr5        dc.w $f0,0        ; BPL5PTH/L
        dc.w $f2,0

Colors        dc.w $180,$511        ; COLOR00
        dc.w $182,$000
        dc.w $184,$422
        dc.w $186,$fff
        dc.w $188,$444
        dc.w $18a,$632
        dc.w $18c,$832
        dc.w $18e,$920
        dc.w $190,$a60
        dc.w $192,$c75
        dc.w $194,$d73
        dc.w $196,$686
        dc.w $198,$f96
        dc.w $19a,$ea8
        dc.w $19c,$4a7
        dc.w $19e,$175        ; COLOR15

        dc.w $1a0,$f00        ; COLOR16 of "the crows" banner font

        ; sprite colors
        dc.w $1a2,$222        ; COLOR17 skull color 1
        dc.w $1a4,$999        ; COLOR18 skull color 2
        dc.w $1a6,$eee        ; COLOR19 skull color 3
        dc.w $1a8,0        ; COLOR20 - unused
        dc.w $1aa,0        ;        - unused
        dc.w $1ac,0        ;        - unused
        dc.w $1ae,0        ;        - unused
        dc.w $1b0,0        ; COLOR24 - unused

        ; pic colors
        dc.w $1b2,$e95        ; COLOR25
        dc.w $1b4,$d84
        dc.w $1b6,$686
        dc.w $1b8,$4a7
        dc.w $1ba,$175
        dc.w $1bc,$333
        dc.w $1be,$444        ; COLOR31

        dc.w $100,$5200        ; BPLCON0 enable 5 bitplanes
                    ; %0101001000000000

        dc.w $4a07,$FFFE    ; WAIT - wait for line 4a
; (under the skull sprite)
; Mirror colors 1-15 of the image to do not affect the banner overlay,
; in this way the banner will be behind the man
        dc.w $1a2,$000    ; color17
        dc.w $1a4,$422    ; color18
        dc.w $1a6,$fff    ; color19
        dc.w $1a8,$444    ; color20
        dc.w $1aa,$632    ; color21
        dc.w $1ac,$832    ; color22
        dc.w $1ae,$920    ; color23
        dc.w $1b0,$a60    ; color24
        dc.w $1b2,$c75    ; color25
        dc.w $1b4,$d73    ; color26
        dc.w $1b6,$686    ; color27
        dc.w $1b8,$f96    ; color28
        dc.w $1ba,$ea8    ; color29
        dc.w $1bc,$4a7    ; color30
        dc.w $1be,$175    ; color31

        dc.w $FFFF,$FFFE    ; end of copperlist

;--- Sprite data

; Image of the left skull jaw opened (sprite 0)
JAWLOPEN
        dc.w $0080,$0080 ; line 20
        dc.w $0080,$0080
        dc.w $00FF,$0080
        dc.w $00E3,$009E
        dc.w $005F,$003F
        dc.w $003F,$003F
        dc.w $0007,$0000 ; line 26

; Image of the left skull jaw closed (sprite 0)
JAWLCLOS
        dc.w $00FF,$0080 ; line 20
        dc.w $00E3,$009E
        dc.w $005F,$003F
        dc.w $003F,$003F
        dc.w $0007,$0000
        dc.w $0000,$0000
        dc.w $0000,$0000 ; line 26

; Image of the right skull jaw closed (sprite 1) - sprite side by side
JAWRCLOS
        dc.w $FC00,$0300 ; line 20
        dc.w $5400,$EB00
        dc.w $FA00,$FC00
        dc.w $FC00,$FC00
        dc.w $F000,$0000
        dc.w $0000,$0000
        dc.w $0000,$0000 ; line 26

; Image of the right skull jaw opened (sprite 1) - sprite side by side
JAWROPEN
        dc.w $0000,$0100 ; line 20
        dc.w $0000,$0100 ; line 21
        dc.w $FC00,$0300 ; line 22
        dc.w $5400,$EB00 ; line 23
        dc.w $FA00,$FC00 ; line 24
        dc.w $FC00,$FC00 ; line 25
        dc.w $F000,$0000 ; line 26

; Left Image of the skull (SPRITE0)
SkulLeft
VSTARTL        dc.b $30
HSTARTL        dc.b $90
VSTOPL        dc.b $4a,$00
        dc.w $0000,$0000 ;1
        dc.w $000F,$0000 ;2
        dc.w $0037,$000F ;3
        dc.w $01FF,$00FF ;4
        dc.w $03FF,$01FF ;5
        dc.w $07FF,$07FF ;6
        dc.w $0FFF,$07FF ;7
        dc.w $0FFF,$0FFF ;8
        dc.w $0FFF,$0FFF ;9
        dc.w $0EFF,$0DFF ;10
        dc.w $0EFD,$0DE3 ;11
        dc.w $07FF,$0EFF ;12
        dc.w $03FD,$0203 ;13
        dc.w $07FF,$0606 ;14
        dc.w $07ED,$071E ;15
        dc.w $07ED,$071E ;16
        dc.w $07EC,$03DF ;17
        dc.w $01EF,$001F ;18
        dc.w $00E2,$009F ;19
JAWL        dc.w $0080,$0080 ;20
        dc.w $0080,$0080 ;21
        dc.w $00FF,$0080 ;22
        dc.w $00E3,$009E ;23
        dc.w $005F,$003F ;24
        dc.w $003F,$003F ;25
        dc.w $0007,$0000 ;26
        dc.w 0,0

; Right Image of the skull (SPRITE1)
SkulRight
VSTARTR        dc.b $30
HSTARTR        dc.b $90
VSTOPR        dc.b $4a,$00
        dc.w $0000,$0000 ; line 1
        dc.w $F000,$0000 ; line 2
        dc.w $EC00,$F000 ; line 3
        dc.w $FF80,$FF00 ; line 4
        dc.w $FFC0,$FF80 ; line 5
        dc.w $FFE0,$FFE0 ; line 6
        dc.w $FFF0,$FFE0 ; line 7
        dc.w $FFE0,$FFF0 ; line 8
        dc.w $FFE0,$FFF0 ; line 9
        dc.w $FFE0,$FFB0 ; line 10
        dc.w $B7E0,$CFB0 ; line 11
        dc.w $FEE0,$FF70 ; line 12
        dc.w $BF80,$C040 ; line 13
        dc.w $5FE0,$E060 ; line 14
        dc.w $B7E0,$78E0 ; line 15
        dc.w $B7E0,$78E0 ; line 16
        dc.w $37E0,$FBC0 ; line 17
        dc.w $F780,$F800 ; line 18
        dc.w $4600,$F900 ; line 19
JAWR        dc.w $0000,$0100 ; line 20
        dc.w $0000,$0100 ; line 21
        dc.w $FC00,$0300 ; line 22
        dc.w $5400,$EB00 ; line 23
        dc.w $FA00,$FC00 ; line 24
        dc.w $FC00,$FC00 ; line 25
        dc.w $F000,$0000 ; line 26
        dc.w 0,0


; Image of the crow man
man    incbin    "crow_img_16.raw"
PATCH  dcb.b    40*256,$00

; Image of the banner
banner    incbin    "crow_banner_2.raw"
PATCH2  dcb.b    40*256,$00

;--- Music
    IFD    MUSIC
mt_data    incbin  "inkazzato.mod"
    ENDC

    END


As you can see I changed a LOT of things as I went along. Especially the Movebanner routine, formerly known as the MuoviCopper routine ;)


About the DMACON settings; i'm pretty sure BLTEN is the 7th bit, even though it's called bit 6... see: http://amigadev.elowar.com/read/ADCD.../node002F.html

Update: I wrote the assembled code as a standalone object from AsmTwo and started it from the CLI; it works fine and shows no errors on exit.

ross 16 May 2018 20:20

Quote:

Originally Posted by Ozzyboshi (Post 1241589)
I am not sure it's my fault, I suspect that producing an executable with devpac causes this problem regardlessly of the code.

Problem here is that you need some Workbench startup code, see:
http://amigadev.elowar.com/read/ADCD.../node0248.html

You can google for an asm version, i've mine but too lazy to search now :p

Quote:

Another thing, the instruction
move.w #$83a0,$dff096 ; enable necessary dma bits
Ok, in this instruction you did not activate the blitter DMA, but did you make sure you deactivated it previously?

Without something like
move.w #$40,$dff096
it could be active from a previous situation.
Remember that bit 15 is a SET/CLR bit..
;)

ross 16 May 2018 20:34

Ok, I looked for.
It's only a snippet from a bigger startup code but the relevant WB startup part is here:


Code:

        movea.l        $4.w,a6
        movea.l        ThisTask(a6),a5
        tst.l        pr_CLI(a5)                ; test if CLI
        bne.s        _cli

* we were called from the Workbench

        lea        pr_MsgPort(a5),a0
        jsr        _LVOWaitPort(a6)        ; wait for a message
        lea        pr_MsgPort(a5),a0
        jsr        _LVOGetMsg(a6)                ; then get it
        move.l        d0,-(sp)                ; save it for later reply
        moveq        #0,d0                        ; no args
        bsr.s        _cli                        ; call shared code
        jsr        _LVOForbid(a6)                ; it prohibits WB to unloadseg me
        movea.l        (sp)+,a1
        jmp        _LVOReplyMsg(a6)        ; reply to WB message and exit
       

_cli: ; shared init code...



All times are GMT +2. The time now is 03:32.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.

Page generated in 0.04497 seconds with 11 queries