Go Back   TehSkeen.com > Dev Houses > SkeenDev Development Forum

Mini Skeen Menu
Main News Page Online Discussion Forums Downloads Database Console Modification Reviews IRC Chat Information Contests
Network Links
Network Links
Active Threads
195 *EXCLUSIVE* Interview with teh Wii Exploit Author
Last Post: antonioster
Posted On: Today
Replies: 29
Views: 26,861
0 I have a problem
Last Post: link11510
Posted On: Today
Replies: 15
Views: 323
102 Theater Room, Nintendo’s Video On Demand Service Launches Tomorrow
Last Post: SifJar
Posted On: Today
Replies: 3
Views: 82
102 More "Unlock Your Wii" Scam Sites
Last Post: monoufo
Posted On: Today
Replies: 14
Views: 517
102 WODE vs. NSMB
Last Post: djdynamite123
Posted On: Today
Replies: 0
Views: 50
106 Game Categories Revised v11 Released
Last Post: brakken
Posted On: Today
Replies: 0
Views: 61
203 Crap 2.4b Released
Last Post: djdynamite123
Posted On: Today
Replies: 0
Views: 70
214 New Mario Bros - Anti-Modchip Protection
Last Post: MENTALDOMINANCE
Posted On: Today
Replies: 53
Views: 4,436
0 SDL MAME Wii
Last Post: azrael11
Posted On: Today
Replies: 237
Views: 16,332
0 Boot 2 Thoughts
Last Post: SifJar
Posted On: Today
Replies: 6
Views: 232
0 NDS broke, need money to fix it :(
Last Post: SoraK05
Posted On: Today
Replies: 6
Views: 1,206
225 Pong2 v0.99 Released
Last Post: djdynamite123
Posted On: Today
Replies: 0
Views: 83
225 RedSquare 0.93 Released
Last Post: djdynamite123
Posted On: Today
Replies: 0
Views: 71
225 SpaceBubble 0.92 Released
Last Post: djdynamite123
Posted On: Today
Replies: 0
Views: 67
225 BibleQuiz 0.94 Released
Last Post: djdynamite123
Posted On: Today
Replies: 0
Views: 65
0 New Super Mario Bros. Question
Last Post: cobleman
Posted On: Today
Replies: 9
Views: 260
52 HELP!!! Backup Channel Trouble
Last Post: R3dfaction
Posted On: Today
Replies: 2
Views: 65
228 Wii64/Cube64 Beta 1 Released!
Last Post: spellcaster
Posted On: Today
Replies: 157
Views: 19,609
203 KeyStego 1.0 Released
Last Post: Savage_Nation
Posted On: Today
Replies: 8
Views: 560
189 Hu-Go GC Project
Last Post: gusmento01
Posted On: Yesterday
Replies: 171
Views: 34,060
More...

Genesis Plus Project
  #1  
Old 02-12-2007, 11:14 AM
brakken's Avatar
brakken brakken is offline
Brakkenator
 
Join Date: Jul 2005
Location: USA
Posts: 18,096
Send a message via AIM to brakken Send a message via MSN to brakken
SkeenDev Genesis Plus Project

Pictures of Genesis Plus
Attached Images
File Type: gif genplus1.gif (29.7 KB, 3109 views)
File Type: gif genplus2.gif (19.5 KB, 2566 views)

Last edited by brakken; 05-23-2007 at 01:56 AM..
Reply With Quote

  #2  
Old 03-17-2007, 10:04 AM
eke-eke eke-eke is offline
finish him
 
Join Date: Mar 2006
Location: Toulouse, France
Posts: 982
Default

INTRODUCTION


This is a port of Charles MacDonald's Genesis Plus emulator, based on Softdev's last release, with a lof of compatibility fixes and additional features. Download the latest version and execute genplus.dol on your Gamecube or Wii with your prefered method and then load a rom from ISO9660 DVD or from SDCARD. If you use SDCARD, roms must be placed in the previously created directory /genplus/roms. Read included genplus.pdf for detailled options and full credits.

A complete User Guide can also be found here.

KNOWN ISSUE: expansion controllers (Nunchuk or Classic) are sometime not detected upon initialization. To solve that, simply deconnect and reconnect it from the wiimote.


FEATURES

Accurate & full speed Sega Genesis/Megadrive emulation
  • NTSC (60Hz) & PAL (50Hz) timings support
  • cycle-accurate CPUs synchronization (68000, Z80, YM2612, SN76489)
  • cycle-accurate VDP emulation (DMA, FIFO, HV interrupts, HBLANK,…)
  • original frequency YM2612 emulation (High Quality FM)
  • hardware latency emulation
  • full overscan area (horizontal & vertical colored borders) emulation
  • TMSS BIOS support
  • PICO hardware support (experimental)
  • Blargg's NTSC filter support
Support for various input peripherals
  • 3-buttons & 6-buttons controllers
  • Sega TeamPlayer & EA 4-Way Play multitap adapters
  • Sega Menacer & Konami Justifier lightguns
  • Sega Mouse & Sega Mega Mouse
Support for various cartridge internal hardware
  • SVP DSP (Virtua Racing)
  • J-Cart
  • backup RAM (parallel SRAM/FRAM and serial EEPROM)
  • ROM bankswitch (Super Street Fighter 2)
  • SRAM switch (Phantasy Star 4, Legend of Thor, Sonic the Hedgehog 3)
  • ROM mappers & copy protection devices used in many unlicensed/pirate cartridges
  • Game Genie codes
Gamecube/Wii extra features
  • Stereo Sound (@48 kHz)
  • 1~4 Players support
  • SRAM and SaveState files (on MemoryCard & SDCard)
  • automatic SRAM/Savestate loading & saving
  • ROM internal information screen
  • support for zipped (.zip) and interleaved (.smd) roms
  • load roms from SDCard or DVD
  • original video modes (240p/240i/288p/288i) support
  • interlaced (576i/480i) & progressive (480p) video modes support
Wii-only features
  • up to 8 Players support
  • Wiimote, Nunchuk & Classic Controller support


WHAT'S NEW

See included history.txt for a full changelog.

Quote:
1.3.1 (20/12/2008):
-------------------
[NGC/Wii]
- improved sound engine
- modified frame synchronization (now use audio DMA interrupt)

1.3.0 (14/12/2008):
-------------------
[Genesis]
- YM2612 bugfixes (MAME core):
.fixed EG Decay->Substain transition when SL & DR are minimals: fix tracks #3 and #9 in "Mega Turrican"
.fixed a bug in SSG-EG emulation code: fix Level 1 music in "Alisia Dragoon"
.modified SSG-EG Decay End Level: fix some sound effects (ChainSaw, Zap...) in "Beavis & Butthead"
.improved Detune overflow accuracy: fix very high frequency sounds in many games
.fixed registers 0x20-0x26 Reset state: fix intro music in "B.O.B"
.reverted incorrect fix with KEY ON: fix "Flamethrower" sound effect in "Alien 3" and many others
- adjusted HCounter values: fixes line flickering in "Sonic 3D" bonus stage
- adjusted VINT timing: fixes hang-up in "V.R Troopers"
- improved HBLANK flag accuracy: fixes line flickering in "Gouketsuji Ichizoku"
- fixed broken Z80 access to WRAM: fixes hang-up in "Mamono Hunter Youko"
- modified JCART emulation: fixes corrupted tracks logo in "Micro Machines 2"
- added Blargg's NTSC Filters support (NTSC video artifacts emulation)
- optimized VDP rendering core, rewrote 68k interface (memory handlers, cycle execution, interrupts): greatly improved emulation speed

[NGC/Wii]
- remove slowest libsamplerate settings under "HQ YM2612" option, only keeps SRC_LINEAR (faster) and SRC_SINC_FAST (better)
- added an option to enable/disable bilinear filtering
- rewrote video engine: improved horizontal scaling (VI+GX), improved rendering speed (direct texture mapping)
- removed embedded font, (re)enabled IPL font support: now should works for Qoob users too (thanks to emukiddid)
- fixed "Reset" button behavior, now acts more like Genesis Reset button ;-)
- patched libfat for faster SDCARD accesses (thanks to svpe)
- SRAM and SaveState filenames are now based on the ROM filename (for FAT devices only)
- various bugfixes, menu tweaks and code cleanup

[NGC only]
- added 480p support in menu

[Wii only]
- implemented fast scrolling in menu using Wiimote D-PAD
- added "Power" button support
- added USB Storage support
- Widescreen menu fix
- *new* libogc 1.7.0 features: SDHC support, Wiimote shutdown button support



CREDITS

Genesis Plus coreGamecube/Wii port
  • original Gamecube's port by softdev, honkeykong & markcube
  • additional features and Wii port by Eke-Eke
  • graphical interface and icon design by brakken
  • libFAT by Chism , ported to libogc by Sven Peter (svpe) & wintermute
  • wiiuse library by Michael Laforest (para), ported to libogc by shagkur
  • libDI by Erant
  • libOGC by winterMute, shagkur and all contributors
  • devkitpro & devkitPPC by winterMute


This project source code is now maintained under SVN: you can submit bugs and browse the sourcecode from here.



Attached Files
File Type: zip inject.zip (61.6 KB, 1580 views)
File Type: 7z genplus-gx-1.3.0.7z (1.32 MB, 734 views)
File Type: 7z genplus-gx-1.3.1.7z (1.32 MB, 1877 views)

Last edited by eke-eke; 01-18-2009 at 02:13 PM..
Reply With Quote

  #3  
Old 03-17-2007, 02:20 PM
wolf9545 wolf9545 is offline
member++
 
Join Date: Feb 2007
Posts: 76
Green Q

Nice emulator. I was wondering why when I load the emulator on my gamecube does the test become hard to read? I don't mean it's scrambled or difficult but it's like a bit fuzzy. I still can read it but hard to make out some of the game names.
Reply With Quote

  #4  
Old 03-19-2007, 11:46 AM
eke-eke eke-eke is offline
finish him
 
Join Date: Mar 2006
Location: Toulouse, France
Posts: 982
Default

Ok, I understand what you are talking about and I corrected the problem. In fact, in order to speedup memory access, we were swapping ROM data but some functions read the header of the ROM after we swapped it: SRAM detection, Region Detection and RomInfo Detection.
That's why you see inverted letters in the Rom Info Menu ...


@Softdev: I corrected this by removing the call to swab() funtion, as I noticed that the same thing was also done later by the function bswap() in gen_init() function. So, I removed both functions, kept memory access like you did (no WRITE or READ macros anymore) and everything is now working fine.


I updated the sourcecode and binary in my previous post, please download everything again
Reply With Quote

  #5  
Old 03-20-2007, 04:29 PM
wolf9545 wolf9545 is offline
member++
 
Join Date: Feb 2007
Posts: 76
Default

I tried it out and the text doesn't really look any different but a bit crisper. I never noticed any upside down text just a bit fuzzy. I'm keeping with the one I have because another programmer sent me one that has subdirectory support. I don't happen to remember the autohor's name at the moment.
Reply With Quote

  #6  
Old 03-20-2007, 05:13 PM
eke-eke eke-eke is offline
finish him
 
Join Date: Mar 2006
Location: Toulouse, France
Posts: 982
Default

I don't understand... which text are you talking about ???
Reply With Quote

  #7  
Old 03-20-2007, 06:18 PM
JLF65's Avatar
JLF65 JLF65 is offline
mad poster
 
Join Date: Nov 2006
Posts: 141
Default

Okay, here's the mods I made to GenPlus for subdirectory support on SD cards. I noticed that v2 of SNES uses the GP code as well, and now so does SMSPlus, so all three could be updated using these edits.

First we start with filesel.c. Things to note in this file:
ShowFiles() - changes str functions to avoid overflows on LONG file names.
parse_sdcard_dir () - new function to parse the SD card path. It could go elsewhere, but I put it here to minimize the number of files changed.
FileSelector () - added code for handling sdcard directories.
OpenSD () - modified to use parse_sdcard_dir()
GetSDInfo () - modified to use directory path

Code:
/****************************************************************************
 *  Genesis Plus 1.2a
 *
 *  Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003  Charles Mac Donald
 *
 *  This program 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.
 *
 *  This program 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 this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * DVD File Selection
 ***************************************************************************/ 
  
#include <shared.h>
#include <font.h>
#include <sdcard.h>
#include <iso9660.h>
#include <dvd.h>
#include <unzip.h>
  
#define PAGESIZE 22
static int maxfiles;
extern int genromsize;
extern void reloadrom ();
int havedir = 0;
int UseSDCARD = 0;
sd_file * filehandle;
int LoadDVDFile (unsigned char *buffer);

/***************************************************************************
 * Showfile screen
 ***************************************************************************/ 
static void 
ShowFiles (int offset, int selection) 
{
  int i, j;
  char text[80];
  ClearScreen ();
  j = 0;
  for (i = offset; i < (offset + PAGESIZE) && (i < maxfiles); i++)
	{
	  if (filelist[i].flags)
	{
	  strcpy (text, "[");
	  strncat (text, filelist[i].filename, 77);
	  strcat (text, "]");
	}
	  else
	strncpy (text, filelist[i].filename, 79);

	  text[79]=0;

	  if (j == (selection - offset))
	{
			/*** Highlighted text entry ***/ 
		setfontcolour (COLOR_BLACK);
	  fntDrawBoxFilled (100, (j * fheight) + 120, 540, 
				 ((j + 1) * fheight) + 120, COLOR_WHITE);
	  WriteCentre ((j * fheight) + 120, text);
	  setfontcolour (COLOR_WHITE);
	}
	  else
	{
			/*** Normal entry ***/ 
		WriteCentre ((j * fheight) + 120, text);
	}
	  j++;
	}
  SetScreen ();
}


int
parse_sdcard_dir (char *sdcardpath) 
{
  DIR *sddir = NULL;
  int entries = 0;
  
	/**
	 * Get a list of files from the directory
	 */
 
  entries = SDCARD_ReadDir (sdcardpath, &sddir);
  if (entries <= 0)
	return 0; /** exit with error */

/*  char msg[128];
  sprintf (msg, "Found %d entries", entries);
  WaitPrompt (msg); */
  
	/**
	 * Move to DVD structure - this is required for the file selector 
	 */ 
  maxfiles = 0;
  if (entries>MAXFILES) entries = MAXFILES;

  while (entries)
	{
	  memset (&filelist[maxfiles], 0, sizeof (FILEENTRIES));
	  strncpy(filelist[maxfiles].sdcardpath, sdcardpath, SDCARD_MAX_PATH_LEN);
	  filelist[maxfiles].sdcardpath[SDCARD_MAX_PATH_LEN-1] = 0;
	  strncpy(filelist[maxfiles].filename, sddir[maxfiles].fname, MAXJOLIET);
	  filelist[maxfiles].filename[MAXJOLIET-1] = 0;
	  filelist[maxfiles].length = sddir[maxfiles].fsize;
	  filelist[maxfiles].flags = (char)(sddir[maxfiles].fattr & SDCARD_ATTR_DIR);

	  maxfiles++;
	  entries--;
	}

  free(sddir);

  return maxfiles;
}

/****************************************************************************
 * FileSelector
 *
 * Let user select a file from the DVD listing
 ****************************************************************************/ 
int offset = 0;
int selection = 0;

#define PADCAL 70
void 
FileSelector () 
{
  short p;
  signed char a;
  int haverom = 0;
  int redraw = 1;
  while (haverom == 0)
	{
	  if (redraw)
	ShowFiles (offset, selection);
	  redraw = 0;
	  p = PAD_ButtonsDown (0);
	  a = PAD_StickY (0);
	  if ((p & PAD_BUTTON_DOWN) || (a < -PADCAL))
	{
	  selection++;
	  if (selection == maxfiles)
		selection = offset = 0;
	  if ((selection - offset) >= PAGESIZE)
		offset += PAGESIZE;
	  redraw = 1;
	}			// End of down
	  if ((p & PAD_BUTTON_UP) || (a > PADCAL))
	{
	  selection--;
	  if (selection < 0)
		{
		  selection = maxfiles - 1;
		  offset = selection - PAGESIZE + 1;
		}
	  if (selection < offset)
		{
		  offset -= PAGESIZE;
		}
	  if (offset < 0)
		offset = 0;
	  redraw = 1;
	}			// End of Up
	  if (PAD_ButtonsHeld (0) & PAD_BUTTON_LEFT)
	{
			/*** Go back a page ***/ 
		selection -= PAGESIZE;
	  if (selection < 0)
		{
		  selection = maxfiles - 1;
		  offset = selection - PAGESIZE + 1;
		}
	  if (selection < offset)
		offset -= PAGESIZE;
	  if (offset < 0)
		offset = 0;
	  redraw = 1;
	}
	  if (PAD_ButtonsHeld (0) & PAD_BUTTON_RIGHT)
	{
			  /*** Go forward a page ***/ 
		selection += PAGESIZE;
	  if (selection > maxfiles - 1)
		selection = offset = 0;
	  if ((selection - offset) >= PAGESIZE)
		offset += PAGESIZE;
	  redraw = 1;
	}
	  if (p & PAD_BUTTON_A)
	{
	  if (filelist[selection].flags)			/*** This is directory ***/
		{
				if (UseSDCARD)
				{
					char fname[SDCARD_MAX_PATH_LEN + MAXJOLIET];
					strncpy(fname, filelist[selection].sdcardpath, SDCARD_MAX_PATH_LEN);
					fname[SDCARD_MAX_PATH_LEN-1] = 0;
					strncat(fname, filelist[selection].filename, MAXJOLIET);
					fname[SDCARD_MAX_PATH_LEN+MAXJOLIET-2] = 0;
					strcat(fname, "\\");
					offset = selection = 0;
					maxfiles = parse_sdcard_dir(fname);
				} else {
					rootdir = filelist[selection].offset;
					rootdirlength = filelist[selection].length;
					offset = selection = 0;
					maxfiles = parsedirectory();
				}
		}
	  else
		{
		  rootdir = filelist[selection].offset;
		  rootdirlength = filelist[selection].length;
				/*** Now load the DVD file to it's offset ***/ 
		genromsize = LoadDVDFile (cart_rom);
		  reloadrom ();
		  haverom = 1;
		}
	  redraw = 1;
	}
	}
}


/****************************************************************************
 * OpenDVD
 *
 * Function to load a DVD directory and display to user.
 ****************************************************************************/ 
void 
OpenDVD () 
{
  UseSDCARD = 0;
  if (getpvd () < 0)
	return;
  if (havedir == 0)
	
	{
	  if ((maxfiles = parsedirectory ()))
	
	{
	  FileSelector ();
	  havedir = 1;
	}
	}
  
  else
	FileSelector ();
}


/**
 * OpenSD updated to use the new libogc.  Written by softdev and pasted
 * into this code by Drack.  Enjoy!
 **/
  int
OpenSD () 
{
  UseSDCARD = 1;
  
	/**
	 * Initialise libOGC SD functions
	 */ 
	SDCARD_Init ();		/**< libOGC ensures that you actually only do init once **/
  
  if (!parse_sdcard_dir("dev0:\\GPROMS\\"))
	{
	  WaitPrompt ("Unable to open SDCARD!");
	  return 0;		/**< Just run away if I can't read the directory! **/
	}
  
  FileSelector ();

  return 1;
}


/****************************************************************************
 * SDCard Get Info
 ****************************************************************************/ 
  void
GetSDInfo () 
{
  char fname[SDCARD_MAX_PATH_LEN+MAXJOLIET];
  rootdirlength = 0;
  strncpy (fname, filelist[selection].sdcardpath, SDCARD_MAX_PATH_LEN);
  fname[SDCARD_MAX_PATH_LEN-1] = 0;
  strncat (fname, filelist[selection].filename, MAXJOLIET);
  fname[SDCARD_MAX_PATH_LEN+MAXJOLIET-1] = 0;
  filehandle = SDCARD_OpenFile (fname, "rb");
  if (filehandle == NULL)
	{
	  WaitPrompt ("Unable to open file!");
	  return;
	}
  rootdirlength = SDCARD_GetFileSize (filehandle);
}


/****************************************************************************
 * LoadDVDFile
 *
 * This function will load a file from DVD, in BIN, SMD or ZIP format.
 * The values for offset and length are inherited from rootdir and 
 * rootdirlength.
 *
 * The buffer parameter should re-use the initial ROM buffer.
 ****************************************************************************/ 
int 
LoadDVDFile (unsigned char *buffer) 
{
  int offset;
  int blocks;
  int i;
  int discoffset;
  char readbuffer[2048];
  
	/*** SDCard Addition ***/ 
  if (UseSDCARD)
	GetSDInfo ();
  if (rootdirlength == 0)
	return 0;
  
	/*** How many 2k blocks to read ***/ 
	blocks = rootdirlength / 2048;
  offset = 0;
  discoffset = rootdir;
  ShowAction ("Loading ... Wait");
  if (UseSDCARD)
	SDCARD_ReadFile (filehandle, &readbuffer, 2048);
  
  else
	dvd_read (&readbuffer, 2048, discoffset);
  if (!IsZipFile ((char *) readbuffer))
	
	{
	  if (UseSDCARD)
	SDCARD_SeekFile (filehandle, 0, SDCARD_SEEK_SET);
	  for (i = 0; i < blocks; i++)
	
	{
	  if (UseSDCARD)
		SDCARD_ReadFile (filehandle, &readbuffer, 2048);
	  
	  else
		dvd_read (readbuffer, 2048, discoffset);
	  memcpy (buffer + offset, readbuffer, 2048);
	  offset += 2048;
	  discoffset += 2048;
	}
	  
		/*** And final cleanup ***/ 
	if (rootdirlength % 2048)
	
	{
	  i = rootdirlength % 2048;
	  if (UseSDCARD)
		SDCARD_ReadFile (filehandle, &readbuffer, i);
	  
	  else
		dvd_read (readbuffer, 2048, discoffset);
	  memcpy (buffer + offset, readbuffer, i);
	}
	}
  
  else
	
	{
	  return UnZipBuffer (buffer, discoffset, rootdirlength);
	}
  if (UseSDCARD)
	SDCARD_CloseFile (filehandle);
  return rootdirlength;
}

The next file is iso9660.h. The only change here the addition of sdcardpath. SDCARD_MAX_PATH_LEN is used, meaning you need to add an include for sdcard.h before iso9660.h in places that include it. Or you could just hardcode that here instead.

Code:
/****************************************************************************
 *  Genesis Plus 1.2a
 *
 *  Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003  Charles Mac Donald
 *
 *  This program 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.
 *
 *  This program 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 this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * DVD ISO9660/Joliet Parsing
 *
 * This is not intended as a complete guide to ISO9660.
 * Here I use the bare minimum!
 ***************************************************************************/

#define MAXJOLIET 56
typedef struct
{
  unsigned int offset;
  unsigned int length;
  char flags;
  char filename[MAXJOLIET];
  char sdcardpath[SDCARD_MAX_PATH_LEN];
} FILEENTRIES;

extern int rootdir;
extern int rootdirlength;
#define MAXFILES 1000			/** Restrict to 1000 files per dir **/

extern int getpvd ();
extern int parsedirectory ();
extern FILEENTRIES filelist[MAXFILES];

That should be it (other than includes for sdcard.h before iso9660.h if you don't hardcode the SDCARD_MAX_PATH_LEN value). This works with the GenPlus from before Eke-Eke's release. I don't think there should be any trouble working it into the latest releases of any of the emus. If so, I can work out the differences.
Reply With Quote

  #8  
Old 03-20-2007, 06:57 PM
eke-eke eke-eke is offline
finish him
 
Join Date: Mar 2006
Location: Toulouse, France
Posts: 982
Default

Thanks a lot !

In fact, I already modified filesel.c in order to support subdirectories but I was stuck with the main problem: how to detect that an entry is actually a directory and not a file (in order to set the .flags field) ?

I will have a look in your code and see what I was missing, thanks again
Reply With Quote

  #9  
Old 03-20-2007, 08:22 PM
wolf9545 wolf9545 is offline
member++
 
Join Date: Feb 2007
Posts: 76
Default

I mean the text that is displayed when you run the emulator. When you first start the emulator the main menu and the list of games. The text is a bit fuzzy, not crisp like the SNES or NES emulators.
Reply With Quote

  #10  
Old 03-20-2007, 08:28 PM
eke-eke eke-eke is offline
finish him
 
Join Date: Mar 2006
Location: Toulouse, France
Posts: 982
Default

Sorry but I don't see any differences from previous release and don't find the text hard to read
The font used in genplus has always been different from snes9xgx 's one
Reply With Quote

  #11  
Old 03-20-2007, 08:52 PM
JLF65's Avatar
JLF65 JLF65 is offline
mad poster
 
Join Date: Nov 2006
Posts: 141
Default

Quote:
Originally Posted by eke-eke
Thanks a lot !

In fact, I already modified filesel.c in order to support subdirectories but I was stuck with the main problem: how to detect that an entry is actually a directory and not a file (in order to set the .flags field) ?

I will have a look in your code and see what I was missing, thanks again
The old (last Oct) libsdcard had a bug - if the directory path didn't end with a '\', you would only get filenames from SDCARD_ReadDir, no attributes or sizes. The "fix" to that was always make sure the path always ends in a '\' character. Someone tried to fix that in the cvs, but apparently broke libsdcard (in the current libogc release). I haven't had a chance to look into that yet.

Anywho, I simply check the attrs like you're supposed to, secure in the knowledge that by making sure my paths end in '\' I get proper data from SDCARD_ReadDir.

Be sure to check the str commands in your code... the original code allowed for buffer overflows on LONG names (>79 chars with GP).
Reply With Quote

  #12  
Old 03-21-2007, 06:42 AM
eke-eke eke-eke is offline
finish him
 
Join Date: Mar 2006
Location: Toulouse, France
Posts: 982
Default

I added the ".fattr" parameter reading in my own code, in order to set the .flags attribute like you did but it didn't seems to work well:
Directories are not always detected (I see that they're detected if '[]' is there). Precisely, the first time I access the SDcard, I see my directories as files and if I select one with 'A', I come back to main menu. Then, if I access SDcard again, my directories are now detected correctly and I can browse them. After loading a file, if I retry to access sdcard, directories are NOT detected anymore, like in step 1.

I also replaced completely my code by yours but the same thing happened, it seems that "directory" flag setting is a little buggy


Do you say that this is due to a bug in last libogc sdcard code, that's it ? Which version of libogc works OK for you ?


By the way, I think there is something wrong in your code with "selection" and "offset" variables handling.
For example, if you access sdcard again after loading a file from a subdirectory, the selection bar can be out of bounds (you have to press D-PAD continously so that it appears). This is due to the fact that "selection" static variable is not reinitialized and points to an entry in the previous entry list (the one with the content of a subdirectory) but what is displayed on screen is the list of subdirectories.
I think you have to reset both values each time you call the SD parsedir function

Last edited by eke-eke; 03-21-2007 at 07:09 AM..
Reply With Quote

  #13  
Old 03-21-2007, 02:32 PM
JLF65's Avatar
JLF65 JLF65 is offline
mad poster
 
Join Date: Nov 2006
Posts: 141
Default

Quote:
Originally Posted by eke-eke
I added the ".fattr" parameter reading in my own code, in order to set the .flags attribute like you did but it didn't seems to work well:
Directories are not always detected (I see that they're detected if '[]' is there). Precisely, the first time I access the SDcard, I see my directories as files and if I select one with 'A', I come back to main menu. Then, if I access SDcard again, my directories are now detected correctly and I can browse them. After loading a file, if I retry to access sdcard, directories are NOT detected anymore, like in step 1.

I also replaced completely my code by yours but the same thing happened, it seems that "directory" flag setting is a little buggy


Do you say that this is due to a bug in last libogc sdcard code, that's it ? Which version of libogc works OK for you ?


By the way, I think there is something wrong in your code with "selection" and "offset" variables handling.
For example, if you access sdcard again after loading a file from a subdirectory, the selection bar can be out of bounds (you have to press D-PAD continously so that it appears). This is due to the fact that "selection" static variable is not reinitialized and points to an entry in the previous entry list (the one with the content of a subdirectory) but what is displayed on screen is the list of subdirectories.
I think you have to reset both values each time you call the SD parsedir function
Yeah... I probably did miss resetting those in parse.

I use the Oct 2006 libogc with the changes made for big sd cards. Like I said, someone tried fixing the '\' bug and broke the sd card directory support almost completely. If someone else doesn't look at it, I'll try to look at that problem this weekend.
Reply With Quote

  #14  
Old 03-21-2007, 03:56 PM
eke-eke eke-eke is offline
finish him
 
Join Date: Mar 2006
Location: Toulouse, France
Posts: 982
Default

That's right...
if actual libogc, in SDCARD_ReadDir function, someone added this:

Quote:
strcpy(fpath,dirname);
slen = strlen(fpath);
if(fpath[slen]=='\\') fpath[slen] = 0;
I assume this was done to remove any '\' char at the end of directory name, as the function later does this before getting status & size:

Quote:
sprintf(buffer,"%s\\%s",fpath,dent.name);
card_getFileSize(buffer,&size);
ent->fsize = size;
card_readStat(buffer,&stats);
ent->fattr = stats.attr;
The correct code in first part should be, I think:
Quote:
strcpy(fpath,dirname);
slen = strlen(fpath);
if(fpath[slen-1]=='\\') fpath[slen-1] = 0;

I don't know who should be advised for this...


By the way, in my sourcecode, I simply avoid adding '\' character at the end of the directorie's name and this works fine now (with the last libogc only of course).

Last edited by eke-eke; 03-21-2007 at 04:30 PM..
Reply With Quote

  #15  
Old 03-21-2007, 04:19 PM
JLF65's Avatar
JLF65 JLF65 is offline
mad poster
 
Join Date: Nov 2006
Posts: 141
Default

Yeah... looking at the code, that appears to be the correct correction.

Last edited by JLF65; 03-21-2007 at 04:21 PM..
Reply With Quote

Genesis Plus update
  #16  
Old 03-22-2007, 10:48 AM
eke-eke eke-eke is offline
finish him
 
Join Date: Mar 2006
Location: Toulouse, France
Posts: 982
Positive Genesis Plus update

Ok, after some intense testing, I finally got everything working fine, just like DVD browsing

Here is the latest genplus release, with SDCARD subdirectories browsing and LFN (max 255 char.) support...

It has been compiled with last libogc (04/02/07), don't try to compile the source with previous versions of libogc, it will not work.

Download from my first post.

Last edited by eke-eke; 03-22-2007 at 11:01 AM..
Reply With Quote

  #17  
Old 03-26-2007, 02:58 PM
eke-eke eke-eke is offline
finish him
 
Join Date: Mar 2006
Location: Toulouse, France
Posts: 982
Positive

Here's a small update with some minor additions, which you would perhaps found useful:

Quote:
- added DVD automount: automatically call libogc DVD_Mount function if ISO PVD reading failed (idea taken from softdev's last neocdredux release). This may be useful for loading roms from a DVD after booting from SDLOAD or after stopping DVD motor.
- added "DVD motor off" feature, like in others emulators
- corrected Memory Card mounting function: EXI_ProbeReset() function was never called if the first mounting attempt failed. Should fix some of the "Unable to mount memory card" errors.
Download updated source & binary from the 2nd post on this thread

Last edited by eke-eke; 03-26-2007 at 03:11 PM..
Reply With Quote

sound fix
  #18  
Old 04-10-2007, 07:24 PM
eke-eke eke-eke is offline
finish him
 
Join Date: Mar 2006
Location: Toulouse, France
Posts: 982
Default sound fix

While playing some genesis games, I recently noticed that PSG volume (mostly used for sound effects) was sometime not correct and playing too loud in the last release.

here's a little fix:

Quote:
Changelog.

11/04/2007:
- correctedMAX_OUTPUT value in SN76496 core: fix PSG sound (SFX) volume
- removed unused sound buffer allocation

As usual, I updated binaries and sources in my original post, look for genplus-070411.7z

Last edited by eke-eke; 04-10-2007 at 07:36 PM..
Reply With Quote

  #19  
Old 04-16-2007, 04:27 AM
sindrik sindrik is offline
member
 
Join Date: Dec 2006
Posts: 33
Default

X & Z buttons functions are inverted.

Sound FX is barely audible in some games (Punches or specials in Streets of Rage 3, for example).

Haven't found any other bugs yet.

Last edited by sindrik; 04-16-2007 at 04:30 AM..
Reply With Quote

  #20  
Old 04-16-2007, 06:13 AM
eke-eke eke-eke is offline
finish him
 
Join Date: Mar 2006
Location: Toulouse, France
Posts: 982
Default

Quote:
Originally Posted by sindrik
X & Z buttons functions are inverted.
By default, X & Z are linked respectively to L & R Buttons on the GC PAD.
As far as I know, these buttons are inverted in libogc so, in the genplus sourcecode, X is seen as pressed when PAD_ButtonsHeld() function return PAD_TRIGGER_R (and Z is set when PAD_TRIGGER_L).
Do you have recompiled the sources with a corrected libogc ?
Or perhaps this has already been fixed in the last libogc ?

Quote:
Originally Posted by sindrik
Sound FX is barely audible in some games (Punches or specials in Streets of Rage 3, for example).
The modification I made on PSG was perhaps not correct, I will have a look. Is it a general issue or only with few games ?

Last edited by eke-eke; 04-16-2007 at 06:20 AM..
Reply With Quote

PSG Info
  #21  
Old 04-16-2007, 06:36 AM
softdev softdev is offline
masta blasta
 
Join Date: Aug 2005
Location: Alpha Centauri
Posts: 575
Default PSG Info

The PSG having reduced amplitude is not surprising. The last change reduced the bit swing from 32767 down to 16383 - effectively halving the volume. GC is 16 bit sound ( 32767 - -32768) so this should be returned to it's original value.

The latest confirmation from John Kortink, is that the white noise feedback for the SN76496 was also in error. It should be 0x14002 (FB_WNOISE).

Volume should be controlled through SN76496_set_gain function only.
Reply With Quote

  #22  
Old 04-16-2007, 12:28 PM
eke-eke eke-eke is offline
finish him
 
Join Date: Mar 2006
Location: Toulouse, France
Posts: 982
Default

Ok, thank you, I will remodified these as soon as I can...
I did this because Charles Mc Donald said there was something wrong with PSG output and that he has to divided the output volume by 2... which I thought I omitted to do in former releases

strangely, I personally find that the PSG volume is more correct so: after playing on a real genesis, I never head sound FX playing louder than FM music, which was the case with genesis plus


EDIT: I just give a test with Street of Rage 3, I never played the game on a real genesis so I can't tell if something's wrong but I noticed in the sound test that some "punches" effects are actually DAC samples. DAC samples (most often used for voice sampling) are related to the YM2612 engine (FM), not the SN7489 (PSG).
Could you please go into the sound test, scroll into the "voice" list to find the punch effetcs and tell me if these are these effects which sound too quiet for you ?

On the other hand, if I correct my mistake and set PSG MAX_OUTPUT to original value, the sound effects in Alladdin (which I owned myself) are a bit too loud (apples pickingfor example, if you want to test).

I guess the best way is to have a configurable PSG volume, as well as a configurable Filtering Value for the Low-Pass Filter.

Last edited by eke-eke; 04-16-2007 at 04:11 PM..
Reply With Quote

  #23  
Old 04-18-2007, 06:32 AM
sindrik sindrik is offline
member
 
Join Date: Dec 2006
Posts: 33
Default

Quote:
Originally Posted by eke-eke
By default, X & Z are linked respectively to L & R Buttons on the GC PAD.
As far as I know, these buttons are inverted in libogc so, in the genplus sourcecode, X is seen as pressed when PAD_ButtonsHeld() function return PAD_TRIGGER_R (and Z is set when PAD_TRIGGER_L).
Do you have recompiled the sources with a corrected libogc ?
Or perhaps this has already been fixed in the last libogc?
Well, i tested the already compiled DOL from the package from the start, just to be sure, so i couldn't say if it is an issue with libOGC.

Quote:
Originally Posted by eke-eke
The modification I made on PSG was perhaps not correct, I will have a look. Is it a general issue or only with few games?
Quote:
Originally Posted by eke-eke
Could you please go into the sound test, scroll into the "voice" list to find the punch effetcs and tell me if these are these effects which sound too quiet for you?
I will report it back to you in a couple of hours.
Reply With Quote

  #24  
Old 04-19-2007, 01:12 AM
sindrik sindrik is offline
member
 
Join Date: Dec 2006
Posts: 33
Time

Ok, here is my findings and comparisons:

With GenesisPlus 070326, Super Street Fighter II misses the 'drum line' in the game's intro. This is not happening with 070411.

In 070326, music emulation in Streets of Rage 2 seems to be a bit off and unaccurate (check BGM 00 and compare either with real hardware or another emu and you'll see what i mean, i used both hardware and Gens32 Surreal for comparison). This seems to be somehow corrected in 070411.

Voice tests sound ok in Streets of Rage 3 (070326), but in-game it sounds very bland. When you hit the opponent or get hit, and Axel's -> ->+B blitz, where he screams "Bare Knuckle" (voice 20 in test). This sounds a little bit clearer and better in latest 070411 version.

X and Z buttons are inverted in both versions (although this is since they began to work with your 070309 release). Tested with these three games, with the already compiled emu and a fresh compile with latest libOGC (070204).
Reply With Quote

  #25  
Old 04-19-2007, 05:31 AM
eke-eke eke-eke is offline
finish him
 
Join Date: Mar 2006
Location: Toulouse, France
Posts: 982
Default

Quote:
Ok, here is my findings and comparisons:

With GenesisPlus 070326, Super Street Fighter II misses the 'drum line' in the game's intro. This is not happening with 070411.

In 070326, music emulation in Streets of Rage 2 seems to be a bit off and unaccurate (check BGM 00 and compare either with real hardware or another emu and you'll see what i mean, i used both hardware and Gens32 Surreal for comparison). This seems to be somehow corrected in 070411.

Voice tests sound ok in Streets of Rage 3 (070326), but in-game it sounds very bland. When you hit the opponent or get hit, and Axel's -> ->+B blitz, where he screams "Bare Knuckle" (voice 20 in test). This sounds a little bit clearer and better in latest 070411 version.
Thanks for the feedback. The only real difference between 070326 and 070411 is the PSG maxoutput divided by 2. This should not have consequences on the FM music, except that you can hear it better as the psg volume is lower, that's all.

Perhaps it has something to do with the Low-Pass filter applied on the mixed sound stream (1/2 PSG + 3/4 FM). When I have the time, I will post a new version with configurable soundfilter option and corrected MAX_OUPUT value (no more divided, this should never be done like this).

Btw, regarding the test you made, it seems that the last version (with MAX_OUTPUT divided by 2) is more correct than the previous one ? What about the volume of "punches" and "specials" sfx in SOR 3 ?

Quote:
X and Z buttons are inverted in both versions (although this is since they began to work with your 070309 release). Tested with these three games, with the already compiled emu and a fresh compile with latest libOGC (070204).
Yes, I noticed this also, this will be reinverted in next release
Reply With Quote

  #26  
Old 04-19-2007, 05:57 PM
sindrik sindrik is offline
member
 
Join Date: Dec 2006
Posts: 33
Default

Quote:
Originally Posted by eke-eke
Btw, regarding the test you made, it seems that the last version (with MAX_OUTPUT divided by 2) is more correct than the previous one ? What about the volume of "punches" and "specials" sfx in SOR 3?
Well, punches and Axel's blitz and hitting sounds sound just a bit clearer in this version (although not as clear as opposed to cartridge or Gens32, check it if you can). Voice 02 (enemy dying) and Voice 21 (jump+kick, and others) still sound bland.

Quote:
Originally Posted by eke-eke
When I have the time, I will post a new version with configurable soundfilter option and corrected MAX_OUPUT value (no more divided, this should never be done like this).
Quote:
Originally Posted by eke-eke
Yes, I noticed this also, this will be reinverted in next release
I'll be patiently waiting
Reply With Quote

  #27  
Old 04-21-2007, 05:43 AM
eke-eke eke-eke is offline
finish him
 
Join Date: Mar 2006
Location: Toulouse, France
Posts: 982
Default

@Sindrik: Could you test this dol please ?

I simplified the mixing function to the maximum: PSG max volume is back to normal (0x7FFF), PSG and Stereo FM streams are only additionned, without specific mixing or filtering, I only apply sample final clipping (min -0x7FFF, max 0x7FFF).
This is how it's done in Gens I think, from the code i've seen...

Btw, gens (and gens32) use specific FM and PSG 'C' core (also based on some mame's constants). Perhaps this could be interesting to include them like an alternative in Genesis Plus

Last edited by eke-eke; 04-25-2007 at 10:29 AM.. Reason: Removed file attached
Reply With Quote

  #28  
Old 04-23-2007, 10:19 PM
RamyMason RamyMason is offline
new member
 
Join Date: Apr 2007
Posts: 2
Default

[ no begging for warez on tehskeen ] - brakken

Last edited by brakken; 04-23-2007 at 11:25 PM..
Reply With Quote

  #29  
Old 04-24-2007, 02:29 AM
sindrik sindrik is offline
member
 
Join Date: Dec 2006
Posts: 33
Quote:
Originally Posted by eke-eke
@Sindrik: Could you test this dol please ?

I simplified the mixing function to the maximum: PSG max volume is back to normal (0x7FFF), PSG and Stereo FM streams are only additionned, without specific mixing or filtering, I only apply sample final clipping (min -0x7FFF, max 0x7FFF).
This is how it's done in Gens I think, from the code i've seen...

Btw, gens (and gens32) use specific FM and PSG 'C' core (also based on some mame's constants). Perhaps this could be interesting to include them like an alternative in Genesis Plus
Good! Report in a couple of hours .

Last edited by sindrik; 04-24-2007 at 02:31 AM..
Reply With Quote

  #30  
Old 04-24-2007, 06:38 AM
eke-eke eke-eke is offline
finish him
 
Join Date: Mar 2006
Location: Toulouse, France
Posts: 982
Default

Regarding DAC volume being too low, here's what I found:

Genesis Plus use a modified version of the YM2612 core (by James Ponder I think), and DAC volume is modified on YM2612 Writes like this:

Quote:
case 0x2a: /* DAC data (YM2612) */
YM2612UpdateReq(n);
/* James Ponder 2001-09-30 level setting of 5 found suitable */
F2612->dacout = ((int)v - 0x80) << 5; /* level unknown */
break;
In Gens (the author uses his own YM2612 core) we have:

Quote:
// Trivial optimisation
if(YM2612.OPNAadr == 0x2A)
{
YM2612.DACdata = ((int)data - 0x80) << 7;
return 0;
}

In Picodrive (Notaz's Genesis Emulator for GP2X, using also Mame's YM2612 core):

Quote:
case 0x2a: /* DAC data (YM2612) */
ym2612.dacout = ((int)v - 0x80) << 6; /* level unknown (notaz: 8 seems to be too much) */
ret=0;
break;

I think that the shift value that we use is definitively too low and that using 6 (multiply the volume by 2) or 7 like in others emulators would be better. I can't do it for now buf if you are able to recompilate genplus, you could try this
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -4. The time now is 06:13 PM.


vBulletin skins developed by: eXtremepixels
Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
All Original Content (C) 2005-2008 brakken, All Rights Reseverd