wram_2M_to_1M(Pico_mcd->word_ram2M);
#ifdef _ASM_CD_MEMORY_C
PicoMemResetCD(Pico_mcd->s68k_regs[3]);
wram_2M_to_1M(Pico_mcd->word_ram2M);
#ifdef _ASM_CD_MEMORY_C
PicoMemResetCD(Pico_mcd->s68k_regs[3]);
- PicoMemResetCDdecode(Pico_mcd->s68k_regs[3]);
+ if (Pico_mcd->s68k_regs[3]&4)
+ PicoMemResetCDdecode(Pico_mcd->s68k_regs[3]);
#endif
if (Pico_mcd->m.audio_track > 0 && Pico_mcd->m.audio_track < Pico_mcd->TOC.Last_Track)
mp3_start_play(Pico_mcd->TOC.Tracks[Pico_mcd->m.audio_track].F, Pico_mcd->m.audio_offset);
#endif
if (Pico_mcd->m.audio_track > 0 && Pico_mcd->m.audio_track < Pico_mcd->TOC.Last_Track)
mp3_start_play(Pico_mcd->TOC.Tracks[Pico_mcd->m.audio_track].F, Pico_mcd->m.audio_offset);
PicoMemResetCDdecode: @r3
PicoMemResetCDdecode: @r3
+ tst r3, #4
+ bxeq lr @ we should not be called in 2M mode
ldr r1, =m_s68k_write8_table
ldr r3, =m_s68k_decode_write_table
and r2, r0, #0x18
ldr r1, =m_s68k_write8_table
ldr r3, =m_s68k_decode_write_table
and r2, r0, #0x18
+@ r0=prt1, r1=ptr2; unaligned ptr MUST be r0
.macro m_read32_gen
tst r0, #2
ldrneh r0, [r1, r0]!
.macro m_read32_gen
tst r0, #2
ldrneh r0, [r1, r0]!
-@ r0=prt1, r1=data, r2=ptr2
+@ r0=prt1, r1=data, r2=ptr2; unaligned ptr MUST be r0
.macro m_write32_gen
tst r0, #2
mov r1, r1, ror #16
.macro m_write32_gen
tst r0, #2
mov r1, r1, ror #16
.long m_m68k_read8_r0d
m_m68k_read8_r00:
add r1, r1, #0x110000
.long m_m68k_read8_r0d
m_m68k_read8_r00:
add r1, r1, #0x110000
and r0, r0, #0x04000000 @ we need irq2 mask state
mov r0, r0, lsr #19
bx lr
and r0, r0, #0x04000000 @ we need irq2 mask state
mov r0, r0, lsr #19
bx lr
movge r0, #0
bxge lr
@ I have seen the range 0x0e-0x2f accessed quite frequently with long i/o, so here is some code for that
movge r0, #0
bxge lr
@ I have seen the range 0x0e-0x2f accessed quite frequently with long i/o, so here is some code for that
- ldr r0, =(Pico+0x22200)
+ mov r0, r1
+ ldr r1, =(Pico+0x22200)
m_read32_gen
and r1, r2, r0 @ data is big-endian read as little, have to byteswap
and r0, r2, r0, lsr #8
m_read32_gen
and r1, r2, r0 @ data is big-endian read as little, have to byteswap
and r0, r2, r0, lsr #8
gfx_cd_reset();
#ifdef _ASM_CD_MEMORY_C
PicoMemResetCD(1);
gfx_cd_reset();
#ifdef _ASM_CD_MEMORY_C
PicoMemResetCD(1);
- PicoMemResetCDdecode(1);
+ //PicoMemResetCDdecode(1); // don't have to call this in 2M mode
-static void gfx_do(void)
+static void gfx_do(unsigned int func, unsigned short *stamp_base, unsigned int H_Dot)
{
unsigned int eax, ebx, ecx, edx, esi, edi, pixel;
{
unsigned int eax, ebx, ecx, edx, esi, edi, pixel;
- unsigned int XD, Buffer_Adr, H_Dot;
- unsigned int func = rot_comp.Function;
- unsigned short *stamp_base;
+ unsigned int XD, Buffer_Adr;
int DYXS;
XD = rot_comp.Reg_60 & 7;
Buffer_Adr = ((rot_comp.Reg_5E & 0xfff8) + rot_comp.YD) << 2;
int DYXS;
XD = rot_comp.Reg_60 & 7;
Buffer_Adr = ((rot_comp.Reg_5E & 0xfff8) + rot_comp.YD) << 2;
- stamp_base = (unsigned short *) (Pico_mcd->word_ram2M + rot_comp.Stamp_Map_Adr);
- H_Dot = rot_comp.Reg_62 & 0x1ff;
ecx = *(unsigned int *)(Pico_mcd->word_ram2M + rot_comp.Vector_Adr);
edx = ecx >> 16;
ecx = (ecx & 0xffff) << 8;
ecx = *(unsigned int *)(Pico_mcd->word_ram2M + rot_comp.Vector_Adr);
edx = ecx >> 16;
ecx = (ecx & 0xffff) << 8;
{
if (func & 4) // 16x16 screen
{
{
if (func & 4) // 16x16 screen
{
- eax = (ecx >> (11+5)) & 0x007f;
- ebx = (edx >> (11-2)) & 0x3f80;
+ ebx = ((ecx >> (11+5)) & 0x007f) |
+ ((edx >> (11-2)) & 0x3f80);
- eax = (ecx >> (11+5)) & 0x07;
- ebx = (edx >> (11+2)) & 0x38;
+ ebx = ((ecx >> (11+5)) & 0x07) |
+ ((edx >> (11+2)) & 0x38);
}
}
else // mode 16x16 dot
{
if (func & 4) // 16x16 screen
{
}
}
else // mode 16x16 dot
{
if (func & 4) // 16x16 screen
{
- eax = (ecx >> (11+4)) & 0x00ff;
- ebx = (edx >> (11-4)) & 0xff00;
+ ebx = ((ecx >> (11+4)) & 0x00ff) |
+ ((edx >> (11-4)) & 0xff00);
- eax = (ecx >> (11+4)) & 0x0f;
- ebx = (edx >> (11+0)) & 0xf0;
+ ebx = ((ecx >> (11+4)) & 0x0f) |
+ ((edx >> (11+0)) & 0xf0);
// MAKE_IMAGE_PIXEL
if (!(func & 1)) // NOT TILED
// MAKE_IMAGE_PIXEL
if (!(func & 1)) // NOT TILED
- // esi = rot_comp.Stamp_Map_Adr;
- edi = stamp_base[ebx] | (stamp_base[ebx+1] << 16);
- esi = edi;
- edi >>= (11+1);
- esi = (esi & 0x7ff) << 7;
+ edi = stamp_base[ebx];// | (stamp_base[ebx+1] << 16);
+ esi = (edi & 0x7ff) << 7;
if (!esi) { pixel = 0; goto Pixel_Out; }
if (!esi) { pixel = 0; goto Pixel_Out; }
edi &= (0x1c>>1);
eax = ecx;
ebx = edx;
edi &= (0x1c>>1);
eax = ecx;
ebx = edx;
rot_comp.YD++;
// rot_comp.V_Dot--; // will be done by caller
}
rot_comp.YD++;
// rot_comp.V_Dot--; // will be done by caller
}
void gfx_cd_update(void)
{
void gfx_cd_update(void)
{
- unsigned char *V_Dot = (unsigned char *) &rot_comp.Reg_64;
+ int V_Dot = rot_comp.Reg_64 & 0xff;
int jobs;
dprintf("gfx_cd_update, Reg_64 = %04x", rot_comp.Reg_64);
int jobs;
dprintf("gfx_cd_update, Reg_64 = %04x", rot_comp.Reg_64);
{
gfx_completed();
return;
{
gfx_completed();
return;
rot_comp.Float_Part &= 0xffff;
rot_comp.Float_Part += rot_comp.Draw_Speed;
rot_comp.Float_Part &= 0xffff;
rot_comp.Float_Part += rot_comp.Draw_Speed;
+ if (PicoOpt & 0x1000) // scale/rot enabled
- if (PicoOpt & 0x1000)
- gfx_do(); // jmp [Jmp_Adr]:
+ unsigned int func = rot_comp.Function;
+ unsigned int H_Dot = rot_comp.Reg_62 & 0x1ff;
+ unsigned short *stamp_base = (unsigned short *) (Pico_mcd->word_ram2M + rot_comp.Stamp_Map_Adr);
- (*V_Dot)--; // dec byte [V_Dot]
+ while (jobs--)
+ {
+ gfx_do(func, stamp_base, H_Dot); // jmp [Jmp_Adr]:
+ V_Dot--; // dec byte [V_Dot]
+ if (V_Dot == 0)
+ {
+ // GFX_Completed:
+ gfx_completed();
+ return;
+ }
+ }
+ }
+ else
+ {
+ if (jobs >= V_Dot)
gfx_completed();
return;
}
gfx_completed();
return;
}
+
+ rot_comp.Reg_64 = V_Dot;
extern volatile unsigned short *gp2x_memregs; /* from minimal library rlyeh */\r
extern volatile unsigned long *gp2x_memregl;\r
\r
extern volatile unsigned short *gp2x_memregs; /* from minimal library rlyeh */\r
extern volatile unsigned long *gp2x_memregl;\r
\r
+extern int reset_timing;\r
static unsigned char *shared_mem = 0;\r
static _940_data_t *shared_data = 0;\r
_940_ctl_t *shared_ctl = 0;\r
static unsigned char *shared_mem = 0;\r
static _940_data_t *shared_data = 0;\r
_940_ctl_t *shared_ctl = 0;\r
if (CHECK_BUSY(JOB940_MP3DECODE)) wait_busy_940(JOB940_MP3DECODE);\r
add_job_940(JOB940_INVALIDATE_DCACHE);\r
}\r
if (CHECK_BUSY(JOB940_MP3DECODE)) wait_busy_940(JOB940_MP3DECODE);\r
add_job_940(JOB940_INVALIDATE_DCACHE);\r
}\r
static short sndBuffer[2*44100/50];\r
static char noticeMsg[64]; // notice msg to draw\r
static struct timeval noticeMsgTime = { 0, 0 }; // when started showing\r
static short sndBuffer[2*44100/50];\r
static char noticeMsg[64]; // notice msg to draw\r
static struct timeval noticeMsgTime = { 0, 0 }; // when started showing\r
-static int reset_timing, osd_fps_x;\r
static int combo_keys = 0, combo_acts = 0; // keys and actions which need button combos\r
static int gp2x_old_gamma = 100;\r
static unsigned char *movie_data = NULL;\r
static int movie_size = 0;\r
unsigned char *framebuff = 0; // temporary buffer for alt renderer\r
int state_slot = 0;\r
static int combo_keys = 0, combo_acts = 0; // keys and actions which need button combos\r
static int gp2x_old_gamma = 100;\r
static unsigned char *movie_data = NULL;\r
static int movie_size = 0;\r
unsigned char *framebuff = 0; // temporary buffer for alt renderer\r
int state_slot = 0;\r
continue;\r
}\r
updateKeys();\r
continue;\r
}\r
updateKeys();\r
- SkipFrame(tval.tv_usec < lim_time+target_frametime); frames_done++;\r
+ SkipFrame(tval.tv_usec < lim_time+target_frametime*2); frames_done++;\r