-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
5,394 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-O | ||
-Wall | ||
-std=c++14 | ||
-I.. | ||
-I../.pio/libdeps/teensy41/libcli/src | ||
-I../.pio/libdeps/teensy41/libasm/src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#include "devs_tms7000.h" | ||
#include <string.h> | ||
#include "debugger.h" | ||
#include "mc6850.h" | ||
|
||
namespace debugger { | ||
namespace tms7000 { | ||
|
||
DevsTms7000 Devs; | ||
|
||
void DevsTms7000::reset() { | ||
ACIA.reset(); | ||
ACIA.setBaseAddr(ACIA_BASE); | ||
} | ||
|
||
void DevsTms7000::begin() { | ||
enableDevice(ACIA); | ||
} | ||
|
||
void DevsTms7000::loop() { | ||
ACIA.loop(); | ||
} | ||
|
||
bool DevsTms7000::isSelected(uint32_t addr) const { | ||
return ACIA.isSelected(addr); | ||
} | ||
|
||
uint16_t DevsTms7000::read(uint32_t addr) const { | ||
return ACIA.read(addr); | ||
} | ||
|
||
void DevsTms7000::write(uint32_t addr, uint16_t data) const { | ||
ACIA.write(addr, data); | ||
} | ||
|
||
Device &DevsTms7000::parseDevice(const char *name) const { | ||
if (strcasecmp(name, ACIA.name()) == 0) | ||
return ACIA; | ||
return Devs::nullDevice(); | ||
} | ||
|
||
void DevsTms7000::enableDevice(Device &dev) { | ||
ACIA.enable(&dev == &ACIA); | ||
} | ||
|
||
void DevsTms7000::printDevices() const { | ||
printDevice(ACIA); | ||
} | ||
|
||
} // namespace tms7000 | ||
} // namespace debugger | ||
|
||
// Local Variables: | ||
// mode: c++ | ||
// c-basic-offset: 4 | ||
// tab-width: 4 | ||
// End: | ||
// vim: set ft=cpp et ts=4 sw=4: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#ifndef __DEVS_TMS7000_H__ | ||
#define __DEVS_TMS7000_H__ | ||
|
||
#include "devs.h" | ||
|
||
#define ACIA_BASE 0x01F0 // P240 | ||
|
||
namespace debugger { | ||
namespace tms7000 { | ||
|
||
struct DevsTms7000 : Devs { | ||
void begin() override; | ||
void reset() override; | ||
void loop() override; | ||
bool isSelected(uint32_t addr) const override; | ||
uint16_t read(uint32_t addr) const override; | ||
void write(uint32_t addr, uint16_t data) const override; | ||
|
||
Device &parseDevice(const char *name) const override; | ||
void enableDevice(Device &dev) override; | ||
void printDevices() const override; | ||
}; | ||
|
||
extern struct DevsTms7000 Devs; | ||
|
||
} // namespace tms7000 | ||
} // namespace debugger | ||
#endif /* __DEVS_TMS7000H__ */ | ||
|
||
// Local Variables: | ||
// mode: c++ | ||
// c-basic-offset: 4 | ||
// tab-width: 4 | ||
// End: | ||
// vim: set ft=cpp et ts=4 sw=4: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/usr/bin/gawk -f | ||
# -*- mode: awk; -*- | ||
|
||
BEGIN { | ||
PRETTY_PRINT = 0; | ||
GENERATE_TABLE = 1; | ||
} | ||
|
||
BEGIN { | ||
if (PRETTY_PRINT) { | ||
pretty_print("op", "mnemo", "operand", "#", "bus"); | ||
pretty_print("--", "-----", "----------", "-", "-"); | ||
} | ||
if (GENERATE_TABLE) { | ||
printf("constexpr uint8_t INST_TABLE[] = {\n"); | ||
} | ||
} | ||
|
||
function pretty_print(opc, mnemo, operand, len, bus) { | ||
if (PRETTY_PRINT == 0) | ||
return; | ||
printf("%-2s %-5s %-10s %s %s\n", | ||
opc, mnemo, operand, len, bus); | ||
} | ||
|
||
function generate_ENTRY(opc, mnemo, operand, len, bus) { | ||
if (GENERATE_TABLE == 0) | ||
return; | ||
if (bus == "-") | ||
bus = "0"; | ||
if (len == "-") { | ||
printf(" 0, // %s\n", opc); | ||
} else { | ||
printf(" E(%d, %d), // %s: %-5s %s\n", | ||
len, bus, opc, mnemo, operand); | ||
} | ||
} | ||
|
||
END { | ||
if (GENERATE_TABLE) | ||
printf("};\n"); | ||
} | ||
|
||
$1 !~ /[0-9A-F][0-9A-F]/ { next; } | ||
$1 ~ /[0-9A-F][0-9A-F]/ { | ||
opc = $1; | ||
mne = $2; | ||
opr = $3; | ||
len = $4; | ||
bus = $5; | ||
|
||
pretty_print(opc, mne, opr, len, bus); | ||
generate_ENTRY(opc, mne, opr, len, bus); | ||
} |
Oops, something went wrong.