Welcome, Guest. Please login or register.

Author Topic: Pattern screen  (Read 4504 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline AlfaRomeoTopic starter

  • Newbie
  • *
  • Join Date: Jul 2010
  • Posts: 8
    • Show all replies
Pattern screen
« on: October 24, 2011, 02:50:15 PM »
Hi,
I´m trying to display a pattern in a 1 bitplane screen with the following code found in Amiga Computing Mag but it results in screen garbage and not in a regular pattern as it should be.
I already tried to find the bug but with no luck :angry:
Can someone point what´s wrong in the code that results in the garbage displayed on the screen, please?
 
Code: [Select]
                        Section Screen,code_c
 
_LVOOpenLib    EQU    -552
_LVOCloseLib    EQU    -414
 
DiwStart    EQU    $8E
DiwStop        EQU    $90
DDFStart    EQU    $92
DDFStop        EQU    $94
BplCon0        EQU    $100
BplCon1        EQU    $102
Col0        EQU    $180
Col1        EQU    $182
BPL1PTH        EQU    $E0
BPL1PTL        EQU    $E2
 
        move.l    #scr,d0    ;Load address of our screen in d0
        move.w    d0,pl1l    ;Load low scr addr in Copper list
        swap    d0    ;Swap address in d0
        move.w    d0,pl1h    ;Load high scr addr in Copper list
 
        move.l     4.w,a6            ;ExecBase
        move.l    #0,d0
        lea    GfxName,a1
        jsr    _LVOOpenLib(a6)        ;Open GFX library
        move.l    d0,a1
        move.l    38(a1),WB    ;Store WB Copper addr
 
        move.l    4.w,a6
        jsr    _LVOCloseLib(a6)    ;Close GFX library
 
        move.l    #CopList,$DFF080    ;Load Copper list in Copper
 
Loop:        btst    #6,$BFE001    ;Test left mouse button
        bne    Loop        ;If not pressed keep in loop
 
        move.l    WB,$DFF080    ;Restore WB Copper
        rts
 
CopList:    dc.w    DiwStart,$2C81        ;Top left corner of the scr
        dc.w    DiwStop,$2CC1    ;Bottom right corner scr
        dc.w    DDFStart,$38    ;Data fetch start
        dc.w    DDFStop,$D0    ;Data fetch stop
        dc.w    BplCon0,$1000    ;Set 1 bitplane lo-res scr
        dc.w    BplCon1,$0    ;No horizontal offset
        dc.w    Col0,$0        ;Black background color
        dc.w    Col1,$FFF    ;White foreground color
        dc.w    BPL1PTH        ;Bitplane low high word    
pl1h
        dc.w    0
        dc.w    BPL1PTL        ;Bitplane low word
pl1l
        dc.w    0
        dc.w    $FFFF,$FFFE    ;End of copper list
 
WB        dc.l    0
 
scr        dcb.b    8000,$55     ;Block of 8000 bytes of a pattern
 
GfxName        dc.b    "graphics.library",0
« Last Edit: October 24, 2011, 02:58:08 PM by AlfaRomeo »
 

Offline AlfaRomeoTopic starter

  • Newbie
  • *
  • Join Date: Jul 2010
  • Posts: 8
    • Show all replies
Re: Pattern screen
« Reply #1 on: October 24, 2011, 09:59:28 PM »
Thanks for the help.
I thought that the command "section screen,code_c" at the beginning of the code was to force the code to be in ChipRam :angry: my compiler is DevPac 3.18, should recognise "code_c"
« Last Edit: October 24, 2011, 10:02:48 PM by AlfaRomeo »