Clean a bit the NEC emulation files

This commit is contained in:
Godzil
2019-09-20 16:25:02 +01:00
parent baf836a747
commit 43292a26dc
3 changed files with 26 additions and 16 deletions

View File

@@ -115,20 +115,19 @@ void nec_exit (void)
}
void dump_memory();
void nec_int(DWORD wektor)
void nec_int(uint16_t vector)
{
DWORD dest_seg, dest_off;
if(I.IF)
{
i_pushf();
I.TF = I.IF = 0;
dest_off = ReadWord(wektor);
dest_seg = ReadWord(wektor+2);
dest_off = ReadWord(vector);
dest_seg = ReadWord(vector+2);
PUSH(I.sregs[CS]);
PUSH(I.ip);
I.ip = (WORD)dest_off;
@@ -999,6 +998,7 @@ OP( 0x61, i_popa )
(void)tmp; // We need to uppop something and need tmp
CLK(8);
}
/* BOUND */
OP( 0x62, i_chkind )
{
UINT32 low,high,tmp;
@@ -3641,6 +3641,7 @@ OP( 0xfa, i_di )
}
OP( 0xfb, i_ei )
{
/* STI */
SetIF(1);
CLK(4);
}

View File

@@ -1,9 +1,8 @@
BYTE cpu_readport(BYTE);
void cpu_writeport(DWORD,BYTE);
#define cpu_readop cpu_readmem20
#define cpu_readop_arg cpu_readmem20
void cpu_writemem20(DWORD,BYTE);
BYTE cpu_readmem20(DWORD);
#ifndef __NEC_H_
#define __NEC_H_
#include "necintrf.h"
typedef enum { ES, CS, SS, DS } SREGS;
typedef enum { AW, CW, DW, BW, SP, BP, IX, IY } WREGS;
@@ -389,3 +388,5 @@ typedef struct
di++; \
} \
}
#endif /* __NEC_H_ */

View File

@@ -1,6 +1,6 @@
/* ASG 971222 -- rewrote this interface */
#ifndef __NEC_H_
#define __NEC_H_
#ifndef __NECITRF_H_
#define __NECITRF_H_
@@ -60,10 +60,18 @@ extern const char *v33_info(void *context, int regnum);
extern unsigned v33_dasm(char *buffer, unsigned pc);
*/
void nec_set_reg(int,unsigned);
void nec_set_irq_line(int irqline, int state);
void nec_set_reg(int regnum, uint32_t val);
int nec_execute(int cycles);
unsigned nec_get_reg(int regnum);
void nec_reset (void *param);
void nec_int(DWORD wektor);
void nec_int(uint16_t vector);
#endif
uint8_t cpu_readport(uint8_t);
void cpu_writeport(uint32_t, uint8_t);
#define cpu_readop cpu_readmem20
#define cpu_readop_arg cpu_readmem20
void cpu_writemem20(uint32_t, uint8_t);
BYTE cpu_readmem20(uint32_t);
#endif /* __NECITRF_H_ */