1.32 release

git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@87 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2007-04-04 18:35:48 +00:00
parent 46ede6a688
commit 6ab2f79cf1
9 changed files with 97 additions and 60 deletions

View file

@ -1,3 +1,6 @@
// Code for communication with ARM940 and control of it.
// (c) Copyright 2007, Grazvydas "notaz" Ignotas
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -285,7 +288,7 @@ static void wait_busy_940(int job)
gp2x_memregs[0x3b46>>1], gp2x_memregl[0x4500>>2], gp2x_memregl[0x4510>>2]);
printf("last lr: %08x, lastjob: %i\n", shared_ctl->last_lr, shared_ctl->lastjob);
strcpy(menuErrorMsg, "940 crashed.");
strcpy(menuErrorMsg, "940 crashed, too much overclock?");
engineState = PGS_Menu;
crashed_940 = 1;
}

View file

@ -62,6 +62,7 @@ endif
ifeq "$(asm_misc)" "1"
DEFINC += -D_ASM_MISC_C
OBJS += ../../Pico/misc_asm.o
OBJS += ../../Pico/cd/misc_asm.o
endif
ifeq "$(asm_cdpico)" "1"
DEFINC += -D_ASM_CD_PICO_C
@ -156,6 +157,9 @@ testrefr.gpe : test.o gp2x.o asmutils.o
../../Pico/cd/memory_asm.o : ../../Pico/cd/Memory.s
@echo $<
@$(AS) $(ASOPT) $< -o $@
../../Pico/cd/misc_asm.o : ../../Pico/cd/misc.s
@echo $<
@$(AS) $(ASOPT) $< -o $@
# build Cyclone
../../cpu/Cyclone/proj/Cyclone.s :

View file

@ -1,3 +1,4 @@
@ vim:filetype=armasm
@ some color conversion and blitting routines
@ (c) Copyright 2006, notaz

View file

@ -18,67 +18,79 @@ mid-frame image changes (raster effects), so it is useful only with some games.
Other two are accurate line-based renderers. The 8bit is faster but does not
run well with some games like Street Racer.
2. "Accurate timing"
2. "Scaling"
"hw" means GP2X hardware scaler, which causes no performance loss, but scaled
image looks a bit blocky. "sw" means software scaling, which uses pixel
averaging and may look a bit nicer, but blurry. Horizontal scaling is only for
games which use so called "32 column mode" (256x224 or 256x240), and scales
image width to 320 pixels. Vertical scales height to 240 for games which use
height 224 (most of them).
3. "Accurate timing"
This adds some more emulation precision, but slows the emulation down. Without
this option some games do not boot (Red Zone for example), others have sound
problems. This options has no effect for Sega/Mega CD emulation.
3. "Accurate sprites"
4. "Accurate sprites"
This option improves emulation of sprite priorities, it also enables emulation
of sprite collision bit. If you see one sprite being drawn incorrectly above
the other (often seen in Sonic 3D Blast), you can enable this to fix the problem.
This only works with the default renderer (see first option).
This only works with the accurate renderers (see first option).
4. "Show FPS"
5. "Show FPS"
Self-explanatory. Format is XX/YY, where XX is the number of rendered frames and
YY is the number of emulated frames per second.
5. "Frameskip"
6. "Frameskip"
How many frames to skip rendering before displaying another.
"Auto" is recommended.
6. "Enable sound"
7. "Enable sound"
Does what it says. You must enable at least YM2612 or SN76496 (in advanced options,
see below) for this to make sense.
7. "Sound Quality"
8. "Sound Quality"
Sound rate and stereo mode. If you want 44100Hz sound, it is recommended to enable
the second core (next option).
8. "Use ARM940 core for sound"
9. "Use ARM940 core for sound"
This option causes PicoDrive to use ARM940T core (GP2X's second CPU) for sound
(i.e. to generate YM2612 samples) to improve performance noticeably.
9. "6 button pad"
10. "6 button pad"
If you enable this, games will think that 6 button gamepad is connected. If you
go and reconfigure your keys, you will be able to bind X,Y,Z and mode actions.
10. "Genesis Region"
11. "Region"
This option lets you force the game to think it is running on machine from the
specified region, or just to set autodetection order. Also affects Sega/Mega CD.
11. "Use SRAM/BRAM savestates"
12. "Use SRAM/BRAM savestates"
This will automatically read/write SRAM (or BRAM for Sega/Mega CD) savestates for
games which are using them. SRAM is saved whenever you pause your game or exit the
emulator.
12. "GP2X CPU clocks"
13. "Confirm savestate"
Allows to enable confirmation on savestate saving (to prevent savestate overwrites),
on loading (to prevent destroying current game progress), and on both or none.
14. "GP2X CPU clocks"
Here you can change clocks of both GP2X's CPUs. Larger values increase performance.
There is no separate option for the second CPU because both CPUs use the same clock
source. Setting this option to 200 will cause PicoDrive NOT to change GP2X's clocks
at all (this is if you use external program to set clock).
13. "[Sega/Mega CD options]"
15. "[Sega/Mega CD options]"
Enters Sega/Mega CD options menu (see below).
14. "[advanced options]"
16. "[advanced options]"
Enters advanced options menu (see below).
15. "Save cfg as default"
17. "Save cfg as default"
If you save your config here it will be loaded on next ROM load, but only if there
is no game specific config saved (which will be loaded in that case).
16. "Save cfg for current game only"
18. "Save cfg for current game only"
Whenever you load current ROM again these settings will be loaded (squidgehack and
RAM settings will not take effect until emulator is restarted).
@ -88,45 +100,41 @@ Advanced configuration
Enter [advanced options] in config menu to see these options.
1. "Scale 32 column mode"
This enables hardware scaling for lower-res genesis mode (where width is
32 8-pixel tiles, instead of 40 in other mode).
2. "Gamma correction"
1. "Gamma correction"
Alters image gamma through GP2X hardware. Larger values make image to look brighter,
lower - darker (default is 1.0).
3. "Emulate Z80"
2. "Emulate Z80"
Enables emulation of Z80 chip, which was mostly used to drive the other sound chips.
Some games do complex sync with it, so you must enable it even if you don't use
sound to be able to play them.
4. "Emulate YM2612 (FM)"
3. "Emulate YM2612 (FM)"
This enables emulation of six-channel FM sound synthesizer chip, which was used to
produce sound effects and music.
5. "Emulate SN76496 (PSG)"
4. "Emulate SN76496 (PSG)"
This enables emulation of additional sound chip for additional effects.
Note: if you change sound settings AFTER loading a ROM, you may need to reset
game to get sound. This is because most games initialize sound chips on
startup, and this data is lost when sound chips are being enabled/disabled.
6. "gzip savestates"
5. "gzip savestates"
This will always apply gzip compression on your savestates, allowing you to
save some space and load/save time.
7. "Don't save config on exit"
This will disable config autowrite on exit (which might cause SD card corruption
according to DaveC).
6. "Don't save last used ROM"
This will disable writing last used ROM to config on exit (what might cause SD
card corruption according to DaveC).
8. "craigix's RAM timings"
7. "craigix's RAM timings"
This overclocks the GP2X RAM chips, but may cause instability. Recommended if you
use the second core for sound. Needs emulator restart to take effect.
See this thread:
http://www.gp32x.com/board/index.php?showtopic=32319
9. "squidgehack"
8. "squidgehack"
Well known way to improve the GP2X performance. You must restart the emulator
for the change of this option to take effect.
@ -135,32 +143,35 @@ Sega/Mega CD options
--------------------
1,2,3. "USA/EUR/JAP BIOS"
These options just shows if your BIOS files were correctly detected be the
emulator (it shows the filename it is using). If so, you can press Start to test
your BIOS.
These options just show if your BIOS files were correctly detected by the
emulator (it shows the filename it is using). If so, you can press Start to
test your BIOS.
4. "CD LEDs"
The Sega/Mega CD unit had two blinking LEDs (red and green) on it. This option
will display them on left-top corner of the screen.
will display them on top-left corner of the screen.
5. "CDDA audio (using mp3s)"
This option enables CD audio playback.
6. "PCM audio"
This enables 8 channel PCM sound source. It is required for some games to run,
because they monitor state of the audio chip.
because they monitor state of this audio chip.
7. "ReadAhead buffer"
This option is for dealing with slow SD card access in GP2X, which makes FMV
games unplayable. It will allow emulator not to access SD card for longer periods
of time, but it will take more time to fill the buffer.
8. "Scale/Rot. fx"
8. "Save RAM cart"
Here you can enable 64K RAM cart. Format it in BIOS if you do.
9. "Scale/Rot. fx"
The Sega/Mega CD had scaling/rotation chip, which allows effects similar to
"Mode 7" effects in SNES. Unfortunately emulating it is slow, and very few games
used it, so it's better to disable this option.
used it, so it's better to disable this option, unless game really needs it.
9. "Better sync"
10. "Better sync"
This option is similar to "Perfect synchro" in Gens. Some games require it to run,
for example most (all?) Wolfteam games, and some other ones. Don't use it for
games which don't need it, it will just slow them down.

View file

@ -1,4 +1,4 @@
// (c) Copyright 2006 notaz, All rights reserved.
// (c) Copyright 2006-2007 notaz, All rights reserved.
// Free for non-commercial use.
// For commercial use, separate licencing terms must be obtained.
@ -310,7 +310,7 @@ int emu_ReloadRom(void)
// detect wrong files (Pico crashes on very small files), also see if ROM EP is good
if(rom_size <= 0x200 || strncmp((char *)rom_data, "Pico", 4) == 0 ||
((*(unsigned short *)(rom_data+4)<<16)|(*(unsigned short *)(rom_data+6))) >= (int)rom_size) {
((*(unsigned char *)(rom_data+4)<<16)|(*(unsigned short *)(rom_data+6))) >= (int)rom_size) {
if (rom_data) free(rom_data);
rom_data = 0;
sprintf(menuErrorMsg, "Not a ROM selected.");
@ -482,8 +482,8 @@ int emu_ReadConfig(int game)
// set default config
memset(&currentConfig, 0, sizeof(currentConfig));
currentConfig.lastRomFile[0] = 0;
currentConfig.EmuOpt = 0x1f | 0x400; // | cd_leds
currentConfig.PicoOpt = 0x0f | 0xe00; // | use_940 | cd_pcm | cd_cdda
currentConfig.EmuOpt = 0x1f | 0x600; // | confirm_save, cd_leds
currentConfig.PicoOpt = 0x0f | 0xe00; // | use_940, cd_pcm, cd_cdda
currentConfig.PsndRate = 22050; // 44100;
currentConfig.PicoRegion = 0; // auto
currentConfig.PicoAutoRgnOrder = 0x184; // US, EU, JP
@ -1328,7 +1328,7 @@ if (Pico.m.frame_count == 31563) {
// save SRAM
if((currentConfig.EmuOpt & 1) && SRam.changed) {
osd_text(4, 232, "Writing SRAM/BRAM..");
emu_state_cb("Writing SRAM/BRAM..");
emu_SaveLoadGame(0, 1);
SRam.changed = 0;
}
@ -1459,9 +1459,18 @@ int emu_SaveLoadGame(int load, int sram)
FILE *sramFile;
int sram_size;
unsigned char *sram_data;
int truncate = 1;
if (PicoMCD&1) {
if (PicoOpt&0x8000) { // MCD RAM cart?
sram_size = 0x12000;
sram_data = SRam.data;
if (sram_data)
memcpy32((int *)sram_data, (int *)Pico_mcd->bram, 0x2000/4);
} else {
sram_size = 0x2000;
sram_data = Pico_mcd->bram;
truncate = 0; // the .brm may contain RAM cart data after normal brm
}
} else {
sram_size = SRam.end-SRam.start+1;
if(SRam.reg_back & 4) sram_size=0x2000;
@ -1474,6 +1483,8 @@ int emu_SaveLoadGame(int load, int sram)
if(!sramFile) return -1;
fread(sram_data, 1, sram_size, sramFile);
fclose(sramFile);
if ((PicoMCD&1) && (PicoOpt&0x8000))
memcpy32((int *)Pico_mcd->bram, (int *)sram_data, 0x2000/4);
} else {
// sram save needs some special processing
// see if we have anything to save
@ -1481,7 +1492,7 @@ int emu_SaveLoadGame(int load, int sram)
if (sram_data[sram_size-1]) break;
if (sram_size) {
sramFile = fopen(saveFname, "wb");
sramFile = fopen(saveFname, truncate ? "wb" : "r+b");
ret = fwrite(sram_data, 1, sram_size, sramFile);
ret = (ret != sram_size) ? -1 : 0;
fclose(sramFile);

View file

@ -1,4 +1,4 @@
// (c) Copyright 2006 notaz, All rights reserved.
// (c) Copyright 2006-2007 notaz, All rights reserved.
// Free for non-commercial use.
// For commercial use, separate licencing terms must be obtained.

View file

@ -772,8 +772,9 @@ static void draw_cd_menu_options(int menu_sel, char *b_us, char *b_eu, char *b_j
gp2x_text_out8(tl_x, (y+=10), "CDDA audio (using mp3s) %s", (currentConfig.PicoOpt&0x0800)?"ON":"OFF"); // 4
gp2x_text_out8(tl_x, (y+=10), "PCM audio %s", (currentConfig.PicoOpt&0x0400)?"ON":"OFF"); // 5
gp2x_text_out8(tl_x, (y+=10), "ReadAhead buffer %s", ra_buff); // 6
gp2x_text_out8(tl_x, (y+=10), "Scale/Rot. fx (slow) %s", (currentConfig.PicoOpt&0x1000)?"ON":"OFF"); // 7
gp2x_text_out8(tl_x, (y+=10), "Better sync (slow) %s", (currentConfig.PicoOpt&0x2000)?"ON":"OFF"); // 8
gp2x_text_out8(tl_x, (y+=10), "SaveRAM cart %s", (currentConfig.PicoOpt&0x8000)?"ON":"OFF"); // 7
gp2x_text_out8(tl_x, (y+=10), "Scale/Rot. fx (slow) %s", (currentConfig.PicoOpt&0x1000)?"ON":"OFF"); // 8
gp2x_text_out8(tl_x, (y+=10), "Better sync (slow) %s", (currentConfig.PicoOpt&0x2000)?"ON":"OFF"); // 9
gp2x_text_out8(tl_x, (y+=10), "Done");
// draw cursor
@ -789,7 +790,7 @@ static void draw_cd_menu_options(int menu_sel, char *b_us, char *b_eu, char *b_j
static void cd_menu_loop_options(void)
{
int menu_sel = 0, menu_sel_max = 9;
int menu_sel = 0, menu_sel_max = 10;
unsigned long inp = 0;
char bios_us[32], bios_eu[32], bios_jp[32], *bios, *p;
@ -829,9 +830,10 @@ static void cd_menu_loop_options(void)
if (PicoCDBuffers > 8*1024) PicoCDBuffers = 8*1024; // 16M
}
break;
case 7: currentConfig.PicoOpt^=0x1000; break;
case 8: currentConfig.PicoOpt^=0x2000; break;
case 9: return;
case 7: currentConfig.PicoOpt^=0x8000; break;
case 8: currentConfig.PicoOpt^=0x1000; break;
case 9: currentConfig.PicoOpt^=0x2000; break;
case 10: return;
}
}
if(inp & (GP2X_X|GP2X_A)) return;
@ -996,7 +998,7 @@ static void draw_menu_options(int menu_sel)
gp2x_text_out8(tl_x, (y+=10), "Sound Quality: %5iHz %s", currentConfig.PsndRate, monostereo);
gp2x_text_out8(tl_x, (y+=10), "Use ARM940 core for sound %s", (currentConfig.PicoOpt&0x200)?"ON":"OFF"); // 8
gp2x_text_out8(tl_x, (y+=10), "6 button pad %s", (currentConfig.PicoOpt&0x020)?"ON":"OFF"); // 9
gp2x_text_out8(tl_x, (y+=10), "Genesis Region: %s", region_name(currentConfig.PicoRegion));
gp2x_text_out8(tl_x, (y+=10), "Region: %s", region_name(currentConfig.PicoRegion));
gp2x_text_out8(tl_x, (y+=10), "Use SRAM/BRAM savestates %s", (currentConfig.EmuOpt &0x001)?"ON":"OFF"); // 11
gp2x_text_out8(tl_x, (y+=10), "Confirm savestate %s", strssconfirm); // 12
gp2x_text_out8(tl_x, (y+=10), "Save slot %i", state_slot); // 13

View file

@ -1,3 +1,6 @@
// Some mp3 related code for Sega/Mega CD
// (c) Copyright 2007, Grazvydas "notaz" Ignotas
#include <stdio.h>
#include <string.h>

View file

@ -1,3 +1,5 @@
@ vim:filetype=armasm
@ .equiv START_ROW, 1
@ .equiv END_ROW, 27
@ one row means 8 pixels. If above example was used, (27-1)*8=208 lines would be rendered.