14 August 2012, 13:49 | #1 |
Registered User
Join Date: May 2010
Location: London, UK
Posts: 268
|
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 |
14 August 2012, 13:59 | #2 |
Retired Quartex Sysop
Join Date: Sep 2001
Location: Roman Verulamium
Age: 58
Posts: 1,873
|
One for Galahad methinks!!
|
14 August 2012, 14:52 | #3 |
Registered Insane
Join Date: Feb 2010
Location: Ununited Kingdom
Posts: 792
|
|
14 August 2012, 15:31 | #4 |
Registered User
Join Date: May 2010
Location: London, UK
Posts: 268
|
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?! |
14 August 2012, 18:35 | #5 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
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. |
14 August 2012, 19:15 | #6 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
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.
|
14 August 2012, 19:48 | #7 |
Registered User
Join Date: May 2010
Location: London, UK
Posts: 268
|
Thanks guys
|
14 August 2012, 20:49 | #8 |
Going nowhere
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 9,004
|
|
14 August 2012, 20:54 | #9 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
|
14 August 2012, 21:47 | #10 |
Registered User
Join Date: May 2010
Location: London, UK
Posts: 268
|
$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 |
14 August 2012, 23:05 | #11 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
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.
|
14 August 2012, 23:20 | #12 |
Going nowhere
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 9,004
|
|
25 August 2012, 01:40 | #13 |
Registered User
Join Date: Mar 2010
Location: wisbech
Posts: 276
|
del.
Last edited by freehand; 29 September 2012 at 03:27. |
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 |
|
|