now that i have a piano to test with, refine piano emulation a bit. also rename that file to conform to more recent standards

This commit is contained in:
zeromus 2011-02-09 00:36:25 +00:00
parent 1d239bce90
commit 20aa3cc42e
6 changed files with 20 additions and 23 deletions

View File

@ -80,7 +80,7 @@ libdesmume_a_SOURCES = \
utils/libfat/partition.cpp \ utils/libfat/partition.cpp \
utils/libfat/partition.h \ utils/libfat/partition.h \
addons.cpp addons.h \ addons.cpp addons.h \
addons/slot2_mpcf.cpp addons/slot2_paddle.cpp addons/gbagame.cpp addons/none.cpp addons/rumblepak.cpp addons/guitarGrip.cpp addons/expMemory.cpp addons/piano.cpp addons/slot1_none.cpp addons/slot1_r4.cpp addons/slot1_retail.cpp \ addons/slot2_mpcf.cpp addons/slot2_paddle.cpp addons/gbagame.cpp addons/none.cpp addons/rumblepak.cpp addons/guitarGrip.cpp addons/expMemory.cpp addons/slot2_piano.cpp addons/slot1_none.cpp addons/slot1_r4.cpp addons/slot1_retail.cpp \
cheatSystem.cpp cheatSystem.h \ cheatSystem.cpp cheatSystem.h \
texcache.cpp texcache.h rasterize.cpp rasterize.h \ texcache.cpp texcache.h rasterize.cpp rasterize.h \
metaspu/metaspu.cpp metaspu/metaspu.h \ metaspu/metaspu.cpp metaspu/metaspu.h \

View File

@ -1,20 +1,17 @@
/* Copyright (C) 2010 DeSmuME team /* Copyright (C) 2010-2011 DeSmuME team
This file is part of DeSmuME This file 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.
DeSmuME is free software; you can redistribute it and/or modify This file is distributed in the hope that it will be useful,
it under the terms of the GNU General Public License as published by but WITHOUT ANY WARRANTY; without even the implied warranty of
the Free Software Foundation; either version 2 of the License, or MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
(at your option) any later version. GNU General Public License for more details.
DeSmuME is distributed in the hope that it will be useful, You should have received a copy of the GNU General Public License
but WITHOUT ANY WARRANTY; without even the implied warranty of along with the this software. If not, see <http://www.gnu.org/licenses/>.
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 DeSmuME; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include "../addons.h" #include "../addons.h"
@ -75,14 +72,14 @@ static u8 piano_read08(u32 procnum, u32 adr)
if(adr == 0x09FFFFFE) return (~(pianoKeyStatus&0xFF)); if(adr == 0x09FFFFFE) return (~(pianoKeyStatus&0xFF));
if(adr == 0x09FFFFFF) return (~((pianoKeyStatus>>8)&0xFF))&~(0x18); if(adr == 0x09FFFFFF) return (~((pianoKeyStatus>>8)&0xFF))&~(0x18);
if(adr&1) return 0x07; if(adr&1) return 0xE7;
else return 0x00; else return 0xFF;
} }
static u16 piano_read16(u32 procnum, u32 adr) static u16 piano_read16(u32 procnum, u32 adr)
{ {
//printf("piano: read 16 at 0x%08X\n", adr); //printf("piano: read 16 at 0x%08X\n", adr);
if(adr != 0x09FFFFFE) if(adr != 0x09FFFFFE)
return 0x07FF; return 0xE7FF;
u16 ret = piano_read08(procnum,0x09FFFFFE)|(piano_read08(procnum,0x09FFFFFF)<<8); u16 ret = piano_read08(procnum,0x09FFFFFE)|(piano_read08(procnum,0x09FFFFFF)<<8);
//return ( (PIANO_PAK & 0x1800 ) == 0 ); //return ( (PIANO_PAK & 0x1800 ) == 0 );
return ret; return ret;
@ -90,7 +87,7 @@ static u16 piano_read16(u32 procnum, u32 adr)
static u32 piano_read32(u32 procnum, u32 adr) static u32 piano_read32(u32 procnum, u32 adr)
{ {
//printf("piano: read 32 at 0x%08X\n", adr); //printf("piano: read 32 at 0x%08X\n", adr);
return 0x07FF07FF; return 0xE7FFE7FF;
} }
static void piano_info(char *info) { strcpy(info, "Piano for EasyPiano"); } static void piano_info(char *info) { strcpy(info, "Piano for EasyPiano"); }

View File

@ -1648,7 +1648,7 @@
> >
</File> </File>
<File <File
RelativePath="..\addons\piano.cpp" RelativePath="..\addons\slot2_piano.cpp"
> >
</File> </File>
<File <File

View File

@ -1010,7 +1010,7 @@
> >
</File> </File>
<File <File
RelativePath="..\addons\piano.cpp" RelativePath="..\addons\slot2_piano.cpp"
> >
</File> </File>
<File <File

View File

@ -378,7 +378,7 @@
<ClCompile Include="tileView.cpp"> <ClCompile Include="tileView.cpp">
<Filter>Windows\tools</Filter> <Filter>Windows\tools</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\addons\piano.cpp"> <ClCompile Include="..\addons\slot2_piano.cpp">
<Filter>Core\addons</Filter> <Filter>Core\addons</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\utils\dlditool.cpp"> <ClCompile Include="..\utils\dlditool.cpp">

View File

@ -1005,7 +1005,7 @@
> >
</File> </File>
<File <File
RelativePath="..\addons\piano.cpp" RelativePath="..\addons\slot2_piano.cpp"
> >
</File> </File>
<File <File