pouët.net

Go to bottom

Proper startup-code for Amiga

category: code [glöplog]
Hello Amiga coders,

I need a proper startup-code that eventually takes over the system.
The target is say A500 OCS / ECS.
Both Assembly and C are welcome :)

I know there are plenty of web resources available but all seem to use their own techniques.
At least I would need the essential steps to be executed, thanks.
added on the 2015-11-01 15:24:36 by AlienTech AlienTech
"eventually takes over the system." ?!?!?! are you planning to code a rootkit?!?!?
added on the 2015-11-01 16:56:16 by maali maali
An NSA implant against Amiga sceners!
added on the 2015-11-01 19:55:49 by Kylearan Kylearan
There's loads of the out there. Stingray posted his online some time ago and it's works rather well.
added on the 2015-11-01 20:05:54 by djh0ffman djh0ffman
You could also rip out the "take" and "give" functions from my from my demo-system
added on the 2015-11-01 20:22:38 by noname noname
You can use my MiniStartup, include it at the beginning of your source and create a label called MAIN in your actual source, this is the routine called by the startup once the system has been taken over.

To add a VBL interrupt routine you can use the VBIptr, let it point to your VBI routine (a normal routine that ends with rts!) and it will be called each VBI.
added on the 2015-11-02 07:56:52 by StingRay StingRay
Quote:

At least I would need the essential steps to be executed, thanks.


- save the system copperlists and flush the view
- get VBR location if you detect a 68010+ machine
- save the state of the hardware registers (INTENA, DMA, ADKCON etc.)
- disable interrupts/dma (this is the actual "kill system/OS" part)
- enable your needed DMA (and interrupt) channels
- run your demo
- disable interrupts/dma (this is the actual "kill system/OS" part)
- restore system copperlists
- restore old DMA/INTENA/ADKCON ect. settings
- restore old view
added on the 2015-11-02 08:07:11 by StingRay StingRay
Stingrays awnser covers the most important parts.
I would add some more things to keep things compatible.

- turn off all caches on 68020+ machines
- set proper values for $0106, $01fc in your copperlists for AGA compatibility
- always enable colorburst in bplcon0 in your copperlists to avoid problems with gfx boards and flickerfixers
added on the 2015-11-02 09:00:07 by axis^oxy axis^oxy
You can also have a look at my startup code. It features automatic exit on LMB and pause on RMB, configurable compatibility with different OS/hardware combinations and other neat stuff. ;)
added on the 2015-11-03 18:27:50 by Blueberry Blueberry
@All

Thanks for all the contributions.

Well it seems to me that an "ultimate" startup-code which is guaranteed to work on all systems (!) is even trickier than programming the demo effects ... so which is a good compromise to go?

My target is, as said before, A500 68000 / OCS / ECS.
added on the 2015-11-04 10:57:52 by AlienTech AlienTech
Well the above two options are pretty much as good as it gets; just pick one ;)
added on the 2015-11-04 11:25:31 by Fell Fell
Mine works with all CPUs, chipsets, Kickstarts and screenmodes. No need for compromises. :)
added on the 2015-11-04 17:22:02 by Blueberry Blueberry
I personally like Blueberry's. It's proven to work well. I am sure StingRay's is solid, too. Most importantly, don't try to write your own unless you really know what you are doing.
added on the 2015-11-04 17:56:25 by Hannibal Hannibal
@Blueberry

My congrats!
Do you handle "exotic" cases too? The early A1000? A Mediator based Amiga with OS 3.9?
Do you also handle all the various known workarounds?
:)
added on the 2015-11-04 19:50:46 by AlienTech AlienTech
@AlienTech: Now you're beginning to sound like that guy people *don't* want to help. :)
@Korvkiosken

Just coder curiosity ... :)
added on the 2015-11-04 20:16:57 by AlienTech AlienTech
blueberry <3
added on the 2015-11-04 21:52:04 by farfar farfar
System-friendly startup code for the Amiga, one of computer science's greatest unsolved problems.
added on the 2015-11-05 09:35:27 by Scali Scali
What Scali said!
added on the 2015-11-05 09:41:04 by rloaderro rloaderro
Rubbish! Both these ones work great!
added on the 2015-11-05 12:55:23 by Fell Fell
Quote:
My congrats!

Erm, thanks. ;)

Quote:
Do you handle "exotic" cases too?

Which exotic cases did you have in mind? No, it doesn't run on PPC. No, it doesn't run on machines without an actual Amiga chipset. Those are not the target platform.

Quote:
The early A1000?

I haven't tried it, but I don't see why it shouldn't. All the OS functions the startup uses have been there from the early days AFAIK.

Quote:
A Mediator based Amiga with OS 3.9?

Do you mean using a PCI graphics card? Shouldn't be a problem. The Amiga graphics will go to the Amiga RGB output of course.

Quote:
Do you also handle all the various known workarounds?

Workarounds for what? By whom?

Quote:
:)

;)
added on the 2015-11-05 16:23:42 by Blueberry Blueberry
Quote:
Mine works with all CPUs, chipsets, Kickstarts and screenmodes.

So does mine. :)

Quote:
Well it seems to me that an "ultimate" startup-code which is guaranteed to work on all systems (!) is even trickier than programming the demo effects


It's not really tricky if you know what you're doing.

Quote:

... so which is a good compromise to go?


There's no need for compromises as Blueberry said.

Besides, before looking for the "ultimate" startup-code which never has and never will exist you should just use those that are available and concentrate on actual effect coding, much more fun that way.
added on the 2015-11-05 17:56:59 by StingRay StingRay
@Blueberry

Quote:
Which exotic cases did you have in mind? No, it doesn't run on PPC. No, it doesn't run on machines without an actual Amiga chipset. Those are not the target platform.


Of course a minimum of a M68K cpu and OCS chipset are required.
With "exotic" I meant those Amiga compatible systems like for example The Draco and the modern Minimig (which I own).

It is very good it should work on all the target systems.

Quote:
Workarounds for what? By whom?


"; twice to avoid a4k hw bug" from the source code provided above by StingRay.
added on the 2015-11-05 20:56:51 by AlienTech AlienTech
Quote:
and the modern Minimig (which I own).

If a standard startup doesn't work on the MiniMig, then the MiniMig core should be fixed, not the startup.
added on the 2015-11-05 21:01:55 by britelite britelite
@StingRay

I 100% agree with you, it is only because I check source code from other people before actually using it ... I am very old fashion :)

Thanks again.
added on the 2015-11-05 21:02:36 by AlienTech AlienTech

login

Go to top