View Single Post
Old 19 September 2012, 12:56   #32
Join Date: Jul 2008
Location: Sweden
Posts: 2,112
The replayer is written to be modular and easy to call from C, that's why it looks like this. (what I assume from looking at it at least)

The AutoVecBase refers to the vector base, the base address where the M68K exception and interrupt vectors are. On 68000 it's always 0, on 68010 and up it can and may be located elsewhere.

The NearDataBase is the base address of the small/near data section, it will be called _LinkerDB. This stuff is more or less automatically handled in most Amiga C compilers and linkers.

EDIT: here's an example
          section   code

          xref      _LinkerDB
          xref      mt_init, mt_music, mt_install_cia, mt_end, mt_remove_cia, mt_Enable
          near      a4

start     move.l    4, a6
          lea       getvbr, a5          ; determine the vector base
          jsr       -30(a6)

          lea       $dff000, a6
          lea       _LinkerDB, a4       ; near data section in A4
          lea       module, a0
          jsr       mt_init

          move.l    a3, a0              ; vector base in A0
          st        d0                  ; PAL
          jsr       mt_install_cia

          st        mt_Enable(a4)

wait      btst      #6, $bfe001
          bne       wait

          jsr       mt_end
          jsr       mt_remove_cia

          moveq     #0, d0

getvbr    sub.l     a3, a3              ; assume address 0
          btst      #0, 297(a6)         ; check AttnFlags in exec to see if
          beq       .done               ; we have 68010 or higher

          movec     vbr, a3             ; read the vector base register

.done     rte

          section   data_c

module    incbin    speris_end.mod

Last edited by Leffmann; 19 September 2012 at 13:17.
Leffmann is offline  
Page generated in 0.03959 seconds with 10 queries