lapetus-cvs Mailing List for Lapetus (Page 2)
Status: Inactive
Brought to you by:
cyberwarriorx
You can subscribe to this list here.
2007 |
Jan
|
Feb
(6) |
Mar
(23) |
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(26) |
Feb
(9) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(11) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Theo B. <cyb...@us...> - 2008-01-12 18:16:28
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv16098 Modified Files: lapetus.c Log Message: -Couple of code tweaks Index: lapetus.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/lapetus.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- lapetus.c 9 Jan 2008 05:03:44 -0000 1.2 +++ lapetus.c 12 Jan 2008 18:16:23 -0000 1.3 @@ -46,8 +46,9 @@ DebugInit(); #endif - // Unpause and stop dsp - SCUREG_PPAF = 0x4000000; + // If DSP is running, stop it + if (DSPIsExec()) + DSPStop(); if (InterruptGetLevelMask() > 0x7) InterruptSetLevelMask(0x7); |
From: Theo B. <cyb...@us...> - 2008-01-12 18:16:00
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15706 Modified Files: dsp.c dsp.h Log Message: -Couple of code tweaks Index: dsp.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/dsp.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- dsp.c 22 Jan 2007 04:12:12 -0000 1.2 +++ dsp.c 12 Jan 2008 18:15:56 -0000 1.3 @@ -44,16 +44,15 @@ SCUREG_PPD = program[i]; } - SCUREG_PPAF = 0; - return LAPETUS_ERR_OK; } ////////////////////////////////////////////////////////////////////////////// -void DSPExec() +void DSPExec(u8 PC) { - SCUREG_PPAF = SCUREG_PPAF | 0x18000; + SCUREG_PPAF = 0; + SCUREG_PPAF = 0x18000 | PC; } ////////////////////////////////////////////////////////////////////////////// @@ -67,7 +66,7 @@ void DSPStop() { - SCUREG_PPAF = SCUREG_PPAF & ~0x10000; + SCUREG_PPAF = 0; } ////////////////////////////////////////////////////////////////////////////// Index: dsp.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/dsp.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- dsp.h 14 Jan 2007 19:46:07 -0000 1.1 +++ dsp.h 12 Jan 2008 18:15:56 -0000 1.2 @@ -28,7 +28,7 @@ #define SCUREG_PDD (*(volatile u32 *)0x25FE008C) int DSPLoad(u32 *program, u8 offset, u8 size); -void DSPExec(); +void DSPExec(u8 PC); int DSPIsExec(); void DSPStop(); void DSPPause(); |
From: Theo B. <cyb...@us...> - 2008-01-11 00:47:18
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv7096 Added Files: mpeg.c Log Message: -Some MPEG stuff I wrote ages ago that I didn't commit --- NEW FILE: mpeg.c --- /* Copyright 2006-2007 Theo Berkau This file is part of Lapetus. Lapetus is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Lapetus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Lapetus; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "lapetus.h" ////////////////////////////////////////////////////////////////////////////// BOOL IsMPEGAuth() { cdcmd_struct cdcmd; cdcmd_struct cdcmdrs; cdcmd.CR1 = 0xE100; cdcmd.CR2 = 0x0001; cdcmd.CR3 = 0x0000; cdcmd.CR4 = 0x0000; // If command fails, assume it's not authenticated if (CDExecCommand(0, &cdcmd, &cdcmdrs) != LAPETUS_ERR_OK) return FALSE; // Disc type Authenticated: // 0x00: No MPEG Card/Not Authenticated // 0x02: Some kind of MPEG card if (cdcmdrs.CR2 != 0x022) return FALSE; return TRUE; } ////////////////////////////////////////////////////////////////////////////// int MPEGAuth() { int ret; cdcmd_struct cdcmd; cdcmd_struct cdcmdrs; u16 auth; // Clear hirq flags CDB_REG_HIRQ = ~(HIRQ_MPED); // Authenticate disc cdcmd.CR1 = 0xE000; cdcmd.CR2 = 0x0001; cdcmd.CR3 = 0x0000; cdcmd.CR4 = 0x0000; if ((ret = CDExecCommand(HIRQ_EFLS, &cdcmd, &cdcmdrs)) != LAPETUS_ERR_OK) return ret; // wait till operation is finished while (!(CDB_REG_HIRQ & HIRQ_MPED)) {} // Was Authentication successful? if (!IsMPEGAuth(&auth)) return -1; return LAPETUS_ERR_OK; } ////////////////////////////////////////////////////////////////////////////// int MPEGInit () { int ret; cdcmd_struct cdcmd; cdcmd_struct cdcmdrs; screensettings_struct settings; // Make sure MPEG card is authenticated if (!IsMPEGAuth()) MPEGAuth(); // Now Initialize MPEG card cdcmd.CR1 = 0x9300; cdcmd.CR2 = 0x0001; // might have to change this cdcmd.CR3 = 0x0000; cdcmd.CR4 = 0x0000; if ((ret = CDExecCommand(HIRQ_MPED, &cdcmd, &cdcmdrs)) != LAPETUS_ERR_OK) return ret; // Do a MPEG Set Mode here // Get MPEG stats here // Get MPEG Connection here // Enable the external audio through SCSP SoundExternalAudioEnable(7, 7); // Setup NBG1 as EXBG settings.isbitmap = TRUE; settings.bitmapsize = BG_BITMAP512x256; settings.transparentbit = 0; settings.color = BG_32786COLOR; settings.specialpriority = 0; settings.specialcolorcalc = 0; settings.extrapalettenum = 0; settings.mapoffset = 0; return VdpEXBGInit(&settings); } ////////////////////////////////////////////////////////////////////////////// int MpegPlay(file_struct *file) { // Setup CD filters here // Setup MPEG connections here // Start CD transfer here // Start MPEG decoding here return LAPETUS_ERR_OK; } ////////////////////////////////////////////////////////////////////////////// int MpegPause(file_struct *file) { return LAPETUS_ERR_OK; } ////////////////////////////////////////////////////////////////////////////// int MpegStop(file_struct *file) { return LAPETUS_ERR_OK; } ////////////////////////////////////////////////////////////////////////////// |
From: Theo B. <cyb...@us...> - 2008-01-10 21:09:53
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv18322 Modified Files: rotscr.c Log Message: -Added a few functions Index: rotscr.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/rotscr.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- rotscr.c 4 Jul 2007 02:32:43 -0000 1.2 +++ rotscr.c 10 Jan 2008 21:09:50 -0000 1.3 @@ -23,6 +23,18 @@ ////////////////////////////////////////////////////////////////////////////// +void VdpSetRotationTable(screensettings_struct *settings, int num, rottbl_struct *tbl) +{ + volatile u16 *outtbl=(volatile u16 *)(0x20000000 | settings->parameteraddr | (num * 0x80)); + volatile u16 *intbl=(volatile u16 *)tbl; + int i; + + for (i = 0; i < sizeof(rottbl_struct) / 2; i++) + outtbl[i] = intbl[i]; +} + +////////////////////////////////////////////////////////////////////////////// + void InitRotationTable(u32 addr) { volatile rottbl_struct *tbl=(volatile rottbl_struct *)(0x20000000 | addr); @@ -271,6 +283,16 @@ ////////////////////////////////////////////////////////////////////////////// +void VdpRBG0DeInit(void) +{ + vdp2settings.BGON.part.rbg0enab = 0; + + // Disable Screen + VDP2_REG_BGON = vdp2settings.BGON.all; +} + +////////////////////////////////////////////////////////////////////////////// + int VdpRBG1Init(screensettings_struct *settings) { // First make sure RBG0 is enabled @@ -388,3 +410,13 @@ } ////////////////////////////////////////////////////////////////////////////// + +void VdpRBG1DeInit(void) +{ + vdp2settings.BGON.part.rbg1enab = 0; + + // Disable Screen + VDP2_REG_BGON = vdp2settings.BGON.all; +} + +////////////////////////////////////////////////////////////////////////////// |
From: Theo B. <cyb...@us...> - 2008-01-10 21:09:18
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv18282 Modified Files: smpc.h Log Message: -A bit of a hack to get it working on Yabause(surprisingly, it still works on a real system) Index: smpc.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/smpc.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- smpc.h 28 Feb 2007 02:19:35 -0000 1.2 +++ smpc.h 10 Jan 2008 21:09:14 -0000 1.3 @@ -74,7 +74,7 @@ SMPC_REG_COMREG = cmd; // Wait till command is finished - while(SMPC_REG_SF & 0x1) {} +// while(SMPC_REG_SF & 0x1) {} } ////////////////////////////////////////////////////////////////////////////// |
From: Theo B. <cyb...@us...> - 2008-01-10 06:15:23
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv22415 Modified Files: dma.h Log Message: -Added copyright Index: dma.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/dma.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- dma.h 9 Jan 2008 05:03:44 -0000 1.1 +++ dma.h 10 Jan 2008 06:15:19 -0000 1.2 @@ -1,3 +1,22 @@ +/* Copyright 2007 Theo Berkau + + This file is part of Lapetus. + + Lapetus is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + Lapetus is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Lapetus; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + #ifndef DMA_H #define DMA_H |
From: Theo B. <cyb...@us...> - 2008-01-10 06:14:11
|
Update of /cvsroot/lapetus/lapetus/sys In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv21968/sys Log Message: Directory /cvsroot/lapetus/lapetus/sys added to the repository |
From: Theo B. <cyb...@us...> - 2008-01-09 22:09:58
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv19735 Modified Files: cdfs.c Log Message: -Can't remember what changed here. Oh well Index: cdfs.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/cdfs.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- cdfs.c 3 Mar 2007 05:23:07 -0000 1.2 +++ cdfs.c 9 Jan 2008 22:09:55 -0000 1.3 @@ -156,7 +156,7 @@ sectbuffered = 0; // Read in lba 16 - if ((ret = CDReadSector(dirtbl, 166, SECT_2048, 1)) != LAPETUS_ERR_OK) + if ((ret = CDReadSector(dirtbl, 166, SECT_2048, 2048)) != LAPETUS_ERR_OK) return ret; CopyDirRecord(dirtbl+0x9C, &dirrec); @@ -186,13 +186,35 @@ // read the directory table, and find the next subdirectory. Once we're // in the correct level, parse through the table and find the file. - if ((ret = CDReadSector(dirtbl, 150+rootlba, SECT_2048, 1)) != LAPETUS_ERR_OK) + if ((ret = CDReadSector(dirtbl, 150+rootlba, SECT_2048, 2048)) != LAPETUS_ERR_OK) return ret; lba = rootlba + 1; sectorsleft = rootsize - 1; workbuffer = dirtbl; + if (path == NULL) + { + int i; + // Get first file(I may remove this feature yet) + for (i = 0; i < 3; i++) + { + if (workbuffer[0] == 0) + return LAPETUS_ERR_FILENOTFOUND; + + CopyDirRecord(workbuffer, &dirrec); + workbuffer += dirrec.recordsize; + } + + // We're done. + file->lba = lba; + file->size = dirrec.size; + file->sectpos = 0; + file->pos = 0; + + return LAPETUS_ERR_OK; + } + while(!done) { if ((p = strchr(path, '\\')) == NULL) @@ -231,7 +253,7 @@ if (sectorsleft > 0) { // Read in new sector - if ((ret = CDReadSector(dirtbl, 150+lba, SECT_2048, 1)) != LAPETUS_ERR_OK) + if ((ret = CDReadSector(dirtbl, 150+lba, SECT_2048, 2048)) != LAPETUS_ERR_OK) return ret; lba++; sectorsleft--; @@ -247,7 +269,7 @@ break; // Ok, we've found the next directory table, time to read it - if ((ret = CDReadSector(dirtbl, 150+lba, SECT_2048, 1)) != LAPETUS_ERR_OK) + if ((ret = CDReadSector(dirtbl, 150+lba, SECT_2048, 2048)) != LAPETUS_ERR_OK) return ret; lba++; sectorsleft--; @@ -294,14 +316,13 @@ int CDFSRead(u8 *buffer, int size, int num, file_struct *file) { int ret; - int sectreadsize=(size * num) / 2048; // Only sector-aligned transfers supported for now - if ((size * num) % 2048 == 0 && file->pos == 0) + if (file->pos == 0) { // Straight sectors reads. Nice and fast - if ((ret = CDReadSector(buffer, 150+file->lba+file->sectpos, SECT_2048, sectreadsize)) == LAPETUS_ERR_OK) - file->sectpos += sectreadsize; + if ((ret = CDReadSector(buffer, 150+file->lba+file->sectpos, SECT_2048, size * num)) == LAPETUS_ERR_OK) + file->sectpos += (size * num); return ret; } else |
From: Theo B. <cyb...@us...> - 2008-01-09 05:56:03
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv25747 Modified Files: vdp1.c vdpinit.c Log Message: -Fixed a couple of bugs, etc. Index: vdp1.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/vdp1.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- vdp1.c 7 Jul 2007 03:37:41 -0000 1.2 +++ vdp1.c 9 Jan 2008 05:55:59 -0000 1.3 @@ -181,7 +181,7 @@ { volatile vdp1cmd_struct *tbl=(volatile vdp1cmd_struct *)(VDP1_RAM+(commandnum * 0x20)); - tbl->CMDCTRL = ((sprite->attr >> 12) & 0x7FF0) | 0x0005; + tbl->CMDCTRL = ((sprite->attr >> 12) & 0x7FF0) | 0x0006; tbl->CMDLINK = sprite->linkaddr / 8; tbl->CMDPMOD.all = (u16)sprite->attr | 0xC0; tbl->CMDCOLR = sprite->bank; Index: vdpinit.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/vdpinit.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- vdpinit.c 7 Jul 2007 03:37:41 -0000 1.5 +++ vdpinit.c 9 Jan 2008 05:55:59 -0000 1.6 @@ -196,6 +196,7 @@ case SCREEN_RBG0: // RBG0 { vdp2settings.PRIR.all = priority; + VDP2_REG_PRIR = vdp2settings.PRIR.all; break; } default: break; @@ -255,6 +256,8 @@ void VdpEnableColorOffset(u16 screen, int select) { // Adjust select first + screen = 1 << screen; + if (select == 0) vdp2settings.CLOFSL &= ~screen; else @@ -277,3 +280,15 @@ } ////////////////////////////////////////////////////////////////////////////// + +void VdpEnableLineWindow(int screennum, int windownum, u16 mode, u32 linetbladdr) +{ +} + +////////////////////////////////////////////////////////////////////////////// + +void VdpDisableLineWindow(void) +{ +} + +////////////////////////////////////////////////////////////////////////////// |
From: Theo B. <cyb...@us...> - 2008-01-09 05:18:00
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv10817 Modified Files: vdp.h Log Message: -Added some function declares Index: vdp.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/vdp.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- vdp.h 7 Jul 2007 03:37:41 -0000 1.7 +++ vdp.h 9 Jan 2008 05:17:54 -0000 1.8 @@ -763,7 +763,8 @@ SCREEN_NBG3 = 3, SCREEN_RBG0 = 4, SCREEN_RBG1 = 5, - SCREEN_EXBG = 6 + SCREEN_EXBG = 6, + SCREEN_VDP1 = 7 }; enum BGSIZE @@ -926,12 +927,19 @@ void VdpInit(int res); void VdpSetPriority(int screen, u8 priority); int VdpNBG0Init(screensettings_struct *settings); +void VdpNBG0DeInit(void); int VdpNBG1Init(screensettings_struct *settings); +void VdpNBG1DeInit(void); int VdpNBG2Init(screensettings_struct *settings); +void VdpNBG2DeInit(void); int VdpNBG3Init(screensettings_struct *settings); +void VdpNBG3DeInit(void); int VdpRBG0Init(screensettings_struct *settings); +void VdpRBG0DeInit(void); int VdpRBG1Init(screensettings_struct *settings); +void VdpRBG1DeInit(void); int VdpEXBGInit(screensettings_struct *settings); +void VdpEXBGDeInit(void); void VdpVsync(void); void VdpDispOn(void); void VdpDispOff(void); @@ -939,6 +947,13 @@ void VdpEnableColorOffset(u16 screen, int select); void VdpDisableColorOffset(u16 screen); +// Window functions +void VdpEnableLineWindow(int screennum, int windownum, u16 mode, u32 linetbladdr); +void VdpDisableLineWindow(void); + +// Rotation Screen specific +void VdpSetRotationTable(screensettings_struct *settings, int num, rottbl_struct *tbl); + // Palette related int VdpSetPalette(int type, void *palette, int size); int VdpSetDefaultPalette(void); |
From: Theo B. <cyb...@us...> - 2008-01-09 05:16:21
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv10364 Modified Files: text.c text.h Log Message: -Added a clear screen function Index: text.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/text.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- text.h 3 Mar 2007 03:32:55 -0000 1.1 +++ text.h 9 Jan 2008 05:16:16 -0000 1.2 @@ -22,5 +22,6 @@ void VdpPrintText(font_struct * font, int x, int y, int color, const char *text); void VdpPrintf(font_struct * font, int x, int y, int color, char *format, ...); +void VdpClearScreen(font_struct *font); #endif Index: text.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/text.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- text.c 3 Mar 2007 03:32:55 -0000 1.3 +++ text.c 9 Jan 2008 05:16:16 -0000 1.4 @@ -52,3 +52,28 @@ ////////////////////////////////////////////////////////////////////////////// +void VdpClearScreen(font_struct *font) +{ + int i; + + if (font->screen == SCREEN_VDP1) + { + VdpStartDrawList(); + VdpEndDrawList(); + } + else + { + // Figure out whether we're dealing with bitmap or tiled(fix me) +// if (bitmap) + { + for (i = 0; i < (512 * 256 / 4); i++) + ((u32 *)font->out)[i] = 0; + } +// else +// { +// } + } +} + +////////////////////////////////////////////////////////////////////////////// + |
From: Theo B. <cyb...@us...> - 2008-01-09 05:04:28
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5652 Modified Files: cd.c cd.h Log Message: -Moved sound functions and other fixes Index: cd.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/cd.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- cd.c 3 Mar 2007 03:53:44 -0000 1.2 +++ cd.c 9 Jan 2008 05:04:21 -0000 1.3 @@ -436,6 +436,50 @@ ////////////////////////////////////////////////////////////////////////////// +int CDTransferDataBytes(u32 numbytes, u32 *buffer) +{ + u32 i; + int ret; + int numsectors=numbytes / sectorsizetbl[cdsectorsize]; + + if (numbytes % sectorsizetbl[cdsectorsize]) + numsectors++; + + // Setup a transfer from cd buffer to wram, then delete data + // from cd buffer + if ((ret = CDGetThenDeleteSectorData(0, 0, numsectors)) != 0) + return ret; + + // wait a bit + for (i = 0; i < 20000; i++) {} + + // Do transfer + for (i = 0; i < (numbytes >> 2); i++) + { + buffer[0] = CDB_REG_DATATRNS; // this can also be done in word units as well + buffer++; + } + + // Get the remainder + if (numbytes % 4) + { + u32 data; + u8 *datapointer=&data; + + data = CDB_REG_DATATRNS; + + for (i = 0; i < (numbytes % 4); i++) + ((u8 *)buffer)[i] = datapointer[i]; + } + + if ((ret = CDEndTransfer()) != 0) + return ret; + + return LAPETUS_ERR_OK; +} + +////////////////////////////////////////////////////////////////////////////// + int CDInit() { int ret; @@ -648,11 +692,15 @@ ////////////////////////////////////////////////////////////////////////////// -int CDReadSector(void *buffer, u32 FAD, int sectorsize, u32 numsectors) +int CDReadSector(void *buffer, u32 FAD, int sectorsize, u32 numbytes) { int ret; int done=0; - u32 sectorsread=0; + // Figure out how many sectors we actually have to read + int numsectors=numbytes / sectorsizetbl[cdsectorsize]; + + if (numbytes % sectorsizetbl[cdsectorsize] != 0) + numsectors++; if ((ret = CDSetSectorSize(sectorsize)) != 0) return ret; @@ -679,19 +727,25 @@ while (!done) { u32 sectorstoread=0; + u32 bytestoread; // Wait until there's data ready while ((sectorstoread = CDIsDataReady(0)) == 0) {} + if ((sectorstoread * sectorsizetbl[cdsectorsize]) > numbytes) + bytestoread = numbytes; + else + bytestoread = sectorstoread * sectorsizetbl[cdsectorsize]; + // Setup a transfer from cd buffer to wram, then delete data // from cd buffer - if ((ret = CDTransferData(sectorstoread, buffer)) != 0) + if ((ret = CDTransferDataBytes(bytestoread, buffer)) != 0) return ret; - sectorsread += sectorstoread; - buffer += sectorsizetbl[cdsectorsize]; + numbytes -= bytestoread; + buffer += bytestoread; - if (sectorsread >= numsectors) + if (numbytes == 0) done = 1; } @@ -700,56 +754,6 @@ ////////////////////////////////////////////////////////////////////////////// -// This could probably be moved to sound.c -void SoundExternalAudioEnable(u8 vol_l, u8 vol_r) -{ - volatile u16 *slot_ptr; - - vol_l &= 0x7; - vol_r &= 0x7; - - // Setup SCSP Slot 16 and Slot 17 for playing - slot_ptr = (volatile u16 *)(0x25B00000 + (0x20 * 16)); - slot_ptr[0] = 0x1000; - slot_ptr[1] = 0x0000; - slot_ptr[2] = 0x0000; - slot_ptr[3] = 0x0000; - slot_ptr[4] = 0x0000; - slot_ptr[5] = 0x0000; - slot_ptr[6] = 0x00FF; - slot_ptr[7] = 0x0000; - slot_ptr[8] = 0x0000; - slot_ptr[9] = 0x0000; - slot_ptr[10] = 0x0000; - slot_ptr[11] = 0x001F | (vol_l << 5); - slot_ptr[12] = 0x0000; - slot_ptr[13] = 0x0000; - slot_ptr[14] = 0x0000; - slot_ptr[15] = 0x0000; - - slot_ptr = (volatile u16 *)(0x25B00000 + (0x20 * 17)); - slot_ptr[0] = 0x1000; - slot_ptr[1] = 0x0000; - slot_ptr[2] = 0x0000; - slot_ptr[3] = 0x0000; - slot_ptr[4] = 0x0000; - slot_ptr[5] = 0x0000; - slot_ptr[6] = 0x00FF; - slot_ptr[7] = 0x0000; - slot_ptr[8] = 0x0000; - slot_ptr[9] = 0x0000; - slot_ptr[10] = 0x0000; - slot_ptr[11] = 0x000F | (vol_r << 5); - slot_ptr[12] = 0x0000; - slot_ptr[13] = 0x0000; - slot_ptr[14] = 0x0000; - slot_ptr[15] = 0x0000; - - *((volatile u16 *)(0x25B00400)) = 0x020F; -} - -////////////////////////////////////////////////////////////////////////////// - int PlayCDAudio(u8 audiotrack, u8 repeat, u8 vol_l, u8 vol_r) { cdcmd_struct cdcmd; Index: cd.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/cd.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- cd.h 3 Mar 2007 03:54:13 -0000 1.2 +++ cd.h 9 Jan 2008 05:04:21 -0000 1.3 @@ -94,7 +94,7 @@ int CDStopDrive(); int CDStartDrive(); int IsCDPresent(); -int CDReadSector(void *buffer, u32 FAD, int sectorsize, u32 numsectors); +int CDReadSector(void *buffer, u32 FAD, int sectorsize, u32 numbytes); int PlayCDAudio(u8 audiotrack, u8 repeat, u8 vol_l, u8 vol_r); int StopCDAudio(void); #endif |
From: Theo B. <cyb...@us...> - 2008-01-09 05:03:48
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5263 Modified Files: lapetus.c lapetus.h Added Files: dma.h sound.c sound.h Log Message: -Moved sound functions and other fixes Index: lapetus.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/lapetus.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- lapetus.c 28 Feb 2007 02:06:31 -0000 1.1 +++ lapetus.c 9 Jan 2008 05:03:44 -0000 1.2 @@ -46,6 +46,9 @@ DebugInit(); #endif + // Unpause and stop dsp + SCUREG_PPAF = 0x4000000; + if (InterruptGetLevelMask() > 0x7) InterruptSetLevelMask(0x7); } Index: lapetus.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/lapetus.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- lapetus.h 3 Mar 2007 05:19:48 -0000 1.8 +++ lapetus.h 9 Jan 2008 05:03:44 -0000 1.9 @@ -26,12 +26,14 @@ #include "cd.h" #include "cdfs.h" #include "commlink.h" +#include "dma.h" #include "dsp.h" #include "int.h" #include "mpeg.h" #include "netlink.h" #include "sci.h" #include "smpc.h" +#include "sound.h" #include "text.h" #include "timer.h" #include "vdp.h" --- NEW FILE: sound.h --- /* Copyright 2006-2007 Theo Berkau This file is part of Lapetus. Lapetus is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Lapetus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Lapetus; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef SOUND_H #define SOUND_H #define SCSP_REG_MVOL (*(volatile u8 *)0x25B00401) #define SCSP_REG_MIBUF (*(volatile u8 *)0x25B00405) #define SCSP_REG_SCIEB (*(volatile u16 *)0x25B0041E) #define SCSP_REG_SCIPD (*(volatile u16 *)0x25B00420) #define SCSP_REG_SCIRE (*(volatile u16 *)0x25B00422) #define SCSP_REG_SCILV0 (*(volatile u8 *)0x25B00424) #define SCSP_REG_SCILV1 (*(volatile u8 *)0x25B00426) #define SCSP_REG_SCILV2 (*(volatile u8 *)0x25B00428) #define SoundKeyOffAll() (*(volatile u8 *)(0x25B00000) = 0x10) void SoundInit(void); void SoundLoadDriver(u8 *data, u32 size); void SoundExternalAudioEnable(u8 vol_l, u8 vol_r); #endif --- NEW FILE: dma.h --- #ifndef DMA_H #define DMA_H int ScuDMAInit(void); int ScuDMAStart(int chan, void *src, void *dst, u32 size, u32 add, u32 mode); BOOL IsScuDMARunning(int chan); void ScuDMAStopAll(void); int Sh2DMAInit(void); int Sh2DMAStart(int chan, void *src, void *dst, u32 size, u32 mode); BOOL IsSh2DMARunning(int chan); void Sh2DMAStopAll(void); #endif --- NEW FILE: sound.c --- /* Copyright 2006-2007 Theo Berkau This file is part of Lapetus. Lapetus is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Lapetus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Lapetus; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "lapetus.h" ////////////////////////////////////////////////////////////////////////////// void SoundInit(void) { int i; // Turn off Sound CPU SmpcIssueCommand(0x07); // Make sure SCSP is set to 512k mode *(volatile u8 *)(0x25B00400) = 0x02; // Clear Sound Ram for (i = 0; i < 0x80000; i+=4) *(volatile u32 *)(0x25A00000 + i) = 0x00000000; // Clear MIDI input i = SCSP_REG_MIBUF; i = SCSP_REG_MIBUF; i = SCSP_REG_MIBUF; i = SCSP_REG_MIBUF; // Clear DSP micro program for (i = 0; i < 0x400; i+=4) *(volatile u16 *)(0x25B00800 + i) = 0; // Clear DSP memory address for (i = 0; i < 0x80; i+=4) *(volatile u16 *)(0x25B00780 + i) = 0; // Clear DSP coefficient table for (i = 0; i < 0x80; i+=4) *(volatile u16 *)(0x25B00700 + i) = 0; // Clear DSP temporary work area for (i = 0; i < 0x200; i+=4) *(volatile u16 *)(0x25B00C00 + i) = 0; // Clear all slots for (i = 0; i < 0x400; i+=4) *(volatile u16 *)(0x25B00000 + i) = 0; // Key off all slots SoundKeyOffAll(); // Set TL to max for all slots for (i = 0; i < 32; i++) *(volatile u8 *)(0x25B00000 + (i * 32) + 0x0D) = 0xFF; // Set Master Volume to max SCSP_REG_MVOL = 0xF; } ////////////////////////////////////////////////////////////////////////////// void SoundLoadDriver(u8 *data, u32 size) { int i; // Turn off Sound CPU SmpcIssueCommand(0x07); // Make sure SCSP is set to 512k mode *(volatile u8 *)(0x25B00400) = 0x02; // Clear Sound Ram for (i = 0; i < 0x80000; i+=4) *(volatile u32 *)(0x25A00000 + i) = 0x00000000; // Copy driver over for (i = 0; i < size; i++) *(volatile u8 *)(0x25A00000 + i) = data[i]; // Turn on Sound CPU again SmpcIssueCommand(0x06); } ////////////////////////////////////////////////////////////////////////////// void SoundExternalAudioEnable(u8 vol_l, u8 vol_r) { volatile u16 *slot_ptr; vol_l &= 0x7; vol_r &= 0x7; // Setup SCSP Slot 16 and Slot 17 for playing slot_ptr = (volatile u16 *)(0x25B00000 + (0x20 * 16)); slot_ptr[0] = 0x1000; slot_ptr[1] = 0x0000; slot_ptr[2] = 0x0000; slot_ptr[3] = 0x0000; slot_ptr[4] = 0x0000; slot_ptr[5] = 0x0000; slot_ptr[6] = 0x00FF; slot_ptr[7] = 0x0000; slot_ptr[8] = 0x0000; slot_ptr[9] = 0x0000; slot_ptr[10] = 0x0000; slot_ptr[11] = 0x001F | (vol_l << 5); slot_ptr[12] = 0x0000; slot_ptr[13] = 0x0000; slot_ptr[14] = 0x0000; slot_ptr[15] = 0x0000; slot_ptr = (volatile u16 *)(0x25B00000 + (0x20 * 17)); slot_ptr[0] = 0x1000; slot_ptr[1] = 0x0000; slot_ptr[2] = 0x0000; slot_ptr[3] = 0x0000; slot_ptr[4] = 0x0000; slot_ptr[5] = 0x0000; slot_ptr[6] = 0x00FF; slot_ptr[7] = 0x0000; slot_ptr[8] = 0x0000; slot_ptr[9] = 0x0000; slot_ptr[10] = 0x0000; slot_ptr[11] = 0x000F | (vol_r << 5); slot_ptr[12] = 0x0000; slot_ptr[13] = 0x0000; slot_ptr[14] = 0x0000; slot_ptr[15] = 0x0000; *((volatile u16 *)(0x25B00400)) = 0x020F; } ////////////////////////////////////////////////////////////////////////////// |
From: Theo B. <cyb...@us...> - 2008-01-09 04:45:57
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30219 Modified Files: font.c font.h Added Files: font8x16.c font8x8.c Log Message: -Some font improvements --- NEW FILE: font8x8.c --- #include <lapetus.h> u8 font8x8[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x81,0xA5,0x81,0xBD,0x99, 0x81,0x7E,0x7E,0xFF,0xDB,0xFF,0xC3,0xE7,0xFF,0x7E,0x6C,0xFE,0xFE,0xFE, 0x7C,0x38,0x10,0x00,0x10,0x38,0x7C,0xFE,0x7C,0x38,0x10,0x00,0x38,0x7C, 0x38,0xFE,0xFE,0x7C,0x38,0x7C,0x10,0x10,0x38,0x7C,0xFE,0x7C,0x38,0x7C, 0x00,0x00,0x18,0x3C,0x3C,0x18,0x00,0x00,0xFF,0xFF,0xE7,0xC3,0xC3,0xE7, 0xFF,0xFF,0x00,0x3C,0x66,0x42,0x42,0x66,0x3C,0x00,0xFF,0xC3,0x99,0xBD, 0xBD,0x99,0xC3,0xFF,0x0F,0x07,0x0F,0x7D,0xCC,0xCC,0xCC,0x78,0x3C,0x66, 0x66,0x66,0x3C,0x18,0x7E,0x18,0x3F,0x33,0x3F,0x30,0x30,0x70,0xF0,0xE0, 0x7F,0x63,0x7F,0x63,0x63,0x67,0xE6,0xC0,0x99,0x5A,0x3C,0xE7,0xE7,0x3C, 0x5A,0x99,0x80,0xE0,0xF8,0xFE,0xF8,0xE0,0x80,0x00,0x02,0x0E,0x3E,0xFE, 0x3E,0x0E,0x02,0x00,0x18,0x3C,0x7E,0x18,0x18,0x7E,0x3C,0x18,0x66,0x66, 0x66,0x66,0x66,0x00,0x66,0x00,0x7F,0xDB,0xDB,0x7B,0x1B,0x1B,0x1B,0x00, 0x3E,0x63,0x38,0x6C,0x6C,0x38,0xCC,0x78,0x00,0x00,0x00,0x00,0x7E,0x7E, 0x7E,0x00,0x18,0x3C,0x7E,0x18,0x7E,0x3C,0x18,0xFF,0x18,0x3C,0x7E,0x18, 0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x18, 0x0C,0xFE,0x0C,0x18,0x00,0x00,0x00,0x30,0x60,0xFE,0x60,0x30,0x00,0x00, 0x00,0x00,0xC0,0xC0,0xC0,0xFE,0x00,0x00,0x00,0x24,0x66,0xFF,0x66,0x24, 0x00,0x00,0x00,0x18,0x3C,0x7E,0xFF,0xFF,0x00,0x00,0x00,0xFF,0xFF,0x7E, 0x3C,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x78, 0x78,0x30,0x30,0x00,0x30,0x00,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00, 0x6C,0x6C,0xFE,0x6C,0xFE,0x6C,0x6C,0x00,0x30,0x7C,0xC0,0x78,0x0C,0xF8, 0x30,0x00,0x00,0xC6,0xCC,0x18,0x30,0x66,0xC6,0x00,0x38,0x6C,0x38,0x76, 0xDC,0xCC,0x76,0x00,0x60,0x60,0xC0,0x00,0x00,0x00,0x00,0x00,0x18,0x30, 0x60,0x60,0x60,0x30,0x18,0x00,0x60,0x30,0x18,0x18,0x18,0x30,0x60,0x00, 0x00,0x66,0x3C,0xFF,0x3C,0x66,0x00,0x00,0x00,0x30,0x30,0xFC,0x30,0x30, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x60,0x00,0x00,0x00,0xFC, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x06,0x0C, 0x18,0x30,0x60,0xC0,0x80,0x00,0x7C,0xC6,0xCE,0xDE,0xF6,0xE6,0x7C,0x00, 0x30,0x70,0x30,0x30,0x30,0x30,0xFC,0x00,0x78,0xCC,0x0C,0x38,0x60,0xCC, 0xFC,0x00,0x78,0xCC,0x0C,0x38,0x0C,0xCC,0x78,0x00,0x1C,0x3C,0x6C,0xCC, 0xFE,0x0C,0x1E,0x00,0xFC,0xC0,0xF8,0x0C,0x0C,0xCC,0x78,0x00,0x38,0x60, 0xC0,0xF8,0xCC,0xCC,0x78,0x00,0xFC,0xCC,0x0C,0x18,0x30,0x30,0x30,0x00, 0x78,0xCC,0xCC,0x78,0xCC,0xCC,0x78,0x00,0x78,0xCC,0xCC,0x7C,0x0C,0x18, 0x70,0x00,0x00,0x30,0x30,0x00,0x00,0x30,0x30,0x00,0x00,0x30,0x30,0x00, 0x00,0x30,0x30,0x60,0x18,0x30,0x60,0xC0,0x60,0x30,0x18,0x00,0x00,0x00, 0xFC,0x00,0x00,0xFC,0x00,0x00,0x60,0x30,0x18,0x0C,0x18,0x30,0x60,0x00, 0x78,0xCC,0x0C,0x18,0x30,0x00,0x30,0x00,0x7C,0xC6,0xDE,0xDE,0xDE,0xC0, 0x78,0x00,0x30,0x78,0xCC,0xCC,0xFC,0xCC,0xCC,0x00,0xFC,0x66,0x66,0x7C, 0x66,0x66,0xFC,0x00,0x3C,0x66,0xC0,0xC0,0xC0,0x66,0x3C,0x00,0xF8,0x6C, 0x66,0x66,0x66,0x6C,0xF8,0x00,0xFE,0x62,0x68,0x78,0x68,0x62,0xFE,0x00, 0xFE,0x62,0x68,0x78,0x68,0x60,0xF0,0x00,0x3C,0x66,0xC0,0xC0,0xCE,0x66, 0x3E,0x00,0xCC,0xCC,0xCC,0xFC,0xCC,0xCC,0xCC,0x00,0x78,0x30,0x30,0x30, 0x30,0x30,0x78,0x00,0x1E,0x0C,0x0C,0x0C,0xCC,0xCC,0x78,0x00,0xE6,0x66, 0x6C,0x78,0x6C,0x66,0xE6,0x00,0xF0,0x60,0x60,0x60,0x62,0x66,0xFE,0x00, 0xC6,0xEE,0xFE,0xFE,0xD6,0xC6,0xC6,0x00,0xC6,0xE6,0xF6,0xDE,0xCE,0xC6, 0xC6,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0x6C,0x38,0x00,0xFC,0x66,0x66,0x7C, 0x60,0x60,0xF0,0x00,0x78,0xCC,0xCC,0xCC,0xDC,0x78,0x1C,0x00,0xFC,0x66, 0x66,0x7C,0x6C,0x66,0xE6,0x00,0x78,0xCC,0xE0,0x70,0x1C,0xCC,0x78,0x00, 0xFC,0xB4,0x30,0x30,0x30,0x30,0x78,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC, 0xFC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0x78,0x30,0x00,0xC6,0xC6,0xC6,0xD6, 0xFE,0xEE,0xC6,0x00,0xC6,0xC6,0x6C,0x38,0x38,0x6C,0xC6,0x00,0xCC,0xCC, 0xCC,0x78,0x30,0x30,0x78,0x00,0xFE,0xC6,0x8C,0x18,0x32,0x66,0xFE,0x00, 0x78,0x60,0x60,0x60,0x60,0x60,0x78,0x00,0xC0,0x60,0x30,0x18,0x0C,0x06, 0x02,0x00,0x78,0x18,0x18,0x18,0x18,0x18,0x78,0x00,0x10,0x38,0x6C,0xC6, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x30,0x30, 0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x0C,0x7C,0xCC,0x76,0x00, 0xE0,0x60,0x60,0x7C,0x66,0x66,0xDC,0x00,0x00,0x00,0x78,0xCC,0xC0,0xCC, 0x78,0x00,0x1C,0x0C,0x0C,0x7C,0xCC,0xCC,0x76,0x00,0x00,0x00,0x78,0xCC, 0xFC,0xC0,0x78,0x00,0x38,0x6C,0x60,0xF0,0x60,0x60,0xF0,0x00,0x00,0x00, 0x76,0xCC,0xCC,0x7C,0x0C,0xF8,0xE0,0x60,0x6C,0x76,0x66,0x66,0xE6,0x00, 0x30,0x00,0x70,0x30,0x30,0x30,0x78,0x00,0x0C,0x00,0x0C,0x0C,0x0C,0xCC, 0xCC,0x78,0xE0,0x60,0x66,0x6C,0x78,0x6C,0xE6,0x00,0x70,0x30,0x30,0x30, 0x30,0x30,0x78,0x00,0x00,0x00,0xCC,0xFE,0xFE,0xD6,0xC6,0x00,0x00,0x00, 0xF8,0xCC,0xCC,0xCC,0xCC,0x00,0x00,0x00,0x78,0xCC,0xCC,0xCC,0x78,0x00, 0x00,0x00,0xDC,0x66,0x66,0x7C,0x60,0xF0,0x00,0x00,0x76,0xCC,0xCC,0x7C, 0x0C,0x1E,0x00,0x00,0xDC,0x76,0x66,0x60,0xF0,0x00,0x00,0x00,0x7C,0xC0, 0x78,0x0C,0xF8,0x00,0x10,0x30,0x7C,0x30,0x30,0x34,0x18,0x00,0x00,0x00, 0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0xCC,0xCC,0xCC,0x78,0x30,0x00, 0x00,0x00,0xC6,0xD6,0xFE,0xFE,0x6C,0x00,0x00,0x00,0xC6,0x6C,0x38,0x6C, 0xC6,0x00,0x00,0x00,0xCC,0xCC,0xCC,0x7C,0x0C,0xF8,0x00,0x00,0xFC,0x98, 0x30,0x64,0xFC,0x00,0x1C,0x30,0x30,0xE0,0x30,0x30,0x1C,0x00,0x18,0x18, 0x18,0x00,0x18,0x18,0x18,0x00,0xE0,0x30,0x30,0x1C,0x30,0x30,0xE0,0x00, 0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6, 0xFE,0x00,0x78,0xCC,0xC0,0xCC,0x78,0x18,0x0C,0x78,0x00,0xCC,0x00,0xCC, 0xCC,0xCC,0x7E,0x00,0x1C,0x00,0x78,0xCC,0xFC,0xC0,0x78,0x00,0x7E,0xC3, 0x3C,0x06,0x3E,0x66,0x3F,0x00,0xCC,0x00,0x78,0x0C,0x7C,0xCC,0x7E,0x00, 0xE0,0x00,0x78,0x0C,0x7C,0xCC,0x7E,0x00,0x30,0x30,0x78,0x0C,0x7C,0xCC, 0x7E,0x00,0x00,0x00,0x78,0xC0,0xC0,0x78,0x0C,0x38,0x7E,0xC3,0x3C,0x66, 0x7E,0x60,0x3C,0x00,0xCC,0x00,0x78,0xCC,0xFC,0xC0,0x78,0x00,0xE0,0x00, 0x78,0xCC,0xFC,0xC0,0x78,0x00,0xCC,0x00,0x70,0x30,0x30,0x30,0x78,0x00, 0x7C,0xC6,0x38,0x18,0x18,0x18,0x3C,0x00,0xE0,0x00,0x70,0x30,0x30,0x30, 0x78,0x00,0xC6,0x38,0x6C,0xC6,0xFE,0xC6,0xC6,0x00,0x30,0x30,0x00,0x78, 0xCC,0xFC,0xCC,0x00,0x1C,0x00,0xFC,0x60,0x78,0x60,0xFC,0x00,0x00,0x00, 0x7F,0x0C,0x7F,0xCC,0x7F,0x00,0x3E,0x6C,0xCC,0xFE,0xCC,0xCC,0xCE,0x00, 0x78,0xCC,0x00,0x78,0xCC,0xCC,0x78,0x00,0x00,0xCC,0x00,0x78,0xCC,0xCC, 0x78,0x00,0x00,0xE0,0x00,0x78,0xCC,0xCC,0x78,0x00,0x78,0xCC,0x00,0xCC, 0xCC,0xCC,0x7E,0x00,0x00,0xE0,0x00,0xCC,0xCC,0xCC,0x7E,0x00,0x00,0xCC, 0x00,0xCC,0xCC,0x7C,0x0C,0xF8,0xC3,0x18,0x3C,0x66,0x66,0x3C,0x18,0x00, 0xCC,0x00,0xCC,0xCC,0xCC,0xCC,0x78,0x00,0x18,0x18,0x7E,0xC0,0xC0,0x7E, 0x18,0x18,0x38,0x6C,0x64,0xF0,0x60,0xE6,0xFC,0x00,0xCC,0xCC,0x78,0xFC, 0x30,0xFC,0x30,0x30,0xF8,0xCC,0xCC,0xFA,0xC6,0xCF,0xC6,0xC7,0x0E,0x1B, 0x18,0x3C,0x18,0x18,0xD8,0x70,0x1C,0x00,0x78,0x0C,0x7C,0xCC,0x7E,0x00, 0x38,0x00,0x70,0x30,0x30,0x30,0x78,0x00,0x00,0x1C,0x00,0x78,0xCC,0xCC, 0x78,0x00,0x00,0x1C,0x00,0xCC,0xCC,0xCC,0x7E,0x00,0x00,0xF8,0x00,0xF8, 0xCC,0xCC,0xCC,0x00,0xFC,0x00,0xCC,0xEC,0xFC,0xDC,0xCC,0x00,0x3C,0x6C, 0x6C,0x3E,0x00,0x7E,0x00,0x00,0x38,0x6C,0x6C,0x38,0x00,0x7C,0x00,0x00, 0x30,0x00,0x30,0x60,0xC0,0xCC,0x78,0x00,0x00,0x00,0x00,0xFC,0xC0,0xC0, 0x00,0x00,0x00,0x00,0x00,0xFC,0x0C,0x0C,0x00,0x00,0xC3,0xC6,0xCC,0xDE, 0x33,0x66,0xCC,0x0F,0xC3,0xC6,0xCC,0xDB,0x37,0x6F,0xCF,0x03,0x18,0x18, 0x00,0x18,0x18,0x18,0x18,0x00,0x00,0x33,0x66,0xCC,0x66,0x33,0x00,0x00, 0x00,0xCC,0x66,0x33,0x66,0xCC,0x00,0x00,0x22,0x88,0x22,0x88,0x22,0x88, 0x22,0x88,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0xDB,0x77,0xDB,0xEE, 0xDB,0x77,0xDB,0xEE,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x18,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x18,0x18,0x18, 0x36,0x36,0x36,0x36,0xF6,0x36,0x36,0x36,0x00,0x00,0x00,0x00,0xFE,0x36, 0x36,0x36,0x00,0x00,0xF8,0x18,0xF8,0x18,0x18,0x18,0x36,0x36,0xF6,0x06, 0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x00,0x00, 0xFE,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xFE,0x00,0x00,0x00, 0x36,0x36,0x36,0x36,0xFE,0x00,0x00,0x00,0x18,0x18,0xF8,0x18,0xF8,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x1F,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0xFF,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x18,0x18, 0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0xFF,0x18, 0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x18,0x18,0x18,0x36,0x36,0x36,0x36, 0x37,0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x3F,0x00,0x00,0x00,0x00,0x00, 0x3F,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xFF,0x00,0x00,0x00, 0x00,0x00,0xFF,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x37,0x36, 0x36,0x36,0x00,0x00,0xFF,0x00,0xFF,0x00,0x00,0x00,0x36,0x36,0xF7,0x00, 0xF7,0x36,0x36,0x36,0x18,0x18,0xFF,0x00,0xFF,0x00,0x00,0x00,0x36,0x36, 0x36,0x36,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x18,0x18,0x18, 0x00,0x00,0x00,0x00,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x3F,0x00, 0x00,0x00,0x18,0x18,0x1F,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x1F,0x18, 0x1F,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x3F,0x36,0x36,0x36,0x36,0x36, 0x36,0x36,0xFF,0x36,0x36,0x36,0x18,0x18,0xFF,0x18,0xFF,0x18,0x18,0x18, 0x18,0x18,0x18,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x18, 0x18,0x18,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00, 0xFF,0xFF,0xFF,0xFF,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0x0F,0x0F, 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00, 0x00,0x00,0x76,0xDC,0xC8,0xDC,0x76,0x00,0x00,0x78,0xCC,0xF8,0xCC,0xF8, 0xC0,0xC0,0x00,0xFC,0xCC,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0xFE,0x6C,0x6C, 0x6C,0x6C,0x6C,0x00,0xFC,0xCC,0x60,0x30,0x60,0xCC,0xFC,0x00,0x00,0x00, 0x7E,0xD8,0xD8,0xD8,0x70,0x00,0x00,0x66,0x66,0x66,0x66,0x7C,0x60,0xC0, 0x00,0x76,0xDC,0x18,0x18,0x18,0x18,0x00,0xFC,0x30,0x78,0xCC,0xCC,0x78, 0x30,0xFC,0x38,0x6C,0xC6,0xFE,0xC6,0x6C,0x38,0x00,0x38,0x6C,0xC6,0xC6, 0x6C,0x6C,0xEE,0x00,0x1C,0x30,0x18,0x7C,0xCC,0xCC,0x78,0x00,0x00,0x00, 0x7E,0xDB,0xDB,0x7E,0x00,0x00,0x06,0x0C,0x7E,0xDB,0xDB,0x7E,0x60,0xC0, 0x38,0x60,0xC0,0xF8,0xC0,0x60,0x38,0x00,0x78,0xCC,0xCC,0xCC,0xCC,0xCC, 0xCC,0x00,0x00,0xFC,0x00,0xFC,0x00,0xFC,0x00,0x00,0x30,0x30,0xFC,0x30, 0x30,0x00,0xFC,0x00,0x60,0x30,0x18,0x30,0x60,0x00,0xFC,0x00,0x18,0x30, 0x60,0x30,0x18,0x00,0xFC,0x00,0x0E,0x1B,0x1B,0x18,0x18,0x18,0x18,0x18, 0x18,0x18,0x18,0x18,0x18,0xD8,0xD8,0x70,0x30,0x30,0x00,0xFC,0x00,0x30, 0x30,0x00,0x00,0x76,0xDC,0x00,0x76,0xDC,0x00,0x00,0x38,0x6C,0x6C,0x38, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x18,0x00,0x00,0x00,0x0F,0x0C,0x0C,0x0C,0xEC,0x6C,0x3C,0x1C, 0x78,0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x70,0x18,0x30,0x60,0x78,0x00, 0x00,0x00,0x00,0x00,0x3C,0x3C,0x3C,0x3C,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00 }; u32 font8x8size=sizeof(font8x8); Index: font.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/font.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- font.h 3 Mar 2007 03:26:20 -0000 1.1 +++ font.h 9 Jan 2008 04:45:54 -0000 1.2 @@ -19,15 +19,25 @@ #ifndef FONT_H #define FONT_H -typedef struct +struct font_s { u8 width, height, bpp; u8 *data; u32 charsize; int lineinc; u8 *out; - int (*drawchar)(void *font, int x, int y, int color, int charnum); -} font_struct; + int (*drawchar)(struct font_s *font, int x, int y, int color, int charnum); + int screen; + int transparent; +}; +typedef struct font_s font_struct; + +extern u8 font8x8[]; +extern u32 font8x8size; +extern u8 font8x16[]; +extern u32 font8x16size; + +int VdpSetFont(int screen, font_struct *font, int transparent); int VdpSetDefaultFont(int screen, font_struct *font); #endif Index: font.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/font.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- font.c 3 Mar 2007 05:21:44 -0000 1.1 +++ font.c 9 Jan 2008 04:45:54 -0000 1.2 @@ -21,313 +21,34 @@ ////////////////////////////////////////////////////////////////////////////// -u8 defaultfont[] = { - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x7E,0x81,0xA5,0x81,0x81,0xBD,0x99,0x81,0x81,0x7E, - 0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0xFF,0xDB,0xFF,0xFF,0xC3,0xE7,0xFF, - 0xFF,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6C,0xFE,0xFE,0xFE, - 0xFE,0x7C,0x38,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x38, - 0x7C,0xFE,0x7C,0x38,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18, - 0x3C,0x3C,0xE7,0xE7,0xE7,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x18,0x3C,0x7E,0xFF,0xFF,0x7E,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00, - 0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE7,0xC3,0xC3,0xE7,0xFF,0xFF, - 0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x42,0x42,0x66, - 0x3C,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xC3,0x99,0xBD, - 0xBD,0x99,0xC3,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x1E,0x0E,0x1A,0x32, - 0x78,0xCC,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x66, - 0x66,0x66,0x66,0x3C,0x18,0x7E,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00, - 0x3F,0x33,0x3F,0x30,0x30,0x30,0x30,0x70,0xF0,0xE0,0x00,0x00,0x00,0x00, - 0x00,0x00,0x7F,0x63,0x7F,0x63,0x63,0x63,0x63,0x67,0xE7,0xE6,0xC0,0x00, - 0x00,0x00,0x00,0x00,0x00,0x18,0x18,0xDB,0x3C,0xE7,0x3C,0xDB,0x18,0x18, - 0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xE0,0xF0,0xF8,0xFE,0xF8,0xF0,0xE0, - 0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x02,0x06,0x0E,0x1E,0x3E,0xFE,0x3E, - 0x1E,0x0E,0x06,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3C,0x7E,0x18, - 0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x66, - 0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x66,0x00,0x00,0x00,0x00,0x00,0x00, - 0x7F,0xDB,0xDB,0xDB,0x7B,0x1B,0x1B,0x1B,0x1B,0x1B,0x00,0x00,0x00,0x00, - 0x00,0x7C,0xC6,0x60,0x38,0x6C,0xC6,0xC6,0x6C,0x38,0x0C,0xC6,0x7C,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFE,0xFE,0xFE, - 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x7E,0x3C, - 0x18,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18, - 0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18, - 0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x18,0x0C,0xFE,0x0C,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x30,0x60,0xFE,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xFE,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x66,0xFF,0x66,0x24,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x38,0x38,0x7C,0x7C,0xFE, - 0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFE,0x7C,0x7C, - 0x38,0x38,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3C, - 0x3C,0x3C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x66, - 0x66,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x6C,0x6C,0xFE,0x6C,0x6C,0x6C,0xFE,0x6C,0x6C,0x00,0x00, - 0x00,0x00,0x18,0x18,0x7C,0xC6,0xC2,0xC0,0x7C,0x06,0x06,0x86,0xC6,0x7C, - 0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0xC2,0xC6,0x0C,0x18,0x30,0x60, - 0xC6,0x86,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x6C,0x6C,0x38,0x76,0xDC, - 0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x60,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x18, - 0x30,0x30,0x30,0x30,0x30,0x30,0x18,0x0C,0x00,0x00,0x00,0x00,0x00,0x00, - 0x30,0x18,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x18,0x30,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x66,0x3C,0xFF,0x3C,0x66,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18, - 0x18,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x02,0x06,0x0C,0x18,0x30,0x60,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00, - 0x3C,0x66,0xC3,0xC3,0xDB,0xDB,0xC3,0xC3,0x66,0x3C,0x00,0x00,0x00,0x00, - 0x00,0x00,0x18,0x38,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x00,0x00, - 0x00,0x00,0x00,0x00,0x7C,0xC6,0x06,0x0C,0x18,0x30,0x60,0xC0,0xC6,0xFE, - 0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x06,0x06,0x3C,0x06,0x06,0x06, - 0xC6,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x1C,0x3C,0x6C,0xCC,0xFE, - 0x0C,0x0C,0x0C,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xC0,0xC0,0xC0, - 0xFC,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x60, - 0xC0,0xC0,0xFC,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,0x00,0x00, - 0xFE,0xC6,0x06,0x06,0x0C,0x18,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00, - 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, - 0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0x0C,0x78, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18, - 0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00, - 0x00,0x18,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x0C,0x18, - 0x30,0x60,0x30,0x18,0x0C,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x7E,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x60,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x60,0x00,0x00,0x00,0x00, - 0x00,0x00,0x7C,0xC6,0xC6,0x0C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xDE,0xDE,0xDE,0xDC,0xC0,0x7C, - 0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6, - 0xC6,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x66, - 0x66,0x66,0x66,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0xC2,0xC0, - 0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x6C, - 0x66,0x66,0x66,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00,0x00,0x00,0x00, - 0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, - 0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x60,0x60,0xF0,0x00,0x00, - 0x00,0x00,0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xDE,0xC6,0xC6,0x66,0x3A, - 0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6, - 0xC6,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18, - 0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x0C,0x0C,0x0C, - 0x0C,0x0C,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0xE6,0x66, - 0x66,0x6C,0x78,0x78,0x6C,0x66,0x66,0xE6,0x00,0x00,0x00,0x00,0x00,0x00, - 0xF0,0x60,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, - 0x00,0x00,0xC3,0xE7,0xFF,0xFF,0xDB,0xC3,0xC3,0xC3,0xC3,0xC3,0x00,0x00, - 0x00,0x00,0x00,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0xC6, - 0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6, - 0xC6,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x60, - 0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6, - 0xC6,0xC6,0xC6,0xD6,0xDE,0x7C,0x0C,0x0E,0x00,0x00,0x00,0x00,0xFC,0x66, - 0x66,0x66,0x7C,0x6C,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00,0x00,0x00, - 0x7C,0xC6,0xC6,0x60,0x38,0x0C,0x06,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, - 0x00,0x00,0xFF,0xDB,0x99,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, - 0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C, - 0x00,0x00,0x00,0x00,0x00,0x00,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0x66, - 0x3C,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0xC3,0xC3,0xC3,0xC3,0xC3,0xDB, - 0xDB,0xFF,0x66,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0xC3,0xC3,0x66,0x3C, - 0x18,0x18,0x3C,0x66,0xC3,0xC3,0x00,0x00,0x00,0x00,0x00,0x00,0xC3,0xC3, - 0xC3,0x66,0x3C,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,0x00,0x00, - 0xFF,0xC3,0x86,0x0C,0x18,0x30,0x60,0xC1,0xC3,0xFF,0x00,0x00,0x00,0x00, - 0x00,0x00,0x3C,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3C,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xE0,0x70,0x38,0x1C,0x0E,0x06,0x02, - 0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, - 0x0C,0x3C,0x00,0x00,0x00,0x00,0x10,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x30,0x30,0x18,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, - 0x00,0x00,0xE0,0x60,0x60,0x78,0x6C,0x66,0x66,0x66,0x66,0x7C,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C, - 0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x0C,0x0C,0x3C,0x6C,0xCC,0xCC,0xCC, - 0xCC,0x76,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xFE, - 0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x6C,0x64,0x60, - 0xF0,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0xCC,0x78,0x00,0x00,0x00, - 0xE0,0x60,0x60,0x6C,0x76,0x66,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00, - 0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, - 0x00,0x00,0x00,0x00,0x06,0x06,0x00,0x0E,0x06,0x06,0x06,0x06,0x06,0x06, - 0x66,0x66,0x3C,0x00,0x00,0x00,0xE0,0x60,0x60,0x66,0x6C,0x78,0x78,0x6C, - 0x66,0xE6,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18, - 0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE6, - 0xFF,0xDB,0xDB,0xDB,0xDB,0xDB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60, - 0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C, - 0x0C,0x0C,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0x76,0x66,0x60,0x60, - 0x60,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x60, - 0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x30,0x30,0xFC, - 0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0xC3,0xC3,0xC3,0xC3,0x66,0x3C,0x18,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0xC3,0xC3,0xC3,0xDB,0xDB,0xFF,0x66,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC3,0x66,0x3C,0x18,0x3C,0x66,0xC3, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6, - 0xC6,0x7E,0x06,0x0C,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xCC,0x18, - 0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x18,0x18,0x18, - 0x70,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18, - 0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00, - 0x70,0x18,0x18,0x18,0x0E,0x18,0x18,0x18,0x18,0x70,0x00,0x00,0x00,0x00, - 0x00,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC2,0x66, - 0x3C,0x0C,0x06,0x7C,0x00,0x00,0x00,0x00,0xCC,0x00,0x00,0xCC,0xCC,0xCC, - 0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,0x00,0x0C,0x18,0x30,0x00,0x7C, - 0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,0x00,0x10,0x38,0x6C, - 0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,0x00,0x00, - 0xCC,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, - 0x00,0x60,0x30,0x18,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00, - 0x00,0x00,0x00,0x38,0x6C,0x38,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x60,0x60,0x66,0x3C, - 0x0C,0x06,0x3C,0x00,0x00,0x00,0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xFE, - 0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0x00,0x00,0x7C, - 0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,0x00,0x60,0x30,0x18, - 0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,0x00,0x00, - 0x66,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, - 0x00,0x18,0x3C,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, - 0x00,0x00,0x00,0x60,0x30,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C, - 0x00,0x00,0x00,0x00,0x00,0xC6,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6, - 0xC6,0xC6,0x00,0x00,0x00,0x00,0x38,0x6C,0x38,0x00,0x38,0x6C,0xC6,0xC6, - 0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,0x18,0x30,0x60,0x00,0xFE,0x66, - 0x60,0x7C,0x60,0x60,0x66,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x6E,0x3B,0x1B,0x7E,0xD8,0xDC,0x77,0x00,0x00,0x00,0x00,0x00,0x00, - 0x3E,0x6C,0xCC,0xCC,0xFE,0xCC,0xCC,0xCC,0xCC,0xCE,0x00,0x00,0x00,0x00, - 0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, - 0x00,0x00,0x00,0x00,0xC6,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C, - 0x00,0x00,0x00,0x00,0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6, - 0xC6,0x7C,0x00,0x00,0x00,0x00,0x00,0x30,0x78,0xCC,0x00,0xCC,0xCC,0xCC, - 0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,0x00,0x60,0x30,0x18,0x00,0xCC, - 0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0x00, - 0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0x78,0x00,0x00,0xC6, - 0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, - 0x00,0xC6,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, - 0x00,0x00,0x00,0x18,0x18,0x7E,0xC3,0xC0,0xC0,0xC0,0xC3,0x7E,0x18,0x18, - 0x00,0x00,0x00,0x00,0x00,0x38,0x6C,0x64,0x60,0xF0,0x60,0x60,0x60,0x60, - 0xE6,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0xC3,0x66,0x3C,0x18,0xFF,0x18, - 0xFF,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0xFC,0x66,0x66,0x7C,0x62, - 0x66,0x6F,0x66,0x66,0x66,0xF3,0x00,0x00,0x00,0x00,0x00,0x0E,0x1B,0x18, - 0x18,0x18,0x7E,0x18,0x18,0x18,0x18,0x18,0xD8,0x70,0x00,0x00,0x00,0x18, - 0x30,0x60,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, - 0x00,0x0C,0x18,0x30,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, - 0x00,0x00,0x00,0x18,0x30,0x60,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C, - 0x00,0x00,0x00,0x00,0x00,0x18,0x30,0x60,0x00,0xCC,0xCC,0xCC,0xCC,0xCC, - 0xCC,0x76,0x00,0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0xDC,0x66,0x66, - 0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0xC6,0xE6,0xF6, - 0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,0x00,0x3C,0x6C,0x6C, - 0x3E,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38, - 0x6C,0x6C,0x38,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x60,0xC0,0xC6,0xC6,0x7C,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xC0,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0x06,0x06, - 0x06,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC2,0xC6,0xCC,0x18,0x30, - 0x60,0xCE,0x9B,0x06,0x0C,0x1F,0x00,0x00,0x00,0xC0,0xC0,0xC2,0xC6,0xCC, - 0x18,0x30,0x66,0xCE,0x96,0x3E,0x06,0x06,0x00,0x00,0x00,0x00,0x18,0x18, - 0x00,0x18,0x18,0x18,0x3C,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x36,0x6C,0xD8,0x6C,0x36,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0xD8,0x6C,0x36,0x6C,0xD8,0x00,0x00,0x00,0x00, - 0x00,0x00,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44, - 0x11,0x44,0x11,0x44,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA, - 0x55,0xAA,0x55,0xAA,0x55,0xAA,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77, - 0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0x18,0x18,0x18,0x18,0x18,0x18, - 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, - 0x18,0x18,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, - 0x18,0x18,0x18,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, - 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x36,0x36,0x36,0x36,0x36,0x36, - 0x36,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x36,0x36,0x36,0x36, - 0x36,0x36,0x36,0x36,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0xF8,0x18,0x18, - 0x18,0x18,0x18,0x18,0x18,0x18,0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xF6, - 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, - 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x00,0x00,0x00,0x00, - 0x00,0xFE,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, - 0x36,0x36,0x36,0xF6,0x06,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0x18, - 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18, - 0x18,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, - 0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x18, - 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x18,0x18, - 0x18,0x18,0x18,0x18,0x18,0x18,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37, - 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37, - 0x30,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x3F,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, - 0x36,0x36,0x36,0xF7,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36, - 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x37,0x36,0x36,0x36,0x36, - 0x36,0x36,0x36,0x36,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xF7, - 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x18,0x18,0x18,0x18,0x18,0xFF, - 0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x36,0x36,0x36, - 0x36,0x36,0x36,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0xFF,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x36,0x36,0x36,0x36,0x36,0x36, - 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x3F,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x1F, - 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x3F,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, - 0x36,0x36,0x36,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x18,0x18, - 0x18,0x18,0x18,0xFF,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, - 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x18,0x18,0x18, - 0x18,0x18,0x18,0x18,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0, - 0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0x0F,0x0F,0x0F,0x0F, - 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0xFF,0xFF, - 0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0xD8,0xD8,0xD8,0xDC,0x76,0x00,0x00, - 0x00,0x00,0x00,0x00,0x78,0xCC,0xCC,0xCC,0xD8,0xCC,0xC6,0xC6,0xC6,0xCC, - 0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xC6,0xC6,0xC0,0xC0,0xC0,0xC0,0xC0, - 0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x6C,0x6C,0x6C, - 0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xC6,0x60, - 0x30,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x7E,0xD8,0xD8,0xD8,0xD8,0xD8,0x70,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xC0,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x76,0xDC,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x7E,0x18,0x3C,0x66,0x66,0x66,0x3C,0x18,0x7E, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6, - 0x6C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0x6C, - 0x6C,0x6C,0x6C,0xEE,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x30,0x18,0x0C, - 0x3E,0x66,0x66,0x66,0x66,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x7E,0xDB,0xDB,0xDB,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x03,0x06,0x7E,0xDB,0xDB,0xF3,0x7E,0x60,0xC0,0x00,0x00,0x00,0x00, - 0x00,0x00,0x1C,0x30,0x60,0x60,0x7C,0x60,0x60,0x60,0x30,0x1C,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00, - 0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7E,0x18, - 0x18,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x18,0x0C, - 0x06,0x0C,0x18,0x30,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C, - 0x18,0x30,0x60,0x30,0x18,0x0C,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00, - 0x0E,0x1B,0x1B,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, - 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xD8,0xD8,0xD8,0x70,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x7E,0x00,0x18,0x18,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0x76,0xDC, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x6C,0x6C,0x38,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F, - 0x0C,0x0C,0x0C,0x0C,0x0C,0xEC,0x6C,0x6C,0x3C,0x1C,0x00,0x00,0x00,0x00, - 0x00,0xD8,0x6C,0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x70,0xD8,0x30,0x60,0xC8,0xF8,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C, - 0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -}; +int DrawCharVdp1(font_struct *font, int x, int y, int color, int charnum) +{ + sprite_struct sprite; + u32 src = (u32)font->out + (charnum * font->charsize); -u32 defaultfontsize=sizeof(defaultfont); + sprite.attr = SPRITE_PRECLIPENABLE | SPRITE_HIGHSPEEDSHRINKDISABLE | + SPRITE_CLIPDISABLE | SPRITE_ENDCODEDISABLE | SPRITE_8BPP256COLOR; + sprite.addr = src; +// sprite.bank = RGB16(31, 0, 0) | 0X8000; + sprite.bank = 0; // fix me + sprite.width = font->width; + sprite.height = font->height; + sprite.x = x; + sprite.y = y; + VdpDrawNormalSprite(&sprite); + + return font->width; +} ////////////////////////////////////////////////////////////////////////////// -int DrawCharBitmap1bppTo8bpp(void *font, int x, int y, int color, int charnum) +int DrawCharBitmap1bppTo8bpp(font_struct *font, int x, int y, int color, int charnum) { int i, i2; - u8 *src = ((font_struct *)font)->data + (charnum * ((font_struct *)font)->charsize); - u8 *dest = ((font_struct *)font)->out + (y * ((font_struct *)font)->lineinc) + x; + u8 *src = font->data + (charnum * font->charsize); + u8 *dest = font->out + (y * font->lineinc) + x; - for (i = 0; i < (((font_struct *)font)->height * ((font_struct *)font)->width / 8); i++) + for (i = 0; i < (font->height * font->width / 8); i++) { u8 pixel = src[i]; @@ -335,24 +56,42 @@ { if ((pixel >> 7) & 0x1) dest[i2] = (u8)color; + else if (!font->transparent) + dest[i2] = 0; pixel <<= 1; } - dest += ((font_struct *)font)->lineinc; + dest += font->lineinc; } - return ((font_struct *)font)->width; + return font->width; } ////////////////////////////////////////////////////////////////////////////// -int VdpSetFont(int screen, font_struct *font) +int VdpSetFont(int screen, font_struct *font, int transparent) { + int i; + // This is just a basic implementation so I can make sure the basic // framework is working font->charsize = font->width * font->height * font->bpp / 8; - font->lineinc = 512; - font->out = (u8 *)0x25E00000; - font->drawchar = DrawCharBitmap1bppTo8bpp; + + if (screen == SCREEN_VDP1) + { + font->lineinc = font->width; + + for (i = 0; i < 128; i++) + DrawCharBitmap1bppTo8bpp(font, 0, i * font->height, 1, i); + font->drawchar = DrawCharVdp1; + } + else + { + font->lineinc = 512; // fix me(should be detected) + font->drawchar = DrawCharBitmap1bppTo8bpp; + } + + font->screen = screen; + font->transparent = transparent; return LAPETUS_ERR_OK; } @@ -361,12 +100,17 @@ int VdpSetDefaultFont(int screen, font_struct *font) { - font->data = defaultfont; + font->data = font8x16; font->width = 8; font->height = 16; font->bpp = 1; - return VdpSetFont(screen, font); + if (screen == SCREEN_VDP1) + font->out = (u8 *)0x25C20000; + else + font->out = (u8 *)0x25E00000; + + return VdpSetFont(screen, font, 0); } ////////////////////////////////////////////////////////////////////////////// --- NEW FILE: font8x16.c --- #include <lapetus.h> u8 font8x16[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x7E,0x81,0xA5,0x81,0x81,0xBD,0x99,0x81,0x81,0x7E, 0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0xFF,0xDB,0xFF,0xFF,0xC3,0xE7,0xFF, 0xFF,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6C,0xFE,0xFE,0xFE, 0xFE,0x7C,0x38,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x38, 0x7C,0xFE,0x7C,0x38,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18, 0x3C,0x3C,0xE7,0xE7,0xE7,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x18,0x3C,0x7E,0xFF,0xFF,0x7E,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00, 0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE7,0xC3,0xC3,0xE7,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x42,0x42,0x66, 0x3C,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xC3,0x99,0xBD, 0xBD,0x99,0xC3,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x1E,0x0E,0x1A,0x32, 0x78,0xCC,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x66, 0x66,0x66,0x66,0x3C,0x18,0x7E,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00, 0x3F,0x33,0x3F,0x30,0x30,0x30,0x30,0x70,0xF0,0xE0,0x00,0x00,0x00,0x00, 0x00,0x00,0x7F,0x63,0x7F,0x63,0x63,0x63,0x63,0x67,0xE7,0xE6,0xC0,0x00, 0x00,0x00,0x00,0x00,0x00,0x18,0x18,0xDB,0x3C,0xE7,0x3C,0xDB,0x18,0x18, 0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xE0,0xF0,0xF8,0xFE,0xF8,0xF0,0xE0, 0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x02,0x06,0x0E,0x1E,0x3E,0xFE,0x3E, 0x1E,0x0E,0x06,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3C,0x7E,0x18, 0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x66, 0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x66,0x00,0x00,0x00,0x00,0x00,0x00, 0x7F,0xDB,0xDB,0xDB,0x7B,0x1B,0x1B,0x1B,0x1B,0x1B,0x00,0x00,0x00,0x00, 0x00,0x7C,0xC6,0x60,0x38,0x6C,0xC6,0xC6,0x6C,0x38,0x0C,0xC6,0x7C,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFE,0xFE,0xFE, 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x7E,0x3C, 0x18,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18, 0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18, 0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x18,0x0C,0xFE,0x0C,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x30,0x60,0xFE,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xFE,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x66,0xFF,0x66,0x24,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x38,0x38,0x7C,0x7C,0xFE, 0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFE,0x7C,0x7C, 0x38,0x38,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3C, 0x3C,0x3C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x66, 0x66,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x6C,0x6C,0xFE,0x6C,0x6C,0x6C,0xFE,0x6C,0x6C,0x00,0x00, 0x00,0x00,0x18,0x18,0x7C,0xC6,0xC2,0xC0,0x7C,0x06,0x06,0x86,0xC6,0x7C, 0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0xC2,0xC6,0x0C,0x18,0x30,0x60, 0xC6,0x86,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x6C,0x6C,0x38,0x76,0xDC, 0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x60,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x18, 0x30,0x30,0x30,0x30,0x30,0x30,0x18,0x0C,0x00,0x00,0x00,0x00,0x00,0x00, 0x30,0x18,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x18,0x30,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x66,0x3C,0xFF,0x3C,0x66,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18, 0x18,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x02,0x06,0x0C,0x18,0x30,0x60,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 0x3C,0x66,0xC3,0xC3,0xDB,0xDB,0xC3,0xC3,0x66,0x3C,0x00,0x00,0x00,0x00, 0x00,0x00,0x18,0x38,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x00,0x00, 0x00,0x00,0x00,0x00,0x7C,0xC6,0x06,0x0C,0x18,0x30,0x60,0xC0,0xC6,0xFE, 0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x06,0x06,0x3C,0x06,0x06,0x06, 0xC6,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x1C,0x3C,0x6C,0xCC,0xFE, 0x0C,0x0C,0x0C,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xC0,0xC0,0xC0, 0xFC,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x60, 0xC0,0xC0,0xFC,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,0x00,0x00, 0xFE,0xC6,0x06,0x06,0x0C,0x18,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00, 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, 0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0x0C,0x78, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18, 0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00, 0x00,0x18,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x0C,0x18, 0x30,0x60,0x30,0x18,0x0C,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x7E,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x60,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x60,0x00,0x00,0x00,0x00, 0x00,0x00,0x7C,0xC6,0xC6,0x0C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xDE,0xDE,0xDE,0xDC,0xC0,0x7C, 0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6, 0xC6,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x66, 0x66,0x66,0x66,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0xC2,0xC0, 0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x6C, 0x66,0x66,0x66,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00,0x00,0x00,0x00, 0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, 0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x60,0x60,0xF0,0x00,0x00, 0x00,0x00,0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xDE,0xC6,0xC6,0x66,0x3A, 0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6, 0xC6,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18, 0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x0C,0x0C,0x0C, 0x0C,0x0C,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0xE6,0x66, 0x66,0x6C,0x78,0x78,0x6C,0x66,0x66,0xE6,0x00,0x00,0x00,0x00,0x00,0x00, 0xF0,0x60,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, 0x00,0x00,0xC3,0xE7,0xFF,0xFF,0xDB,0xC3,0xC3,0xC3,0xC3,0xC3,0x00,0x00, 0x00,0x00,0x00,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0xC6, 0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6, 0xC6,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x60, 0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6, 0xC6,0xC6,0xC6,0xD6,0xDE,0x7C,0x0C,0x0E,0x00,0x00,0x00,0x00,0xFC,0x66, 0x66,0x66,0x7C,0x6C,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00,0x00,0x00, 0x7C,0xC6,0xC6,0x60,0x38,0x0C,0x06,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x00,0x00,0xFF,0xDB,0x99,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, 0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C, 0x00,0x00,0x00,0x00,0x00,0x00,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0x66, 0x3C,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0xC3,0xC3,0xC3,0xC3,0xC3,0xDB, 0xDB,0xFF,0x66,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0xC3,0xC3,0x66,0x3C, 0x18,0x18,0x3C,0x66,0xC3,0xC3,0x00,0x00,0x00,0x00,0x00,0x00,0xC3,0xC3, 0xC3,0x66,0x3C,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,0x00,0x00, 0xFF,0xC3,0x86,0x0C,0x18,0x30,0x60,0xC1,0xC3,0xFF,0x00,0x00,0x00,0x00, 0x00,0x00,0x3C,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3C,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xE0,0x70,0x38,0x1C,0x0E,0x06,0x02, 0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, 0x0C,0x3C,0x00,0x00,0x00,0x00,0x10,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x30,0x30,0x18,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0x00,0x00,0xE0,0x60,0x60,0x78,0x6C,0x66,0x66,0x66,0x66,0x7C,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C, 0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x0C,0x0C,0x3C,0x6C,0xCC,0xCC,0xCC, 0xCC,0x76,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xFE, 0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x6C,0x64,0x60, 0xF0,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0xCC,0x78,0x00,0x00,0x00, 0xE0,0x60,0x60,0x6C,0x76,0x66,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00, 0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, 0x00,0x00,0x00,0x00,0x06,0x06,0x00,0x0E,0x06,0x06,0x06,0x06,0x06,0x06, 0x66,0x66,0x3C,0x00,0x00,0x00,0xE0,0x60,0x60,0x66,0x6C,0x78,0x78,0x6C, 0x66,0xE6,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18, 0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE6, 0xFF,0xDB,0xDB,0xDB,0xDB,0xDB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60, 0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C, 0x0C,0x0C,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0x76,0x66,0x60,0x60, 0x60,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x60, 0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x30,0x30,0xFC, 0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0xC3,0xC3,0xC3,0xC3,0x66,0x3C,0x18,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0xC3,0xC3,0xC3,0xDB,0xDB,0xFF,0x66,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC3,0x66,0x3C,0x18,0x3C,0x66,0xC3, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6, 0xC6,0x7E,0x06,0x0C,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xCC,0x18, 0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x18,0x18,0x18, 0x70,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18, 0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00, 0x70,0x18,0x18,0x18,0x0E,0x18,0x18,0x18,0x18,0x70,0x00,0x00,0x00,0x00, 0x00,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC2,0x66, 0x3C,0x0C,0x06,0x7C,0x00,0x00,0x00,0x00,0xCC,0x00,0x00,0xCC,0xCC,0xCC, 0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,0x00,0x0C,0x18,0x30,0x00,0x7C, 0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,0x00,0x10,0x38,0x6C, 0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,0x00,0x00, 0xCC,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0x00,0x60,0x30,0x18,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00, 0x00,0x00,0x00,0x38,0x6C,0x38,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x60,0x60,0x66,0x3C, 0x0C,0x06,0x3C,0x00,0x00,0x00,0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xFE, 0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0x00,0x00,0x7C, 0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,0x00,0x60,0x30,0x18, 0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,0x00,0x00, 0x66,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, 0x00,0x18,0x3C,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, 0x00,0x00,0x00,0x60,0x30,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C, 0x00,0x00,0x00,0x00,0x00,0xC6,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6, 0xC6,0xC6,0x00,0x00,0x00,0x00,0x38,0x6C,0x38,0x00,0x38,0x6C,0xC6,0xC6, 0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,0x18,0x30,0x60,0x00,0xFE,0x66, 0x60,0x7C,0x60,0x60,0x66,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x6E,0x3B,0x1B,0x7E,0xD8,0xDC,0x77,0x00,0x00,0x00,0x00,0x00,0x00, 0x3E,0x6C,0xCC,0xCC,0xFE,0xCC,0xCC,0xCC,0xCC,0xCE,0x00,0x00,0x00,0x00, 0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, 0x00,0x00,0x00,0x00,0xC6,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C, 0x00,0x00,0x00,0x00,0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6, 0xC6,0x7C,0x00,0x00,0x00,0x00,0x00,0x30,0x78,0xCC,0x00,0xCC,0xCC,0xCC, 0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,0x00,0x60,0x30,0x18,0x00,0xCC, 0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0x00, 0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0x78,0x00,0x00,0xC6, 0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, 0x00,0xC6,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00, 0x00,0x00,0x00,0x18,0x18,0x7E,0xC3,0xC0,0xC0,0xC0,0xC3,0x7E,0x18,0x18, 0x00,0x00,0x00,0x00,0x00,0x38,0x6C,0x64,0x60,0xF0,0x60,0x60,0x60,0x60, 0xE6,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0xC3,0x66,0x3C,0x18,0xFF,0x18, 0xFF,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0xFC,0x66,0x66,0x7C,0x62, 0x66,0x6F,0x66,0x66,0x66,0xF3,0x00,0x00,0x00,0x00,0x00,0x0E,0x1B,0x18, 0x18,0x18,0x7E,0x18,0x18,0x18,0x18,0x18,0xD8,0x70,0x00,0x00,0x00,0x18, 0x30,0x60,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, 0x00,0x0C,0x18,0x30,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00, 0x00,0x00,0x00,0x18,0x30,0x60,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C, 0x00,0x00,0x00,0x00,0x00,0x18,0x30,0x60,0x00,0xCC,0xCC,0xCC,0xCC,0xCC, 0xCC,0x76,0x00,0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0xDC,0x66,0x66, 0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0xC6,0xE6,0xF6, 0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,0x00,0x3C,0x6C,0x6C, 0x3E,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38, 0x6C,0x6C,0x38,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x60,0xC0,0xC6,0xC6,0x7C,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xC0,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0x06,0x06, 0x06,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC2,0xC6,0xCC,0x18,0x30, 0x60,0xCE,0x9B,0x06,0x0C,0x1F,0x00,0x00,0x00,0xC0,0xC0,0xC2,0xC6,0xCC, 0x18,0x30,0x66,0xCE,0x96,0x3E,0x06,0x06,0x00,0x00,0x00,0x00,0x18,0x18, 0x00,0x18,0x18,0x18,0x3C,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x36,0x6C,0xD8,0x6C,0x36,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0xD8,0x6C,0x36,0x6C,0xD8,0x00,0x00,0x00,0x00, 0x00,0x00,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44, 0x11,0x44,0x11,0x44,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA, 0x55,0xAA,0x55,0xAA,0x55,0xAA,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77, 0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0x18,0x18,0x18,0x18,0x18,0x18, 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x18,0x18,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x18,0x18,0x18,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x36,0x36,0x36,0x36,0x36,0x36, 0x36,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x36,0x36,0x36,0x36, 0x36,0x36,0x36,0x36,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0xF8,0x18,0x18, 0x18,0x18,0x18,0x18,0x18,0x18,0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xF6, 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x00,0x00,0x00,0x00, 0x00,0xFE,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0x36,0x36,0x36,0xF6,0x06,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0x18, 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18, 0x18,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x18, 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x18,0x18, 0x18,0x18,0x18,0x18,0x18,0x18,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37, 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37, 0x30,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x3F,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0x36,0x36,0x36,0xF7,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36, 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x37,0x36,0x36,0x36,0x36, 0x36,0x36,0x36,0x36,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xF7, 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x18,0x18,0x18,0x18,0x18,0xFF, 0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x36,0x36,0x36, 0x36,0x36,0x36,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0xFF,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x36,0x36,0x36,0x36,0x36,0x36, 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x3F,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x1F, 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x3F,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, 0x36,0x36,0x36,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x18,0x18, 0x18,0x18,0x18,0xFF,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x18,0x18,0x18, 0x18,0x18,0x18,0x18,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0, 0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0x0F,0x0F,0x0F,0x0F, 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0xD8,0xD8,0xD8,0xDC,0x76,0x00,0x00, 0x00,0x00,0x00,0x00,0x78,0xCC,0xCC,0xCC,0xD8,0xCC,0xC6,0xC6,0xC6,0xCC, 0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xC6,0xC6,0xC0,0xC0,0xC0,0xC0,0xC0, 0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x6C,0x6C,0x6C, 0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xC6,0x60, 0x30,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x7E,0xD8,0xD8,0xD8,0xD8,0xD8,0x70,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xC0,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x76,0xDC,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x7E,0x18,0x3C,0x66,0x66,0x66,0x3C,0x18,0x7E, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6, 0x6C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0x6C, 0x6C,0x6C,0x6C,0xEE,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x30,0x18,0x0C, 0x3E,0x66,0x66,0x66,0x66,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x7E,0xDB,0xDB,0xDB,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x03,0x06,0x7E,0xDB,0xDB,0xF3,0x7E,0x60,0xC0,0x00,0x00,0x00,0x00, 0x00,0x00,0x1C,0x30,0x60,0x60,0x7C,0x60,0x60,0x60,0x30,0x1C,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00, 0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7E,0x18, 0x18,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x18,0x0C, 0x06,0x0C,0x18,0x30,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C, 0x18,0x30,0x60,0x30,0x18,0x0C,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00, 0x0E,0x1B,0x1B,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xD8,0xD8,0xD8,0x70,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x7E,0x00,0x18,0x18,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0x76,0xDC, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x6C,0x6C,0x38,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F, 0x0C,0x0C,0x0C,0x0C,0x0C,0xEC,0x6C,0x6C,0x3C,0x1C,0x00,0x00,0x00,0x00, 0x00,0xD8,0x6C,0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x70,0xD8,0x30,0x60,0xC8,0xF8,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C, 0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; u32 font8x16size=sizeof(font8x16); |
From: Theo B. <cyb...@us...> - 2008-01-08 09:28:45
|
Update of /cvsroot/lapetus/lapetus/tests/regtest In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29063 Modified Files: cdb.c cdb.h intfac.c intfac.h main.c main.h makefile objects scsp.c scsp.h scu.c scu.h sh2.c tests.h vdp2.c vdp2.h Log Message: -Did some major tweaks to the menu system(looks a lot better) -Reworked a bunch of code -Added more framework code for areas that aren't finished Index: sh2.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/sh2.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- sh2.c 7 Jan 2008 03:10:46 -0000 1.1 +++ sh2.c 8 Jan 2008 09:28:40 -0000 1.2 @@ -62,6 +62,9 @@ RegisterTest(&DivOperationTest, "DIV operations"); RegisterTest(&DivInterruptTest, "DIV overflow interrupt"); DoTests("SH2 tests", 0, 0); + + // Other tests to do: instruction tests, check all register accesses, + // onchip functions } ////////////////////////////////////////////////////////////////////////////// Index: cdb.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/cdb.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- cdb.c 7 Jan 2008 03:10:46 -0000 1.1 +++ cdb.c 8 Jan 2008 09:28:40 -0000 1.2 @@ -18,12 +18,49 @@ */ #include <lapetus.h> +#include "intfac.h" #include "tests.h" +#include "cdb.h" ////////////////////////////////////////////////////////////////////////////// void cdbtest() { + int choice; + + MENUITEMSTRUCT cdbmenu[] = { + { "CD Commands", &cdcmdtest, }, + { "MPEG Commands", &mpegcmdtest, }, + { "Misc CD Block" , &misccdtest, }, + { "Go back to main menu", NULL }, + { "\0", NULL } + }; + + for (;;) + { + choice = DoMenu(cdbmenu, 8, 14, "CD Block Tests"); + ClearScr(); + if (choice == ((sizeof(cdbmenu) / sizeof(MENUITEMSTRUCT)) - 2)) + break; + } +} + +////////////////////////////////////////////////////////////////////////////// + +void cdcmdtest() +{ +} + +////////////////////////////////////////////////////////////////////////////// + +void mpegcmdtest() +{ +} + +////////////////////////////////////////////////////////////////////////////// + +void misccdtest() +{ } ////////////////////////////////////////////////////////////////////////////// Index: objects =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/objects,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- objects 7 Jan 2008 03:10:46 -0000 1.1 +++ objects 8 Jan 2008 09:28:40 -0000 1.2 @@ -1,10 +1,14 @@ OBJ = $(CRT0) \ obj/main.o \ + obj/cart.o \ obj/cdb.o \ obj/dsp.o \ + obj/m68k.o \ obj/scsp.o \ obj/scu.o \ + obj/smpc.o \ obj/sh2.o \ + obj/vdp1.o \ obj/vdp2.o \ obj/tests.o \ obj/intfac.o Index: makefile =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- makefile 7 Jan 2008 03:10:46 -0000 1.1 +++ makefile 8 Jan 2008 09:28:40 -0000 1.2 @@ -4,10 +4,10 @@ # FLAGS = -Wall -g -#EXE = main.bin -EXE = main.coff +EXE = main.bin +#EXE = main.coff all: $(EXE) -TARGETTYPE = coff-sh +#TARGETTYPE = coff-sh include ../shared/makefile include ./objects Index: cdb.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/cdb.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- cdb.h 7 Jan 2008 03:10:46 -0000 1.1 +++ cdb.h 8 Jan 2008 09:28:40 -0000 1.2 @@ -17,9 +17,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef CDB_H -#define CDB_H +#ifndef CDBH +#define CDBH void cdbtest(); +void cdcmdtest(); +void mpegcmdtest(); +void misccdtest(); #endif Index: scu.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/scu.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- scu.h 7 Jan 2008 03:10:46 -0000 1.1 +++ scu.h 8 Jan 2008 09:28:40 -0000 1.2 @@ -17,8 +17,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef SCU_H -#define SCU_H +#ifndef SCUH +#define SCUH void scutest(); void TestSCUVERRegister(); Index: intfac.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/intfac.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- intfac.c 7 Jan 2008 03:10:46 -0000 1.1 +++ intfac.c 8 Jan 2008 09:28:40 -0000 1.2 @@ -1,3 +1,22 @@ +/* Copyright 2006-2008 Theo Berkau + + This file is part of Lapetus. + + Lapetus is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + Lapetus is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Lapetus; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + #include <string.h> #include <lapetus.h> #include "intfac.h" @@ -7,8 +26,6 @@ void ClearScr(void) { - int i, i2; - VdpDispOff(); VdpClearScreen(&testdispfont); VdpDispOn(); @@ -16,13 +33,22 @@ ////////////////////////////////////////////////////////////////////////////// -int DoMenu(MENUITEMSTRUCT *menu, int x, int y) +int DoMenu(MENUITEMSTRUCT *menu, int x, int y, const char *title) { int cursel=0; int nummenu=0; int i; + int menux, menuy; + + // Setup Priorities + VDP2_REG_PRIR = 0x0002; + VDP2_REG_PRISA = 0x0101; + VDP2_REG_PRISB = 0x0101; + VDP2_REG_PRISC = 0x0101; + VDP2_REG_PRISD = 0x0101; // Make sure current screen is clear + WindowInit(); // Figure out how many menu items there are for (;;) @@ -31,71 +57,23 @@ nummenu++; } - // Add Menu Sprite to draw list - for (i = 0; i < nummenu; i++) - VdpPrintf(&testdispfont, (x+1) * 8, (y+i) * 8, 0xF, (char *)menu[i].name); - - // Add Selected Menu Item(should always be first item) sprite to draw list - VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, ">"); - - for (;;) - { - VdpVsync(); - - // poll joypad(if menu item is selected, return) - if (per[0].butpushonce & PAD_UP) - { - VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, " "); - - if (cursel > 0) - cursel--; - - VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, ">"); - } - else if (per[0].butpushonce & PAD_DOWN) - { - VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, " "); - - if (cursel < (nummenu - 1)) - cursel++; - - VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, ">"); - } - - if (per[0].butpushonce & PAD_A) - { - ClearScr(); - - if (menu[cursel].func) - menu[cursel].func(); - return cursel; - } - } -} - -////////////////////////////////////////////////////////////////////////////// - -int DoWindow(WINDOWSTRUCT *window, int x, int y) -{ - int nummenu=0; - int i; + WindowDraw(x, y, 260, 5+5+5+8+nummenu*8, 0, RGB16(26, 26, 25) | 0X8000); - // Make sure current screen is clear + // Draw title + VdpPrintf(&testdispfont, x+6, y+5, 15, "%s", title); - // Figure out how many window items there are - for (;;) - { -// if (menu[nummenu].name[0] == '\0') break; -// nummenu++; - } + menux = x + 6; + menuy = y + 5 + 8 + 5; -/* // Add Menu Sprite to draw list for (i = 0; i < nummenu; i++) - VdpPrintf(&testdispfont, (x+1) * 8, (y+i) * 8, 0xF, (char *)menu[i].name); + { + VdpPrintf(&testdispfont, menux + (1 * 8) + 1, menuy + (i * 8)+1, 0x10, (char *)menu[i].name); + VdpPrintf(&testdispfont, menux + (1 * 8), menuy + (i * 8), 0xF, (char *)menu[i].name); + } // Add Selected Menu Item(should always be first item) sprite to draw list - VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, ">"); + VdpPrintf(&testdispfont, menux, menuy+(cursel * 8), 0xF, ">"); for (;;) { @@ -104,21 +82,21 @@ // poll joypad(if menu item is selected, return) if (per[0].butpushonce & PAD_UP) { - VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, " "); + VdpPrintf(&testdispfont, menux, menuy + (cursel * 8), 0, ">"); if (cursel > 0) cursel--; - VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, ">"); + VdpPrintf(&testdispfont, menux, menuy + (cursel * 8), 0xF, ">"); } else if (per[0].butpushonce & PAD_DOWN) { - VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, " "); + VdpPrintf(&testdispfont, menux, menuy + (cursel * 8), 0x0, ">"); if (cursel < (nummenu - 1)) cursel++; - VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, ">"); + VdpPrintf(&testdispfont, menux, menuy + (cursel * 8), 0xF, ">"); } if (per[0].butpushonce & PAD_A) @@ -130,98 +108,101 @@ return cursel; } } -*/ } ////////////////////////////////////////////////////////////////////////////// -/* int MessageBox(const char *header, const char *body, int type) { - int body_x=0, body_y=0; - - body_x = ((320 / 8) - strlen(body)) / 2; // fix me - body_y = (224 / 8) / 2; // fix me +// WindowDraw(wnd->x, wnd->y, wnd->width, wnd->height, 0, RGB16(26, 26, 25) | 0X8000); - for (;;) - { - VdpVsync(); + return 0; // fix me(it should return what control was chosen) +} -// VdpStartDrawList(); -// Vdp1printf(body_x * 8, body_y * 8, 0xF0, (char *)body); -// _printf(body_x * 8, body_y * 8, 0xF0, (char *)body); -// Vdp1DrawPolygon(body_x - 8, body_y - 8, -// body_x + (strlen(body) * 8) + 8, body_y - 8, -// body_x + (strlen(body) * 8) + 8, body_y + 16, // fix me -// body_x - 8, body_y + 16, // fix me -// RGB16(0, 0, 127), -// SPRITE_ENDCODEDISABLE | SPRITE_TRANSPIXELDISABLE | SPRITE_16BPP); +////////////////////////////////////////////////////////////////////////////// -// Vdp1DrawNormalSprite(0, 16, 16, 0, 0, 0); +void WindowInit(void) +{ +} -// Vdp1DrawPolygon(0, 0, -// 200, 0, -// 200, 180, -// 0, 180, -// 0xFFFE, -// SPRITE_ENDCODEDISABLE); -// RGB16_COLOR(10,20,30), +////////////////////////////////////////////////////////////////////////////// -// Vdp1DrawDistortedSprite(0, 16, 16, 0, 0, 16, 0, 16, 16, 0, 16, 0); +void WindowDraw(int x, int y, int width, int height, u16 fgcolor, u16 bgcolor) +{ + sprite_struct localcoord; + sprite_struct sprite; -// VdpEndDrawList(); + localcoord.attr = 0; + localcoord.x = 0; + localcoord.y = 0; - switch (type) - { - // fix me - default: - VdpPrintf(&testdispfont, ((320 / 16) - 1) * 8, (body_y+2) * 8, 0xF, "OK"); //fix me - break; - } + VdpStartDrawList(); + VdpLocalCoordinate(&localcoord); - if (per[0].id == PER_KEYBOARD) - { - keyboarddata_struct *kbd=(keyboarddata_struct *)&per[0]; + sprite.attr = SPRITE_PRECLIPENABLE | SPRITE_HIGHSPEEDSHRINKDISABLE | + SPRITE_CLIPDISABLE | SPRITE_ENDCODEDISABLE | SPRITE_16BPP; + sprite.bank = bgcolor; + sprite.x = x; + sprite.y = y; + sprite.x2 = x+width; + sprite.y2 = y; + sprite.x3 = x+width; + sprite.y3 = y+height; + sprite.x4 = x; + sprite.y4 = y+height; - if (kbd->flags & 0x8) // Make - { - if (kbd->key == KEY_ENTER || - kbd->key == KEY_KPENTER || - kbd->key == KEY_SPACE || - kbd->key == KEY_ESC) - break; - } - } - else if (per[0].butpushonce & PAD_A) - { - break; - } - } + VdpDrawPolygon(&sprite); - ClearScr(); + // White lines + sprite.x += 1; + sprite.y += 1; + sprite.x2 -= 1; + sprite.y2 += 1; + sprite.bank = RGB16(31, 31, 31) | 0X8000; + VdpDrawLine(&sprite); - return 0; // fix me(it should return what control was chosen) -} -*/ + sprite.x2 = sprite.x; + sprite.y2 = sprite.y4-1; + VdpDrawLine(&sprite); -////////////////////////////////////////////////////////////////////////////// + // Gray lines + sprite.x = sprite.x2; + sprite.y = sprite.y2; + sprite.x2 = sprite.x3-1; + sprite.y2 = sprite.y3-1; + sprite.bank = RGB16(16, 16, 16) | 0X8000; + VdpDrawLine(&sprite); -/* -lwnd_struct *LWICreateWindow(char *name, int style, int x, int y, int width, int height, lwnd_struct *parent) -{ -} + sprite.x = sprite.x2; + sprite.y = y+1; + VdpDrawLine(&sprite); -////////////////////////////////////////////////////////////////////////////// + // Dark lines + sprite.x+=1; + sprite.y-=1; + sprite.x2+=1; + sprite.y2+=1; + sprite.bank = RGB16(8, 8, 8) | 0X8000; + VdpDrawLine(&sprite); -int LWIGetMessage(lmsg_struct *msg, lwnd_struct *wnd, int filtermin, int filtermax) -{ -} + sprite.x = x; + sprite.y = sprite.y2; + VdpDrawLine(&sprite); -////////////////////////////////////////////////////////////////////////////// + // Caption + sprite.x = x+3; + sprite.y = y+3; + sprite.x2 = x+width-3; + sprite.y2 = sprite.y; + sprite.x3 = sprite.x2; + sprite.y3 = y+12; + sprite.x4 = sprite.x; + sprite.y4 = sprite.y3; + sprite.bank = RGB16(1, 4, 13) | 0X8000; + VdpDrawPolygon(&sprite); -int LWIDispatchMessage(lmsg_struct *msg) -{ + VdpEndDrawList(); } ////////////////////////////////////////////////////////////////////////////// -*/ + Index: vdp2.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/vdp2.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- vdp2.c 7 Jan 2008 03:10:46 -0000 1.1 +++ vdp2.c 8 Jan 2008 09:28:40 -0000 1.2 @@ -64,7 +64,7 @@ void WorkingQuerry(const char *question) { // Ask the user if it's visible - VdpPrintf(&testdispfont, 2 * 8, 20 * 8, 0xF, question); + VdpPrintf(&testdispfont, 2 * 8, 20 * 8, 0xF, "%s", question); VdpPrintf(&testdispfont, 2 * 8, 21 * 8, 0xF, "C - Yes B - No"); for(;;) Index: scsp.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/scsp.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- scsp.c 7 Jan 2008 03:10:46 -0000 1.1 +++ scsp.c 8 Jan 2008 09:28:40 -0000 1.2 @@ -18,7 +18,9 @@ */ #include <lapetus.h> +#include "intfac.h" #include "tests.h" +#include "scsp.h" #define SCSPREG_TIMERA (*(volatile u16 *)0x25B00418) #define SCSPREG_TIMERB (*(volatile u16 *)0x25B0041A) @@ -36,28 +38,32 @@ int tinc=0; -void ScuInterruptTest(void); -void ScspTimerATest(); -void ScspTimerBTest(); -void ScspTimerCTest(); -void ScspTimerTimingTest(u16 timersetting); -void ScspTimerTimingTest0(); -void ScspTimerTimingTest1(); -void ScspTimerTimingTest2(); -void ScspTimerTimingTest3(); -void ScspTimerTimingTest4(); -void ScspTimerTimingTest5(); -void ScspTimerTimingTest6(); -void ScspTimerTimingTest7(); -void ScspIntOnTimerEnableTest(); -void ScspIntOnTimerResetTest(); -void ScspIntDupTest(); -void ScspMCIPDTest(); - ////////////////////////////////////////////////////////////////////////////// void scsptest() { + int choice; + + MENUITEMSTRUCT vdp1menu[] = { + { "SCSP timing" , &scsptimingtest, }, + { "Misc" , &scspmisctest, }, + { "Go back to main menu", NULL }, + { "\0", NULL } + }; + + for (;;) + { + choice = DoMenu(vdp1menu, 8, 14, "SCSP Tests"); + ClearScr(); + if (choice == ((sizeof(vdp1menu) / sizeof(MENUITEMSTRUCT)) - 2)) + break; + } +} + +////////////////////////////////////////////////////////////////////////////// + +void scspminimalinit() +{ // Put system in minimalized state InterruptSetLevelMask(0xF); @@ -70,7 +76,13 @@ // Display On VdpDispOn(); +} +////////////////////////////////////////////////////////////////////////////// + +void scsptimingtest() +{ + scspminimalinit(); UnregisterAllTests(); RegisterTest(&ScuInterruptTest, "Sound Request Interrupt"); RegisterTest(&ScspTimerATest, "Timer A"); @@ -84,6 +96,15 @@ RegisterTest(&ScspTimerTimingTest5, "Timer timing w/32 sample inc"); RegisterTest(&ScspTimerTimingTest6, "Timer timing w/64 sample inc"); RegisterTest(&ScspTimerTimingTest7, "Timer timing w/128 sample inc"); + DoTests("SCSP Timer tests", 0, 0); +} + +////////////////////////////////////////////////////////////////////////////// + +void scspmisctest() +{ + scspminimalinit(); + UnregisterAllTests(); RegisterTest(&ScspIntOnTimerEnableTest, "Int on Timer enable behaviour"); RegisterTest(&ScspIntOnTimerResetTest, "Int on Timer reset behaviour"); RegisterTest(&ScspIntDupTest, "No second Int after Timer done"); Index: main.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/main.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- main.h 7 Jan 2008 03:10:46 -0000 1.1 +++ main.h 8 Jan 2008 09:28:40 -0000 1.2 @@ -17,7 +17,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _MAIN_H_ -#define _MAIN_H_ +#ifndef MAINH +#define MAINH -#endif /* _MAIN_H_ */ +void alltest(); + +#endif Index: vdp2.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/vdp2.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- vdp2.h 7 Jan 2008 03:10:46 -0000 1.1 +++ vdp2.h 8 Jan 2008 09:28:40 -0000 1.2 @@ -17,8 +17,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef VDP2_H -#define VDP2_H +#ifndef VDP2H +#define VDP2H void vdp2test(); Index: intfac.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/intfac.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- intfac.h 7 Jan 2008 03:10:46 -0000 1.1 +++ intfac.h 8 Jan 2008 09:28:40 -0000 1.2 @@ -1,25 +1,41 @@ +/* Copyright 2006-2008 Theo Berkau -#ifndef INTFAC_H -#define INTFAC_H -typedef struct -{ - s8 name[26]; - void (*func)(); -} MENUITEMSTRUCT; + This file is part of Lapetus. + + Lapetus is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + Lapetus is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Lapetus; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef INTFACH +#define INTFACH typedef struct { - int type; - s8 name[26]; int x; int y; - int w; - int h; - void *extra; - int attributes; - int (*func)(); + int width; + int height; + int fgcolor; + int bgcolor; } WINDOWSTRUCT; +typedef struct +{ + s8 name[26]; + void (*func)(); +} MENUITEMSTRUCT; + #define WINTYPE_NONE 0x00000000 #define WINTYPE_TITLE 0x00000001 #define WINTYPE_TEXT 0x00000002 @@ -29,9 +45,13 @@ #define WINATTR_INVISIBLE 0x00000000 #define WINATTR_GRAYED 0x00000002 -int DoMenu(MENUITEMSTRUCT *menu, int x, int y); -int DoWindow(WINDOWSTRUCT *window, int x, int y); +int DoMenu(MENUITEMSTRUCT *menu, int x, int y, const char *title); int MessageBox(const char *header, const char *body, int type); void ClearScr(void); +void WindowInit(void); +void WindowDraw(int x, int y, int width, int height, u16 fgcolor, u16 bgcolor); +void DoFullMenu(font_struct *font, MENUITEMSTRUCT *menu, const char *name, + int x, int y, int width, int height); + #endif Index: scu.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/scu.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- scu.c 7 Jan 2008 03:10:46 -0000 1.1 +++ scu.c 8 Jan 2008 09:28:40 -0000 1.2 @@ -76,10 +76,9 @@ for (;;) { - choice = DoMenu(scumenu, 8, 14); + choice = DoMenu(scumenu, 8, 14, "SCU Menu"); ClearScr(); - - if (choice == 3) + if (choice == ((sizeof(scumenu) / sizeof(MENUITEMSTRUCT)) - 2)) break; } } @@ -568,8 +567,6 @@ void TestISTandIMS() { - int i; - // Mask All interrupts SCUREG_IMS = 0xBFFF; Index: main.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/main.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- main.c 7 Jan 2008 03:10:46 -0000 1.2 +++ main.c 8 Jan 2008 09:28:40 -0000 1.3 @@ -19,20 +19,28 @@ #include <lapetus.h> #include "cdb.h" +#include "cart.h" +#include "m68k.h" #include "scsp.h" #include "scu.h" #include "sh2.h" +#include "smpc.h" +#include "vdp1.h" #include "vdp2.h" #include "intfac.h" +#include "main.h" MENUITEMSTRUCT mainmenu[] = { { "SH2 Test" , &sh2test, }, { "SCU Test", &scutest, }, { "CD Block Test" , &cdbtest, }, -//{ "68k Test" , &cdbtest, }, +{ "Cartridge Test" , &carttest, }, // Could almost autodetect the cart type +{ "68k Test" , &m68ktest, }, { "SCSP Test" , &scsptest, }, -//{ "VDP1 Test" , &vdp1test, }, +{ "SMPC Test" , &smpctest, }, +{ "VDP1 Test" , &vdp1test, }, { "VDP2 Test" , &vdp2test, }, +{ "Run all tests" , &alltest, }, { "\0", NULL } }; @@ -41,6 +49,12 @@ ////////////////////////////////////////////////////////////////////////////// +void alltest() +{ +} + +////////////////////////////////////////////////////////////////////////////// + int main() { int i; @@ -94,16 +108,15 @@ testdispfont.height = 8; testdispfont.bpp = 1; testdispfont.out = (u8 *)0x25E00000; - VdpSetFont(SCREEN_RBG0, &testdispfont); + VdpSetFont(SCREEN_RBG0, &testdispfont, 1); // Print messages and cursor - VdpPrintf(&testdispfont, 2 * 8, 1 * 8, 15, "Saturn Regression Test v0.2"); VdpDispOn(); // Display Main Menu for(;;) { - choice = DoMenu(mainmenu, 4, 14); + choice = DoMenu(mainmenu, 4, 14, "Saturn Regression Test v0.3"); ClearScr(); } } Index: tests.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/tests.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- tests.h 7 Jan 2008 03:10:46 -0000 1.1 +++ tests.h 8 Jan 2008 09:28:40 -0000 1.2 @@ -17,8 +17,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef TESTS_H -#define TESTS_H +#ifndef TESTSH +#define TESTSH #include <lapetus.h> Index: scsp.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/scsp.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- scsp.h 7 Jan 2008 03:10:46 -0000 1.1 +++ scsp.h 8 Jan 2008 09:28:40 -0000 1.2 @@ -17,9 +17,29 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef SCSP_H -#define SCSP_H +#ifndef SCSPH +#define SCSPH void scsptest(); +void scsptimingtest(); +void scspmisctest(); + +void ScuInterruptTest(void); +void ScspTimerATest(); +void ScspTimerBTest(); +void ScspTimerCTest(); +void ScspTimerTimingTest(u16 timersetting); +void ScspTimerTimingTest0(); +void ScspTimerTimingTest1(); +void ScspTimerTimingTest2(); +void ScspTimerTimingTest3(); +void ScspTimerTimingTest4(); +void ScspTimerTimingTest5(); +void ScspTimerTimingTest6(); +void ScspTimerTimingTest7(); +void ScspIntOnTimerEnableTest(); +void ScspIntOnTimerResetTest(); +void ScspIntDupTest(); +void ScspMCIPDTest(); #endif |
From: Theo B. <cyb...@us...> - 2008-01-07 22:14:39
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv20686 Modified Files: TODO Log Message: -Not complete, but should be more accurate now Index: TODO =================================================================== RCS file: /cvsroot/lapetus/lapetus/TODO,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- TODO 1 Mar 2007 23:20:24 -0000 1.2 +++ TODO 7 Jan 2008 22:14:35 -0000 1.3 @@ -1,14 +1,62 @@ +Action Replay/Commlink +----------------------- +-Almost done, just a few odd commmands that haven't been implemented + +CD Block +--------- +-Add CD file system support. That way people can easily opening files by + passing a string to a simple function. + +Backup Ram +----------- +-Nothing has been done here + +DRAM Cart +---------- +-Nothing has been done here + +Netlink +-------- +-Add it to cvs, finish writing it so people can actually do something with it + +SCSP +----- +-Aside from loading the sound driver, nothing else has been done here + +SMPC +----- +-Only standard pad, keyboard and mouse support have been added. + +SCU DSP +-------- +-Might need a few minor things, but otherwise complete + +System link +------------ +-I have some code for it, needs to be written so there's less lost data + +VDP1 +----- +-Might need some reworking, but otherwise complete + +VDP2 +----- +-Pretty much everything except for Rotation Screens, Back Screen and color offset + needs implementing + Features --------- -Fullscale Debugger +-gdb stub -Redo vdp code so that as little actual rendering is done during a v-blank as possible(only dma to vram, peripheral retrieving, etc. should be done) -From old code --------------- +Misc +----- -Clean up the rest of code, make to easier to use, and then merge it -It'd be more efficient to use tables in vdp vram cycle calculations as the code required do to all that work may end up taking more space than a table would -Optimize CD code better to fit the average programmer(I mean, they probably won't even use like half of what the cd block has to offer) + |
From: Theo B. <cyb...@us...> - 2008-01-07 03:22:53
|
Update of /cvsroot/lapetus/lapetus/tests/shared In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv3007 Added Files: BART.LNK crt0.s makefile Log Message: -Bunch of dependencies --- NEW FILE: crt0.s --- ! ! Bart's Custom Sega Saturn Start-Up Code ! Bart Trzynadlowski, 2001 ! Public domain ! ! For use with the GNU C Compiler. This code has been tested with gcc version ! cygnus-2.7-96q3. ! ! Make sure this is the first file linked into your project, so that it is at ! the very beginning. Use the BART.LNK linker script. Load the resulting ! binary at 0x6004000 on the Sega Saturn and begin execution there. ! .section .text ! ! Entry point ! .global start start: ! ! Clear BSS ! mov.l bss_start,r0 mov.l bss_end,r1 mov #0,r2 lbss: cmp/ge r0,r1 bt lbss_end add #1,r0 mov.b r2,@r0 bra lbss lbss_end: ! ! Set initial stack pointer. Stack is from 0x6002000-0x6003FFF ! mov.l stack_ptr,r15 ! ! Jump to main() ! mov.l main_ptr,r0 jsr @r0 nop ! ! When main() terminates, jump back to the ARP entry point ! mov.l arp_ptr,r0 jmp @r0 nop nop ! ! Following is never reached, it was the from the original ! version of crt0.s ! ! ! Once _main() has terminated, disable interrupts and loop infinitely ! mov #0xf,r0 shll2 r0 shll2 r0 ldc r0,sr end: bra end nop arp_ptr: .long 0x02000100 main_ptr: .long _main stack_ptr: .long 0x6004000 ! stack is from 0x6002000-0x6003FFF bss_start: .long __bss_start bss_end: .long __bss_end ! This is to keep libc happy .global _atexit bra end nop --- NEW FILE: makefile --- CC = sh-coff-gcc AS = sh-coff-as LD = sh-coff-ld ifndef TARGETTYPE TARGETTYPE = binary endif LDFLAGS = -nostartfiles --script ../shared/bart.lnk --oformat $(TARGETTYPE) CRT0 = obj/crt0.o LIBS = C:/PROGRA~1/KPITCU~1/GNUSHV~1/sh-coff/sh-coff/lib/libc.a \ C:/PROGRA~1/KPITCU~1/GNUSHV~1/sh-coff/lib/gcc/sh-coff/4.0-GNUSH_v0601/libgcc.a obj/crt0.o: ../shared/crt0.s $(AS) $< -o $@ --- NEW FILE: BART.LNK --- /* * Bart's Custom Sega Saturn Linker Script * Bart Trzynadlowski, 2001 * Public domain * * For use with the GNU linker, ld. This script has been tested with ld * version 2.6-96q3. * * This script allows code to be loaded at 0x6004000. Data follows immediately * after the code, and BSS (uninitialized data) immediately after that. The * output file is a plain binary image. Begin execution at the very beginning * of the binary (0x6004000.) */ OUTPUT_FORMAT("binary") SECTIONS { . = 0x6004000; .text : { *(.text) } .tors : { ___ctors = . ; *(.ctors) ___ctors_end = . ; ___dtors = . ; *(.dtors) ___dtors_end = . ; } .data : { *(.data) } __bss_start = .; .bss : { *(.bss) } __bss_end = .; _end = .; } |
From: Theo B. <cyb...@us...> - 2008-01-07 03:16:50
|
Update of /cvsroot/lapetus/lapetus/tests/shared In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv563/shared Log Message: Directory /cvsroot/lapetus/lapetus/tests/shared added to the repository |
From: Theo B. <cyb...@us...> - 2008-01-07 03:10:49
|
Update of /cvsroot/lapetus/lapetus/tests/regtest In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30683 Modified Files: main.c Added Files: cdb.c cdb.h dsp.c dsp.h intfac.c intfac.h main.h makefile objects scsp.c scsp.h scu.c scu.h sh2.c sh2.h tests.c tests.h vdp2.c vdp2.h Log Message: -Bunch of WIP stuff --- NEW FILE: sh2.c --- /* Copyright 2006-2007 Theo Berkau This file is part of Lapetus. Lapetus is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Lapetus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Lapetus; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <lapetus.h> #include "tests.h" #define SH2REG_IPRA (*(volatile u16 *)0xFFFFFEE2) #define SH2REG_DVSR (*(volatile u32 *)0xFFFFFF00) #define SH2REG_DVDNT (*(volatile u32 *)0xFFFFFF04) #define SH2REG_DVCR (*(volatile u32 *)0xFFFFFF08) #define SH2REG_VCRDIV (*(volatile u32 *)0xFFFFFF0C) #define SH2REG_DVDNTH (*(volatile u32 *)0xFFFFFF10) #define SH2REG_DVDNTL (*(volatile u32 *)0xFFFFFF14) #define SH2REG_DVDNTUH (*(volatile u32 *)0xFFFFFF18) #define SH2REG_DVDNTUL (*(volatile u32 *)0xFFFFFF1C) #define SH2REG_DVSR2 (*(volatile u32 *)0xFFFFFF20) #define SH2REG_DVDNT2 (*(volatile u32 *)0xFFFFFF24) #define SH2REG_DVCR2 (*(volatile u32 *)0xFFFFFF28) #define SH2REG_VCRDIV2 (*(volatile u32 *)0xFFFFFF2C) #define SH2REG_DVDNTH2 (*(volatile u32 *)0xFFFFFF30) #define SH2REG_DVDNTL2 (*(volatile u32 *)0xFFFFFF34) #define SH2REG_DVDNTUH2 (*(volatile u32 *)0xFFFFFF38) #define SH2REG_DVDNTUL2 (*(volatile u32 *)0xFFFFFF3C) void DivMirrorTest(void); void DivOperationTest(void); void DivInterruptTest(void); ////////////////////////////////////////////////////////////////////////////// void sh2test() { InterruptSetLevelMask(0xF); InitLapetus(RES_320x224); // Setup a screen for us draw on VdpRBG0Init(&testdispsettings); VdpSetDefaultPalette(); // Display On VdpDispOn(); UnregisterAllTests(); RegisterTest(&DivMirrorTest, "DIV register access"); RegisterTest(&DivOperationTest, "DIV operations"); RegisterTest(&DivInterruptTest, "DIV overflow interrupt"); DoTests("SH2 tests", 0, 0); } ////////////////////////////////////////////////////////////////////////////// #define TestAccessB(r) \ r = 0x01; \ if (r != 0x01) \ { \ stagestatus = STAGESTAT_BADDATA; \ return; \ } #define TestAccessW(r) \ r = 0x0102; \ if (r != 0x0102) \ { \ stagestatus = STAGESTAT_BADDATA; \ return; \ } #define TestAccessL(r) \ r = 0x01020304; \ if (r != 0x01020304) \ { \ stagestatus = STAGESTAT_BADDATA; \ return; \ } void DivMirrorTest(void) { // This tests DIV register reads/writes and checks mirroring TestAccessW(SH2REG_VCRDIV) TestAccessW(SH2REG_VCRDIV2) SH2REG_VCRDIV = 0; TestAccessB(SH2REG_DVCR) TestAccessB(SH2REG_DVCR2) SH2REG_DVCR = 0; TestAccessL(SH2REG_DVDNTH) TestAccessL(SH2REG_DVDNTH2) TestAccessL(SH2REG_DVSR) TestAccessL(SH2REG_DVSR2) TestAccessL(SH2REG_DVDNTUH) TestAccessL(SH2REG_DVDNTUH2) TestAccessL(SH2REG_DVDNTUL) TestAccessL(SH2REG_DVDNTUL2) stagestatus = STAGESTAT_DONE; } ////////////////////////////////////////////////////////////////////////////// void DivOperationTest(void) { // This tests to make sure the dividing operation is correct int i; // Test 64-bit/32-bit operation SH2REG_DVSR = 0x10; SH2REG_DVDNTH = 0x1; SH2REG_DVDNTL = 0x9; // Wait a bit for (i = 0; i < 20; i++) {} if (SH2REG_DVDNTL != 0x10000000 || SH2REG_DVDNTL2 != 0x10000000 || SH2REG_DVDNT != 0x10000000 || SH2REG_DVDNT2 != 0x10000000 || SH2REG_DVDNTUL != 0x10000000 || SH2REG_DVDNTUL2 != 0x10000000 || SH2REG_DVDNTH != 9 || SH2REG_DVDNTH2 != 9 || SH2REG_DVDNTUH != 9 || SH2REG_DVDNTUH2 != 9) { stagestatus = STAGESTAT_BADDATA; return; } // Ok, mirrors are working alright, and 64-bit/32-bit operation is correct // Test 32-bit/32-bit operation SH2REG_DVSR = 0x10; SH2REG_DVDNT = 0x10000009; // Wait a bit for (i = 0; i < 20; i++) {} if (SH2REG_DVDNTL != 0x1000000 || SH2REG_DVDNTL2 != 0x1000000 || SH2REG_DVDNT != 0x1000000 || SH2REG_DVDNT2 != 0x1000000 || SH2REG_DVDNTUL != 0x1000000 || SH2REG_DVDNTUL2 != 0x1000000 || SH2REG_DVDNTH != 9 || SH2REG_DVDNTH2 != 9 || SH2REG_DVDNTUH != 9 || SH2REG_DVDNTUH2 != 9) { stagestatus = STAGESTAT_BADDATA; return; } // Ok, mirrors are working alright, and 32-bit/32-bit operation is correct // Now let's do an overflow test(It seems you can only trigger it using 64-bit/32-bit operation) SH2REG_DVSR = 0x1; SH2REG_DVCR = 0; SH2REG_DVDNTH = 0x1; SH2REG_DVDNTL = 0x0; // Wait a bit for (i = 0; i < 20; i++) {} if (SH2REG_DVDNTL != 0x7FFFFFFF || SH2REG_DVDNTH != 0xFFFFFFFE || SH2REG_DVCR != 0x1) { stagestatus = STAGESTAT_BADDATA; return; } // Lastly, do two divide by zero tests SH2REG_DVSR = 0; SH2REG_DVCR = 0; SH2REG_DVDNT = 0; // Wait a bit for (i = 0; i < 20; i++) {} if (SH2REG_DVDNT != 0x7FFFFFFF || SH2REG_DVDNTH != 0 || SH2REG_DVCR != 0x1) { stagestatus = STAGESTAT_BADDATA; return; } SH2REG_DVSR = 0; SH2REG_DVCR = 0; SH2REG_DVDNT = 0xD0000000; // Wait a bit for (i = 0; i < 20; i++) {} if (SH2REG_DVDNT != 0x80000000 || SH2REG_DVDNTH != 0xFFFFFFFE || SH2REG_DVCR != 0x1) { stagestatus = STAGESTAT_BADDATA; return; } stagestatus = STAGESTAT_DONE; } ////////////////////////////////////////////////////////////////////////////// void sh2inttestfunc(void) __attribute__ ((interrupt_handler)); void sh2inttestfunc(void) { BIOS_SetSH2Interrupt(0x6E, 0); SH2REG_DVCR = 0; stagestatus = STAGESTAT_DONE; } ////////////////////////////////////////////////////////////////////////////// void DivInterruptTest(void) { // This tests to make sure an interrupt is generated when the registers are setup // for it, and an overflow occurs stagestatus = STAGESTAT_WAITINGFORINT; BIOS_SetSH2Interrupt(0x6E, sh2inttestfunc); SH2REG_VCRDIV = 0x6E; SH2REG_IPRA = 0xF << 12; InterruptSetLevelMask(0xE); SH2REG_DVSR = 0; SH2REG_DVCR = 0x2; SH2REG_DVDNT = 0xD0000000; // Alright, test is all setup, now when the interrupt is done, the test // will successfully complete } ////////////////////////////////////////////////////////////////////////////// --- NEW FILE: cdb.c --- /* Copyright 2006-2007 Theo Berkau This file is part of Lapetus. Lapetus is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Lapetus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Lapetus; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <lapetus.h> #include "tests.h" ////////////////////////////////////////////////////////////////////////////// void cdbtest() { } ////////////////////////////////////////////////////////////////////////////// --- NEW FILE: objects --- OBJ = $(CRT0) \ obj/main.o \ obj/cdb.o \ obj/dsp.o \ obj/scsp.o \ obj/scu.o \ obj/sh2.o \ obj/vdp2.o \ obj/tests.o \ obj/intfac.o EXTRALIBS = -llapetus --- NEW FILE: sh2.h --- /* Copyright 2006-2007 Theo Berkau This file is part of Lapetus. Lapetus is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Lapetus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Lapetus; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef SH2_H #define SH2_H void sh2test(); #endif --- NEW FILE: makefile --- # # (c) 2002 Charles MacDonald # (c) 2006 Theo Berkau # FLAGS = -Wall -g #EXE = main.bin EXE = main.coff all: $(EXE) TARGETTYPE = coff-sh include ../shared/makefile include ./objects $(EXE): $(OBJ) $(LD) $(LDFLAGS) $(OBJ) $(EXTRALIBS) $(LIBS) -o $(EXE) obj/%.o: %.c %.h $(CC) -c $< -o $@ $(FLAGS) obj/%.o: %.s $(AS) $< -o $@ pack: sh-coff-strip $(EXE) --strip-all clean: rm -f obj/*.o rm -f *.bin makedir: mkdir obj --- NEW FILE: cdb.h --- /* Copyright 2006-2007 Theo Berkau This file is part of Lapetus. Lapetus is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Lapetus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Lapetus; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef CDB_H #define CDB_H void cdbtest(); #endif --- NEW FILE: scu.h --- /* Copyright 2006-2007 Theo Berkau This file is part of Lapetus. Lapetus is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Lapetus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Lapetus; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef SCU_H #define SCU_H void scutest(); void TestSCUVERRegister(); void TestVBlankInInterrupt(); void TestVBlankOutInterrupt(); void TestHBlankInInterrupt(); void TestTimer0Interrupt(); void TestTimer1Interrupt(); void TestDSPEndInterrupt(); void TestSoundRequestInterrupt(); void TestSMPCInterrupt(); void TestPadInterrupt(); void TestDMA0Interrupt(); void TestDMA1Interrupt(); void TestDMA2Interrupt(); void TestDMAIllegalInterrupt(); void TestSpriteDrawEndInterrupt(); void TestCDBlockInterrupt(); void TestDMA(); void TestDMA0(); void TestDMA1(); void TestDMA2(); void TestDMAMisalignment(); void TestISTandIMS(); void TestDSP(); void TestMVI_Imm_d(); void scuinttest(void); void scudmatest(); void scudsptest(); #endif --- NEW FILE: intfac.c --- #include <string.h> #include <lapetus.h> #include "intfac.h" #include "tests.h" ////////////////////////////////////////////////////////////////////////////// void ClearScr(void) { int i, i2; VdpDispOff(); VdpClearScreen(&testdispfont); VdpDispOn(); } ////////////////////////////////////////////////////////////////////////////// int DoMenu(MENUITEMSTRUCT *menu, int x, int y) { int cursel=0; int nummenu=0; int i; // Make sure current screen is clear // Figure out how many menu items there are for (;;) { if (menu[nummenu].name[0] == '\0') break; nummenu++; } // Add Menu Sprite to draw list for (i = 0; i < nummenu; i++) VdpPrintf(&testdispfont, (x+1) * 8, (y+i) * 8, 0xF, (char *)menu[i].name); // Add Selected Menu Item(should always be first item) sprite to draw list VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, ">"); for (;;) { VdpVsync(); // poll joypad(if menu item is selected, return) if (per[0].butpushonce & PAD_UP) { VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, " "); if (cursel > 0) cursel--; VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, ">"); } else if (per[0].butpushonce & PAD_DOWN) { VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, " "); if (cursel < (nummenu - 1)) cursel++; VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, ">"); } if (per[0].butpushonce & PAD_A) { ClearScr(); if (menu[cursel].func) menu[cursel].func(); return cursel; } } } ////////////////////////////////////////////////////////////////////////////// int DoWindow(WINDOWSTRUCT *window, int x, int y) { int nummenu=0; int i; // Make sure current screen is clear // Figure out how many window items there are for (;;) { // if (menu[nummenu].name[0] == '\0') break; // nummenu++; } /* // Add Menu Sprite to draw list for (i = 0; i < nummenu; i++) VdpPrintf(&testdispfont, (x+1) * 8, (y+i) * 8, 0xF, (char *)menu[i].name); // Add Selected Menu Item(should always be first item) sprite to draw list VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, ">"); for (;;) { VdpVsync(); // poll joypad(if menu item is selected, return) if (per[0].butpushonce & PAD_UP) { VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, " "); if (cursel > 0) cursel--; VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, ">"); } else if (per[0].butpushonce & PAD_DOWN) { VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, " "); if (cursel < (nummenu - 1)) cursel++; VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, ">"); } if (per[0].butpushonce & PAD_A) { ClearScr(); if (menu[cursel].func) menu[cursel].func(); return cursel; } } */ } ////////////////////////////////////////////////////////////////////////////// /* int MessageBox(const char *header, const char *body, int type) { int body_x=0, body_y=0; body_x = ((320 / 8) - strlen(body)) / 2; // fix me body_y = (224 / 8) / 2; // fix me for (;;) { VdpVsync(); // VdpStartDrawList(); // Vdp1printf(body_x * 8, body_y * 8, 0xF0, (char *)body); // _printf(body_x * 8, body_y * 8, 0xF0, (char *)body); // Vdp1DrawPolygon(body_x - 8, body_y - 8, // body_x + (strlen(body) * 8) + 8, body_y - 8, // body_x + (strlen(body) * 8) + 8, body_y + 16, // fix me // body_x - 8, body_y + 16, // fix me // RGB16(0, 0, 127), // SPRITE_ENDCODEDISABLE | SPRITE_TRANSPIXELDISABLE | SPRITE_16BPP); // Vdp1DrawNormalSprite(0, 16, 16, 0, 0, 0); // Vdp1DrawPolygon(0, 0, // 200, 0, // 200, 180, // 0, 180, // 0xFFFE, // SPRITE_ENDCODEDISABLE); // RGB16_COLOR(10,20,30), // Vdp1DrawDistortedSprite(0, 16, 16, 0, 0, 16, 0, 16, 16, 0, 16, 0); // VdpEndDrawList(); switch (type) { // fix me default: VdpPrintf(&testdispfont, ((320 / 16) - 1) * 8, (body_y+2) * 8, 0xF, "OK"); //fix me break; } if (per[0].id == PER_KEYBOARD) { keyboarddata_struct *kbd=(keyboarddata_struct *)&per[0]; if (kbd->flags & 0x8) // Make { if (kbd->key == KEY_ENTER || kbd->key == KEY_KPENTER || kbd->key == KEY_SPACE || kbd->key == KEY_ESC) break; } } else if (per[0].butpushonce & PAD_A) { break; } } ClearScr(); return 0; // fix me(it should return what control was chosen) } */ ////////////////////////////////////////////////////////////////////////////// /* lwnd_struct *LWICreateWindow(char *name, int style, int x, int y, int width, int height, lwnd_struct *parent) { } ////////////////////////////////////////////////////////////////////////////// int LWIGetMessage(lmsg_struct *msg, lwnd_struct *wnd, int filtermin, int filtermax) { } ////////////////////////////////////////////////////////////////////////////// int LWIDispatchMessage(lmsg_struct *msg) { } ////////////////////////////////////////////////////////////////////////////// */ --- NEW FILE: vdp2.c --- /* Copyright 2006-2007 Theo Berkau This file is part of Lapetus. Lapetus is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Lapetus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Lapetus; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <lapetus.h> #include "tests.h" void Vdp2NBG0Test (); void Vdp2NBG1Test (); void Vdp2NBG2Test (); void Vdp2NBG3Test (); void Vdp2RBG0Test (); void Vdp2RBG1Test (); ////////////////////////////////////////////////////////////////////////////// void hline(int x1, int y1, int x2, u8 color) { int i; volatile u8 *buf=(volatile u8 *)(0x25E00000+(y1 * 512)); for (i = x1; i < (x2+1); i++) buf[i] = color; } ////////////////////////////////////////////////////////////////////////////// void vline(int x1, int y1, int y2, u8 color) { int i; volatile u8 *buf=(volatile u8 *)(0x25E00000+(y1 * 512) + x1); for (i = 0; i < (y2-y1+1); i++) buf[i * 512] = color; } ////////////////////////////////////////////////////////////////////////////// void DrawBox(int x1, int y1, int x2, int y2, u8 color) { hline(x1, y1, x2, color); hline(x1, y2, x2, color); vline(x1, y1, y2, color); vline(x2, y1, y2, color); } ////////////////////////////////////////////////////////////////////////////// void WorkingQuerry(const char *question) { // Ask the user if it's visible VdpPrintf(&testdispfont, 2 * 8, 20 * 8, 0xF, question); VdpPrintf(&testdispfont, 2 * 8, 21 * 8, 0xF, "C - Yes B - No"); for(;;) { VdpVsync(); if (per[0].butpushonce & PAD_B) { stagestatus = STAGESTAT_BADGRAPHICS; break; } else if (per[0].butpushonce & PAD_C) { stagestatus = STAGESTAT_DONE; break; } } } ////////////////////////////////////////////////////////////////////////////// void vdp2test() { // Put system in minimalized state InterruptSetLevelMask(0xF); InitLapetus(RES_320x224); VdpRBG0Init(&testdispsettings); VdpSetDefaultPalette(); // Display On VdpDispOn(); UnregisterAllTests(); // RegisterTest(&Vdp2InterruptTest, "Sound Request Interrupt"); RegisterTest(&Vdp2RBG0Test, "RBG0 bitmap"); DoTests("VDP2 Screen tests", 0, 0); } ////////////////////////////////////////////////////////////////////////////// void Vdp2NBG0Test () { screensettings_struct settings; // Draw a box on our default screen DrawBox(120, 180, 80, 40, 15); // Setup NBG0 for drawing settings.isbitmap = TRUE; settings.bitmapsize = BG_BITMAP512x256; settings.transparentbit = 0; settings.color = BG_256COLOR; settings.specialpriority = 0; settings.specialcolorcalc = 0; settings.extrapalettenum = 0; // settings.mapoffset = 0; // settings.parameteraddr = 0x25E60000; VdpNBG0Init(&settings); // Draw some stuff on the screen WorkingQuerry("Is the above graphics displayed?"); // Disable NBG0 VdpNBG0DeInit(); } ////////////////////////////////////////////////////////////////////////////// void Vdp2NBG1Test () { } ////////////////////////////////////////////////////////////////////////////// void Vdp2NBG2Test () { } ////////////////////////////////////////////////////////////////////////////// void Vdp2NBG3Test () { } ////////////////////////////////////////////////////////////////////////////// void Vdp2RBG0Test () { // Draw a box on our default screen DrawBox(120, 180, 80, 40, 15); // Draw some graphics on the RBG0 layer WorkingQuerry("Is the above graphics displayed?"); } ////////////////////////////////////////////////////////////////////////////// void Vdp2RBG1Test () { } ////////////////////////////////////////////////////////////////////////////// --- NEW FILE: scsp.c --- /* Copyright 2006-2007 Theo Berkau This file is part of Lapetus. Lapetus is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Lapetus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Lapetus; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <lapetus.h> #include "tests.h" #define SCSPREG_TIMERA (*(volatile u16 *)0x25B00418) #define SCSPREG_TIMERB (*(volatile u16 *)0x25B0041A) #define SCSPREG_TIMERC (*(volatile u16 *)0x25B0041C) #define SCSPREG_SCIEB (*(volatile u16 *)0x25B0041E) #define SCSPREG_SCIPD (*(volatile u16 *)0x25B00420) #define SCSPREG_SCIRE (*(volatile u16 *)0x25B00422) #define SCSPREG_MCIEB (*(volatile u16 *)0x25B0042A) #define SCSPREG_MCIPD (*(volatile u16 *)0x25B0042C) #define SCSPREG_MCIRE (*(volatile u16 *)0x25B0042E) volatile u32 hblankcounter=0; int tinc=0; void ScuInterruptTest(void); void ScspTimerATest(); void ScspTimerBTest(); void ScspTimerCTest(); void ScspTimerTimingTest(u16 timersetting); void ScspTimerTimingTest0(); void ScspTimerTimingTest1(); void ScspTimerTimingTest2(); void ScspTimerTimingTest3(); void ScspTimerTimingTest4(); void ScspTimerTimingTest5(); void ScspTimerTimingTest6(); void ScspTimerTimingTest7(); void ScspIntOnTimerEnableTest(); void ScspIntOnTimerResetTest(); void ScspIntDupTest(); void ScspMCIPDTest(); ////////////////////////////////////////////////////////////////////////////// void scsptest() { // Put system in minimalized state InterruptSetLevelMask(0xF); InitLapetus(RES_320x224); VdpRBG0Init(&testdispsettings); VdpSetDefaultPalette(); // Turn off sound cpu SmpcIssueCommand(0x07); // Display On VdpDispOn(); UnregisterAllTests(); RegisterTest(&ScuInterruptTest, "Sound Request Interrupt"); RegisterTest(&ScspTimerATest, "Timer A"); RegisterTest(&ScspTimerBTest, "Timer B"); RegisterTest(&ScspTimerCTest, "Timer C"); RegisterTest(&ScspTimerTimingTest0, "Timer timing w/1 sample inc"); RegisterTest(&ScspTimerTimingTest1, "Timer timing w/2 sample inc"); RegisterTest(&ScspTimerTimingTest2, "Timer timing w/4 sample inc"); RegisterTest(&ScspTimerTimingTest3, "Timer timing w/8 sample inc"); RegisterTest(&ScspTimerTimingTest4, "Timer timing w/16 sample inc"); RegisterTest(&ScspTimerTimingTest5, "Timer timing w/32 sample inc"); RegisterTest(&ScspTimerTimingTest6, "Timer timing w/64 sample inc"); RegisterTest(&ScspTimerTimingTest7, "Timer timing w/128 sample inc"); RegisterTest(&ScspIntOnTimerEnableTest, "Int on Timer enable behaviour"); RegisterTest(&ScspIntOnTimerResetTest, "Int on Timer reset behaviour"); RegisterTest(&ScspIntDupTest, "No second Int after Timer done"); // RegisterTest(&ScspMCIPDTest, "MCIPD bit cleared after Timer Int"); DoTests("SCSP Interrupt tests", 0, 0); } ////////////////////////////////////////////////////////////////////////////// void scspinttestfunc() { stagestatus = STAGESTAT_DONE; // Mask SCSP interrupts BIOS_ChangeSCUInterruptMask(0xFFFFFFFF, 0x40); } ////////////////////////////////////////////////////////////////////////////// void ScuInterruptTest() { // Disable everything temporarily SCSPREG_SCIEB = 0; SCSPREG_MCIEB = 0; // Mask SCSP interrupt temporarily BIOS_ChangeSCUInterruptMask(0xFFFFFFFF, 0x40); // Set SCSP interrupt function BIOS_SetSCUInterrupt(0x46, scspinttestfunc); // Unmask SCSP interrupt BIOS_ChangeSCUInterruptMask(~0x40, 0); // Enable all SCSP Main cpu interrupts SCSPREG_MCIEB = 0x7FF; SCSPREG_MCIRE = 0x7FF; } ////////////////////////////////////////////////////////////////////////////// void ScspTimerTest(int timermask) { // Disable everything temporarily SCSPREG_SCIEB = 0; SCSPREG_MCIEB = 0; // Mask SCSP interrupt temporarily BIOS_ChangeSCUInterruptMask(0xFFFFFFFF, 0x40); // Set SCSP interrupt function BIOS_SetSCUInterrupt(0x46, scspinttestfunc); // Unmask SCSP interrupt BIOS_ChangeSCUInterruptMask(~0x40, 0); stagestatus = STAGESTAT_WAITINGFORINT; // Enable Timer interrupt SCSPREG_MCIRE = timermask; SCSPREG_MCIEB = timermask; } ////////////////////////////////////////////////////////////////////////////// void ScspTimerATest() { ScspTimerTest(0x40); } ////////////////////////////////////////////////////////////////////////////// void ScspTimerBTest() { ScspTimerTest(0x80); } ////////////////////////////////////////////////////////////////////////////// void ScspTimerCTest() { ScspTimerTest(0x100); } ////////////////////////////////////////////////////////////////////////////// void scsptimingfunc(void) { u32 hblanktemp; hblanktemp = hblankcounter; // VdpPrintf(&testdispfont, 1 * 8, 22 * 8, 0xF, "hblankcounter: %08X", hblanktemp); switch (tinc) { case 0: if ((hblanktemp & 0xFF00) < 0x100) // fix me stagestatus = STAGESTAT_DONE; else stagestatus = STAGESTAT_BADTIMING; break; case 1: if ((hblanktemp & 0xFF00) < 0x100) // fix me stagestatus = STAGESTAT_DONE; else stagestatus = STAGESTAT_BADTIMING; break; case 2: if ((hblanktemp & 0xFF00) == 0x100) // fix me stagestatus = STAGESTAT_DONE; else stagestatus = STAGESTAT_BADTIMING; break; case 3: if ((hblanktemp & 0xFF00) == 0x200) // fix me stagestatus = STAGESTAT_DONE; else stagestatus = STAGESTAT_BADTIMING; break; case 4: if ((hblanktemp & 0xFF00) == 0x500) // fix me stagestatus = STAGESTAT_DONE; else stagestatus = STAGESTAT_BADTIMING; break; case 5: if ((hblanktemp & 0xFF00) == 0xB00) // fix me stagestatus = STAGESTAT_DONE; else stagestatus = STAGESTAT_BADTIMING; break; case 6: if ((hblanktemp & 0xFF00) == 0x1600) // fix me stagestatus = STAGESTAT_DONE; else stagestatus = STAGESTAT_BADTIMING; break; case 7: if ((hblanktemp & 0xFF00) == 0x2D00) // fix me stagestatus = STAGESTAT_DONE; else stagestatus = STAGESTAT_BADTIMING; default: stagestatus = STAGESTAT_DONE; break; } } ////////////////////////////////////////////////////////////////////////////// void hblanktimingfunc(void) { hblankcounter++; } ////////////////////////////////////////////////////////////////////////////// void ScspTimerTimingTest(u16 timersetting) { // Disable everything temporarily SCSPREG_SCIEB = 0; SCSPREG_MCIEB = 0; tinc = timersetting >> 8; InterruptSetLevelMask(0xF); // Mask SCSP/H-blank interrupts temporarily BIOS_ChangeSCUInterruptMask(0xFFFFFFFF, 0x40 | 0x4); // Set SCSP interrupt function BIOS_SetSCUInterrupt(0x46, scsptimingfunc); // Set Hblank-in interrupt function BIOS_SetSCUInterrupt(0x42, hblanktimingfunc); // Unmask SCSP/H-blank interrupts BIOS_ChangeSCUInterruptMask(~(0x40 | 0x4), 0); hblankcounter = 0; VdpVsync(); // switch (timermask) // { // case 0x40: SCSPREG_TIMERA = timersetting; // break; // case 0x80: // SCSPREG_TIMERB = timersetting; // break; // case 0x100: // SCSPREG_TIMERC = timersetting; // break; // default: break; // } InterruptSetLevelMask(0x8); stagestatus = STAGESTAT_WAITINGFORINT; // Enable Timer interrupt SCSPREG_MCIRE = 0x0040; SCSPREG_MCIEB = 0x0040; } ////////////////////////////////////////////////////////////////////////////// void ScspTimerTimingTest0() { ScspTimerTimingTest(0x0000); } ////////////////////////////////////////////////////////////////////////////// void ScspTimerTimingTest1() { ScspTimerTimingTest(0x0100); } ////////////////////////////////////////////////////////////////////////////// void ScspTimerTimingTest2() { ScspTimerTimingTest(0x0200); } ////////////////////////////////////////////////////////////////////////////// void ScspTimerTimingTest3() { ScspTimerTimingTest(0x0300); } ////////////////////////////////////////////////////////////////////////////// void ScspTimerTimingTest4() { ScspTimerTimingTest(0x0400); } ////////////////////////////////////////////////////////////////////////////// void ScspTimerTimingTest5() { ScspTimerTimingTest(0x0500); } ////////////////////////////////////////////////////////////////////////////// void ScspTimerTimingTest6() { ScspTimerTimingTest(0x0600); } ////////////////////////////////////////////////////////////////////////////// void ScspTimerTimingTest7() { ScspTimerTimingTest(0x0700); } ////////////////////////////////////////////////////////////////////////////// void intontimerenabletestfunc(void) { // u32 hblanktemp; // hblanktemp = hblankcounter; if (hblankcounter == 0) stagestatus = STAGESTAT_DONE; else stagestatus = STAGESTAT_BADTIMING; // VdpPrintf(&testdispfont, 1 * 8, 23 * 8, 0xF, "hblankcounter: %08X", hblanktemp); } ////////////////////////////////////////////////////////////////////////////// void ScspIntOnTimerEnableTest() { // Disable everything temporarily SCSPREG_SCIEB = 0; SCSPREG_MCIEB = 0; // Mask SCSP/H-blank interrupts temporarily BIOS_ChangeSCUInterruptMask(0xFFFFFFFF, 0x40 | 0x4); // Set SCSP interrupt function BIOS_SetSCUInterrupt(0x46, intontimerenabletestfunc); // Set Hblank-in interrupt function BIOS_SetSCUInterrupt(0x42, hblanktimingfunc); // Unmask SCSP/H-blank interrupts BIOS_ChangeSCUInterruptMask(~(0x40 | 0x4), 0); // Clear timer SCSPREG_TIMERA = 0x0700; SCSPREG_MCIRE = 0x40; // Wait until MCIPD is showing an interrupt pending while (!(SCSPREG_MCIPD & 0x40)) {} stagestatus = STAGESTAT_WAITINGFORINT; // Enable Timer interrupt hblankcounter = 0; SCSPREG_MCIEB = 0x40; } ////////////////////////////////////////////////////////////////////////////// void ScspIntOnTimerResetTest() { // Disable everything temporarily SCSPREG_SCIEB = 0; SCSPREG_MCIEB = 0; // Mask SCSP interrupt temporarily BIOS_ChangeSCUInterruptMask(0xFFFFFFFF, 0x40); // Set SCSP interrupt function BIOS_SetSCUInterrupt(0x46, 0); // Unmask SCSP interrupt BIOS_ChangeSCUInterruptMask(~0x40, 0); // Enable timer SCSPREG_TIMERA = 0x0700; SCSPREG_MCIRE = 0x40; SCSPREG_MCIEB = 0x40; // Wait until MCIPD is showing an interrupt pending while (!(SCSPREG_MCIPD & 0x40)) {} // Set SCSP interrupt function BIOS_SetSCUInterrupt(0x46, scspinttestfunc); stagestatus = STAGESTAT_WAITINGFORINT; // Reset Timer hblankcounter = 0; SCSPREG_MCIRE = 0x40; } ////////////////////////////////////////////////////////////////////////////// void ScspIntDupTest() { // Disable everything temporarily SCSPREG_SCIEB = 0; SCSPREG_MCIEB = 0; // Mask SCSP/H-blank interrupts temporarily BIOS_ChangeSCUInterruptMask(0xFFFFFFFF, 0x40 | 0x4); // Set SCSP interrupt function BIOS_SetSCUInterrupt(0x46, 0); // Set Hblank-in interrupt function BIOS_SetSCUInterrupt(0x42, hblanktimingfunc); // Unmask SCSP/H-blank interrupts BIOS_ChangeSCUInterruptMask(~(0x40 | 0x4), 0); // Enable timer SCSPREG_TIMERA = 0; SCSPREG_MCIRE = 0x40; SCSPREG_MCIEB = 0x40; // Wait until MCIPD is showing an interrupt pending while (!(SCSPREG_MCIPD & 0x40)) {} // Set SCSP interrupt function BIOS_SetSCUInterrupt(0x46, scspinttestfunc); // Wait around 0x2000 hblanks to make sure nothing else triggers the interrupt hblankcounter = 0; while (hblankcounter < 0x2000) {} if (stagestatus == STAGESTAT_DONE) stagestatus = STAGESTAT_BADINTERRUPT; else stagestatus = STAGESTAT_DONE; } ////////////////////////////////////////////////////////////////////////////// void mcipdtestfunc() { u16 mcipdtemp=SCSPREG_MCIPD; VdpPrintf(&testdispfont, 1 * 8, 22 * 8, 0xF, "MCIPD: %04X", mcipdtemp); } ////////////////////////////////////////////////////////////////////////////// void ScspMCIPDTest() { // Disable everything temporarily SCSPREG_SCIEB = 0; SCSPREG_MCIEB = 0; // Mask SCSP/H-blank interrupts temporarily BIOS_ChangeSCUInterruptMask(0xFFFFFFFF, 0x40); // Set SCSP interrupt function BIOS_SetSCUInterrupt(0x46, mcipdtestfunc); // Unmask SCSP/H-blank interrupts BIOS_ChangeSCUInterruptMask(~0x40, 0); stagestatus = STAGESTAT_WAITINGFORINT; // Enable timer SCSPREG_TIMERA = 0x0700; SCSPREG_MCIRE = 0x40; SCSPREG_MCIEB = 0x40; } ////////////////////////////////////////////////////////////////////////////// --- NEW FILE: tests.c --- /* Copyright 2006-2007 Theo Berkau This file is part of Lapetus. Lapetus is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Lapetus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Lapetus; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <lapetus.h> #include "tests.h" int stagestatus=STAGESTAT_START; int waitcounter; u32 errordata=0; typedef struct { void (*testfunc)(void); const char *name; } tests_struct; tests_struct tests[0x100]; u8 numtests=0; ////////////////////////////////////////////////////////////////////////////// void InitTest(void) { // Put saturn in a minimalized state int i; InterruptSetLevelMask(0xF); for (i = 0; i < 0x80; i++) BIOS_SetSH2Interrupt(i, 0); for (i = 0x40; i < 0x60; i++) BIOS_SetSCUInterrupt(i, 0); // Make sure all interrupts have been called BIOS_ChangeSCUInterruptMask(0, 0); BIOS_ChangeSCUInterruptMask(0xFFFFFFFF, 0xFFFFFFFF); VdpInit(RES_320x224); // PerInit(); CommlinkStopService(); // if (InterruptGetLevelMask() > 0x7) // InterruptSetLevelMask(0x7); VdpRBG0Init(&testdispsettings); } ////////////////////////////////////////////////////////////////////////////// void DoTests(const char *testname, int x, int y) { int i; u8 stage=0; // Print messages and cursor VdpPrintf(&testdispfont, x * 8, y * 8, 0xF, (char *)testname); for(;;) { VdpVsync(); if (stagestatus != STAGESTAT_BUSY && stagestatus != STAGESTAT_WAITINGFORINT) { if (stagestatus == STAGESTAT_DONE) VdpPrintf(&testdispfont, (x+38) * 8, (y + stage + 2) * 8, 0xA, "OK"); else if (stagestatus < 0) { // Handle error switch (stagestatus) { case STAGESTAT_BADTIMING: VdpPrintf(&testdispfont, (x+38) * 8, (y + stage + 2) * 8, 0xE, "BT"); break; case STAGESTAT_BADDATA: VdpPrintf(&testdispfont, (x+38) * 8, (y + stage + 2) * 8, 0xC, "BD"); break; case STAGESTAT_BADINTERRUPT: VdpPrintf(&testdispfont, (x+38) * 8, (y + stage + 2) * 8, 0xC, "BI"); break; default: VdpPrintf(&testdispfont, (x+38) * 8, (y + stage + 2) * 8, 0xC, "failed"); break; } } if (stage >= numtests) { VdpPrintf(&testdispfont, x * 8, (y + stage + 3) * 8, 0xF, "All tests done."); break; } stagestatus = STAGESTAT_BUSY; if (tests[stage].name) VdpPrintf(&testdispfont, x * 8, (y + stage + 3) * 8, 0xF, (char *)tests[stage].name); if (tests[stage].testfunc) tests[stage].testfunc(); waitcounter = 60 * 5; stage++; } else { if (stagestatus == STAGESTAT_WAITINGFORINT) { // decrement waitcounter waitcounter--; if (waitcounter <= 0) stagestatus = STAGESTAT_BADINTERRUPT; VdpPrintf(&testdispfont, 0 * 8, 23 * 8, 0xF, "%08X", waitcounter); } } } // Reset all interrupts for (i = 0; i < 0x80; i++) BIOS_SetSH2Interrupt(i, 0); for (i = 0x40; i < 0x60; i++) BIOS_SetSCUInterrupt(i, 0); PerInit(); InterruptSetLevelMask(0x6); VdpVsync(); // Wait until no buttons are pressed while (per[0].butpushonce || per[0].butpush) { VdpVsync(); } for (;;) { VdpVsync(); // return whenever a button pressed if (per[0].butpushonce & PAD_A || per[0].butpushonce & PAD_B || per[0].butpushonce & PAD_C || per[0].butpushonce & PAD_X || per[0].butpushonce & PAD_Y || per[0].butpushonce & PAD_Z || per[0].butpushonce & PAD_L || per[0].butpushonce & PAD_R || per[0].butpushonce & PAD_START) break; } } ////////////////////////////////////////////////////////////////////////////// void RegisterTest(void (*func)(void), const char *name) { tests[numtests].testfunc = func; tests[numtests].name = name; numtests++; } ////////////////////////////////////////////////////////////////////////////// void UnregisterAllTests() { int i; for (i = 0; i < 0x100; i++) { tests[i].testfunc = 0; tests[i].name = 0; } numtests=0; stagestatus=STAGESTAT_START; } ////////////////////////////////////////////////////////////////////////////// --- NEW FILE: dsp.h --- /* Copyright 2006-2008 Theo Berkau This file is part of Lapetus. Lapetus is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Lapetus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Lapetus; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef DSPH #define DSPH void scudsptest(); void TestDSP(); void TestMVI_Imm_d(); void TestDSPTiming(); #define NOP() 0x00000000 #define AND() (1 << 26) #define OR() (2 << 26) #define XOR() (3 << 26) #define ADD() (4 << 26) #define SUB() (5 << 26) #define AD2() (6 << 26) #define SR() (8 << 26) #define RR() (9 << 26) #define SL() (10 << 26) #define RL() (11 << 26) #define RL8() (15 << 26) #define MOVSRC_MC0 0x0 #define MOVSRC_MC1 0x1 #define MOVSRC_MC2 0x2 #define MOVSRC_MC3 0x3 #define MOVSRC_MC0P 0x4 #define MOVSRC_MC1P 0x5 #define MOVSRC_MC2P 0x6 #define MOVSRC_MC3P 0x7 #define MOVSRC_ALUL 0x9 #define MOVSRC_ALUH 0xA #define MOV_s_X(s) (0x02000000 | (s << 20)) #define MOV_MUL_P() (0x01000000) #define MOV_s_P(s) (0x01800000 | (s << 20)) #define MOV_s_Y(s) (0x00080000 | (s << 14)) #define CLR_A() (0x00020000) #define MOV_ALU_A() (0x00040000) #define MOV_s_A(s) (0x00060000 | (s << 14)) #define MOVDEST_MC0 0x0 #define MOVDEST_MC1 0x1 #define MOVDEST_MC2 0x2 #define MOVDEST_MC3 0x3 #define MOVDEST_RX 0x4 #define MOVDEST_PL 0x5 #define MOVDEST_RA0 0x6 #define MOVDEST_WA0 0x7 #define MOVDEST_LOP 0xA #define MOVDEST_TOP 0xB #define MOVDEST_CT0 0xC #define MOVDEST_CT1 0xD #define MOVDEST_CT2 0xE #define MOVDEST_CT3 0xF #define MOV_Imm_d(imm, d) (0x00001000 | (d << 8) | ((imm) & 0xFF)) #define MOV_s_d(s, d) (0x00003000 | (d << 8) | (s)) #define MVIDEST_MC0 0x0 #define MVIDEST_MC1 0x1 #define MVIDEST_MC2 0x2 #define MVIDEST_MC3 0x3 #define MVIDEST_RX 0x4 #define MVIDEST_PL 0x5 #define MVIDEST_RA0 0x6 #define MVIDEST_WA0 0x7 #define MVIDEST_LOP 0xA #define MVIDEST_PC 0xC #define MVI_Imm_d(imm, d) (0x80000000 | ((imm) & 0x1FFFFFF) | (d << 26)) #define MVI_Imm_d_Z(imm, d) (0x82000000 | (0x21 << 19) | ((imm) & 0x7FFFF) | (d << 26)) #define MVI_Imm_d_NZ(imm, d) (0x82000000 | (0x1 << 19) | ((imm) & 0x7FFFF) | (d << 26)) #define MVI_Imm_d_S(imm, d) (0x82000000 | (0x22 << 19) | ((imm) & 0x7FFFF) | (d << 26)) #define MVI_Imm_d_NS(imm, d) (0x82000000 | (0x2 << 19) | ((imm) & 0x7FFFF) | (d << 26)) #define MVI_Imm_d_C(imm, d) (0x82000000 | (0x24 << 19) | ((imm) & 0x7FFFF) | (d << 26)) #define MVI_Imm_d_NC(imm, d) (0x82000000 | (0x4 << 19) | ((imm) & 0x7FFFF) | (d << 26)) #define MVI_Imm_d_T0(imm, d) (0x82000000 | (0x28 << 19) | ((imm) & 0x7FFFF) | (d << 26)) #define MVI_Imm_d_NT0(imm, d) (0x82000000 | (0x8 << 19) | ((imm) & 0x7FFFF) | (d << 26)) #define MVI_Imm_d_ZS(imm, d) (0x82000000 | (0x23 << 19) | ((imm) & 0x7FFFF) | (d << 26)) #define MVI_Imm_d_NZS(imm, d) (0x82000000 | (0x3 << 19) | ((imm) & 0x7FFFF) | (d << 26)) #define DMAADD_0 0x0 #define DMAADD_1 0x1 #define DMAADD_2 0x2 #define DMAADD_4 0x3 #define DMAADD_8 0x4 #define DMAADD_16 0x5 #define DMAADD_32 0x6 #define DMAADD_64 0x7 #define DMARAM_0 0x0 #define DMARAM_1 0x1 #define DMARAM_2 0x2 #define DMARAM_3 0x3 #define DMARAM_PROG 0x4 #define DMA_D0_RAM_Imm(add, ram, imm) (0xC0000000 | (add << 15) | (ram << 8) | (imm & 0xFF)) #define DMA_RAM_D0_Imm(add, ram, imm) (0xC0001000 | (add << 15) | (ram << 8) | (imm & 0xFF)) #define DMA_D0_RAM_s(add, ram, s) (0xC0002000 | (add << 15) | (ram << 8) | s) #define DMA_RAM_D0_s(add, ram, s) (0xC0003000 | (add << 15) | (ram << 8) | s) //#define DMAH_D0_RAM_Imm(add, ram, imm) (0xC??????? | (add << 15) | (ram << 8) | (imm & 0xFF)) //#define DMAH_RAM_D0_Imm(add, ram, imm) (0xC??????? | (add << 15) | (ram << 8) | (imm & 0xFF)) //#define DMA_D0_RAM_s(add, ram, s) (0xC??????? | (add << 15) | (ram << 8) | s) //#define DMA_RAM_D0_s(add, ram, s) (0xC??????? | (add << 15) | (ram << 8) | s) #define JMP_Imm(imm) (0xD0000000 | (imm & 0xFF)) #define JMP_Z_Imm(imm) () #define JMP_NZ_Imm(imm) () #define JMP_S_Imm(imm) () #define JMP_NS_Imm(imm) () #define JMP_C_Imm(imm) () #define JMP_NC_Imm(imm) () #define JMP_T0_Imm(imm) () #define JMP_NT0_Imm(imm) () #define JMP_ZS_Imm(imm) () #define JMP_NZS_Imm(imm) () #define BTM() (0xE0000000) #define LPS() (0xE8000000) #define END() (0xF0000000) #define ENDI() (0xF8000000) #endif --- NEW FILE: main.h --- /* Copyright 2006-2007 Theo Berkau This file is part of Lapetus. Lapetus is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Lapetus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Lapetus; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _MAIN_H_ #define _MAIN_H_ #endif /* _MAIN_H_ */ --- NEW FILE: vdp2.h --- /* Copyright 2006-2007 Theo Berkau This file is part of Lapetus. Lapetus is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Lapetus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Lapetus; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef VDP2_H #define VDP2_H void vdp2test(); #endif --- NEW FILE: intfac.h --- #ifndef INTFAC_H #define INTFAC_H typedef struct { s8 name[26]; void (*func)(); } MENUITEMSTRUCT; typedef struct { int type; s8 name[26]; int x; int y; int w; int h; void *extra; int attributes; int (*func)(); } WINDOWSTRUCT; #define WINTYPE_NONE 0x00000000 #define WINTYPE_TITLE 0x00000001 #define WINTYPE_TEXT 0x00000002 #define WINTYPE_BUTTON 0x00000003 #define WINATTR_VISIBLE 0x00000001 #define WINATTR_INVISIBLE 0x00000000 #define WINATTR_GRAYED 0x00000002 int DoMenu(MENUITEMSTRUCT *menu, int x, int y); int DoWindow(WINDOWSTRUCT *window, int x, int y); int MessageBox(const char *header, const char *body, int type); void ClearScr(void); #endif --- NEW FILE: scu.c --- /* Copyright 2006-2007 Theo Berkau This file is part of Lapetus. Lapetus is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Lapetus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Lapetus; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <lapetus.h> #include "intfac.h" #include "tests.h" #include "dsp.h" #include "scu.h" #define SCUREG_D0R (*(volatile u32 *)0x25FE0000) #define SCUREG_D0W (*(volatile u32 *)0x25FE0004) #define SCUREG_D0C (*(volatile u32 *)0x25FE0008) #define SCUREG_D0AD (*(volatile u32 *)0x25FE000C) #define SCUREG_D0EN (*(volatile u32 *)0x25FE0010) #define SCUREG_D0MD (*(volatile u32 *)0x25FE0014) #define SCUREG_D1R (*(volatile u32 *)0x25FE0020) #define SCUREG_D1W (*(volatile u32 *)0x25FE0024) #define SCUREG_D1C (*(volatile u32 *)0x25FE0028) #define SCUREG_D1AD (*(volatile u32 *)0x25FE002C) #define SCUREG_D1EN (*(volatile u32 *)0x25FE0030) #define SCUREG_D1MD (*(volatile u32 *)0x25FE0034) #define SCUREG_D2R (*(volatile u32 *)0x25FE0040) #define SCUREG_D2W (*(volatile u32 *)0x25FE0044) #define SCUREG_D2C (*(volatile u32 *)0x25FE0048) #define SCUREG_D2AD (*(volatile u32 *)0x25FE004C) #define SCUREG_D2EN (*(volatile u32 *)0x25FE0050) #define SCUREG_D2MD (*(volatile u32 *)0x25FE0054) #define SCUREG_T0C (*(volatile u32 *)0x25FE0090) #define SCUREG_T1S (*(volatile u32 *)0x25FE0094) #define SCUREG_T1MD (*(volatile u32 *)0x25FE0098) #define SCUREG_IMS (*(volatile u32 *)0x25FE00A0) #define SCUREG_IST (*(volatile u32 *)0x25FE00A4) #define SCUREG_AIACK (*(volatile u32 *)0x25FE00A8) #define SCUREG_ASR0 (*(volatile u32 *)0x25FE00B0) #define SCUREG_ASR1 (*(volatile u32 *)0x25FE00B4) #define SCUREG_RSEL (*(volatile u32 *)0x25FE00C4) #define SCUREG_VER (*(volatile u32 *)0x25FE00C8) ////////////////////////////////////////////////////////////////////////////// void scutest() { int choice; MENUITEMSTRUCT scumenu[] = { // { "SCU Register Test", &scuregistertest, }, // { "SCU Interrupt Test", &scuinttest, }, { "SCU DMA Test" , &scudmatest, }, { "SCU DSP Test" , &scudsptest, }, { "Go back to main menu", NULL }, { "\0", NULL } }; for (;;) { choice = DoMenu(scumenu, 8, 14); ClearScr(); if (choice == 3) break; } } ////////////////////////////////////////////////////////////////////////////// /* void scuinttest(void) { InterruptSetLevelMask(0xF); InitLapetus(RES_320x224); VdpRBG0Init(&testdispsettings); VdpSetDefaultPalette(); // Display On VdpDispOn(); UnregisterAllTests(); RegisterTest(&TestSCUVERRegister, "VER Register"); DoTests("SCU Register tests", 0, 0); } */ ////////////////////////////////////////////////////////////////////////////// void scuinttest() { InterruptSetLevelMask(0xF); InitLapetus(RES_320x224); VdpRBG0Init(&testdispsettings); VdpSetDefaultPalette(); // Display On VdpDispOn(); UnregisterAllTests(); RegisterTest(&TestISTandIMS, "Interrupt status and mask"); RegisterTest(&TestVBlankInInterrupt, "Vblank-out Interrupt"); RegisterTest(&TestVBlankOutInterrupt, "Vblank-in Interrupt"); RegisterTest(&TestHBlankInInterrupt, "HBlank-in Interrupt"); RegisterTest(&TestTimer0Interrupt, "Timer 0 Interrupt"); RegisterTest(&TestTimer1Interrupt, "Timer 1 Interrupt"); // RegisterTest(&TestDSPEndInterrupt, "DSP End Interrupt"); RegisterTest(&TestSoundRequestInterrupt, "Sound Request Interrupt"); // RegisterTest(&TestSMPCInterrupt, "SMPC Interrupt"); // RegisterTest(&TestPadInterrupt, "Pad Interrupt"); RegisterTest(&TestDMA0Interrupt, "DMA0 Interrupt"); RegisterTest(&TestDMA1Interrupt, "DMA1 Interrupt"); RegisterTest(&TestDMA2Interrupt, "DMA2 Interrupt"); RegisterTest(&TestDMAIllegalInterrupt, "Illegal DMA Interrupt"); RegisterTest(&TestSpriteDrawEndInterrupt, "Sprite Draw End Interrupt"); // RegisterTest(&TestCDBlockInterrupt, "CD Block Interrupt"); // If Netlink is connected, do a test on it too // if (NetlinkInit() == LAPETUS_ERR_OK) // RegisterTest(&TestNetlinkInterrupt, "Netlink Interrupt"); DoTests("SCU Interrupt tests", 0, 0); } ////////////////////////////////////////////////////////////////////////////// void scudmatest() { InterruptSetLevelMask(0xF); InitLapetus(RES_320x224); VdpRBG0Init(&testdispsettings); VdpSetDefaultPalette(); // Display On VdpDispOn(); UnregisterAllTests(); RegisterTest(&TestDMA0, "DMA 0 transfer"); RegisterTest(&TestDMA1, "DMA 1 transfer"); RegisterTest(&TestDMA2, "DMA 2 transfer"); RegisterTest(&TestDMAMisalignment, "Misaligned DMA transfer"); // RegisterTest(&TestIndirectDMA, "Indirect DMA transfer"); // RegisterTest(&TestTransNum0, "0 Transfer Number transfer"); // RegisterTest(&TestDMAStatus, "DMA Status Register"); // Test out DMA start factors here // RegisterTest(&, ); DoTests("SCU DMA tests", 0, 0); } ////////////////////////////////////////////////////////////////////////////// void TestSCUVERRegister() { // Make sure it's at least version 4 VdpPrintf(&testdispfont, 0 * 8, 23 * 8, 0xF, "%08X", SCUREG_PPAF); SCUREG_PPAF = 0; VdpPrintf(&testdispfont, 0 * 8, 24 * 8, 0xF, "%08X", SCUREG_PPAF); if (SCUREG_VER < 4) stagestatus = STAGESTAT_BADDATA; else stagestatus = STAGESTAT_DONE; } ////////////////////////////////////////////////////////////////////////////// int isinttime=0; void (*oldfunc)(); u8 intvector; u32 oldmask; void testintfunc() { InterruptSetLevelMask(0xF); // Return interrupt settings back to normal BIOS_SetSCUInterrupt(intvector, oldfunc); BIOS_SetSCUInterruptMask(oldmask); if (isinttime) stagestatus = STAGESTAT_DONE; else stagestatus = STAGESTAT_BADINTERRUPT; isinttime = 0; if (intvector >= 0x50) { // Need to do an A-bus interrupt acknowledge } VdpPrintf(&testdispfont, 0 * 8, 25 * 8, 0xF, "int"); } ////////////////////////////////////////////////////////////////////////////// void SetupInterrupt(u8 vector, u32 mask) { InterruptSetLevelMask(0xF); VdpPrintf(&testdispfont, 0 * 8, 25 * 8, 0xF, " "); VdpPrintf(&testdispfont, 0 * 8, 24 * 8, 0xF, "setup start"); intvector = vector; stagestatus = STAGESTAT_WAITINGFORINT; oldfunc = BIOS_GetSCUInterrupt(intvector); oldmask = BIOS_GetSCUInterruptMask(); BIOS_SetSCUInterrupt(intvector, testintfunc); isinttime = 1; BIOS_ChangeSCUInterruptMask(~mask, 0); VdpPrintf(&testdispfont, 0 * 8, 24 * 8, 0xF, "setup done "); } ////////////////////////////////////////////////////////////////////////////// void TestVBlankInInterrupt() { SetupInterrupt(0x40, 0x0001); InterruptSetLevelMask(0xE); } ////////////////////////////////////////////////////////////////////////////// void TestVBlankOutInterrupt() { SetupInterrupt(0x41, 0x0002); InterruptSetLevelMask(0xD); } ////////////////////////////////////////////////////////////////////////////// void TestHBlankInInterrupt() { SetupInterrupt(0x42, 0x0004); InterruptSetLevelMask(0xC); } ////////////////////////////////////////////////////////////////////////////// void TestTimer0Interrupt() { SetupInterrupt(0x43, 0x0008); // Enable Timer 0 SCUREG_T0C = 19; InterruptSetLevelMask(0xB); } ////////////////////////////////////////////////////////////////////////////// void TestTimer1Interrupt() { SCUREG_T1MD = 0; SCUREG_T1S = 100; SetupInterrupt(0x44, 0x0010); SCUREG_T1MD = 1; InterruptSetLevelMask(0xA); } ////////////////////////////////////////////////////////////////////////////// void TestDSPEndInterrupt() { SetupInterrupt(0x45, 0x0020); // Clear out program control port u32 testval = SCUREG_PPAF; // Make sure program is stopped, etc. SCUREG_PPAF = 0; // Setup DSP so we can send a program to it SCUREG_PPAF = 0x8000; // Upload our program(ENDI instruction) SCUREG_PPD = 0xF8000000; // Start executing program SCUREG_PPAF = 0x10000; InterruptSetLevelMask(0x9); } ////////////////////////////////////////////////////////////////////////////// void TestSoundRequestInterrupt() { SetupInterrupt(0x46, 0x0040); // Reset all Sound interrupts *((volatile u16*)0x25B0042E) = 0x7FF; // Set MCIEB to reset when we write to bit 5 of MCIPD *((volatile u16*)0x25B0042A) = 0x20; // trigger interrupt using MCIPD *((volatile u16*)0x25B0042C) = 0x20; InterruptSetLevelMask(0x8); } ////////////////////////////////////////////////////////////////////////////// void TestSMPCInterrupt() { SetupInterrupt(0x47, 0x0080); // Insert triggering mechanism here(fix me) SmpcWaitTillReady(); SMPC_REG_IREG(0) = 0x00; // no intback status SMPC_REG_IREG(1) = 0x0A; // 15-byte mode, peripheral data returned, time optimized SMPC_REG_IREG(2) = 0xF0; // ??? SmpcIssueCommand(SMPC_CMD_INTBACK); InterruptSetLevelMask(0x7); } ////////////////////////////////////////////////////////////////////////////// void TestPadInterrupt() { SetupInterrupt(0x48, 0x0100); // Insert triggering mechanism here(fix me) InterruptSetLevelMask(0x7); } ////////////////////////////////////////////////////////////////////////////// void TestDMA0Interrupt() { SetupInterrupt(0x4B, 0x0800); // Do a quick DMA SCUREG_D0EN = 0; SCUREG_D0R = 0x060F0000; SCUREG_D0W = 0x25C40000; SCUREG_D0C = 0x4; SCUREG_D0AD = 0x101; SCUREG_D0MD = 0x00000007; SCUREG_D0EN = 0x101; InterruptSetLevelMask(0x4); } ////////////////////////////////////////////////////////////////////////////// void TestDMA1Interrupt() { SetupInterrupt(0x4A, 0x0400); // Do a quick DMA SCUREG_D1EN = 0; SCUREG_D1R = 0x060F0000; SCUREG_D1W = 0x25C40000; SCUREG_D1C = 0x4; SCUREG_D1AD = 0x101; SCUREG_D1MD = 0x00000007; SCUREG_D1EN = 0x101; InterruptSetLevelMask(0x5); } ////////////////////////////////////////////////////////////////////////////// void TestDMA2Interrupt() { SetupInterrupt(0x49, 0x0200); // Do a quick DMA SCUREG_D2EN = 0; SCUREG_D2R = 0x060F0000; SCUREG_D2W = 0x25C40000; SCUREG_D2C = 0x4; SCUREG_D2AD = 0x101; SCUREG_D2MD = 0x00000007; SCUREG_D2EN = 0x101; InterruptSetLevelMask(0x5); } ////////////////////////////////////////////////////////////////////////////// void TestDMAIllegalInterrupt() { SetupInterrupt(0x4C, 0x1000); // Insert triggering mechanism here(fix me) // Do a quick DMA SCUREG_D0EN = 0; SCUREG_D0R = 0x060F0000; SCUREG_D0W = 0; SCUREG_D0C = 0x4; SCUREG_D0AD = 0x101; SCUREG_D0MD = 0x00000007; SCUREG_D0EN = 0x101; InterruptSetLevelMask(0x2); } ////////////////////////////////////////////////////////////////////////////// void TestSpriteDrawEndInterrupt() { sprite_struct localcoord; SetupInterrupt(0x4D, 0x2000); localcoord.attr = 0; localcoord.x = 0; localcoord.y = 0; VdpStartDrawList(); VdpLocalCoordinate(&localcoord); VdpEndDrawList(); InterruptSetLevelMask(0x1); } ////////////////////////////////////////////////////////////////////////////// void TestCDBlockInterrupt() { SetupInterrupt(0x50, 0x10000); // Unmask Subcode Q irq CDB_REG_HIRQ = ~HIRQ_SCDQ; CDB_REG_HIRQMASK = ~HIRQ_SCDQ; InterruptSetLevelMask(0x6); } ////////////////////////////////////////////////////////////////////////////// u32 dmavaltest; void dmaint (void) { BIOS_SetSCUInterrupt(0x49, 0); BIOS_SetSCUInterrupt(0x4A, 0); BIOS_SetSCUInterrupt(0x4B, 0); BIOS_ChangeSCUInterruptMask(0xFFFFFFFF, 0x800 | 0x400 | 0x200); if (*((volatile u32 *)0x25C40000) != dmavaltest) { stagestatus = STAGESTAT_BADDATA; return; } InterruptSetLevelMask(0xF); stagestatus = STAGESTAT_DONE; } ////////////////////////////////////////////////////////////////////////////// void TestDMA0() { dmavaltes... [truncated message content] |
From: Theo B. <cyb...@us...> - 2008-01-07 01:52:11
|
Update of /cvsroot/lapetus/lapetus/tests/regtest In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv474 Added Files: main.c Log Message: -Slowly but steadily commiting my regression testing code for emulators --- NEW FILE: main.c --- /* Copyright 2006-2007 Theo Berkau This file is part of Lapetus. Lapetus is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Lapetus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Lapetus; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <lapetus.h> #include "cdb.h" #include "scsp.h" #include "scu.h" #include "sh2.h" #include "vdp2.h" #include "intfac.h" MENUITEMSTRUCT mainmenu[] = { { "SH2 Test" , &sh2test, }, { "SCU Test", &scutest, }, { "CD Block Test" , &cdbtest, }, //{ "68k Test" , &cdbtest, }, { "SCSP Test" , &scsptest, }, //{ "VDP1 Test" , &vdp1test, }, { "VDP2 Test" , &vdp2test, }, { "\0", NULL } }; screensettings_struct testdispsettings; font_struct testdispfont; ////////////////////////////////////////////////////////////////////////////// int main() { int i; int choice; BIOS_ChangeSCUInterruptMask(0xFFFFFFFF, 0xFFFFFFFF); InterruptSetLevelMask(0); // Wait a bit for (i = 0; i < 200000; i++) {} InterruptSetLevelMask(0xF); BIOS_SetSCUInterrupt(0x40, 0); BIOS_SetSCUInterrupt(0x41, 0); BIOS_SetSCUInterrupt(0x42, 0); BIOS_SetSCUInterrupt(0x43, 0); BIOS_SetSCUInterrupt(0x44, 0); BIOS_SetSCUInterrupt(0x45, 0); BIOS_SetSCUInterrupt(0x46, 0); BIOS_SetSCUInterrupt(0x47, 0); BIOS_SetSCUInterrupt(0x48, 0); BIOS_SetSCUInterrupt(0x49, 0); BIOS_SetSCUInterrupt(0x4A, 0); BIOS_SetSCUInterrupt(0x4B, 0); BIOS_SetSCUInterrupt(0x4C, 0); BIOS_SetSCUInterrupt(0x4D, 0); BIOS_SetSCUInterrupt(0x50, 0); InitLapetus(RES_320x224); // Setup a screen for us draw on testdispsettings.isbitmap = TRUE; testdispsettings.bitmapsize = BG_BITMAP512x256; testdispsettings.transparentbit = 0; testdispsettings.color = BG_256COLOR; testdispsettings.specialpriority = 0; testdispsettings.specialcolorcalc = 0; testdispsettings.extrapalettenum = 0; testdispsettings.mapoffset = 0; testdispsettings.rotationmode = 0; testdispsettings.parameteraddr = 0x25E60000; VdpRBG0Init(&testdispsettings); // Use the default palette VdpSetDefaultPalette(); // Setup an 8x8 1BPP font testdispfont.data = font8x8; testdispfont.width = 8; testdispfont.height = 8; testdispfont.bpp = 1; testdispfont.out = (u8 *)0x25E00000; VdpSetFont(SCREEN_RBG0, &testdispfont); // Print messages and cursor VdpPrintf(&testdispfont, 2 * 8, 1 * 8, 15, "Saturn Regression Test v0.2"); VdpDispOn(); // Display Main Menu for(;;) { choice = DoMenu(mainmenu, 4, 14); slClear(); } } ////////////////////////////////////////////////////////////////////////////// |
From: Theo B. <cyb...@us...> - 2008-01-06 17:49:49
|
Update of /cvsroot/lapetus/lapetus/tests/regtest In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5567/regtest Log Message: Directory /cvsroot/lapetus/lapetus/tests/regtest added to the repository |
From: Theo B. <cyb...@us...> - 2008-01-06 17:49:27
|
Update of /cvsroot/lapetus/lapetus/tests In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5549/tests Log Message: Directory /cvsroot/lapetus/lapetus/tests added to the repository |
From: Theo B. <cyb...@us...> - 2007-11-09 00:38:18
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv6061 Modified Files: commlink.c Log Message: -Fixed a bug causing checksum issues Index: commlink.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/commlink.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- commlink.c 13 Feb 2007 20:26:38 -0000 1.1 +++ commlink.c 9 Nov 2007 00:38:13 -0000 1.2 @@ -163,6 +163,8 @@ { case 0x01: { + u8 chksum; + // Download Memory CLSendLong(val); @@ -191,19 +193,19 @@ if (size == 0) break; - data = 0; + chksum = 0; while (size > 0) { - data += *((volatile u8 *)addr); - data &= 0xFF; - CLExchangeByte(*((volatile u8 *)addr)); + data = *((volatile u8 *)addr); + chksum += data; + CLExchangeByte(data); addr++; size--; } // Send the checksum - CLExchangeByte(data); + CLExchangeByte(chksum); } CLExchangeByte('0'); |
From: Theo B. <cyb...@us...> - 2007-08-01 16:39:26
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv25519 Modified Files: bios.h Log Message: -Removed volatile from bios defines of type void. Apparently GCC ignores it. I'll add it back if there's problems. Index: bios.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/bios.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- bios.h 12 Feb 2007 05:02:06 -0000 1.1 +++ bios.h 1 Aug 2007 16:38:30 -0000 1.2 @@ -20,15 +20,15 @@ #ifndef BIOS_H #define BIOS_H -#define BIOS_RunCDPlayer() ((**(volatile void(**)(void))0x0600026C)()) +#define BIOS_RunCDPlayer() ((**(void(**)(void))0x0600026C)()) #define BIOS_IsMpegCardPresent() ((**(volatile int(**)(int))0x06000274)()) -#define BIOS_SetSCUInterrupt(vector, func) ((**(volatile void(**)(u32, void *))0x06000300)((vector), (func))) +#define BIOS_SetSCUInterrupt(vector, func) ((**(void(**)(u32, void *))0x06000300)((vector), (func))) #define BIOS_GetSCUInterrupt(vector) ((void*)(**(void(*(**)(u32))(u32))0x6000304)(vector)) -#define BIOS_SetSH2Interrupt(vector, func) ((**(volatile void(**)(u32, void *))0x06000310)((vector), (func))) +#define BIOS_SetSH2Interrupt(vector, func) ((**(void(**)(u32, void *))0x06000310)((vector), (func))) #define BIOS_GetSH2Interrupt(vector) ((void*)(**(void(*(**)(u32))(u32))0x6000314)(vector)) -#define BIOS_SetClockSpeed(mode) ((**(volatile void(**)(u32))0x06000320)((mode))) +#define BIOS_SetClockSpeed(mode) ((**(void(**)(u32))0x06000320)((mode))) #define BIOS_GetClockSpeed (*(volatile u32*)0x6000324) -#define BIOS_SetSCUInterruptMask(bits) ((**(volatile void(**)(u32))0x06000340)((bits))) +#define BIOS_SetSCUInterruptMask(bits) ((**(void(**)(u32))0x06000340)((bits))) #define BIOS_ChangeSCUInterruptMask(mask, bits) ((**(volatile void(**)(u32, u32))0x06000344)((mask), (bits))) #define BIOS_GetSCUInterruptMask() (*(volatile u32 *)0x06000348) |
From: Theo B. <cyb...@us...> - 2007-07-07 03:37:45
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5042 Modified Files: vdp.h vdp1.c vdpinit.c Log Message: -Added polygon/polyline/line VDP1 draw functions -Fixed a bug where sprites/polygons weren't being drawn correctly using 16-bit color -Fixed a bug in RGB16 define Index: vdp1.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/vdp1.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- vdp1.c 4 Jul 2007 02:32:43 -0000 1.1 +++ vdp1.c 7 Jul 2007 03:37:41 -0000 1.2 @@ -133,6 +133,68 @@ ////////////////////////////////////////////////////////////////////////////// +void VdpDrawPolygon(sprite_struct *sprite) +{ + volatile vdp1cmd_struct *tbl=(volatile vdp1cmd_struct *)(VDP1_RAM+(commandnum * 0x20)); + + tbl->CMDCTRL = ((sprite->attr >> 12) & 0x7FF0) | 0x0004; + tbl->CMDLINK = sprite->linkaddr / 8; + tbl->CMDPMOD.all = (u16)sprite->attr | 0xC0 ; + tbl->CMDCOLR = sprite->bank; + tbl->CMDXA = sprite->x; + tbl->CMDYA = sprite->y; + tbl->CMDXB = sprite->x2; + tbl->CMDYB = sprite->y2; + tbl->CMDXC = sprite->x3; + tbl->CMDYC = sprite->y3; + tbl->CMDXD = sprite->x4; + tbl->CMDYD = sprite->y4; + tbl->CMDGRDA = sprite->gouraudaddr / 8; + commandnum++; +} + +////////////////////////////////////////////////////////////////////////////// + +void VdpDrawPolyLine(sprite_struct *sprite) +{ + volatile vdp1cmd_struct *tbl=(volatile vdp1cmd_struct *)(VDP1_RAM+(commandnum * 0x20)); + + tbl->CMDCTRL = ((sprite->attr >> 12) & 0x7FF0) | 0x0005; + tbl->CMDLINK = sprite->linkaddr / 8; + tbl->CMDPMOD.all = (u16)sprite->attr | 0xC0; + tbl->CMDCOLR = sprite->bank; + tbl->CMDXA = sprite->x; + tbl->CMDYA = sprite->y; + tbl->CMDXB = sprite->x2; + tbl->CMDYB = sprite->y2; + tbl->CMDXC = sprite->x3; + tbl->CMDYC = sprite->y3; + tbl->CMDXD = sprite->x4; + tbl->CMDYD = sprite->y4; + tbl->CMDGRDA = sprite->gouraudaddr / 8; + commandnum++; +} + +////////////////////////////////////////////////////////////////////////////// + +void VdpDrawLine(sprite_struct *sprite) +{ + volatile vdp1cmd_struct *tbl=(volatile vdp1cmd_struct *)(VDP1_RAM+(commandnum * 0x20)); + + tbl->CMDCTRL = ((sprite->attr >> 12) & 0x7FF0) | 0x0005; + tbl->CMDLINK = sprite->linkaddr / 8; + tbl->CMDPMOD.all = (u16)sprite->attr | 0xC0; + tbl->CMDCOLR = sprite->bank; + tbl->CMDXA = sprite->x; + tbl->CMDYA = sprite->y; + tbl->CMDXB = sprite->x2; + tbl->CMDYB = sprite->y2; + tbl->CMDGRDA = sprite->gouraudaddr / 8; + commandnum++; +} + +////////////////////////////////////////////////////////////////////////////// + void VdpStartDrawList() { commandnum = 0; Index: vdpinit.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/vdpinit.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- vdpinit.c 4 Jul 2007 02:29:36 -0000 1.4 +++ vdpinit.c 7 Jul 2007 03:37:41 -0000 1.5 @@ -126,6 +126,9 @@ EWRR |= 256; VDP1_REG_EWRR = EWRR; + + // Setup Sprite data to be both RGB and palette + VDP2_REG_SPCTL = 0x0020; VDP1_REG_PTMR = 0x0002; // Clear VDP2 Ram Index: vdp.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/vdp.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- vdp.h 4 Jul 2007 02:32:43 -0000 1.6 +++ vdp.h 7 Jul 2007 03:37:41 -0000 1.7 @@ -862,7 +862,7 @@ #define SPRITE_8BPP256COLOR 0x00000020 #define SPRITE_16BPP 0x00000028 -#define RGB16(r, g, b) (0x8000 | (((b) & 0x1F) << 10) | (((g) & 0x1F) << 10) | ((r) & 0x1F)) +#define RGB16(r, g, b) (0x8000 | (((b) & 0x1F) << 10) | (((g) & 0x1F) << 5) | ((r) & 0x1F)) typedef struct { @@ -950,6 +950,9 @@ void VdpDrawNormalSprite(sprite_struct *sprite); void VdpDrawScaledSprite(sprite_struct *sprite); void VdpDrawDistortedSprite(sprite_struct *sprite); +void VdpDrawPolygon(sprite_struct *sprite); +void VdpDrawPolyLine(sprite_struct *sprite); +void VdpDrawLine(sprite_struct *sprite); void VdpStartDrawList(); void VdpEndDrawList(); |