[Lapetus-cvs] lapetus/tests/regtest cdb.c, 1.1, 1.2 cdb.h, 1.1, 1.2 intfac.c, 1.1, 1.2 intfac.h, 1.
Status: Inactive
Brought to you by:
cyberwarriorx
From: Theo B. <cyb...@us...> - 2008-01-08 09:28:45
|
Update of /cvsroot/lapetus/lapetus/tests/regtest In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29063 Modified Files: cdb.c cdb.h intfac.c intfac.h main.c main.h makefile objects scsp.c scsp.h scu.c scu.h sh2.c tests.h vdp2.c vdp2.h Log Message: -Did some major tweaks to the menu system(looks a lot better) -Reworked a bunch of code -Added more framework code for areas that aren't finished Index: sh2.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/sh2.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- sh2.c 7 Jan 2008 03:10:46 -0000 1.1 +++ sh2.c 8 Jan 2008 09:28:40 -0000 1.2 @@ -62,6 +62,9 @@ RegisterTest(&DivOperationTest, "DIV operations"); RegisterTest(&DivInterruptTest, "DIV overflow interrupt"); DoTests("SH2 tests", 0, 0); + + // Other tests to do: instruction tests, check all register accesses, + // onchip functions } ////////////////////////////////////////////////////////////////////////////// Index: cdb.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/cdb.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- cdb.c 7 Jan 2008 03:10:46 -0000 1.1 +++ cdb.c 8 Jan 2008 09:28:40 -0000 1.2 @@ -18,12 +18,49 @@ */ #include <lapetus.h> +#include "intfac.h" #include "tests.h" +#include "cdb.h" ////////////////////////////////////////////////////////////////////////////// void cdbtest() { + int choice; + + MENUITEMSTRUCT cdbmenu[] = { + { "CD Commands", &cdcmdtest, }, + { "MPEG Commands", &mpegcmdtest, }, + { "Misc CD Block" , &misccdtest, }, + { "Go back to main menu", NULL }, + { "\0", NULL } + }; + + for (;;) + { + choice = DoMenu(cdbmenu, 8, 14, "CD Block Tests"); + ClearScr(); + if (choice == ((sizeof(cdbmenu) / sizeof(MENUITEMSTRUCT)) - 2)) + break; + } +} + +////////////////////////////////////////////////////////////////////////////// + +void cdcmdtest() +{ +} + +////////////////////////////////////////////////////////////////////////////// + +void mpegcmdtest() +{ +} + +////////////////////////////////////////////////////////////////////////////// + +void misccdtest() +{ } ////////////////////////////////////////////////////////////////////////////// Index: objects =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/objects,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- objects 7 Jan 2008 03:10:46 -0000 1.1 +++ objects 8 Jan 2008 09:28:40 -0000 1.2 @@ -1,10 +1,14 @@ OBJ = $(CRT0) \ obj/main.o \ + obj/cart.o \ obj/cdb.o \ obj/dsp.o \ + obj/m68k.o \ obj/scsp.o \ obj/scu.o \ + obj/smpc.o \ obj/sh2.o \ + obj/vdp1.o \ obj/vdp2.o \ obj/tests.o \ obj/intfac.o Index: makefile =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- makefile 7 Jan 2008 03:10:46 -0000 1.1 +++ makefile 8 Jan 2008 09:28:40 -0000 1.2 @@ -4,10 +4,10 @@ # FLAGS = -Wall -g -#EXE = main.bin -EXE = main.coff +EXE = main.bin +#EXE = main.coff all: $(EXE) -TARGETTYPE = coff-sh +#TARGETTYPE = coff-sh include ../shared/makefile include ./objects Index: cdb.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/cdb.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- cdb.h 7 Jan 2008 03:10:46 -0000 1.1 +++ cdb.h 8 Jan 2008 09:28:40 -0000 1.2 @@ -17,9 +17,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef CDB_H -#define CDB_H +#ifndef CDBH +#define CDBH void cdbtest(); +void cdcmdtest(); +void mpegcmdtest(); +void misccdtest(); #endif Index: scu.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/scu.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- scu.h 7 Jan 2008 03:10:46 -0000 1.1 +++ scu.h 8 Jan 2008 09:28:40 -0000 1.2 @@ -17,8 +17,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef SCU_H -#define SCU_H +#ifndef SCUH +#define SCUH void scutest(); void TestSCUVERRegister(); Index: intfac.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/intfac.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- intfac.c 7 Jan 2008 03:10:46 -0000 1.1 +++ intfac.c 8 Jan 2008 09:28:40 -0000 1.2 @@ -1,3 +1,22 @@ +/* Copyright 2006-2008 Theo Berkau + + This file is part of Lapetus. + + Lapetus is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + Lapetus is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Lapetus; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + #include <string.h> #include <lapetus.h> #include "intfac.h" @@ -7,8 +26,6 @@ void ClearScr(void) { - int i, i2; - VdpDispOff(); VdpClearScreen(&testdispfont); VdpDispOn(); @@ -16,13 +33,22 @@ ////////////////////////////////////////////////////////////////////////////// -int DoMenu(MENUITEMSTRUCT *menu, int x, int y) +int DoMenu(MENUITEMSTRUCT *menu, int x, int y, const char *title) { int cursel=0; int nummenu=0; int i; + int menux, menuy; + + // Setup Priorities + VDP2_REG_PRIR = 0x0002; + VDP2_REG_PRISA = 0x0101; + VDP2_REG_PRISB = 0x0101; + VDP2_REG_PRISC = 0x0101; + VDP2_REG_PRISD = 0x0101; // Make sure current screen is clear + WindowInit(); // Figure out how many menu items there are for (;;) @@ -31,71 +57,23 @@ nummenu++; } - // Add Menu Sprite to draw list - for (i = 0; i < nummenu; i++) - VdpPrintf(&testdispfont, (x+1) * 8, (y+i) * 8, 0xF, (char *)menu[i].name); - - // Add Selected Menu Item(should always be first item) sprite to draw list - VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, ">"); - - for (;;) - { - VdpVsync(); - - // poll joypad(if menu item is selected, return) - if (per[0].butpushonce & PAD_UP) - { - VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, " "); - - if (cursel > 0) - cursel--; - - VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, ">"); - } - else if (per[0].butpushonce & PAD_DOWN) - { - VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, " "); - - if (cursel < (nummenu - 1)) - cursel++; - - VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, ">"); - } - - if (per[0].butpushonce & PAD_A) - { - ClearScr(); - - if (menu[cursel].func) - menu[cursel].func(); - return cursel; - } - } -} - -////////////////////////////////////////////////////////////////////////////// - -int DoWindow(WINDOWSTRUCT *window, int x, int y) -{ - int nummenu=0; - int i; + WindowDraw(x, y, 260, 5+5+5+8+nummenu*8, 0, RGB16(26, 26, 25) | 0X8000); - // Make sure current screen is clear + // Draw title + VdpPrintf(&testdispfont, x+6, y+5, 15, "%s", title); - // Figure out how many window items there are - for (;;) - { -// if (menu[nummenu].name[0] == '\0') break; -// nummenu++; - } + menux = x + 6; + menuy = y + 5 + 8 + 5; -/* // Add Menu Sprite to draw list for (i = 0; i < nummenu; i++) - VdpPrintf(&testdispfont, (x+1) * 8, (y+i) * 8, 0xF, (char *)menu[i].name); + { + VdpPrintf(&testdispfont, menux + (1 * 8) + 1, menuy + (i * 8)+1, 0x10, (char *)menu[i].name); + VdpPrintf(&testdispfont, menux + (1 * 8), menuy + (i * 8), 0xF, (char *)menu[i].name); + } // Add Selected Menu Item(should always be first item) sprite to draw list - VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, ">"); + VdpPrintf(&testdispfont, menux, menuy+(cursel * 8), 0xF, ">"); for (;;) { @@ -104,21 +82,21 @@ // poll joypad(if menu item is selected, return) if (per[0].butpushonce & PAD_UP) { - VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, " "); + VdpPrintf(&testdispfont, menux, menuy + (cursel * 8), 0, ">"); if (cursel > 0) cursel--; - VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, ">"); + VdpPrintf(&testdispfont, menux, menuy + (cursel * 8), 0xF, ">"); } else if (per[0].butpushonce & PAD_DOWN) { - VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, " "); + VdpPrintf(&testdispfont, menux, menuy + (cursel * 8), 0x0, ">"); if (cursel < (nummenu - 1)) cursel++; - VdpPrintf(&testdispfont, x * 8, (y+cursel) * 8, 0xF, ">"); + VdpPrintf(&testdispfont, menux, menuy + (cursel * 8), 0xF, ">"); } if (per[0].butpushonce & PAD_A) @@ -130,98 +108,101 @@ return cursel; } } -*/ } ////////////////////////////////////////////////////////////////////////////// -/* int MessageBox(const char *header, const char *body, int type) { - int body_x=0, body_y=0; - - body_x = ((320 / 8) - strlen(body)) / 2; // fix me - body_y = (224 / 8) / 2; // fix me +// WindowDraw(wnd->x, wnd->y, wnd->width, wnd->height, 0, RGB16(26, 26, 25) | 0X8000); - for (;;) - { - VdpVsync(); + return 0; // fix me(it should return what control was chosen) +} -// VdpStartDrawList(); -// Vdp1printf(body_x * 8, body_y * 8, 0xF0, (char *)body); -// _printf(body_x * 8, body_y * 8, 0xF0, (char *)body); -// Vdp1DrawPolygon(body_x - 8, body_y - 8, -// body_x + (strlen(body) * 8) + 8, body_y - 8, -// body_x + (strlen(body) * 8) + 8, body_y + 16, // fix me -// body_x - 8, body_y + 16, // fix me -// RGB16(0, 0, 127), -// SPRITE_ENDCODEDISABLE | SPRITE_TRANSPIXELDISABLE | SPRITE_16BPP); +////////////////////////////////////////////////////////////////////////////// -// Vdp1DrawNormalSprite(0, 16, 16, 0, 0, 0); +void WindowInit(void) +{ +} -// Vdp1DrawPolygon(0, 0, -// 200, 0, -// 200, 180, -// 0, 180, -// 0xFFFE, -// SPRITE_ENDCODEDISABLE); -// RGB16_COLOR(10,20,30), +////////////////////////////////////////////////////////////////////////////// -// Vdp1DrawDistortedSprite(0, 16, 16, 0, 0, 16, 0, 16, 16, 0, 16, 0); +void WindowDraw(int x, int y, int width, int height, u16 fgcolor, u16 bgcolor) +{ + sprite_struct localcoord; + sprite_struct sprite; -// VdpEndDrawList(); + localcoord.attr = 0; + localcoord.x = 0; + localcoord.y = 0; - switch (type) - { - // fix me - default: - VdpPrintf(&testdispfont, ((320 / 16) - 1) * 8, (body_y+2) * 8, 0xF, "OK"); //fix me - break; - } + VdpStartDrawList(); + VdpLocalCoordinate(&localcoord); - if (per[0].id == PER_KEYBOARD) - { - keyboarddata_struct *kbd=(keyboarddata_struct *)&per[0]; + sprite.attr = SPRITE_PRECLIPENABLE | SPRITE_HIGHSPEEDSHRINKDISABLE | + SPRITE_CLIPDISABLE | SPRITE_ENDCODEDISABLE | SPRITE_16BPP; + sprite.bank = bgcolor; + sprite.x = x; + sprite.y = y; + sprite.x2 = x+width; + sprite.y2 = y; + sprite.x3 = x+width; + sprite.y3 = y+height; + sprite.x4 = x; + sprite.y4 = y+height; - if (kbd->flags & 0x8) // Make - { - if (kbd->key == KEY_ENTER || - kbd->key == KEY_KPENTER || - kbd->key == KEY_SPACE || - kbd->key == KEY_ESC) - break; - } - } - else if (per[0].butpushonce & PAD_A) - { - break; - } - } + VdpDrawPolygon(&sprite); - ClearScr(); + // White lines + sprite.x += 1; + sprite.y += 1; + sprite.x2 -= 1; + sprite.y2 += 1; + sprite.bank = RGB16(31, 31, 31) | 0X8000; + VdpDrawLine(&sprite); - return 0; // fix me(it should return what control was chosen) -} -*/ + sprite.x2 = sprite.x; + sprite.y2 = sprite.y4-1; + VdpDrawLine(&sprite); -////////////////////////////////////////////////////////////////////////////// + // Gray lines + sprite.x = sprite.x2; + sprite.y = sprite.y2; + sprite.x2 = sprite.x3-1; + sprite.y2 = sprite.y3-1; + sprite.bank = RGB16(16, 16, 16) | 0X8000; + VdpDrawLine(&sprite); -/* -lwnd_struct *LWICreateWindow(char *name, int style, int x, int y, int width, int height, lwnd_struct *parent) -{ -} + sprite.x = sprite.x2; + sprite.y = y+1; + VdpDrawLine(&sprite); -////////////////////////////////////////////////////////////////////////////// + // Dark lines + sprite.x+=1; + sprite.y-=1; + sprite.x2+=1; + sprite.y2+=1; + sprite.bank = RGB16(8, 8, 8) | 0X8000; + VdpDrawLine(&sprite); -int LWIGetMessage(lmsg_struct *msg, lwnd_struct *wnd, int filtermin, int filtermax) -{ -} + sprite.x = x; + sprite.y = sprite.y2; + VdpDrawLine(&sprite); -////////////////////////////////////////////////////////////////////////////// + // Caption + sprite.x = x+3; + sprite.y = y+3; + sprite.x2 = x+width-3; + sprite.y2 = sprite.y; + sprite.x3 = sprite.x2; + sprite.y3 = y+12; + sprite.x4 = sprite.x; + sprite.y4 = sprite.y3; + sprite.bank = RGB16(1, 4, 13) | 0X8000; + VdpDrawPolygon(&sprite); -int LWIDispatchMessage(lmsg_struct *msg) -{ + VdpEndDrawList(); } ////////////////////////////////////////////////////////////////////////////// -*/ + Index: vdp2.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/vdp2.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- vdp2.c 7 Jan 2008 03:10:46 -0000 1.1 +++ vdp2.c 8 Jan 2008 09:28:40 -0000 1.2 @@ -64,7 +64,7 @@ void WorkingQuerry(const char *question) { // Ask the user if it's visible - VdpPrintf(&testdispfont, 2 * 8, 20 * 8, 0xF, question); + VdpPrintf(&testdispfont, 2 * 8, 20 * 8, 0xF, "%s", question); VdpPrintf(&testdispfont, 2 * 8, 21 * 8, 0xF, "C - Yes B - No"); for(;;) Index: scsp.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/scsp.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- scsp.c 7 Jan 2008 03:10:46 -0000 1.1 +++ scsp.c 8 Jan 2008 09:28:40 -0000 1.2 @@ -18,7 +18,9 @@ */ #include <lapetus.h> +#include "intfac.h" #include "tests.h" +#include "scsp.h" #define SCSPREG_TIMERA (*(volatile u16 *)0x25B00418) #define SCSPREG_TIMERB (*(volatile u16 *)0x25B0041A) @@ -36,28 +38,32 @@ int tinc=0; -void ScuInterruptTest(void); -void ScspTimerATest(); -void ScspTimerBTest(); -void ScspTimerCTest(); -void ScspTimerTimingTest(u16 timersetting); -void ScspTimerTimingTest0(); -void ScspTimerTimingTest1(); -void ScspTimerTimingTest2(); -void ScspTimerTimingTest3(); -void ScspTimerTimingTest4(); -void ScspTimerTimingTest5(); -void ScspTimerTimingTest6(); -void ScspTimerTimingTest7(); -void ScspIntOnTimerEnableTest(); -void ScspIntOnTimerResetTest(); -void ScspIntDupTest(); -void ScspMCIPDTest(); - ////////////////////////////////////////////////////////////////////////////// void scsptest() { + int choice; + + MENUITEMSTRUCT vdp1menu[] = { + { "SCSP timing" , &scsptimingtest, }, + { "Misc" , &scspmisctest, }, + { "Go back to main menu", NULL }, + { "\0", NULL } + }; + + for (;;) + { + choice = DoMenu(vdp1menu, 8, 14, "SCSP Tests"); + ClearScr(); + if (choice == ((sizeof(vdp1menu) / sizeof(MENUITEMSTRUCT)) - 2)) + break; + } +} + +////////////////////////////////////////////////////////////////////////////// + +void scspminimalinit() +{ // Put system in minimalized state InterruptSetLevelMask(0xF); @@ -70,7 +76,13 @@ // Display On VdpDispOn(); +} +////////////////////////////////////////////////////////////////////////////// + +void scsptimingtest() +{ + scspminimalinit(); UnregisterAllTests(); RegisterTest(&ScuInterruptTest, "Sound Request Interrupt"); RegisterTest(&ScspTimerATest, "Timer A"); @@ -84,6 +96,15 @@ RegisterTest(&ScspTimerTimingTest5, "Timer timing w/32 sample inc"); RegisterTest(&ScspTimerTimingTest6, "Timer timing w/64 sample inc"); RegisterTest(&ScspTimerTimingTest7, "Timer timing w/128 sample inc"); + DoTests("SCSP Timer tests", 0, 0); +} + +////////////////////////////////////////////////////////////////////////////// + +void scspmisctest() +{ + scspminimalinit(); + UnregisterAllTests(); RegisterTest(&ScspIntOnTimerEnableTest, "Int on Timer enable behaviour"); RegisterTest(&ScspIntOnTimerResetTest, "Int on Timer reset behaviour"); RegisterTest(&ScspIntDupTest, "No second Int after Timer done"); Index: main.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/main.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- main.h 7 Jan 2008 03:10:46 -0000 1.1 +++ main.h 8 Jan 2008 09:28:40 -0000 1.2 @@ -17,7 +17,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _MAIN_H_ -#define _MAIN_H_ +#ifndef MAINH +#define MAINH -#endif /* _MAIN_H_ */ +void alltest(); + +#endif Index: vdp2.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/vdp2.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- vdp2.h 7 Jan 2008 03:10:46 -0000 1.1 +++ vdp2.h 8 Jan 2008 09:28:40 -0000 1.2 @@ -17,8 +17,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef VDP2_H -#define VDP2_H +#ifndef VDP2H +#define VDP2H void vdp2test(); Index: intfac.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/intfac.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- intfac.h 7 Jan 2008 03:10:46 -0000 1.1 +++ intfac.h 8 Jan 2008 09:28:40 -0000 1.2 @@ -1,25 +1,41 @@ +/* Copyright 2006-2008 Theo Berkau -#ifndef INTFAC_H -#define INTFAC_H -typedef struct -{ - s8 name[26]; - void (*func)(); -} MENUITEMSTRUCT; + This file is part of Lapetus. + + Lapetus is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + Lapetus is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Lapetus; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef INTFACH +#define INTFACH typedef struct { - int type; - s8 name[26]; int x; int y; - int w; - int h; - void *extra; - int attributes; - int (*func)(); + int width; + int height; + int fgcolor; + int bgcolor; } WINDOWSTRUCT; +typedef struct +{ + s8 name[26]; + void (*func)(); +} MENUITEMSTRUCT; + #define WINTYPE_NONE 0x00000000 #define WINTYPE_TITLE 0x00000001 #define WINTYPE_TEXT 0x00000002 @@ -29,9 +45,13 @@ #define WINATTR_INVISIBLE 0x00000000 #define WINATTR_GRAYED 0x00000002 -int DoMenu(MENUITEMSTRUCT *menu, int x, int y); -int DoWindow(WINDOWSTRUCT *window, int x, int y); +int DoMenu(MENUITEMSTRUCT *menu, int x, int y, const char *title); int MessageBox(const char *header, const char *body, int type); void ClearScr(void); +void WindowInit(void); +void WindowDraw(int x, int y, int width, int height, u16 fgcolor, u16 bgcolor); +void DoFullMenu(font_struct *font, MENUITEMSTRUCT *menu, const char *name, + int x, int y, int width, int height); + #endif Index: scu.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/scu.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- scu.c 7 Jan 2008 03:10:46 -0000 1.1 +++ scu.c 8 Jan 2008 09:28:40 -0000 1.2 @@ -76,10 +76,9 @@ for (;;) { - choice = DoMenu(scumenu, 8, 14); + choice = DoMenu(scumenu, 8, 14, "SCU Menu"); ClearScr(); - - if (choice == 3) + if (choice == ((sizeof(scumenu) / sizeof(MENUITEMSTRUCT)) - 2)) break; } } @@ -568,8 +567,6 @@ void TestISTandIMS() { - int i; - // Mask All interrupts SCUREG_IMS = 0xBFFF; Index: main.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/main.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- main.c 7 Jan 2008 03:10:46 -0000 1.2 +++ main.c 8 Jan 2008 09:28:40 -0000 1.3 @@ -19,20 +19,28 @@ #include <lapetus.h> #include "cdb.h" +#include "cart.h" +#include "m68k.h" #include "scsp.h" #include "scu.h" #include "sh2.h" +#include "smpc.h" +#include "vdp1.h" #include "vdp2.h" #include "intfac.h" +#include "main.h" MENUITEMSTRUCT mainmenu[] = { { "SH2 Test" , &sh2test, }, { "SCU Test", &scutest, }, { "CD Block Test" , &cdbtest, }, -//{ "68k Test" , &cdbtest, }, +{ "Cartridge Test" , &carttest, }, // Could almost autodetect the cart type +{ "68k Test" , &m68ktest, }, { "SCSP Test" , &scsptest, }, -//{ "VDP1 Test" , &vdp1test, }, +{ "SMPC Test" , &smpctest, }, +{ "VDP1 Test" , &vdp1test, }, { "VDP2 Test" , &vdp2test, }, +{ "Run all tests" , &alltest, }, { "\0", NULL } }; @@ -41,6 +49,12 @@ ////////////////////////////////////////////////////////////////////////////// +void alltest() +{ +} + +////////////////////////////////////////////////////////////////////////////// + int main() { int i; @@ -94,16 +108,15 @@ testdispfont.height = 8; testdispfont.bpp = 1; testdispfont.out = (u8 *)0x25E00000; - VdpSetFont(SCREEN_RBG0, &testdispfont); + VdpSetFont(SCREEN_RBG0, &testdispfont, 1); // Print messages and cursor - VdpPrintf(&testdispfont, 2 * 8, 1 * 8, 15, "Saturn Regression Test v0.2"); VdpDispOn(); // Display Main Menu for(;;) { - choice = DoMenu(mainmenu, 4, 14); + choice = DoMenu(mainmenu, 4, 14, "Saturn Regression Test v0.3"); ClearScr(); } } Index: tests.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/tests.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- tests.h 7 Jan 2008 03:10:46 -0000 1.1 +++ tests.h 8 Jan 2008 09:28:40 -0000 1.2 @@ -17,8 +17,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef TESTS_H -#define TESTS_H +#ifndef TESTSH +#define TESTSH #include <lapetus.h> Index: scsp.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/tests/regtest/scsp.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- scsp.h 7 Jan 2008 03:10:46 -0000 1.1 +++ scsp.h 8 Jan 2008 09:28:40 -0000 1.2 @@ -17,9 +17,29 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef SCSP_H -#define SCSP_H +#ifndef SCSPH +#define SCSPH void scsptest(); +void scsptimingtest(); +void scspmisctest(); + +void ScuInterruptTest(void); +void ScspTimerATest(); +void ScspTimerBTest(); +void ScspTimerCTest(); +void ScspTimerTimingTest(u16 timersetting); +void ScspTimerTimingTest0(); +void ScspTimerTimingTest1(); +void ScspTimerTimingTest2(); +void ScspTimerTimingTest3(); +void ScspTimerTimingTest4(); +void ScspTimerTimingTest5(); +void ScspTimerTimingTest6(); +void ScspTimerTimingTest7(); +void ScspIntOnTimerEnableTest(); +void ScspIntOnTimerResetTest(); +void ScspIntDupTest(); +void ScspMCIPDTest(); #endif |