English Amiga Board


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

 
 
Thread Tools
Old 14 August 2012, 13:49   #1
spud
Registered User

 
Join Date: May 2010
Location: London, UK
Posts: 256
Menace tutorial AGA fix

Hi all

Tinkering with asm (writing a game - slowly) and making use of the startup/shutdown framework provided by the Menace tutorial all those years ago I wonder if anyone can explain what is required to fix the source code to work on AGA?

Right now it runs fine when ECS or OCS is selected as the chipset, but AGA gives a corrupt screen.

Whether the startup code provided by the tutorial is or isn't a good example of such code I don't know, but it would be good to know why it doesn't work and how to correct it. It should hopefully further understanding of the architecture which is quite overwhelming when coming from a z80 coding perspective !

Cheers
spud is offline  
Old 14 August 2012, 13:59   #2
Methanoid
Retired Quartex Sysop
Methanoid's Avatar
 
Join Date: Sep 2001
Location: Roman Verulamium
Age: 55
Posts: 1,841
One for Galahad methinks!!
Methanoid is offline  
Old 14 August 2012, 14:52   #3
deicidal
Registered Insane

deicidal's Avatar
 
Join Date: Feb 2010
Location: Ununited Kingdom
Posts: 792
Try here

http://zakalwe.fi/~shd/amiga-cracking/agafix-v2.html
deicidal is offline  
Old 14 August 2012, 15:31   #4
spud
Registered User

 
Join Date: May 2010
Location: London, UK
Posts: 256
That looks like a useful resource, thanks

Done so much reading around since I posted the original question and managed to pull together code and put it in the right (?) place to seemingly fix it to display on AGA.

Running this before I install the copperlist:
sub.l a1,a1
move.l GraphicsBase,a6
jsr _LVOLoadView(a6) ; Blank the screen
jsr _LVOWaitTOF(a6)
jsr _LVOWaitTOF(a6)

and aligning the actual copperlist with
cnop 0,8

Why does it work... more reading needed to determine that. Information overload?!
spud is offline  
Old 14 August 2012, 18:35   #5
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,265
On AGA, register FMODE is usually set to instruct the bitplane DMA to fetch data in chunks of 64 bits, so when all other bitplane parameters are set up for 16 bits like in OCS/ECS, you get these distorted graphics.

LoadView(NULL) fixes things because it sets up a Copper program that sets FMODE, BPLCON2 and BPLCON3 (and probably some other registers) to OCS/ECS compatible values. There's never any need to align the Copper program on 8 bytes though, a plain even address will do.

I think calling LoadView like this will also enable internal display output if you have RTG in your system, so you should keep this in your program.
Leffmann is offline  
Old 14 August 2012, 19:15   #6
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,650
Quote:
Originally Posted by Leffmann View Post
I think calling LoadView like this will also enable internal display output if you have RTG in your system, so you should keep this in your program.
That's correct. Without the LoadView() call the display won't be switched to the RTG screen which means you won't see anything if you only have 1 monitor connected to your Amiga.
StingRay is online now  
Old 14 August 2012, 19:48   #7
spud
Registered User

 
Join Date: May 2010
Location: London, UK
Posts: 256
Thanks guys
spud is offline  
Old 14 August 2012, 20:49   #8
Galahad/FLT
Going nowhere

Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 47
Posts: 8,073
Quote:
Originally Posted by spud View Post
Thanks guys
First bit of code to try in your setup routine would be

move.w #0,$dff1fc

This clears the Fmode burst modus, which 'should' correct the screen.
Galahad/FLT is offline  
Old 14 August 2012, 20:54   #9
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,650
Quote:
Originally Posted by Galahad/FLT View Post
First bit of code to try in your setup routine would be

move.w #0,$dff1fc

This clears the Fmode burst modus, which 'should' correct the screen.
The LoadView(0) call does this (and more) as Leffmann said.
StingRay is online now  
Old 14 August 2012, 21:47   #10
spud
Registered User

 
Join Date: May 2010
Location: London, UK
Posts: 256
$dff1fc is presumaby the f-mode register then? that is a "new" register that isn't featured in the O/ECS? which would explain why I couldn't find it in the hardware ref manual, yet there is lots of talk about it. Sometimes the blindingly obvious is staring you in the face, but you can't see it.

Anyway, I tested moving 0 into it, and I see that works too.The copperlist didn't mind not being 64bit aligned either. Thanks again for the help.

I'll provide a demo of what I'm up to when it progresses beyond routine testing - at the moment I've got a software sprite moving about (not using the blitter - good (if simple) excercise in programming I think), platforms blitted into place, dual playfield, some copper background goodies and now it works under AGA. Lots more to learn, though. More question to follow? Maybe
spud is offline  
Old 14 August 2012, 23:05   #11
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,650
Yes, it's the fetch mode register that was introduced with AGA. And yes, just setting the fetch mode register to 0 will work too but the LoadView approach is a much better one, especially if you want full compatibility with "alien" screen modes.
StingRay is online now  
Old 14 August 2012, 23:20   #12
Galahad/FLT
Going nowhere

Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 47
Posts: 8,073
Quote:
Originally Posted by StingRay View Post
The LoadView(0) call does this (and more) as Leffmann said.
I know that, but its simple code to track down his screen problem and actually diagnose it as an fmode problem
Galahad/FLT is offline  
Old 25 August 2012, 01:40   #13
freehand
Registered User
 
Join Date: Mar 2010
Location: wisbech
Posts: 150
del.

Last edited by freehand; 29 September 2012 at 03:27.
freehand 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
Is there an Altered Destiny *AGA* fix? BarryB support.Games 2 06 January 2012 00:31
For sale: Indivision AGA / IDE Fix + Express + Software Dreamcatcher MarketPlace 1 12 August 2010 18:56
CARE Request: Tubular Worlds AGA - CD32 Fix Heavy Stylus project.CARE 6 22 May 2009 12:03
Indivision AGA 1200 + Elbox PC-Key fix! Fingerlickin_B Hardware mods 10 24 September 2008 00:59
Fix for Microprose games Pirates! and Colonization AGA? hexaae support.Games 5 25 July 2006 15:53

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.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Page generated in 0.12566 seconds with 13 queries