make the code relocatable
[megadrive.git] / hexed / sega_gcc.s
1         dc.l 0x0,0x200\r
2         dc.l INT,INT,INT,INT,INT,INT,INT\r
3         dc.l INT,INT,INT,INT,INT,INT,INT,INT\r
4         dc.l INT,INT,INT,INT,INT,INT,INT,INT\r
5         dc.l INT,INT,INT,HBL,INT,VBL,INT,INT\r
6         dc.l INT,INT,INT,INT,INT,INT,INT,INT\r
7         dc.l INT,INT,INT,INT,INT,INT,INT,INT\r
8         dc.l INT,INT,INT,INT,INT,INT,INT,INT\r
9         dc.l INT,INT,INT,INT,INT,INT,INT\r
10         .ascii "SEGA GENESIS                    "\r
11         .ascii "hexed (c) notaz, 2009                           "\r
12         .ascii "HEXED (C) NOTAZ, 2009                           "\r
13         .ascii "GM 00000000-00"\r
14         .byte 0x00,0x00\r
15         .ascii "JD              "\r
16         .byte 0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00\r
17         .byte 0x00,0xff,0x00,0x00,0xff,0xff,0xff,0xff\r
18         .ascii "               "\r
19         .ascii "                        "\r
20         .ascii "                         "\r
21         .ascii "JUE             "\r
22 \r
23         tst.l   0xa10008\r
24         bne     SkipSetup\r
25 * Check Version Number\r
26         move.b  (0xa10000),%d0\r
27         andi.b  #0x0f,%d0\r
28         beq     WrongVersion\r
29 * Sega Security Code (SEGA)\r
30         move.l  #0x53454741,(0xa14000)\r
31 WrongVersion:\r
32         moveq   #0,%d0\r
33         movea.l %d0,%a7\r
34         move    %a7,%usp\r
35 SkipSetup:\r
36         tst.w   0xC00004\r
37         bra     main\r
38 \r
39 * INT:\r
40 *       rte\r
41 \r
42 HBL:\r
43         rte\r
44 \r
45 * VBL:\r
46 *       addq.l #1,(vtimer).l\r
47 *       rte\r
48 \r