mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 07:17:45 -04:00
optimizations, fixes, hacks, psp, ...
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@295 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
8022f53da6
commit
b542be4686
37 changed files with 928 additions and 548 deletions
|
@ -13,6 +13,10 @@
|
|||
#include <string.h>
|
||||
#include "cz80.h"
|
||||
|
||||
#if PICODRIVE_HACKS
|
||||
#include <Pico/PicoInt.h>
|
||||
#endif
|
||||
|
||||
#ifndef ALIGN_DATA
|
||||
#define ALIGN_DATA __attribute__((aligned(4)))
|
||||
#endif
|
||||
|
@ -203,6 +207,13 @@ void Cz80_Reset(cz80_struc *CPU)
|
|||
Cz80_Set_Reg(CPU, CZ80_PC, 0);
|
||||
}
|
||||
|
||||
/* */
|
||||
#if PICODRIVE_HACKS
|
||||
static inline unsigned char picodrive_read(unsigned short a)
|
||||
{
|
||||
return (a < 0x4000) ? Pico.zram[a&0x1fff] : z80_read(a);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*--------------------------------------------------------
|
||||
CPUŽÀ<EFBFBD>s
|
||||
|
|
|
@ -52,6 +52,7 @@ extern "C" {
|
|||
#define CZ80_FETCH_SFT (16 - CZ80_FETCH_BITS)
|
||||
#define CZ80_FETCH_BANK (1 << CZ80_FETCH_BITS)
|
||||
|
||||
#define PICODRIVE_HACKS 1
|
||||
#define CZ80_LITTLE_ENDIAN 1
|
||||
#define CZ80_USE_JUMPTABLE 1
|
||||
#define CZ80_BIG_FLAGS_ARRAY 1
|
||||
|
|
|
@ -57,7 +57,11 @@
|
|||
//#ifndef BUILD_CPS1PSP
|
||||
//#define READ_MEM8(A) memory_region_cpu2[(A)]
|
||||
//#else
|
||||
#if PICODRIVE_HACKS
|
||||
#define READ_MEM8(A) picodrive_read(A)
|
||||
#else
|
||||
#define READ_MEM8(A) CPU->Read_Byte(A)
|
||||
#endif
|
||||
//#endif
|
||||
#if CZ80_LITTLE_ENDIAN
|
||||
#define READ_MEM16(A) (READ_MEM8(A) | (READ_MEM8((A) + 1) << 8))
|
||||
|
@ -65,7 +69,16 @@
|
|||
#define READ_MEM16(A) ((READ_MEM8(A) << 8) | READ_MEM8((A) + 1))
|
||||
#endif
|
||||
|
||||
#if PICODRIVE_HACKS
|
||||
#define WRITE_MEM8(A, D) { \
|
||||
unsigned short a = A; \
|
||||
unsigned char d = D; \
|
||||
if (a < 0x4000) Pico.zram[a&0x1fff] = d; \
|
||||
else z80_write(a, d); \
|
||||
}
|
||||
#else
|
||||
#define WRITE_MEM8(A, D) CPU->Write_Byte(A, D);
|
||||
#endif
|
||||
#if CZ80_LITTLE_ENDIAN
|
||||
#define WRITE_MEM16(A, D) { WRITE_MEM8(A, D); WRITE_MEM8((A) + 1, (D) >> 8); }
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue