--- hatari/src/uae-cpu/hatari-glue.c 2019/04/01 07:10:05 1.1.1.4 +++ hatari/src/uae-cpu/hatari-glue.c 2019/04/01 07:10:23 1.1.1.5 @@ -6,14 +6,12 @@ #include "../includes/tos.h" #include "../includes/gemdos.h" #include "../includes/cart.h" +#include "../includes/vdi.h" +#include "../includes/stMemory.h" -#ifndef UAESYSDEPS #include "sysdeps.h" -#endif -#ifndef UAEMEMORY -#include "memory.h" -#endif #include "maccess.h" +#include "memory.h" #include "newcpu.h" #ifndef FALSE @@ -111,9 +109,10 @@ unsigned long OpCode_ConnectedDrive(uae_ return 4; } + /* ----------------------------------------------------------------------- */ /* - Re-direct execution to old GEM calls, used in 'cart.s' + Re-direct execution to old GEMDOS calls, used in 'cart.s' */ unsigned long OpCode_OldGemDos(uae_u32 opcode) { @@ -122,6 +121,7 @@ unsigned long OpCode_OldGemDos(uae_u32 o return 4; } + /* ----------------------------------------------------------------------- */ /* Intercept GEMDOS calls (setup vector $84) @@ -139,11 +139,12 @@ unsigned long OpCode_GemDos(uae_u32 opco else GemDOS_OpCode(); /* handler code in gemdos.c */ - m68k_incpc(2); - fill_prefetch_0(); - return 4; + m68k_incpc(2); + fill_prefetch_0(); + return 4; } + /* ----------------------------------------------------------------------- */ /* Modify TimerD in GEMDos to gain more desktop performance @@ -157,11 +158,27 @@ unsigned long OpCode_GemDos(uae_u32 opco */ unsigned long OpCode_TimerD(uae_u32 opcode) { - /*fprintf(stderr, "OpCode_TimerD handled\n");*/ - m68k_dreg(regs,0)=3; /* 3 = Select Timer D */ - m68k_dreg(regs,1)=7; /* 1 = /4 for 9600 baud(used /200) */ - m68k_dreg(regs,2)=100; /* 2 = 9600 baud(100) */ - m68k_incpc(2); - fill_prefetch_0(); - return 4; + /*fprintf(stderr, "OpCode_TimerD handled\n");*/ + m68k_dreg(regs,0)=3; /* 3 = Select Timer D */ + m68k_dreg(regs,1)=7; /* 1 = /4 for 9600 baud(used /200) */ + m68k_dreg(regs,2)=100; /* 2 = 9600 baud(100) */ + m68k_incpc(2); + fill_prefetch_0(); + return 4; +} + + +/*-----------------------------------------------------------------------*/ +/* + This is called after completion of each VDI call +*/ +unsigned long OpCode_VDI(uae_u32 opcode) +{ + VDI_Complete(); + + /* Set PC back to where originated from to continue instruction decoding */ + m68k_setpc(VDI_OldPC); + + fill_prefetch_0(); + return 4; }