English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 29 January 2020, 12:15   #1
timg
Registered User
 
Join Date: Jan 2020
Location: Saltash
Posts: 27
Screen Setup

Hi Guys,

After following Graeme Cowie's configuration for setting up VASM and running on a VM I thought I'd dig out a small shooter I did back in '94.

I've got it running but the display is out of alignment, which I think is a copper issue... reading another thread the window size and overscan values I have a those for a standard PAL screen, and I've tinkered with the odd/even modulos but to no avail so far.

Does anyone know where else to look?


Code:
CopList:	Dc.W	WINTL,$2C81,WINBR,$2CC1	; Window Size
	Dc.W	OVER1,$0038,OVER2,$00D0	; OverScan Values
	Dc.W	HWSCR,$0000,PRIOR,$0008	; HW Scroll + Priority
	Dc.W	ODMOD,$0004,EVMOD,$0004	; Odd+Even Modulos
	Dc.W	SCREN,LOWR3		; Screen Type

	Dc.W	BPL1A,BASIC,BPL1B,$09FC	; Bitplane 1
	Dc.W	BPL2A,BASIC,BPL2B,$49FC	; Bitplane 2
	Dc.W	BPL3A,BASIC,BPL3B,$89FC	; Bitplane 3
Code:
ODMOD:	Equ	$0108		; Odd Modulos
EVMOD:	Equ	$010A		; Even Modulos

WINTL:	Equ	$008E		; Window Top/Left
WINBR:	Equ	$0090		; Window Bottom/Right
OVER1:	Equ	$0092		; OverScan 1
OVER2:	Equ	$0094		; OverScan 2

SCREN:	Equ	$0100		; Type Of Screen

HWSCR:	Equ	$0102		; Hardware Scroll
PRIOR:	Equ	$0104		; Priority

LOWR1:	Equ	$1200		; Lowres 1 
LOWR2:	Equ	$2200		; Lowres 2
LOWR3:	Equ	$3200		; Lowres 3
LOWR4:	Equ	$4200		; Lowres 4
LOWR5:	Equ	$5200		; Lowres 5
Attached Thumbnails
Click image for larger version

Name:	Annotation 2020-01-29 091058.png
Views:	122
Size:	6.6 KB
ID:	66042  
timg is offline  
Old 29 January 2020, 13:25   #2
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,614
Copper list looks OK (although I turn bitplane DMA on after setting bitplane pointers). It might be the rendering that has the wrong screen width (or modulo). Your current screen width is 320+4*8=352, of which 320 is shown. You can test by poking a byte at screen+0 and another at screen+44, they should line up vertically.

Last edited by Photon; 29 January 2020 at 13:30.
Photon is offline  
Old 29 January 2020, 13:27   #3
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
Your bitplane screen buffer seems for a 512x256 screen ($49FC-$09fc=$4000->/256=64->*8=512).

As your registers setup is for a 320 screen, you need to set modulo registers to
512/8-320/8=64-40=$18
ross is offline  
Old 29 January 2020, 14:59   #4
timg
Registered User
 
Join Date: Jan 2020
Location: Saltash
Posts: 27
Thanks for the suggestions... I tried odd and even modulos at $18 but that still displayed the same as before.

I'm assuming that by "although I turn bitplane DMA on after setting bitplane pointers" you mean setting the screen type after the bitplanes like so:



Code:
CopList:	Dc.W	WINTL,$2C81,WINBR,$2CC1	; Window Size
	Dc.W	OVER1,$0038,OVER2,$00D0	; OverScan Values
	Dc.W	HWSCR,$0000,PRIOR,$0008	; HW Scroll + Priority
	Dc.W	ODMOD,$0018,EVMOD,$0018	; Odd+Even Modulos

	Dc.W	BPL1A,BASIC,BPL1B,$09FC	; Bitplane 1
	Dc.W	BPL2A,BASIC,BPL2B,$49FC	; Bitplane 2
	Dc.W	BPL3A,BASIC,BPL3B,$89FC	; Bitplane 3
	Dc.W	SCREN,LOWR3		; Screen Type
That did alter the display but also seems to have affected the sprites used to show the scores at the top, see attached... it's showing random flashes of blue so I guess the screen is even further out of sync?
Attached Thumbnails
Click image for larger version

Name:	Annotation 2020-01-29 135527.png
Views:	101
Size:	3.5 KB
ID:	66043  
timg is offline  
Old 29 January 2020, 15:17   #5
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
Without further info, is impossible a definite answer.

Photon's and mine are only suggestions based on what you posted (very little about real conditions in your setup).
So if you want a proper response better if you post more.
ross is offline  
Old 29 January 2020, 15:33   #6
timg
Registered User
 
Join Date: Jan 2020
Location: Saltash
Posts: 27
Thanks Ross, I'll see if I can strip the code out and make something I can post.

I'm returning to this after 25 years so it's not exactly fresh in my mind!
timg is offline  
Old 29 January 2020, 15:42   #7
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
Quote:
Originally Posted by timg View Post
Thanks Ross, I'll see if I can strip the code out and make something I can post.

I'm returning to this after 25 years so it's not exactly fresh in my mind!
The most important information is the screen rendering width, so it's possible to derive the other values to be set with the copper in the registers.
(x=512 could be simply a value used to use shift instead of mul in code)
ross is offline  
Old 29 January 2020, 16:35   #8
buzzybee
Registered User
 
Join Date: Oct 2015
Location: Landsberg / Germany
Posts: 526
Just a thought: Could it be that the screen setup is fine but the modulo values within the blitting / bitplane copying code should be +4?
buzzybee is offline  
Old 29 January 2020, 16:41   #9
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,212
Are you running on AGA? Is FMODE register set to something other than 0 ?
DanScott is offline  
Old 29 January 2020, 22:30   #10
timg
Registered User
 
Join Date: Jan 2020
Location: Saltash
Posts: 27
Quote:
Originally Posted by buzzybee View Post
Just a thought: Could it be that the screen setup is fine but the modulo values within the blitting / bitplane copying code should be +4?
Thanks for the idea, I will look through the blitting code too.


Quote:
Originally Posted by DanScott View Post
Are you running on AGA? Is FMODE register set to something other than 0 ?
Not as far as I can tell, but thanks for the idea.
timg is offline  
Old 31 January 2020, 19:02   #11
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,614
Quote:
Originally Posted by timg View Post
I'm assuming that by "although I turn bitplane DMA on after setting bitplane pointers" you mean setting the screen type after the bitplanes

-/-

That did alter the display but also seems to have affected the sprites used to show the scores at the top, see attached... it's showing random flashes of blue so I guess the screen is even further out of sync?
I think setting BPLCON0 last is just a habit; wanting everything set up before I turn on bitplane DMA.

The other stuff shouldn't be affected. I think you're setting values while the screen is displayed. Could you post the full copper list? I think we'll solve the problem then.

Obviously I'm assuming that you don't change values in the copper list. If you do, the changes might come just as the copper list is being read and displayed, and you must put a wait for the "top left" of the window before the write to BPLCON0.
Photon is offline  
Old 03 February 2020, 12:20   #12
timg
Registered User
 
Join Date: Jan 2020
Location: Saltash
Posts: 27
Hi Guys,

Just an update, I finally managed to sort this by specifically setting FMODE to 0 in the copper. This didn't work initially as I'd not realised that I was updating the copper is specific places in code and of course, adding the new command meant all my copper offsets were off.

This of course had the knock-on effect of me having to update all the copper code... the joys of returning to code 25 years after you wrote it! lol

Anyway, the main ship sprite is not displaying properly but for those who are interested, here's the video. This was really just a coding test to try and work on things like collision and player control etc. so it's nothing advance, but happy it's working again!

[ Show youtube player ]

Thanks to everyone for their help and suggestions!
timg is offline  
Old 03 February 2020, 12:31   #13
buzzybee
Registered User
 
Join Date: Oct 2015
Location: Landsberg / Germany
Posts: 526
Great you got your old code to work. Looks nice!
buzzybee is offline  
Old 03 February 2020, 15:16   #14
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,212
Quote:
Originally Posted by timg View Post
Hi Guys,

Just an update, I finally managed to sort this by specifically setting FMODE to 0 in the copper.
So you were running on AGA (this register doesn't exist on OCS/ECS)
DanScott is offline  
Old 03 February 2020, 15:58   #15
timg
Registered User
 
Join Date: Jan 2020
Location: Saltash
Posts: 27
Quote:
Originally Posted by DanScott View Post
So you were running on AGA (this register doesn't exist on OCS/ECS)
It was originally run on my A500 back in the day, I've been running it on A1200 WinUAE recently... I'd assumed this register would have been set to 0 by default.
timg is offline  
Old 03 February 2020, 17:52   #16
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
(FMODE)

Quote:
Originally Posted by timg View Post
I'd assumed this register would have been set to 0 by default.
Maybe when starting out of the boot block. But not when you start your code from an AGA workbench. LoadView(NULL) doesn't reset it, AFAIK. Also don't forget to reset the new BPLCONx registers.
phx 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
Smooth H-scrolling platform game in AMOS, screen copy vs screen offset? Damiga Coders. AMOS 32 24 October 2023 19:00
Resolution Autoswitch + Auto Integer Scaling: Screen stuck 25% below top of screen bladecgn support.WinUAE 21 17 March 2019 17:52
Blitz Basic Screen setup Ze Emulatron Coders. Blitz Basic 2 29 November 2012 22:43
Black screen with 50 hz D3D not(DD) in WinUAE 2.3.3 from 60 hz setup in Win 7 Mixter support.WinUAE 7 26 February 2012 19:19
Amiga 600 not booting... Yellow screen, and Red screen when turning PSU off jbenam support.Hardware 34 20 March 2011 22:10

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 23:38.

Top

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