View Single Post
Old 27 October 2010, 19:32   #5
move.l #$c0ff33,throat

StingRay's Avatar
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,239
Originally Posted by sidewinder View Post
My current idea is to save the current machine state (all the CPU and custom registers) and the restore them when I'm completed. What else do I need to worry about?
The idea is correct. What you need to do is this:

- save current view and flush it so your code will work from non-native screen modes too (think graphics cards)
- store the system copperlists so you can restore them later
- if you want to use interrupts, check if your code is runnning on a CPU >68000, if so get the VBR (v.ector b.ase r.egister) since IRQ vectors can be relocated, i.e. they don't start at $0 anymore
- store custom regs (INTENA, DMACON, ADKCON

I'll attach my ministartup code which does all that, feel free to use/modify it.

Originally Posted by Lonewolf10 View Post
If you are writing a demo, then you don't need to worry about this as many demo's don't allow you to exit them (presumably to help against hacking images and code that may otherwise remain in memory).
I'm sorry but this is 1988 style! Nowadays almost all demos exit cleanly to DOS so saying "you don't have to worry about this" is simply wrong.
Attached Files
File Type: s ministartup.s (5.4 KB, 512 views)
StingRay is offline  
Page generated in 0.05539 seconds with 11 queries