nuclear@4: | vi:filetype=gas68k: nuclear@0: | the following will go into the .vect section which will be placed at the very nuclear@0: | begining of the binary at address 0 by the linker (see lnkscript). nuclear@0: .section .vect,"a" nuclear@0: .extern start nuclear@0: | exception vectors nuclear@0: .long _stacktop | 00 reset - initial SSP nuclear@0: .long start | 01 reset - initial PC nuclear@0: .long intr_fatal | 02 bus error nuclear@0: .long intr_fatal | 03 address error nuclear@0: .long intr_fatal | 04 illegal instruction nuclear@0: .long intr_fatal | 05 zero divide nuclear@0: .long intr_fatal | 06 chk instruction nuclear@0: .long intr_fatal | 07 trapv instruction nuclear@0: .long intr_fatal | 08 privilege violation nuclear@0: .long intr_fatal | 09 trace nuclear@0: .long intr_fatal | 0a line 1010 emulator nuclear@0: .long intr_fatal | 0b line 1111 emulator nuclear@0: .long intr_fatal | 0c reserved nuclear@0: .long intr_fatal | 0d reserved nuclear@0: .long intr_fatal | 0e format error (mc68010 only) nuclear@0: .long intr_fatal | 0f uninitialized interrupt vector nuclear@0: .long intr_fatal | 10 \ nuclear@0: .long intr_fatal | 11 | nuclear@0: .long intr_fatal | 12 | nuclear@0: .long intr_fatal | 13 > reserved nuclear@0: .long intr_fatal | 14 | nuclear@0: .long intr_fatal | 15 | nuclear@0: .long intr_fatal | 16 | nuclear@0: .long intr_fatal | 17 / nuclear@0: .long intr_fatal | 18 spurious interrupt nuclear@0: .long intr_fatal | 19 level 1 interrupt nuclear@0: .long intr_fatal | 1a level 2 interrupt nuclear@0: .long intr_fatal | 1b level 3 interrupt nuclear@0: .long intr_hblank | 1c level 4 interrupt (hblank in the mega drive) nuclear@0: .long intr_fatal | 1d level 5 interrupt nuclear@0: .long intr_vblank | 1e level 6 interrupt (vblank in the mega drive) nuclear@0: .long intr_fatal | 1f level 7 interrupt nuclear@0: .long intr_fatal | 20 trap 0 nuclear@0: .long intr_fatal | 21 trap 1 nuclear@0: .long intr_fatal | 22 trap 2 nuclear@0: .long intr_fatal | 23 trap 3 nuclear@0: .long intr_fatal | 24 trap 4 nuclear@0: .long intr_fatal | 25 trap 5 nuclear@0: .long intr_fatal | 26 trap 6 nuclear@0: .long intr_fatal | 27 trap 7 nuclear@0: .long intr_fatal | 28 trap 8 nuclear@0: .long intr_fatal | 29 trap 9 nuclear@0: .long intr_fatal | 2a trap a nuclear@0: .long intr_fatal | 2b trap b nuclear@0: .long intr_fatal | 2c trap c nuclear@0: .long intr_fatal | 2d trap d nuclear@0: .long intr_fatal | 2e trap e nuclear@0: .long intr_fatal | 2f trap f nuclear@0: .long intr_fatal | 30 \ nuclear@0: .long intr_fatal | 31 | nuclear@0: .long intr_fatal | 32 | nuclear@0: .long intr_fatal | 33 | nuclear@0: .long intr_fatal | 34 | nuclear@0: .long intr_fatal | 35 | nuclear@0: .long intr_fatal | 36 | nuclear@0: .long intr_fatal | 37 | nuclear@0: .long intr_fatal | 38 > reserved nuclear@0: .long intr_fatal | 39 | nuclear@0: .long intr_fatal | 3a | nuclear@0: .long intr_fatal | 3b | nuclear@0: .long intr_fatal | 3c | nuclear@0: .long intr_fatal | 3d | nuclear@0: .long intr_fatal | 3e | nuclear@0: .long intr_fatal | 3f / nuclear@0: nuclear@0: | from here on we continue in the regular .text section since we don't care nuclear@0: | where this code ends up. nuclear@0: .text nuclear@1: nuclear@1: .global enable_intr nuclear@1: enable_intr: nuclear@1: andi.w #0xf8ff, %sr nuclear@1: rts nuclear@1: nuclear@1: .global disable_intr nuclear@1: disable_intr: nuclear@1: ori.w #0x0300, %sr nuclear@1: rts nuclear@1: nuclear@0: | interrupt handlers nuclear@0: intr_fatal: nuclear@0: stop #0x2700 nuclear@0: nuclear@1: .include "vdpdefs.inc" nuclear@1: .extern vblank_handler nuclear@1: .extern palval nuclear@1: nuclear@0: intr_hblank: nuclear@4: | move.l #0xc0020000, VDP_PORT_CTL nuclear@4: | nuclear@4: | move.w testcol, %d0 nuclear@4: | move.w %d0, VDP_PORT_DATA nuclear@4: | rol.b #4, %d0 nuclear@4: | move.w %d0, testcol nuclear@4: | nuclear@0: rte nuclear@1: nuclear@0: intr_vblank: nuclear@5: jsr vblank_handler nuclear@0: rte