-
Notifications
You must be signed in to change notification settings - Fork 78
Finding The SmartPort Dispatcher
Thomas Cherryhomes edited this page Dec 26, 2022
·
6 revisions
Before using the SmartPort, you have to find it. More specifically, you have to find the dispatcher.
The first part, finding the slot, is accomplished by scanning the I/O space for each slot ($C000, $C100, ...), for the following four bytes at offsets 1, 3, 5, and 7:
| Offset | Byte |
|---|---|
| 1 | $20 |
| 3 | $00 |
| 5 | $03 |
| 7 | $00 |
/**
* Check for SmartPort presence
* @return slot #, or 0xFF if not present.
*/
uint8_t sp_find_slot(void)
{
uint8_t s=0;
for (s=7; s-- > 0;)
{
uint16_t a = 0xc000 + (s * 0x100);
if ((PEEK(a+1) == 0x20) &&
(PEEK(a+3) == 0x00) &&
(PEEK(a+5) == 0x03) &&
(PEEK(a+7) == 0x00))
return s;
}
// Did not find.
return 0;
}Once the slot has been found, the dispatcher address can be found by reading offset $FF at the found slot, then taking the value found, adding 3 to it, and adding that to the slot address.
/**
* Return dispatch address for Smartport slot.
* @param s Slot # (1-7)
* @return smartport dispatch address
*/
uint16_t sp_dispatch_address(uint8_t slot)
{
uint16_t a = (slot * 0x100) + 0xC000;
uint8_t j = PEEK(a+0xFF);
return a + j + 3;
}Once this is found, you can start Issuing SmartPort Commands.
Copyright 2024 Contributors to the FujiNetWIFI project.
Join us on Discord: https://discord.gg/7MfFTvD
- Home
- What is FujiNet?
- The Definition of Done
- Board bring up for FujiNet Platform.IO code
- The Complete Linux CLI Guide
- The Complete macOS CLI Guide
- Development Env for Apps
- FujiNet-Development-Guidelines
- System Quickstarts
- FujiNet Flasher
- Setting up a TNFS Server
- FujiNet Configuration File: fnconfig.ini
- AppKey Registry - SIO Command $DC Open App Key
- CP-M Support
- BBS
- Official Hardware Versions
- Prototype Board Revisions
- FujiNet Development Guidelines
- Atari Programming
- Apple Programming
- C64 Programming
- ADAM Programming
- Testing Plan
- Hacker List
- FujiNet VirtualMachine