English Amiga Board


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

 
 
Thread Tools
Old 09 November 2018, 21:20   #1
rcman
Long time Amiga Owner
 
rcman's Avatar
 
Join Date: Jun 2017
Location: Uxbridge Canada
Age: 56
Posts: 182
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 21:29.
rcman is offline  
Old 09 November 2018, 22:29   #2
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
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, 02:12   #3
rcman
Long time Amiga Owner
 
rcman's Avatar
 
Join Date: Jun 2017
Location: Uxbridge Canada
Age: 56
Posts: 182
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, 02:37   #4
rcman
Long time Amiga Owner
 
rcman's Avatar
 
Join Date: Jun 2017
Location: Uxbridge Canada
Age: 56
Posts: 182
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, 117 views)

Last edited by rcman; 10 November 2018 at 03:03.
rcman is offline  
Old 10 November 2018, 05:50   #5
rcman
Long time Amiga Owner
 
rcman's Avatar
 
Join Date: Jun 2017
Location: Uxbridge Canada
Age: 56
Posts: 182
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, 14:25   #6
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
$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, 15:14   #7
rcman
Long time Amiga Owner
 
rcman's Avatar
 
Join Date: Jun 2017
Location: Uxbridge Canada
Age: 56
Posts: 182
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, 18:14   #8
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
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, 14:26   #9
rcman
Long time Amiga Owner
 
rcman's Avatar
 
Join Date: Jun 2017
Location: Uxbridge Canada
Age: 56
Posts: 182
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, 14:48   #10
dodke
Registered User
 
Join Date: Feb 2018
Location: London / UK
Posts: 112
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, 14:54   #11
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
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, 17:12   #12
rcman
Long time Amiga Owner
 
rcman's Avatar
 
Join Date: Jun 2017
Location: Uxbridge Canada
Age: 56
Posts: 182
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, 21:03   #13
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
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, 15:26   #14
rcman
Long time Amiga Owner
 
rcman's Avatar
 
Join Date: Jun 2017
Location: Uxbridge Canada
Age: 56
Posts: 182
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  
Old 21 November 2018, 16:35   #15
rcman
Long time Amiga Owner
 
rcman's Avatar
 
Join Date: Jun 2017
Location: Uxbridge Canada
Age: 56
Posts: 182
Earok I have a question for you.

I asked directly on twitter but you didn't reply. I am looking at the game Crystal Kingdoms. What mode is this running in?

Thanks
RC
rcman is offline  
Old 21 November 2018, 23:17   #16
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Sorry, I must have missed that message! I didn't write Crystal Kingdoms myself (I can only claim credit for finding it in an old hard drive backup) and no source was provided so I'm not sure.
earok is offline  
Old 24 December 2018, 02:13   #17
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
Blitz doesn't directly support interlace modes (it was probably too much of a chore to implement for the Acid programmers), so you will have to implement it totally by yourself, probably by allocating a sufficiently tall bitmap, setting the modulo to an entire line, and adding a custom coplist to set the starting position alternatingly at line 0 or line 1.
idrougge 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 14:49
AGA Fetch mode testing earok Coders. Blitz Basic 1 29 September 2017 01:25
indivision aga and ham mode pbareges support.Hardware 3 03 February 2009 12:25
What's the best screen mode for an AGA shoot-um-up NovaCoder Coders. General 5 09 January 2009 13:19
Stop Interlace in AGA mode andy_blah support.WinUAE 135 21 August 2008 19: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 09:05.

Top

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