lapetus-cvs Mailing List for Lapetus (Page 3)
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...> - 2007-07-04 02:32:46
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv7163 Modified Files: rotscr.c vdp.h Added Files: vdp1.c Log Message: -Moved rottbl_struct typedef to vdp.h -Added new file for vdp1 drawing: vdp1.c -Added functions for system clipping, user clipping, normal sprite drawing, scaled sprite drawing, distorted sprite drawing. Index: rotscr.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/rotscr.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- rotscr.c 27 Feb 2007 23:32:55 -0000 1.1 +++ rotscr.c 4 Jul 2007 02:32:43 -0000 1.2 @@ -19,20 +19,6 @@ #include "lapetus.h" -typedef struct -{ - u32 Xst, Yst, Zst; - u32 deltaXst, deltaYst; - u32 deltaX, deltaY; - u32 A, B, C, D, E, F; - u16 Px, Py, Pz; - u16 unused1; - u16 Cx, Cy, Cz; - u16 unused2; - u32 Mx, My; - u32 kx, ky; -} rottbl_struct; - extern vdp2settings_struct vdp2settings; ////////////////////////////////////////////////////////////////////////////// --- NEW FILE: vdp1.c --- /* 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 */ #include "lapetus.h" ////////////////////////////////////////////////////////////////////////////// int commandnum=0; ////////////////////////////////////////////////////////////////////////////// void VdpSystemClipping(sprite_struct *sprite) { volatile vdp1cmd_struct *tbl=(volatile vdp1cmd_struct *)(VDP1_RAM+(commandnum * 0x20)); tbl->CMDCTRL = ((sprite->attr >> 12) & 0x7FF0) | 0x0009; tbl->CMDLINK = sprite->linkaddr / 8; tbl->CMDXC = sprite->x; tbl->CMDYC = sprite->y; commandnum++; } ////////////////////////////////////////////////////////////////////////////// void VdpUserClipping(sprite_struct *sprite) { volatile vdp1cmd_struct *tbl=(volatile vdp1cmd_struct *)(VDP1_RAM+(commandnum * 0x20)); tbl->CMDCTRL = ((sprite->attr >> 12) & 0x7FF0) | 0x0008; tbl->CMDLINK = sprite->linkaddr / 8; tbl->CMDXA = sprite->x; tbl->CMDYA = sprite->y; tbl->CMDXC = sprite->x2; tbl->CMDYC = sprite->y2; commandnum++; } ////////////////////////////////////////////////////////////////////////////// void VdpLocalCoordinate(sprite_struct *sprite) { volatile vdp1cmd_struct *tbl=(volatile vdp1cmd_struct *)(VDP1_RAM+(commandnum * 0x20)); tbl->CMDCTRL = ((sprite->attr >> 12) & 0x7FF0) | 0x000A; tbl->CMDLINK = sprite->linkaddr / 8; tbl->CMDXA = sprite->x; tbl->CMDYA = sprite->y; commandnum++; } ////////////////////////////////////////////////////////////////////////////// void VdpDrawNormalSprite(sprite_struct *sprite) { volatile vdp1cmd_struct *tbl=(volatile vdp1cmd_struct *)(VDP1_RAM+(commandnum * 0x20)); tbl->CMDCTRL = ((sprite->attr >> 12) & 0x7FF0) | 0x0000; tbl->CMDLINK = sprite->linkaddr / 8; tbl->CMDPMOD.all = (u16)sprite->attr; tbl->CMDCOLR = sprite->bank; tbl->CMDSRCA = sprite->addr / 8; tbl->CMDSIZE = ((sprite->width / 8) << 8) | sprite->height; tbl->CMDXA = sprite->x; tbl->CMDYA = sprite->y; tbl->CMDGRDA = sprite->gouraudaddr / 8; commandnum++; } ////////////////////////////////////////////////////////////////////////////// void VdpDrawScaledSprite(sprite_struct *sprite) { volatile vdp1cmd_struct *tbl=(volatile vdp1cmd_struct *)(VDP1_RAM+(commandnum * 0x20)); tbl->CMDCTRL = ((sprite->attr >> 12) & 0x7FF0) | 0x0001; tbl->CMDLINK = sprite->linkaddr / 8; tbl->CMDPMOD.all = (u16)sprite->attr; tbl->CMDCOLR = sprite->bank; tbl->CMDSRCA = sprite->addr / 8; tbl->CMDSIZE = ((sprite->width / 8) << 8) | sprite->height; 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 VdpDrawDistortedSprite(sprite_struct *sprite) { volatile vdp1cmd_struct *tbl=(volatile vdp1cmd_struct *)(VDP1_RAM+(commandnum * 0x20)); tbl->CMDCTRL = ((sprite->attr >> 12) & 0x7FF0) | 0x0002; tbl->CMDLINK = sprite->linkaddr / 8; tbl->CMDPMOD.all = (u16)sprite->attr; tbl->CMDCOLR = sprite->bank; tbl->CMDSRCA = sprite->addr / 8; tbl->CMDSIZE = ((sprite->width / 8) << 8) | sprite->height; 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 VdpStartDrawList() { commandnum = 0; } ////////////////////////////////////////////////////////////////////////////// void VdpEndDrawList() { *((volatile u16 *)(VDP1_RAM+(commandnum * 0x20))) = 0x8000; } ////////////////////////////////////////////////////////////////////////////// Index: vdp.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/vdp.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- vdp.h 3 Mar 2007 02:59:38 -0000 1.5 +++ vdp.h 4 Jul 2007 02:32:43 -0000 1.6 @@ -796,34 +796,71 @@ CRM8_1024 = 0x2 }; -#define SPRITE_MSBOFF 0x0000 -#define SPRITE_MSBON 0x8000 +typedef struct +{ + u32 Xst, Yst, Zst; + u32 deltaXst, deltaYst; + u32 deltaX, deltaY; + u32 A, B, C, D, E, F; + u16 Px, Py, Pz; + u16 unused1; + u16 Cx, Cy, Cz; + u16 unused2; + u32 Mx, My; + u32 kx, ky; +} rottbl_struct; -#define SPRITE_HIGHSPEEDSHRINKDISABLE 0x0000 -#define SPRITE_HIGHSPEEDSHRINKENABLE 0x1000 +#define SPRITE_JUMPNEXT 0x00000000 +#define SPRITE_JUMPASSIGN 0x01000000 +#define SPRITE_JUMPCALL 0x02000000 +#define SPRITE_JUMPRETURN 0x03000000 +#define SPRITE_SKIPNEXT 0x04000000 +#define SPRITE_SKIPASSIGN 0x05000000 +#define SPRITE_SKIPCALL 0x06000000 +#define SPRITE_SKIPRETURN 0x07000000 -#define SPRITE_PRECLIPDISABLE 0x0800 -#define SPRITE_PRECLIPENABLE 0x0000 +#define SPRITE_ZOOMPOINTNONE 0x00000000 +#define SPRITE_ZOOMPOINTUPPERLEFT 0x00500000 +#define SPRITE_ZOOMPOINTUPPERCENTER 0x00600000 +#define SPRITE_ZOOMPOINTUPPERRIGHT 0x00700000 +#define SPRITE_ZOOMPOINTCENTERLEFT 0x00900000 +#define SPRITE_ZOOMPOINTCENTERCENTER 0x00A00000 +#define SPRITE_ZOOMPOINTCENTERRIGHT 0x00B00000 +#define SPRITE_ZOOMPOINTLOWERLEFT 0x00D00000 +#define SPRITE_ZOOMPOINTLOWERCENTER 0x00E00000 +#define SPRITE_ZOOMPOINTLOWERRIGHT 0x00F00000 -#define SPRITE_CLIPDISABLE 0x0000 -#define SPRITE_CLIPOUTSIDE 0x0400 -#define SPRITE_CLIPINSIDE 0x0600 +#define SPRITE_REVERSEHORIZONTAL 0x00010000 +#define SPRITE_REVERSEVERTICAL 0x00020000 -#define SPRITE_MESHDISABLE 0x0000 -#define SPRITE_MESHENABLE 0x0100 +#define SPRITE_MSBOFF 0x00000000 +#define SPRITE_MSBON 0x00008000 -#define SPRITE_ENDCODEDISABLE 0x0080 -#define SPRITE_ENDCODEENABLE 0x0000 +#define SPRITE_HIGHSPEEDSHRINKDISABLE 0x00000000 +#define SPRITE_HIGHSPEEDSHRINKENABLE 0x00001000 -#define SPRITE_TRANSPIXELDISABLE 0x0040 -#define SPRITE_TRANSPIXELENABLE 0x0000 +#define SPRITE_PRECLIPDISABLE 0x00000800 +#define SPRITE_PRECLIPENABLE 0x00000000 -#define SPRITE_4BPP 0x0000 -#define SPRITE_4BPPLUT 0x0008 -#define SPRITE_8BPP64COLOR 0x0010 -#define SPRITE_8BPP128COLOR 0x0018 -#define SPRITE_8BPP256COLOR 0x0020 -#define SPRITE_16BPP 0x0028 +#define SPRITE_CLIPDISABLE 0x00000000 +#define SPRITE_CLIPOUTSIDE 0x00000400 +#define SPRITE_CLIPINSIDE 0x00000600 + +#define SPRITE_MESHDISABLE 0x00000000 +#define SPRITE_MESHENABLE 0x00000100 + +#define SPRITE_ENDCODEDISABLE 0x00000080 +#define SPRITE_ENDCODEENABLE 0x00000000 + +#define SPRITE_TRANSPIXELDISABLE 0x00000040 +#define SPRITE_TRANSPIXELENABLE 0x00000000 + +#define SPRITE_4BPP 0x00000000 +#define SPRITE_4BPPLUT 0x00000008 +#define SPRITE_8BPP64COLOR 0x00000010 +#define SPRITE_8BPP128COLOR 0x00000018 +#define SPRITE_8BPP256COLOR 0x00000020 +#define SPRITE_16BPP 0x00000028 #define RGB16(r, g, b) (0x8000 | (((b) & 0x1F) << 10) | (((g) & 0x1F) << 10) | ((r) & 0x1F)) @@ -864,6 +901,23 @@ u16 CMDUNUSED; } vdp1cmd_struct; +typedef struct +{ + u32 linkaddr; + u32 attr; + u32 addr; + u32 gouraudaddr; + u16 bank; + u16 width, height; + s16 x; + s16 y; + s16 x2; + s16 y2; + s16 x3; + s16 y3; + s16 x4; + s16 y4; +} sprite_struct; extern volatile u16 *vdp1ram; extern volatile u16 *vdp2ram; @@ -889,6 +943,14 @@ int VdpSetPalette(int type, void *palette, int size); int VdpSetDefaultPalette(void); -////////////////////////////////////////////////////////////////////////////// +// Sprite/Polygon related +void VdpSystemClipping(sprite_struct *sprite); +void VdpUserClipping(sprite_struct *sprite); +void VdpLocalCoordinate(sprite_struct *sprite); +void VdpDrawNormalSprite(sprite_struct *sprite); +void VdpDrawScaledSprite(sprite_struct *sprite); +void VdpDrawDistortedSprite(sprite_struct *sprite); +void VdpStartDrawList(); +void VdpEndDrawList(); #endif |
From: Theo B. <cyb...@us...> - 2007-07-04 02:29:39
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5936 Modified Files: vdpinit.c Log Message: -Now when VDP's are initialized, VDP1 is put in a useable state. Index: vdpinit.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/vdpinit.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- vdpinit.c 3 Mar 2007 02:59:05 -0000 1.3 +++ vdpinit.c 4 Jul 2007 02:29:36 -0000 1.4 @@ -42,6 +42,7 @@ void VdpInit(int res) { int i; + u16 EWRR; // Make sure VDP2 is in a sane state VDP2_REG_TVMD = res; @@ -99,6 +100,34 @@ for (i = 0; i < 0x80000; i+=2) *((volatile u16 *)(VDP1_RAM+i)) = 0x0000; + // Set end code in first entry + *((volatile u16 *)(VDP1_RAM)) = 0x8000; + + // Set Sprite priorities + VDP2_REG_PRISA = 0x0707; + VDP2_REG_PRISB = 0x0707; + VDP2_REG_PRISC = 0x0707; + VDP2_REG_PRISD = 0x0707; + + // Enable VDP1 + VDP1_REG_FBCR = 0x0000; + VDP1_REG_TVMR = 0x0000; + VDP1_REG_EWDR = 0x0000; + VDP1_REG_EWLR = (0 << 9) | 0; + + if (vdp2settings.screenwidth <= 512) + EWRR = (vdp2settings.screenwidth << 9); + else + EWRR = (512 << 9); + + if (vdp2settings.screenheight <= 256) + EWRR |= vdp2settings.screenheight; + else + EWRR |= 256; + + VDP1_REG_EWRR = EWRR; + VDP1_REG_PTMR = 0x0002; + // Clear VDP2 Ram for (i = 0; i < 0x80000; i+=2) *((volatile u16 *)(VDP2_RAM+i)) = 0x0000; |
From: Theo B. <cyb...@us...> - 2007-03-03 05:23:12
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv16721 Modified Files: cdfs.c Log Message: -Fixed a silly bug Index: cdfs.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/cdfs.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- cdfs.c 3 Mar 2007 05:19:21 -0000 1.1 +++ cdfs.c 3 Mar 2007 05:23:07 -0000 1.2 @@ -305,7 +305,7 @@ return ret; } else - return LAPETUS_ERR_UNSUPPORTED + return LAPETUS_ERR_UNSUPPORTED; return LAPETUS_ERR_OK; } |
From: Theo B. <cyb...@us...> - 2007-03-03 05:22:36
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv16397 Modified Files: makefile Log Message: -All newly added files are now being compiled and linked Index: makefile =================================================================== RCS file: /cvsroot/lapetus/lapetus/makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- makefile 1 Mar 2007 23:21:45 -0000 1.6 +++ makefile 3 Mar 2007 05:22:31 -0000 1.7 @@ -11,8 +11,9 @@ ASFLAGS = ARFLAGS = rv -OBJS = cd.o commlink.o dsp.o int.o lapetus.o smpc.o timer.o \ - vdpinit.o scrscr.o rotscr.o text.o pal.o +OBJS = cd.o cdfs.o \ + commlink.o dsp.o int.o lapetus.o smpc.o timer.o \ + vdpinit.o scrscr.o rotscr.o text.o pal.o font.o TARGET = $(LIBDIR)/liblapetus.a |
From: Theo B. <cyb...@us...> - 2007-03-03 05:21:48
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15929 Added Files: font.c Log Message: -New font system. Very incomplete right now. Only 1 bpp fonts supported and can only output on 8 bpp bitmaps --- NEW FILE: font.c --- /* 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 */ #include "lapetus.h" ////////////////////////////////////////////////////////////////////////////// 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 }; u32 defaultfontsize=sizeof(defaultfont); ////////////////////////////////////////////////////////////////////////////// int DrawCharBitmap1bppTo8bpp(void *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; for (i = 0; i < (((font_struct *)font)->height * ((font_struct *)font)->width / 8); i++) { u8 pixel = src[i]; for (i2 = 0; i2 < 8; i2++) { if ((pixel >> 7) & 0x1) dest[i2] = (u8)color; pixel <<= 1; } dest += ((font_struct *)font)->lineinc; } return ((font_struct *)font)->width; } ////////////////////////////////////////////////////////////////////////////// int VdpSetFont(int screen, font_struct *font) { // 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; return LAPETUS_ERR_OK; } ////////////////////////////////////////////////////////////////////////////// int VdpSetDefaultFont(int screen, font_struct *font) { font->data = defaultfont; font->width = 8; font->height = 16; font->bpp = 1; return VdpSetFont(screen, font); } ////////////////////////////////////////////////////////////////////////////// |
From: Theo B. <cyb...@us...> - 2007-03-03 05:19:51
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14950 Modified Files: lapetus.h Log Message: -Added new error type(unsupported feature) Index: lapetus.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/lapetus.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- lapetus.h 3 Mar 2007 03:56:05 -0000 1.7 +++ lapetus.h 3 Mar 2007 05:19:48 -0000 1.8 @@ -48,5 +48,6 @@ #define LAPETUS_ERR_UNKNOWN -7 // Unknown error #define LAPETUS_ERR_AUTH -8 // Disc authentication error #define LAPETUS_ERR_FILENOTFOUND -9 // File not found error +#define LAPETUS_ERR_UNSUPPORTED -10 // Unsupported feature #endif |
From: Theo B. <cyb...@us...> - 2007-03-03 05:19:29
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14895 Added Files: cdfs.c Log Message: -Now files can be read from a disc. This should prove to be very handy for developers. --- NEW FILE: cdfs.c --- /* 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 */ #include <string.h> #include "lapetus.h" ////////////////////////////////////////////////////////////////////////////// typedef struct { u16 groupid; u16 userid; u16 attributes; u16 signature; u8 filenumber; u8 reserved[5]; } xarec_struct; typedef struct { u8 recordsize; u8 xarecordsize; u32 lba; u32 size; u8 dateyear; u8 datemonth; u8 dateday; u8 datehour; u8 dateminute; u8 datesecond; u8 gmtoffset; u8 flags; u8 fileunitsize; u8 interleavegapsize; u16 volumesequencenumber; u8 namelength; char name[32]; xarec_struct xarecord; } dirrec_struct; u8 *dirtbl; u8 *sectbuf; int sectbuffered; int dirtblsize; int rootlba; int rootsize; ////////////////////////////////////////////////////////////////////////////// void CopyDirRecord(u8 *buffer, dirrec_struct *dirrec) { u8 *temp_pointer; temp_pointer = buffer; memcpy(&dirrec->recordsize, buffer, sizeof(dirrec->recordsize)); buffer += sizeof(dirrec->recordsize); memcpy(&dirrec->xarecordsize, buffer, sizeof(dirrec->xarecordsize)); buffer += sizeof(dirrec->xarecordsize); buffer += sizeof(dirrec->lba); memcpy(&dirrec->lba, buffer, sizeof(dirrec->lba)); buffer += sizeof(dirrec->lba); buffer += sizeof(dirrec->size); memcpy(&dirrec->size, buffer, sizeof(dirrec->size)); buffer += sizeof(dirrec->size); dirrec->dateyear = buffer[0]; dirrec->datemonth = buffer[1]; dirrec->dateday = buffer[2]; dirrec->datehour = buffer[3]; dirrec->dateminute = buffer[4]; dirrec->datesecond = buffer[5]; dirrec->gmtoffset = buffer[6]; buffer += 7; dirrec->flags = buffer[0]; buffer += sizeof(dirrec->flags); dirrec->fileunitsize = buffer[0]; buffer += sizeof(dirrec->fileunitsize); dirrec->interleavegapsize = buffer[0]; buffer += sizeof(dirrec->interleavegapsize); buffer += sizeof(dirrec->volumesequencenumber); memcpy(&dirrec->volumesequencenumber, buffer, sizeof(dirrec->volumesequencenumber)); buffer += sizeof(dirrec->volumesequencenumber); dirrec->namelength = buffer[0]; buffer += sizeof(dirrec->namelength); memset(dirrec->name, 0, sizeof(dirrec->name)); memcpy(dirrec->name, buffer, dirrec->namelength); buffer += dirrec->namelength; // handle padding buffer += (1 - dirrec->namelength % 2); memset(&dirrec->xarecord, 0, sizeof(dirrec->xarecord)); // Sadily, this is the best way I can think of for detecting XA records if ((dirrec->recordsize - (buffer - temp_pointer)) == 14) { memcpy(&dirrec->xarecord.groupid, buffer, sizeof(dirrec->xarecord.groupid)); buffer += sizeof(dirrec->xarecord.groupid); memcpy(&dirrec->xarecord.userid, buffer, sizeof(dirrec->xarecord.userid)); buffer += sizeof(dirrec->xarecord.userid); memcpy(&dirrec->xarecord.attributes, buffer, sizeof(dirrec->xarecord.attributes)); buffer += sizeof(dirrec->xarecord.attributes); memcpy(&dirrec->xarecord.signature, buffer, sizeof(dirrec->xarecord.signature)); buffer += sizeof(dirrec->xarecord.signature); memcpy(&dirrec->xarecord.filenumber, buffer, sizeof(dirrec->xarecord.filenumber)); buffer += sizeof(dirrec->xarecord.filenumber); memcpy(dirrec->xarecord.reserved, buffer, sizeof(dirrec->xarecord.reserved)); buffer += sizeof(dirrec->xarecord.reserved); } } ////////////////////////////////////////////////////////////////////////////// int CDFSInit(void *workdirtbl, int size) { int ret; dirrec_struct dirrec; dirtbl = workdirtbl; dirtblsize = size; if (size < 4096) return LAPETUS_ERR_INVALIDARG; sectbuf = workdirtbl+2048; sectbuffered = 0; // Read in lba 16 if ((ret = CDReadSector(dirtbl, 166, SECT_2048, 1)) != LAPETUS_ERR_OK) return ret; CopyDirRecord(dirtbl+0x9C, &dirrec); // Ok, now we have the root directory(that's good enough for now) rootlba = dirrec.lba; rootsize = (dirrec.size / 2048); return LAPETUS_ERR_OK; } ////////////////////////////////////////////////////////////////////////////// int CDFSOpen(const char *path, file_struct *file) { char *p; char dirname[13]; dirrec_struct dirrec; u32 lba; u32 size; int sectorsleft; u8 *workbuffer; int done=0; int ret; // Starting with the root directory, go through each subdirectory, // 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) return ret; lba = rootlba + 1; sectorsleft = rootsize - 1; workbuffer = dirtbl; while(!done) { if ((p = strchr(path, '\\')) == NULL) { // It's just the filename now done = 1; size = strlen(path); } else size = p - path; strncpy(dirname, path, size); dirname[size] = '\0'; path += size; // Now that we've got the current subdirectory's name, let's find its // table. for (;;) { CopyDirRecord(workbuffer, &dirrec); workbuffer += dirrec.recordsize; if (strcmp(dirrec.name, dirname) == 0 || strncmp(dirrec.name, dirname, strlen(dirname)) == 0) { lba = dirrec.lba; sectorsleft = dirrec.size / 2048; break; } // If record size of the next entry is zero, it means we're at the end // of the directory record data in the current sector if (workbuffer[0] == 0) { // Let's see if we can read in another sector yet if (sectorsleft > 0) { // Read in new sector if ((ret = CDReadSector(dirtbl, 150+lba, SECT_2048, 1)) != LAPETUS_ERR_OK) return ret; lba++; sectorsleft--; workbuffer = dirtbl; } else // We can't, let's bail return LAPETUS_ERR_FILENOTFOUND; } } if (done) 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) return ret; lba++; sectorsleft--; workbuffer = dirtbl; } // Ok, time to fill out the file structure file->lba = lba; file->size = dirrec.size; file->sectpos = 0; file->pos = 0; return LAPETUS_ERR_OK; } ////////////////////////////////////////////////////////////////////////////// int CDFSSeek(file_struct *file, int offset, int seek_type) { switch(seek_type) { case CDFS_SEEK_SET: file->sectpos = offset / 2048; file->pos = offset % 2048; break; case CDFS_SEEK_CUR: file->sectpos = file->sectpos + ((file->pos + offset) / 2048); file->pos = (file->pos + offset) % 2048; break; case CDFS_SEEK_END: file->sectpos = (file->size - 1 - offset) / 2048; file->pos = (file->size - 1 - offset) % 2048; break; default: return LAPETUS_ERR_INVALIDARG; } // Change the CD read position here if need be return LAPETUS_ERR_OK; } ////////////////////////////////////////////////////////////////////////////// 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) { // Straight sectors reads. Nice and fast if ((ret = CDReadSector(buffer, 150+file->lba+file->sectpos, SECT_2048, sectreadsize)) == LAPETUS_ERR_OK) file->sectpos += sectreadsize; return ret; } else return LAPETUS_ERR_UNSUPPORTED return LAPETUS_ERR_OK; } ////////////////////////////////////////////////////////////////////////////// int CDFSClose(file_struct *file) { return LAPETUS_ERR_OK; } ////////////////////////////////////////////////////////////////////////////// |
From: Theo B. <cyb...@us...> - 2007-03-03 03:56:10
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv12102 Modified Files: lapetus.h Log Message: -Added the new header files -New error type for "File not found" Index: lapetus.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/lapetus.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- lapetus.h 1 Mar 2007 23:17:45 -0000 1.6 +++ lapetus.h 3 Mar 2007 03:56:05 -0000 1.7 @@ -21,8 +21,10 @@ #define LAPETUS_H #include "types.h" +#include "font.h" #include "bios.h" #include "cd.h" +#include "cdfs.h" #include "commlink.h" #include "dsp.h" #include "int.h" @@ -30,6 +32,7 @@ #include "netlink.h" #include "sci.h" #include "smpc.h" +#include "text.h" #include "timer.h" #include "vdp.h" @@ -44,5 +47,6 @@ #define LAPETUS_ERR_BUSY -6 // Hardware is busy #define LAPETUS_ERR_UNKNOWN -7 // Unknown error #define LAPETUS_ERR_AUTH -8 // Disc authentication error +#define LAPETUS_ERR_FILENOTFOUND -9 // File not found error #endif |
From: Theo B. <cyb...@us...> - 2007-03-03 03:54:54
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv11628 Added Files: cdfs.h Log Message: -Initial add --- NEW FILE: cdfs.h --- /* 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 CDFS_H #define CDFS_H typedef struct { u32 lba; u32 size; u32 sectpos; u32 pos; } file_struct; enum SEEKTYPES { CDFS_SEEK_SET = 0, CDFS_SEEK_CUR = 1, CDFS_SEEK_END = 2 }; int CDFSInit(void *workdirtbl, int size); int CDFSOpen(const char *path, file_struct *file); int CDFSSeek(file_struct *file, int offset, int seek_type); int CDFSRead(u8 *buffer, int size, int num, file_struct *file); int CDFSClose(file_struct *file); #endif |
From: Theo B. <cyb...@us...> - 2007-03-03 03:54:16
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv11581 Modified Files: cd.h Log Message: -Changed to use new VdpPrint* functions Index: cd.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/cd.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- cd.h 12 Feb 2007 06:15:50 -0000 1.1 +++ cd.h 3 Mar 2007 03:54:13 -0000 1.2 @@ -78,8 +78,16 @@ u32 FAD; } cdstat_struct; +enum SECTORSIZE +{ + SECT_2048 = 0x0, + SECT_2336 = 0x1, + SECT_2340 = 0x2, + SECT_2352 = 0x3 +}; + int CDExecCommand(u16 hirqmask, cdcmd_struct *cdcmd, cdcmd_struct *cdcmdrs); -int CDDebugExecCommand(u16 hirqmask, cdcmd_struct *cdcmd, cdcmd_struct *cdcmdrs); +int CDDebugExecCommand(font_struct *font, u16 hirqmask, cdcmd_struct *cdcmd, cdcmd_struct *cdcmdrs); int CDInit(); int IsCDAuth(u16 *disctypeauth); int CDAuth(); |
From: Theo B. <cyb...@us...> - 2007-03-03 03:53:55
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv11206 Modified Files: cd.c Log Message: -Changed to use new VdpPrint* functions -Changed CDReadSector so you specify the sector size type, instead of the actual size of the sector Index: cd.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/cd.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- cd.c 1 Mar 2007 23:21:09 -0000 1.1 +++ cd.c 3 Mar 2007 03:53:44 -0000 1.2 @@ -21,7 +21,8 @@ ////////////////////////////////////////////////////////////////////////////// -static int cdsectorsize = 2048; +static int cdsectorsize = SECT_2048; +int sectorsizetbl[4] = { 2048, 2336, 2340, 2352 }; ////////////////////////////////////////////////////////////////////////////// @@ -99,7 +100,7 @@ ////////////////////////////////////////////////////////////////////////////// -int CDDebugExecCommand(u16 hirqmask, cdcmd_struct *cdcmd, cdcmd_struct *cdcmdrs) +int CDDebugExecCommand(font_struct *font, u16 hirqmask, cdcmd_struct *cdcmd, cdcmd_struct *cdcmdrs) { int old_levelmask; u16 hirq_temp; @@ -121,10 +122,10 @@ CDWriteCommand(cdcmd); // Go into an endless loop showing the HIRQ - VdpPrintText(2 * 8, 20 * 8, 0xF0, "HIRQ = "); + VdpPrintText(font, 2 * 8, 20 * 8, 15, "HIRQ = "); for (;;) - VdpPrintf(2 * 8, 20 * 8, 0xF0, "%d", CDB_REG_HIRQ); + VdpPrintf(font, 2 * 8, 20 * 8, 15, "%d", CDB_REG_HIRQ); // return interrupts back to normal InterruptSetLevelMask(old_levelmask); @@ -367,28 +368,7 @@ cdcmd_struct cdcmd; cdcmd_struct cdcmdrs; - switch (size) - { - case 2048: - cdsectorsize = size; - size = 0; - break; - case 2336: - cdsectorsize = size; - size = 1; - break; - case 2340: - cdsectorsize = size; - size = 2; - break; - case 2352: - cdsectorsize = size; - size = 3; - break; - default: - size = 0xFF; - break; - } + cdsectorsize = size; cdcmd.CR1 = 0x6000 | (size & 0xFF); cdcmd.CR2 = size << 8; @@ -445,7 +425,7 @@ for (i = 0; i < 20000; i++) {} // Do transfer - for (i = 0; i < ((numsectors * cdsectorsize) / 4); i++) + for (i = 0; i < ((numsectors * sectorsizetbl[cdsectorsize]) / 4); i++) buffer[i] = CDB_REG_DATATRNS; // this can also be done in word units as well if ((ret = CDEndTransfer()) != 0) @@ -709,7 +689,7 @@ return ret; sectorsread += sectorstoread; - buffer += cdsectorsize; + buffer += sectorsizetbl[cdsectorsize]; if (sectorsread >= numsectors) done = 1; |
From: Theo B. <cyb...@us...> - 2007-03-03 03:32:59
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv4187 Modified Files: text.c Added Files: text.h Log Message: -Updated to use new font system --- NEW FILE: text.h --- /* 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 TEXT_H #define TEXT_H 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, ...); #endif Index: text.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/text.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- text.c 1 Mar 2007 00:50:42 -0000 1.2 +++ text.c 3 Mar 2007 03:32:55 -0000 1.3 @@ -19,24 +19,34 @@ #include <stdio.h> #include <stdarg.h> +#include <string.h> #include "lapetus.h" ////////////////////////////////////////////////////////////////////////////// -void VdpPrintText(int x, int y, int color, const char *text) +extern vdp2settings_struct vdp2settings; + +////////////////////////////////////////////////////////////////////////////// + +void VdpPrintText(font_struct *font, int x, int y, int color, const char *text) { + int i; + int length = strlen(text); + + for (i = 0; i < length; i++) + x += font->drawchar(font, x, y, color, text[i]); } ////////////////////////////////////////////////////////////////////////////// -void VdpPrintf(int x, int y, int color, char *format, ...) +void VdpPrintf(font_struct *font, int x, int y, int color, char *format, ...) { char string[256]; // I hope that's enough va_list arg; va_start(arg, format); vsprintf(string, format, arg); - VdpPrintText(x, y, color, string); + VdpPrintText(font, x, y, color, string); va_end(arg); } |
From: Theo B. <cyb...@us...> - 2007-03-03 03:26:28
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2092 Added Files: font.h Log Message: -Initial add --- NEW FILE: font.h --- /* 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 FONT_H #define FONT_H typedef struct { 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 VdpSetDefaultFont(int screen, font_struct *font); #endif |
From: Theo B. <cyb...@us...> - 2007-03-03 03:12:03
|
Update of /cvsroot/lapetus/lapetus/examples In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv28428/examples Log Message: Directory /cvsroot/lapetus/lapetus/examples added to the repository |
From: Theo B. <cyb...@us...> - 2007-03-03 03:11:06
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27602 Modified Files: pal.c Log Message: -Fixed a bug where the palette wasn't generated correctly -Adjusted the palette formatting so it's easy to read Index: pal.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/pal.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- pal.c 1 Mar 2007 00:48:37 -0000 1.1 +++ pal.c 3 Mar 2007 03:10:11 -0000 1.2 @@ -21,74 +21,74 @@ #include "lapetus.h" -//#define RGB16(r, g, b) ((r) | ((g) << 5) | ((b) << 10)) +#define RGB555(r,g,b) ((r) | ((g) << 5) | ((b) << 10)) u16 defaultpalette[256] = { - RGB16(0, 0, 0), RGB16(0, 0, 21), RGB16(0, 21, 0), RGB16(0, 21, 21), - RGB16(21, 0, 0), RGB16(21, 0, 21), RGB16(21, 10, 0), RGB16(21, 21, 21), - RGB16(10, 10, 10), RGB16(10, 10, 31), RGB16(10, 31, 10), RGB16(10, 31, 31), - RGB16(31, 10, 10), RGB16(31, 10, 31), RGB16(31, 31, 10), RGB16(31, 31, 31), - RGB16(0, 0, 0), RGB16(2, 2, 2), RGB16(4, 4, 4), RGB16(5, 5, 5), - RGB16(7, 7, 7), RGB16(8, 8, 8), RGB16(10, 10, 10), RGB16(12, 12, 12), - RGB16(14, 14, 14), RGB16(16, 16, 16), RGB16(18, 18, 18), RGB16(20, 20, 20), - RGB16(22, 22, 22), RGB16(25, 25, 25), RGB16(28, 28, 28), RGB16(31, 31, 31), - RGB16(0, 0, 31), RGB16(8, 0, 31), RGB16(15, 0, 31), RGB16(23, 0, 31), - RGB16(31, 0, 31), RGB16(31, 0, 23), RGB16(31, 0, 15), RGB16(31, 0, 8), - RGB16(31, 0, 0), RGB16(31, 8, 0), RGB16(31, 15, 0), RGB16(31, 23, 0), - RGB16(31, 31, 0), RGB16(23, 31, 0), RGB16(15, 31, 0), RGB16(8, 31, 0), - RGB16(0, 31, 0), RGB16(0, 31, 8), RGB16(0, 31, 15), RGB16(0, 31, 23), - RGB16(0, 31, 31), RGB16(0, 23, 31), RGB16(0, 15, 31), RGB16(0, 8, 31), - RGB16(15, 15, 31), RGB16(19, 15, 31), RGB16(23, 15, 31), RGB16(27, 15, 31), - RGB16(31, 15, 31), RGB16(31, 15, 27), RGB16(31, 15, 23), RGB16(31, 15, 19), - RGB16(31, 15, 15), RGB16(31, 19, 15), RGB16(31, 23, 15), RGB16(31, 27, 15), - RGB16(31, 31, 15), RGB16(27, 31, 15), RGB16(23, 31, 15), RGB16(19, 31, 15), - RGB16(15, 31, 15), RGB16(15, 31, 19), RGB16(15, 31, 23), RGB16(15, 31, 27), - RGB16(15, 31, 31), RGB16(15, 27, 31), RGB16(15, 23, 31), RGB16(15, 19, 31), - RGB16(22, 22, 31), RGB16(24, 22, 31), RGB16(27, 22, 31), RGB16(29, 22, 31), - RGB16(31, 22, 31), RGB16(31, 22, 29), RGB16(31, 22, 27), RGB16(31, 22, 24), - RGB16(31, 22, 22), RGB16(31, 24, 22), RGB16(31, 27, 22), RGB16(31, 29, 22), - RGB16(31, 31, 22), RGB16(29, 31, 22), RGB16(27, 31, 22), RGB16(24, 31, 22), - RGB16(22, 31, 22), RGB16(22, 31, 24), RGB16(22, 31, 27), RGB16(22, 31, 29), - RGB16(22, 31, 31), RGB16(22, 29, 31), RGB16(22, 27, 31), RGB16(22, 24, 31), - RGB16(0, 0, 14), RGB16(3, 0, 14), RGB16(7, 0, 14), RGB16(10, 0, 14), - RGB16(14, 0, 14), RGB16(14, 0, 10), RGB16(14, 0, 7), RGB16(14, 0, 3), - RGB16(14, 0, 0), RGB16(14, 3, 0), RGB16(14, 7, 0), RGB16(14, 10, 0), - RGB16(14, 14, 0), RGB16(10, 14, 0), RGB16(7, 14, 0), RGB16(3, 14, 0), - RGB16(0, 14, 0), RGB16(0, 14, 3), RGB16(0, 14, 7), RGB16(0, 14, 10), - RGB16(0, 14, 14), RGB16(0, 10, 14), RGB16(0, 7, 14), RGB16(0, 3, 14), - RGB16(7, 7, 14), RGB16(8, 7, 14), RGB16(10, 7, 14), RGB16(12, 7, 14), - RGB16(14, 7, 14), RGB16(14, 7, 12), RGB16(14, 7, 10), RGB16(14, 7, 8), - RGB16(14, 7, 7), RGB16(14, 8, 7), RGB16(14, 10, 7), RGB16(14, 12, 7), - RGB16(14, 14, 7), RGB16(12, 14, 7), RGB16(10, 14, 7), RGB16(8, 14, 7), - RGB16(7, 14, 7), RGB16(7, 14, 8), RGB16(7, 14, 10), RGB16(7, 14, 12), - RGB16(7, 14, 14), RGB16(7, 12, 14), RGB16(7, 10, 14), RGB16(7, 8, 14), - RGB16(10, 10, 14), RGB16(11, 10, 14), RGB16(12, 10, 14), RGB16(13, 10, 14), - RGB16(14, 10, 14), RGB16(14, 10, 13), RGB16(14, 10, 12), RGB16(14, 10, 11), - RGB16(14, 10, 10), RGB16(14, 11, 10), RGB16(14, 12, 10), RGB16(14, 13, 10), - RGB16(14, 14, 10), RGB16(13, 14, 10), RGB16(12, 14, 10), RGB16(11, 14, 10), - RGB16(10, 14, 10), RGB16(10, 14, 11), RGB16(10, 14, 12), RGB16(10, 14, 13), - RGB16(10, 14, 14), RGB16(10, 13, 14), RGB16(10, 12, 14), RGB16(10, 11, 14), - RGB16(0, 0, 8), RGB16(2, 0, 8), RGB16(4, 0, 8), RGB16(6, 0, 8), - RGB16(8, 0, 8), RGB16(8, 0, 6), RGB16(8, 0, 4), RGB16(8, 0, 2), - RGB16(8, 0, 0), RGB16(8, 2, 0), RGB16(8, 4, 0), RGB16(8, 6, 0), - RGB16(8, 8, 0), RGB16(6, 8, 0), RGB16(4, 8, 0), RGB16(2, 8, 0), - RGB16(0, 8, 0), RGB16(0, 8, 2), RGB16(0, 8, 4), RGB16(0, 8, 6), - RGB16(0, 8, 8), RGB16(0, 6, 8), RGB16(0, 4, 8), RGB16(0, 2, 8), - RGB16(4, 4, 8), RGB16(5, 4, 8), RGB16(6, 4, 8), RGB16(7, 4, 8), - RGB16(8, 4, 8), RGB16(8, 4, 7), RGB16(8, 4, 6), RGB16(8, 4, 5), - RGB16(8, 4, 4), RGB16(8, 5, 4), RGB16(8, 6, 4), RGB16(8, 7, 4), - RGB16(8, 8, 4), RGB16(7, 8, 4), RGB16(6, 8, 4), RGB16(5, 8, 4), - RGB16(4, 8, 4), RGB16(4, 8, 5), RGB16(4, 8, 6), RGB16(4, 8, 7), - RGB16(4, 8, 8), RGB16(4, 7, 8), RGB16(4, 6, 8), RGB16(4, 5, 8), - RGB16(5, 5, 8), RGB16(6, 5, 8), RGB16(6, 5, 8), RGB16(7, 5, 8), - RGB16(8, 5, 8), RGB16(8, 5, 7), RGB16(8, 5, 6), RGB16(8, 5, 6), - RGB16(8, 5, 5), RGB16(8, 6, 5), RGB16(8, 6, 5), RGB16(8, 7, 5), - RGB16(8, 8, 5), RGB16(7, 8, 5), RGB16(6, 8, 5), RGB16(6, 8, 5), - RGB16(5, 8, 5), RGB16(5, 8, 6), RGB16(5, 8, 6), RGB16(5, 8, 7), - RGB16(5, 8, 8), RGB16(5, 7, 8), RGB16(5, 6, 8), RGB16(5, 6, 8), - RGB16(0, 0, 0), RGB16(0, 0, 0), RGB16(0, 0, 0), RGB16(0, 0, 0), - RGB16(0, 0, 0), RGB16(0, 0, 0), RGB16(0, 0, 0), RGB16(0, 0, 0) + RGB555(0,0,0), RGB555(0,0,21), RGB555(0,21,0), RGB555(0,21,21), + RGB555(21,0,0), RGB555(21,0,21), RGB555(21,10,0), RGB555(21,21,21), + RGB555(10,10,10), RGB555(10,10,31), RGB555(10,31,10), RGB555(10,31,31), + RGB555(31,10,10), RGB555(31,10,31), RGB555(31,31,10), RGB555(31,31,31), + RGB555(0,0,0), RGB555(2,2,2), RGB555(4,4,4), RGB555(5,5,5), + RGB555(7,7,7), RGB555(8,8,8), RGB555(10,10,10), RGB555(12,12,12), + RGB555(14,14,14), RGB555(16,16,16), RGB555(18,18,18), RGB555(20,20,20), + RGB555(22,22,22), RGB555(25,25,25), RGB555(28,28,28), RGB555(31,31,31), + RGB555(0,0,31), RGB555(8,0,31), RGB555(15,0,31), RGB555(23,0,31), + RGB555(31,0,31), RGB555(31,0,23), RGB555(31,0,15), RGB555(31,0,8), + RGB555(31,0,0), RGB555(31,8,0), RGB555(31,15,0), RGB555(31,23,0), + RGB555(31,31,0), RGB555(23,31,0), RGB555(15,31,0), RGB555(8,31,0), + RGB555(0,31,0), RGB555(0,31,8), RGB555(0,31,15), RGB555(0,31,23), + RGB555(0,31,31), RGB555(0,23,31), RGB555(0,15,31), RGB555(0,8,31), + RGB555(15,15,31), RGB555(19,15,31), RGB555(23,15,31), RGB555(27,15,31), + RGB555(31,15,31), RGB555(31,15,27), RGB555(31,15,23), RGB555(31,15,19), + RGB555(31,15,15), RGB555(31,19,15), RGB555(31,23,15), RGB555(31,27,15), + RGB555(31,31,15), RGB555(27,31,15), RGB555(23,31,15), RGB555(19,31,15), + RGB555(15,31,15), RGB555(15,31,19), RGB555(15,31,23), RGB555(15,31,27), + RGB555(15,31,31), RGB555(15,27,31), RGB555(15,23,31), RGB555(15,19,31), + RGB555(22,22,31), RGB555(24,22,31), RGB555(27,22,31), RGB555(29,22,31), + RGB555(31,22,31), RGB555(31,22,29), RGB555(31,22,27), RGB555(31,22,24), + RGB555(31,22,22), RGB555(31,24,22), RGB555(31,27,22), RGB555(31,29,22), + RGB555(31,31,22), RGB555(29,31,22), RGB555(27,31,22), RGB555(24,31,22), + RGB555(22,31,22), RGB555(22,31,24), RGB555(22,31,27), RGB555(22,31,29), + RGB555(22,31,31), RGB555(22,29,31), RGB555(22,27,31), RGB555(22,24,31), + RGB555(0,0,14), RGB555(3,0,14), RGB555(7,0,14), RGB555(10,0,14), + RGB555(14,0,14), RGB555(14,0,10), RGB555(14,0,7), RGB555(14,0,3), + RGB555(14,0,0), RGB555(14,3,0), RGB555(14,7,0), RGB555(14,10,0), + RGB555(14,14,0), RGB555(10,14,0), RGB555(7,14,0), RGB555(3,14,0), + RGB555(0,14,0), RGB555(0,14,3), RGB555(0,14,7), RGB555(0,14,10), + RGB555(0,14,14), RGB555(0,10,14), RGB555(0,7,14), RGB555(0,3,14), + RGB555(7,7,14), RGB555(8,7,14), RGB555(10,7,14), RGB555(12,7,14), + RGB555(14,7,14), RGB555(14,7,12), RGB555(14,7,10), RGB555(14,7,8), + RGB555(14,7,7), RGB555(14,8,7), RGB555(14,10,7), RGB555(14,12,7), + RGB555(14,14,7), RGB555(12,14,7), RGB555(10,14,7), RGB555(8,14,7), + RGB555(7,14,7), RGB555(7,14,8), RGB555(7,14,10), RGB555(7,14,12), + RGB555(7,14,14), RGB555(7,12,14), RGB555(7,10,14), RGB555(7,8,14), + RGB555(10,10,14), RGB555(11,10,14), RGB555(12,10,14), RGB555(13,10,14), + RGB555(14,10,14), RGB555(14,10,13), RGB555(14,10,12), RGB555(14,10,11), + RGB555(14,10,10), RGB555(14,11,10), RGB555(14,12,10), RGB555(14,13,10), + RGB555(14,14,10), RGB555(13,14,10), RGB555(12,14,10), RGB555(11,14,10), + RGB555(10,14,10), RGB555(10,14,11), RGB555(10,14,12), RGB555(10,14,13), + RGB555(10,14,14), RGB555(10,13,14), RGB555(10,12,14), RGB555(10,11,14), + RGB555(0,0,8), RGB555(2,0,8), RGB555(4,0,8), RGB555(6,0,8), + RGB555(8,0,8), RGB555(8,0,6), RGB555(8,0,4), RGB555(8,0,2), + RGB555(8,0,0), RGB555(8,2,0), RGB555(8,4,0), RGB555(8,6,0), + RGB555(8,8,0), RGB555(6,8,0), RGB555(4,8,0), RGB555(2,8,0), + RGB555(0,8,0), RGB555(0,8,2), RGB555(0,8,4), RGB555(0,8,6), + RGB555(0,8,8), RGB555(0,6,8), RGB555(0,4,8), RGB555(0,2,8), + RGB555(4,4,8), RGB555(5,4,8), RGB555(6,4,8), RGB555(7,4,8), + RGB555(8,4,8), RGB555(8,4,7), RGB555(8,4,6), RGB555(8,4,5), + RGB555(8,4,4), RGB555(8,5,4), RGB555(8,6,4), RGB555(8,7,4), + RGB555(8,8,4), RGB555(7,8,4), RGB555(6,8,4), RGB555(5,8,4), + RGB555(4,8,4), RGB555(4,8,5), RGB555(4,8,6), RGB555(4,8,7), + RGB555(4,8,8), RGB555(4,7,8), RGB555(4,6,8), RGB555(4,5,8), + RGB555(5,5,8), RGB555(6,5,8), RGB555(6,5,8), RGB555(7,5,8), + RGB555(8,5,8), RGB555(8,5,7), RGB555(8,5,6), RGB555(8,5,6), + RGB555(8,5,5), RGB555(8,6,5), RGB555(8,6,5), RGB555(8,7,5), + RGB555(8,8,5), RGB555(7,8,5), RGB555(6,8,5), RGB555(6,8,5), + RGB555(5,8,5), RGB555(5,8,6), RGB555(5,8,6), RGB555(5,8,7), + RGB555(5,8,8), RGB555(5,7,8), RGB555(5,6,8), RGB555(5,6,8), + RGB555(0,0,0), RGB555(0,0,0), RGB555(0,0,0), RGB555(0,0,0), + RGB555(0,0,0), RGB555(0,0,0), RGB555(0,0,0), RGB555(0,0,0) }; ////////////////////////////////////////////////////////////////////////////// |
From: Theo B. <cyb...@us...> - 2007-03-03 02:59:42
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv23391 Modified Files: vdp.h Log Message: -Moved some function prototypes to text.h Index: vdp.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/vdp.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- vdp.h 1 Mar 2007 23:18:53 -0000 1.4 +++ vdp.h 3 Mar 2007 02:59:38 -0000 1.5 @@ -889,10 +889,6 @@ int VdpSetPalette(int type, void *palette, int size); int VdpSetDefaultPalette(void); -// Text related -void VdpPrintText(int x, int y, int color, const char *text); -void VdpPrintf(int x, int y, int color, char *format, ...); - ////////////////////////////////////////////////////////////////////////////// #endif |
From: Theo B. <cyb...@us...> - 2007-03-03 02:59:09
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv23186 Modified Files: vdpinit.c Log Message: -Fixed a bug where the screenwidth and screenheight variables were getting cleared after setting them correctly. Index: vdpinit.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/vdpinit.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- vdpinit.c 27 Feb 2007 23:27:07 -0000 1.2 +++ vdpinit.c 3 Mar 2007 02:59:05 -0000 1.3 @@ -51,6 +51,9 @@ else BIOS_SetClockSpeed(0); // 320 + for (i = 0; i < sizeof(vdp2settings); i++) + *(((u8 *)&vdp2settings)+i) = 0; + switch(res & 0x3) { case 0: @@ -124,9 +127,6 @@ VDP2_REG_CYCB0U = 0xFFFF; // No Access, No Access, No Access, No Access VDP2_REG_CYCB1L = 0xFFFF; // No Access, No Access, No Access, No Access VDP2_REG_CYCB1U = 0xFFFF; // No Access, No Access, No Access, No Access - - for (i = 0; i < sizeof(vdp2settings); i++) - *(((u8 *)&vdp2settings)+i) = 0; } ////////////////////////////////////////////////////////////////////////////// |
From: Theo B. <cyb...@us...> - 2007-03-01 23:21:52
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17714 Modified Files: makefile Log Message: -Added cd.c to list of objects to compile Index: makefile =================================================================== RCS file: /cvsroot/lapetus/lapetus/makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- makefile 1 Mar 2007 00:50:42 -0000 1.5 +++ makefile 1 Mar 2007 23:21:45 -0000 1.6 @@ -11,7 +11,7 @@ ASFLAGS = ARFLAGS = rv -OBJS = commlink.o dsp.o int.o lapetus.o smpc.o timer.o \ +OBJS = cd.o commlink.o dsp.o int.o lapetus.o smpc.o timer.o \ vdpinit.o scrscr.o rotscr.o text.o pal.o TARGET = $(LIBDIR)/liblapetus.a |
From: Theo B. <cyb...@us...> - 2007-03-01 23:21:39
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17578 Added Files: cd.c Log Message: -Initial add -Basically supports simple sector reads and cd audio playing --- NEW FILE: cd.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" ////////////////////////////////////////////////////////////////////////////// static int cdsectorsize = 2048; ////////////////////////////////////////////////////////////////////////////// void CDWriteCommand(cdcmd_struct *cdcmd) { CDB_REG_CR1 = cdcmd->CR1; CDB_REG_CR2 = cdcmd->CR2; CDB_REG_CR3 = cdcmd->CR3; CDB_REG_CR4 = cdcmd->CR4; } ////////////////////////////////////////////////////////////////////////////// void CDReadReturnStatus(cdcmd_struct *cdcmdrs) { cdcmdrs->CR1 = CDB_REG_CR1; cdcmdrs->CR2 = CDB_REG_CR2; cdcmdrs->CR3 = CDB_REG_CR3; cdcmdrs->CR4 = CDB_REG_CR4; } ////////////////////////////////////////////////////////////////////////////// int CDExecCommand(u16 hirqmask, cdcmd_struct *cdcmd, cdcmd_struct *cdcmdrs) { int old_levelmask; u16 hirq_temp; u16 cdstatus; int i; // Mask any interrupts, we don't need to be interrupted old_levelmask = InterruptGetLevelMask(); InterruptSetLevelMask(0xF); hirq_temp = CDB_REG_HIRQ; // Make sure CMOK flag is set, or we can't continue if (!(hirq_temp & HIRQ_CMOK)) return LAPETUS_ERR_BUSY; // Clear CMOK and any other user-defined flags CDB_REG_HIRQ = ~(hirqmask | HIRQ_CMOK); // Alright, time to execute the command CDWriteCommand(cdcmd); // Let's wait till the command operation is finished for (i = 0; i < 0x240000; i++) { hirq_temp = CDB_REG_HIRQ; if (hirq_temp & HIRQ_CMOK) break; } if (!(hirq_temp & HIRQ_CMOK)) return LAPETUS_ERR_BUSY; // Read return data CDReadReturnStatus(cdcmdrs); cdstatus = cdcmdrs->CR1 >> 8; // Was command good? if (cdstatus == STATUS_REJECT) return LAPETUS_ERR_BUSY; else if (cdstatus & STATUS_WAIT) return LAPETUS_ERR_BUSY; // return interrupts back to normal InterruptSetLevelMask(old_levelmask); // It's all good return LAPETUS_ERR_OK; } ////////////////////////////////////////////////////////////////////////////// int CDDebugExecCommand(u16 hirqmask, cdcmd_struct *cdcmd, cdcmd_struct *cdcmdrs) { int old_levelmask; u16 hirq_temp; // Mask any interrupts, we don't need to be interrupted old_levelmask = InterruptGetLevelMask(); InterruptSetLevelMask(0xF); hirq_temp = CDB_REG_HIRQ; // Make sure CMOK flag is set, or we can't continue if (!(hirq_temp & HIRQ_CMOK)) return LAPETUS_ERR_BUSY; // Clear CMOK and any other user-defined flags CDB_REG_HIRQ = ~(hirqmask | HIRQ_CMOK); // Alright, time to execute the command CDWriteCommand(cdcmd); // Go into an endless loop showing the HIRQ VdpPrintText(2 * 8, 20 * 8, 0xF0, "HIRQ = "); for (;;) VdpPrintf(2 * 8, 20 * 8, 0xF0, "%d", CDB_REG_HIRQ); // return interrupts back to normal InterruptSetLevelMask(old_levelmask); } ////////////////////////////////////////////////////////////////////////////// int CDCDBInit(int standby) { cdcmd_struct cdcmd; cdcmd_struct cdcmdrs; // CD Init Command cdcmd.CR1 = 0x0400; cdcmd.CR2 = standby; cdcmd.CR3 = 0x0000; cdcmd.CR4 = 0x040F; return CDExecCommand(0, &cdcmd, &cdcmdrs); } ////////////////////////////////////////////////////////////////////////////// int CDEndTransfer() { int ret; cdcmd_struct cdcmd; cdcmd_struct cdcmdrs; cdcmd.CR1 = 0x0600; cdcmd.CR2 = 0x0000; cdcmd.CR3 = 0x0000; cdcmd.CR4 = 0x0000; ret = CDExecCommand(0, &cdcmd, &cdcmdrs); CDB_REG_HIRQ = (~HIRQ_DRDY) | HIRQ_CMOK; return ret; } ////////////////////////////////////////////////////////////////////////////// static int linepos=16; int CDPlayFAD(int playmode, int startfad, int numsectors) { cdcmd_struct cdcmd; cdcmd_struct cdcmdrs; int ret; // Clear flags CDB_REG_HIRQ = ~(HIRQ_PEND|HIRQ_CSCT) | HIRQ_CMOK; cdcmd.CR1 = 0x1080 | (startfad >> 16); cdcmd.CR2 = startfad; cdcmd.CR3 = (playmode << 8) | 0x80 | (numsectors >> 16); cdcmd.CR4 = numsectors; ret = CDExecCommand(0, &cdcmd, &cdcmdrs); linepos++; return ret; } ////////////////////////////////////////////////////////////////////////////// int CDSeekFAD(int seekfad) { cdcmd_struct cdcmd; cdcmd_struct cdcmdrs; cdcmd.CR1 = 0x1180 | (seekfad >> 16); cdcmd.CR2 = seekfad; cdcmd.CR3 = 0; cdcmd.CR4 = 0; return CDExecCommand(0, &cdcmd, &cdcmdrs); } ////////////////////////////////////////////////////////////////////////////// int CDConnectCDToFilter(int filternum) { cdcmd_struct cdcmd; cdcmd_struct cdcmdrs; cdcmd.CR1 = 0x3000; cdcmd.CR2 = 0x0000; cdcmd.CR3 = filternum << 8; cdcmd.CR4 = 0x0000; return CDExecCommand(HIRQ_ESEL, &cdcmd, &cdcmdrs); } ////////////////////////////////////////////////////////////////////////////// static int CDSetFilterMode(int filternum, int mode) { int ret; cdcmd_struct cdcmd; cdcmd_struct cdcmdrs; cdcmd.CR1 = 0x4400 | (mode & 0xFF); cdcmd.CR2 = 0; cdcmd.CR3 = (filternum << 8); cdcmd.CR4 = 0; ret = CDExecCommand(HIRQ_ESEL, &cdcmd, &cdcmdrs); // Wait for function to finish while (!(CDB_REG_HIRQ & HIRQ_ESEL)) {} return ret; } ////////////////////////////////////////////////////////////////////////////// int CDSetFilterSubheaderConditions(int filternum) // fix me { int ret; cdcmd_struct cdcmd; cdcmd_struct cdcmdrs; cdcmd.CR1 = 0x4200 | 0x00; // fix me cdcmd.CR2 = 0x0000; // fix me cdcmd.CR3 = (filternum << 8) | 0x00; // fix me cdcmd.CR4 = 0x0000; // fix me ret = CDExecCommand(HIRQ_ESEL, &cdcmd, &cdcmdrs); // Wait for function to finish while (!(CDB_REG_HIRQ & HIRQ_ESEL)) {} return ret; } ////////////////////////////////////////////////////////////////////////////// int CDSetFilterConnection(int filternum, int connectflag, int truecon, int falsecon) { int ret; cdcmd_struct cdcmd; cdcmd_struct cdcmdrs; cdcmd.CR1 = 0x4600 | (connectflag & 0xFF); cdcmd.CR2 = (truecon << 8) | (falsecon & 0xFF); cdcmd.CR3 = (filternum << 8); cdcmd.CR4 = 0; ret = CDExecCommand(HIRQ_ESEL, &cdcmd, &cdcmdrs); // Wait for function to finish while (!(CDB_REG_HIRQ & HIRQ_ESEL)) {} return ret; } ////////////////////////////////////////////////////////////////////////////// int CDSetFilter(int filternum, int mode, int truecon, int falsecon) { int ret; if ((ret = CDSetFilterMode(filternum, mode)) != 0) return ret; // fix me // if ((ret = CDSetFilterSubheaderConditions(filternum)) != 0) // return ret; // Connect filter 0's true condition to selector 0, false condition to selector NULL if ((ret = CDSetFilterConnection(filternum, 0x03, truecon, falsecon)) != 0) return ret; return LAPETUS_ERR_OK; } ////////////////////////////////////////////////////////////////////////////// static int CDResetSelector(int resetflags, int selnum) { int ret; cdcmd_struct cdcmd; cdcmd_struct cdcmdrs; // Reset Selector Command cdcmd.CR1 = 0x4800 | ((u8)resetflags); cdcmd.CR2 = 0x0000; cdcmd.CR3 = (selnum << 8); cdcmd.CR4 = 0x0000; if ((ret = CDExecCommand(HIRQ_EFLS, &cdcmd, &cdcmdrs)) != 0) return ret; // wait for function to finish while (!(CDB_REG_HIRQ & HIRQ_ESEL)) {} return LAPETUS_ERR_OK; } ////////////////////////////////////////////////////////////////////////////// int CDResetSelectorOne(int selnum) { return CDResetSelector(0, selnum); } ////////////////////////////////////////////////////////////////////////////// int CDResetSelectorAll() { return CDResetSelector(0xFC, 0); } ////////////////////////////////////////////////////////////////////////////// int CDIsDataReady(int selnum) { int ret; cdcmd_struct cdcmd; cdcmd_struct cdcmdrs; cdcmd.CR1 = 0x5100; cdcmd.CR2 = 0; cdcmd.CR3 = (selnum << 8); cdcmd.CR4 = 0; if ((ret = CDExecCommand(0, &cdcmd, &cdcmdrs)) != 0) return LAPETUS_ERR_OK; // Return the number of sectors ready return cdcmdrs.CR4; } ////////////////////////////////////////////////////////////////////////////// int CDSetSectorSize(int size) { cdcmd_struct cdcmd; cdcmd_struct cdcmdrs; switch (size) { case 2048: cdsectorsize = size; size = 0; break; case 2336: cdsectorsize = size; size = 1; break; case 2340: cdsectorsize = size; size = 2; break; case 2352: cdsectorsize = size; size = 3; break; default: size = 0xFF; break; } cdcmd.CR1 = 0x6000 | (size & 0xFF); cdcmd.CR2 = size << 8; cdcmd.CR3 = 0x0000; cdcmd.CR4 = 0x0000; return CDExecCommand(HIRQ_ESEL, &cdcmd, &cdcmdrs); } ////////////////////////////////////////////////////////////////////////////// int CDGetThenDeleteSectorData(int selnum, int sectorpos, int numsectors) { cdcmd_struct cdcmd; cdcmd_struct cdcmdrs; cdcmd.CR1 = 0x6300; cdcmd.CR2 = sectorpos; cdcmd.CR3 = selnum << 8; cdcmd.CR4 = numsectors; return CDExecCommand(HIRQ_EHST, &cdcmd, &cdcmdrs); } ////////////////////////////////////////////////////////////////////////////// int CDAbortFile() { cdcmd_struct cdcmd; cdcmd_struct cdcmdrs; // Abort File Command cdcmd.CR1 = 0x7500; cdcmd.CR2 = 0x0000; cdcmd.CR3 = 0x0000; cdcmd.CR4 = 0x0000; return CDExecCommand(HIRQ_EFLS, &cdcmd, &cdcmdrs); } ////////////////////////////////////////////////////////////////////////////// int CDTransferData(u32 numsectors, u32 *buffer) { u32 i; int ret; // 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 < ((numsectors * cdsectorsize) / 4); i++) buffer[i] = CDB_REG_DATATRNS; // this can also be done in word units as well if ((ret = CDEndTransfer()) != 0) return ret; return LAPETUS_ERR_OK; } ////////////////////////////////////////////////////////////////////////////// int CDInit() { int ret; // Abort any file transfers that may be currently going if ((ret = CDAbortFile()) != 0) return ret; // Init CD Block if ((ret = CDCDBInit(0)) != 0) return ret; // End any previous cd buffer data transfers if ((ret = CDEndTransfer()) != 0) return ret; // Reset all buffer partitions, partition output connectors, all filter // conditions, all filter input connectors, etc. if ((ret = CDResetSelectorAll()) != 0) return ret; return LAPETUS_ERR_OK; } ////////////////////////////////////////////////////////////////////////////// int CDGetStat(cdstat_struct *cdstatus) { cdcmd_struct cdcmd; cdcmd_struct cdcmdrs; int ret; cdcmd.CR1 = 0x0000; cdcmd.CR2 = 0x0000; cdcmd.CR3 = 0x0000; cdcmd.CR4 = 0x0000; if ((ret = CDExecCommand(0, &cdcmd, &cdcmdrs)) != 0) return ret; cdstatus->status = cdcmdrs.CR1 >> 8; cdstatus->flag = (cdcmdrs.CR1 >> 4) & 0xF; cdstatus->repeatcnt = cdcmdrs.CR1 & 0xF; cdstatus->ctrladdr = cdcmdrs.CR2 >> 8; cdstatus->track = cdcmdrs.CR2 & 0xFF; cdstatus->index = cdcmdrs.CR3 >> 8; cdstatus->FAD = ((cdcmdrs.CR3 & 0xFF) << 16) | cdcmdrs.CR4; return LAPETUS_ERR_OK; } ////////////////////////////////////////////////////////////////////////////// int IsCDAuth(u16 *disctypeauth) { cdcmd_struct cdcmd; cdcmd_struct cdcmdrs; cdcmd.CR1 = 0xE100; cdcmd.CR2 = 0x0000; cdcmd.CR3 = 0x0000; cdcmd.CR4 = 0x0000; // If command fails, assume it's not authenticated if (CDExecCommand(0, &cdcmd, &cdcmdrs) != LAPETUS_ERR_OK) return FALSE; if (disctypeauth) *disctypeauth = cdcmdrs.CR2; // Disc type Authenticated: // 0x00: No CD/Not Authenticated // 0x01: Audio CD // 0x02: Regular Data CD(not Saturn disc) // 0x03: Copied/Pirated Saturn Disc // 0x04: Original Saturn Disc if (cdcmdrs.CR2 != 0x04 && cdcmdrs.CR2 != 0x02) return FALSE; return TRUE; } ////////////////////////////////////////////////////////////////////////////// int CDAuth() { int ret; cdcmd_struct cdcmd; cdcmd_struct cdcmdrs; u16 auth; cdstat_struct cdstatus; int i; // Clear hirq flags CDB_REG_HIRQ = ~(HIRQ_DCHG | HIRQ_EFLS); // Authenticate disc cdcmd.CR1 = 0xE000; cdcmd.CR2 = 0x0000; cdcmd.CR3 = 0x0000; cdcmd.CR4 = 0x0000; if ((ret = CDExecCommand(HIRQ_EFLS, &cdcmd, &cdcmdrs)) != 0) return ret; // wait till operation is finished while (!(CDB_REG_HIRQ & HIRQ_EFLS)) {} // Wait until drive has finished seeking for (;;) { // wait a bit for (i = 0; i < 100000; i++) { } if (CDGetStat(&cdstatus) != 0) continue; if (cdstatus.status == STATUS_PAUSE) break; else if (cdstatus.status == STATUS_FATAL) return LAPETUS_ERR_UNKNOWN; } // Was Authentication successful? if (!IsCDAuth(&auth)) return LAPETUS_ERR_AUTH; return LAPETUS_ERR_OK; } ////////////////////////////////////////////////////////////////////////////// int CDStopDrive() { int ret; cdcmd_struct cdcmd; cdcmd_struct cdcmdrs; cdstat_struct cdstatus; int i; // CD Init Command cdcmd.CR1 = 0x0400; cdcmd.CR2 = 0x0001; cdcmd.CR3 = 0x0000; cdcmd.CR4 = 0x040F; if ((ret = CDExecCommand(0, &cdcmd, &cdcmdrs)) != 0) return ret; // Wait till operation is finished(fix me) // Wait till drive is stopped for (;;) { // wait a bit for (i = 0; i < 100000; i++) { } if (CDGetStat(&cdstatus) != 0) continue; if (cdstatus.status == STATUS_STANDBY) break; else if (cdstatus.status == STATUS_FATAL) return LAPETUS_ERR_UNKNOWN; } return LAPETUS_ERR_OK; } ////////////////////////////////////////////////////////////////////////////// int CDStartDrive() { int ret; cdcmd_struct cdcmd; cdcmd_struct cdcmdrs; // CD Init Command cdcmd.CR1 = 0x0400; cdcmd.CR2 = 0x0000; cdcmd.CR3 = 0x0000; cdcmd.CR4 = 0x040F; if ((ret = CDExecCommand(0, &cdcmd, &cdcmdrs)) != 0) return ret; // wait till operation is finished(fix me) return LAPETUS_ERR_OK; } ////////////////////////////////////////////////////////////////////////////// int IsCDPresent() { cdstat_struct cdstatus; // If command fails, assume disc isn't present if (CDGetStat(&cdstatus) != 0) return FALSE; // Check status switch (cdstatus.status & 0xF) { case STATUS_BUSY: return FALSE; case STATUS_OPEN: return FALSE; case STATUS_NODISC: return FALSE; default: break; } return TRUE; } ////////////////////////////////////////////////////////////////////////////// int CDReadSector(void *buffer, u32 FAD, int sectorsize, u32 numsectors) { int ret; int done=0; u32 sectorsread=0; if ((ret = CDSetSectorSize(sectorsize)) != 0) return ret; // Set Filter /* // if ((ret = CDSetFilter(0, 1, 0, 0xFF)) != 0) // if ((ret = CDSetFilter(0, 0x80, 0, 0xFF)) != 0) if ((ret = CDSetFilter(0, 0x10, 0, 1)) != 0) return ret; */ // Clear partition 0 if ((ret = CDResetSelectorOne(0)) != 0) return ret; // Connect CD device to filter 0 if ((ret = CDConnectCDToFilter(0)) != 0) return ret; // Start reading sectors if ((ret = CDPlayFAD(0, FAD, numsectors)) != 0) return ret; while (!done) { u32 sectorstoread=0; // Wait until there's data ready while ((sectorstoread = CDIsDataReady(0)) == 0) {} // Setup a transfer from cd buffer to wram, then delete data // from cd buffer if ((ret = CDTransferData(sectorstoread, buffer)) != 0) return ret; sectorsread += sectorstoread; buffer += cdsectorsize; if (sectorsread >= numsectors) done = 1; } return LAPETUS_ERR_OK; } ////////////////////////////////////////////////////////////////////////////// // 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; cdcmd_struct cdcmdrs; int ret; SoundExternalAudioEnable(vol_l, vol_r); if ((ret = CDSetSectorSize(2048)) != 0) return ret; // Clear partition 0 if ((ret = CDResetSelectorOne(0)) != 0) return ret; // Connect CD device to filter 0 if ((ret = CDConnectCDToFilter(0)) != 0) return ret; // Clear flags CDB_REG_HIRQ = ~(HIRQ_PEND|HIRQ_CSCT) | HIRQ_CMOK; cdcmd.CR1 = 0x1000; cdcmd.CR2 = (audiotrack << 8) | 0x01; cdcmd.CR3 = repeat << 8; cdcmd.CR4 = (audiotrack << 8) | 0x63; ret = CDExecCommand(0, &cdcmd, &cdcmdrs); return ret; } ////////////////////////////////////////////////////////////////////////////// int StopCDAudio(void) { cdcmd_struct cdcmd; cdcmd_struct cdcmdrs; // Do a default seek, that should stop the cd from playing cdcmd.CR1 = 0x11FF; cdcmd.CR2 = 0xFFFF; cdcmd.CR3 = 0xFFFF; cdcmd.CR4 = 0xFFFF; return CDExecCommand(0, &cdcmd, &cdcmdrs); } ////////////////////////////////////////////////////////////////////////////// |
From: Theo B. <cyb...@us...> - 2007-03-01 23:20:27
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17095 Modified Files: TODO Log Message: -Updated Index: TODO =================================================================== RCS file: /cvsroot/lapetus/lapetus/TODO,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TODO 12 Feb 2007 06:15:50 -0000 1.1 +++ TODO 1 Mar 2007 23:20:24 -0000 1.2 @@ -7,3 +7,8 @@ From old code -------------- -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...> - 2007-03-01 23:18:59
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv16169 Modified Files: vdp.h Log Message: -Added prototypes for text display functions Index: vdp.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/vdp.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- vdp.h 1 Mar 2007 01:02:05 -0000 1.3 +++ vdp.h 1 Mar 2007 23:18:53 -0000 1.4 @@ -889,6 +889,10 @@ int VdpSetPalette(int type, void *palette, int size); int VdpSetDefaultPalette(void); +// Text related +void VdpPrintText(int x, int y, int color, const char *text); +void VdpPrintf(int x, int y, int color, char *format, ...); + ////////////////////////////////////////////////////////////////////////////// #endif |
From: Theo B. <cyb...@us...> - 2007-03-01 23:17:48
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15670 Modified Files: lapetus.h Log Message: -Added three new error types. Also added descriptions beside all the error types Index: lapetus.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/lapetus.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- lapetus.h 27 Feb 2007 23:36:09 -0000 1.5 +++ lapetus.h 1 Mar 2007 23:17:45 -0000 1.6 @@ -35,11 +35,14 @@ void InitLapetus(int res); -#define LAPETUS_ERR_OK 0 -#define LAPETUS_ERR_COMM -1 -#define LAPETUS_ERR_HWNOTFOUND -2 -#define LAPETUS_ERR_SIZE -3 -#define LAPETUS_ERR_INVALIDPOINTER -4 -#define LAPETUS_ERR_INVALIDARG -5 +#define LAPETUS_ERR_OK 0 // Everything is good +#define LAPETUS_ERR_COMM -1 // Communication error +#define LAPETUS_ERR_HWNOTFOUND -2 // Hardware not found +#define LAPETUS_ERR_SIZE -3 // Invalid size specified +#define LAPETUS_ERR_INVALIDPOINTER -4 // Invalid pointer passed +#define LAPETUS_ERR_INVALIDARG -5 // Invalid argument passed +#define LAPETUS_ERR_BUSY -6 // Hardware is busy +#define LAPETUS_ERR_UNKNOWN -7 // Unknown error +#define LAPETUS_ERR_AUTH -8 // Disc authentication error #endif |
From: Theo B. <cyb...@us...> - 2007-03-01 01:02:09
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv8078 Modified Files: vdp.h Log Message: -This goes along with the pal.c add. Index: vdp.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/vdp.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- vdp.h 27 Feb 2007 22:19:21 -0000 1.2 +++ vdp.h 1 Mar 2007 01:02:05 -0000 1.3 @@ -789,6 +789,13 @@ BG_16MCOLOR = 0x4 }; +enum CRMMODE +{ + CRM5_1024 = 0x0, + CRM5_2048 = 0x1, + CRM8_1024 = 0x2 +}; + #define SPRITE_MSBOFF 0x0000 #define SPRITE_MSBON 0x8000 @@ -818,7 +825,7 @@ #define SPRITE_8BPP256COLOR 0x0020 #define SPRITE_16BPP 0x0028 -#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) << 10) | ((r) & 0x1F)) typedef struct { @@ -878,6 +885,10 @@ void VdpEnableColorOffset(u16 screen, int select); void VdpDisableColorOffset(u16 screen); +// Palette related +int VdpSetPalette(int type, void *palette, int size); +int VdpSetDefaultPalette(void); + ////////////////////////////////////////////////////////////////////////////// #endif |
From: Theo B. <cyb...@us...> - 2007-03-01 00:50:46
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv1927 Modified Files: makefile text.c Log Message: -Fixed a compile error in text.c -Added text.c and pal.c to makefile -Did a few tweaks to the makefile Index: makefile =================================================================== RCS file: /cvsroot/lapetus/lapetus/makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- makefile 28 Feb 2007 04:28:37 -0000 1.4 +++ makefile 1 Mar 2007 00:50:42 -0000 1.5 @@ -2,16 +2,19 @@ AS = sh-coff-as AR = sh-coff-ar -GCC = C:\PROGRA~1\kpit\GNUSHV~1\Sh-coff - +GCC = C:\PROGRA~1\kpitcu~1\GNUSHV~1\Sh-coff\sh-coff +#LIBDIR = $(GCC)\lib LIBDIR = . -CFLAGS = -O2 -Wall -m2 -I$(GCC)\include\g++-v3 +#INCDIR = $(GCC)\include +INCDIR = . +CFLAGS = -O2 -Wall -m2 -I$(INCDIR) ASFLAGS = ARFLAGS = rv -OBJS = commlink.o dsp.o int.o lapetus.o smpc.o timer.o vdpinit.o scrscr.o rotscr.o +OBJS = commlink.o dsp.o int.o lapetus.o smpc.o timer.o \ + vdpinit.o scrscr.o rotscr.o text.o pal.o -TARGET = $(LIBDIR)/lapetus.a +TARGET = $(LIBDIR)/liblapetus.a all: $(TARGET) Index: text.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/text.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- text.c 28 Feb 2007 07:03:54 -0000 1.1 +++ text.c 1 Mar 2007 00:50:42 -0000 1.2 @@ -18,6 +18,7 @@ */ #include <stdio.h> +#include <stdarg.h> #include "lapetus.h" ////////////////////////////////////////////////////////////////////////////// @@ -31,7 +32,6 @@ void VdpPrintf(int x, int y, int color, char *format, ...) { char string[256]; // I hope that's enough - int i; va_list arg; va_start(arg, format); |
From: Theo B. <cyb...@us...> - 2007-03-01 00:48:41
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv724 Added Files: pal.c Log Message: -Initial add --- NEW FILE: pal.c --- /* 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 */ // Copy a VGA palette to Color Ram #include "lapetus.h" //#define RGB16(r, g, b) ((r) | ((g) << 5) | ((b) << 10)) u16 defaultpalette[256] = { RGB16(0, 0, 0), RGB16(0, 0, 21), RGB16(0, 21, 0), RGB16(0, 21, 21), RGB16(21, 0, 0), RGB16(21, 0, 21), RGB16(21, 10, 0), RGB16(21, 21, 21), RGB16(10, 10, 10), RGB16(10, 10, 31), RGB16(10, 31, 10), RGB16(10, 31, 31), RGB16(31, 10, 10), RGB16(31, 10, 31), RGB16(31, 31, 10), RGB16(31, 31, 31), RGB16(0, 0, 0), RGB16(2, 2, 2), RGB16(4, 4, 4), RGB16(5, 5, 5), RGB16(7, 7, 7), RGB16(8, 8, 8), RGB16(10, 10, 10), RGB16(12, 12, 12), RGB16(14, 14, 14), RGB16(16, 16, 16), RGB16(18, 18, 18), RGB16(20, 20, 20), RGB16(22, 22, 22), RGB16(25, 25, 25), RGB16(28, 28, 28), RGB16(31, 31, 31), RGB16(0, 0, 31), RGB16(8, 0, 31), RGB16(15, 0, 31), RGB16(23, 0, 31), RGB16(31, 0, 31), RGB16(31, 0, 23), RGB16(31, 0, 15), RGB16(31, 0, 8), RGB16(31, 0, 0), RGB16(31, 8, 0), RGB16(31, 15, 0), RGB16(31, 23, 0), RGB16(31, 31, 0), RGB16(23, 31, 0), RGB16(15, 31, 0), RGB16(8, 31, 0), RGB16(0, 31, 0), RGB16(0, 31, 8), RGB16(0, 31, 15), RGB16(0, 31, 23), RGB16(0, 31, 31), RGB16(0, 23, 31), RGB16(0, 15, 31), RGB16(0, 8, 31), RGB16(15, 15, 31), RGB16(19, 15, 31), RGB16(23, 15, 31), RGB16(27, 15, 31), RGB16(31, 15, 31), RGB16(31, 15, 27), RGB16(31, 15, 23), RGB16(31, 15, 19), RGB16(31, 15, 15), RGB16(31, 19, 15), RGB16(31, 23, 15), RGB16(31, 27, 15), RGB16(31, 31, 15), RGB16(27, 31, 15), RGB16(23, 31, 15), RGB16(19, 31, 15), RGB16(15, 31, 15), RGB16(15, 31, 19), RGB16(15, 31, 23), RGB16(15, 31, 27), RGB16(15, 31, 31), RGB16(15, 27, 31), RGB16(15, 23, 31), RGB16(15, 19, 31), RGB16(22, 22, 31), RGB16(24, 22, 31), RGB16(27, 22, 31), RGB16(29, 22, 31), RGB16(31, 22, 31), RGB16(31, 22, 29), RGB16(31, 22, 27), RGB16(31, 22, 24), RGB16(31, 22, 22), RGB16(31, 24, 22), RGB16(31, 27, 22), RGB16(31, 29, 22), RGB16(31, 31, 22), RGB16(29, 31, 22), RGB16(27, 31, 22), RGB16(24, 31, 22), RGB16(22, 31, 22), RGB16(22, 31, 24), RGB16(22, 31, 27), RGB16(22, 31, 29), RGB16(22, 31, 31), RGB16(22, 29, 31), RGB16(22, 27, 31), RGB16(22, 24, 31), RGB16(0, 0, 14), RGB16(3, 0, 14), RGB16(7, 0, 14), RGB16(10, 0, 14), RGB16(14, 0, 14), RGB16(14, 0, 10), RGB16(14, 0, 7), RGB16(14, 0, 3), RGB16(14, 0, 0), RGB16(14, 3, 0), RGB16(14, 7, 0), RGB16(14, 10, 0), RGB16(14, 14, 0), RGB16(10, 14, 0), RGB16(7, 14, 0), RGB16(3, 14, 0), RGB16(0, 14, 0), RGB16(0, 14, 3), RGB16(0, 14, 7), RGB16(0, 14, 10), RGB16(0, 14, 14), RGB16(0, 10, 14), RGB16(0, 7, 14), RGB16(0, 3, 14), RGB16(7, 7, 14), RGB16(8, 7, 14), RGB16(10, 7, 14), RGB16(12, 7, 14), RGB16(14, 7, 14), RGB16(14, 7, 12), RGB16(14, 7, 10), RGB16(14, 7, 8), RGB16(14, 7, 7), RGB16(14, 8, 7), RGB16(14, 10, 7), RGB16(14, 12, 7), RGB16(14, 14, 7), RGB16(12, 14, 7), RGB16(10, 14, 7), RGB16(8, 14, 7), RGB16(7, 14, 7), RGB16(7, 14, 8), RGB16(7, 14, 10), RGB16(7, 14, 12), RGB16(7, 14, 14), RGB16(7, 12, 14), RGB16(7, 10, 14), RGB16(7, 8, 14), RGB16(10, 10, 14), RGB16(11, 10, 14), RGB16(12, 10, 14), RGB16(13, 10, 14), RGB16(14, 10, 14), RGB16(14, 10, 13), RGB16(14, 10, 12), RGB16(14, 10, 11), RGB16(14, 10, 10), RGB16(14, 11, 10), RGB16(14, 12, 10), RGB16(14, 13, 10), RGB16(14, 14, 10), RGB16(13, 14, 10), RGB16(12, 14, 10), RGB16(11, 14, 10), RGB16(10, 14, 10), RGB16(10, 14, 11), RGB16(10, 14, 12), RGB16(10, 14, 13), RGB16(10, 14, 14), RGB16(10, 13, 14), RGB16(10, 12, 14), RGB16(10, 11, 14), RGB16(0, 0, 8), RGB16(2, 0, 8), RGB16(4, 0, 8), RGB16(6, 0, 8), RGB16(8, 0, 8), RGB16(8, 0, 6), RGB16(8, 0, 4), RGB16(8, 0, 2), RGB16(8, 0, 0), RGB16(8, 2, 0), RGB16(8, 4, 0), RGB16(8, 6, 0), RGB16(8, 8, 0), RGB16(6, 8, 0), RGB16(4, 8, 0), RGB16(2, 8, 0), RGB16(0, 8, 0), RGB16(0, 8, 2), RGB16(0, 8, 4), RGB16(0, 8, 6), RGB16(0, 8, 8), RGB16(0, 6, 8), RGB16(0, 4, 8), RGB16(0, 2, 8), RGB16(4, 4, 8), RGB16(5, 4, 8), RGB16(6, 4, 8), RGB16(7, 4, 8), RGB16(8, 4, 8), RGB16(8, 4, 7), RGB16(8, 4, 6), RGB16(8, 4, 5), RGB16(8, 4, 4), RGB16(8, 5, 4), RGB16(8, 6, 4), RGB16(8, 7, 4), RGB16(8, 8, 4), RGB16(7, 8, 4), RGB16(6, 8, 4), RGB16(5, 8, 4), RGB16(4, 8, 4), RGB16(4, 8, 5), RGB16(4, 8, 6), RGB16(4, 8, 7), RGB16(4, 8, 8), RGB16(4, 7, 8), RGB16(4, 6, 8), RGB16(4, 5, 8), RGB16(5, 5, 8), RGB16(6, 5, 8), RGB16(6, 5, 8), RGB16(7, 5, 8), RGB16(8, 5, 8), RGB16(8, 5, 7), RGB16(8, 5, 6), RGB16(8, 5, 6), RGB16(8, 5, 5), RGB16(8, 6, 5), RGB16(8, 6, 5), RGB16(8, 7, 5), RGB16(8, 8, 5), RGB16(7, 8, 5), RGB16(6, 8, 5), RGB16(6, 8, 5), RGB16(5, 8, 5), RGB16(5, 8, 6), RGB16(5, 8, 6), RGB16(5, 8, 7), RGB16(5, 8, 8), RGB16(5, 7, 8), RGB16(5, 6, 8), RGB16(5, 6, 8), RGB16(0, 0, 0), RGB16(0, 0, 0), RGB16(0, 0, 0), RGB16(0, 0, 0), RGB16(0, 0, 0), RGB16(0, 0, 0), RGB16(0, 0, 0), RGB16(0, 0, 0) }; ////////////////////////////////////////////////////////////////////////////// int VdpSetPalette(int type, void *palette, int size) { int i; switch (type) { case CRM5_1024: case CRM5_2048: // Set color ram mode VDP2_REG_RAMCTL = (VDP2_REG_RAMCTL & 0xCFFF) | (type << 12); // Copy over palette to color ram for (i = 0; i < (size * 2); i+=2) *((volatile u16 *)(VDP2_CRAM+i)) = *((u16 *)(palette+i)); break; case CRM8_1024: // Set color ram mode VDP2_REG_RAMCTL = (VDP2_REG_RAMCTL & 0xCFFF) | 0x3000; // Copy over palette to color ram for (i = 0; i < (size * 4); i+=4) *((volatile u32 *)(VDP2_CRAM+i)) = *((u32 *)(palette+i)); break; default: return LAPETUS_ERR_INVALIDARG; } return LAPETUS_ERR_OK; } ////////////////////////////////////////////////////////////////////////////// int VdpSetDefaultPalette(void) { return VdpSetPalette(CRM5_2048, defaultpalette, 256); } ////////////////////////////////////////////////////////////////////////////// |