summaryrefslogtreecommitdiff
path: root/source/spec.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/spec.c')
-rw-r--r--source/spec.c45
1 files changed, 15 insertions, 30 deletions
diff --git a/source/spec.c b/source/spec.c
index ef132d4..1a5eba2 100644
--- a/source/spec.c
+++ b/source/spec.c
@@ -78,9 +78,9 @@
#define OFF_X ((GFX_W-SCR_W)/2)
#define OFF_Y ((GFX_H-SCR_H)/2)
-#define ATTR_AT(x,y) mem[ATTR+(x)+((y)/8)*32]
+#define ATTR_AT(x,y) Z80_MEMORY[ATTR+(x)+((y)/8)*32]
-Z80Byte mem[0x10000];
+Z80Byte Z80_MEMORY[0x10000];
static int border;
static int scanline;
@@ -189,12 +189,12 @@ static void RomPatch(void)
for(f=0;save[f]!=0xff;f++)
{
- mem[ROM_SAVE+f]=save[f];
+ Z80_MEMORY[ROM_SAVE+f]=save[f];
}
for(f=0;load[f]!=0xff;f++)
{
- mem[ROM_LOAD+f]=load[f];
+ Z80_MEMORY[ROM_LOAD+f]=load[f];
}
}
@@ -337,21 +337,21 @@ static int EDCallback(Z80 *z80, Z80Val data)
switch((Z80Byte)data)
{
case ED_SAVE:
- z80->AF.b[Z80_LO_WORD] &= ~eZ80_Carry;
+ z80->AF.b.lo &= ~eZ80_Carry;
break;
case ED_LOAD:
- if (TAPLoad(z80->AF.b[Z80_HI_WORD],
+ if (TAPLoad(z80->AF.b.hi,
&z80->IX.w,
&z80->DE.w,
SPECWriteMemSNAP))
{
- z80->AF.b[Z80_LO_WORD] |= eZ80_Carry;
+ z80->AF.b.lo |= eZ80_Carry;
z80->BC.w=0xb001;
}
else
{
- z80->AF.b[Z80_LO_WORD] &= ~eZ80_Carry;
+ z80->AF.b.lo &= ~eZ80_Carry;
z80->BC.w = 0xff01;
}
break;
@@ -379,7 +379,7 @@ void SPECInit(Z80 *z80)
/* Load the ROM
*/
- memcpy(mem,spec48_bin,ROMLEN);
+ memcpy(Z80_MEMORY,spec48_bin,ROMLEN);
/* Patch the ROM
*/
@@ -429,26 +429,11 @@ void SPECHandleKey(SoftKey key, int is_pressed)
}
-Z80Byte SPECReadMem(Z80 *z80, Z80Word addr)
-{
- return mem[addr];
-}
-
-
-void SPECWriteMem(Z80 *z80, Z80Word addr, Z80Byte val)
-{
- if (addr>=ROMLEN)
- {
- mem[addr]=val;
- }
-}
-
-
void SPECWriteMemSNAP(Z80Word addr, Z80Byte val)
{
if (addr>=ROMLEN)
{
- mem[addr]=val;
+ Z80_MEMORY[addr]=val;
}
}
@@ -538,7 +523,7 @@ void SPECReset(Z80 *z80)
r=0;
for(f=0;f<SCRL;f++)
{
- line[f]=mem+SCRDATA+(c*8*TXT_W)+(r*TXT_W);
+ line[f]=Z80_MEMORY+SCRDATA+(c*8*TXT_W)+(r*TXT_W);
c++;
@@ -562,9 +547,9 @@ void SPECSaveSnapshot(FILE *fp)
{
int f;
- for(f=0; f<sizeof mem; f++)
+ for(f=0; f<sizeof Z80_MEMORY; f++)
{
- PUT_Byte(fp, mem[f]);
+ PUT_Byte(fp, Z80_MEMORY[f]);
}
for(f=0; f<sizeof matrix; f++)
@@ -580,9 +565,9 @@ void SPECLoadSnapshot(FILE *fp)
{
int f;
- for(f=0; f<sizeof mem; f++)
+ for(f=0; f<sizeof Z80_MEMORY; f++)
{
- mem[f] = GET_Byte(fp);
+ Z80_MEMORY[f] = GET_Byte(fp);
}
for(f=0; f<sizeof matrix; f++)