Line 27... |
Line 27... |
#include "abstract.h"
|
#include "abstract.h"
|
|
|
extern int cont_run; /* defined in toplevel.c */
|
extern int cont_run; /* defined in toplevel.c */
|
extern int tt_stopped; /* defined in tick.c */
|
extern int tt_stopped; /* defined in tick.c */
|
extern int flag;
|
extern int flag;
|
|
extern int GlobalMode; /* CZ 21/06/01 */
|
|
|
sprword sprs[MAX_SPRS];
|
sprword sprs[MAX_SPRS];
|
|
|
int temp_disable_except = 0;
|
int temp_disable_except = 0;
|
int audio_cnt = 0;
|
int audio_cnt = 0;
|
Line 39... |
Line 40... |
/* Set a specific SPR with a value. */
|
/* Set a specific SPR with a value. */
|
inline void
|
inline void
|
mtspr(const int regno, const sprword value)
|
mtspr(const int regno, const sprword value)
|
{
|
{
|
int ofs = regno % MAX_SPRS_PER_GRP;
|
int ofs = regno % MAX_SPRS_PER_GRP;
|
|
extern unsigned long pc_phy;
|
|
|
/* MM: Register hooks. */
|
/* MM: Register hooks. */
|
switch (regno) {
|
switch (regno) {
|
case 0xFFFD:
|
case 0xFFFD:
|
fo = fopen ("audiosim.pcm", "wb+");
|
fo = fopen ("audiosim.pcm", "wb+");
|
Line 60... |
Line 62... |
fclose(fo);
|
fclose(fo);
|
printf("Audio closed.\n");
|
printf("Audio closed.\n");
|
cont_run = 0;
|
cont_run = 0;
|
return;
|
return;
|
case SPR_TTMR:
|
case SPR_TTMR:
|
if (value & SPR_TTMR_M == 0x80000000) break;
|
/* CZ -- 04/09/01 Clear the interrupt in the PIC also... */
|
|
/* If it's cleared now and it was set, then we need to fix it */
|
|
if(~value & SPR_TTMR_IP & sprs[SPR_TTMR])
|
|
setsprbit(SPR_PICSR, 3, 0);
|
|
if (value & SPR_TTMR_M == 2) break;
|
case SPR_TTCR:
|
case SPR_TTCR:
|
tt_stopped = 0;
|
tt_stopped = 0;
|
break;
|
break;
|
case 0x1234:
|
case 0x1234:
|
printf("MTSPR(0x1234, %x);\n", value);
|
printf("MTSPR(0x1234, %x);\n", value);
|
Line 95... |
Line 101... |
cont_run = 0;
|
cont_run = 0;
|
}
|
}
|
break;
|
break;
|
}
|
}
|
|
|
/* What the hell is happening here? This looks like a bug
|
|
waiting to happen. Assume regno = 2*MAX_SPRS_PER_GRP+3,
|
|
which presumably means I want to set register 3 in
|
|
group 2. Instead, I calculate ofs as 3, and regno as
|
|
2, and get a final value of 5??? Is this correct?
|
|
Oh well...I didn't write this. Who knows what it is
|
|
actually supposed to do. It doesn't matter if regno
|
|
is less than MAX_SPRS_PER_GRP, which is the only
|
|
way I use it. CZ - 21/06/01
|
|
*/
|
|
|
|
//regno /= MAX_SPRS_PER_GRP;
|
|
//regno += ofs;
|
|
|
|
/* CZ 21/06/01 ... the debugger wants to do this! */
|
/* CZ 21/06/01 ... the debugger wants to do this! */
|
if(GlobalMode)
|
if(GlobalMode)
|
{
|
{
|
extern unsigned long pc;
|
extern unsigned long pc;
|
extern unsigned long pcnext;
|
extern unsigned long pcnext;
|