mirror of
https://github.com/ksherlock/mpw.git
synced 2024-06-06 19:29:45 +00:00
Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
d59a35d3a9 | ||
|
9951892251 | ||
|
79a8a93e03 | ||
|
f619ed31b3 | ||
|
f460696b4f | ||
|
6151ca1e87 | ||
|
b9c7d9f95f | ||
|
2dcb161f5e | ||
|
f08d67333d | ||
|
2e7e75a2a9 | ||
|
bdb1f4b2b9 | ||
|
b8d17f4481 | ||
|
a76287876c | ||
|
022d4cffe9 | ||
|
843ea2764c | ||
|
fc15ad1d81 | ||
|
7ac2a88974 | ||
|
2703e00201 |
3
.github/FUNDING.yml
vendored
Normal file
3
.github/FUNDING.yml
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
github: [ksherlock]
|
4
.github/workflows/cmake-fat.yml
vendored
4
.github/workflows/cmake-fat.yml
vendored
|
@ -11,7 +11,7 @@ jobs:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ jobs:
|
||||||
run: make mpw
|
run: make mpw
|
||||||
|
|
||||||
- name: Archive
|
- name: Archive
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: mpw fat
|
name: mpw fat
|
||||||
path: ${{runner.workspace}}/build/bin/mpw
|
path: ${{runner.workspace}}/build/bin/mpw
|
||||||
|
|
7
.github/workflows/cmake.yml
vendored
7
.github/workflows/cmake.yml
vendored
|
@ -11,10 +11,10 @@ jobs:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-11.0, macos-10.15]
|
os: [macos-12, macos-13]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
|
@ -35,8 +35,7 @@ jobs:
|
||||||
run: cmake --build . --config $BUILD_TYPE
|
run: cmake --build . --config $BUILD_TYPE
|
||||||
|
|
||||||
- name: Archive
|
- name: Archive
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: mpw ${{ matrix.os }}
|
name: mpw ${{ matrix.os }}
|
||||||
path: ${{runner.workspace}}/build/bin/mpw
|
path: ${{runner.workspace}}/build/bin/mpw
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
cmake_minimum_required(VERSION 3.1)
|
cmake_minimum_required(VERSION 3.1)
|
||||||
project(mpw VERSION 0.8.2 LANGUAGES CXX C)
|
project(mpw VERSION 0.8.3 LANGUAGES CXX C)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 11)
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
|
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
|
||||||
|
@ -10,9 +10,19 @@ set(CMAKE_C_STANDARD_REQUIRED TRUE)
|
||||||
set(CMAKE_C_EXTENSIONS FALSE)
|
set(CMAKE_C_EXTENSIONS FALSE)
|
||||||
|
|
||||||
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||||
|
# Clang or AppleClang
|
||||||
|
set(CMAKE_CXX_FLAGS "-Wall ${CMAKE_CXX_FLAGS}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if ("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
|
||||||
# Clang or AppleClang
|
# Clang or AppleClang
|
||||||
set(CMAKE_CXX_FLAGS "-Wall")
|
set(CMAKE_C_FLAGS "-Wall ${CMAKE_C_FLAGS}")
|
||||||
set(CMAKE_C_FLAGS "-Wall")
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
find_program(RAGEL NAMES ragel)
|
||||||
|
if (NOT RAGEL)
|
||||||
|
message(FATAL_ERROR "ragel (version 6) is required.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -90,9 +90,9 @@ or create a shell script (in `/usr/local/bin`, etc)
|
||||||
|
|
||||||
`/usr/local/bin/AsmIIgs`:
|
`/usr/local/bin/AsmIIgs`:
|
||||||
|
|
||||||
#!/usr/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
exec mpw AsmIIgs $@
|
exec mpw AsmIIgs "$@"
|
||||||
|
|
||||||
|
|
||||||
mpw uses the MPW `$Commands` variable to find the command, similar to `$PATH` on Unix. If the `$Commands` variable
|
mpw uses the MPW `$Commands` variable to find the command, similar to `$PATH` on Unix. If the `$Commands` variable
|
||||||
|
|
|
@ -84,9 +84,9 @@ or create a shell script (in /usr/local/bin, etc)
|
||||||
|
|
||||||
/usr/local/bin/AsmIIgs:
|
/usr/local/bin/AsmIIgs:
|
||||||
|
|
||||||
#!/usr/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
exec mpw AsmIIgs $@
|
exec mpw AsmIIgs "$@"
|
||||||
|
|
||||||
mpw looks in the current directory and then in the $MPW:Tools: directory
|
mpw looks in the current directory and then in the $MPW:Tools: directory
|
||||||
for the command to run. The MPW $Commands variable is not yet supported.
|
for the command to run. The MPW $Commands variable is not yet supported.
|
||||||
|
|
|
@ -9,7 +9,7 @@ include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT lexer.cpp
|
OUTPUT lexer.cpp
|
||||||
COMMAND ragel -p -G2 -o lexer.cpp "${CMAKE_CURRENT_SOURCE_DIR}/lexer.rl"
|
COMMAND "${RAGEL}" -p -G2 -o lexer.cpp "${CMAKE_CURRENT_SOURCE_DIR}/lexer.rl"
|
||||||
MAIN_DEPENDENCY lexer.rl
|
MAIN_DEPENDENCY lexer.rl
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ if (LEMON)
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/parser.cpp ${CMAKE_CURRENT_SOURCE_DIR}/parser.h
|
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/parser.cpp ${CMAKE_CURRENT_SOURCE_DIR}/parser.h
|
||||||
# COMMAND cp -f "${CMAKE_CURRENT_SOURCE_DIR}/parser.lemon" "parser.lemon"
|
# COMMAND cp -f "${CMAKE_CURRENT_SOURCE_DIR}/parser.lemon" "parser.lemon"
|
||||||
COMMAND lemon parser.lemon
|
COMMAND ${LEMON} parser.lemon
|
||||||
COMMAND mv -f parser.c parser.cpp
|
COMMAND mv -f parser.c parser.cpp
|
||||||
MAIN_DEPENDENCY parser.lemon
|
MAIN_DEPENDENCY parser.lemon
|
||||||
DEPENDS debugger.h
|
DEPENDS debugger.h
|
||||||
|
@ -30,7 +30,7 @@ if (LEMON)
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/template_parser.cpp ${CMAKE_CURRENT_SOURCE_DIR}/template_parser.h
|
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/template_parser.cpp ${CMAKE_CURRENT_SOURCE_DIR}/template_parser.h
|
||||||
# COMMAND cp -f "${CMAKE_CURRENT_SOURCE_DIR}/template_parser.lemon" "template_parser.lemon"
|
# COMMAND cp -f "${CMAKE_CURRENT_SOURCE_DIR}/template_parser.lemon" "template_parser.lemon"
|
||||||
COMMAND lemon template_parser.lemon
|
COMMAND ${LEMON} template_parser.lemon
|
||||||
COMMAND mv -f template_parser.c template_parser.cpp
|
COMMAND mv -f template_parser.c template_parser.cpp
|
||||||
MAIN_DEPENDENCY template_parser.lemon
|
MAIN_DEPENDENCY template_parser.lemon
|
||||||
DEPENDS debugger.h
|
DEPENDS debugger.h
|
||||||
|
@ -41,7 +41,7 @@ endif()
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT loadtrap.cpp
|
OUTPUT loadtrap.cpp
|
||||||
COMMAND ragel -p -G2 -o loadtrap.cpp "${CMAKE_CURRENT_SOURCE_DIR}/loadtrap.rl"
|
COMMAND "${RAGEL}" -p -G2 -o loadtrap.cpp "${CMAKE_CURRENT_SOURCE_DIR}/loadtrap.rl"
|
||||||
MAIN_DEPENDENCY loadtrap.rl
|
MAIN_DEPENDENCY loadtrap.rl
|
||||||
DEPENDS debugger.h
|
DEPENDS debugger.h
|
||||||
)
|
)
|
||||||
|
@ -49,7 +49,7 @@ add_custom_command(
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT template_loader.cpp
|
OUTPUT template_loader.cpp
|
||||||
COMMAND ragel -p -G2 -o template_loader.cpp "${CMAKE_CURRENT_SOURCE_DIR}/template_loader.rl"
|
COMMAND "${RAGEL}" -p -G2 -o template_loader.cpp "${CMAKE_CURRENT_SOURCE_DIR}/template_loader.rl"
|
||||||
MAIN_DEPENDENCY template_loader.rl
|
MAIN_DEPENDENCY template_loader.rl
|
||||||
DEPENDS debugger.h template_parser.h
|
DEPENDS debugger.h template_parser.h
|
||||||
)
|
)
|
||||||
|
|
|
@ -1135,6 +1135,8 @@ namespace {
|
||||||
{
|
{
|
||||||
std::string s(text);
|
std::string s(text);
|
||||||
|
|
||||||
|
rl_attempted_completion_over = 1; // suppress filename completion if no results.
|
||||||
|
|
||||||
// returns iter to first element _not less_ than key
|
// returns iter to first element _not less_ than key
|
||||||
// ie, >= key.
|
// ie, >= key.
|
||||||
auto iter = SymbolTable.lower_bound(s);
|
auto iter = SymbolTable.lower_bound(s);
|
||||||
|
@ -1213,19 +1215,11 @@ namespace {
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
// this is here to prevent filename tab completion, for now.
|
|
||||||
// state is 0 for first call, non-zero for subsequent calls. It
|
|
||||||
// should return 1 match per invocation, NULL if no more matches.
|
|
||||||
char *mpw_completion_entry_function(const char *text, int state)
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void readline_init()
|
void readline_init()
|
||||||
{
|
{
|
||||||
rl_readline_name = (char *)"mpw";
|
rl_readline_name = (char *)"mpw";
|
||||||
rl_attempted_completion_function = mpw_attempted_completion_function;
|
rl_attempted_completion_function = mpw_attempted_completion_function;
|
||||||
rl_completion_entry_function = (Function *)mpw_completion_entry_function;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -957,10 +957,19 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
#ifdef LOADER_LOAD
|
#ifdef LOADER_LOAD
|
||||||
uint16_t err = Loader::Native::LoadFile(command);
|
uint16_t err = Loader::Native::LoadFile(command);
|
||||||
if (err) exit(EX_CONFIG);
|
if (err) {
|
||||||
|
const char *cp = ErrorName(err);
|
||||||
|
fprintf(stderr, "Unable to load command %s: ", command.c_str());
|
||||||
|
if (cp) printf("%s\n", cp);
|
||||||
|
else printf("%hd\n", err);
|
||||||
|
exit(EX_SOFTWARE);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
uint32_t address = load(command.c_str());
|
uint32_t address = load(command.c_str());
|
||||||
if (!address) exit(EX_CONFIG);
|
if (!address) {
|
||||||
|
fprintf(stderr, "Unable to load command %s\n", command.c_str());
|
||||||
|
exit(EX_SOFTWARE);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
GlobalInit();
|
GlobalInit();
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
**
|
**
|
||||||
** The "lemon" program processes an LALR(1) input grammar file, then uses
|
** The "lemon" program processes an LALR(1) input grammar file, then uses
|
||||||
** this template to construct a parser. The "lemon" program inserts text
|
** this template to construct a parser. The "lemon" program inserts text
|
||||||
** at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the
|
** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the
|
||||||
** interstitial "-" characters) contained in this template is changed into
|
** interstitial "-" characters) contained in this template is changed into
|
||||||
** the value of the %name directive from the grammar. Otherwise, the content
|
** the value of the %name directive from the grammar. Otherwise, the content
|
||||||
** of this template is copied straight through into the generate parser
|
** of this template is copied straight through into the generate parser
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
**
|
**
|
||||||
** The "lemon" program processes an LALR(1) input grammar file, then uses
|
** The "lemon" program processes an LALR(1) input grammar file, then uses
|
||||||
** this template to construct a parser. The "lemon" program inserts text
|
** this template to construct a parser. The "lemon" program inserts text
|
||||||
** at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the
|
** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the
|
||||||
** interstitial "-" characters) contained in this template is changed into
|
** interstitial "-" characters) contained in this template is changed into
|
||||||
** the value of the %name directive from the grammar. Otherwise, the content
|
** the value of the %name directive from the grammar. Otherwise, the content
|
||||||
** of this template is copied straight through into the generate parser
|
** of this template is copied straight through into the generate parser
|
||||||
|
|
|
@ -3,6 +3,11 @@ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||||
set(CMAKE_CXX_FLAGS "-Wall -Wno-unused-function")
|
set(CMAKE_CXX_FLAGS "-Wall -Wno-unused-function")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if ("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
|
||||||
|
# Clang or AppleClang
|
||||||
|
set(CMAKE_C_FLAGS "-Wall -Wno-unused-function")
|
||||||
|
endif()
|
||||||
|
|
||||||
set(CPU_SRC
|
set(CPU_SRC
|
||||||
CpuModule.c
|
CpuModule.c
|
||||||
CpuModule_Disassembler.c
|
CpuModule_Disassembler.c
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
/* @(#) $Id: CpuIntegration.c,v 1.10 2013-01-08 19:17:33 peschau Exp $ */
|
|
||||||
/*=========================================================================*/
|
/*=========================================================================*/
|
||||||
/* Fellow */
|
/* Fellow */
|
||||||
/* Initialization of 68000 core */
|
/* Initialization of 68000 core */
|
||||||
/* Integrates the 68k emulation with custom chips */
|
/* Integrates the 68k emulation with custom chips */
|
||||||
/* */
|
/* */
|
||||||
/* Author: Petter Schau */
|
/* Author: Petter Schau */
|
||||||
/* */
|
/* */
|
||||||
|
@ -34,47 +33,47 @@
|
||||||
#include "interrupt.h"
|
#include "interrupt.h"
|
||||||
|
|
||||||
jmp_buf cpu_integration_exception_buffer;
|
jmp_buf cpu_integration_exception_buffer;
|
||||||
ULO cpu_integration_chip_interrupt_number;
|
uint32_t cpu_integration_chip_interrupt_number;
|
||||||
|
|
||||||
/* Cycles spent by chips (Blitter) as a result of an instruction */
|
/* Cycles spent by chips (Blitter) as a result of an instruction */
|
||||||
static ULO cpu_integration_chip_cycles;
|
static uint32_t cpu_integration_chip_cycles;
|
||||||
static ULO cpu_integration_chip_slowdown;
|
static uint32_t cpu_integration_chip_slowdown;
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* CPU properties */
|
/* CPU properties */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
ULO cpu_integration_speed; // The speed as expressed in the fellow configuration settings
|
uint32_t cpu_integration_speed; // The speed as expressed in the fellow configuration settings
|
||||||
ULO cpu_integration_speed_multiplier; // The cycle multiplier used to adjust the cpu-speed, calculated from cpu_integration_speed
|
uint32_t cpu_integration_speed_multiplier; // The cycle multiplier used to adjust the cpu-speed, calculated from cpu_integration_speed
|
||||||
cpu_integration_models cpu_integration_model; // The cpu model as expressed in the fellow configuration settings
|
cpu_integration_models cpu_integration_model; // The cpu model as expressed in the fellow configuration settings
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* CPU properties */
|
/* CPU properties */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
void cpuIntegrationSetSpeed(ULO speed)
|
void cpuIntegrationSetSpeed(uint32_t speed)
|
||||||
{
|
{
|
||||||
cpu_integration_speed = speed;
|
cpu_integration_speed = speed;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULO cpuIntegrationGetSpeed(void)
|
uint32_t cpuIntegrationGetSpeed(void)
|
||||||
{
|
{
|
||||||
return cpu_integration_speed;
|
return cpu_integration_speed;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cpuIntegrationSetSpeedMultiplier(ULO multiplier)
|
static void cpuIntegrationSetSpeedMultiplier(uint32_t multiplier)
|
||||||
{
|
{
|
||||||
cpu_integration_speed_multiplier = multiplier;
|
cpu_integration_speed_multiplier = multiplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULO cpuIntegrationGetSpeedMultiplier(void)
|
static uint32_t cpuIntegrationGetSpeedMultiplier(void)
|
||||||
{
|
{
|
||||||
return cpu_integration_speed_multiplier;
|
return cpu_integration_speed_multiplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpuIntegrationCalculateMultiplier(void)
|
void cpuIntegrationCalculateMultiplier(void)
|
||||||
{
|
{
|
||||||
ULO multiplier = 12;
|
uint32_t multiplier = 12;
|
||||||
|
|
||||||
switch (cpuGetModelMajor())
|
switch (cpuGetModelMajor())
|
||||||
{
|
{
|
||||||
|
@ -121,39 +120,39 @@ cpu_integration_models cpuIntegrationGetModel(void)
|
||||||
return cpu_integration_model;
|
return cpu_integration_model;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpuIntegrationSetChipCycles(ULO chip_cycles)
|
void cpuIntegrationSetChipCycles(uint32_t chip_cycles)
|
||||||
{
|
{
|
||||||
cpu_integration_chip_cycles = chip_cycles;
|
cpu_integration_chip_cycles = chip_cycles;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULO cpuIntegrationGetChipCycles(void)
|
uint32_t cpuIntegrationGetChipCycles(void)
|
||||||
{
|
{
|
||||||
return cpu_integration_chip_cycles;
|
return cpu_integration_chip_cycles;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpuIntegrationSetChipSlowdown(ULO chip_slowdown)
|
void cpuIntegrationSetChipSlowdown(uint32_t chip_slowdown)
|
||||||
{
|
{
|
||||||
cpu_integration_chip_slowdown = chip_slowdown;
|
cpu_integration_chip_slowdown = chip_slowdown;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULO cpuIntegrationGetChipSlowdown(void)
|
uint32_t cpuIntegrationGetChipSlowdown(void)
|
||||||
{
|
{
|
||||||
return cpu_integration_chip_slowdown;
|
return cpu_integration_chip_slowdown;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpuIntegrationSetChipInterruptNumber(ULO chip_interrupt_number)
|
void cpuIntegrationSetChipInterruptNumber(uint32_t chip_interrupt_number)
|
||||||
{
|
{
|
||||||
cpu_integration_chip_interrupt_number = chip_interrupt_number;
|
cpu_integration_chip_interrupt_number = chip_interrupt_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULO cpuIntegrationGetChipInterruptNumber(void)
|
uint32_t cpuIntegrationGetChipInterruptNumber(void)
|
||||||
{
|
{
|
||||||
return cpu_integration_chip_interrupt_number;
|
return cpu_integration_chip_interrupt_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
// A wrapper for cpuSetIrqLevel that restarts the
|
// A wrapper for cpuSetIrqLevel that restarts the
|
||||||
// scheduling of cpu events if the cpu was stoppped
|
// scheduling of cpu events if the cpu was stoppped
|
||||||
void cpuIntegrationSetIrqLevel(ULO new_interrupt_level, ULO chip_interrupt_number)
|
void cpuIntegrationSetIrqLevel(uint32_t new_interrupt_level, uint32_t chip_interrupt_number)
|
||||||
{
|
{
|
||||||
if (cpuSetIrqLevel(new_interrupt_level))
|
if (cpuSetIrqLevel(new_interrupt_level))
|
||||||
{
|
{
|
||||||
|
@ -241,7 +240,7 @@ void cpuIntegrationInstructionLogging(void)
|
||||||
fprintf(CPUINSTRUCTIONLOG, "SSP:%.6X USP:%.6X SP:%.4X %s %s\t%s\t%s\n", cpuGetSspDirect(), cpuGetUspDirect(), cpuGetSR(), saddress, sdata, sinstruction, soperands);
|
fprintf(CPUINSTRUCTIONLOG, "SSP:%.6X USP:%.6X SP:%.4X %s %s\t%s\t%s\n", cpuGetSspDirect(), cpuGetUspDirect(), cpuGetSR(), saddress, sdata, sinstruction, soperands);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpuIntegrationExceptionLogging(STR *description, ULO original_pc, UWO opcode)
|
void cpuIntegrationExceptionLogging(char *description, uint32_t original_pc, uint16_t opcode)
|
||||||
{
|
{
|
||||||
if (cpu_disable_instruction_log) return;
|
if (cpu_disable_instruction_log) return;
|
||||||
cpuInstructionLogOpen();
|
cpuInstructionLogOpen();
|
||||||
|
@ -250,7 +249,7 @@ void cpuIntegrationExceptionLogging(STR *description, ULO original_pc, UWO opcod
|
||||||
fprintf(CPUINSTRUCTIONLOG, "%s for opcode %.4X at PC %.8X from PC %.8X\n", description, opcode, original_pc, cpuGetPC());
|
fprintf(CPUINSTRUCTIONLOG, "%s for opcode %.4X at PC %.8X from PC %.8X\n", description, opcode, original_pc, cpuGetPC());
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpuIntegrationInterruptLogging(ULO level, ULO vector_address)
|
void cpuIntegrationInterruptLogging(uint32_t level, uint32_t vector_address)
|
||||||
{
|
{
|
||||||
if (cpu_disable_instruction_log) return;
|
if (cpu_disable_instruction_log) return;
|
||||||
cpuInstructionLogOpen();
|
cpuInstructionLogOpen();
|
||||||
|
@ -263,8 +262,7 @@ void cpuIntegrationInterruptLogging(ULO level, ULO vector_address)
|
||||||
|
|
||||||
void cpuIntegrationExecuteInstructionEventHandler68000Fast(void)
|
void cpuIntegrationExecuteInstructionEventHandler68000Fast(void)
|
||||||
{
|
{
|
||||||
ULO cycles;
|
uint32_t cycles = cpuExecuteInstruction();
|
||||||
cycles = cpuExecuteInstruction();
|
|
||||||
|
|
||||||
if (cpuGetStop())
|
if (cpuGetStop())
|
||||||
{
|
{
|
||||||
|
@ -279,8 +277,8 @@ void cpuIntegrationExecuteInstructionEventHandler68000Fast(void)
|
||||||
|
|
||||||
void cpuIntegrationExecuteInstructionEventHandler68000General(void)
|
void cpuIntegrationExecuteInstructionEventHandler68000General(void)
|
||||||
{
|
{
|
||||||
ULO cycles = 0;
|
uint32_t cycles = 0;
|
||||||
ULO time_used = 0;
|
uint32_t time_used = 0;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
@ -303,7 +301,7 @@ void cpuIntegrationExecuteInstructionEventHandler68000General(void)
|
||||||
|
|
||||||
void cpuIntegrationExecuteInstructionEventHandler68020(void)
|
void cpuIntegrationExecuteInstructionEventHandler68020(void)
|
||||||
{
|
{
|
||||||
ULO time_used = 0;
|
uint32_t time_used = 0;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
cpuExecuteInstruction();
|
cpuExecuteInstruction();
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#ifndef CpuIntegration_H
|
#pragma once
|
||||||
#define CpuIntegration_H
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -16,25 +15,23 @@ typedef enum {
|
||||||
|
|
||||||
extern void cpuIntegrationCalculateMultiplier(void);
|
extern void cpuIntegrationCalculateMultiplier(void);
|
||||||
|
|
||||||
extern void cpuIntegrationSetUpInterruptEventHandler(void);
|
|
||||||
extern void cpuIntegrationExecuteInstructionEventHandler68000Fast(void);
|
extern void cpuIntegrationExecuteInstructionEventHandler68000Fast(void);
|
||||||
extern void cpuIntegrationExecuteInstructionEventHandler68000General(void);
|
extern void cpuIntegrationExecuteInstructionEventHandler68000General(void);
|
||||||
extern void cpuIntegrationExecuteInstructionEventHandler68020(void);
|
extern void cpuIntegrationExecuteInstructionEventHandler68020(void);
|
||||||
extern void cpuIntegrationCheckPendingInterrupts(void);
|
extern uint32_t cpuIntegrationDisOpcode(uint32_t disasm_pc, char *saddress, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuIntegrationDisOpcode(ULO disasm_pc, STR *saddress, STR *sdata, STR *sinstruction, STR *soperands);
|
|
||||||
|
|
||||||
extern BOOLE cpuIntegrationSetModel(cpu_integration_models model);
|
extern BOOLE cpuIntegrationSetModel(cpu_integration_models model);
|
||||||
extern cpu_integration_models cpuIntegrationGetModel(void);
|
extern cpu_integration_models cpuIntegrationGetModel(void);
|
||||||
extern ULO cpuIntegrationGetModelMajor(void);
|
extern uint32_t cpuIntegrationGetModelMajor(void);
|
||||||
extern ULO cpuIntegrationGetPC(void);
|
|
||||||
|
|
||||||
extern ULO cpuIntegrationGetInstructionTime(void);
|
void cpuIntegrationSetIrqLevel(uint32_t new_interrupt_level, uint32_t chip_interrupt_number);
|
||||||
extern void cpuIntegrationSetSpeed(ULO speed);
|
extern uint32_t cpuIntegrationGetInstructionTime(void);
|
||||||
extern ULO cpuIntegrationGetSpeed(void);
|
extern void cpuIntegrationSetSpeed(uint32_t speed);
|
||||||
extern void cpuIntegrationSetChipCycles(ULO chip_cycles);
|
extern uint32_t cpuIntegrationGetSpeed(void);
|
||||||
extern ULO cpuIntegrationGetChipCycles(void);
|
extern void cpuIntegrationSetChipCycles(uint32_t chip_cycles);
|
||||||
extern void cpuIntegrationSetChipSlowdown(ULO chip_slowdown);
|
extern uint32_t cpuIntegrationGetChipCycles(void);
|
||||||
extern ULO cpuIntegrationGetChipSlowdown(void);
|
extern void cpuIntegrationSetChipSlowdown(uint32_t chip_slowdown);
|
||||||
|
extern uint32_t cpuIntegrationGetChipSlowdown(void);
|
||||||
|
|
||||||
extern jmp_buf cpu_integration_exception_buffer;
|
extern jmp_buf cpu_integration_exception_buffer;
|
||||||
|
|
||||||
|
@ -50,5 +47,3 @@ extern void cpuIntegrationShutdown(void);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
/* @(#) $Id: CpuModule.c,v 1.7 2012-08-12 16:51:02 peschau Exp $ */
|
|
||||||
/*=========================================================================*/
|
/*=========================================================================*/
|
||||||
/* Fellow */
|
/* Fellow */
|
||||||
/* Initialization of 68000 core */
|
/* Initialization of 68000 core */
|
||||||
|
@ -29,10 +28,8 @@
|
||||||
|
|
||||||
void cpuClearEverything(void)
|
void cpuClearEverything(void)
|
||||||
{
|
{
|
||||||
ULO i,j;
|
for (uint32_t j = 0; j < 2; j++)
|
||||||
|
for (uint32_t i = 0; i < 8; i++)
|
||||||
for (j = 0; j < 2; j++)
|
|
||||||
for (i = 0; i < 8; i++)
|
|
||||||
cpuSetReg(j, i, 0);
|
cpuSetReg(j, i, 0);
|
||||||
|
|
||||||
cpuSetUspDirect(0);
|
cpuSetUspDirect(0);
|
||||||
|
@ -47,7 +44,6 @@ void cpuClearEverything(void)
|
||||||
cpuSetSfc(0);
|
cpuSetSfc(0);
|
||||||
cpuSetDfc(0);
|
cpuSetDfc(0);
|
||||||
cpuSetIrqLevel(0);
|
cpuSetIrqLevel(0);
|
||||||
cpuSetRaiseInterrupt(FALSE);
|
|
||||||
cpuSetStop(FALSE);
|
cpuSetStop(FALSE);
|
||||||
cpuSetInstructionTime(0);
|
cpuSetInstructionTime(0);
|
||||||
cpuSetOriginalPC(0);
|
cpuSetOriginalPC(0);
|
||||||
|
|
|
@ -1,87 +1,88 @@
|
||||||
#ifndef CpuModule_H
|
#pragma once
|
||||||
#define CpuModule_H
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// This header file defines the internal interfaces of the CPU module.
|
||||||
|
|
||||||
|
// MPW additions.
|
||||||
typedef void (*cpuLineExceptionFunc)(uint16_t);
|
typedef void (*cpuLineExceptionFunc)(uint16_t);
|
||||||
extern void cpuSetALineExceptionFunc(cpuLineExceptionFunc func);
|
extern void cpuSetALineExceptionFunc(cpuLineExceptionFunc func);
|
||||||
extern void cpuSetFLineExceptionFunc(cpuLineExceptionFunc func);
|
extern void cpuSetFLineExceptionFunc(cpuLineExceptionFunc func);
|
||||||
|
|
||||||
// This header file defines the internal interfaces of the CPU module.
|
|
||||||
|
|
||||||
//#define CPU_INSTRUCTION_LOGGING
|
|
||||||
|
|
||||||
// Function to check if there are any external interrupt sources wanting to issue interrupts
|
|
||||||
typedef BOOLE (*cpuCheckPendingInterruptsFunc)(void);
|
|
||||||
extern void cpuSetCheckPendingInterruptsFunc(cpuCheckPendingInterruptsFunc func);
|
|
||||||
extern void cpuCheckPendingInterrupts(void);
|
|
||||||
extern void cpuSetUpInterrupt(ULO new_interrupt_level);
|
|
||||||
extern void cpuInitializeFromNewPC(ULO new_pc);
|
|
||||||
|
|
||||||
|
|
||||||
typedef void (*memoryLoggingFunc)(uint32_t address, int size, int readWrite, uint32_t value);
|
typedef void (*memoryLoggingFunc)(uint32_t address, int size, int readWrite, uint32_t value);
|
||||||
extern void memorySetLoggingFunc(memoryLoggingFunc func);
|
extern void memorySetLoggingFunc(memoryLoggingFunc func);
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#define CPU_INSTRUCTION_LOGGING
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Function to check if there are any external interrupt sources wanting to issue interrupts
|
||||||
|
typedef void (*cpuCheckPendingInterruptsFunc)(void);
|
||||||
|
extern void cpuSetCheckPendingInterruptsFunc(cpuCheckPendingInterruptsFunc func);
|
||||||
|
extern void cpuCheckPendingInterrupts(void);
|
||||||
|
extern void cpuSetUpInterrupt(uint32_t new_interrupt_level);
|
||||||
|
extern void cpuInitializeFromNewPC(uint32_t new_pc);
|
||||||
|
|
||||||
// Logging interface
|
// Logging interface
|
||||||
#ifdef CPU_INSTRUCTION_LOGGING
|
#ifdef CPU_INSTRUCTION_LOGGING
|
||||||
|
|
||||||
typedef void (*cpuInstructionLoggingFunc)(void);
|
typedef void (*cpuInstructionLoggingFunc)(void);
|
||||||
extern void cpuSetInstructionLoggingFunc(cpuInstructionLoggingFunc func);
|
extern void cpuSetInstructionLoggingFunc(cpuInstructionLoggingFunc func);
|
||||||
typedef void (*cpuExceptionLoggingFunc)(STR *description, ULO original_pc, UWO opcode);
|
typedef void (*cpuExceptionLoggingFunc)(char *description, uint32_t original_pc, uint16_t opcode);
|
||||||
extern void cpuSetExceptionLoggingFunc(cpuExceptionLoggingFunc func);
|
extern void cpuSetExceptionLoggingFunc(cpuExceptionLoggingFunc func);
|
||||||
typedef void (*cpuInterruptLoggingFunc)(ULO level, ULO vector_address);
|
typedef void (*cpuInterruptLoggingFunc)(uint32_t level, uint32_t vector_address);
|
||||||
extern void cpuSetInterruptLoggingFunc(cpuInterruptLoggingFunc func);
|
extern void cpuSetInterruptLoggingFunc(cpuInterruptLoggingFunc func);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// CPU register and control properties
|
// CPU register and control properties
|
||||||
extern void cpuSetPC(ULO pc);
|
extern void cpuSetPC(uint32_t pc);
|
||||||
extern ULO cpuGetPC(void);
|
extern uint32_t cpuGetPC(void);
|
||||||
|
|
||||||
extern void cpuSetReg(ULO da, ULO i, ULO value);
|
extern void cpuSetReg(uint32_t da, uint32_t i, uint32_t value);
|
||||||
extern ULO cpuGetReg(ULO da, ULO i);
|
extern uint32_t cpuGetReg(uint32_t da, uint32_t i);
|
||||||
|
|
||||||
extern void cpuSetDReg(ULO i, ULO value);
|
extern void cpuSetDReg(uint32_t i, uint32_t value);
|
||||||
extern ULO cpuGetDReg(ULO i);
|
extern uint32_t cpuGetDReg(uint32_t i);
|
||||||
|
|
||||||
extern void cpuSetAReg(ULO i, ULO value);
|
extern void cpuSetAReg(uint32_t i, uint32_t value);
|
||||||
extern ULO cpuGetAReg(ULO i);
|
extern uint32_t cpuGetAReg(uint32_t i);
|
||||||
|
|
||||||
extern void cpuSetSR(ULO sr);
|
extern void cpuSetSR(uint32_t sr);
|
||||||
extern ULO cpuGetSR(void);
|
extern uint32_t cpuGetSR(void);
|
||||||
|
|
||||||
extern void cpuSetUspDirect(ULO usp);
|
extern void cpuSetUspDirect(uint32_t usp);
|
||||||
extern ULO cpuGetUspDirect(void);
|
extern uint32_t cpuGetUspDirect(void);
|
||||||
extern ULO cpuGetUspAutoMap(void);
|
extern uint32_t cpuGetUspAutoMap(void);
|
||||||
|
|
||||||
extern void cpuSetMspDirect(ULO msp);
|
extern void cpuSetMspDirect(uint32_t msp);
|
||||||
extern ULO cpuGetMspDirect(void);
|
extern uint32_t cpuGetMspDirect(void);
|
||||||
|
|
||||||
extern void cpuSetSspDirect(ULO ssp);
|
extern void cpuSetSspDirect(uint32_t ssp);
|
||||||
extern ULO cpuGetSspDirect(void);
|
extern uint32_t cpuGetSspDirect(void);
|
||||||
extern ULO cpuGetSspAutoMap(void);
|
extern uint32_t cpuGetSspAutoMap(void);
|
||||||
|
|
||||||
extern ULO cpuGetVbr(void);
|
extern uint32_t cpuGetVbr(void);
|
||||||
|
|
||||||
extern void cpuSetStop(BOOLE stop);
|
extern void cpuSetStop(BOOLE stop);
|
||||||
extern BOOLE cpuGetStop(void);
|
extern BOOLE cpuGetStop(void);
|
||||||
|
|
||||||
extern void cpuSetInitialPC(ULO pc);
|
extern void cpuSetInitialPC(uint32_t pc);
|
||||||
extern ULO cpuGetInitialPC(void);
|
extern uint32_t cpuGetInitialPC(void);
|
||||||
|
|
||||||
extern void cpuSetInitialSP(ULO sp);
|
extern void cpuSetInitialSP(uint32_t sp);
|
||||||
extern ULO cpuGetInitialSP(void);
|
extern uint32_t cpuGetInitialSP(void);
|
||||||
|
|
||||||
extern ULO cpuGetInstructionTime(void);
|
extern uint32_t cpuGetInstructionTime(void);
|
||||||
|
|
||||||
extern BOOLE cpuSetIrqLevel(ULO irq_level);
|
extern BOOLE cpuSetIrqLevel(uint32_t irq_level);
|
||||||
extern ULO cpuGetIrqLevel(void);
|
extern uint32_t cpuGetIrqLevel(void);
|
||||||
|
|
||||||
extern ULO cpuExecuteInstruction(void);
|
extern uint32_t cpuExecuteInstruction(void);
|
||||||
extern ULO cpuDisOpcode(ULO disasm_pc, STR *saddress, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisOpcode(uint32_t disasm_pc, char *saddress, char *sdata, char *sinstruction, char *soperands);
|
||||||
|
|
||||||
extern void cpuSaveState(FILE *F);
|
extern void cpuSaveState(FILE *F);
|
||||||
extern void cpuLoadState(FILE *F);
|
extern void cpuLoadState(FILE *F);
|
||||||
|
@ -96,12 +97,10 @@ typedef void (*cpuResetExceptionFunc)(void);
|
||||||
extern void cpuSetResetExceptionFunc(cpuResetExceptionFunc func);
|
extern void cpuSetResetExceptionFunc(cpuResetExceptionFunc func);
|
||||||
|
|
||||||
// Configuration settings
|
// Configuration settings
|
||||||
extern void cpuSetModel(ULO major, ULO minor);
|
extern void cpuSetModel(uint32_t major, uint32_t minor);
|
||||||
extern ULO cpuGetModelMajor(void);
|
extern uint32_t cpuGetModelMajor(void);
|
||||||
extern ULO cpuGetModelMinor(void);
|
extern uint32_t cpuGetModelMinor(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
10379
cpu/CpuModule_Code.h
10379
cpu/CpuModule_Code.h
File diff suppressed because it is too large
Load Diff
2609
cpu/CpuModule_Data.h
2609
cpu/CpuModule_Data.h
File diff suppressed because it is too large
Load Diff
3358
cpu/CpuModule_Decl.h
3358
cpu/CpuModule_Decl.h
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,105 +1,102 @@
|
||||||
#ifndef CPUMODULE_DISASSEMBLER_H
|
#pragma once
|
||||||
#define CPUMODULE_DISASSEMBLER_H
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern ULO cpuDisOpcode(ULO disasm_pc, STR *saddress, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisOpcode(uint32_t disasm_pc, char *saddress, char *sdata, char *sinstruction, char *soperands);
|
||||||
|
|
||||||
extern ULO cpuDisIllegal(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisIllegal(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisAbcd(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisAbcd(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisAdd(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisAdd(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisAdda(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisAdda(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisAddi(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisAddi(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisAddq(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisAddq(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisAddx(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisAddx(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisAnd(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisAnd(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisAndi(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisAndi(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisAsx(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisAsx(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisBcc(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisBcc(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisBt(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisBt(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisChk(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisChk(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisClr(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisClr(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisCmp(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisCmp(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisCmpa(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisCmpa(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisCmpi(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisCmpi(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisCmpm(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisCmpm(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisDBcc(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisDBcc(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisDivs(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisDivs(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisDivu(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisDivu(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisEor(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisEor(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisEori(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisEori(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisExg(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisExg(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisExt(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisExt(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisJmp(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisJmp(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisJsr(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisJsr(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisLea(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisLea(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisLink(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisLink(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisLsx(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisLsx(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisMove(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisMove(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisMoveToCcr(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisMoveToCcr(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisMoveToSr(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisMoveToSr(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisMoveFromSr(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisMoveFromSr(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisMoveUsp(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisMoveUsp(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisMovea(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisMovea(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisMovem(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisMovem(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisMovep(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisMovep(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisMoveq(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisMoveq(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisMuls(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisMuls(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisMulu(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisMulu(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisNbcd(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisNbcd(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisNeg(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisNeg(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisNegx(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisNegx(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisNop(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisNop(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisNot(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisNot(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisOr(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisOr(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisOri(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisOri(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisPea(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisPea(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisReset(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisReset(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisRox(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisRox(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisRoxx(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisRoxx(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisRte(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisRte(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisRtr(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisRtr(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisRts(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisRts(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisSbcd(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisSbcd(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisScc(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisScc(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisStop(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisStop(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisSub(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisSub(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisSuba(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisSuba(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisSubi(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisSubi(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisSubq(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisSubq(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisSubx(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisSubx(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisSwap(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisSwap(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisTas(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisTas(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisTrap(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisTrap(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisTrapv(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisTrapv(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisTst(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisTst(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisUnlk(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisUnlk(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisBkpt(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisBkpt(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisBf(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisBf(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisCas(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisCas(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisChkl(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisChkl(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisChk2(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisChk2(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisDivl(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisDivl(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisExtb(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisExtb(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisLinkl(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisLinkl(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisMoveFromCcr(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisMoveFromCcr(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisMovec(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisMovec(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisMoves(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisMoves(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisMull(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisMull(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisPack(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisPack(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisPflush030(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisPflush030(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisPflush040(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisPflush040(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisPtest040(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisPtest040(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisRtd(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisRtd(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisTrapcc(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisTrapcc(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisUnpk(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisUnpk(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisCallm(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisCallm(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
extern ULO cpuDisRtm(ULO prc, ULO opc, STR *sdata, STR *sinstruction, STR *soperands);
|
extern uint32_t cpuDisRtm(uint32_t prc, uint32_t opc, char *sdata, char *sinstruction, char *soperands);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#ifndef CPUMODULE_DISASSEMBLERFUNC_H
|
#pragma once
|
||||||
#define CPUMODULE_DISASSEMBLERFUNC_H
|
|
||||||
|
|
||||||
static UBY cpu_dis_func_tab[65536] =
|
static uint8_t cpu_dis_func_tab[65536] =
|
||||||
{
|
{
|
||||||
60,60,60,60,60,60,60,60,0,0,0,0,0,0,0,0,
|
60,60,60,60,60,60,60,60,0,0,0,0,0,0,0,0,
|
||||||
60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,
|
60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,
|
||||||
|
@ -259,7 +258,7 @@ static UBY cpu_dis_func_tab[65536] =
|
||||||
11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
|
11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
|
||||||
11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
|
11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
|
||||||
11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,
|
11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
|
@ -267,31 +266,31 @@ static UBY cpu_dis_func_tab[65536] =
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
|
@ -299,31 +298,31 @@ static UBY cpu_dis_func_tab[65536] =
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
|
@ -331,23 +330,23 @@ static UBY cpu_dis_func_tab[65536] =
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
|
@ -355,7 +354,7 @@ static UBY cpu_dis_func_tab[65536] =
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
|
@ -363,23 +362,23 @@ static UBY cpu_dis_func_tab[65536] =
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
|
@ -387,7 +386,7 @@ static UBY cpu_dis_func_tab[65536] =
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
|
@ -395,23 +394,23 @@ static UBY cpu_dis_func_tab[65536] =
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
|
@ -419,7 +418,7 @@ static UBY cpu_dis_func_tab[65536] =
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
|
@ -427,23 +426,23 @@ static UBY cpu_dis_func_tab[65536] =
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
|
@ -451,7 +450,7 @@ static UBY cpu_dis_func_tab[65536] =
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
|
@ -459,23 +458,23 @@ static UBY cpu_dis_func_tab[65536] =
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
|
@ -483,7 +482,7 @@ static UBY cpu_dis_func_tab[65536] =
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
|
@ -491,23 +490,23 @@ static UBY cpu_dis_func_tab[65536] =
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,0,0,0,0,0,0,0,0,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,
|
||||||
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
39,39,39,39,39,39,39,39,39,39,39,39,39,0,0,0,
|
||||||
|
@ -4100,4 +4099,3 @@ static UBY cpu_dis_func_tab[65536] =
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
/* @(#) $Id: CpuModule_EffectiveAddress.c,v 1.3 2012-07-15 22:20:35 peschau Exp $ */
|
|
||||||
/*=========================================================================*/
|
/*=========================================================================*/
|
||||||
/* Fellow */
|
/* Fellow */
|
||||||
/* CPU 68k effective address calculation functions */
|
/* CPU 68k effective address calculation functions */
|
||||||
|
@ -30,22 +29,22 @@
|
||||||
#include "CpuModule_Internal.h"
|
#include "CpuModule_Internal.h"
|
||||||
|
|
||||||
/* Calculates EA for (Ax). */
|
/* Calculates EA for (Ax). */
|
||||||
ULO cpuEA02(ULO regno)
|
uint32_t cpuEA02(uint32_t regno)
|
||||||
{
|
{
|
||||||
return cpuGetAReg(regno);
|
return cpuGetAReg(regno);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Calculates EA for (Ax)+ */
|
/* Calculates EA for (Ax)+ */
|
||||||
ULO cpuEA03(ULO regno, ULO size)
|
uint32_t cpuEA03(uint32_t regno, uint32_t size)
|
||||||
{
|
{
|
||||||
ULO tmp = cpuGetAReg(regno);
|
uint32_t tmp = cpuGetAReg(regno);
|
||||||
if (regno == 7 && size == 1) size++;
|
if (regno == 7 && size == 1) size++;
|
||||||
cpuSetAReg(regno, tmp + size);
|
cpuSetAReg(regno, tmp + size);
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Calculates EA for -(Ax) */
|
/* Calculates EA for -(Ax) */
|
||||||
ULO cpuEA04(ULO regno, ULO size)
|
uint32_t cpuEA04(uint32_t regno, uint32_t size)
|
||||||
{
|
{
|
||||||
if (regno == 7 && size == 1) size++;
|
if (regno == 7 && size == 1) size++;
|
||||||
cpuSetAReg(regno, cpuGetAReg(regno) - size);
|
cpuSetAReg(regno, cpuGetAReg(regno) - size);
|
||||||
|
@ -53,20 +52,20 @@ ULO cpuEA04(ULO regno, ULO size)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Calculates EA for disp16(Ax) */
|
/* Calculates EA for disp16(Ax) */
|
||||||
ULO cpuEA05(ULO regno)
|
uint32_t cpuEA05(uint32_t regno)
|
||||||
{
|
{
|
||||||
return cpuGetAReg(regno) + cpuGetNextWordSignExt();
|
return cpuGetAReg(regno) + cpuGetNextWordSignExt();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Calculates EA for disp8(Ax,Ri.size) with 68020 extended modes. */
|
/* Calculates EA for disp8(Ax,Ri.size) with 68020 extended modes. */
|
||||||
static ULO cpuEA06Ext(UWO ext, ULO base_reg_value, ULO index_value)
|
static uint32_t cpuEA06Ext(uint16_t ext, uint32_t base_reg_value, uint32_t index_value)
|
||||||
{
|
{
|
||||||
ULO base_displacement;
|
uint32_t base_displacement;
|
||||||
ULO outer_displacement;
|
uint32_t outer_displacement;
|
||||||
BOOLE index_register_suppressed = (ext & 0x0040);
|
BOOLE index_register_suppressed = (ext & 0x0040);
|
||||||
BOOLE base_register_suppressed = (ext & 0x0080);
|
BOOLE base_register_suppressed = (ext & 0x0080);
|
||||||
ULO base_displacement_size = (ext >> 4) & 3;
|
uint32_t base_displacement_size = (ext >> 4) & 3;
|
||||||
ULO memory_indirect_action = (ext & 7);
|
uint32_t memory_indirect_action = (ext & 7);
|
||||||
|
|
||||||
if (memory_indirect_action == 4
|
if (memory_indirect_action == 4
|
||||||
|| (memory_indirect_action > 4 && index_register_suppressed))
|
|| (memory_indirect_action > 4 && index_register_suppressed))
|
||||||
|
@ -126,14 +125,14 @@ static ULO cpuEA06Ext(UWO ext, ULO base_reg_value, ULO index_value)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Calculates EA for disp8(Ax,Ri.size), calls cpuEA06Ext() for 68020 extended modes. */
|
/* Calculates EA for disp8(Ax,Ri.size), calls cpuEA06Ext() for 68020 extended modes. */
|
||||||
ULO cpuEA06(ULO regno)
|
uint32_t cpuEA06(uint32_t regno)
|
||||||
{
|
{
|
||||||
ULO reg_value = cpuGetAReg(regno);
|
uint32_t reg_value = cpuGetAReg(regno);
|
||||||
UWO ext = cpuGetNextWord();
|
uint16_t ext = cpuGetNextWord();
|
||||||
ULO index_value = cpuGetReg(ext >> 15, (ext >> 12) & 7);
|
uint32_t index_value = cpuGetReg(ext >> 15, (ext >> 12) & 7);
|
||||||
if (!(ext & 0x0800))
|
if (!(ext & 0x0800))
|
||||||
{
|
{
|
||||||
index_value = cpuSignExtWordToLong((UWO)index_value);
|
index_value = cpuSignExtWordToLong((uint16_t)index_value);
|
||||||
}
|
}
|
||||||
if (cpuGetModelMajor() >= 2)
|
if (cpuGetModelMajor() >= 2)
|
||||||
{
|
{
|
||||||
|
@ -143,17 +142,17 @@ ULO cpuEA06(ULO regno)
|
||||||
return cpuEA06Ext(ext, reg_value, index_value);
|
return cpuEA06Ext(ext, reg_value, index_value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return reg_value + index_value + cpuSignExtByteToLong((UBY)ext);
|
return reg_value + index_value + cpuSignExtByteToLong((uint8_t)ext);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Calculates EA for xxxx.W */
|
/* Calculates EA for xxxx.W */
|
||||||
ULO cpuEA70(void)
|
uint32_t cpuEA70()
|
||||||
{
|
{
|
||||||
return cpuGetNextWordSignExt();
|
return cpuGetNextWordSignExt();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Calculates EA for xxxxxxxx.L */
|
/* Calculates EA for xxxxxxxx.L */
|
||||||
ULO cpuEA71(void)
|
uint32_t cpuEA71()
|
||||||
{
|
{
|
||||||
return cpuGetNextLong();
|
return cpuGetNextLong();
|
||||||
}
|
}
|
||||||
|
@ -162,9 +161,9 @@ ULO cpuEA71(void)
|
||||||
/// Calculates EA for disp16(PC)
|
/// Calculates EA for disp16(PC)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>Address</returns>
|
/// <returns>Address</returns>
|
||||||
ULO cpuEA72(void)
|
uint32_t cpuEA72()
|
||||||
{
|
{
|
||||||
ULO pc_tmp = cpuGetPC();
|
uint32_t pc_tmp = cpuGetPC();
|
||||||
return pc_tmp + cpuGetNextWordSignExt();
|
return pc_tmp + cpuGetNextWordSignExt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,14 +171,14 @@ ULO cpuEA72(void)
|
||||||
/// Calculates EA for disp8(PC,Ri.size). Calls cpuEA06Ext() to calculate extended 68020 modes.
|
/// Calculates EA for disp8(PC,Ri.size). Calls cpuEA06Ext() to calculate extended 68020 modes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>Address</returns>
|
/// <returns>Address</returns>
|
||||||
ULO cpuEA73(void)
|
uint32_t cpuEA73()
|
||||||
{
|
{
|
||||||
ULO reg_value = cpuGetPC();
|
uint32_t reg_value = cpuGetPC();
|
||||||
UWO ext = cpuGetNextWord();
|
uint16_t ext = cpuGetNextWord();
|
||||||
ULO index_value = cpuGetReg(ext >> 15, (ext >> 12) & 0x7);
|
uint32_t index_value = cpuGetReg(ext >> 15, (ext >> 12) & 0x7);
|
||||||
if (!(ext & 0x0800))
|
if (!(ext & 0x0800))
|
||||||
{
|
{
|
||||||
index_value = cpuSignExtWordToLong((UWO)index_value);
|
index_value = cpuSignExtWordToLong((uint16_t)index_value);
|
||||||
}
|
}
|
||||||
if (cpuGetModelMajor() >= 2)
|
if (cpuGetModelMajor() >= 2)
|
||||||
{
|
{
|
||||||
|
@ -189,5 +188,5 @@ ULO cpuEA73(void)
|
||||||
return cpuEA06Ext(ext, reg_value, index_value);
|
return cpuEA06Ext(ext, reg_value, index_value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return reg_value + index_value + cpuSignExtByteToLong((UBY)ext);
|
return reg_value + index_value + cpuSignExtByteToLong((uint8_t)ext);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
/* @(#) $Id: CpuModule_Exceptions.c,v 1.5 2012-08-12 16:51:02 peschau Exp $ */
|
|
||||||
/*=========================================================================*/
|
/*=========================================================================*/
|
||||||
/* Fellow */
|
/* Fellow */
|
||||||
/* CPU 68k exception handling functions */
|
/* CPU 68k exception handling functions */
|
||||||
|
@ -29,6 +28,22 @@
|
||||||
#include "CpuModule.h"
|
#include "CpuModule.h"
|
||||||
#include "CpuModule_Internal.h"
|
#include "CpuModule_Internal.h"
|
||||||
|
|
||||||
|
|
||||||
|
// MPW
|
||||||
|
static cpuLineExceptionFunc cpu_a_line_exception_func = NULL;
|
||||||
|
static cpuLineExceptionFunc cpu_f_line_exception_func = NULL;
|
||||||
|
|
||||||
|
void cpuSetALineExceptionFunc(cpuLineExceptionFunc func)
|
||||||
|
{
|
||||||
|
cpu_a_line_exception_func = func;
|
||||||
|
}
|
||||||
|
|
||||||
|
void cpuSetFLineExceptionFunc(cpuLineExceptionFunc func)
|
||||||
|
{
|
||||||
|
cpu_f_line_exception_func = func;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Function for exiting from mid-instruction exceptions */
|
/* Function for exiting from mid-instruction exceptions */
|
||||||
static cpuMidInstructionExceptionFunc cpu_mid_instruction_exception_func;
|
static cpuMidInstructionExceptionFunc cpu_mid_instruction_exception_func;
|
||||||
|
|
||||||
|
@ -55,12 +70,12 @@ void cpuSetResetExceptionFunc(cpuResetExceptionFunc func)
|
||||||
cpu_reset_exception_func = func;
|
cpu_reset_exception_func = func;
|
||||||
}
|
}
|
||||||
|
|
||||||
static STR *cpuGetExceptionName(ULO vector_offset)
|
static char *cpuGetExceptionName(uint32_t vector_offset)
|
||||||
{
|
{
|
||||||
char *name;
|
char *name;
|
||||||
|
|
||||||
if (vector_offset == 0x8)
|
if (vector_offset == 0x8)
|
||||||
name = "Exception: 2 - Access fault";
|
name = "Exception: 2 - Bus error";
|
||||||
else if (vector_offset == 0xc)
|
else if (vector_offset == 0xc)
|
||||||
name = "Exception: 3 - Address error";
|
name = "Exception: 3 - Address error";
|
||||||
else if (vector_offset == 0x10)
|
else if (vector_offset == 0x10)
|
||||||
|
@ -106,9 +121,9 @@ void cpuExceptionFail(BOOLE executejmp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpuThrowException(ULO vector_offset, ULO pc, BOOLE executejmp)
|
void cpuThrowException(uint32_t vector_offset, uint32_t pc, BOOLE executejmp)
|
||||||
{
|
{
|
||||||
ULO vector_address;
|
uint32_t vector_address;
|
||||||
BOOLE is_address_error_on_sub_020 = (cpuGetModelMajor() < 2 && vector_offset == 0xc);
|
BOOLE is_address_error_on_sub_020 = (cpuGetModelMajor() < 2 && vector_offset == 0xc);
|
||||||
BOOLE stack_is_even = !(cpuGetAReg(7) & 1);
|
BOOLE stack_is_even = !(cpuGetAReg(7) & 1);
|
||||||
BOOLE vbr_is_even = !(cpuGetVbr() & 1);
|
BOOLE vbr_is_even = !(cpuGetVbr() & 1);
|
||||||
|
@ -133,7 +148,7 @@ void cpuThrowException(ULO vector_offset, ULO pc, BOOLE executejmp)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
cpuStackFrameGenerate((UWO) vector_offset, pc);
|
cpuStackFrameGenerate((uint16_t) vector_offset, pc);
|
||||||
|
|
||||||
// read a memory position
|
// read a memory position
|
||||||
vector_address = memoryReadLong(cpuGetVbr() + vector_offset);
|
vector_address = memoryReadLong(cpuGetVbr() + vector_offset);
|
||||||
|
@ -152,7 +167,40 @@ void cpuThrowException(ULO vector_offset, ULO pc, BOOLE executejmp)
|
||||||
cpuSetStop(FALSE);
|
cpuSetStop(FALSE);
|
||||||
|
|
||||||
cpuInitializeFromNewPC(vector_address);
|
cpuInitializeFromNewPC(vector_address);
|
||||||
cpuSetInstructionTime(40);
|
|
||||||
|
uint32_t exceptionCycles = 0;
|
||||||
|
|
||||||
|
switch (vector_offset)
|
||||||
|
{
|
||||||
|
case 0x08: exceptionCycles = 50; break; // Bus
|
||||||
|
case 0x0c: exceptionCycles = 50; break; // Address
|
||||||
|
case 0x10: exceptionCycles = 34; break; // Illegal
|
||||||
|
case 0x14: exceptionCycles = 42; break; // Division by zero
|
||||||
|
case 0x18: exceptionCycles = 28; break; // Chk
|
||||||
|
case 0x1c: exceptionCycles = 34; break; // Trapcc/trapv
|
||||||
|
case 0x20: exceptionCycles = 34; break; // Privilege
|
||||||
|
case 0x24: exceptionCycles = 34; break; // Trace
|
||||||
|
case 0x28: exceptionCycles = 34; break; // Line A
|
||||||
|
case 0x2c: exceptionCycles = 34; break; // Line F
|
||||||
|
case 0x80:
|
||||||
|
case 0x84:
|
||||||
|
case 0x88:
|
||||||
|
case 0x8c:
|
||||||
|
case 0x90:
|
||||||
|
case 0x94:
|
||||||
|
case 0x98:
|
||||||
|
case 0x9c:
|
||||||
|
case 0xa0:
|
||||||
|
case 0xa4:
|
||||||
|
case 0xa8:
|
||||||
|
case 0xac:
|
||||||
|
case 0xb0:
|
||||||
|
case 0xb4:
|
||||||
|
case 0xb8:
|
||||||
|
case 0xbc: exceptionCycles = 34; break; // TRAP
|
||||||
|
default: exceptionCycles = 4; break; // Should not come here
|
||||||
|
}
|
||||||
|
cpuSetInstructionTime(exceptionCycles);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the exception happened mid-instruction...
|
// If the exception happened mid-instruction...
|
||||||
|
@ -164,6 +212,7 @@ void cpuThrowException(ULO vector_offset, ULO pc, BOOLE executejmp)
|
||||||
|
|
||||||
void cpuThrowPrivilegeViolationException(void)
|
void cpuThrowPrivilegeViolationException(void)
|
||||||
{
|
{
|
||||||
|
cpuSetInstructionAborted(true);
|
||||||
// The saved pc points to the instruction causing the violation
|
// The saved pc points to the instruction causing the violation
|
||||||
// (And the kickstart excpects pc in the stack frame to be the opcode PC.)
|
// (And the kickstart excpects pc in the stack frame to be the opcode PC.)
|
||||||
cpuThrowException(0x20, cpuGetOriginalPC(), FALSE);
|
cpuThrowException(0x20, cpuGetOriginalPC(), FALSE);
|
||||||
|
@ -171,18 +220,48 @@ void cpuThrowPrivilegeViolationException(void)
|
||||||
|
|
||||||
void cpuThrowIllegalInstructionException(BOOLE executejmp)
|
void cpuThrowIllegalInstructionException(BOOLE executejmp)
|
||||||
{
|
{
|
||||||
|
cpuSetInstructionAborted(true);
|
||||||
// The saved pc points to the illegal instruction
|
// The saved pc points to the illegal instruction
|
||||||
cpuThrowException(0x10, cpuGetOriginalPC(), executejmp);
|
cpuThrowException(0x10, cpuGetOriginalPC(), executejmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cpuThrowIllegalInstructionExceptionFromBreakpoint(void)
|
||||||
|
{
|
||||||
|
cpuSetInstructionAborted(true);
|
||||||
|
// The saved pc points to the illegal instruction
|
||||||
|
cpuThrowException(0x10, cpuGetPC(), FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
void cpuThrowALineException(void)
|
void cpuThrowALineException(void)
|
||||||
{
|
{
|
||||||
|
// MPW
|
||||||
|
if (cpu_a_line_exception_func)
|
||||||
|
{
|
||||||
|
uint16_t opcode = memoryReadWord(cpuGetPC() - 2);
|
||||||
|
cpu_a_line_exception_func(opcode);
|
||||||
|
cpuInitializeFromNewPC(cpuGetPC());
|
||||||
|
cpuSetInstructionTime(512);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
cpuSetInstructionAborted(true);
|
||||||
// The saved pc points to the a-line instruction
|
// The saved pc points to the a-line instruction
|
||||||
cpuThrowException(0x28, cpuGetOriginalPC(), FALSE);
|
cpuThrowException(0x28, cpuGetOriginalPC(), FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpuThrowFLineException(void)
|
void cpuThrowFLineException(void)
|
||||||
{
|
{
|
||||||
|
// MPW
|
||||||
|
if (cpu_f_line_exception_func)
|
||||||
|
{
|
||||||
|
uint16_t opcode = memoryReadWord(cpuGetPC() - 2);
|
||||||
|
cpu_f_line_exception_func(opcode);
|
||||||
|
cpuInitializeFromNewPC(cpuGetPC());
|
||||||
|
cpuSetInstructionTime(512);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
cpuSetInstructionAborted(true);
|
||||||
// The saved pc points to the f-line instruction
|
// The saved pc points to the f-line instruction
|
||||||
cpuThrowException(0x2c, cpuGetOriginalPC(), FALSE);
|
cpuThrowException(0x2c, cpuGetOriginalPC(), FALSE);
|
||||||
}
|
}
|
||||||
|
@ -193,13 +272,13 @@ void cpuThrowTrapVException(void)
|
||||||
cpuThrowException(0x1c, cpuGetPC(), FALSE);
|
cpuThrowException(0x1c, cpuGetPC(), FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpuThrowDivisionByZeroException()
|
void cpuThrowDivisionByZeroException(void)
|
||||||
{
|
{
|
||||||
// The saved pc points to the next instruction, which is now in pc
|
// The saved pc points to the next instruction, which is now in pc
|
||||||
cpuThrowException(0x14, cpuGetPC(), FALSE);
|
cpuThrowException(0x14, cpuGetPC(), FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpuThrowTrapException(ULO vector_no)
|
void cpuThrowTrapException(uint32_t vector_no)
|
||||||
{
|
{
|
||||||
// The saved pc points to the next instruction, which is now in pc
|
// The saved pc points to the next instruction, which is now in pc
|
||||||
cpuThrowException(0x80 + vector_no*4, cpuGetPC(), FALSE);
|
cpuThrowException(0x80 + vector_no*4, cpuGetPC(), FALSE);
|
||||||
|
@ -219,6 +298,7 @@ void cpuThrowTraceException(void)
|
||||||
|
|
||||||
void cpuThrowAddressErrorException(void)
|
void cpuThrowAddressErrorException(void)
|
||||||
{
|
{
|
||||||
|
cpuSetInstructionAborted(true);
|
||||||
cpuThrowException(0xc, cpuGetPC() - 2, TRUE);
|
cpuThrowException(0xc, cpuGetPC() - 2, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
/* @(#) $Id: CpuModule_Flags.c,v 1.3 2011-07-18 17:22:55 peschau Exp $ */
|
|
||||||
/*=========================================================================*/
|
/*=========================================================================*/
|
||||||
/* Fellow */
|
/* Fellow */
|
||||||
/* 68000 flag and condition code handling */
|
/* 68000 flag and condition code handling */
|
||||||
|
@ -27,23 +26,23 @@
|
||||||
|
|
||||||
|
|
||||||
/// Sets the Z flag for bit operations
|
/// Sets the Z flag for bit operations
|
||||||
void cpuSetZFlagBitOpsB(UBY res)
|
void cpuSetZFlagBitOpsB(uint8_t res)
|
||||||
{
|
{
|
||||||
ULO flags = cpu_sr & 0xfffb;
|
uint32_t flags = cpu_sr & 0xfffb;
|
||||||
if (res == 0) flags |= 4;
|
if (res == 0) flags |= 4;
|
||||||
cpu_sr = flags;
|
cpu_sr = flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sets the Z flag for bit operations
|
/// Sets the Z flag for bit operations
|
||||||
void cpuSetZFlagBitOpsL(ULO res)
|
void cpuSetZFlagBitOpsL(uint32_t res)
|
||||||
{
|
{
|
||||||
ULO flags = cpu_sr & 0xfffb;
|
uint32_t flags = cpu_sr & 0xfffb;
|
||||||
if (res == 0) flags |= 4;
|
if (res == 0) flags |= 4;
|
||||||
cpu_sr = flags;
|
cpu_sr = flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
// rm,dm,sm
|
// rm,dm,sm
|
||||||
ULO cpu_xnvc_flag_add_table[2][2][2] = { 0,0x11,0x11,0x13,0xa,8,8,0x19};
|
uint32_t cpu_xnvc_flag_add_table[2][2][2] = { 0,0x11,0x11,0x13,0xa,8,8,0x19};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Calculate XNVC flags of an add operation.
|
/// Calculate XNVC flags of an add operation.
|
||||||
|
@ -51,13 +50,13 @@ ULO cpu_xnvc_flag_add_table[2][2][2] = { 0,0x11,0x11,0x13,0xa,8,8,0x19};
|
||||||
/// <param name="rm">The MSB of the result.</param>
|
/// <param name="rm">The MSB of the result.</param>
|
||||||
/// <param name="dm">The MSB of the destination source.</param>
|
/// <param name="dm">The MSB of the destination source.</param>
|
||||||
/// <param name="sm">The MSB of the source.</param>
|
/// <param name="sm">The MSB of the source.</param>
|
||||||
static ULO cpuMakeFlagXNVCAdd(BOOLE rm, BOOLE dm, BOOLE sm)
|
static uint32_t cpuMakeFlagXNVCAdd(BOOLE rm, BOOLE dm, BOOLE sm)
|
||||||
{
|
{
|
||||||
return cpu_xnvc_flag_add_table[rm][dm][sm];
|
return cpu_xnvc_flag_add_table[rm][dm][sm];
|
||||||
}
|
}
|
||||||
|
|
||||||
// rm,dm,sm
|
// rm,dm,sm
|
||||||
ULO cpu_nvc_flag_add_table[2][2][2] = { 0,1,1,3,0xa,8,8,9};
|
uint32_t cpu_nvc_flag_add_table[2][2][2] = { 0,1,1,3,0xa,8,8,9};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Calculate NVC flags of an add operation for instructions not setting X.
|
/// Calculate NVC flags of an add operation for instructions not setting X.
|
||||||
|
@ -65,13 +64,13 @@ ULO cpu_nvc_flag_add_table[2][2][2] = { 0,1,1,3,0xa,8,8,9};
|
||||||
/// <param name="rm">The MSB of the result.</param>
|
/// <param name="rm">The MSB of the result.</param>
|
||||||
/// <param name="dm">The MSB of the destination source.</param>
|
/// <param name="dm">The MSB of the destination source.</param>
|
||||||
/// <param name="sm">The MSB of the source.</param>
|
/// <param name="sm">The MSB of the source.</param>
|
||||||
static ULO cpuMakeFlagNVCAdd(BOOLE rm, BOOLE dm, BOOLE sm)
|
static uint32_t cpuMakeFlagNVCAdd(BOOLE rm, BOOLE dm, BOOLE sm)
|
||||||
{
|
{
|
||||||
return cpu_nvc_flag_add_table[rm][dm][sm];
|
return cpu_nvc_flag_add_table[rm][dm][sm];
|
||||||
}
|
}
|
||||||
|
|
||||||
// rm,dm,sm
|
// rm,dm,sm
|
||||||
ULO cpu_xnvc_flag_sub_table[2][2][2] = { 0,0x11,2,0,0x19,0x1b,8,0x19};
|
uint32_t cpu_xnvc_flag_sub_table[2][2][2] = { 0,0x11,2,0,0x19,0x1b,8,0x19};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Calculate XNVC flags of a sub operation.
|
/// Calculate XNVC flags of a sub operation.
|
||||||
|
@ -79,13 +78,13 @@ ULO cpu_xnvc_flag_sub_table[2][2][2] = { 0,0x11,2,0,0x19,0x1b,8,0x19};
|
||||||
/// <param name="rm">The MSB of the result.</param>
|
/// <param name="rm">The MSB of the result.</param>
|
||||||
/// <param name="dm">The MSB of the destination source.</param>
|
/// <param name="dm">The MSB of the destination source.</param>
|
||||||
/// <param name="sm">The MSB of the source.</param>
|
/// <param name="sm">The MSB of the source.</param>
|
||||||
static ULO cpuMakeFlagXNVCSub(BOOLE rm, BOOLE dm, BOOLE sm)
|
static uint32_t cpuMakeFlagXNVCSub(BOOLE rm, BOOLE dm, BOOLE sm)
|
||||||
{
|
{
|
||||||
return cpu_xnvc_flag_sub_table[rm][dm][sm];
|
return cpu_xnvc_flag_sub_table[rm][dm][sm];
|
||||||
}
|
}
|
||||||
|
|
||||||
// rm,dm,sm
|
// rm,dm,sm
|
||||||
ULO cpu_nvc_flag_sub_table[2][2][2] = { 0,1,2,0,9,0xb,8,9};
|
uint32_t cpu_nvc_flag_sub_table[2][2][2] = { 0,1,2,0,9,0xb,8,9};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Calculate NVC flags of a sub operation for instructions not setting X.
|
/// Calculate NVC flags of a sub operation for instructions not setting X.
|
||||||
|
@ -93,7 +92,7 @@ ULO cpu_nvc_flag_sub_table[2][2][2] = { 0,1,2,0,9,0xb,8,9};
|
||||||
/// <param name="rm">The MSB of the result.</param>
|
/// <param name="rm">The MSB of the result.</param>
|
||||||
/// <param name="dm">The MSB of the destination source.</param>
|
/// <param name="dm">The MSB of the destination source.</param>
|
||||||
/// <param name="sm">The MSB of the source.</param>
|
/// <param name="sm">The MSB of the source.</param>
|
||||||
static ULO cpuMakeFlagNVCSub(BOOLE rm, BOOLE dm, BOOLE sm)
|
static uint32_t cpuMakeFlagNVCSub(BOOLE rm, BOOLE dm, BOOLE sm)
|
||||||
{
|
{
|
||||||
return cpu_nvc_flag_sub_table[rm][dm][sm];
|
return cpu_nvc_flag_sub_table[rm][dm][sm];
|
||||||
}
|
}
|
||||||
|
@ -125,14 +124,6 @@ void cpuSetFlagV(BOOLE f)
|
||||||
cpu_sr = (cpu_sr & 0xfffd) | ((f) ? 2 : 0);
|
cpu_sr = (cpu_sr & 0xfffd) | ((f) ? 2 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Clear the V flag.
|
|
||||||
/// </summary>
|
|
||||||
static void cpuClearFlagV(void)
|
|
||||||
{
|
|
||||||
cpu_sr = cpu_sr & 0xfffd;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the V flag.
|
/// Get the V flag.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -159,22 +150,6 @@ void cpuSetFlagZ(BOOLE f)
|
||||||
cpu_sr = (cpu_sr & 0xfffb) | ((f) ? 4 : 0);
|
cpu_sr = (cpu_sr & 0xfffb) | ((f) ? 4 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Clear the Z flag.
|
|
||||||
/// </summary>
|
|
||||||
static void cpuClearFlagZ(void)
|
|
||||||
{
|
|
||||||
cpu_sr = cpu_sr & 0xfffb;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get the Z flag.
|
|
||||||
/// </summary>
|
|
||||||
static BOOLE cpuGetFlagZ(void)
|
|
||||||
{
|
|
||||||
return cpu_sr & 0x4;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the X flag.
|
/// Get the X flag.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -199,13 +174,13 @@ void cpuClearFlagsVC(void)
|
||||||
cpu_sr = cpu_sr & 0xfffc;
|
cpu_sr = cpu_sr & 0xfffc;
|
||||||
}
|
}
|
||||||
|
|
||||||
UWO cpuGetZFlagB(UBY res) {return (UWO)((res) ? 0 : 4);}
|
uint16_t cpuGetZFlagB(uint8_t res) {return (uint16_t)((res) ? 0 : 4);}
|
||||||
UWO cpuGetZFlagW(UWO res) {return (UWO)((res) ? 0 : 4);}
|
uint16_t cpuGetZFlagW(uint16_t res) {return (uint16_t)((res) ? 0 : 4);}
|
||||||
UWO cpuGetZFlagL(ULO res) {return (UWO)((res) ? 0 : 4);}
|
uint16_t cpuGetZFlagL(uint32_t res) {return (uint16_t)((res) ? 0 : 4);}
|
||||||
|
|
||||||
UWO cpuGetNFlagB(UBY res) {return (UWO)((res & 0x80) >> 4);}
|
uint16_t cpuGetNFlagB(uint8_t res) {return (uint16_t)((res & 0x80) >> 4);}
|
||||||
UWO cpuGetNFlagW(UWO res) {return (UWO)((res & 0x8000) >> 12);}
|
uint16_t cpuGetNFlagW(uint16_t res) {return (uint16_t)((res & 0x8000) >> 12);}
|
||||||
UWO cpuGetNFlagL(ULO res) {return (UWO)((res & 0x80000000) >> 28);}
|
uint16_t cpuGetNFlagL(uint32_t res) {return (uint16_t)((res & 0x80000000) >> 28);}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set the flags NZVC.
|
/// Set the flags NZVC.
|
||||||
|
@ -216,7 +191,7 @@ UWO cpuGetNFlagL(ULO res) {return (UWO)((res & 0x80000000) >> 28);}
|
||||||
/// <param name="c">The C flag.</param>
|
/// <param name="c">The C flag.</param>
|
||||||
void cpuSetFlagsNZVC(BOOLE z, BOOLE n, BOOLE v, BOOLE c)
|
void cpuSetFlagsNZVC(BOOLE z, BOOLE n, BOOLE v, BOOLE c)
|
||||||
{
|
{
|
||||||
ULO flags = cpu_sr & 0xfff0;
|
uint32_t flags = cpu_sr & 0xfff0;
|
||||||
if (n) flags |= 8;
|
if (n) flags |= 8;
|
||||||
else if (z) flags |= 4;
|
else if (z) flags |= 4;
|
||||||
if (v) flags |= 2;
|
if (v) flags |= 2;
|
||||||
|
@ -231,7 +206,7 @@ void cpuSetFlagsNZVC(BOOLE z, BOOLE n, BOOLE v, BOOLE c)
|
||||||
/// <param name="c">The C flag.</param>
|
/// <param name="c">The C flag.</param>
|
||||||
void cpuSetFlagsVC(BOOLE v, BOOLE c)
|
void cpuSetFlagsVC(BOOLE v, BOOLE c)
|
||||||
{
|
{
|
||||||
ULO flags = cpu_sr & 0xfffc;
|
uint32_t flags = cpu_sr & 0xfffc;
|
||||||
if (v) flags |= 2;
|
if (v) flags |= 2;
|
||||||
if (c) flags |= 1;
|
if (c) flags |= 1;
|
||||||
cpu_sr = flags;
|
cpu_sr = flags;
|
||||||
|
@ -246,7 +221,7 @@ void cpuSetFlagsVC(BOOLE v, BOOLE c)
|
||||||
/// <param name="sm">The MSB of the source.</param>
|
/// <param name="sm">The MSB of the source.</param>
|
||||||
void cpuSetFlagsAdd(BOOLE z, BOOLE rm, BOOLE dm, BOOLE sm)
|
void cpuSetFlagsAdd(BOOLE z, BOOLE rm, BOOLE dm, BOOLE sm)
|
||||||
{
|
{
|
||||||
ULO flags = cpu_sr & 0xffe0;
|
uint32_t flags = cpu_sr & 0xffe0;
|
||||||
if (z) flags |= 4;
|
if (z) flags |= 4;
|
||||||
flags |= cpuMakeFlagXNVCAdd(rm, dm, sm);
|
flags |= cpuMakeFlagXNVCAdd(rm, dm, sm);
|
||||||
cpu_sr = flags;
|
cpu_sr = flags;
|
||||||
|
@ -261,7 +236,7 @@ void cpuSetFlagsAdd(BOOLE z, BOOLE rm, BOOLE dm, BOOLE sm)
|
||||||
/// <param name="sm">The MSB of the source.</param>
|
/// <param name="sm">The MSB of the source.</param>
|
||||||
void cpuSetFlagsSub(BOOLE z, BOOLE rm, BOOLE dm, BOOLE sm)
|
void cpuSetFlagsSub(BOOLE z, BOOLE rm, BOOLE dm, BOOLE sm)
|
||||||
{
|
{
|
||||||
ULO flags = cpu_sr & 0xffe0;
|
uint32_t flags = cpu_sr & 0xffe0;
|
||||||
if (z) flags |= 4;
|
if (z) flags |= 4;
|
||||||
flags |= cpuMakeFlagXNVCSub(rm, dm, sm);
|
flags |= cpuMakeFlagXNVCSub(rm, dm, sm);
|
||||||
cpu_sr = flags;
|
cpu_sr = flags;
|
||||||
|
@ -276,7 +251,7 @@ void cpuSetFlagsSub(BOOLE z, BOOLE rm, BOOLE dm, BOOLE sm)
|
||||||
/// <param name="sm">The MSB of the source.</param>
|
/// <param name="sm">The MSB of the source.</param>
|
||||||
void cpuSetFlagsAddX(BOOLE z, BOOLE rm, BOOLE dm, BOOLE sm)
|
void cpuSetFlagsAddX(BOOLE z, BOOLE rm, BOOLE dm, BOOLE sm)
|
||||||
{
|
{
|
||||||
ULO flags = cpu_sr & ((z) ? 0xffe4 : 0xffe0); // Clear z if result is non-zero
|
uint32_t flags = cpu_sr & ((z) ? 0xffe4 : 0xffe0); // Clear z if result is non-zero
|
||||||
flags |= cpuMakeFlagXNVCAdd(rm, dm, sm);
|
flags |= cpuMakeFlagXNVCAdd(rm, dm, sm);
|
||||||
cpu_sr = flags;
|
cpu_sr = flags;
|
||||||
}
|
}
|
||||||
|
@ -290,7 +265,7 @@ void cpuSetFlagsAddX(BOOLE z, BOOLE rm, BOOLE dm, BOOLE sm)
|
||||||
/// <param name="sm">The MSB of the source.</param>
|
/// <param name="sm">The MSB of the source.</param>
|
||||||
void cpuSetFlagsSubX(BOOLE z, BOOLE rm, BOOLE dm, BOOLE sm)
|
void cpuSetFlagsSubX(BOOLE z, BOOLE rm, BOOLE dm, BOOLE sm)
|
||||||
{
|
{
|
||||||
ULO flags = cpu_sr & ((z) ? 0xffe4 : 0xffe0); // Clear z if result is non-zero
|
uint32_t flags = cpu_sr & ((z) ? 0xffe4 : 0xffe0); // Clear z if result is non-zero
|
||||||
flags |= cpuMakeFlagXNVCSub(rm, dm, sm);
|
flags |= cpuMakeFlagXNVCSub(rm, dm, sm);
|
||||||
cpu_sr = flags;
|
cpu_sr = flags;
|
||||||
}
|
}
|
||||||
|
@ -303,7 +278,7 @@ void cpuSetFlagsSubX(BOOLE z, BOOLE rm, BOOLE dm, BOOLE sm)
|
||||||
/// <param name="dm">The MSB of the destination source.</param>
|
/// <param name="dm">The MSB of the destination source.</param>
|
||||||
void cpuSetFlagsNeg(BOOLE z, BOOLE rm, BOOLE dm)
|
void cpuSetFlagsNeg(BOOLE z, BOOLE rm, BOOLE dm)
|
||||||
{
|
{
|
||||||
ULO flags = cpu_sr & 0xffe0;
|
uint32_t flags = cpu_sr & 0xffe0;
|
||||||
if (z) flags |= 4;
|
if (z) flags |= 4;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -325,7 +300,7 @@ void cpuSetFlagsNeg(BOOLE z, BOOLE rm, BOOLE dm)
|
||||||
/// <param name="dm">The MSB of the destination source.</param>
|
/// <param name="dm">The MSB of the destination source.</param>
|
||||||
void cpuSetFlagsNegx(BOOLE z, BOOLE rm, BOOLE dm)
|
void cpuSetFlagsNegx(BOOLE z, BOOLE rm, BOOLE dm)
|
||||||
{
|
{
|
||||||
ULO flags = cpu_sr & ((z) ? 0xffe4 : 0xffe0); // Clear z if result is non-zero
|
uint32_t flags = cpu_sr & ((z) ? 0xffe4 : 0xffe0); // Clear z if result is non-zero
|
||||||
if (dm || rm)
|
if (dm || rm)
|
||||||
{
|
{
|
||||||
flags |= 0x11; // XC
|
flags |= 0x11; // XC
|
||||||
|
@ -347,7 +322,7 @@ void cpuSetFlagsNegx(BOOLE z, BOOLE rm, BOOLE dm)
|
||||||
/// <param name="sm">The MSB of the source.</param>
|
/// <param name="sm">The MSB of the source.</param>
|
||||||
void cpuSetFlagsCmp(BOOLE z, BOOLE rm, BOOLE dm, BOOLE sm)
|
void cpuSetFlagsCmp(BOOLE z, BOOLE rm, BOOLE dm, BOOLE sm)
|
||||||
{
|
{
|
||||||
ULO flags = cpu_sr & 0xfff0;
|
uint32_t flags = cpu_sr & 0xfff0;
|
||||||
if (z) flags |= 4;
|
if (z) flags |= 4;
|
||||||
flags |= cpuMakeFlagNVCSub(rm, dm, sm);
|
flags |= cpuMakeFlagNVCSub(rm, dm, sm);
|
||||||
cpu_sr = flags;
|
cpu_sr = flags;
|
||||||
|
@ -360,7 +335,7 @@ void cpuSetFlagsCmp(BOOLE z, BOOLE rm, BOOLE dm, BOOLE sm)
|
||||||
/// <param name="rm">The MSB of the result.</param>
|
/// <param name="rm">The MSB of the result.</param>
|
||||||
void cpuSetFlagsShiftZero(BOOLE z, BOOLE rm)
|
void cpuSetFlagsShiftZero(BOOLE z, BOOLE rm)
|
||||||
{
|
{
|
||||||
ULO flags = cpu_sr & 0xfff0; // Always clearing the VC flag
|
uint32_t flags = cpu_sr & 0xfff0; // Always clearing the VC flag
|
||||||
if (rm) flags |= 8;
|
if (rm) flags |= 8;
|
||||||
else if (z) flags |= 4;
|
else if (z) flags |= 4;
|
||||||
cpu_sr = flags;
|
cpu_sr = flags;
|
||||||
|
@ -375,7 +350,7 @@ void cpuSetFlagsShiftZero(BOOLE z, BOOLE rm)
|
||||||
/// <param name="c">The overflow of the result.</param>
|
/// <param name="c">The overflow of the result.</param>
|
||||||
void cpuSetFlagsShift(BOOLE z, BOOLE rm, BOOLE c, BOOLE v)
|
void cpuSetFlagsShift(BOOLE z, BOOLE rm, BOOLE c, BOOLE v)
|
||||||
{
|
{
|
||||||
ULO flags = cpu_sr & 0xffe0;
|
uint32_t flags = cpu_sr & 0xffe0;
|
||||||
if (rm) flags |= 8;
|
if (rm) flags |= 8;
|
||||||
else if (z) flags |= 4;
|
else if (z) flags |= 4;
|
||||||
if (v) flags |= 2;
|
if (v) flags |= 2;
|
||||||
|
@ -391,7 +366,7 @@ void cpuSetFlagsShift(BOOLE z, BOOLE rm, BOOLE c, BOOLE v)
|
||||||
/// <param name="c">The carry of the result.</param>
|
/// <param name="c">The carry of the result.</param>
|
||||||
void cpuSetFlagsRotate(BOOLE z, BOOLE rm, BOOLE c)
|
void cpuSetFlagsRotate(BOOLE z, BOOLE rm, BOOLE c)
|
||||||
{
|
{
|
||||||
ULO flags = cpu_sr & 0xfff0; // Always clearing the V flag
|
uint32_t flags = cpu_sr & 0xfff0; // Always clearing the V flag
|
||||||
|
|
||||||
if (rm) flags |= 8;
|
if (rm) flags |= 8;
|
||||||
else if (z) flags |= 4;
|
else if (z) flags |= 4;
|
||||||
|
@ -406,7 +381,7 @@ void cpuSetFlagsRotate(BOOLE z, BOOLE rm, BOOLE c)
|
||||||
/// <param name="z">The Z flag.</param>
|
/// <param name="z">The Z flag.</param>
|
||||||
/// <param name="rm">The MSB of the result.</param>
|
/// <param name="rm">The MSB of the result.</param>
|
||||||
/// <param name="c">The extend bit and carry of the result.</param>
|
/// <param name="c">The extend bit and carry of the result.</param>
|
||||||
void cpuSetFlagsRotateX(UWO z, UWO rm, UWO x)
|
void cpuSetFlagsRotateX(uint16_t z, uint16_t rm, uint16_t x)
|
||||||
{
|
{
|
||||||
cpu_sr = (cpu_sr & 0xffe0) | z | rm | x;
|
cpu_sr = (cpu_sr & 0xffe0) | z | rm | x;
|
||||||
}
|
}
|
||||||
|
@ -414,9 +389,9 @@ void cpuSetFlagsRotateX(UWO z, UWO rm, UWO x)
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set the flags (ZN00).
|
/// Set the flags (ZN00).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void cpuSetFlagsNZ00NewB(UBY res)
|
void cpuSetFlagsNZ00NewB(uint8_t res)
|
||||||
{
|
{
|
||||||
ULO flag = cpu_sr & 0xfff0;
|
uint32_t flag = cpu_sr & 0xfff0;
|
||||||
if (res & 0x80) flag |= 0x8;
|
if (res & 0x80) flag |= 0x8;
|
||||||
else if (res == 0) flag |= 0x4;
|
else if (res == 0) flag |= 0x4;
|
||||||
cpu_sr = flag;
|
cpu_sr = flag;
|
||||||
|
@ -425,9 +400,9 @@ void cpuSetFlagsNZ00NewB(UBY res)
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set the flags (ZN00).
|
/// Set the flags (ZN00).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void cpuSetFlagsNZ00NewW(UWO res)
|
void cpuSetFlagsNZ00NewW(uint16_t res)
|
||||||
{
|
{
|
||||||
ULO flag = cpu_sr & 0xfff0;
|
uint32_t flag = cpu_sr & 0xfff0;
|
||||||
if (res & 0x8000) flag |= 0x8;
|
if (res & 0x8000) flag |= 0x8;
|
||||||
else if (res == 0) flag |= 0x4;
|
else if (res == 0) flag |= 0x4;
|
||||||
cpu_sr = flag;
|
cpu_sr = flag;
|
||||||
|
@ -436,9 +411,9 @@ void cpuSetFlagsNZ00NewW(UWO res)
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set the flags (ZN00).
|
/// Set the flags (ZN00).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void cpuSetFlagsNZ00NewL(ULO res)
|
void cpuSetFlagsNZ00NewL(uint32_t res)
|
||||||
{
|
{
|
||||||
ULO flag = cpu_sr & 0xfff0;
|
uint32_t flag = cpu_sr & 0xfff0;
|
||||||
if (res & 0x80000000) flag |= 0x8;
|
if (res & 0x80000000) flag |= 0x8;
|
||||||
else if (res == 0) flag |= 0x4;
|
else if (res == 0) flag |= 0x4;
|
||||||
cpu_sr = flag;
|
cpu_sr = flag;
|
||||||
|
@ -447,9 +422,9 @@ void cpuSetFlagsNZ00NewL(ULO res)
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set the flags (ZN00).
|
/// Set the flags (ZN00).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void cpuSetFlagsNZ00New64(LLO res)
|
void cpuSetFlagsNZ00New64(int64_t res)
|
||||||
{
|
{
|
||||||
ULO flag = cpu_sr & 0xfff0;
|
uint32_t flag = cpu_sr & 0xfff0;
|
||||||
if (res < 0) flag |= 0x8;
|
if (res < 0) flag |= 0x8;
|
||||||
else if (res == 0) flag |= 0x4;
|
else if (res == 0) flag |= 0x4;
|
||||||
cpu_sr = flag;
|
cpu_sr = flag;
|
||||||
|
@ -459,7 +434,7 @@ void cpuSetFlagsNZ00New64(LLO res)
|
||||||
/// Set the 4 flags absolute.
|
/// Set the 4 flags absolute.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="f">flags</param>
|
/// <param name="f">flags</param>
|
||||||
void cpuSetFlagsAbs(UWO f)
|
void cpuSetFlagsAbs(uint16_t f)
|
||||||
{
|
{
|
||||||
cpu_sr = (cpu_sr & 0xfff0) | f;
|
cpu_sr = (cpu_sr & 0xfff0) | f;
|
||||||
}
|
}
|
||||||
|
@ -530,29 +505,29 @@ BOOLE cpuCalculateConditionCode11(void)
|
||||||
|
|
||||||
BOOLE cpuCalculateConditionCode12(void)
|
BOOLE cpuCalculateConditionCode12(void)
|
||||||
{
|
{
|
||||||
ULO tmp = cpu_sr & 0xa;
|
uint32_t tmp = cpu_sr & 0xa;
|
||||||
return (tmp == 0xa) || (tmp == 0); // GE - (N && V) || (!N && !V)
|
return (tmp == 0xa) || (tmp == 0); // GE - (N && V) || (!N && !V)
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLE cpuCalculateConditionCode13(void)
|
BOOLE cpuCalculateConditionCode13(void)
|
||||||
{
|
{
|
||||||
ULO tmp = cpu_sr & 0xa;
|
uint32_t tmp = cpu_sr & 0xa;
|
||||||
return (tmp == 0x8) || (tmp == 0x2); // LT - (N && !V) || (!N && V)
|
return (tmp == 0x8) || (tmp == 0x2); // LT - (N && !V) || (!N && V)
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLE cpuCalculateConditionCode14(void)
|
BOOLE cpuCalculateConditionCode14(void)
|
||||||
{
|
{
|
||||||
ULO tmp = cpu_sr & 0xa;
|
uint32_t tmp = cpu_sr & 0xa;
|
||||||
return (!(cpu_sr & 0x4)) && ((tmp == 0xa) || (tmp == 0)); // GT - (N && V && !Z) || (!N && !V && !Z)
|
return (!(cpu_sr & 0x4)) && ((tmp == 0xa) || (tmp == 0)); // GT - (N && V && !Z) || (!N && !V && !Z)
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLE cpuCalculateConditionCode15(void)
|
BOOLE cpuCalculateConditionCode15(void)
|
||||||
{
|
{
|
||||||
ULO tmp = cpu_sr & 0xa;
|
uint32_t tmp = cpu_sr & 0xa;
|
||||||
return (cpu_sr & 0x4) || (tmp == 0x8) || (tmp == 2);// LE - Z || (N && !V) || (!N && V)
|
return (cpu_sr & 0x4) || (tmp == 0x8) || (tmp == 2);// LE - Z || (N && !V) || (!N && V)
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLE cpuCalculateConditionCode(ULO cc)
|
BOOLE cpuCalculateConditionCode(uint32_t cc)
|
||||||
{
|
{
|
||||||
switch (cc & 0xf)
|
switch (cc & 0xf)
|
||||||
{
|
{
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,115 +1,112 @@
|
||||||
#ifndef CpuModule_Internal_H
|
#pragma once
|
||||||
#define CpuModule_Internal_H
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// This header file defines the internal interfaces of the CPU module.
|
// This header file defines the internal interfaces of the CPU module.
|
||||||
extern void cpuMakeOpcodeTableForModel(void);
|
extern void cpuMakeOpcodeTableForModel(void);
|
||||||
extern void cpuCreateMulTimeTables(void);
|
extern void cpuCreateMulTimeTables(void);
|
||||||
|
|
||||||
// StackFrameGen
|
// StackFrameGen
|
||||||
extern void cpuStackFrameGenerate(UWO vector_no, ULO pc);
|
extern void cpuStackFrameGenerate(uint16_t vector_no, uint32_t pc);
|
||||||
extern void cpuStackFrameInit(void);
|
extern void cpuStackFrameInit(void);
|
||||||
|
|
||||||
// Registers
|
// Registers
|
||||||
extern ULO cpu_sr; // Not static because the flags calculation uses it extensively
|
extern uint32_t cpu_sr; // Not static because the flags calculation uses it extensively
|
||||||
extern BOOLE cpuGetFlagSupervisor(void);
|
extern BOOLE cpuGetFlagSupervisor(void);
|
||||||
extern BOOLE cpuGetFlagMaster(void);
|
extern BOOLE cpuGetFlagMaster(void);
|
||||||
extern void cpuSetUspDirect(ULO usp);
|
extern void cpuSetUspDirect(uint32_t usp);
|
||||||
extern ULO cpuGetUspDirect(void);
|
extern uint32_t cpuGetUspDirect(void);
|
||||||
extern ULO cpuGetUspAutoMap(void);
|
extern uint32_t cpuGetUspAutoMap(void);
|
||||||
extern void cpuSetSspDirect(ULO ssp);
|
extern void cpuSetSspDirect(uint32_t ssp);
|
||||||
extern ULO cpuGetSspDirect(void);
|
extern uint32_t cpuGetSspDirect(void);
|
||||||
extern ULO cpuGetSspAutoMap(void);
|
extern uint32_t cpuGetSspAutoMap(void);
|
||||||
extern void cpuSetMspDirect(ULO msp);
|
extern void cpuSetMspDirect(uint32_t msp);
|
||||||
extern ULO cpuGetMspDirect(void);
|
extern uint32_t cpuGetMspDirect(void);
|
||||||
extern ULO cpuGetMspAutoMap(void);
|
extern uint32_t cpuGetMspAutoMap(void);
|
||||||
extern void cpuSetMspAutoMap(ULO new_msp);
|
extern void cpuSetMspAutoMap(uint32_t new_msp);
|
||||||
extern ULO cpuGetIspAutoMap(void);
|
extern uint32_t cpuGetIspAutoMap(void);
|
||||||
extern void cpuSetIspAutoMap(ULO new_isp);
|
extern void cpuSetIspAutoMap(uint32_t new_isp);
|
||||||
extern void cpuSetDReg(ULO i, ULO value);
|
extern void cpuSetDReg(uint32_t i, uint32_t value);
|
||||||
extern ULO cpuGetDReg(ULO i);
|
extern uint32_t cpuGetDReg(uint32_t i);
|
||||||
extern void cpuSetAReg(ULO i, ULO value);
|
extern void cpuSetAReg(uint32_t i, uint32_t value);
|
||||||
extern ULO cpuGetAReg(ULO i);
|
extern uint32_t cpuGetAReg(uint32_t i);
|
||||||
extern void cpuSetReg(ULO da, ULO i, ULO value);
|
extern void cpuSetReg(uint32_t da, uint32_t i, uint32_t value);
|
||||||
extern ULO cpuGetReg(ULO da, ULO i);
|
extern uint32_t cpuGetReg(uint32_t da, uint32_t i);
|
||||||
extern void cpuSetPC(ULO address);
|
extern void cpuSetPC(uint32_t address);
|
||||||
extern ULO cpuGetPC(void);
|
extern uint32_t cpuGetPC(void);
|
||||||
extern void cpuSetStop(BOOLE stop);
|
extern void cpuSetStop(BOOLE stop);
|
||||||
extern BOOLE cpuGetStop(void);
|
extern BOOLE cpuGetStop(void);
|
||||||
extern void cpuSetVbr(ULO vbr);
|
extern void cpuSetVbr(uint32_t vbr);
|
||||||
extern ULO cpuGetVbr(void);
|
extern uint32_t cpuGetVbr(void);
|
||||||
extern void cpuSetSfc(ULO sfc);
|
extern void cpuSetSfc(uint32_t sfc);
|
||||||
extern ULO cpuGetSfc(void);
|
extern uint32_t cpuGetSfc(void);
|
||||||
extern void cpuSetDfc(ULO dfc);
|
extern void cpuSetDfc(uint32_t dfc);
|
||||||
extern ULO cpuGetDfc(void);
|
extern uint32_t cpuGetDfc(void);
|
||||||
extern void cpuSetCacr(ULO cacr);
|
extern void cpuSetCacr(uint32_t cacr);
|
||||||
extern ULO cpuGetCacr(void);
|
extern uint32_t cpuGetCacr(void);
|
||||||
extern void cpuSetCaar(ULO caar);
|
extern void cpuSetCaar(uint32_t caar);
|
||||||
extern ULO cpuGetCaar(void);
|
extern uint32_t cpuGetCaar(void);
|
||||||
extern void cpuSetSR(ULO sr);
|
extern void cpuSetSR(uint32_t sr);
|
||||||
extern ULO cpuGetSR(void);
|
extern uint32_t cpuGetSR(void);
|
||||||
extern void cpuSetInstructionTime(ULO cycles);
|
extern void cpuSetInstructionTime(uint32_t cycles);
|
||||||
extern ULO cpuGetInstructionTime(void);
|
extern uint32_t cpuGetInstructionTime(void);
|
||||||
extern void cpuSetOriginalPC(ULO pc);
|
extern void cpuSetOriginalPC(uint32_t pc);
|
||||||
extern ULO cpuGetOriginalPC(void);
|
extern uint32_t cpuGetOriginalPC(void);
|
||||||
|
extern void cpuSetInstructionAborted(bool aborted);
|
||||||
|
extern bool cpuGetInstructionAborted(void);
|
||||||
|
|
||||||
#ifdef CPU_INSTRUCTION_LOGGING
|
#ifdef CPU_INSTRUCTION_LOGGING
|
||||||
|
|
||||||
extern void cpuSetCurrentOpcode(UWO opcode);
|
extern void cpuSetCurrentOpcode(uint16_t opcode);
|
||||||
extern UWO cpuGetCurrentOpcode(void);
|
extern uint16_t cpuGetCurrentOpcode(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern void cpuProfileWrite(void);
|
extern void cpuProfileWrite(void);
|
||||||
|
|
||||||
extern void cpuSetModelMask(UBY model_mask);
|
extern void cpuSetModelMask(uint8_t model_mask);
|
||||||
extern UBY cpuGetModelMask(void);
|
extern uint8_t cpuGetModelMask(void);
|
||||||
extern void cpuSetDRegWord(ULO regno, UWO val);
|
extern void cpuSetDRegWord(uint32_t regno, uint16_t val);
|
||||||
extern void cpuSetDRegByte(ULO regno, UBY val);
|
extern void cpuSetDRegByte(uint32_t regno, uint8_t val);
|
||||||
extern UWO cpuGetRegWord(ULO i, ULO regno);
|
extern uint16_t cpuGetRegWord(uint32_t i, uint32_t regno);
|
||||||
extern UWO cpuGetDRegWord(ULO regno);
|
extern uint16_t cpuGetDRegWord(uint32_t regno);
|
||||||
extern UBY cpuGetDRegByte(ULO regno);
|
extern uint8_t cpuGetDRegByte(uint32_t regno);
|
||||||
extern ULO cpuGetDRegWordSignExtLong(ULO regno);
|
extern uint32_t cpuGetDRegWordSignExtLong(uint32_t regno);
|
||||||
extern UWO cpuGetDRegByteSignExtWord(ULO regno);
|
extern uint16_t cpuGetDRegByteSignExtWord(uint32_t regno);
|
||||||
extern ULO cpuGetDRegByteSignExtLong(ULO regno);
|
extern uint32_t cpuGetDRegByteSignExtLong(uint32_t regno);
|
||||||
extern UWO cpuGetARegWord(ULO regno);
|
extern uint16_t cpuGetARegWord(uint32_t regno);
|
||||||
extern UBY cpuGetARegByte(ULO regno);
|
extern uint8_t cpuGetARegByte(uint32_t regno);
|
||||||
|
|
||||||
extern UWO cpuGetNextWord(void);
|
extern uint16_t cpuGetNextWord(void);
|
||||||
extern ULO cpuGetNextWordSignExt(void);
|
extern uint32_t cpuGetNextWordSignExt(void);
|
||||||
extern ULO cpuGetNextLong(void);
|
extern uint32_t cpuGetNextLong(void);
|
||||||
extern void cpuSkipNextWord(void);
|
extern void cpuSkipNextWord(void);
|
||||||
extern void cpuSkipNextLong(void);
|
extern void cpuSkipNextLong(void);
|
||||||
extern void cpuClearPrefetch(void);
|
extern void cpuClearPrefetch(void);
|
||||||
extern void cpuValidateReadPointer(void);
|
extern void cpuValidateReadPointer(void);
|
||||||
|
|
||||||
extern void cpuInitializeFromNewPC(ULO new_pc);
|
extern void cpuInitializeFromNewPC(uint32_t new_pc);
|
||||||
|
|
||||||
// Effective address
|
// Effective address
|
||||||
extern ULO cpuEA02(ULO regno);
|
extern uint32_t cpuEA02(uint32_t regno);
|
||||||
extern ULO cpuEA03(ULO regno, ULO size);
|
extern uint32_t cpuEA03(uint32_t regno, uint32_t size);
|
||||||
extern ULO cpuEA04(ULO regno, ULO size);
|
extern uint32_t cpuEA04(uint32_t regno, uint32_t size);
|
||||||
extern ULO cpuEA05(ULO regno);
|
extern uint32_t cpuEA05(uint32_t regno);
|
||||||
extern ULO cpuEA06(ULO regno);
|
extern uint32_t cpuEA06(uint32_t regno);
|
||||||
extern ULO cpuEA70(void);
|
extern uint32_t cpuEA70(void);
|
||||||
extern ULO cpuEA71(void);
|
extern uint32_t cpuEA71(void);
|
||||||
extern ULO cpuEA72(void);
|
extern uint32_t cpuEA72(void);
|
||||||
extern ULO cpuEA73(void);
|
extern uint32_t cpuEA73(void);
|
||||||
|
|
||||||
// Flags
|
// Flags
|
||||||
extern void cpuSetFlagsAdd(BOOLE z, BOOLE rm, BOOLE dm, BOOLE sm);
|
extern void cpuSetFlagsAdd(BOOLE z, BOOLE rm, BOOLE dm, BOOLE sm);
|
||||||
extern void cpuSetFlagsSub(BOOLE z, BOOLE rm, BOOLE dm, BOOLE sm);
|
extern void cpuSetFlagsSub(BOOLE z, BOOLE rm, BOOLE dm, BOOLE sm);
|
||||||
extern void cpuSetFlagsCmp(BOOLE z, BOOLE rm, BOOLE dm, BOOLE sm);
|
extern void cpuSetFlagsCmp(BOOLE z, BOOLE rm, BOOLE dm, BOOLE sm);
|
||||||
extern void cpuSetZFlagBitOpsB(UBY res);
|
extern void cpuSetZFlagBitOpsB(uint8_t res);
|
||||||
extern void cpuSetZFlagBitOpsL(ULO res);
|
extern void cpuSetZFlagBitOpsL(uint32_t res);
|
||||||
|
|
||||||
extern void cpuSetFlagsNZ00NewB(UBY res);
|
extern void cpuSetFlagsNZ00NewB(uint8_t res);
|
||||||
extern void cpuSetFlagsNZ00NewW(UWO res);
|
extern void cpuSetFlagsNZ00NewW(uint16_t res);
|
||||||
extern void cpuSetFlagsNZ00NewL(ULO res);
|
extern void cpuSetFlagsNZ00NewL(uint32_t res);
|
||||||
extern void cpuSetFlagsNZ00New64(LLO res);
|
extern void cpuSetFlagsNZ00New64(int64_t res);
|
||||||
|
|
||||||
extern void cpuSetFlagZ(BOOLE f);
|
extern void cpuSetFlagZ(BOOLE f);
|
||||||
extern void cpuSetFlagN(BOOLE f);
|
extern void cpuSetFlagN(BOOLE f);
|
||||||
|
@ -126,16 +123,16 @@ extern void cpuSetFlagsVC(BOOLE v, BOOLE c);
|
||||||
extern void cpuSetFlagsShiftZero(BOOLE z, BOOLE rm);
|
extern void cpuSetFlagsShiftZero(BOOLE z, BOOLE rm);
|
||||||
extern void cpuSetFlagsShift(BOOLE z, BOOLE rm, BOOLE c, BOOLE v);
|
extern void cpuSetFlagsShift(BOOLE z, BOOLE rm, BOOLE c, BOOLE v);
|
||||||
extern void cpuSetFlagsRotate(BOOLE z, BOOLE rm, BOOLE c);
|
extern void cpuSetFlagsRotate(BOOLE z, BOOLE rm, BOOLE c);
|
||||||
extern void cpuSetFlagsRotateX(UWO z, UWO rm, UWO x);
|
extern void cpuSetFlagsRotateX(uint16_t z, uint16_t rm, uint16_t x);
|
||||||
extern void cpuSetFlagsAddX(BOOLE z, BOOLE rm, BOOLE dm, BOOLE sm);
|
extern void cpuSetFlagsAddX(BOOLE z, BOOLE rm, BOOLE dm, BOOLE sm);
|
||||||
extern void cpuSetFlagsSubX(BOOLE z, BOOLE rm, BOOLE dm, BOOLE sm);
|
extern void cpuSetFlagsSubX(BOOLE z, BOOLE rm, BOOLE dm, BOOLE sm);
|
||||||
extern void cpuSetFlagsAbs(UWO f);
|
extern void cpuSetFlagsAbs(uint16_t f);
|
||||||
extern UWO cpuGetZFlagB(UBY res);
|
extern uint16_t cpuGetZFlagB(uint8_t res);
|
||||||
extern UWO cpuGetZFlagW(UWO res);
|
extern uint16_t cpuGetZFlagW(uint16_t res);
|
||||||
extern UWO cpuGetZFlagL(ULO res);
|
extern uint16_t cpuGetZFlagL(uint32_t res);
|
||||||
extern UWO cpuGetNFlagB(UBY res);
|
extern uint16_t cpuGetNFlagB(uint8_t res);
|
||||||
extern UWO cpuGetNFlagW(UWO res);
|
extern uint16_t cpuGetNFlagW(uint16_t res);
|
||||||
extern UWO cpuGetNFlagL(ULO res);
|
extern uint16_t cpuGetNFlagL(uint32_t res);
|
||||||
extern void cpuClearFlagsVC(void);
|
extern void cpuClearFlagsVC(void);
|
||||||
|
|
||||||
extern BOOLE cpuCalculateConditionCode0(void);
|
extern BOOLE cpuCalculateConditionCode0(void);
|
||||||
|
@ -154,53 +151,47 @@ extern BOOLE cpuCalculateConditionCode12(void);
|
||||||
extern BOOLE cpuCalculateConditionCode13(void);
|
extern BOOLE cpuCalculateConditionCode13(void);
|
||||||
extern BOOLE cpuCalculateConditionCode14(void);
|
extern BOOLE cpuCalculateConditionCode14(void);
|
||||||
extern BOOLE cpuCalculateConditionCode15(void);
|
extern BOOLE cpuCalculateConditionCode15(void);
|
||||||
extern BOOLE cpuCalculateConditionCode(ULO cc);
|
extern BOOLE cpuCalculateConditionCode(uint32_t cc);
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
#ifdef CPU_INSTRUCTION_LOGGING
|
#ifdef CPU_INSTRUCTION_LOGGING
|
||||||
extern void cpuCallInstructionLoggingFunc(void);
|
extern void cpuCallInstructionLoggingFunc(void);
|
||||||
extern void cpuCallExceptionLoggingFunc(STR *description, ULO original_pc, UWO opcode);
|
extern void cpuCallExceptionLoggingFunc(char *description, uint32_t original_pc, uint16_t opcode);
|
||||||
extern void cpuCallInterruptLoggingFunc(ULO level, ULO vector_address);
|
extern void cpuCallInterruptLoggingFunc(uint32_t level, uint32_t vector_address);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Interrupt
|
// Interrupt
|
||||||
extern ULO cpuActivateSSP(void);
|
extern uint32_t cpuActivateSSP(void);
|
||||||
extern void cpuSetRaiseInterrupt(BOOLE raise_irq);
|
extern void cpuSetRaiseInterrupt(BOOLE raise_irq);
|
||||||
extern BOOLE cpuGetRaiseInterrupt(void);
|
extern BOOLE cpuGetRaiseInterrupt(void);
|
||||||
extern void cpuSetRaiseInterruptLevel(ULO raise_irq_level);
|
extern void cpuSetRaiseInterruptLevel(uint32_t raise_irq_level);
|
||||||
extern ULO cpuGetRaiseInterruptLevel(void);
|
extern uint32_t cpuGetRaiseInterruptLevel(void);
|
||||||
|
|
||||||
// Exceptions
|
// Exceptions
|
||||||
extern void cpuThrowPrivilegeViolationException(void);
|
extern void cpuThrowPrivilegeViolationException(void);
|
||||||
extern void cpuThrowIllegalInstructionException(BOOLE executejmp);
|
extern void cpuThrowIllegalInstructionException(BOOLE executejmp);
|
||||||
|
extern void cpuThrowIllegalInstructionExceptionFromBreakpoint(void);
|
||||||
extern void cpuThrowFLineException(void);
|
extern void cpuThrowFLineException(void);
|
||||||
extern void cpuThrowALineException(void);
|
extern void cpuThrowALineException(void);
|
||||||
extern void cpuThrowTrapVException(void);
|
extern void cpuThrowTrapVException(void);
|
||||||
extern void cpuThrowTrapException(ULO vector_no);
|
extern void cpuThrowTrapException(uint32_t vector_no);
|
||||||
extern void cpuThrowDivisionByZeroException();
|
extern void cpuThrowDivisionByZeroException(void);
|
||||||
extern void cpuThrowChkException(void);
|
extern void cpuThrowChkException(void);
|
||||||
extern void cpuThrowTraceException(void);
|
extern void cpuThrowTraceException(void);
|
||||||
extern void cpuThrowResetException(void);
|
extern void cpuThrowResetException(void);
|
||||||
extern void cpuCallResetExceptionFunc(void);
|
extern void cpuCallResetExceptionFunc(void);
|
||||||
extern void cpuFrame1(UWO vector_offset, ULO pc);
|
extern void cpuFrame1(uint16_t vector_offset, uint32_t pc);
|
||||||
|
|
||||||
// Private help functions
|
// Private help functions
|
||||||
static ULO cpuSignExtByteToLong(UBY v) {return (ULO)(LON)(BYT) v;}
|
static uint32_t cpuSignExtByteToLong(uint8_t v) {return (uint32_t)(int32_t)(int8_t) v;}
|
||||||
static UWO cpuSignExtByteToWord(UBY v) {return (UWO)(WOR)(BYT) v;}
|
static uint16_t cpuSignExtByteToWord(uint8_t v) {return (uint16_t)(int16_t)(int8_t) v;}
|
||||||
static ULO cpuSignExtWordToLong(UWO v) {return (ULO)(LON)(WOR) v;}
|
static uint32_t cpuSignExtWordToLong(uint16_t v) {return (uint32_t)(int32_t)(int16_t) v;}
|
||||||
static ULO cpuJoinWordToLong(UWO upper, UWO lower) {return (((ULO)upper) << 16) | ((ULO)lower);}
|
static uint32_t cpuJoinWordToLong(uint16_t upper, uint16_t lower) {return (((uint32_t)upper) << 16) | ((uint32_t)lower);}
|
||||||
static ULO cpuJoinByteToLong(UBY upper, UBY midh, UBY midl, UBY lower) {return (((ULO)upper) << 24) | (((ULO)midh) << 16) | (((ULO)midl) << 8) | ((ULO)lower);}
|
static uint32_t cpuJoinByteToLong(uint8_t upper, uint8_t midh, uint8_t midl, uint8_t lower) {return (((uint32_t)upper) << 24) | (((uint32_t)midh) << 16) | (((uint32_t)midl) << 8) | ((uint32_t)lower);}
|
||||||
static UWO cpuJoinByteToWord(UBY upper, UBY lower) {return (((UWO)upper) << 8) | ((UWO)lower);}
|
static uint16_t cpuJoinByteToWord(uint8_t upper, uint8_t lower) {return (((uint16_t)upper) << 8) | ((uint16_t)lower);}
|
||||||
static BOOLE cpuMsbB(UBY v) {return v>>7;}
|
static BOOLE cpuMsbB(uint8_t v) {return v>>7;}
|
||||||
static BOOLE cpuMsbW(UWO v) {return v>>15;}
|
static BOOLE cpuMsbW(uint16_t v) {return v>>15;}
|
||||||
static BOOLE cpuMsbL(ULO v) {return v>>31;}
|
static BOOLE cpuMsbL(uint32_t v) {return v>>31;}
|
||||||
static BOOLE cpuIsZeroB(UBY v) {return v == 0;}
|
static BOOLE cpuIsZeroB(uint8_t v) {return v == 0;}
|
||||||
static BOOLE cpuIsZeroW(UWO v) {return v == 0;}
|
static BOOLE cpuIsZeroW(uint16_t v) {return v == 0;}
|
||||||
static BOOLE cpuIsZeroL(ULO v) {return v == 0;}
|
static BOOLE cpuIsZeroL(uint32_t v) {return v == 0;}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
/* @(#) $Id: CpuModule_InternalState.c,v 1.9 2012-08-12 16:51:02 peschau Exp $ */
|
|
||||||
/*=========================================================================*/
|
/*=========================================================================*/
|
||||||
/* Fellow */
|
/* Fellow */
|
||||||
/* 68000 internal state */
|
/* 68000 internal state */
|
||||||
|
@ -27,57 +26,58 @@
|
||||||
#include "CpuModule_Internal.h"
|
#include "CpuModule_Internal.h"
|
||||||
|
|
||||||
/* M68k registers */
|
/* M68k registers */
|
||||||
static ULO cpu_regs[2][8]; /* 0 - data, 1 - address */
|
static uint32_t cpu_regs[2][8]; /* 0 - data, 1 - address */
|
||||||
static ULO cpu_pc;
|
static uint32_t cpu_pc;
|
||||||
static ULO cpu_usp;
|
static uint32_t cpu_usp;
|
||||||
static ULO cpu_ssp;
|
static uint32_t cpu_ssp;
|
||||||
static ULO cpu_msp;
|
static uint32_t cpu_msp;
|
||||||
static ULO cpu_sfc;
|
static uint32_t cpu_sfc;
|
||||||
static ULO cpu_dfc;
|
static uint32_t cpu_dfc;
|
||||||
ULO cpu_sr; // Not static because flags calculation use it extensively
|
uint32_t cpu_sr; // Not static because flags calculation use it extensively
|
||||||
static ULO cpu_vbr;
|
static uint32_t cpu_vbr;
|
||||||
static UWO cpu_prefetch_word;
|
static uint16_t cpu_prefetch_word;
|
||||||
static ULO cpu_cacr;
|
static uint32_t cpu_cacr;
|
||||||
static ULO cpu_caar;
|
static uint32_t cpu_caar;
|
||||||
|
|
||||||
/* Irq management */
|
/* Irq management */
|
||||||
static BOOLE cpu_raise_irq;
|
static BOOLE cpu_raise_irq;
|
||||||
static ULO cpu_raise_irq_level;
|
static uint32_t cpu_raise_irq_level;
|
||||||
|
|
||||||
/* Reset values */
|
/* Reset values */
|
||||||
static ULO cpu_initial_pc;
|
static uint32_t cpu_initial_pc;
|
||||||
static ULO cpu_initial_sp;
|
static uint32_t cpu_initial_sp;
|
||||||
|
|
||||||
/* Flag set if CPU is stopped */
|
/* Flag set if CPU is stopped */
|
||||||
static BOOLE cpu_stop;
|
static BOOLE cpu_stop;
|
||||||
|
|
||||||
/* The current CPU model */
|
/* The current CPU model */
|
||||||
static ULO cpu_model_major = -1;
|
static uint32_t cpu_model_major = -1;
|
||||||
static ULO cpu_model_minor;
|
static uint32_t cpu_model_minor;
|
||||||
static UBY cpu_model_mask;
|
static uint8_t cpu_model_mask;
|
||||||
|
|
||||||
/* For exception handling */
|
/* For exception handling */
|
||||||
#ifdef CPU_INSTRUCTION_LOGGING
|
#ifdef CPU_INSTRUCTION_LOGGING
|
||||||
|
|
||||||
static UWO cpu_current_opcode;
|
static uint16_t cpu_current_opcode;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static ULO cpu_original_pc;
|
static uint32_t cpu_original_pc;
|
||||||
|
static bool cpu_instruction_aborted;
|
||||||
|
|
||||||
/* Number of cycles taken by the last intstruction */
|
/* Number of cycles taken by the last intstruction */
|
||||||
static ULO cpu_instruction_time;
|
static uint32_t cpu_instruction_time;
|
||||||
|
|
||||||
/* Getters and setters */
|
/* Getters and setters */
|
||||||
|
|
||||||
void cpuSetDReg(ULO i, ULO value) {cpu_regs[0][i] = value;}
|
void cpuSetDReg(uint32_t i, uint32_t value) {cpu_regs[0][i] = value;}
|
||||||
ULO cpuGetDReg(ULO i) {return cpu_regs[0][i];}
|
uint32_t cpuGetDReg(uint32_t i) {return cpu_regs[0][i];}
|
||||||
|
|
||||||
void cpuSetAReg(ULO i, ULO value) {cpu_regs[1][i] = value;}
|
void cpuSetAReg(uint32_t i, uint32_t value) {cpu_regs[1][i] = value;}
|
||||||
ULO cpuGetAReg(ULO i) {return cpu_regs[1][i];}
|
uint32_t cpuGetAReg(uint32_t i) {return cpu_regs[1][i];}
|
||||||
|
|
||||||
void cpuSetReg(ULO da, ULO i, ULO value) {cpu_regs[da][i] = value;}
|
void cpuSetReg(uint32_t da, uint32_t i, uint32_t value) {cpu_regs[da][i] = value;}
|
||||||
ULO cpuGetReg(ULO da, ULO i) {return cpu_regs[da][i];}
|
uint32_t cpuGetReg(uint32_t da, uint32_t i) {return cpu_regs[da][i];}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the supervisor bit from sr.
|
/// Get the supervisor bit from sr.
|
||||||
|
@ -95,21 +95,21 @@ BOOLE cpuGetFlagMaster(void)
|
||||||
return cpu_sr & 0x1000;
|
return cpu_sr & 0x1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpuSetUspDirect(ULO usp) {cpu_usp = usp;}
|
void cpuSetUspDirect(uint32_t usp) {cpu_usp = usp;}
|
||||||
ULO cpuGetUspDirect(void) {return cpu_usp;}
|
uint32_t cpuGetUspDirect() {return cpu_usp;}
|
||||||
ULO cpuGetUspAutoMap(void) {return (cpuGetFlagSupervisor()) ? cpuGetUspDirect() : cpuGetAReg(7);}
|
uint32_t cpuGetUspAutoMap() {return (cpuGetFlagSupervisor()) ? cpuGetUspDirect() : cpuGetAReg(7);}
|
||||||
|
|
||||||
void cpuSetSspDirect(ULO ssp) {cpu_ssp = ssp;}
|
void cpuSetSspDirect(uint32_t ssp) {cpu_ssp = ssp;}
|
||||||
ULO cpuGetSspDirect(void) {return cpu_ssp;}
|
uint32_t cpuGetSspDirect() {return cpu_ssp;}
|
||||||
ULO cpuGetSspAutoMap(void) {return (cpuGetFlagSupervisor()) ? cpuGetAReg(7) : cpuGetSspDirect();}
|
uint32_t cpuGetSspAutoMap() {return (cpuGetFlagSupervisor()) ? cpuGetAReg(7) : cpuGetSspDirect();}
|
||||||
|
|
||||||
void cpuSetMspDirect(ULO msp) {cpu_msp = msp;}
|
void cpuSetMspDirect(uint32_t msp) {cpu_msp = msp;}
|
||||||
ULO cpuGetMspDirect(void) {return cpu_msp;}
|
uint32_t cpuGetMspDirect() {return cpu_msp;}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the master stack pointer.
|
/// Returns the master stack pointer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ULO cpuGetMspAutoMap(void)
|
uint32_t cpuGetMspAutoMap(void)
|
||||||
{
|
{
|
||||||
if (cpuGetFlagSupervisor() && cpuGetFlagMaster())
|
if (cpuGetFlagSupervisor() && cpuGetFlagMaster())
|
||||||
{
|
{
|
||||||
|
@ -121,7 +121,7 @@ ULO cpuGetMspAutoMap(void)
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the master stack pointer.
|
/// Sets the master stack pointer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void cpuSetMspAutoMap(ULO new_msp)
|
void cpuSetMspAutoMap(uint32_t new_msp)
|
||||||
{
|
{
|
||||||
if (cpuGetFlagSupervisor() && cpuGetFlagMaster())
|
if (cpuGetFlagSupervisor() && cpuGetFlagMaster())
|
||||||
{
|
{
|
||||||
|
@ -136,7 +136,7 @@ void cpuSetMspAutoMap(ULO new_msp)
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the interrupt stack pointer. ssp is used as isp.
|
/// Returns the interrupt stack pointer. ssp is used as isp.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ULO cpuGetIspAutoMap(void)
|
uint32_t cpuGetIspAutoMap(void)
|
||||||
{
|
{
|
||||||
if (cpuGetFlagSupervisor() && !cpuGetFlagMaster())
|
if (cpuGetFlagSupervisor() && !cpuGetFlagMaster())
|
||||||
{
|
{
|
||||||
|
@ -148,7 +148,7 @@ ULO cpuGetIspAutoMap(void)
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the interrupt stack pointer. ssp is used as isp.
|
/// Sets the interrupt stack pointer. ssp is used as isp.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void cpuSetIspAutoMap(ULO new_isp)
|
void cpuSetIspAutoMap(uint32_t new_isp)
|
||||||
{
|
{
|
||||||
if (cpuGetFlagSupervisor() && !cpuGetFlagMaster())
|
if (cpuGetFlagSupervisor() && !cpuGetFlagMaster())
|
||||||
{
|
{
|
||||||
|
@ -160,61 +160,64 @@ void cpuSetIspAutoMap(ULO new_isp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpuSetPC(ULO address) {cpu_pc = address;}
|
void cpuSetPC(uint32_t address) {cpu_pc = address;}
|
||||||
ULO cpuGetPC(void) {return cpu_pc;}
|
uint32_t cpuGetPC() {return cpu_pc;}
|
||||||
|
|
||||||
void cpuSetStop(BOOLE stop) {cpu_stop = stop;}
|
void cpuSetStop(BOOLE stop) {cpu_stop = stop;}
|
||||||
BOOLE cpuGetStop(void) {return cpu_stop;}
|
BOOLE cpuGetStop() {return cpu_stop;}
|
||||||
|
|
||||||
void cpuSetVbr(ULO vbr) {cpu_vbr = vbr;}
|
void cpuSetVbr(uint32_t vbr) {cpu_vbr = vbr;}
|
||||||
ULO cpuGetVbr(void) {return cpu_vbr;}
|
uint32_t cpuGetVbr() {return cpu_vbr;}
|
||||||
|
|
||||||
void cpuSetSfc(ULO sfc) {cpu_sfc = sfc;}
|
void cpuSetSfc(uint32_t sfc) {cpu_sfc = sfc;}
|
||||||
ULO cpuGetSfc(void) {return cpu_sfc;}
|
uint32_t cpuGetSfc() {return cpu_sfc;}
|
||||||
|
|
||||||
void cpuSetDfc(ULO dfc) {cpu_dfc = dfc;}
|
void cpuSetDfc(uint32_t dfc) {cpu_dfc = dfc;}
|
||||||
ULO cpuGetDfc(void) {return cpu_dfc;}
|
uint32_t cpuGetDfc() {return cpu_dfc;}
|
||||||
|
|
||||||
void cpuSetCacr(ULO cacr) {cpu_cacr = cacr;}
|
void cpuSetCacr(uint32_t cacr) {cpu_cacr = cacr;}
|
||||||
ULO cpuGetCacr(void) {return cpu_cacr;}
|
uint32_t cpuGetCacr() {return cpu_cacr;}
|
||||||
|
|
||||||
void cpuSetCaar(ULO caar) {cpu_caar = caar;}
|
void cpuSetCaar(uint32_t caar) {cpu_caar = caar;}
|
||||||
ULO cpuGetCaar(void) {return cpu_caar;}
|
uint32_t cpuGetCaar() {return cpu_caar;}
|
||||||
|
|
||||||
void cpuSetSR(ULO sr) {cpu_sr = sr;}
|
void cpuSetSR(uint32_t sr) {cpu_sr = sr;}
|
||||||
ULO cpuGetSR(void) {return cpu_sr;}
|
uint32_t cpuGetSR() {return cpu_sr;}
|
||||||
|
|
||||||
void cpuSetInstructionTime(ULO cycles) {cpu_instruction_time = cycles;}
|
void cpuSetInstructionTime(uint32_t cycles) {cpu_instruction_time = cycles;}
|
||||||
ULO cpuGetInstructionTime(void) {return cpu_instruction_time;}
|
uint32_t cpuGetInstructionTime() {return cpu_instruction_time;}
|
||||||
|
|
||||||
void cpuSetOriginalPC(ULO pc) {cpu_original_pc = pc;}
|
void cpuSetOriginalPC(uint32_t pc) {cpu_original_pc = pc;}
|
||||||
ULO cpuGetOriginalPC(void) {return cpu_original_pc;}
|
uint32_t cpuGetOriginalPC() {return cpu_original_pc;}
|
||||||
|
|
||||||
|
void cpuSetInstructionAborted(bool aborted) {cpu_instruction_aborted = aborted;}
|
||||||
|
bool cpuGetInstructionAborted() {return cpu_instruction_aborted;}
|
||||||
|
|
||||||
#ifdef CPU_INSTRUCTION_LOGGING
|
#ifdef CPU_INSTRUCTION_LOGGING
|
||||||
|
|
||||||
void cpuSetCurrentOpcode(UWO opcode) {cpu_current_opcode = opcode;}
|
void cpuSetCurrentOpcode(uint16_t opcode) {cpu_current_opcode = opcode;}
|
||||||
UWO cpuGetCurrentOpcode(void) {return cpu_current_opcode;}
|
uint16_t cpuGetCurrentOpcode() {return cpu_current_opcode;}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void cpuSetRaiseInterrupt(BOOLE raise_irq) {cpu_raise_irq = raise_irq;}
|
void cpuSetRaiseInterrupt(BOOLE raise_irq) {cpu_raise_irq = raise_irq;}
|
||||||
BOOLE cpuGetRaiseInterrupt(void) {return cpu_raise_irq;}
|
BOOLE cpuGetRaiseInterrupt() {return cpu_raise_irq;}
|
||||||
void cpuSetRaiseInterruptLevel(ULO raise_irq_level) {cpu_raise_irq_level = raise_irq_level;}
|
void cpuSetRaiseInterruptLevel(uint32_t raise_irq_level) {cpu_raise_irq_level = raise_irq_level;}
|
||||||
ULO cpuGetRaiseInterruptLevel(void) {return cpu_raise_irq_level;}
|
uint32_t cpuGetRaiseInterruptLevel() {return cpu_raise_irq_level;}
|
||||||
|
|
||||||
ULO cpuGetIrqLevel(void) {return (cpu_sr & 0x0700) >> 8;}
|
uint32_t cpuGetIrqLevel() {return (cpu_sr & 0x0700) >> 8;}
|
||||||
|
|
||||||
void cpuSetInitialPC(ULO pc) {cpu_initial_pc = pc;}
|
void cpuSetInitialPC(uint32_t pc) {cpu_initial_pc = pc;}
|
||||||
ULO cpuGetInitialPC(void) {return cpu_initial_pc;}
|
uint32_t cpuGetInitialPC() {return cpu_initial_pc;}
|
||||||
|
|
||||||
void cpuSetInitialSP(ULO sp) {cpu_initial_sp = sp;}
|
void cpuSetInitialSP(uint32_t sp) {cpu_initial_sp = sp;}
|
||||||
ULO cpuGetInitialSP(void) {return cpu_initial_sp;}
|
uint32_t cpuGetInitialSP() {return cpu_initial_sp;}
|
||||||
|
|
||||||
void cpuSetModelMask(UBY model_mask) {cpu_model_mask = model_mask;}
|
void cpuSetModelMask(uint8_t model_mask) {cpu_model_mask = model_mask;}
|
||||||
UBY cpuGetModelMask(void) {return cpu_model_mask;}
|
uint8_t cpuGetModelMask() {return cpu_model_mask;}
|
||||||
|
|
||||||
ULO cpuGetModelMajor(void) {return cpu_model_major;}
|
uint32_t cpuGetModelMajor() {return cpu_model_major;}
|
||||||
ULO cpuGetModelMinor(void) {return cpu_model_minor;}
|
uint32_t cpuGetModelMinor() {return cpu_model_minor;}
|
||||||
|
|
||||||
static void cpuCalculateModelMask(void)
|
static void cpuCalculateModelMask(void)
|
||||||
{
|
{
|
||||||
|
@ -235,7 +238,7 @@ static void cpuCalculateModelMask(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpuSetModel(ULO major, ULO minor)
|
void cpuSetModel(uint32_t major, uint32_t minor)
|
||||||
{
|
{
|
||||||
BOOLE makeOpcodeTable = (cpu_model_major != major);
|
BOOLE makeOpcodeTable = (cpu_model_major != major);
|
||||||
cpu_model_major = major;
|
cpu_model_major = major;
|
||||||
|
@ -245,57 +248,59 @@ void cpuSetModel(ULO major, ULO minor)
|
||||||
if (makeOpcodeTable) cpuMakeOpcodeTableForModel();
|
if (makeOpcodeTable) cpuMakeOpcodeTableForModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__BIG_ENDIAN__)
|
#if 0
|
||||||
void cpuSetDRegWord(ULO regno, UWO val) {*((WOR*)&cpu_regs[0][regno]+1) = val;}
|
void cpuSetDRegWord(uint32_t regno, uint16_t val) {*((int16_t*)&cpu_regs[0][regno]) = val;}
|
||||||
void cpuSetDRegByte(ULO regno, UBY val) {*((UBY*)&cpu_regs[0][regno]+3) = val;}
|
void cpuSetDRegByte(uint32_t regno, uint8_t val) {*((uint8_t*)&cpu_regs[0][regno]) = val;}
|
||||||
#else
|
#else
|
||||||
void cpuSetDRegWord(ULO regno, UWO val) {*((WOR*)&cpu_regs[0][regno]) = val;}
|
// MPW -- above assumes little endian.
|
||||||
void cpuSetDRegByte(ULO regno, UBY val) {*((UBY*)&cpu_regs[0][regno]) = val;}
|
void cpuSetDRegWord(uint32_t regno, uint16_t val) {cpu_regs[0][regno] &= 0xffff0000; cpu_regs[0][regno] |= val;}
|
||||||
|
void cpuSetDRegByte(uint32_t regno, uint8_t val) {cpu_regs[0][regno] &= 0xffffff00; cpu_regs[0][regno] |= val;}
|
||||||
#endif
|
#endif
|
||||||
UWO cpuGetRegWord(ULO i, ULO regno) {return (UWO)cpu_regs[i][regno];}
|
|
||||||
|
|
||||||
UWO cpuGetDRegWord(ULO regno) {return (UWO)cpu_regs[0][regno];}
|
uint16_t cpuGetRegWord(uint32_t i, uint32_t regno) {return (uint16_t)cpu_regs[i][regno];}
|
||||||
UBY cpuGetDRegByte(ULO regno) {return (UBY)cpu_regs[0][regno];}
|
uint16_t cpuGetDRegWord(uint32_t regno) {return (uint16_t)cpu_regs[0][regno];}
|
||||||
|
uint8_t cpuGetDRegByte(uint32_t regno) {return (uint8_t)cpu_regs[0][regno];}
|
||||||
|
|
||||||
UWO cpuGetARegWord(ULO regno) {return (UWO)cpu_regs[1][regno];}
|
uint32_t cpuGetDRegWordSignExtLong(uint32_t regno) {return cpuSignExtWordToLong(cpuGetDRegWord(regno));}
|
||||||
UBY cpuGetARegByte(ULO regno) {return (UBY)cpu_regs[1][regno];}
|
uint16_t cpuGetDRegByteSignExtWord(uint32_t regno) {return cpuSignExtByteToWord(cpuGetDRegByte(regno));}
|
||||||
ULO cpuGetDRegWordSignExtLong(ULO regno) {return cpuSignExtWordToLong(cpuGetDRegWord(regno));}
|
uint32_t cpuGetDRegByteSignExtLong(uint32_t regno) {return cpuSignExtByteToLong(cpuGetDRegByte(regno));}
|
||||||
UWO cpuGetDRegByteSignExtWord(ULO regno) {return cpuSignExtByteToWord(cpuGetDRegByte(regno));}
|
|
||||||
ULO cpuGetDRegByteSignExtLong(ULO regno) {return cpuSignExtByteToLong(cpuGetDRegByte(regno));}
|
|
||||||
|
|
||||||
typedef UWO (*cpuGetWordFunc)(void);
|
uint16_t cpuGetARegWord(uint32_t regno) {return (uint16_t)cpu_regs[1][regno];}
|
||||||
typedef ULO (*cpuGetLongFunc)(void);
|
uint8_t cpuGetARegByte(uint32_t regno) {return (uint8_t)cpu_regs[1][regno];}
|
||||||
|
|
||||||
static UWO cpuGetNextWordInternal(void)
|
typedef uint16_t (*cpuGetWordFunc)(void);
|
||||||
|
typedef uint32_t (*cpuGetLongFunc)(void);
|
||||||
|
|
||||||
|
static uint16_t cpuGetNextWordInternal(void)
|
||||||
{
|
{
|
||||||
UWO data = memoryReadWord(cpuGetPC() + 2);
|
uint16_t data = memoryReadWord(cpuGetPC() + 2);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULO cpuGetNextLongInternal(void)
|
static uint32_t cpuGetNextLongInternal(void)
|
||||||
{
|
{
|
||||||
ULO data = memoryReadLong(cpuGetPC() + 2);
|
uint32_t data = memoryReadLong(cpuGetPC() + 2);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
UWO cpuGetNextWord(void)
|
uint16_t cpuGetNextWord(void)
|
||||||
{
|
{
|
||||||
UWO tmp = cpu_prefetch_word;
|
uint16_t tmp = cpu_prefetch_word;
|
||||||
cpu_prefetch_word = cpuGetNextWordInternal();
|
cpu_prefetch_word = cpuGetNextWordInternal();
|
||||||
cpuSetPC(cpuGetPC() + 2);
|
cpuSetPC(cpuGetPC() + 2);
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULO cpuGetNextWordSignExt(void)
|
uint32_t cpuGetNextWordSignExt(void)
|
||||||
{
|
{
|
||||||
return cpuSignExtWordToLong(cpuGetNextWord());
|
return cpuSignExtWordToLong(cpuGetNextWord());
|
||||||
}
|
}
|
||||||
|
|
||||||
ULO cpuGetNextLong(void)
|
uint32_t cpuGetNextLong(void)
|
||||||
{
|
{
|
||||||
ULO tmp = cpu_prefetch_word << 16;
|
uint32_t tmp = cpu_prefetch_word << 16;
|
||||||
ULO data = cpuGetNextLongInternal();
|
uint32_t data = cpuGetNextLongInternal();
|
||||||
cpu_prefetch_word = (UWO) data;
|
cpu_prefetch_word = (uint16_t) data;
|
||||||
cpuSetPC(cpuGetPC() + 4);
|
cpuSetPC(cpuGetPC() + 4);
|
||||||
return tmp | (data >> 16);
|
return tmp | (data >> 16);
|
||||||
}
|
}
|
||||||
|
@ -322,7 +327,7 @@ void cpuSkipNextLong(void)
|
||||||
cpuInitializePrefetch();
|
cpuInitializePrefetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpuInitializeFromNewPC(ULO new_pc)
|
void cpuInitializeFromNewPC(uint32_t new_pc)
|
||||||
{
|
{
|
||||||
cpuSetPC(new_pc);
|
cpuSetPC(new_pc);
|
||||||
cpuInitializePrefetch();
|
cpuInitializePrefetch();
|
||||||
|
@ -330,13 +335,11 @@ void cpuInitializeFromNewPC(ULO new_pc)
|
||||||
|
|
||||||
void cpuSaveState(FILE *F)
|
void cpuSaveState(FILE *F)
|
||||||
{
|
{
|
||||||
ULO i, j;
|
|
||||||
|
|
||||||
fwrite(&cpu_model_major, sizeof(cpu_model_major), 1, F);
|
fwrite(&cpu_model_major, sizeof(cpu_model_major), 1, F);
|
||||||
fwrite(&cpu_model_minor, sizeof(cpu_model_minor), 1, F);
|
fwrite(&cpu_model_minor, sizeof(cpu_model_minor), 1, F);
|
||||||
for (i = 0; i < 2; i++)
|
for (uint32_t i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
for (j = 0; j < 7; j++)
|
for (uint32_t j = 0; j < 7; j++)
|
||||||
{
|
{
|
||||||
fwrite(&cpu_regs[i][j], sizeof(cpu_regs[i][j]), 1, F);
|
fwrite(&cpu_regs[i][j], sizeof(cpu_regs[i][j]), 1, F);
|
||||||
}
|
}
|
||||||
|
@ -358,13 +361,11 @@ void cpuSaveState(FILE *F)
|
||||||
|
|
||||||
void cpuLoadState(FILE *F)
|
void cpuLoadState(FILE *F)
|
||||||
{
|
{
|
||||||
ULO i, j;
|
|
||||||
|
|
||||||
fread(&cpu_model_major, sizeof(cpu_model_major), 1, F);
|
fread(&cpu_model_major, sizeof(cpu_model_major), 1, F);
|
||||||
fread(&cpu_model_minor, sizeof(cpu_model_minor), 1, F);
|
fread(&cpu_model_minor, sizeof(cpu_model_minor), 1, F);
|
||||||
for (i = 0; i < 2; i++)
|
for (uint32_t i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
for (j = 0; j < 7; j++)
|
for (uint32_t j = 0; j < 7; j++)
|
||||||
{
|
{
|
||||||
fread(&cpu_regs[i][j], sizeof(cpu_regs[i][j]), 1, F);
|
fread(&cpu_regs[i][j], sizeof(cpu_regs[i][j]), 1, F);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
/* @(#) $Id: CpuModule_Interrupts.c,v 1.5 2012-08-12 16:51:02 peschau Exp $ */
|
|
||||||
/*=========================================================================*/
|
/*=========================================================================*/
|
||||||
/* Fellow */
|
/* Fellow */
|
||||||
/* 68000 interrupt handling */
|
/* 68000 interrupt handling */
|
||||||
|
@ -32,7 +31,7 @@ cpuCheckPendingInterruptsFunc cpu_check_pending_interrupts_func;
|
||||||
void cpuCheckPendingInterrupts(void)
|
void cpuCheckPendingInterrupts(void)
|
||||||
{
|
{
|
||||||
if (cpuGetRaiseInterrupt()) return;
|
if (cpuGetRaiseInterrupt()) return;
|
||||||
if (cpu_check_pending_interrupts_func) cpu_check_pending_interrupts_func();
|
cpu_check_pending_interrupts_func();
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpuSetCheckPendingInterruptsFunc(cpuCheckPendingInterruptsFunc func)
|
void cpuSetCheckPendingInterruptsFunc(cpuCheckPendingInterruptsFunc func)
|
||||||
|
@ -40,9 +39,9 @@ void cpuSetCheckPendingInterruptsFunc(cpuCheckPendingInterruptsFunc func)
|
||||||
cpu_check_pending_interrupts_func = func;
|
cpu_check_pending_interrupts_func = func;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULO cpuActivateSSP(void)
|
uint32_t cpuActivateSSP(void)
|
||||||
{
|
{
|
||||||
ULO currentSP = cpuGetAReg(7);
|
uint32_t currentSP = cpuGetAReg(7);
|
||||||
|
|
||||||
// check supervisor bit number (bit 13) within the system byte of the status register
|
// check supervisor bit number (bit 13) within the system byte of the status register
|
||||||
if (!cpuGetFlagSupervisor())
|
if (!cpuGetFlagSupervisor())
|
||||||
|
@ -66,7 +65,7 @@ ULO cpuActivateSSP(void)
|
||||||
// Retrns TRUE if the CPU is in the stopped state,
|
// Retrns TRUE if the CPU is in the stopped state,
|
||||||
// this allows our scheduling queue to start
|
// this allows our scheduling queue to start
|
||||||
// scheduling CPU events again.
|
// scheduling CPU events again.
|
||||||
BOOLE cpuSetIrqLevel(ULO new_interrupt_level)
|
BOOLE cpuSetIrqLevel(uint32_t new_interrupt_level)
|
||||||
{
|
{
|
||||||
cpuSetRaiseInterrupt(TRUE);
|
cpuSetRaiseInterrupt(TRUE);
|
||||||
cpuSetRaiseInterruptLevel(new_interrupt_level);
|
cpuSetRaiseInterruptLevel(new_interrupt_level);
|
||||||
|
@ -83,10 +82,10 @@ BOOLE cpuSetIrqLevel(ULO new_interrupt_level)
|
||||||
Transfers control to an interrupt routine
|
Transfers control to an interrupt routine
|
||||||
============================================================*/
|
============================================================*/
|
||||||
|
|
||||||
void cpuSetUpInterrupt(ULO new_interrupt_level)
|
void cpuSetUpInterrupt(uint32_t new_interrupt_level)
|
||||||
{
|
{
|
||||||
UWO vector_offset = (UWO) (0x60 + new_interrupt_level*4);
|
uint16_t vector_offset = (uint16_t) (0x60 + new_interrupt_level*4);
|
||||||
ULO vector_address = memoryReadLong(cpuGetVbr() + vector_offset);
|
uint32_t vector_address = memoryReadLong(cpuGetVbr() + vector_offset);
|
||||||
|
|
||||||
cpuActivateSSP(); // Switch to using ssp or msp. Loads a7 and preserves usp if we came from user-mode.
|
cpuActivateSSP(); // Switch to using ssp or msp. Loads a7 and preserves usp if we came from user-mode.
|
||||||
|
|
||||||
|
@ -94,7 +93,7 @@ void cpuSetUpInterrupt(ULO new_interrupt_level)
|
||||||
|
|
||||||
cpuSetSR(cpuGetSR() & 0x38ff); // Clear interrupt level
|
cpuSetSR(cpuGetSR() & 0x38ff); // Clear interrupt level
|
||||||
cpuSetSR(cpuGetSR() | 0x2000); // Set supervisor mode
|
cpuSetSR(cpuGetSR() | 0x2000); // Set supervisor mode
|
||||||
cpuSetSR(cpuGetSR() | (UWO)(new_interrupt_level << 8)); // Set interrupt level
|
cpuSetSR(cpuGetSR() | (uint16_t)(new_interrupt_level << 8)); // Set interrupt level
|
||||||
|
|
||||||
#ifdef CPU_INSTRUCTION_LOGGING
|
#ifdef CPU_INSTRUCTION_LOGGING
|
||||||
cpuCallInterruptLoggingFunc(new_interrupt_level, vector_address);
|
cpuCallInterruptLoggingFunc(new_interrupt_level, vector_address);
|
||||||
|
@ -104,7 +103,7 @@ void cpuSetUpInterrupt(ULO new_interrupt_level)
|
||||||
{
|
{
|
||||||
if (cpuGetFlagMaster())
|
if (cpuGetFlagMaster())
|
||||||
{ // If the cpu was in master mode, preserve msp, and switch to using ssp (isp) in a7.
|
{ // If the cpu was in master mode, preserve msp, and switch to using ssp (isp) in a7.
|
||||||
ULO oldA7 = cpuGetAReg(7);
|
uint32_t oldA7 = cpuGetAReg(7);
|
||||||
cpuSetMspDirect(oldA7);
|
cpuSetMspDirect(oldA7);
|
||||||
cpuSetAReg(7, cpuGetSspDirect());
|
cpuSetAReg(7, cpuGetSspDirect());
|
||||||
cpuFrame1(vector_offset, cpuGetPC()); // Make the throwaway frame on ssp/isp
|
cpuFrame1(vector_offset, cpuGetPC()); // Make the throwaway frame on ssp/isp
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
/* @(#) $Id: CpuModule_Logging.c,v 1.3 2012-08-12 16:51:02 peschau Exp $ */
|
|
||||||
/*=========================================================================*/
|
/*=========================================================================*/
|
||||||
/* Fellow */
|
/* Fellow */
|
||||||
/* CPU 68k logging functions */
|
/* CPU 68k logging functions */
|
||||||
|
@ -49,7 +48,7 @@ void cpuSetExceptionLoggingFunc(cpuExceptionLoggingFunc func)
|
||||||
cpu_exception_logging_func = func;
|
cpu_exception_logging_func = func;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpuCallExceptionLoggingFunc(STR *description, ULO original_pc, UWO opcode)
|
void cpuCallExceptionLoggingFunc(char *description, uint32_t original_pc, uint16_t opcode)
|
||||||
{
|
{
|
||||||
if (cpu_exception_logging_func != NULL)
|
if (cpu_exception_logging_func != NULL)
|
||||||
cpu_exception_logging_func(description, original_pc, opcode);
|
cpu_exception_logging_func(description, original_pc, opcode);
|
||||||
|
@ -60,7 +59,7 @@ void cpuSetInterruptLoggingFunc(cpuInterruptLoggingFunc func)
|
||||||
cpu_interrupt_logging_func = func;
|
cpu_interrupt_logging_func = func;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpuCallInterruptLoggingFunc(ULO level, ULO vector_address)
|
void cpuCallInterruptLoggingFunc(uint32_t level, uint32_t vector_address)
|
||||||
{
|
{
|
||||||
if (cpu_interrupt_logging_func != NULL)
|
if (cpu_interrupt_logging_func != NULL)
|
||||||
cpu_interrupt_logging_func(level, vector_address);
|
cpu_interrupt_logging_func(level, vector_address);
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
#include "fmem.h"
|
#include "fmem.h"
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
#ifndef CPUMODULE_PROFILE_H
|
#pragma once
|
||||||
#define CPUMODULE_PROFILE_H
|
|
||||||
|
|
||||||
void cpuProfileWrite(void)
|
void cpuProfileWrite(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
/* @(#) $Id: CpuModule_StackFrameGen.c,v 1.3 2011-07-18 17:22:55 peschau Exp $ */
|
|
||||||
/*=========================================================================*/
|
/*=========================================================================*/
|
||||||
/* Fellow */
|
/* Fellow */
|
||||||
/* 68000 stack frame generation */
|
/* 68000 stack frame generation */
|
||||||
|
@ -27,10 +26,10 @@
|
||||||
#include "CpuModule_Internal.h"
|
#include "CpuModule_Internal.h"
|
||||||
|
|
||||||
/* Exception stack frame jmptables */
|
/* Exception stack frame jmptables */
|
||||||
typedef void(*cpuStackFrameGenFunc)(UWO, ULO);
|
typedef void(*cpuStackFrameGenFunc)(uint16_t, uint32_t);
|
||||||
static cpuStackFrameGenFunc cpu_stack_frame_gen_func[64];
|
static cpuStackFrameGenFunc cpu_stack_frame_gen_func[64];
|
||||||
|
|
||||||
static void cpuSetStackFrameGenFunc(ULO vector_no, cpuStackFrameGenFunc func)
|
static void cpuSetStackFrameGenFunc(uint32_t vector_no, cpuStackFrameGenFunc func)
|
||||||
{
|
{
|
||||||
cpu_stack_frame_gen_func[vector_no] = func;
|
cpu_stack_frame_gen_func[vector_no] = func;
|
||||||
}
|
}
|
||||||
|
@ -41,7 +40,7 @@ static void cpuSetStackFrameGenFunc(ULO vector_no, cpuStackFrameGenFunc func)
|
||||||
000: All, except bus and address error
|
000: All, except bus and address error
|
||||||
========================================================================*/
|
========================================================================*/
|
||||||
|
|
||||||
static void cpuFrameGroup1(UWO vector_offset, ULO pcPtr)
|
static void cpuFrameGroup1(uint16_t vector_offset, uint32_t pcPtr)
|
||||||
{
|
{
|
||||||
// save PC
|
// save PC
|
||||||
cpuSetAReg(7, cpuGetAReg(7) - 4);
|
cpuSetAReg(7, cpuGetAReg(7) - 4);
|
||||||
|
@ -49,7 +48,7 @@ static void cpuFrameGroup1(UWO vector_offset, ULO pcPtr)
|
||||||
|
|
||||||
// save SR
|
// save SR
|
||||||
cpuSetAReg(7, cpuGetAReg(7) - 2);
|
cpuSetAReg(7, cpuGetAReg(7) - 2);
|
||||||
memoryWriteWord((UWO)cpuGetSR(), cpuGetAReg(7));
|
memoryWriteWord((uint16_t)cpuGetSR(), cpuGetAReg(7));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*========================================================================
|
/*========================================================================
|
||||||
|
@ -61,7 +60,7 @@ static void cpuFrameGroup1(UWO vector_offset, ULO pcPtr)
|
||||||
memory_fault_read is TRUE if the access was a read
|
memory_fault_read is TRUE if the access was a read
|
||||||
========================================================================*/
|
========================================================================*/
|
||||||
|
|
||||||
static void cpuFrameGroup2(UWO vector_offset, ULO pcPtr)
|
static void cpuFrameGroup2(uint16_t vector_offset, uint32_t pcPtr)
|
||||||
{
|
{
|
||||||
// save PC
|
// save PC
|
||||||
cpuSetAReg(7, cpuGetAReg(7) - 4);
|
cpuSetAReg(7, cpuGetAReg(7) - 4);
|
||||||
|
@ -69,7 +68,7 @@ static void cpuFrameGroup2(UWO vector_offset, ULO pcPtr)
|
||||||
|
|
||||||
// save SR
|
// save SR
|
||||||
cpuSetAReg(7, cpuGetAReg(7) - 2);
|
cpuSetAReg(7, cpuGetAReg(7) - 2);
|
||||||
memoryWriteWord((UWO)cpuGetSR(), cpuGetAReg(7));
|
memoryWriteWord((uint16_t)cpuGetSR(), cpuGetAReg(7));
|
||||||
|
|
||||||
// fault address, skip ireg
|
// fault address, skip ireg
|
||||||
cpuSetAReg(7, cpuGetAReg(7) - 6);
|
cpuSetAReg(7, cpuGetAReg(7) - 6);
|
||||||
|
@ -79,7 +78,7 @@ static void cpuFrameGroup2(UWO vector_offset, ULO pcPtr)
|
||||||
memoryWriteLong(memory_fault_read << 4, cpuGetAReg(7));
|
memoryWriteLong(memory_fault_read << 4, cpuGetAReg(7));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cpuFrame4Words(UWO frame_code, UWO vector_offset, ULO pc)
|
static void cpuFrame4Words(uint16_t frame_code, uint16_t vector_offset, uint32_t pc)
|
||||||
{
|
{
|
||||||
// save vector_offset word
|
// save vector_offset word
|
||||||
cpuSetAReg(7, cpuGetAReg(7) - 2);
|
cpuSetAReg(7, cpuGetAReg(7) - 2);
|
||||||
|
@ -91,7 +90,7 @@ static void cpuFrame4Words(UWO frame_code, UWO vector_offset, ULO pc)
|
||||||
|
|
||||||
// save SR
|
// save SR
|
||||||
cpuSetAReg(7, cpuGetAReg(7) - 2);
|
cpuSetAReg(7, cpuGetAReg(7) - 2);
|
||||||
memoryWriteWord((UWO)cpuGetSR(), cpuGetAReg(7));
|
memoryWriteWord((uint16_t)cpuGetSR(), cpuGetAReg(7));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -111,7 +110,7 @@ static void cpuFrame4Words(UWO frame_code, UWO vector_offset, ULO pc)
|
||||||
030: Same as for 020
|
030: Same as for 020
|
||||||
========================================================================*/
|
========================================================================*/
|
||||||
|
|
||||||
static void cpuFrame0(UWO vector_offset, ULO pc)
|
static void cpuFrame0(uint16_t vector_offset, uint32_t pc)
|
||||||
{
|
{
|
||||||
cpuFrame4Words(0x0000, vector_offset, pc);
|
cpuFrame4Words(0x0000, vector_offset, pc);
|
||||||
}
|
}
|
||||||
|
@ -131,7 +130,7 @@ static void cpuFrame0(UWO vector_offset, ULO pc)
|
||||||
040: Same as for 020
|
040: Same as for 020
|
||||||
========================================================================*/
|
========================================================================*/
|
||||||
|
|
||||||
void cpuFrame1(UWO vector_offset, ULO pc)
|
void cpuFrame1(uint16_t vector_offset, uint32_t pc)
|
||||||
{
|
{
|
||||||
cpuFrame4Words(0x1000, vector_offset, pc);
|
cpuFrame4Words(0x1000, vector_offset, pc);
|
||||||
}
|
}
|
||||||
|
@ -147,7 +146,7 @@ void cpuFrame1(UWO vector_offset, ULO pc)
|
||||||
060: Same as for 040
|
060: Same as for 040
|
||||||
========================================================================*/
|
========================================================================*/
|
||||||
|
|
||||||
static void cpuFrame2(UWO vector_offset, ULO pc)
|
static void cpuFrame2(uint16_t vector_offset, uint32_t pc)
|
||||||
{
|
{
|
||||||
// save inst address
|
// save inst address
|
||||||
cpuSetAReg(7, cpuGetAReg(7) - 4);
|
cpuSetAReg(7, cpuGetAReg(7) - 4);
|
||||||
|
@ -162,7 +161,7 @@ static void cpuFrame2(UWO vector_offset, ULO pc)
|
||||||
|
|
||||||
========================================================================*/
|
========================================================================*/
|
||||||
|
|
||||||
static void cpuFrame8(UWO vector_offset, ULO pc)
|
static void cpuFrame8(uint16_t vector_offset, uint32_t pc)
|
||||||
{
|
{
|
||||||
cpuSetAReg(7, cpuGetAReg(7) - 50);
|
cpuSetAReg(7, cpuGetAReg(7) - 50);
|
||||||
cpuFrame4Words(0x8000, vector_offset, pc);
|
cpuFrame4Words(0x8000, vector_offset, pc);
|
||||||
|
@ -178,14 +177,14 @@ static void cpuFrame8(UWO vector_offset, ULO pc)
|
||||||
Fellow will always generate this frame for bus/address errors
|
Fellow will always generate this frame for bus/address errors
|
||||||
========================================================================*/
|
========================================================================*/
|
||||||
|
|
||||||
static void cpuFrameA(UWO vector_offset, ULO pc)
|
static void cpuFrameA(uint16_t vector_offset, uint32_t pc)
|
||||||
{
|
{
|
||||||
// save vector_offset offset
|
// save vector_offset offset
|
||||||
cpuSetAReg(7, cpuGetAReg(7) - 24);
|
cpuSetAReg(7, cpuGetAReg(7) - 24);
|
||||||
cpuFrame4Words(0xa000, vector_offset, pc);
|
cpuFrame4Words(0xa000, vector_offset, pc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpuStackFrameGenerate(UWO vector_offset, ULO pc)
|
void cpuStackFrameGenerate(uint16_t vector_offset, uint32_t pc)
|
||||||
{
|
{
|
||||||
cpu_stack_frame_gen_func[vector_offset>>2](vector_offset, pc);
|
cpu_stack_frame_gen_func[vector_offset>>2](vector_offset, pc);
|
||||||
}
|
}
|
||||||
|
@ -196,8 +195,7 @@ void cpuStackFrameGenerate(UWO vector_offset, ULO pc)
|
||||||
|
|
||||||
static void cpuStackFrameInitSetDefaultFunc(cpuStackFrameGenFunc default_func)
|
static void cpuStackFrameInitSetDefaultFunc(cpuStackFrameGenFunc default_func)
|
||||||
{
|
{
|
||||||
ULO i;
|
for (uint32_t i = 0; i < 64; i++)
|
||||||
for (i = 0; i < 64; i++)
|
|
||||||
cpuSetStackFrameGenFunc(i, default_func);
|
cpuSetStackFrameGenFunc(i, default_func);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
50
cpu/defs.h
50
cpu/defs.h
|
@ -1,14 +1,10 @@
|
||||||
#ifndef DEFS_H
|
#pragma once
|
||||||
#define DEFS_H
|
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Maximum values for memory, don't change */
|
/* Maximum values for memory, don't change */
|
||||||
|
|
||||||
|
@ -17,27 +13,19 @@ extern "C" {
|
||||||
#define BOGOMEM 0x1c0000
|
#define BOGOMEM 0x1c0000
|
||||||
#define KICKMEM 0x080000
|
#define KICKMEM 0x080000
|
||||||
|
|
||||||
/* Fellow types to ensure correct sizes */
|
|
||||||
|
|
||||||
typedef uint8_t UBY;
|
|
||||||
typedef uint16_t UWO;
|
|
||||||
typedef uint32_t ULO;
|
|
||||||
typedef uint64_t ULL;
|
|
||||||
typedef int8_t BYT;
|
|
||||||
typedef int16_t WOR;
|
|
||||||
typedef int32_t LON;
|
|
||||||
typedef int64_t LLO;
|
|
||||||
typedef int BOOLE;
|
typedef int BOOLE;
|
||||||
|
|
||||||
#define FALSE 0
|
#define FALSE 0
|
||||||
#define TRUE 1
|
#define TRUE 1
|
||||||
typedef char STR;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#ifndef X64
|
#ifndef X64
|
||||||
#define PTR_TO_INT(i) ((ULO)i)
|
#define PTR_TO_INT(i) ((uint32_t)i)
|
||||||
|
#define PTR_TO_INT_MASK_TYPE(i) ((uint32_t)i)
|
||||||
#endif
|
#endif
|
||||||
#ifdef X64
|
#ifdef X64
|
||||||
#define PTR_TO_INT(i) ((ULL)i)
|
#define PTR_TO_INT(i) ((uint64_t)i)
|
||||||
|
#define PTR_TO_INT_MASK_TYPE(i) ((uint64_t)i)
|
||||||
#endif
|
#endif
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -49,17 +37,17 @@ typedef char STR;
|
||||||
/* The decode routines have this type */
|
/* The decode routines have this type */
|
||||||
/*------------------------------------*/
|
/*------------------------------------*/
|
||||||
|
|
||||||
typedef void (*decoderoutinetype)(ULO,ULO);
|
typedef void (*decoderoutinetype)(uint32_t, uint32_t);
|
||||||
|
|
||||||
extern UBY configromname[];
|
extern uint8_t configromname[];
|
||||||
|
|
||||||
typedef union {
|
typedef union {
|
||||||
ULO *lptr;
|
uint32_t *lptr;
|
||||||
UWO *wptr;
|
uint16_t *wptr;
|
||||||
UBY *bptr;
|
uint8_t *bptr;
|
||||||
ULO lval;
|
uint32_t lval;
|
||||||
UWO wval[2];
|
uint16_t wval[2];
|
||||||
UBY bval[4];
|
uint8_t bval[4];
|
||||||
} ptunion;
|
} ptunion;
|
||||||
|
|
||||||
typedef void (*planar2chunkyroutine)(void);
|
typedef void (*planar2chunkyroutine)(void);
|
||||||
|
@ -69,13 +57,3 @@ typedef void (*sound_before_emu_routine)(void);
|
||||||
typedef void (*sound_after_emu_routine)(void);
|
typedef void (*sound_after_emu_routine)(void);
|
||||||
|
|
||||||
typedef void (*buseventfunc)(void);
|
typedef void (*buseventfunc)(void);
|
||||||
|
|
||||||
#define FELLOWVERSION "WinFellow alpha v0.5.0 build 0 (CVS)"
|
|
||||||
#define FELLOWLONGVERSION "WinFellow Amiga Emulator alpha v0.5.0 - CVS"
|
|
||||||
#define FELLOWNUMERICVERSION "0.5.0.0"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
1692
cpu/fmem.c
1692
cpu/fmem.c
File diff suppressed because it is too large
Load Diff
152
cpu/fmem.h
152
cpu/fmem.h
|
@ -1,41 +1,50 @@
|
||||||
#ifndef FMEM_H
|
#pragma once
|
||||||
#define FMEM_H
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// new functions
|
// MPW
|
||||||
|
|
||||||
extern void memorySetMemory(uint8_t *memory, uint32_t size);
|
extern void memorySetMemory(uint8_t *memory, uint32_t size);
|
||||||
extern void memorySetGlobalLog(uint32_t globalLog);
|
extern void memorySetGlobalLog(uint32_t globalLog);
|
||||||
extern uint8_t *memoryPointer(uint32_t address);
|
extern uint8_t *memoryPointer(uint32_t address);
|
||||||
|
|
||||||
|
|
||||||
|
/* Access for chipset emulation that already have validated addresses */
|
||||||
|
|
||||||
|
#define chipmemReadByte(address) (memory_chip[address])
|
||||||
|
#define chipmemReadWord(address) ((((uint16_t) memory_chip[address]) << 8) | ((uint16_t) memory_chip[address + 1]))
|
||||||
|
#define chipmemWriteWord(data, address) \
|
||||||
|
memory_chip[address] = (uint8_t) (data >> 8); \
|
||||||
|
memory_chip[address + 1] = (uint8_t) data
|
||||||
|
|
||||||
/* Memory access functions */
|
/* Memory access functions */
|
||||||
|
|
||||||
extern UBY memoryReadByte(ULO address);
|
extern uint8_t memoryReadByte(uint32_t address);
|
||||||
extern UWO memoryReadWord(ULO address);
|
extern uint16_t memoryReadWord(uint32_t address);
|
||||||
extern ULO memoryReadLong(ULO address);
|
extern uint32_t memoryReadLong(uint32_t address);
|
||||||
extern uint64_t memoryReadLongLong(ULO address);
|
extern uint64_t memoryReadLongLong(uint32_t address);
|
||||||
extern void memoryWriteByte(UBY data, ULO address);
|
extern void memoryWriteByte(uint8_t data, uint32_t address);
|
||||||
extern void memoryWriteWord(UWO data, ULO address);
|
extern void memoryWriteWord(uint16_t data, uint32_t address);
|
||||||
extern void memoryWriteLong(ULO data, ULO address);
|
extern void memoryWriteLong(uint32_t data, uint32_t address);
|
||||||
extern void memoryWriteLongLong(uint64_t data, ULO address);
|
extern void memoryWriteLongLong(uint64_t data, uint32_t address);
|
||||||
|
|
||||||
extern UWO memoryChipReadWord(ULO address);
|
extern uint16_t memoryChipReadWord(uint32_t address);
|
||||||
extern void memoryChipWriteWord(UWO data, ULO address);
|
extern void memoryChipWriteWord(uint16_t data, uint32_t address);
|
||||||
|
|
||||||
#define memoryReadByteFromPointer(address) (address[0])
|
#define memoryReadByteFromPointer(address) (address[0])
|
||||||
#define memoryReadWordFromPointer(address) ((address[0] << 8) | address[1])
|
#define memoryReadWordFromPointer(address) ((address[0] << 8) | address[1])
|
||||||
#define memoryReadLongFromPointer(address) ((address[0] << 24) | (address[1] << 16) | (address[2] << 8) | address[3])
|
#define memoryReadLongFromPointer(address) ((address[0] << 24) | (address[1] << 16) | (address[2] << 8) | address[3])
|
||||||
|
|
||||||
|
extern void memoryWriteLongToPointer(uint32_t data, uint8_t *address);
|
||||||
|
|
||||||
/* IO Bank functions */
|
/* IO Bank functions */
|
||||||
|
|
||||||
typedef UWO (*memoryIoReadFunc)(ULO address);
|
typedef uint16_t (*memoryIoReadFunc)(uint32_t address);
|
||||||
typedef void (*memoryIoWriteFunc)(UWO data, ULO address);
|
typedef void (*memoryIoWriteFunc)(uint16_t data, uint32_t address);
|
||||||
|
|
||||||
extern void memorySetIoReadStub(ULO index, memoryIoReadFunc ioreadfunction);
|
extern void memorySetIoReadStub(uint32_t index, memoryIoReadFunc ioreadfunction);
|
||||||
extern void memorySetIoWriteStub(ULO index, memoryIoWriteFunc iowritefunction);
|
extern void memorySetIoWriteStub(uint32_t index, memoryIoWriteFunc iowritefunction);
|
||||||
|
|
||||||
/* For the copper */
|
/* For the copper */
|
||||||
extern memoryIoWriteFunc memory_iobank_write[257];
|
extern memoryIoWriteFunc memory_iobank_write[257];
|
||||||
|
@ -43,23 +52,24 @@ extern memoryIoWriteFunc memory_iobank_write[257];
|
||||||
/* Expansion card functions */
|
/* Expansion card functions */
|
||||||
|
|
||||||
typedef void (*memoryEmemCardInitFunc)(void);
|
typedef void (*memoryEmemCardInitFunc)(void);
|
||||||
typedef void (*memoryEmemCardMapFunc)(ULO);
|
typedef void (*memoryEmemCardMapFunc)(uint32_t);
|
||||||
|
|
||||||
extern void memoryEmemClear(void);
|
extern void memoryEmemClear(void);
|
||||||
extern void memoryEmemCardAdd(memoryEmemCardInitFunc cardinit,
|
extern void memoryEmemCardAdd(memoryEmemCardInitFunc cardinit,
|
||||||
memoryEmemCardMapFunc cardmap);
|
memoryEmemCardMapFunc cardmap);
|
||||||
extern void memoryEmemSet(ULO index, ULO data);
|
extern void memoryEmemSet(uint32_t index, uint32_t data);
|
||||||
extern void memoryEmemMirror(ULO emem_offset, UBY *src, ULO size);
|
extern void memoryEmemMirror(uint32_t emem_offset, uint8_t *src, uint32_t size);
|
||||||
|
|
||||||
/* Device memory functions. fhfile is using these. */
|
/* Device memory functions. fhfile is using these. */
|
||||||
|
|
||||||
extern void memoryDmemSetByte(UBY data);
|
extern void memoryDmemSetByte(uint8_t data);
|
||||||
extern void memoryDmemSetWord(UWO data);
|
extern void memoryDmemSetWord(uint16_t data);
|
||||||
extern void memoryDmemSetLong(ULO data);
|
extern void memoryDmemSetLong(uint32_t data);
|
||||||
extern void memoryDmemSetLongNoCounter(ULO data, ULO offset);
|
extern void memoryDmemSetLongNoCounter(uint32_t data, uint32_t offset);
|
||||||
extern void memoryDmemSetString(STR *data);
|
extern void memoryDmemSetString(const char *data);
|
||||||
extern void memoryDmemSetCounter(ULO val);
|
extern void memoryDmemSetCounter(uint32_t val);
|
||||||
extern ULO memoryDmemGetCounter(void);
|
extern uint32_t memoryDmemGetCounter(void);
|
||||||
|
extern uint32_t memoryDmemGetCounterWithoutOffset(void);
|
||||||
extern void memoryDmemClear(void);
|
extern void memoryDmemClear(void);
|
||||||
|
|
||||||
/* Module management functions */
|
/* Module management functions */
|
||||||
|
@ -76,12 +86,12 @@ extern void memoryShutdown(void);
|
||||||
|
|
||||||
/* Memory bank functions */
|
/* Memory bank functions */
|
||||||
|
|
||||||
typedef UBY (*memoryReadByteFunc)(ULO address);
|
typedef uint8_t (*memoryReadByteFunc)(uint32_t address);
|
||||||
typedef UWO (*memoryReadWordFunc)(ULO address);
|
typedef uint16_t (*memoryReadWordFunc)(uint32_t address);
|
||||||
typedef ULO (*memoryReadLongFunc)(ULO address);
|
typedef uint32_t (*memoryReadLongFunc)(uint32_t address);
|
||||||
typedef void (*memoryWriteByteFunc)(UBY data, ULO address);
|
typedef void (*memoryWriteByteFunc)(uint8_t data, uint32_t address);
|
||||||
typedef void (*memoryWriteWordFunc)(UWO data, ULO address);
|
typedef void (*memoryWriteWordFunc)(uint16_t data, uint32_t address);
|
||||||
typedef void (*memoryWriteLongFunc)(ULO data, ULO address);
|
typedef void (*memoryWriteLongFunc)(uint32_t data, uint32_t address);
|
||||||
|
|
||||||
extern memoryReadByteFunc memory_bank_readbyte[65536];
|
extern memoryReadByteFunc memory_bank_readbyte[65536];
|
||||||
extern memoryReadWordFunc memory_bank_readword[65536];
|
extern memoryReadWordFunc memory_bank_readword[65536];
|
||||||
|
@ -90,8 +100,8 @@ extern memoryWriteByteFunc memory_bank_writebyte[65536];
|
||||||
extern memoryWriteWordFunc memory_bank_writeword[65536];
|
extern memoryWriteWordFunc memory_bank_writeword[65536];
|
||||||
extern memoryWriteLongFunc memory_bank_writelong[65536];
|
extern memoryWriteLongFunc memory_bank_writelong[65536];
|
||||||
|
|
||||||
extern UBY *memory_bank_pointer[65536];
|
extern uint8_t *memory_bank_pointer[65536];
|
||||||
extern UBY *memory_bank_datapointer[65536];
|
extern uint8_t *memory_bank_datapointer[65536];
|
||||||
|
|
||||||
extern void memoryBankSet(memoryReadByteFunc rb,
|
extern void memoryBankSet(memoryReadByteFunc rb,
|
||||||
memoryReadWordFunc rw,
|
memoryReadWordFunc rw,
|
||||||
|
@ -99,39 +109,43 @@ extern void memoryBankSet(memoryReadByteFunc rb,
|
||||||
memoryWriteByteFunc wb,
|
memoryWriteByteFunc wb,
|
||||||
memoryWriteWordFunc ww,
|
memoryWriteWordFunc ww,
|
||||||
memoryWriteLongFunc wl,
|
memoryWriteLongFunc wl,
|
||||||
UBY *basep,
|
uint8_t *basep,
|
||||||
ULO bank,
|
uint32_t bank,
|
||||||
ULO basebank,
|
uint32_t basebank,
|
||||||
BOOLE pointer_can_write);
|
BOOLE pointer_can_write);
|
||||||
extern UBY *memoryAddressToPtr(ULO address);
|
extern uint8_t *memoryAddressToPtr(uint32_t address);
|
||||||
extern void memoryChipMap(BOOLE overlay);
|
extern void memoryChipMap(bool overlay);
|
||||||
|
|
||||||
/* Memory configuration properties */
|
/* Memory configuration properties */
|
||||||
|
|
||||||
extern BOOLE memorySetChipSize(ULO chipsize);
|
extern BOOLE memorySetChipSize(uint32_t chipsize);
|
||||||
extern ULO memoryGetChipSize(void);
|
extern uint32_t memoryGetChipSize(void);
|
||||||
extern BOOLE memorySetFastSize(ULO fastsize);
|
extern BOOLE memorySetFastSize(uint32_t fastsize);
|
||||||
extern ULO memoryGetFastSize(void);
|
extern uint32_t memoryGetFastSize(void);
|
||||||
extern void memorySetFastAllocatedSize(ULO fastallocatedsize);
|
extern void memorySetFastAllocatedSize(uint32_t fastallocatedsize);
|
||||||
extern ULO memoryGetFastAllocatedSize(void);
|
extern uint32_t memoryGetFastAllocatedSize(void);
|
||||||
extern BOOLE memorySetSlowSize(ULO bogosize);
|
extern BOOLE memorySetSlowSize(uint32_t bogosize);
|
||||||
extern ULO memoryGetSlowSize(void);
|
extern uint32_t memoryGetSlowSize(void);
|
||||||
extern BOOLE memorySetUseAutoconfig(BOOLE useautoconfig);
|
extern bool memorySetUseAutoconfig(bool useautoconfig);
|
||||||
extern BOOLE memoryGetUseAutoconfig(void);
|
extern bool memoryGetUseAutoconfig(void);
|
||||||
extern BOOLE memorySetAddress32Bit(BOOLE address32bit);
|
extern BOOLE memorySetAddress32Bit(BOOLE address32bit);
|
||||||
extern BOOLE memoryGetAddress32Bit(void);
|
extern BOOLE memoryGetAddress32Bit(void);
|
||||||
extern BOOLE memorySetKickImage(STR *kickimage);
|
extern BOOLE memorySetKickImage(char *kickimage);
|
||||||
extern STR *memoryGetKickImage(void);
|
extern BOOLE memorySetKickImageExtended(char *kickimageext);
|
||||||
extern void memorySetKey(STR *key);
|
extern char *memoryGetKickImage(void);
|
||||||
extern STR *memoryGetKey(void);
|
extern void memorySetKey(char *key);
|
||||||
|
extern char *memoryGetKey(void);
|
||||||
extern BOOLE memoryGetKickImageOK(void);
|
extern BOOLE memoryGetKickImageOK(void);
|
||||||
|
|
||||||
/* Derived from memory configuration */
|
/* Derived from memory configuration */
|
||||||
|
|
||||||
extern ULO memoryGetKickImageBaseBank(void);
|
extern uint32_t memoryGetKickImageBaseBank(void);
|
||||||
extern ULO memoryGetKickImageVersion(void);
|
extern uint32_t memoryGetKickImageVersion(void);
|
||||||
extern ULO memoryInitialPC(void);
|
extern uint32_t memoryInitialPC(void);
|
||||||
extern ULO memoryInitialSP(void);
|
extern uint32_t memoryInitialSP(void);
|
||||||
|
|
||||||
|
/* Kickstart decryption */
|
||||||
|
extern int memoryKickLoadAF2(char *filename, FILE *F, uint8_t *memory_kick, const bool);
|
||||||
|
|
||||||
/* Kickstart load error handling */
|
/* Kickstart load error handling */
|
||||||
|
|
||||||
|
@ -148,21 +162,19 @@ extern ULO memoryInitialSP(void);
|
||||||
|
|
||||||
/* Global variables */
|
/* Global variables */
|
||||||
|
|
||||||
extern UBY memory_chip[];
|
extern uint8_t memory_chip[];
|
||||||
extern UBY *memory_fast;
|
extern uint8_t *memory_fast;
|
||||||
extern UBY memory_slow[];
|
extern uint8_t memory_slow[];
|
||||||
extern UBY memory_kick[];
|
extern uint8_t memory_kick[];
|
||||||
extern ULO memory_chipsize;
|
extern uint32_t memory_chipsize;
|
||||||
extern UBY memory_emem[];
|
extern uint8_t memory_emem[];
|
||||||
|
|
||||||
extern ULO intenar,intena,intreq;
|
extern uint32_t potgor;
|
||||||
extern ULO potgor;
|
|
||||||
|
|
||||||
extern ULO memory_fault_address;
|
extern uint32_t memory_fault_address;
|
||||||
extern BOOLE memory_fault_read;
|
extern BOOLE memory_fault_read;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
22
cpu/memory.c
22
cpu/memory.c
|
@ -8,14 +8,14 @@
|
||||||
/*============================================================================*/
|
/*============================================================================*/
|
||||||
|
|
||||||
BOOLE memory_fault_read = FALSE; /* TRUE - read / FALSE - write */
|
BOOLE memory_fault_read = FALSE; /* TRUE - read / FALSE - write */
|
||||||
ULO memory_fault_address = 0;
|
uint32_t memory_fault_address = 0;
|
||||||
|
|
||||||
/*==============================================================================
|
/*==============================================================================
|
||||||
Raises exception 3 when a word or long is accessing an odd address
|
Raises exception 3 when a word or long is accessing an odd address
|
||||||
and the CPU is < 020
|
and the CPU is < 020
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
static void memoryOddRead(ULO address)
|
static void memoryOddRead(uint32_t address)
|
||||||
{
|
{
|
||||||
if (address & 1)
|
if (address & 1)
|
||||||
{
|
{
|
||||||
|
@ -28,7 +28,7 @@ static void memoryOddRead(ULO address)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void memoryOddWrite(ULO address)
|
static void memoryOddWrite(uint32_t address)
|
||||||
{
|
{
|
||||||
if (address & 1)
|
if (address & 1)
|
||||||
{
|
{
|
||||||
|
@ -75,7 +75,7 @@ uint8_t *memoryPointer(uint32_t address)
|
||||||
|
|
||||||
// memory read of 0xffffffff not handled correctly
|
// memory read of 0xffffffff not handled correctly
|
||||||
// since the unsigned compare overflows.
|
// since the unsigned compare overflows.
|
||||||
UBY memoryReadByte(ULO address)
|
uint8_t memoryReadByte(uint32_t address)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (MemoryLoggingFunc)
|
if (MemoryLoggingFunc)
|
||||||
|
@ -88,7 +88,7 @@ UBY memoryReadByte(ULO address)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
UWO memoryReadWord(ULO address)
|
uint16_t memoryReadWord(uint32_t address)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (MemoryLoggingFunc)
|
if (MemoryLoggingFunc)
|
||||||
|
@ -103,7 +103,7 @@ UWO memoryReadWord(ULO address)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULO memoryReadLong(ULO address)
|
uint32_t memoryReadLong(uint32_t address)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (MemoryLoggingFunc)
|
if (MemoryLoggingFunc)
|
||||||
|
@ -121,7 +121,7 @@ ULO memoryReadLong(ULO address)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uint64_t memoryReadLongLong(ULO address)
|
uint64_t memoryReadLongLong(uint32_t address)
|
||||||
{
|
{
|
||||||
uint64_t tmp;
|
uint64_t tmp;
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ uint64_t memoryReadLongLong(ULO address)
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void memoryWriteByte(UBY data, ULO address)
|
void memoryWriteByte(uint8_t data, uint32_t address)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (MemoryLoggingFunc)
|
if (MemoryLoggingFunc)
|
||||||
|
@ -144,7 +144,7 @@ void memoryWriteByte(UBY data, ULO address)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void memoryWriteWord(UWO data, ULO address)
|
void memoryWriteWord(uint16_t data, uint32_t address)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (MemoryLoggingFunc)
|
if (MemoryLoggingFunc)
|
||||||
|
@ -159,7 +159,7 @@ void memoryWriteWord(UWO data, ULO address)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void memoryWriteLong(ULO data, ULO address)
|
void memoryWriteLong(uint32_t data, uint32_t address)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (MemoryLoggingFunc)
|
if (MemoryLoggingFunc)
|
||||||
|
@ -178,7 +178,7 @@ void memoryWriteLong(ULO data, ULO address)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void memoryWriteLongLong(uint64_t data, ULO address)
|
void memoryWriteLongLong(uint64_t data, uint32_t address)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (address & 0x01) memoryOddWrite(address);
|
if (address & 0x01) memoryOddWrite(address);
|
||||||
|
|
2
libsane
2
libsane
|
@ -1 +1 @@
|
||||||
Subproject commit 9c2af7c48dcbb58a5af436c295e83643c7f33f8b
|
Subproject commit 8a47aacd7d8a19566701ae60dd03ff3c6e6b3634
|
|
@ -107,7 +107,7 @@ enum macos_error {
|
||||||
envVersTooBig = -5502, /*Version bigger than call can handle*/
|
envVersTooBig = -5502, /*Version bigger than call can handle*/
|
||||||
fontDecError = -64, /*error during font declaration*/
|
fontDecError = -64, /*error during font declaration*/
|
||||||
fontNotDeclared = -65, /*font not declared*/
|
fontNotDeclared = -65, /*font not declared*/
|
||||||
fontSubErr = -66, /*font substitution occured*/
|
fontSubErr = -66, /*font substitution occurred*/
|
||||||
fontNotOutlineErr = -32615, /*bitmap font passed to routine that does outlines only*/
|
fontNotOutlineErr = -32615, /*bitmap font passed to routine that does outlines only*/
|
||||||
firstDskErr = -84, /*I/O System Errors*/
|
firstDskErr = -84, /*I/O System Errors*/
|
||||||
lastDskErr = -64, /*I/O System Errors*/
|
lastDskErr = -64, /*I/O System Errors*/
|
||||||
|
@ -196,7 +196,7 @@ enum macos_error {
|
||||||
rgnTooBigErr = -500,
|
rgnTooBigErr = -500,
|
||||||
updPixMemErr = -125, /*insufficient memory to update a pixmap*/
|
updPixMemErr = -125, /*insufficient memory to update a pixmap*/
|
||||||
pictInfoVersionErr = -11000, /* wrong version of the PictInfo structure */
|
pictInfoVersionErr = -11000, /* wrong version of the PictInfo structure */
|
||||||
pictInfoIDErr = -11001, /* the internal consistancy check for the PictInfoID is wrong */
|
pictInfoIDErr = -11001, /* the internal consistency check for the PictInfoID is wrong */
|
||||||
pictInfoVerbErr = -11002, /* the passed verb was invalid */
|
pictInfoVerbErr = -11002, /* the passed verb was invalid */
|
||||||
cantLoadPickMethodErr = -11003, /* unable to load the custom pick proc */
|
cantLoadPickMethodErr = -11003, /* unable to load the custom pick proc */
|
||||||
colorsRequestedErr = -11004, /* the number of colors requested was illegal */
|
colorsRequestedErr = -11004, /* the number of colors requested was illegal */
|
||||||
|
@ -249,7 +249,7 @@ enum macos_error {
|
||||||
smEmptySlot = -300, /*No card in slot*/
|
smEmptySlot = -300, /*No card in slot*/
|
||||||
smCRCFail = -301, /*CRC check failed for declaration data*/
|
smCRCFail = -301, /*CRC check failed for declaration data*/
|
||||||
smFormatErr = -302, /*FHeader Format is not Apple's*/
|
smFormatErr = -302, /*FHeader Format is not Apple's*/
|
||||||
smRevisionErr = -303, /*Wrong revison level*/
|
smRevisionErr = -303, /*Wrong revision level*/
|
||||||
smNoDir = -304, /*Directory offset is Nil */
|
smNoDir = -304, /*Directory offset is Nil */
|
||||||
smDisabledSlot = -305, /*This slot is disabled (-305 use to be smLWTstBad)*/
|
smDisabledSlot = -305, /*This slot is disabled (-305 use to be smLWTstBad)*/
|
||||||
smNosInfoArray = -306, /*No sInfoArray. Memory Mgr error.*/
|
smNosInfoArray = -306, /*No sInfoArray. Memory Mgr error.*/
|
||||||
|
@ -258,14 +258,14 @@ enum macos_error {
|
||||||
smResrvErr = -307, /*Fatal reserved error. Resreved field <> 0.*/
|
smResrvErr = -307, /*Fatal reserved error. Resreved field <> 0.*/
|
||||||
smUnExBusErr = -308, /*Unexpected BusError*/
|
smUnExBusErr = -308, /*Unexpected BusError*/
|
||||||
smBLFieldBad = -309, /*ByteLanes field was bad.*/
|
smBLFieldBad = -309, /*ByteLanes field was bad.*/
|
||||||
smFHBlockRdErr = -310, /*Error occured during _sGetFHeader.*/
|
smFHBlockRdErr = -310, /*Error occurred during _sGetFHeader.*/
|
||||||
smFHBlkDispErr = -311, /*Error occured during _sDisposePtr (Dispose of FHeader block).*/
|
smFHBlkDispErr = -311, /*Error occurred during _sDisposePtr (Dispose of FHeader block).*/
|
||||||
smDisposePErr = -312, /*_DisposePointer error*/
|
smDisposePErr = -312, /*_DisposePointer error*/
|
||||||
smNoBoardSRsrc = -313, /*No Board sResource.*/
|
smNoBoardSRsrc = -313, /*No Board sResource.*/
|
||||||
smGetPRErr = -314, /*Error occured during _sGetPRAMRec (See SIMStatus).*/
|
smGetPRErr = -314, /*Error occurred during _sGetPRAMRec (See SIMStatus).*/
|
||||||
smNoBoardId = -315, /*No Board Id.*/
|
smNoBoardId = -315, /*No Board Id.*/
|
||||||
smInitStatVErr = -316, /*The InitStatusV field was negative after primary or secondary init.*/
|
smInitStatVErr = -316, /*The InitStatusV field was negative after primary or secondary init.*/
|
||||||
smInitTblVErr = -317, /*An error occured while trying to initialize the Slot Resource Table.*/
|
smInitTblVErr = -317, /*An error occurred while trying to initialize the Slot Resource Table.*/
|
||||||
smNoJmpTbl = -318, /*SDM jump table could not be created.*/
|
smNoJmpTbl = -318, /*SDM jump table could not be created.*/
|
||||||
smBadBoardId = -319, /*BoardId was wrong; re-init the PRAM record.*/
|
smBadBoardId = -319, /*BoardId was wrong; re-init the PRAM record.*/
|
||||||
smBusErrTO = -320, /*BusError time out.*/
|
smBusErrTO = -320, /*BusError time out.*/
|
||||||
|
@ -285,20 +285,20 @@ but a special error is needed to patch secondary inits.*/
|
||||||
|
|
||||||
smCPUErr = -334, /*Code revision is wrong*/
|
smCPUErr = -334, /*Code revision is wrong*/
|
||||||
smsPointerNil = -335, /*LPointer is nil From sOffsetData. If this error occurs; check sInfo rec for more information.*/
|
smsPointerNil = -335, /*LPointer is nil From sOffsetData. If this error occurs; check sInfo rec for more information.*/
|
||||||
smNilsBlockErr = -336, /*Nil sBlock error (Dont allocate and try to use a nil sBlock)*/
|
smNilsBlockErr = -336, /*Nil sBlock error (Don't allocate and try to use a nil sBlock)*/
|
||||||
smSlotOOBErr = -337, /*Slot out of bounds error*/
|
smSlotOOBErr = -337, /*Slot out of bounds error*/
|
||||||
smSelOOBErr = -338, /*Selector out of bounds error*/
|
smSelOOBErr = -338, /*Selector out of bounds error*/
|
||||||
smNewPErr = -339, /*_NewPtr error*/
|
smNewPErr = -339, /*_NewPtr error*/
|
||||||
smBlkMoveErr = -340, /*_BlockMove error*/
|
smBlkMoveErr = -340, /*_BlockMove error*/
|
||||||
smCkStatusErr = -341, /*Status of slot = fail.*/
|
smCkStatusErr = -341, /*Status of slot = fail.*/
|
||||||
smGetDrvrNamErr = -342, /*Error occured during _sGetDrvrName.*/
|
smGetDrvrNamErr = -342, /*Error occurred during _sGetDrvrName.*/
|
||||||
smDisDrvrNamErr = -343, /*Error occured during _sDisDrvrName.*/
|
smDisDrvrNamErr = -343, /*Error occurred during _sDisDrvrName.*/
|
||||||
smNoMoresRsrcs = -344, /*No more sResources*/
|
smNoMoresRsrcs = -344, /*No more sResources*/
|
||||||
smsGetDrvrErr = -345, /*Error occurred during _sGetDriver.*/
|
smsGetDrvrErr = -345, /*Error occurred during _sGetDriver.*/
|
||||||
smBadsPtrErr = -346, /*Bad pointer was passed to sCalcsPointer*/
|
smBadsPtrErr = -346, /*Bad pointer was passed to sCalcsPointer*/
|
||||||
smByteLanesErr = -347, /*NumByteLanes was determined to be zero.*/
|
smByteLanesErr = -347, /*NumByteLanes was determined to be zero.*/
|
||||||
smOffsetErr = -348, /*Offset was too big (temporary error*/
|
smOffsetErr = -348, /*Offset was too big (temporary error*/
|
||||||
smNoGoodOpens = -349, /*No opens were successfull in the loop.*/
|
smNoGoodOpens = -349, /*No opens were successful in the loop.*/
|
||||||
smSRTOvrFlErr = -350, /*SRT over flow.*/
|
smSRTOvrFlErr = -350, /*SRT over flow.*/
|
||||||
smRecNotFnd = -351, /*Record not found in the SRT.*/
|
smRecNotFnd = -351, /*Record not found in the SRT.*/
|
||||||
editionMgrInitErr = -450, /*edition manager not inited by this app*/
|
editionMgrInitErr = -450, /*edition manager not inited by this app*/
|
||||||
|
@ -333,7 +333,7 @@ but a special error is needed to patch secondary inits.*/
|
||||||
|
|
||||||
interruptsMaskedErr = -624, /*don't call with interrupts masked*/
|
interruptsMaskedErr = -624, /*don't call with interrupts masked*/
|
||||||
cannotDeferErr = -625, /*unable to defer additional functions*/
|
cannotDeferErr = -625, /*unable to defer additional functions*/
|
||||||
ddpSktErr = -91, /*error in soket number*/
|
ddpSktErr = -91, /*error in socket number*/
|
||||||
ddpLenErr = -92, /*data length too big*/
|
ddpLenErr = -92, /*data length too big*/
|
||||||
noBridgeErr = -93, /*no network bridge for non-local send*/
|
noBridgeErr = -93, /*no network bridge for non-local send*/
|
||||||
lapProtErr = -94, /*error in attaching/detaching protocol*/
|
lapProtErr = -94, /*error in attaching/detaching protocol*/
|
||||||
|
@ -453,7 +453,7 @@ but a special error is needed to patch secondary inits.*/
|
||||||
noDefaultUserErr = -922, /* user hasn't typed in owners name in Network Setup Control Pannel */
|
noDefaultUserErr = -922, /* user hasn't typed in owners name in Network Setup Control Pannel */
|
||||||
notLoggedInErr = -923, /* The default userRefNum does not yet exist */
|
notLoggedInErr = -923, /* The default userRefNum does not yet exist */
|
||||||
noUserRefErr = -924, /* unable to create a new userRefNum */
|
noUserRefErr = -924, /* unable to create a new userRefNum */
|
||||||
networkErr = -925, /* An error has occured in the network, not too likely */
|
networkErr = -925, /* An error has occurred in the network, not too likely */
|
||||||
noInformErr = -926, /* PPCStart failed because destination did not have inform pending */
|
noInformErr = -926, /* PPCStart failed because destination did not have inform pending */
|
||||||
authFailErr = -927, /* unable to authenticate user at destination */
|
authFailErr = -927, /* unable to authenticate user at destination */
|
||||||
noUserRecErr = -928, /* Invalid user reference number */
|
noUserRecErr = -928, /* Invalid user reference number */
|
||||||
|
|
|
@ -60,7 +60,7 @@ enum {
|
||||||
SMGlobals = 0x0CC4, /* (long) pointer to Sound Manager Globals*/
|
SMGlobals = 0x0CC4, /* (long) pointer to Sound Manager Globals*/
|
||||||
TheGDevice = 0x0CC8, /*[GLOBAL VAR] (long) the current graphics device*/
|
TheGDevice = 0x0CC8, /*[GLOBAL VAR] (long) the current graphics device*/
|
||||||
CQDGlobals = 0x0CCC, /* (long) quickDraw global extensions*/
|
CQDGlobals = 0x0CCC, /* (long) quickDraw global extensions*/
|
||||||
ADBBase = 0x0CF8, /*[GLOBAL VAR] (long) pointer to Front Desk Buss Variables*/
|
ADBBase = 0x0CF8, /*[GLOBAL VAR] (long) pointer to Front Desk Bus Variables*/
|
||||||
WarmStart = 0x0CFC, /*[GLOBAL VAR] (long) flag to indicate it is a warm start*/
|
WarmStart = 0x0CFC, /*[GLOBAL VAR] (long) flag to indicate it is a warm start*/
|
||||||
TimeDBRA = 0x0D00, /*[GLOBAL VAR] (word) number of iterations of DBRA per millisecond*/
|
TimeDBRA = 0x0D00, /*[GLOBAL VAR] (word) number of iterations of DBRA per millisecond*/
|
||||||
TimeSCCDB = 0x0D02, /*[GLOBAL VAR] (word) number of iter's of SCC access & DBRA.*/
|
TimeSCCDB = 0x0D02, /*[GLOBAL VAR] (word) number of iter's of SCC access & DBRA.*/
|
||||||
|
|
|
@ -1047,7 +1047,7 @@ enum {
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
_ALMDispatch = 0xAAA4 /* Apple Location Manger*/
|
_ALMDispatch = 0xAAA4 /* Apple Location Manager*/
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
|
|
@ -73,7 +73,7 @@
|
||||||
* include stdint.h. The hope is that one or the other can be
|
* include stdint.h. The hope is that one or the other can be
|
||||||
* used with no real difference.
|
* used with no real difference.
|
||||||
*
|
*
|
||||||
* 5) In the current verison, if your platform can't represent
|
* 5) In the current version, if your platform can't represent
|
||||||
* int32_t, int16_t and int8_t, it just dumps out with a compiler
|
* int32_t, int16_t and int8_t, it just dumps out with a compiler
|
||||||
* error.
|
* error.
|
||||||
*
|
*
|
||||||
|
|
|
@ -7,7 +7,7 @@ set(MPW_SRC mpw.cpp mpw_io.cpp mpw_close.cpp mpw_access.cpp mpw_ioctl.cpp mpw_er
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT environment.cpp
|
OUTPUT environment.cpp
|
||||||
COMMAND ragel -p -G2 -o environment.cpp "${CMAKE_CURRENT_SOURCE_DIR}/environment.rl"
|
COMMAND "${RAGEL}" -p -G2 -o environment.cpp "${CMAKE_CURRENT_SOURCE_DIR}/environment.rl"
|
||||||
MAIN_DEPENDENCY environment.rl
|
MAIN_DEPENDENCY environment.rl
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ namespace MPW
|
||||||
int fd = f.cookie;
|
int fd = f.cookie;
|
||||||
ssize_t size;
|
ssize_t size;
|
||||||
|
|
||||||
Log(" read(%04x, %08x, %08x)", fd, f.buffer, f.count);
|
Log(" read(%04x, %08x, %08x)\n", fd, f.buffer, f.count);
|
||||||
size = OS::Internal::FDEntry::read(fd, memoryPointer(f.buffer), f.count);
|
size = OS::Internal::FDEntry::read(fd, memoryPointer(f.buffer), f.count);
|
||||||
//Log(" -> %ld\n", size);
|
//Log(" -> %ld\n", size);
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ set(TOOLBOX_SRC
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT pathnames.cpp
|
OUTPUT pathnames.cpp
|
||||||
COMMAND ragel -p -G2 -o pathnames.cpp "${CMAKE_CURRENT_SOURCE_DIR}/pathnames.rl"
|
COMMAND "${RAGEL}" -p -G2 -o pathnames.cpp "${CMAKE_CURRENT_SOURCE_DIR}/pathnames.rl"
|
||||||
MAIN_DEPENDENCY pathnames.rl
|
MAIN_DEPENDENCY pathnames.rl
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
#include <macos/traps.h>
|
#include <macos/traps.h>
|
||||||
|
|
||||||
// yuck. TST.W d0
|
// yuck. TST.W d0
|
||||||
extern "C" void cpuSetFlagsNZ00NewW(UWO res);
|
extern "C" void cpuSetFlagsNZ00NewW(uint16_t res);
|
||||||
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -505,7 +505,7 @@ namespace ToolBox {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Push<4>(returnPC == 0 ? cpuGetPC() : returnPC);
|
Push<4>(returnPC == 0 ? cpuGetPC() : returnPC);
|
||||||
Log("$04x *%s - $%08x", trap, TrapName(trap), address);
|
Log("$04x *%s - $%08x\n", trap, TrapName(trap), address);
|
||||||
cpuInitializeFromNewPC(address);
|
cpuInitializeFromNewPC(address);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -835,6 +835,15 @@ namespace ToolBox {
|
||||||
d0 = OS::CmpString(trap);
|
d0 = OS::CmpString(trap);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
//_RelString [MARKS,CASE]
|
||||||
|
case 0xa050:
|
||||||
|
case 0xa250:
|
||||||
|
case 0xa450:
|
||||||
|
case 0xa650:
|
||||||
|
d0 = OS::RelString(trap);
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
// NewPtr [Sys, Clear] (logicalSize: Size): Ptr;
|
// NewPtr [Sys, Clear] (logicalSize: Size): Ptr;
|
||||||
case 0xa11e:
|
case 0xa11e:
|
||||||
case 0xa31e:
|
case 0xa31e:
|
||||||
|
|
|
@ -1203,7 +1203,7 @@ namespace MM
|
||||||
|
|
||||||
const auto &info = iter->second;
|
const auto &info = iter->second;
|
||||||
|
|
||||||
// resouce not yet supported...
|
// resource not yet supported...
|
||||||
// would need extra field and support in RM:: when
|
// would need extra field and support in RM:: when
|
||||||
// creating.
|
// creating.
|
||||||
// see HSetRBit, HClrRBit
|
// see HSetRBit, HClrRBit
|
||||||
|
|
|
@ -800,8 +800,8 @@ namespace OS
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool caseSens = trap & (1 << 9);
|
//bool diacSens = trap & (1 << 9); // ignore for now...
|
||||||
//bool diacSens = trap & (1 << 10); // ignore for now...
|
bool caseSens = trap & (1 << 10);
|
||||||
|
|
||||||
uint32_t aStr = cpuGetAReg(0);
|
uint32_t aStr = cpuGetAReg(0);
|
||||||
uint32_t bStr = cpuGetAReg(1);
|
uint32_t bStr = cpuGetAReg(1);
|
||||||
|
@ -838,6 +838,55 @@ namespace OS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint16_t RelString(uint16_t trap)
|
||||||
|
{
|
||||||
|
|
||||||
|
/*
|
||||||
|
* on entry:
|
||||||
|
* A0 Pointer to first character of first string
|
||||||
|
* A1 Pointer to first character of second string
|
||||||
|
* D0 (high) length of first string
|
||||||
|
* D0 (low) length of second string
|
||||||
|
*
|
||||||
|
* on exit:
|
||||||
|
* D0 0 if strings equal, -1 if first < second, 1 if first > second
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
//bool diacSens = trap & (1 << 9); // ignore for now...
|
||||||
|
bool caseSens = trap & (1 << 10);
|
||||||
|
|
||||||
|
uint32_t aStr = cpuGetAReg(0);
|
||||||
|
uint32_t bStr = cpuGetAReg(1);
|
||||||
|
|
||||||
|
uint32_t length = cpuGetDReg(0);
|
||||||
|
|
||||||
|
uint32_t aLen = (length >> 16);
|
||||||
|
uint32_t bLen = (length & 0xffff);
|
||||||
|
|
||||||
|
std::string a = ToolBox::ReadString(aStr, aLen);
|
||||||
|
std::string b = ToolBox::ReadString(bStr, bLen);
|
||||||
|
|
||||||
|
Log("%04x RelString(%s, %s)\n", trap, a.c_str(), b.c_str());
|
||||||
|
|
||||||
|
if (aStr == bStr) return 0; // same ptr...
|
||||||
|
|
||||||
|
for (uint32_t i = 0; i < std::min(aLen, bLen); ++i) {
|
||||||
|
unsigned aa = a[i];
|
||||||
|
unsigned bb = b[i];
|
||||||
|
if (!caseSens) {
|
||||||
|
aa = toupper(aa);
|
||||||
|
bb = toupper(bb);
|
||||||
|
}
|
||||||
|
if (aa == bb) continue;
|
||||||
|
return aa < bb ? -1 : 1;
|
||||||
|
}
|
||||||
|
if (aLen == bLen) return 0;
|
||||||
|
return aLen < bLen ? -1 : 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#pragma mark - Time Utilities
|
#pragma mark - Time Utilities
|
||||||
|
|
||||||
time_t UnixToMac(time_t t)
|
time_t UnixToMac(time_t t)
|
||||||
|
|
|
@ -71,6 +71,7 @@ namespace OS
|
||||||
|
|
||||||
#pragma mark String Utilities
|
#pragma mark String Utilities
|
||||||
uint16_t CmpString(uint16_t trap);
|
uint16_t CmpString(uint16_t trap);
|
||||||
|
uint16_t RelString(uint16_t trap);
|
||||||
|
|
||||||
|
|
||||||
#pragma mark - Time Utilities
|
#pragma mark - Time Utilities
|
||||||
|
|
|
@ -83,8 +83,8 @@ namespace OS {
|
||||||
{
|
{
|
||||||
char buffer[PATH_MAX + 1];
|
char buffer[PATH_MAX + 1];
|
||||||
|
|
||||||
// FSSpecs are valid for non-existant files
|
// FSSpecs are valid for non-existent files
|
||||||
// but not non-existant directories.
|
// but not non-existent directories.
|
||||||
// realpath does not behave in such a manner.
|
// realpath does not behave in such a manner.
|
||||||
|
|
||||||
// expand the path. Also handles relative paths.
|
// expand the path. Also handles relative paths.
|
||||||
|
@ -106,8 +106,6 @@ namespace OS {
|
||||||
{
|
{
|
||||||
// FSMakeFSSpec(vRefNum: Integer; dirID: LongInt; fileName: Str255; VAR spec: FSSpec): OSErr;
|
// FSMakeFSSpec(vRefNum: Integer; dirID: LongInt; fileName: Str255; VAR spec: FSSpec): OSErr;
|
||||||
|
|
||||||
// todo -- if the file does not exist (but the path is otherwise valid), create the spec but return fnfErr.
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* See Chapter 2, File Manager / Using the File Manager, 2-35
|
* See Chapter 2, File Manager / Using the File Manager, 2-35
|
||||||
*
|
*
|
||||||
|
@ -176,7 +174,9 @@ namespace OS {
|
||||||
// write the filename...
|
// write the filename...
|
||||||
ToolBox::WritePString(spec + 6, leaf);
|
ToolBox::WritePString(spec + 6, leaf);
|
||||||
|
|
||||||
return 0;
|
struct stat st;
|
||||||
|
int rv = ::stat(sname.c_str(), &st);
|
||||||
|
if (rv < 0) return macos_error_from_errno();
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
|
@ -394,17 +394,17 @@ namespace OS {
|
||||||
rv = ::stat(path.c_str(), &st);
|
rv = ::stat(path.c_str(), &st);
|
||||||
if (rv < 0)
|
if (rv < 0)
|
||||||
{
|
{
|
||||||
if (wasAliased) memoryWriteWord(0, wasAliased);
|
if (wasAliased) memoryWriteByte(0, wasAliased);
|
||||||
if (targetIsFolder) memoryWriteWord(0, targetIsFolder);
|
if (targetIsFolder) memoryWriteByte(0, targetIsFolder);
|
||||||
|
|
||||||
return macos_error_from_errno();
|
return macos_error_from_errno();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (targetIsFolder)
|
if (targetIsFolder)
|
||||||
memoryWriteWord(S_ISDIR(st.st_mode) ? 1 : 0, targetIsFolder);
|
memoryWriteByte(S_ISDIR(st.st_mode) ? 1 : 0, targetIsFolder);
|
||||||
|
|
||||||
// don't bother pretending a soft link is an alias.
|
// don't bother pretending a soft link is an alias.
|
||||||
if (wasAliased) memoryWriteWord(0, wasAliased);
|
if (wasAliased) memoryWriteByte(0, wasAliased);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -848,7 +848,7 @@ namespace RM
|
||||||
|
|
||||||
if (nativeSize != info->size) {
|
if (nativeSize != info->size) {
|
||||||
// resize...
|
// resize...
|
||||||
// chould get state / unlock / set state ... but that does nothing in OS X.
|
// could get state / unlock / set state ... but that does nothing in OS X.
|
||||||
|
|
||||||
::SetHandleSize(nativeHandle, info->size);
|
::SetHandleSize(nativeHandle, info->size);
|
||||||
OSErr err = MemError();
|
OSErr err = MemError();
|
||||||
|
|
|
@ -736,7 +736,7 @@ namespace fp = floating_point;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void cpuSetFlagsAbs(UWO f);
|
extern "C" void cpuSetFlagsAbs(uint16_t f);
|
||||||
uint16_t fp68k(uint16_t trap)
|
uint16_t fp68k(uint16_t trap)
|
||||||
{
|
{
|
||||||
uint16_t op;
|
uint16_t op;
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
|
|
||||||
|
|
||||||
// yuck. TST.W d0
|
// yuck. TST.W d0
|
||||||
extern "C" void cpuSetFlagsNZ00NewW(UWO res);
|
extern "C" void cpuSetFlagsNZ00NewW(uint16_t res);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -199,6 +199,14 @@ namespace ToolBox {
|
||||||
d0 = OS::SetFPos(trap);
|
d0 = OS::SetFPos(trap);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// _RelString [,MARKS, CASE]
|
||||||
|
case 0xa050:
|
||||||
|
case 0xa250:
|
||||||
|
case 0xa450:
|
||||||
|
case 0xa650:
|
||||||
|
d0 = OS::RelString(trap);
|
||||||
|
break;
|
||||||
|
|
||||||
case 0xa051:
|
case 0xa051:
|
||||||
d0 = OS::ReadXPRam(trap);
|
d0 = OS::ReadXPRam(trap);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -257,8 +257,8 @@ struct VolumeParam {
|
||||||
unsigned short ioVNmFls; /*number of files in directory*/
|
unsigned short ioVNmFls; /*number of files in directory*/
|
||||||
unsigned short ioVDirSt; /*start block of file directory*/
|
unsigned short ioVDirSt; /*start block of file directory*/
|
||||||
short ioVBlLn; /*GetVolInfo: length of dir in blocks*/
|
short ioVBlLn; /*GetVolInfo: length of dir in blocks*/
|
||||||
unsigned short ioVNmAlBlks; /*for compatibilty ioVNmAlBlks * ioVAlBlkSiz <= 2 GB*/
|
unsigned short ioVNmAlBlks; /*for compatibility ioVNmAlBlks * ioVAlBlkSiz <= 2 GB*/
|
||||||
unsigned long ioVAlBlkSiz; /*for compatibilty ioVAlBlkSiz is <= $0000FE00 (65,024)*/
|
unsigned long ioVAlBlkSiz; /*for compatibility ioVAlBlkSiz is <= $0000FE00 (65,024)*/
|
||||||
unsigned long ioVClpSiz; /*GetVolInfo: bytes to allocate at a time*/
|
unsigned long ioVClpSiz; /*GetVolInfo: bytes to allocate at a time*/
|
||||||
unsigned short ioAlBlSt; /*starting disk(512-byte) block in block map*/
|
unsigned short ioAlBlSt; /*starting disk(512-byte) block in block map*/
|
||||||
unsigned long ioVNxtFNum; /*GetVolInfo: next free file number*/
|
unsigned long ioVNxtFNum; /*GetVolInfo: next free file number*/
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
infile="$1"
|
infile="$1"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user