[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
VBLRetrace Manager: how to access A5 ?
- To: info-mcl@cambridge.apple.com
- Subject: VBLRetrace Manager: how to access A5 ?
- From: jacopin@laforia.ibp.fr ( Eric JACOPIN)
- Date: Thu, 30 Sep 93 13:55:30 +0100
Hello !
I'd like to install a VBL retrace task and to access to some of my globals in
it. I then have to manipulate A5. Reading it seems to be possible within MACL.
But what about Placing values in A5 ?
Here is an example of what I'd like to do:
(defrecord VBLTask
(qLink pointer)
(qType integer)
(vblAddr pointer)
(vblCount integer)
(vblPhase integer))
(defrecord Task
(myAppA5 longint)
(myVBLTask VBLTask))
(defvar *time* 50)
(setq DoMyVbl
(defpascal DoMyVbl ((register :reg))
(let* ((CurrentA5 (rref register :regbuf.rA5)))
;;------------> Still to be done : Install :Task.MyAppA5 in :a5
(print *time*)
(if (zerop *times*)
(Stop-It)
(setq *time* (1- *time*)))
(rset MyTask :Task.MyVBLTask.vblCount 60)
;;-------------> Still to be done : Install CurrentA5 in :a5
)))
(setq MyVBLTask (make-record :VBLTask
:qType 1
:vblAddr DoMyVbl
:vblCount 60
:vblPhase 0))
(setq MyTask (make-record :Task
:myAppA5 (%get-long (%int-to-ptr #x0904))
:myVBLTask MyVBLTask))
(CCL:_VInstall :A0 (make-record :VBLTask
:qType 1
:vblAddr (defpascal DoMyVbl ((registers :reg))
(print "Coucou !"))
:vblCount 60
:vblPhase 0)
:D0)
(CCL:_VInstall :A0 MyVBLTask :D0)
(defun Stop-It () (CCL:_VRemove :A0 MyVBLTask :D0))
;;; What follows works but but can't access to globals:
(CCL:_VInstall :A0 (make-record :VBLTask
:qType 1
:vblAddr (defpascal DoMyVbl ()
(print "Coucou !"))
:vblCount 600 ;; will print "Coucou ! in 10s
:vblPhase 0)
:D0)
ANY ideas ?
[Eric JACOPIN]
LAFORIA-IBP, Boite 169, 4,place Jussieu,
75252 PARIS Cedex 05, FRANCE. AI is a bag of tricks.