Skip to content

Commit

Permalink
Moved 6309 opcodes to library
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Hood committed Feb 23, 2021
1 parent a24afc2 commit d3c8835
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion HD6309Exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "library/HD6309.h"

#include "library/HD6309Macros.h"
#include "hd6309opcodes.h"
#include "library/HD6309OpCodes.h"

int HD6309Exec(int cycleFor)
{
Expand Down
2 changes: 0 additions & 2 deletions Vcc.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@
<ClCompile Include="AudioConfig.c" />
<ClCompile Include="BitBangerConfig.c" />
<ClCompile Include="HD6309Exec.c" />
<ClCompile Include="hd6309opcodes.c" />
<ClCompile Include="MC6809Exec.c" />
<ClCompile Include="CpuConfig.c" />
<ClCompile Include="CreateDDWindow.c" />
Expand Down Expand Up @@ -202,7 +201,6 @@
<ClInclude Include="AudioConfig.h" />
<ClInclude Include="BitBangerConfig.h" />
<ClInclude Include="HD6309Exec.h" />
<ClInclude Include="hd6309opcodes.h" />
<ClInclude Include="MC6809Exec.h" />
<ClInclude Include="CpuConfig.h" />
<ClInclude Include="CreateDDWindow.h" />
Expand Down
3 changes: 0 additions & 3 deletions hd6309opcodes.h

This file was deleted.

16 changes: 9 additions & 7 deletions hd6309opcodes.c → library/HD6309OpCodes.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "library/HD6309.h"
#include "library/MMU.h"
#include "HD6309.h"
#include "MMU.h"

#include "library/HD6309Macros.h"
#include "HD6309Macros.h"

static HD6309State* hd63096State = GetHD6309State();

Expand Down Expand Up @@ -7063,12 +7063,14 @@ void(*JmpVec3[256])(void) = {
};

//--Essentially Page_1()
void HD6309ExecOpCode(int cycleFor, unsigned char opcode) {
HD6309State* hd63096State = GetHD6309State();
extern "C" {
__declspec(dllexport) void __cdecl HD6309ExecOpCode(int cycleFor, unsigned char opcode) {
HD6309State* hd63096State = GetHD6309State();

hd63096State->gCycleFor = cycleFor;
hd63096State->gCycleFor = cycleFor;

JmpVec1[opcode](); // Execute instruction pointed to by PC_REG
JmpVec1[opcode](); // Execute instruction pointed to by PC_REG
}
}

void Page_2(void) //10
Expand Down
3 changes: 3 additions & 0 deletions library/HD6309OpCodes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#pragma once

extern "C" __declspec(dllexport) void __cdecl HD6309ExecOpCode(int cycleFor, unsigned char opcode);
2 changes: 2 additions & 0 deletions library/library.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
<ClCompile Include="fileoperations.c" />
<ClCompile Include="Graphics.c" />
<ClCompile Include="HD6309.c" />
<ClCompile Include="HD6309OpCodes.c" />
<ClCompile Include="IOBus.c" />
<ClCompile Include="Joystick.c" />
<ClCompile Include="Keyboard.c" />
Expand Down Expand Up @@ -218,6 +219,7 @@
<ClInclude Include="Graphics.h" />
<ClInclude Include="HD6309.h" />
<ClInclude Include="HD6309Macros.h" />
<ClInclude Include="HD6309OpCodes.h" />
<ClInclude Include="IOBus.h" />
<ClInclude Include="Joystick.h" />
<ClInclude Include="Keyboard.h" />
Expand Down

0 comments on commit d3c8835

Please sign in to comment.