--- /dev/null
+CROSS = m68k-elf-\r
+CC = $(CROSS)gcc\r
+AS = $(CROSS)as\r
+LD = $(CROSS)ld\r
+OBJCOPY = $(CROSS)objcopy\r
+\r
+ASFLAGS += -m68000 --register-prefix-optional --bitwise-or -pic\r
+ASFLAGS_CC += -Wa,-m68000 -Wa,--register-prefix-optional -Wa,--bitwise-or -Wa,-pic\r
+CFLAGS += -Wall -g -O1 -m68000 -fomit-frame-pointer\r
+LDLIBS += $(shell $(CC) -print-file-name=libgcc.a)\r
+\r
+TARGET = megaed_stop\r
+OBJS = sega_gcc.o main.o\r
+\r
+all: $(TARGET).bin\r
+\r
+$(TARGET).elf: $(OBJS)\r
+ $(LD) -o $@ -Ted_app.ld -Map $(TARGET).map $^ $(LDLIBS)\r
+\r
+$(TARGET)_e.bin: $(TARGET).bin\r
+ dd if=/dev/zero of=$@ bs=1M count=1\r
+ dd if=$^ of=$@ bs=1M seek=1\r
+ dd if=$^ of=$@ conv=notrunc\r
+\r
+clean:\r
+ $(RM) $(TARGET).bin $(OBJS) $(TARGET).elf $(TARGET).map\r
+\r
+\r
+%.bin: %.elf\r
+ $(OBJCOPY) -I elf32-m68k -O binary $^ $@\r
+\r
+%.o: %.S\r
+ $(CC) -c -o $@ $^ $(ASFLAGS_CC)\r
+\r
+rel: $(TARGET).bin\r
+ mkdir -p /tmp/$(TARGET)/src/\r
+ cp $^ /tmp/$(TARGET)/\r
+ $(MAKE) clean\r
+ cp -a * /tmp/$(TARGET)/src/\r
--- /dev/null
+This is free and unencumbered software released into the public domain.
+
+Anyone is free to copy, modify, publish, use, compile, sell, or
+distribute this software, either in source code form or as a compiled
+binary, for any purpose, commercial or non-commercial, and by any
+means.
+
+In jurisdictions that recognize copyright laws, the author or authors
+of this software dedicate any and all copyright interest in the
+software to the public domain. We make this dedication for the benefit
+of the public at large and to the detriment of our heirs and
+successors. We intend this dedication to be an overt act of
+relinquishment in perpetuity of all present and future rights to this
+software under copyright law.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+For more information, please refer to <http://unlicense.org/>
--- /dev/null
+OUTPUT_ARCH(m68k)\r
+SEARCH_DIR(.)\r
+/*GROUP(-lbcc -lc -lgcc)*/\r
+__DYNAMIC = 0;\r
+\r
+/*\r
+ * Setup the memory map of the SEGA Genesis.\r
+ * stack grows down from high memory.\r
+ *\r
+ * The memory map look like this:\r
+ * +--------------------+ <- low memory\r
+ * | .text |\r
+ * | _etext |\r
+ * | ctor list | the ctor and dtor lists are for\r
+ * | dtor list | C++ support\r
+ * +--------------------+\r
+ * | .data | initialized data goes here\r
+ * | _edata |\r
+ * +--------------------+\r
+ * | .bss |\r
+ * | __bss_start | start of bss, cleared by crt0\r
+ * | _end | start of heap, used by sbrk()\r
+ * +--------------------+\r
+ * . .\r
+ * . .\r
+ * . .\r
+ * | __stack | top of stack\r
+ * +--------------------+\r
+ */\r
+MEMORY\r
+{\r
+ rom : ORIGIN = 0x00100000, LENGTH = 0x00300000\r
+ ram : ORIGIN = 0x00ff0100, LENGTH = 0x0000FF00\r
+}\r
+\r
+/*\r
+ * allocate the stack to be at the top of memory, since the stack\r
+ * grows down\r
+ */\r
+\r
+PROVIDE (__stack = 0x00fffff0);\r
+\r
+/*\r
+ * Initalize some symbols to be zero so we can reference them in the\r
+ * crt0 without core dumping. These functions are all optional, but\r
+ * we do this so we can have our crt0 always use them if they exist. \r
+ * This is so BSPs work better when using the crt0 installed with gcc.\r
+ * We have to initalize them twice, so we cover a.out (which prepends\r
+ * an underscore) and coff object file formats.\r
+ */\r
+PROVIDE (hardware_init_hook = 0);\r
+PROVIDE (_hardware_init_hook = 0);\r
+PROVIDE (software_init_hook = 0);\r
+PROVIDE (_software_init_hook = 0);\r
+\r
+SECTIONS\r
+{\r
+ .text 0x00100000:\r
+ {\r
+ *(.text)\r
+ . = ALIGN(0x4);\r
+ __CTOR_LIST__ = .;\r
+ LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)\r
+ *(.ctors)\r
+ LONG(0)\r
+ __CTOR_END__ = .;\r
+ __DTOR_LIST__ = .;\r
+ LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)\r
+ *(.dtors)\r
+ LONG(0)\r
+ __DTOR_END__ = .;\r
+ *(.rodata*)\r
+ *(.gcc_except_table)\r
+\r
+ __INIT_SECTION__ = . ;\r
+ *(.init)\r
+ SHORT (0x4e75) /* rts */\r
+\r
+ __FINI_SECTION__ = . ;\r
+ *(.fini)\r
+ SHORT (0x4e75) /* rts */\r
+\r
+ _etext = .;\r
+ *(.lit)\r
+ } > rom\r
+\r
+ .data 0xff0100 :\r
+ {\r
+ *(.shdata)\r
+ *(.data)\r
+ _edata = .;\r
+ } > ram\r
+\r
+ /* .bss 0xff0100 : */\r
+ .bss BLOCK (0x4) :\r
+ {\r
+ __bss_start = . ;\r
+ *(.shbss)\r
+ *(.bss)\r
+ *(COMMON)\r
+ *(.eh_fram)\r
+ *(.eh_frame)\r
+ _end = ALIGN (0x8);\r
+ __end = _end;\r
+ } > ram\r
+\r
+ .stab 0 (NOLOAD) :\r
+ {\r
+ *(.stab)\r
+ }\r
+\r
+ .stabstr 0 (NOLOAD) :\r
+ {\r
+ *(.stabstr)\r
+ }\r
+}\r
--- /dev/null
+/*
+ * File: edos.h
+ * Author: krik
+ *
+ * Created on 29 Ìàðò 2012 ã., 1:29
+ */
+
+#ifndef _EDOS_H
+#define _EDOS_H
+
+//#include "segalib.h"
+
+/*
+ * saddr: address in sectors
+ * slen: lenght in sectors
+ * wr_slen: how many sectors will be written
+ * sector size 512 bytes
+ * dma reading of usb and SD available only if data destination located in rom area (0-0x3ffffff). dma reading not available for genesis ram
+ * destination address for dma reading must be aligned to 512b
+ * one mbyte of sdram can be mapped to one of four banks in rom space. osSetMemMap(u16) can be used for mapping configuration.
+ * os code located in last mbyte of sdram and should be mapped in bank 0
+ * user code located in begin of sdram. default mapping 0x210f means that end of sdram (OS) mapped to area 0-0x0fffff, first mbyte of user code mapped to 0x100000-0x1fffff,
+ * memory configuration:
+ * genesis address: 0x000000-0x0fffff, physical sdram address: 0xf00000-0xffffff OS
+ * genesis address: 0x100000-0x3fffff, physical sdram address: 0x000000-0x2fffff user code (current application)
+ * 0xff0000-0xff00ff OS dma code
+ * first 256bytes of genesis ram must be reserved for OS
+ * */
+
+
+#define MEM_ERR_SPI_RD_TIMEOUT 120
+
+#define ERR_FILE_TOO_BIG 140
+#define ERR_WRON_OS_SIZE 142
+#define ERR_OS_VERIFY 143
+#define ERR_OS_VERIFY2 144
+#define ERR_BAD_DMA_ADDRESS 145
+#define ERR_MUST_NOT_RET 146
+
+//100 - 119 fat errors
+#define FAT_ERR_NOT_EXIST 100
+#define FAT_ERR_EXIST 101
+#define FAT_ERR_NAME 102
+#define FAT_ERR_OUT_OF_FILE 103
+#define FAT_ERR_BAD_BASE_CLUSTER 104;
+#define FAT_ERR_NO_FRE_SPACE 105
+#define FAT_ERR_NOT_FILE 106
+#define FAT_ERR_FILE_MODE 107
+#define FAT_ERR_ROT_OVERFLOW 108
+#define FAT_ERR_OUT_OF_TABLE 109
+#define FAT_ERR_INIT 110
+#define FAT_LFN_BUFF_OVERFLOW 111
+#define FAT_DISK_NOT_READY 112
+#define FAT_ERR_SIZE 113
+#define FAT_ERR_RESIZE 114
+
+
+#define DISK_ERR_INIT 50
+#define DISK_ERR_RD1 62
+#define DISK_ERR_RD2 63
+
+#define DISK_ERR_WR1 64
+#define DISK_ERR_WR2 65
+#define DISK_ERR_WR3 66
+#define DISK_ERR_WR4 67
+#define DISK_ERR_WR5 68
+
+typedef struct {
+ u32 entry_cluster;
+ u32 size;
+ u32 hdr_sector;
+ u16 hdr_idx;
+ u8 name[256];
+ u16 is_dir;
+} FatFullRecord;
+
+typedef struct {
+ u8(*diskWrite)(u32 saddr, u8 *buff, u16 slen);
+ u8(*diskRead)(u32 saddr, void *buff, u16 slen);//*dst must be alligned to 512bytes and be in range 0x100000-0x3fffff. *dst can be located in genesis ram also, but transfer will be slow in this case
+ u8(*usbReadByte)();//loop inside of function waiting until usbRdReady != 0
+ void (*usbWriteByte)(u8 dat);//loop inside of function waiting until usbWrReady != 0
+ u8(*usbReadDma)(u16 *dst, u16 slen);//*dst must be alligned to 512bytes and be in range 0x100000-0x3fffff
+ u8(*usbReadPio)(u16 *dst, u16 slen);
+ u8(*usbRdReady)(); //return 1 if some data comes from pc
+ u8(*usbWrReady)(); //return 1 usb ready to send byte
+ void (*osSetMemMap)(u16 map); //memoty configuration 4x1Mb
+ u16(*osGetOsVersion)();
+ u16(*osGetFirmVersion)();
+ void (*osGetSerial)(u32 * buff); // 8bytes uniq serial number
+ void (*VDP_setReg)(u8 reg, u8 value);//os vdp functions should be used, otherwise system may hang while udb/sd dma
+ void (*VDP_vintOn)();
+ void (*VDP_vintOff)();
+ void (*memInitDmaCode)();//copy dma routine to genesis ram
+ u8(*fatReadDir)(FatFullRecord * frec);//get next record in current dir
+ void(*fatOpenDir)(u32 entry_cluster);//arg is entry cluster ot dir or 0. zero arg means that need to open root dir
+ u8(*fatOpenFileByeName)(u8 *name, u32 wr_slen);//wr_slen write len, or 0 if reading
+ u8(*fatOpenFile)(FatFullRecord *rec, u32 wr_slen);//wr_slen is write len, or 0 if reading
+ u8(*fatReadFile)(void *dst, u32 slen);
+ u8(*fatWriteFile)(void *src, u32 slen);
+ u8(*fatCreateRecIfNotExist)(u8 *name, u8 is_dir);
+ u8(*fatSkipSectors)(u32 slen);
+} OsRoutine;
+
+
+extern OsRoutine *ed_os;
+void edInit();
+
+
+//stereo dac. 8bit for each channel.
+//any writing to this port enables dac output, any reading from this port disables dac output.
+#define REG_DAC *((volatile u16*) (0xA1300E))
+
+
+//stuff for direct access to usb and spi. not recommended for use. OS function should be used for best compatibility
+#define _SPI_SS 0
+#define _SPI_FULL_SPEED 1
+#define _SPI_SPI16 2
+#define _SPI_AREAD 3
+
+//spi port (sd interface)
+#define SPI_PORT *((volatile u16*) (0xA13000))
+#define SPI_CFG_PORT *((volatile u16*) (0xA13002))
+
+//16bit or 8bit spi mode
+#define SPI16_ON SPI_CFG_PORT |= (1 << _SPI_SPI16)
+#define SPI16_OFF SPI_CFG_PORT &= ~(1 << _SPI_SPI16)
+
+//spi autoread. means that not need to write something to spi port before than read
+#define SPI_AR_ON SPI_CFG_PORT |= (1 << _SPI_AREAD)
+#define SPI_AR_OFF SPI_CFG_PORT &= ~(1 << _SPI_AREAD)
+
+//spi chip select
+#define SPI_SS_OFF SPI_CFG_PORT |= (1 << _SPI_SS)
+#define SPI_SS_ON SPI_CFG_PORT &= ~(1 << _SPI_SS)
+
+//spi speed. low speed need only for sd init
+#define SPI_HI_SPEED_ON SPI_CFG_PORT |= (1 << _SPI_FULL_SPEED)
+#define SPI_HI_SPEED_OFF SPI_CFG_PORT &= ~(1 << _SPI_FULL_SPEED)
+
+//usb-serial port
+#define FIFO_PORT *((volatile u16*) (0xA1300A))
+
+//spi and usb state
+#define STATE_PORT *((volatile u16*) (0xA1300C))
+#define _STATE_SPI_READY 0
+#define _STATE_FIFO_WR_READY 1
+#define _STATE_FIFO_RD_READY 2
+#define IS_FIFO_RD_READY (STATE_PORT & (1 << _STATE_FIFO_RD_READY))
+#define IS_FIFO_WR_READY (STATE_PORT & (1 << _STATE_FIFO_WR_READY))
+
+
+#endif /* _EDOS_H */
+
--- /dev/null
+/*
+ * This software is released into the public domain.
+ * See UNLICENSE file in top level directory.
+ */
+#include <stdlib.h>
+#include <stdarg.h>
+
+#define u8 unsigned char
+#define u16 unsigned short
+#define u32 unsigned int
+
+#include "edos.h"
+
+#define GFX_DATA_PORT 0xC00000
+#define GFX_CTRL_PORT 0xC00004
+
+#define TILE_MEM_END 0xB000
+
+#define FONT_LEN 128
+#define TILE_FONT_BASE (TILE_MEM_END / 32 - FONT_LEN)
+
+/* note: using ED menu's layout here.. */
+#define WPLANE (TILE_MEM_END + 0x0000)
+#define HSCRL (TILE_MEM_END + 0x0800)
+#define SLIST (TILE_MEM_END + 0x0C00)
+#define APLANE (TILE_MEM_END + 0x1000)
+#define BPLANE (TILE_MEM_END + 0x3000)
+
+#define read8(a) \
+ *((volatile u8 *) (a))
+#define read16(a) \
+ *((volatile u16 *) (a))
+#define read32(a) \
+ *((volatile u32 *) (a))
+#define write16(a, d) \
+ *((volatile u16 *) (a)) = (d)
+#define write32(a, d) \
+ *((volatile u32 *) (a)) = (d)
+
+#define GFX_WRITE_VRAM_ADDR(adr) \
+ (((0x4000 | ((adr) & 0x3FFF)) << 16) | ((adr) >> 14) | 0x00)
+#define GFX_WRITE_VSRAM_ADDR(adr) \
+ (((0x4000 | ((adr) & 0x3FFF)) << 16) | ((adr) >> 14) | 0x10)
+
+enum {
+ VDP_MODE1 = 0x00,
+ VDP_MODE2 = 0x01,
+ VDP_BACKDROP = 0x07,
+ VDP_MODE3 = 0x0b,
+ VDP_MODE4 = 0x0c,
+ VDP_AUTOINC = 0x0f,
+ VDP_SCROLLSZ = 0x10,
+};
+
+/* cell counts */
+#define LEFT_BORDER 1 /* lame TV */
+#define PLANE_W 64
+#define PLANE_H 32
+#define CSCREEN_H 28
+
+static void VDP_drawTextML(const char *str, u16 plane_base,
+ u16 x, u16 y)
+{
+ const u8 *src = (const u8 *)str;
+ u16 basetile = 0;
+ int max_len = 40 - LEFT_BORDER;
+ int len;
+ u32 addr;
+
+ x += LEFT_BORDER;
+
+ for (len = 0; str[len] && len < max_len; len++)
+ ;
+ if (len > (PLANE_W - x))
+ len = PLANE_W - x;
+
+ addr = plane_base + ((x + (PLANE_W * y)) << 1);
+ write32(GFX_CTRL_PORT, GFX_WRITE_VRAM_ADDR(addr));
+
+ while (len-- > 0) {
+ write16(GFX_DATA_PORT,
+ basetile | ((*src++) - 32 + TILE_FONT_BASE));
+ }
+}
+
+static int printf_ypos;
+
+static void printf_line(int x, const char *buf)
+{
+ u32 addr;
+ int i;
+
+ VDP_drawTextML(buf, APLANE, x, printf_ypos++ & (PLANE_H - 1));
+
+ if (printf_ypos >= CSCREEN_H) {
+ /* clear next line */
+ addr = APLANE;
+ addr += (PLANE_W * (printf_ypos & (PLANE_H - 1))) << 1;
+ write32(GFX_CTRL_PORT, GFX_WRITE_VRAM_ADDR(addr));
+ for (i = 0; i < 40 / 2; i++)
+ write32(GFX_DATA_PORT, 0);
+
+ /* scroll plane */
+ write32(GFX_CTRL_PORT, GFX_WRITE_VSRAM_ADDR(0));
+ write16(GFX_DATA_PORT, (printf_ypos - CSCREEN_H + 1) * 8);
+ }
+}
+
+#define PRINTF_LEN 40
+
+static int printf(const char *fmt, ...)
+{
+ static const char hexchars[] = "0123456789abcdef";
+ static int printf_xpos;
+ char c, buf[PRINTF_LEN + 11 + 1];
+ const char *s;
+ va_list ap;
+ int ival;
+ u32 uval;
+ int d = 0;
+ int i, j;
+
+ va_start(ap, fmt);
+ for (d = 0; *fmt; ) {
+ int prefix0 = 0;
+ int fwidth = 0;
+
+ c = *fmt++;
+ if (d < PRINTF_LEN)
+ buf[d] = c;
+
+ if (c != '%') {
+ if (c == '\n') {
+ buf[d] = 0;
+ printf_line(printf_xpos, buf);
+ d = 0;
+ printf_xpos = 0;
+ continue;
+ }
+ d++;
+ continue;
+ }
+ if (d >= PRINTF_LEN)
+ continue;
+
+ if (*fmt == '0') {
+ prefix0 = 1;
+ fmt++;
+ }
+
+ while ('1' <= *fmt && *fmt <= '9') {
+ fwidth = fwidth * 10 + *fmt - '0';
+ fmt++;
+ }
+
+ switch (*fmt++) {
+ case '%':
+ d++;
+ break;
+ case 'd':
+ case 'i':
+ ival = va_arg(ap, int);
+ if (ival < 0) {
+ buf[d++] = '-';
+ ival = -ival;
+ }
+ for (i = 1000000000; i >= 10; i /= 10)
+ if (ival >= i)
+ break;
+ for (; i >= 10; i /= 10) {
+ buf[d++] = '0' + ival / i;
+ ival %= i;
+ }
+ buf[d++] = '0' + ival;
+ break;
+ case 'x':
+ uval = va_arg(ap, int);
+ while (fwidth > 1 && uval < (1 << (fwidth - 1) * 4)) {
+ buf[d++] = prefix0 ? '0' : ' ';
+ fwidth--;
+ }
+ for (j = 1; j < 8 && uval >= (1 << j * 4); j++)
+ ;
+ for (j--; j >= 0; j--)
+ buf[d++] = hexchars[(uval >> j * 4) & 0x0f];
+ break;
+ case 's':
+ s = va_arg(ap, char *);
+ while (*s && d < PRINTF_LEN)
+ buf[d++] = *s++;
+ break;
+ default:
+ // don't handle, for now
+ d++;
+ va_arg(ap, void *);
+ break;
+ }
+ }
+ buf[d] = 0;
+ va_end(ap);
+
+ if (d != 0) {
+ // line without \n
+ VDP_drawTextML(buf, APLANE, printf_xpos,
+ printf_ypos & (PLANE_H - 1));
+ printf_xpos += d;
+ }
+
+ return d; // wrong..
+}
+
+int main()
+{
+ OsRoutine *ed;
+ u8 seed, bad = 0;
+ u8 *p, val;
+ int i, t, len;
+
+ ed = (OsRoutine *) *(u32 *)0x1A0;
+ ed->memInitDmaCode();
+
+ ed->VDP_setReg(VDP_MODE1, 0x04);
+ ed->VDP_setReg(VDP_MODE2, 0x64);
+ ed->VDP_setReg(VDP_AUTOINC, 2);
+ ed->VDP_setReg(VDP_SCROLLSZ, 0x01);
+
+ /* clear name tables */
+ write32(GFX_CTRL_PORT, GFX_WRITE_VRAM_ADDR(APLANE));
+ for (i = 0; i < PLANE_W * PLANE_H / 2; i++)
+ write32(GFX_DATA_PORT, 0);
+
+ write32(GFX_CTRL_PORT, GFX_WRITE_VRAM_ADDR(BPLANE));
+ for (i = 0; i < PLANE_W * PLANE_H / 2; i++)
+ write32(GFX_DATA_PORT, 0);
+
+ /* scroll planes */
+ write32(GFX_CTRL_PORT, GFX_WRITE_VSRAM_ADDR(0));
+ write32(GFX_DATA_PORT, 0);
+
+ /* note: relying on ED menu's font setup here.. */
+
+ printf("\n");
+ printf("MD version: %02x\n", read8(0xa10001));
+ printf("ED os/fw: %d/%d\n\n", ed->osGetOsVersion(),
+ ed->osGetFirmVersion());
+
+ seed = read8(0xC00009);
+ p = (void *)0x200000;
+ len = 0x200000;
+ printf("filling SDRAM, seed=%02x.. ", seed);
+
+ val = seed;
+ for (i = 0; i < len; i++)
+ p[i] = val++;
+
+ printf("done.\n");
+
+ for (t = 1; ; t++) {
+ printf("executing stop.. ");
+ for (i = 0; i < 5 * 60; i++)
+ asm volatile("stop #0x2000");
+ printf("done\n");
+
+ printf("checking memory..\n");
+
+ val = seed;
+ for (i = 0; i < len; i++) {
+ if (p[i] != val) {
+ printf("bad: %06x: got %02x, expected %02x\n",
+ &p[i], p[i], val);
+ bad = 1;
+ }
+ val++;
+ }
+
+ printf("done. Try %d: test ", t);
+ if (bad) {
+ printf("FAILED\n");
+ break;
+ }
+ printf("PASSED\n");
+ }
+
+ /* there are not enough STOP opcodes in this world :D */
+ while (1)
+ asm volatile("stop #0x2000");
+
+ return 0;
+}
+
+// vim:ts=4:sw=4:expandtab
--- /dev/null
+ dc.l 0, 0x200, exc__, exc__, exc__, exc__, exc__, exc__\r
+ dc.l exc__, exc__, exc__, exc__, exc__, exc__, exc__, exc__\r
+ dc.l exc__, exc__, exc__, exc__, exc__, exc__, exc__, exc__\r
+ dc.l exc__, exc__, exc__, exc__, HBL, exc__, VBL, exc__\r
+ dc.l exc__, exc__, exc__, exc__, exc__, exc__, exc__, exc__\r
+ dc.l exc__, exc__, exc__, exc__, exc__, exc__, exc__, exc__\r
+ dc.l exc__, exc__, exc__, exc__, exc__, exc__, exc__, exc__\r
+ dc.l exc__, exc__, exc__, exc__, exc__, exc__, exc__, exc__\r
+\r
+ .ascii "SEGA EVERDRIVE "\r
+ .ascii "MEGA-ED SDRAM vs STOP "\r
+ .ascii "MEGA-ED SDRAM vs STOP "\r
+ .ascii "GM 00000000-00"\r
+ .byte 0x00,0x00\r
+ .ascii "JD "\r
+ .byte 0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00\r
+ .byte 0x00,0xff,0x00,0x00,0xff,0xff,0xff,0xff\r
+ .ascii " "\r
+ .ascii " "\r
+ .ascii " "\r
+ .ascii "JUE "\r
+\r
+RST:\r
+ move.w #0x2700, %sr\r
+/* magic ED app init */\r
+ move.w #0x0000, (0xA13006)\r
+ jmp init_ed.l\r
+init_ed:\r
+ move.w #0x210f, (0xA13006)\r
+ move.l #HBL, (0x70)\r
+ move.l #VBL, (0x78)\r
+\r
+ moveq #0, %d0\r
+ movea.l %d0, %a7\r
+ move %a7, %usp\r
+ bra main\r
+\r
+HBL:\r
+VBL:\r
+exc__:\r
+ rte\r
+\r
+# vim:filetype=asmM68k:ts=4:sw=4:expandtab\r