A.D.A. Amiga Demoscene Archive

  Welcome guest! Please register a new account or log in

  

  

  

Demos Amiga Demoscene Archive Forum / Coding / ASM tutorial failure

 

Author Message
Oerg866
Member
#1 - Posted: 22 Sep 2009 19:29
Reply Quote
Talking about this tutorial: http://aminet.net/package/dev/asm/Asm-Course2

http://pastebin.ca/1575443

All sample programs that work with the copperlists fail to work, they display a blank screen on all different systems and assemblers I've tried. Any ideas?
winden
Member
#2 - Posted: 22 Sep 2009 20:43
Reply Quote
put a " cnop 0,8" before the copperliste: label, so that the address of the start of the copperlist is evenly divisible by 8. It is a requirement of AGA chipset.
Kalms
Member
#3 - Posted: 22 Sep 2009 20:57
Reply Quote
That piece of code will fail on any machine which has fastmem. So unless you are using an unexpanded A500 or A1200, you need to change it a bit.

First thing you need to do, is to place the copperlist in chip memory. The copperlist is a sequence of instructions which will get read by the copper (graphics coprocessor). The copper can only read from chip memory.

Split your program into two sections, by putting a

section code,code

at the top of the file, and a

section data_c,data_c

just before the "Copperliste:" label.

The resulting executable file will have its contents split into two sections. The entire "data_c" section will have a flag set which indicates to the OS's program loader that it should get loaded into chip memory.


After this change, there are still several reasons why it might not woirk. The setup code you're using is omitting several steps which a well-behaved program would go through.


Couple off the top of my mind:

* before you activate your own copperlist, do the following to "reset" the display registers to a known-good state:

sub.l a1, a1
jsr LoadView(a6) ; Blank the screen
jsr WaitTOF(a6)
jsr WaitTOF(a6)

* if you are going to use the blitter, you should perform OwnBlitter() / DisownBlitter() at the start/end of your program. Also, just because you just did OwnBlitter() doesn't mean that it is idle -- follow the OwnBlitter() with a WaitBlit() to ensure that is the case.

etc. See http://www.amiga.org/forums/showpost.php?s=a95a68d d42be987d255f705ed5bd74ae&p=83619&postcount=3 for a list of things to do for a "full" system teardown/setup.
Kalms
Member
#4 - Posted: 22 Sep 2009 21:00
Reply Quote
winden: 2 bytes alignment is all that is needed for the copperlist. it's being fetched in 2-byte chunks even with the AGA chipset. It's the bitplane ptrs that may need 8-byte alignment with high FMODE.
Oerg866
Member
#5 - Posted: 22 Sep 2009 21:32 - Edited
Reply Quote
Very well thank you sir, I will try your suggestions and report results later! :)

EDIT: Hehey! Disabling the Fast and slow RAM works very fine!
winden
Member
#6 - Posted: 22 Sep 2009 21:37
Reply Quote
kalms: I just carpet-bombed higher alignment everywhere when switched from ECS to AGA :) Good to know it is not actually necessary tho.
z5_
Member
#7 - Posted: 22 Sep 2009 23:45 - Edited
Reply Quote
Just something from (little) personal experience. Be careful with trying to understand, use and assemble code found "somewhere on the internet". Especially when you are not sure if it's AGA or OCS code. Learning asm + amiga chipset isn't easy and trying to learn it from "random" material found on the internet may not be the easiest approach (at least it wasn't for me).

I seem to remember a good tutorial from Dr.doom in an issue of Eurochart for an AGA startup system. I'd gamble it was issue 42 but i'm not sure. There was a coders corner in some of the issues. Read it and compare it with Xeron's notes on amiga.org (link see Kalms post).

Having a good reliable startup system (and more generally speaking a good demosystem) is important. Because it's something that you can reuse again and again and it gives confidence in building on top of that. Consider it the foundation on which you are going to build a house (the actual intro).

ps. this is advice from a newbie to a newbie :)
dodke
Member
#8 - Posted: 23 Sep 2009 08:20
Reply Quote
I don't do half of the stuff xeron is talking about. Hmm :) Not even sure what everything means.
xeron
Member
#9 - Posted: 29 Sep 2009 11:42
Reply Quote
@dodke
You really should do all the things I said. If you don't know how to do any of those things, just ask here.
britelite
Member
#10 - Posted: 30 Sep 2009 10:45
Reply Quote
I always do everything xeron says, because he's just that awesome.
kasie
Member
#11 - Posted: 30 Sep 2009 12:22
Reply Quote
@brite
and becose of it some of your code works fine on os4 ?:)
dodke
Member
#12 - Posted: 1 Oct 2009 14:31
Reply Quote
btw. there are more things to life than os4 compatibility
asman
Member
#13 - Posted: 2 Oct 2009 23:49
Reply Quote
@xeron

What about case when I use PORTS ints ? Should I set/clr cia.icr or other cia reg.
xeron
Member
#14 - Posted: 12 Oct 2009 11:03
Reply Quote
Britelite definately did all the things i said, because he used to use the same startupcode as me for hardware bashing demos (dunno if he still does).
xeron
Member
#15 - Posted: 12 Oct 2009 11:04
Reply Quote
@asman

In general, just try and leave the hardware as you found it.

 

  Please register a new account or log in to comment

  

  

  

 

A.D.A. Amiga Demoscene Archive, Version 3.0