lapetus-cvs Mailing List for Lapetus (Page 4)
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-02-28 07:03:58
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv22950 Added Files: text.c Log Message: -Initial add --- NEW FILE: text.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 <stdio.h> #include "lapetus.h" ////////////////////////////////////////////////////////////////////////////// void VdpPrintText(int x, int y, int color, const char *text) { } ////////////////////////////////////////////////////////////////////////////// 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); vsprintf(string, format, arg); VdpPrintText(x, y, color, string); va_end(arg); } ////////////////////////////////////////////////////////////////////////////// |
From: Theo B. <cyb...@us...> - 2007-02-28 04:38:23
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv22012 Modified Files: timer.c Log Message: -Changed to use new functions, etc. Index: timer.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/timer.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- timer.c 12 Feb 2007 04:19:49 -0000 1.2 +++ timer.c 28 Feb 2007 04:38:09 -0000 1.3 @@ -74,14 +74,14 @@ int TimerSetup(int type, u32 *freq) { u32 clock=0; - int old_imask = get_imask(); + int old_levelmask = InterruptGetLevelMask(); if (freq == NULL) return LAPETUS_ERR_INVALIDPOINTER; freq[0] = 0; - set_imask(0xF); + InterruptSetLevelMask(0xF); if (BIOS_GetClockSpeed == 0) clock = 26846587; @@ -141,11 +141,11 @@ case TIMER_HBLANK: // Setup Interrupt BIOS_SetSCUInterrupt(0x42, TimerHBlankIncrement); - BIOS_ChangeSCUInterruptMask(~0x0004, 0); + BIOS_ChangeSCUInterruptMask(~MASK_HBLANKIN, 0); freq[0] = 224; // fix me - if (old_imask > 0xC) - old_imask = 0xC; + if (old_levelmask > 0xC) + old_levelmask = 0xC; break; default: @@ -153,10 +153,10 @@ } timercounter = 0; - if (old_imask == 0xF) - old_imask = 0xE; + if (old_levelmask == 0xF) + old_levelmask = 0xE; - set_imask(old_imask); + InterruptSetLevelMask(old_levelmask); return LAPETUS_ERR_OK; } |
From: Theo B. <cyb...@us...> - 2007-02-28 04:28:40
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv18056 Modified Files: makefile Log Message: -Includes all the new files Index: makefile =================================================================== RCS file: /cvsroot/lapetus/lapetus/makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- makefile 16 Feb 2007 01:38:50 -0000 1.3 +++ makefile 28 Feb 2007 04:28:37 -0000 1.4 @@ -5,11 +5,11 @@ GCC = C:\PROGRA~1\kpit\GNUSHV~1\Sh-coff LIBDIR = . -CFLAGS = -O2 -Wall -m2 -I$(GCC)\include\g++-v3 -DDEBUG +CFLAGS = -O2 -Wall -m2 -I$(GCC)\include\g++-v3 ASFLAGS = ARFLAGS = rv -OBJS = commlink.o dsp.o timer.o vdpinit.o +OBJS = commlink.o dsp.o int.o lapetus.o smpc.o timer.o vdpinit.o scrscr.o rotscr.o TARGET = $(LIBDIR)/lapetus.a |
From: Theo B. <cyb...@us...> - 2007-02-28 04:25:39
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv16803 Added Files: smpc.c Log Message: -Initial add --- NEW FILE: smpc.c --- /* Copyright 2005-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" perdata_struct per[MAX_PERIPHERALS]; static u16 oldperpush[MAX_PERIPHERALS]; // fix me ////////////////////////////////////////////////////////////////////////////// void SmpcCommand (u8 cmd) { SmpcWaitTillReady(); SmpcIssueCommand(cmd); } ////////////////////////////////////////////////////////////////////////////// void perhandler(void) { // Issue Intback command(we only want peripheral data) SmpcWaitTillReady(); SMPC_REG_IREG(0) = 0x00; // no intback status SMPC_REG_IREG(1) = 0x0A; // 15-byte mode, peripheral data returned, time optimized SMPC_REG_IREG(2) = 0xF0; // ??? SmpcIssueCommand(SMPC_CMD_INTBACK); } ////////////////////////////////////////////////////////////////////////////// void smpchandler() { /* Port Status: 0x04 - Sega-tap is connected 0x16 - Multi-tap is connected 0x21-0x2F - Clock serial peripheral is connected 0xF0 - Not Connected or Unknown Device 0xF1 - Peripheral is directly connected Peripheral ID: 0x02 - Digital Device Standard Format 0x13 - Racing Device Standard Format 0x15 - Analog Device Standard Format 0x23 - Pointing Device Standard Format 0x23 - Shooting Device Standard Format 0x34 - Keyboard Device Standard Format 0xE1 - Mega Drive 3-Button Pad 0xE2 - Mega Drive 6-Button Pad 0xE3 - Saturn Mouse 0xFF - Not Connected Special Notes: If a peripheral is disconnected from a port, SMPC only returns 1 byte for that port(which is the port status 0xF0), at the next OREG is the port status of the next port. e.g. If Port 1 has nothing connected, and Port 2 has a controller connected: OREG0 = 0xF0 OREG1 = 0xF1 OREG2 = 0x02 etc. */ u16 perdata; u8 portcon; u8 perid; u8 oregcounter=0; u8 percounter=0; int i, i2; // See what is actually connected to Port 1/2 for (i2 = 0; i2 < 2; i2++) { portcon = SMPC_REG_OREG(oregcounter); oregcounter++; if ((portcon & 0xF0) != 0x20) { for (i = 0; i < (portcon & 0x0F); i++) { per[i+percounter].id = perid = SMPC_REG_OREG(oregcounter); oregcounter++; // if (perid == 0x02) // { // oldperpush[i+percounter] = per[i+percounter].butpush; // perdata = (SMPC_REG_OREG(oregcounter) << 8) | SMPC_REG_OREG(oregcounter+1); // oregcounter += 2; // } // else // oregcounter += (perid & 0xF); switch (perid >> 4) { case 0x0: // Standard Pad type case 0x1: // Analog type(Racing wheel/Analog pad) case 0x3: // Keyboard type { oldperpush[i+percounter] = per[i+percounter].butpush; perdata = (SMPC_REG_OREG(oregcounter) << 8) | SMPC_REG_OREG(oregcounter+1); oregcounter += 2; switch (perid & 0xF) { case 0x3: // Racing oregcounter += 1; break; case 0x4: // Keyboard ((keyboarddata_struct *)per)[i+percounter].kbdtype = perdata & 0x7; perdata |= 0x7; ((keyboarddata_struct *)per)[i+percounter].flags = SMPC_REG_OREG(oregcounter); ((keyboarddata_struct *)per)[i+percounter].key = SMPC_REG_OREG(oregcounter+1); if (((keyboarddata_struct *)per)[i+percounter].flags != 0x6) { if (((keyboarddata_struct *)per)[i+percounter].key == KEY_LEFTSHIFT || ((keyboarddata_struct *)per)[i+percounter].key == KEY_RIGHTSHIFT) ((keyboarddata_struct *)per)[i+percounter].extrastate[0] = (((keyboarddata_struct *)per)[i+percounter].flags >> 3) & 0x1; } oregcounter += 2; break; case 0x5: // Analog Pad oregcounter += 3; break; default: break; } per[i+percounter].butpush = perdata ^ 0xFFFF; per[i+percounter].butpushonce = (oldperpush[i+percounter] ^ per[i+percounter].butpush) & per[i+percounter].butpush; break; } case 0x2: // Pointer type(Mouse/Gun) case 0xE: // Other type(Mega Drive 3/6 button pads/Shuttle Mouse) { switch (perid & 0xF) { case 0x2: // Mega Drive 6-button Pad case 0x1: // Mega Drive 3-button Pad break; case 0x3: // Saturn/Shuttle Mouse { perdata = SMPC_REG_OREG(oregcounter); per[i+percounter].butpush = (perdata & 0xF) << 8; // fix me per[i+percounter].butpushonce = (oldperpush[i+percounter] ^ per[i+percounter].butpush) & per[i+percounter].butpush; ((mousedata_struct *)per)[i+percounter].flags = perdata >> 4; ((mousedata_struct *)per)[i+percounter].x = SMPC_REG_OREG(oregcounter+1); ((mousedata_struct *)per)[i+percounter].y = SMPC_REG_OREG(oregcounter+2); // X Overflow if (((mousedata_struct *)per)[i+percounter].flags & 0x4) ((mousedata_struct *)per)[i+percounter].x++; // X Sign if (((mousedata_struct *)per)[i+percounter].flags & 0x1) ((mousedata_struct *)per)[i+percounter].x = 0 - ((mousedata_struct *)per)[i+percounter].x - 1; // Y Overflow if (((mousedata_struct *)per)[i+percounter].flags & 0x8) ((mousedata_struct *)per)[i+percounter].y++; // Y Sign if (((mousedata_struct *)per)[i+percounter].flags & 0x2) ((mousedata_struct *)per)[i+percounter].y = 0 - ((mousedata_struct *)per)[i+percounter].y - 1; break; } default: break; } oregcounter += (perid & 0xF); break; } default: break; } percounter++; } } } // Issue break SMPC_REG_IREG(0) = 0x40; } ////////////////////////////////////////////////////////////////////////////// void PerInit() { // Make sure vblank-out's and SMPC's interrupts are disabled BIOS_ChangeSCUInterruptMask(0xFFFFFFF, MASK_VBLANKOUT | MASK_SYSTEMMANAGER); SMPC_REG_DDR1 = 0; SMPC_REG_EXLE = 0; SMPC_REG_IOSEL = 0; // Set both ports to SMPC control mode // Add our vblank-out interrupt BIOS_SetSCUInterrupt(0x41, perhandler); // Add our SMPC interrupt BIOS_SetSCUInterrupt(0x47, smpchandler); // Clear internal variables memset(oldperpush, 0, MAX_PERIPHERALS * sizeof(u16)); memset(per, 0, sizeof(perdata_struct) * MAX_PERIPHERALS); // Unmask vblank-out interrupt BIOS_ChangeSCUInterruptMask(~(MASK_VBLANKOUT | MASK_SYSTEMMANAGER), 0); } ////////////////////////////////////////////////////////////////////////////// |
From: Theo B. <cyb...@us...> - 2007-02-28 02:19:39
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29201 Modified Files: smpc.h Log Message: -Fixed copyright -Fixed some formatting Index: smpc.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/smpc.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- smpc.h 12 Feb 2007 05:56:50 -0000 1.1 +++ smpc.h 28 Feb 2007 02:19:35 -0000 1.2 @@ -1,4 +1,4 @@ -/* Copyright 2006-2007 Theo Berkau +/* Copyright 2005-2007 Theo Berkau This file is part of Lapetus. @@ -24,17 +24,17 @@ ////////////////////////////////////////////////////////////////////////////// -#define SMPC_REG_IREG(i) *((volatile u8 *)0x20100001+((i) * 2)) -#define SMPC_REG_COMREG *((volatile u8 *)0x2010001F) -#define SMPC_REG_OREG(o) *((volatile u8 *)0x20100021+((o) * 2)) -#define SMPC_REG_SR *((volatile u8 *)0x20100061) -#define SMPC_REG_SF *((volatile u8 *)0x20100063) -#define SMPC_REG_PDR1 *((volatile u8 *)0x20100075) -#define SMPC_REG_PDR2 *((volatile u8 *)0x20100077) -#define SMPC_REG_DDR1 *((volatile u8 *)0x20100079) -#define SMPC_REG_DDR2 *((volatile u8 *)0x2010007B) -#define SMPC_REG_IOSEL *((volatile u8 *)0x2010007D) -#define SMPC_REG_EXLE *((volatile u8 *)0x2010007F) +#define SMPC_REG_IREG(i) *((volatile u8 *)0x20100001+((i) * 2)) +#define SMPC_REG_COMREG *((volatile u8 *)0x2010001F) +#define SMPC_REG_OREG(o) *((volatile u8 *)0x20100021+((o) * 2)) +#define SMPC_REG_SR *((volatile u8 *)0x20100061) +#define SMPC_REG_SF *((volatile u8 *)0x20100063) +#define SMPC_REG_PDR1 *((volatile u8 *)0x20100075) +#define SMPC_REG_PDR2 *((volatile u8 *)0x20100077) +#define SMPC_REG_DDR1 *((volatile u8 *)0x20100079) +#define SMPC_REG_DDR2 *((volatile u8 *)0x2010007B) +#define SMPC_REG_IOSEL *((volatile u8 *)0x2010007D) +#define SMPC_REG_EXLE *((volatile u8 *)0x2010007F) ////////////////////////////////////////////////////////////////////////////// |
From: Theo B. <cyb...@us...> - 2007-02-28 02:06:36
|
Update of /cvsroot/lapetus/lapetus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv23878 Added Files: lapetus.c Log Message: -Initial add --- NEW FILE: lapetus.c --- /* Copyright 2005-2007 Theo Berkau This file is part of Lapetus. Lapetus is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Lapetus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Lapetus; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "lapetus.h" ////////////////////////////////////////////////////////////////////// void InitLapetus(int res) { int i; InterruptSetLevelMask(0xF); for (i = 0; i < 0x80; i++) BIOS_SetSH2Interrupt(i, 0); for (i = 0x40; i < 0x60; i++) BIOS_SetSCUInterrupt(i, 0); // Make sure all interrupts have been called BIOS_ChangeSCUInterruptMask(0, 0); BIOS_ChangeSCUInterruptMask(0xFFFFFFFF, 0xFFFFFFFF); VdpInit(res); PerInit(); CommlinkStopService(); #ifdef DEBUG DebugInit(); #endif if (InterruptGetLevelMask() > 0x7) InterruptSetLevelMask(0x7); } ////////////////////////////////////////////////////////////////////// |