Skip to content

Commit

Permalink
[atari][pclink] merge FN-PC and FN-ESP PCLink code
Browse files Browse the repository at this point in the history
  • Loading branch information
a8jan committed Feb 3, 2024
1 parent 1f99756 commit 8172e4d
Show file tree
Hide file tree
Showing 30 changed files with 370 additions and 185 deletions.
1 change: 1 addition & 0 deletions data/webui/config/fujiapple-iec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ components:
disk_swap: true
boot_settings: true
apetime: false
pclink: false
tweaks:
# webui tweaks, if any
1 change: 1 addition & 0 deletions data/webui/config/fujiapple-rev0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ components:
boot_settings: true
apetime: false
cpm_settings: true
pclink: false
tweaks:
# webui tweaks, if any
1 change: 1 addition & 0 deletions data/webui/config/fujiloaf-rev0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ components:
disk_swap: true
boot_settings: true
apetime: false
pclink: false
tweaks:
# webui tweaks, if any
1 change: 1 addition & 0 deletions data/webui/config/fujinet-adam-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ components:
disk_swap: true
boot_settings: true
apetime: false
pclink: false
tweaks:
# webui tweaks, if any
1 change: 1 addition & 0 deletions data/webui/config/fujinet-atari-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ components:
boot_settings: true
apetime: true
cpm_settings: true
pclink: true
tweaks:
# webui tweaks, if any
1 change: 1 addition & 0 deletions data/webui/config/fujinet-cx16.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ components:
disk_swap: true
boot_settings: true
apetime: false
pclink: false
tweaks:
# webui tweaks, if any
1 change: 1 addition & 0 deletions data/webui/config/fujinet-heathkit-h89.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ components:
disk_swap: true
boot_settings: true
apetime: false
pclink: false
tweaks:
# webui tweaks, if any
1 change: 1 addition & 0 deletions data/webui/config/fujinet-iec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ components:
disk_swap: true
boot_settings: true
apetime: false
pclink: false
tweaks:
# webui tweaks, if any
1 change: 1 addition & 0 deletions data/webui/config/fujinet-lynx-devkitc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ components:
disk_swap: true
boot_settings: true
apetime: false
pclink: false
tweaks:
# webui tweaks, if any
1 change: 1 addition & 0 deletions data/webui/config/fujinet-lynx-prototype.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ components:
disk_swap: true
boot_settings: true
apetime: false
pclink: false
tweaks:
# webui tweaks, if any
1 change: 1 addition & 0 deletions data/webui/config/fujinet-pc-atari.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ components:
serial_port: true
emulator_settings: true
cpm_settings: true
pclink: true
tweaks:
# webui tweaks, if any
fujinet_pc: true
1 change: 1 addition & 0 deletions data/webui/config/fujinet-rc2014spi-rev0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ components:
disk_swap: true
boot_settings: true
apetime: false
pclink: false
tweaks:
# webui tweaks, if any
1 change: 1 addition & 0 deletions data/webui/config/fujinet-rs232-rev0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ components:
disk_swap: true
boot_settings: true
apetime: false
pclink: false
tweaks:
# webui tweaks, if any
1 change: 1 addition & 0 deletions data/webui/config/fujinet-v1-4mb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ components:
disk_swap: true
boot_settings: true
apetime: true
pclink: true
tweaks:
# webui tweaks, if any
1 change: 1 addition & 0 deletions data/webui/config/fujinet-v1-8mb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ components:
disk_swap: true
boot_settings: true
apetime: true
pclink: true
tweaks:
# webui tweaks, if any
1 change: 1 addition & 0 deletions data/webui/config/fujinet-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ components:
disk_swap: true
boot_settings: true
apetime: true
pclink: true
tweaks:
# webui tweaks, if any
1 change: 1 addition & 0 deletions data/webui/config/lolin-d32-iec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ components:
disk_swap: true
boot_settings: true
apetime: false
pclink: false
tweaks:
# webui tweaks, if any
188 changes: 115 additions & 73 deletions data/webui/template/www/index.tmpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,121 @@ <h2 style="text-align: center;">Need help? Go to the <a href="https://github.com
</div>
</div>
{% endif %}
{% if components.cpm_settings %}
<div class="flexchild">
<form action="/config" method="post">
<div class="settings">
<div class="settings-header">
CP/M<span id="logowob"></span>Settings
</div>
<div class="settings-left">
<div class="svgicon">
<svg width="53.317mm" height="46.17mm" version="1.1" viewBox="0 0 53.317 46.17" xmlns="http://www.w3.org/2000/svg">
<g transform="translate(-7.5798 -24.586)">
<rect x="9.7771" y="26.784" width="48.922" height="41.775" ry="8.4013" fill="#454545" stroke="#000" stroke-width="3.9947"/>
<g fill="#0f0">
<g transform="matrix(1.5554 0 0 1.5554 -4.3212 -13.767)" stroke-width=".26458" aria-label="CP/M">
<path d="m11.825 31.973h0.79375v-0.79375h0.79375v-0.79375h3.175v0.79375h0.79375v1.5875h-0.79375v-0.79375h-0.79375v-0.79375h-1.5875v0.79375h-0.79375v4.7625h0.79375v0.79375h1.5875v-0.79375h0.79375v-0.79375h0.79375v1.5875h-0.79375v0.79375h-3.175v-0.79375h-0.79375v-0.79375h-0.79375z"/>
<path d="m18.439 30.385v0.79375h0.79375v6.35h-0.79375v0.79375h3.175v-0.79375h-0.79375v-3.175h2.3812v-0.79375h0.79375v-2.3812h-0.79375v-0.79375zm2.3812 0.79375h1.5875v2.3812h-1.5875z"/>
<path d="m25.054 38.323v-1.5875h0.79375v-0.79375h0.79375v-0.79375h0.79375v-0.79375h0.79375v-0.79375h0.79375v-0.79375h0.79375v-0.79375h0.79375v1.5875h-0.79375v0.79375h-0.79375v0.79375h-0.79375v0.79375h-0.79375v0.79375h-0.79375v0.79375h-0.79375v0.79375z"/>
<path d="m31.668 30.385v7.9375h1.5875v-4.7625h0.79375v0.79375h0.79375v-0.79375h0.79375v4.7625h1.5875v-7.9375h-1.5875v0.79375h-0.79375v0.79375h-0.79375v-0.79375h-0.79375v-0.79375z"/>
</g>
<g transform="matrix(1.5554 0 0 1.5554 -4.3212 -13.767)" stroke-width=".26458" aria-label="A0&gt;">
<path d="m16.217 48.336h-0.97014v-1.9403h-1.4552v1.9403h-0.97014v-3.3955h0.48507v-0.48507h0.48507v-0.48507h0.48507v-0.48507h0.48507v0.48507h0.48507v0.48507h0.48507v0.48507h0.48507zm-0.97014-2.4253v-0.97014h-0.48507v-0.48507h-0.48507v0.48507h-0.48507v0.97014z"/>
<path d="m16.966 47.366h0.48507v0.48507h0.48507v0.48507h1.4552v-0.48507h0.48507v-0.48507h0.48507v-2.9104h-0.48507v-0.48507h-0.48507v-0.48507h-1.4552v0.48507h-0.48507v0.48507h-0.48507zm1.9403-3.3955v0.48507h0.48507v2.9104h-0.48507v0.48507h-0.48507v-0.48507h-0.48507v-2.9104h0.48507v-0.48507zm-0.48507 1.4552h0.48507v0.97014h-0.48507z"/>
<path d="m24.507 46.396h-0.48507v0.48507h-0.48507v0.48507h-0.48507v0.48507h-0.48507v0.48507h-0.97014v-0.48507h0.48507v-0.48507h0.48507v-0.48507h0.48507v-0.48507h0.48507v-0.48507h-0.48507v-0.48507h-0.48507v-0.48507h-0.48507v-0.48507h-0.48507v-0.48507h0.97014v0.48507h0.48507v0.48507h0.48507v0.48507h0.48507v0.48507h0.48507z"/>
</g>
<rect x="36.147" y="54.021" width="5.191" height="7.6902" rx="0" ry="0"/>
</g>
</g>
</svg>
</div>
</div>
<div class="settings-content settings-55-45">
<div class="set">
<div class="settings-label">
<label>Use as virtual CP/M device</label>
</div>
<div class="settings-value">
<div class="radio-container">
<input checked="" id="cpm-virt-yes" name="cpm_enabled" type="radio" value="1">
<label for="cpm-virt-yes" class="r-yes-no">Yes</label>
<input checked="" id="cpm-virt-no" name="cpm_enabled" type="radio" value="0">
<label for="cpm-virt-no" class="r-yes-no">No</label>
</div>
</div>
</div>
<div class="set">
<div class="settings-label">
<label>Set custom Console Command Processor</label>
</div>
<div class="settings-value">
<input type="text" name="cpm_ccp" id="cpm_ccp" value="<%FN_CPM_CCP%>">
</div>
</div>
<hr>
<div class="settings-text">
<div>
Custom CCP must be a valid path on the SD Card<br>
Example: <strong>/some/directory/custom.ccp</strong><br>
Set CCP to <strong>$</strong> for default built-in CCP<br>
</div>
</div>
<script>
var current_cpm_enabled = "<%FN_CPM_ENABLED%>";
</script>
</div>
<div class="settings-footer">
<div class="save-button">
<button type="submit" value="Save">Save</button>
</div>
</div>
</div>
</form>
</div>
{% endif %}
{% if components.pclink %}
<div class="flexchild">
<form action="/config" method="post">
<div class="settings">
<div class="settings-header">
PC<span id="logowob"></span>Link
</div>
<script>
var current_pclink = "<%FN_PCLINK_ENABLED%>";
</script>
<div class="settings-left">
<div class="svgicon">
<!-- SVG PCLink icon should go here
<svg width="100%" height="100%" viewBox="0 0 297 254" version="1.1"
</svg>
-->
</div>
</div>
<div class="settings-content settings-45-55">
<div class="set">
<div class="settings-label">
<label for="">Enable PCLink</label>
</div>
<div class="settings-value">
<div class="radio-container">
<input checked="" id="pclink-yes" name="pclink_enabled" type="radio" value="1">
<label for="pclink-yes" class="r-yes-no">Yes</label>
<input checked="" id="pclink-no" name="pclink_enabled" type="radio" value="0">
<label for="pclink-no" class="r-yes-no">No</label>
</div>
</div>
</div>
</div>
<div class="settings-footer">
<div class="save-button">
<button type="submit" value="Save">Save</button>
</div>
</div>
</div>
</form>
</div>
{% endif %}
{% if components.disk_swap %}
<div class="flexchild">
<form action="/config" method="post">
Expand Down Expand Up @@ -1318,79 +1433,6 @@ <h2 style="text-align: center;">Need help? Go to the <a href="https://github.com
</form>
</div>
{% endif %}
{% if components.cpm_settings %}
<div class="flexchild">
<form action="/config" method="post">
<div class="settings">
<div class="settings-header">
CP/M<span id="logowob"></span>Settings
</div>
<div class="settings-left">
<div class="svgicon">
<svg width="53.317mm" height="46.17mm" version="1.1" viewBox="0 0 53.317 46.17" xmlns="http://www.w3.org/2000/svg">
<g transform="translate(-7.5798 -24.586)">
<rect x="9.7771" y="26.784" width="48.922" height="41.775" ry="8.4013" fill="#454545" stroke="#000" stroke-width="3.9947"/>
<g fill="#0f0">
<g transform="matrix(1.5554 0 0 1.5554 -4.3212 -13.767)" stroke-width=".26458" aria-label="CP/M">
<path d="m11.825 31.973h0.79375v-0.79375h0.79375v-0.79375h3.175v0.79375h0.79375v1.5875h-0.79375v-0.79375h-0.79375v-0.79375h-1.5875v0.79375h-0.79375v4.7625h0.79375v0.79375h1.5875v-0.79375h0.79375v-0.79375h0.79375v1.5875h-0.79375v0.79375h-3.175v-0.79375h-0.79375v-0.79375h-0.79375z"/>
<path d="m18.439 30.385v0.79375h0.79375v6.35h-0.79375v0.79375h3.175v-0.79375h-0.79375v-3.175h2.3812v-0.79375h0.79375v-2.3812h-0.79375v-0.79375zm2.3812 0.79375h1.5875v2.3812h-1.5875z"/>
<path d="m25.054 38.323v-1.5875h0.79375v-0.79375h0.79375v-0.79375h0.79375v-0.79375h0.79375v-0.79375h0.79375v-0.79375h0.79375v-0.79375h0.79375v1.5875h-0.79375v0.79375h-0.79375v0.79375h-0.79375v0.79375h-0.79375v0.79375h-0.79375v0.79375h-0.79375v0.79375z"/>
<path d="m31.668 30.385v7.9375h1.5875v-4.7625h0.79375v0.79375h0.79375v-0.79375h0.79375v4.7625h1.5875v-7.9375h-1.5875v0.79375h-0.79375v0.79375h-0.79375v-0.79375h-0.79375v-0.79375z"/>
</g>
<g transform="matrix(1.5554 0 0 1.5554 -4.3212 -13.767)" stroke-width=".26458" aria-label="A0&gt;">
<path d="m16.217 48.336h-0.97014v-1.9403h-1.4552v1.9403h-0.97014v-3.3955h0.48507v-0.48507h0.48507v-0.48507h0.48507v-0.48507h0.48507v0.48507h0.48507v0.48507h0.48507v0.48507h0.48507zm-0.97014-2.4253v-0.97014h-0.48507v-0.48507h-0.48507v0.48507h-0.48507v0.97014z"/>
<path d="m16.966 47.366h0.48507v0.48507h0.48507v0.48507h1.4552v-0.48507h0.48507v-0.48507h0.48507v-2.9104h-0.48507v-0.48507h-0.48507v-0.48507h-1.4552v0.48507h-0.48507v0.48507h-0.48507zm1.9403-3.3955v0.48507h0.48507v2.9104h-0.48507v0.48507h-0.48507v-0.48507h-0.48507v-2.9104h0.48507v-0.48507zm-0.48507 1.4552h0.48507v0.97014h-0.48507z"/>
<path d="m24.507 46.396h-0.48507v0.48507h-0.48507v0.48507h-0.48507v0.48507h-0.48507v0.48507h-0.97014v-0.48507h0.48507v-0.48507h0.48507v-0.48507h0.48507v-0.48507h0.48507v-0.48507h-0.48507v-0.48507h-0.48507v-0.48507h-0.48507v-0.48507h-0.48507v-0.48507h0.97014v0.48507h0.48507v0.48507h0.48507v0.48507h0.48507v0.48507h0.48507z"/>
</g>
<rect x="36.147" y="54.021" width="5.191" height="7.6902" rx="0" ry="0"/>
</g>
</g>
</svg>
</div>
</div>
<div class="settings-content settings-55-45">
<div class="set">
<div class="settings-label">
<label>Use as virtual CP/M device</label>
</div>
<div class="settings-value">
<div class="radio-container">
<input checked="" id="cpm-virt-yes" name="cpm_enabled" type="radio" value="1">
<label for="cpm-virt-yes" class="r-yes-no">Yes</label>
<input checked="" id="cpm-virt-no" name="cpm_enabled" type="radio" value="0">
<label for="cpm-virt-no" class="r-yes-no">No</label>
</div>
</div>
</div>
<div class="set">
<div class="settings-label">
<label>Set custom Console Command Processor</label>
</div>
<div class="settings-value">
<input type="text" name="cpm_ccp" id="cpm_ccp" value="<%FN_CPM_CCP%>">
</div>
</div>
<hr>
<div class="settings-text">
<div>
Custom CCP must be a valid path on the SD Card<br>
Example: <strong>/some/directory/custom.ccp</strong><br>
Set CCP to <strong>$</strong> for default built-in CCP<br>
</div>
</div>
<script>
var current_cpm_enabled = "<%FN_CPM_ENABLED%>";
</script>
</div>
<div class="settings-footer">
<div class="save-button">
<button type="submit" value="Save">Save</button>
</div>
</div>
</div>
</form>
</div>
{% endif %}
</div>
</div>
<script type="text/javascript" src="{{ paths.js_path }}/settings.js"></script>
Expand Down
4 changes: 4 additions & 0 deletions data/webui/template/www/js/settings.tmpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,7 @@ setSerialProceed(current_serial_proceed);
{% if components.emulator_settings %}
setInputValue(current_netsio_enabled == 1, "netsio-yes", "netsio-no");
{% endif %}

{% if components.pclink %}
setInputValue(current_pclink == 1, "pclink-yes", "pclink-no");
{% endif %}
4 changes: 2 additions & 2 deletions lib/bus/sio/siocom/netsio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ int NetSioPort::handle_netsio()

case NETSIO_DATA_BYTE:
b = rxbuf[1];
if (_baud_peer < _baud * 95 / 100 || _baud_peer > _baud * 105 / 100)
if (_baud_peer < _baud * 90 / 100 || _baud_peer > _baud * 110 / 100)
b ^= (uint8_t)_baud_peer ^ (uint8_t)_baud; // corrupt byte
if (rxbuffer_put(b))
Debug_println("NetSIO rxbuffer overrun");
Expand All @@ -367,7 +367,7 @@ int NetSioPort::handle_netsio()
// for (int i = 1; i < received; i++)
{
b = rxbuf[i];
if (_baud_peer < _baud * 95 / 100 || _baud_peer > _baud * 105 / 100)
if (_baud_peer < _baud * 90 / 100 || _baud_peer > _baud * 110 / 100)
b ^= (uint8_t)_baud_peer ^ (uint8_t)_baud; // corrupt byte
if (rxbuffer_put(b))
Debug_println("NetSIO rxbuffer overrun");
Expand Down
3 changes: 3 additions & 0 deletions lib/config/fnConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ class fnConfig

bool get_apetime_enabled();
void store_apetime_enabled(bool enabled);
bool get_pclink_enabled();
void store_pclink_enabled(bool enabled);

#ifndef ESP_PLATFORM
// NETSIO (Connection to Atari emulator)
Expand Down Expand Up @@ -488,6 +490,7 @@ class fnConfig
bool device_7_enabled = true;
bool device_8_enabled = true;
bool apetime = true;
bool pclink = true;
};

struct phbook_info
Expand Down
16 changes: 16 additions & 0 deletions lib/config/fnc_enable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,20 @@ void fnConfig::store_apetime_enabled(bool enabled)
}
}

bool fnConfig::get_pclink_enabled()
{
return _denable.pclink;
}

void fnConfig::store_pclink_enabled(bool enabled)
{
if (_denable.pclink != enabled)
{
_denable.pclink = enabled;
_dirty = true;
}
}

void fnConfig::_read_section_device_enable(std::stringstream &ss)
{
std::string line;
Expand Down Expand Up @@ -156,6 +170,8 @@ void fnConfig::_read_section_device_enable(std::stringstream &ss)
_denable.device_8_enabled = atoi(value.c_str());
else if (strcasecmp(name.c_str(), "enable_apetime") == 0)
_denable.apetime = atoi(value.c_str());
else if (strcasecmp(name.c_str(), "enable_pclink") == 0)
_denable.pclink = atoi(value.c_str());
}
}
}
Loading

0 comments on commit 8172e4d

Please sign in to comment.