English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 09 November 2018, 22:20   #1
rcman
Long time Amiga Owner

rcman's Avatar
 
Join Date: Jun 2017
Location: Uxbridge Canada
Age: 51
Posts: 22
AGA Mode 640 x 400

Hi,

I'm trying to load a 64 colour bitmap with the initcopList as follows. Is this correct? There is no sprites or scrolling.


Value Coplist Properties
$10 Enable smooth scrolling
$20 Dual playfield display
$40 Extra-halfbrite (EHB) display mode
$100 Make high resolution (640 pixels wide)
$400 Use low resolution sprites
$800 Use high resolution sprites
$1000 Enable fetch mode 1
$2000 Enable fetch mode 2
$3000 Enable fetch mode 3
$10000 Use AGA palette

#PLAYFIELD_DEPTH = 8
#COPPERLIST_DISPLAY = 0

InitCopList #COPPERLIST_DISPLAY,23,400,$10100,0,2^#PLAYFIELD_DEPTH,0

Thanks
RC

Last edited by rcman; 09 November 2018 at 22:29.
rcman is offline  
Old 09 November 2018, 23:29   #2
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 3,408
Hmmmm, well there are a couple of small issues. First, you're supposed to allocate all sprites anyway, even if you don't use them, so that parameter should be 8. Then, the number of bitplanes you want to use needs to be added to the flags. Then, the start position of the top of the display is generally recommended to be 44, to avoid losing the top of the display for low overscan monitors. Finally, high resolution ($100) makes it 640 pixels wide, but still the default height, so your display of 400 pixels high will extend beyond the bottom of your display. To increase the vertical resolution, you need to make it interlaced. Just how you can do that with the standard CopList commands, I don't know I'm afraid. Referring to the hardware reference manual on setting up a display might help you here as I'm sure other registers need to be set. But, that aside, your new InitCopList command might look like this:

Code:
#flgs = $10000 + $100 + #PLAYFIELD_DEPTH
InitCopList #COPPERLIST_DISPLAY, 44, 400, #flgs, 8, 2^#PLAYFIELD_DEPTH, 0
This should open a 256-colour display.
Daedalus is offline  
Old 10 November 2018, 03:12   #3
rcman
Long time Amiga Owner

rcman's Avatar
 
Join Date: Jun 2017
Location: Uxbridge Canada
Age: 51
Posts: 22
Quote:
Originally Posted by Daedalus View Post
Hmmmm, well there are a couple of small issues. First, you're supposed to allocate all sprites anyway, even if you don't use them, so that parameter should be 8. Then, the number of bitplanes you want to use needs to be added to the flags. Then, the start position of the top of the display is generally recommended to be 44, to avoid losing the top of the display for low overscan monitors. Finally, high resolution ($100) makes it 640 pixels wide, but still the default height, so your display of 400 pixels high will extend beyond the bottom of your display. To increase the vertical resolution, you need to make it interlaced. Just how you can do that with the standard CopList commands, I don't know I'm afraid. Referring to the hardware reference manual on setting up a display might help you here as I'm sure other registers need to be set. But, that aside, your new InitCopList command might look like this:

Code:
#flgs = $10000 + $100 + #PLAYFIELD_DEPTH
InitCopList #COPPERLIST_DISPLAY, 44, 400, #flgs, 8, 2^#PLAYFIELD_DEPTH, 0
This should open a 256-colour display.
Thank you! I'll keep you posted.

RC
rcman is offline  
Old 10 November 2018, 03:37   #4
rcman
Long time Amiga Owner

rcman's Avatar
 
Join Date: Jun 2017
Location: Uxbridge Canada
Age: 51
Posts: 22
Quote:
Originally Posted by rcman View Post
Thank you! I'll keep you posted.

RC
Okay I am not sure why I just get a black screen

WBStartup

#KEY_ESCAPE = $45
; Objects
#PALETTE_DISPLAY = 0
#BITMAP_SPRITESHEET = 0
#SHAPE_DUMMY = 0
#COPPERLIST_DISPLAY = 0

; Playfield specs

#PLAYFIELD_WIDTH = 640
#PLAYFIELD_HEIGHT = 400
#PLAYFIELD_DEPTH = 8

; Allocate Bitmaps

BitMap #BITMAP_SPRITESHEET , 640, 400, 6

; Load sprite sheet
LoadBitMap #BITMAP_SPRITESHEET, "Sewers640.iff",#PALETTE_DISPLAY

AutoCookie On

GetaShape #SHAPE_DUMMY,5*32,32,32,32

; getashape n,x,y,w,h
; where n is shape number, x and y are top left coordinates and w and h are width and height of the desired shape in pixels.

; goto blitzmode
BLITZ

#flgs = $10000 + $100 + #PLAYFIELD_DEPTH + $8

InitCopList #COPPERLIST_DISPLAY, 44, 400, #flgs, 8, 2^#PLAYFIELD_DEPTH, 0

DisplayPalette #COPPERLIST_DISPLAY,#PALETTE_DISPLAY
CreateDisplay #COPPERLIST_DISPLAY

DisplayBitMap 0,0

While NOT RawStatus(#KEY_ESCAPE)
VWait
Wend

End
Attached Files
File Type: zip Sewers640.zip (26.5 KB, 4 views)

Last edited by rcman; 10 November 2018 at 04:03.
rcman is offline  
Old 10 November 2018, 06:50   #5
rcman
Long time Amiga Owner

rcman's Avatar
 
Join Date: Jun 2017
Location: Uxbridge Canada
Age: 51
Posts: 22
Quote:
Originally Posted by rcman View Post
Okay I am not sure why I just get a black screen

WBStartup

#KEY_ESCAPE = $45
; Objects
#PALETTE_DISPLAY = 0
#BITMAP_SPRITESHEET = 0
#SHAPE_DUMMY = 0
#COPPERLIST_DISPLAY = 0

; Playfield specs

#PLAYFIELD_WIDTH = 640
#PLAYFIELD_HEIGHT = 400
#PLAYFIELD_DEPTH = 8

; Allocate Bitmaps

BitMap #BITMAP_SPRITESHEET , 640, 400, 6

; Load sprite sheet
LoadBitMap #BITMAP_SPRITESHEET, "Sewers640.iff",#PALETTE_DISPLAY

AutoCookie On

GetaShape #SHAPE_DUMMY,5*32,32,32,32

; getashape n,x,y,w,h
; where n is shape number, x and y are top left coordinates and w and h are width and height of the desired shape in pixels.

; goto blitzmode
BLITZ

#flgs = $10000 + $100 + #PLAYFIELD_DEPTH + $8

InitCopList #COPPERLIST_DISPLAY, 44, 400, #flgs, 8, 2^#PLAYFIELD_DEPTH, 0

DisplayPalette #COPPERLIST_DISPLAY,#PALETTE_DISPLAY
CreateDisplay #COPPERLIST_DISPLAY

DisplayBitMap 0,0

While NOT RawStatus(#KEY_ESCAPE)
VWait
Wend

End

Looks like InitcopList is suppose to be $11108

it displays but it seems stretched. When I bring it in to Dpaint it looks good. I am also using the 64 color iff as the 256 one doesn't seem to load. I still know something is wrong

RC
rcman is offline  
Old 10 November 2018, 15:25   #6
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 3,408
$10108 should be fine. You were adding the depth on twice with the + #PLAYFIELD_DEPTH *and* + $8, which won't work.

When you say it looks stretched, are you opening the same sort of screen in DPaint? 640x256?
Daedalus is offline  
Old 10 November 2018, 16:14   #7
rcman
Long time Amiga Owner

rcman's Avatar
 
Join Date: Jun 2017
Location: Uxbridge Canada
Age: 51
Posts: 22
Quote:
Originally Posted by Daedalus View Post
$10108 should be fine. You were adding the depth on twice with the + #PLAYFIELD_DEPTH *and* + $8, which won't work.

When you say it looks stretched, are you opening the same sort of screen in DPaint? 640x256?

Um no, I'm opening a 640 x 400 screen in dpaint. I thought since the iff was that size that's what I was opening?

RC
rcman is offline  
Old 10 November 2018, 19:14   #8
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 3,408
No, the screen opened by the Display Library will be 256-ish pixels high, since it's not interlaced or productivity. The screen DPaint opens is likely one or the other of those.
Daedalus is offline  
Old 12 November 2018, 15:26   #9
rcman
Long time Amiga Owner

rcman's Avatar
 
Join Date: Jun 2017
Location: Uxbridge Canada
Age: 51
Posts: 22
Quote:
Originally Posted by Daedalus View Post
No, the screen opened by the Display Library will be 256-ish pixels high, since it's not interlaced or productivity. The screen DPaint opens is likely one or the other of those.
Maybe I'm missing something. When I open Dpaint I select a display which is 640x400 256 color. Can I not open this up in Blitz? You're saying it's only 640x200 I'm a little confused.

Can blitz not display a 640x400 image?

RC
rcman is offline  
Old 12 November 2018, 15:48   #10
dodke
Registered User

 
Join Date: Feb 2018
Location: London / UK
Posts: 31
So, I don't know anything about blitz but the thing is, regular NTSC or PAL output is interlaced. Basically the resolution is half of the full one and you're alternating between showing odd and even lines of the full res image. If you set the hardware interlace bit then the chipset will automatically toggle the 'frame flop' bit (in VPOS) which will cause the frame to appear half a line lower on every other frame. You'll probably need a CRT screen to see this correctly.
dodke is offline  
Old 12 November 2018, 15:54   #11
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 3,408
Not directly in Blitz mode, no. The standard vertical resolution is 200 in NTSC mode and 256 in PAL mode. A little bit more is possible by moving the display up a little and using the overscan area, but ultimately, double-height displays require either a doubled pixel clock (like DblPAL, DblNTSC & Productivity modes), or an interlaced screen, neither of which Blitz supports in Blitz mode. In Amiga mode you can open any type of screen you like in an OS-friendly way, but in Blitz mode you have to do it manually. Earok appears to have devised a clever way of doing it here by swapping coplists every frame, but even then you have to sort your even and odd fields yourself. So it's not easy.

If DPaint is opening a 400 pixel screenmode, I suspect it's interlaced, though it might not look flickery due to your display.
Daedalus is offline  
Old 12 November 2018, 18:12   #12
rcman
Long time Amiga Owner

rcman's Avatar
 
Join Date: Jun 2017
Location: Uxbridge Canada
Age: 51
Posts: 22
Quote:
Originally Posted by Daedalus View Post
Not directly in Blitz mode, no. The standard vertical resolution is 200 in NTSC mode and 256 in PAL mode. A little bit more is possible by moving the display up a little and using the overscan area, but ultimately, double-height displays require either a doubled pixel clock (like DblPAL, DblNTSC & Productivity modes), or an interlaced screen, neither of which Blitz supports in Blitz mode. In Amiga mode you can open any type of screen you like in an OS-friendly way, but in Blitz mode you have to do it manually. Earok appears to have devised a clever way of doing it here by swapping coplists every frame, but even then you have to sort your even and odd fields yourself. So it's not easy.

If DPaint is opening a 400 pixel screenmode, I suspect it's interlaced, though it might not look flickery due to your display.

Thank you for your help!


RC
rcman is offline  
Old 13 November 2018, 22:03   #13
earok
Registered User

 
Join Date: Dec 2013
Location: Auckland
Posts: 1,842
This will display an AGA image in interlaced (640x512), maybe not as cleanly as possible since I'm using VPOS rather than BPLCON0. I'll post the complete example with image to GitHub.

Quote:
WBStartup
DEFTYPE .w

;The interlaced bitmap
BitMap 0,640,512,8

;The original bitmap
BitMap 1,640,512,8
LoadBitMap 1,"image.iff",0

;Convert the original bitmap to interlaced
Use BitMap 0
for i = 0 to 255
BlockScroll 0,i*2,640,1,0,i,1
BlockScroll 0,1+i*2,640,1,0,i+256,1
next

;Configure two copper lists
for i = 0 to 1

InitCopList i,44,DispHeight,$10000 + $1000 + $100 + $8,8,256,0
DisplayBitMap i,0,0,i*256
DisplayPalette i,0

next

BLITZ

;Repeatedly recreate the display and toggle the LOF bit
SetInt 5

VP = Peek.w($DFF004)

X=1-X
if X=0
CreateDisplay 0
VP = VP BITSET 15
else
CreateDisplay 1
VP = VP BITCLR 15
endif

Poke.w $DFF02A,VP


End SetInt

While Joyb(0)+Joyb(1) = 0
Wend

End
earok is offline  
Old 14 November 2018, 16:26   #14
rcman
Long time Amiga Owner

rcman's Avatar
 
Join Date: Jun 2017
Location: Uxbridge Canada
Age: 51
Posts: 22
Quote:
Originally Posted by earok View Post
This will display an AGA image in interlaced (640x512), maybe not as cleanly as possible since I'm using VPOS rather than BPLCON0. I'll post the complete example with image to GitHub.
Thank you!

RC
rcman is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto-Mouse to 400 DPI mode lifeschool request.UAE Wishlist 3 09 November 2017 15:49
AGA Fetch mode testing earok Coders. Blitz Basic 1 29 September 2017 02:25
indivision aga and ham mode pbareges support.Hardware 3 03 February 2009 13:25
What's the best screen mode for an AGA shoot-um-up NovaCoder Coders. General 5 09 January 2009 14:19
Stop Interlace in AGA mode andy_blah support.WinUAE 135 21 August 2008 20:43

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 22:05.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.08108 seconds with 16 queries