--- /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
+#include <stdarg.h>
+
+#define u8 unsigned char
+#define u16 unsigned short
+#define u32 unsigned int
+
+#define noinline __attribute__((noinline))
+
+#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 WPLAN (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 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 noinline 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;
+
+ if (printf_ypos >= CSCREEN_H) {
+ }
+
+ 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 - 27) * 8);
+ }
+}
+
+static noinline int printf(const char *fmt, ...)
+{
+ static int printf_xpos;
+ char buf[40+11];
+ va_list ap;
+ int ival;
+ int d = 0;
+ int i;
+
+ va_start(ap, fmt);
+ for (d = 0; *fmt; ) {
+ buf[d] = *fmt++;
+ if (buf[d] != '%') {
+ if (buf[d] == '\n') {
+ buf[d] = 0;
+ if (d != 0)
+ printf_line(printf_xpos, buf);
+ d = 0;
+ printf_xpos = 0;
+ continue;
+ }
+ d++;
+ continue;
+ }
+
+ 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 's':
+ // s = va_arg(ap, char *);
+ default:
+ // don't handle, for now
+ d++;
+ buf[d++] = *fmt++;
+ 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..
+}
+
+void exception(void)
+{
+ VDP_drawTextML("============", APLANE, 0, 0);
+ VDP_drawTextML(" exception! ", APLANE, 0, 1);
+ VDP_drawTextML("============", APLANE, 0, 2);
+ while (1)
+ ;
+}
+
+void vbl(void)
+{
+}
+
+int main()
+{
+ OsRoutine *ed;
+ int i, j = 0;
+
+ 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);
+
+ /* note: relying on ED menu's font setup here.. */
+
+ // VDP_drawTextML("hello", APLANE, 0, 0);
+ printf("hello1");
+ printf(" hello2\n");
+ printf("hello3\n");
+
+ for (;;) {
+ for (i = 0; i < 30; i++)
+ asm volatile("stop #0x2000");
+
+ printf("hello %d\n", j++);
+ }
+
+ return 0;
+}
+
+// vim:ts=4:sw=4:expandtab
--- /dev/null
+ dc.l 0x0,0x200\r
+ dc.l INT,INT,INT,INT,INT,INT,INT\r
+ dc.l INT,INT,INT,INT,INT,INT,INT,INT\r
+ dc.l INT,INT,INT,INT,INT,INT,INT,INT\r
+ dc.l INT,INT,INT,HBL,INT,VBL,INT,INT\r
+ dc.l INT,INT,INT,INT,INT,INT,INT,INT\r
+ dc.l INT,INT,INT,INT,INT,INT,INT,INT\r
+ dc.l INT,INT,INT,INT,INT,INT,INT,INT\r
+ dc.l INT,INT,INT,INT,INT,INT,INT\r
+ .ascii "SEGA EVERDRIVE "\r
+ .ascii "MEGA-ED host "\r
+ .ascii "MEGA-ED host "\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
+/* magic ED app init */\r
+RST:\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
+INT:\r
+ movem.l %d0-%d1/%a0-%a1,-(%sp)\r
+ jsr exception\r
+ movem.l (%sp)+,%d0-%d1/%a0-%a1\r
+ rte\r
+\r
+HBL:\r
+ rte\r
+\r
+VBL:\r
+ movem.l %d0-%d1/%a0-%a1,-(%sp)\r
+ jsr vbl\r
+ movem.l (%sp)+,%d0-%d1/%a0-%a1\r
+ rte\r
+\r
+\r
+* Standard 32X startup code for MD side at 0x3F0\r
+ .org 0x3F0\r
+\r
+ .word 0x287C,0xFFFF,0xFFC0,0x23FC,0x0000,0x0000,0x00A1,0x5128\r
+ .word 0x46FC,0x2700,0x4BF9,0x00A1,0x0000,0x7001,0x0CAD,0x4D41\r
+ .word 0x5253,0x30EC,0x6600,0x03E6,0x082D,0x0007,0x5101,0x67F8\r
+ .word 0x4AAD,0x0008,0x6710,0x4A6D,0x000C,0x670A,0x082D,0x0000\r
+ .word 0x5101,0x6600,0x03B8,0x102D,0x0001,0x0200,0x000F,0x6706\r
+ .word 0x2B78,0x055A,0x4000,0x7200,0x2C41,0x4E66,0x41F9,0x0000\r
+ .word 0x04D4,0x6100,0x0152,0x6100,0x0176,0x47F9,0x0000,0x04E8\r
+ .word 0x43F9,0x00A0,0x0000,0x45F9,0x00C0,0x0011,0x3E3C,0x0100\r
+ .word 0x7000,0x3B47,0x1100,0x3B47,0x1200,0x012D,0x1100,0x66FA\r
+ .word 0x7425,0x12DB,0x51CA,0xFFFC,0x3B40,0x1200,0x3B40,0x1100\r
+ .word 0x3B47,0x1200,0x149B,0x149B,0x149B,0x149B,0x41F9,0x0000\r
+ .word 0x04C0,0x43F9,0x00FF,0x0000,0x22D8,0x22D8,0x22D8,0x22D8\r
+ .word 0x22D8,0x22D8,0x22D8,0x22D8,0x41F9,0x00FF,0x0000,0x4ED0\r
+ .word 0x1B7C,0x0001,0x5101,0x41F9,0x0000,0x06BC,0xD1FC,0x0088\r
+ .word 0x0000,0x4ED0,0x0404,0x303C,0x076C,0x0000,0x0000,0xFF00\r
+ .word 0x8137,0x0002,0x0100,0x0000,0xAF01,0xD91F,0x1127,0x0021\r
+ .word 0x2600,0xF977,0xEDB0,0xDDE1,0xFDE1,0xED47,0xED4F,0xD1E1\r
+ .word 0xF108,0xD9C1,0xD1E1,0xF1F9,0xF3ED,0x5636,0xE9E9,0x9FBF\r
+ .word 0xDFFF,0x4D41,0x5253,0x2049,0x6E69,0x7469,0x616C,0x2026\r
+ .word 0x2053,0x6563,0x7572,0x6974,0x7920,0x5072,0x6F67,0x7261\r
+ .word 0x6D20,0x2020,0x2020,0x2020,0x2020,0x2043,0x6172,0x7472\r
+ .word 0x6964,0x6765,0x2056,0x6572,0x7369,0x6F6E,0x2020,0x2020\r
+ .word 0x436F,0x7079,0x7269,0x6768,0x7420,0x5345,0x4741,0x2045\r
+ .word 0x4E54,0x4552,0x5052,0x4953,0x4553,0x2C4C,0x5444,0x2E20\r
+ .word 0x3139,0x3934,0x2020,0x2020,0x2020,0x2020,0x2020,0x2020\r
+ .word 0x2020,0x2020,0x2020,0x2020,0x2020,0x2020,0x2020,0x2020\r
+ .word 0x2020,0x2020,0x2020,0x524F,0x4D20,0x5665,0x7273,0x696F\r
+ .word 0x6E20,0x312E,0x3000,0x48E7,0xC040,0x43F9,0x00C0,0x0004\r
+ .word 0x3011,0x303C,0x8000,0x323C,0x0100,0x3E3C,0x0012,0x1018\r
+ .word 0x3280,0xD041,0x51CF,0xFFF8,0x4CDF,0x0203,0x4E75,0x48E7\r
+ .word 0x81C0,0x41F9,0x0000,0x063E,0x43F9,0x00C0,0x0004,0x3298\r
+ .word 0x3298,0x3298,0x3298,0x3298,0x3298,0x3298,0x2298,0x3341\r
+ .word 0xFFFC,0x3011,0x0800,0x0001,0x66F8,0x3298,0x3298,0x7000\r
+ .word 0x22BC,0xC000,0x0000,0x7E0F,0x3340,0xFFFC,0x3340,0xFFFC\r
+ .word 0x3340,0xFFFC,0x3340,0xFFFC,0x51CF,0xFFEE,0x22BC,0x4000\r
+ .word 0x0010,0x7E09,0x3340,0xFFFC,0x3340,0xFFFC,0x3340,0xFFFC\r
+ .word 0x3340,0xFFFC,0x51CF,0xFFEE,0x4CDF,0x0381,0x4E75,0x8114\r
+ .word 0x8F01,0x93FF,0x94FF,0x9500,0x9600,0x9780,0x4000,0x0080\r
+ .word 0x8104,0x8F02,0x48E7,0xC140,0x43F9,0x00A1,0x5180,0x08A9\r
+ .word 0x0007,0xFF80,0x66F8,0x3E3C,0x00FF,0x7000,0x7200,0x337C\r
+ .word 0x00FF,0x0004,0x3341,0x0006,0x3340,0x0008,0x4E71,0x0829\r
+ .word 0x0001,0x000B,0x66F8,0x0641,0x0100,0x51CF,0xFFE8,0x4CDF\r
+ .word 0x0283,0x4E75,0x48E7,0x8180,0x41F9,0x00A1,0x5200,0x08A8\r
+ .word 0x0007,0xFF00,0x66F8,0x3E3C,0x001F,0x20C0,0x20C0,0x20C0\r
+ .word 0x20C0,0x51CF,0xFFF6,0x4CDF,0x0181,0x4E75,0x41F9,0x00FF\r
+ .word 0x0000,0x3E3C,0x07FF,0x7000,0x20C0,0x20C0,0x20C0,0x20C0\r
+ .word 0x20C0,0x20C0,0x20C0,0x20C0,0x51CF,0xFFEE,0x3B7C,0x0000\r
+ .word 0x1200,0x7E0A,0x51CF,0xFFFE,0x43F9,0x00A1,0x5100,0x7000\r
+ .word 0x2340,0x0020,0x2340,0x0024,0x1B7C,0x0003,0x5101,0x2E79\r
+ .word 0x0088,0x0000,0x0891,0x0007,0x66FA,0x7000,0x3340,0x0002\r
+ .word 0x3340,0x0004,0x3340,0x0006,0x2340,0x0008,0x2340,0x000C\r
+ .word 0x3340,0x0010,0x3340,0x0030,0x3340,0x0032,0x3340,0x0038\r
+ .word 0x3340,0x0080,0x3340,0x0082,0x08A9,0x0000,0x008B,0x66F8\r
+ .word 0x6100,0xFF12,0x08E9,0x0000,0x008B,0x67F8,0x6100,0xFF06\r
+ .word 0x08A9,0x0000,0x008B,0x6100,0xFF3C,0x303C,0x0040,0x2229\r
+ .word 0x0020,0x0C81,0x5351,0x4552,0x6700,0x0092,0x303C,0x0080\r
+ .word 0x2229,0x0020,0x0C81,0x5344,0x4552,0x6700,0x0080,0x21FC\r
+ .word 0x0088,0x02A2,0x0070,0x303C,0x0002,0x7200,0x122D,0x0001\r
+ .word 0x1429,0x0080,0xE14A,0x8242,0x0801,0x000F,0x660A,0x0801\r
+ .word 0x0006,0x6700,0x0058,0x6008,0x0801,0x0006,0x6600,0x004E\r
+ .word 0x7020,0x41F9,0x0088,0x0000,0x3C28,0x018E,0x4A46,0x6700\r
+ .word 0x0010,0x3429,0x0028,0x0C42,0x0000,0x67F6,0xB446,0x662C\r
+ .word 0x7000,0x2340,0x0028,0x2340,0x002C,0x3E14,0x2C7C,0xFFFF\r
+ .word 0xFFC0,0x4CD6,0x7FF9,0x44FC,0x0000,0x6014,0x43F9,0x00A1\r
+ .word 0x5100,0x3340,0x0006,0x303C,0x8000,0x6004,0x44FC,0x0001\r
+\r