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.
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.
"eventually takes over the system." ?!?!?! are you planning to code a rootkit?!?!?
An NSA implant against Amiga sceners!
There's loads of the out there. Stingray posted his online some time ago and it's works rather well.
You could also rip out the "take" and "give" functions from my from my demo-system
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.
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.
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
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
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
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. ;)
@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.
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.
Well the above two options are pretty much as good as it gets; just pick one ;)
Mine works with all CPUs, chipsets, Kickstarts and screenmodes. No need for compromises. :)
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.
@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?
:)
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?
:)
@AlienTech: Now you're beginning to sound like that guy people *don't* want to help. :)
@Korvkiosken
Just coder curiosity ... :)
Just coder curiosity ... :)
blueberry <3
System-friendly startup code for the Amiga, one of computer science's greatest unsolved problems.
What Scali said!
Rubbish! Both these ones work great!
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:
:)
;)
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.
@Blueberry
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.
"; twice to avoid a4k hw bug" from the source code provided above by StingRay.
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.
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.
@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.
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.