mirror of
https://github.com/FujiNetWIFI/fujinet-firmware.git
synced 2026-05-21 03:56:03 -05:00
Page:
Finding SmartPort Devices
Pages
"upstream.sh" Script To Rebase Changes
5CS PC TODO
A Simple NetCat Program
ADAM FujiNet Quickstart Guide
ADAM Programming
ATASCII Printer
About Each Printer
Accessing the Real Time Clock
Active Branches
AdamNet Timing Analysis
Additional Commands for R: Devices
Apple II & III FujiNet Quickstart Guide
Apple II FujiNet Platform Reference Guide
Apple II SP over SLIP
Apple II memleak analysis notes.
Apple IIgs Programming
Apple Programming
Apple2 Test Results ‐ 2025‐08‐26
Apple2 memleak analysis notes.
Apple2
AppleII & III FujiNet Quickstart Guide
AppleII III FujiNet Quickstart Guide
AppleII FujiNet Plaform Reference Guide
AppleII FujiNet Quickstart Guide
AppleII III FujiNet Quickstart Guide
Applesoft Network extensions
Apple‐68k: Ideas for Extending the DCD Protocol
Application Ideas
Atari 1020
Atari 1025
Atari 1027
Atari 1029
Atari 820
Atari 822
Atari 825
Atari BASIC JSON POST Best Practices
Atari FujiNet Programming Series: Roman Checkers
Atari FujiNet Quickstart Guide
Atari Program Recorder (410 1010 XC11 XC12)
Atari Programming
Atari8
BBS Express 850 1.0 Documentation
BBS Express 850 1.0
BBS
Baud Rate Test
Before Each Test
Board Bring Up Hardware
Board Bring Up Software
Board Bring Up
Board bring up for FujiNet Platform.IO code
Boot a Game from Fujinet.Online
Boot the FujiNet to CONFIG
CIO Commands for N Device
CIO and FMS copy commands
CONFIG HTTP API
CONFIG Users Guide
CP M Support
Carina BBS 2.7
ChatGPT Ruminations on DOS
Code Re Org Handling Different Systems
Cold Start Profiling
Coleco ADAM Tests
Color Computer Quickstart Guide
Commands for Device $09 (Network)
Commands for Device $0F (Fujinet)
Commodore 64 Tidying Up
Commodore FujiNet Quickstart Guide
Complete CLI Guide to Builds
Config 2.0 Set WiFi Network
Config 2.0 Verify ATR Disk Booting
Config 2.0 Verify Host Slot Editing
Config 2.0 Verify Joystick Control
Config 2.0 Verify Slot Quick Keys
Config 2.0 Verify Subdirectory Traversal
Config 2.0 Verify Version
Config 2.0 Verify XEX Disk Booting
Configuration Test
Connecting to a BBS
Contributing to the Project
Copying disk from Internet
Creating New Disk
Credits
DIAGNOSTIC: Alter SIO Timing for T0
DIAGNOSTIC: Alter SIO Timing for T1
DIAGNOSTIC: Alter SIO Timing for T2
DIAGNOSTIC: Alter SIO Timing for T3
DIAGNOSTIC: Alter SIO Timing for T4
DIAGNOSTIC: Alter SIO Timing for T5
DOS XL Cheat Sheet
Deploying your Favorite BBS
Dev News
Developing a Turn Based Multiplayer Server Prototype for Poker
Development Atari
Development Env for Apps
Directory of The Big RunCPM ZIP
ESP32 Schematic
Epson FX 80
Error Codes for N: Device
Example Read Clock on Adam
Example Read JSON Data
Example TNFS Hosts
FEP 001
FEP 002
FEP 003
FEP 004
FOREMDOC
FORM2DOC
Finding SmartPort Devices
Finding The SmartPort Dispatcher
Firmware Code Book Blue
Firmware Test Plan for Apple II
Firmware Test Plan for Apple2
Firmware Versioning
FoReM 850 26M
FujiNet CLI Flasher
FujiNet Commands Reference
FujiNet Commodore Programming
FujiNet Config Tools
FujiNet Configuration File: fnconfig.ini
FujiNet Development Guidelines
FujiNet Documentation Style Guide
FujiNet Documentation Wish List
FujiNet Flasher
FujiNet Networking (N: Device) Quickstart Guide
FujiNet Talking Points for YouTubers, Podcasters, etc.
FujiNet VirtualMachine
Fujinet Documentation Style Guide Scratch Pad
GRANTIC (screen dump)
Git Config Aliases
Git History Examples
Guide to Building AppleWin on Linux
HTML Printer
HTTP Collect Headers
HTTP Headers
HTTP POST
HTTP Protocol
HTTP Set Channel Mode
HTTP Test Harness
Hacker List
High Score storage for Legacy Games
High Score writeable ATR example in BASIC
Home
How FujiNet Supports Connections to BBS
How I added FujiNet Clock support to FoRem 26M
Installing a High Score Party Server
Intellivision Bring‐up Notes
Issuing SmartPort Commands
JSON Query Format
Known TNFS Hosts
Listen Test
Load file from HTTP into AtariWriter
Loading Binary Files from N: Device
Loading PLATOTERM to access IRATA.ONLINE
MIDI Maze Notes
MIDIMaze
MSX Technical Overview
MS‐DOS BIOS Specification
Mac68k Quickstart Guide
N Device Close
N Device Get Characters
N Device Get Record
N Device Open
N Device Put Characters
N Device Put Record
N Device Status
N Device Template
N: AUX1 Values
N: AUX2 Values
N: Device Filename Size Limitations
N: Game Developer Cheat Sheet
N: SIO Command $20 Rename File
N: SIO Command $21 Delete File
N: SIO Command $25 Point in File
N: SIO Command $26 Note in File
N: SIO Command $2A Make Directory
N: SIO Command $2B Remove Directory
N: SIO Command $2C Change Directory
N: SIO Command $30 Get Current Directory
N: SIO Command $FB Set JSON Parameters
N: SIO Command $FC Set Channel Mode
N: SIO Command $FD Set Login
N: SIO Command $FE Set Password
N: SIO Command $FF Query for Special Command DSTATS
N: SIO Command 'A' Accept
N: SIO Command 'C' Close
N: SIO Command 'D' Set UDP Destination
N: SIO Command 'E' (get) Error
N: SIO Command 'H' Set Hash Type
N: SIO Command 'O' Open
N: SIO Command 'P' Parse JSON
N: SIO Command 'Q' Query JSON
N: SIO Command 'R' Read
N: SIO Command 'S' Status
N: SIO Command 'T' Set Translation
N: SIO Command 'W' Write
N: SIO Command 'Z' Set PROCEED Timer Rate
N: SIO Command 'c' Close Client Connection
N: TCP Game Example: Light Cycles
N: TCP Game Example: Reversi
N: Theory of Operation
N: devicespec
Nightly Firmware Builds
Official Hardware Versions
Okimate 10
PC DOS FujiNet Quickstart Guide
PLATOTERM Key Charts
PR 1108 Atari Testing Procedure
PR 1108 Test Plan
Printer Emulation
Printing Epson Graphics Output from Print Shop
Printing Text File to Printer
Production Units
Protocol libraries
Prototype Board Revisions
RS232 Quickstart Guide
Run FujiNet with Altirra for Atari
Run FujiNet with OpenMSX
Run FujiNet with Xroar for CoCo
S.A.M. Emulation on P4:
S100 FujiNet Quickstart Guide
SIO Command $4E Network Open
SIO Command $53 Network Status
SIO Command $64 TCP Disconnect
SIO Command $C5 Hash Output
SIO Command $C7 Hash Compute
SIO Command $C8 Hash Input
SIO Command $C9 Base64 Decode Output
SIO Command $CA Base64 Decode Length
SIO Command $CB Base64 Decode Compute
SIO Command $CC Base64 Decode Input
SIO Command $CD Base64 Encode Output
SIO Command $CE Base64 Encode Length
SIO Command $CF Base64 Encode Compute
SIO Command $D0 Base64 Encode Input
SIO Command $D6 Set Boot Mode
SIO Command $D7 Mount All
SIO Command $D8 Copy File
SIO Command $D9 Enable Disable CONFIG in D1
SIO Command $DA Get Device Slot Filename
SIO Command $DB Close App Key
SIO Command $DC Open App Key
SIO Command $DD Read App Key
SIO Command $DE Write App Key
SIO Command $DF Set External SIO Clock
SIO Command $E0 Get Host Prefix
SIO Command $E1 Set Host Prefix
SIO Command $E2 Set Filename for Device Slot
SIO Command $E3 Set HSIO Index
SIO Command $E4 Set Directory Position
SIO Command $E5 Get Directory Position
SIO Command $E6 Umount Host
SIO Command $E7 New Disk
SIO Command $E8 Get Adapter Config
SIO Command $E9 Unmount Device Image
SIO Command $EB Set UART Baudrate
SIO Command $F0 Enable UDPStream Mode
SIO Command $F1 Write Device Slots
SIO Command $F2 Drive Map Read
SIO Command $F2 Read Device Slots
SIO Command $F3 Write Host Slots
SIO Command $F4 TNFS Read Hosts Slots
SIO Command $F4 Read Host Slots
SIO Command $F5 Close Directory
SIO Command $F6 Read Directory
SIO Command $F7 Open Directory
SIO Command $F8 Mount Device Image
SIO Command $F9 Mount Host
SIO Command $FA Get WiFi Status
SIO Command $FB Set SSID and Connect
SIO Command $FC Get Scan Result
SIO Command $FD Scan Networks
SIO Command $FE Get SSID
SIO Command $FF Reset FujiNet
SIO Command Page Template
SIO Commands for Device ID $70
SIO Commands for Device IDs $71 to $78
Sample FNCONFIG.INI
Setting Up TNFS On Windows 10
Setting up TNFS on a Raspberry Pi
Setting up a TNFS Server
Software Changes for New Platforms
SpartaDOS X Ultimate1MB FujiNet Utilities
System Quickstarts
Testing Plan
Testing Results V1.3 ‐ Atari
Testing against FTP Server
Testing local SD Card Storage
The Complete Linux CLI Guide
The Complete MacOS CLI Guide
The Complete OSX CLI Guide
The Definition of Done
The Original GoogleDoc
Things To Hack On
Things to do with FujiNet
Toplevel Hardware
Toplevel Miscellaneous
Toplevel Software
Toplevel User Guides
Toplevel Virtualization
Translation Test
Useful External Documentation
Using AMAC with FujiNet
Using App Keys
Using FujiNet from fig FORTH
Using FujiNet‐PC‐RS232 with 86Box in Linux
Using HTTP S from BASIC
Using NDEV in Atari DOS 2.0 2.5
Using SAM (Voice Synthesizer)
Using the MODEM Sniffer
Using the N: Device
Using the N: Tools in DOS 2
Using the SD: protocol adapter.
Virtual Apple II FujiNet
Virtual Apple2 FujiNet
Virtual Atari FujiNet
Virtual CoCo FujiNet
Virtual FujiNet Quickstart Guide
What is FujiNet?
XIO Commands
YAIL Home
fnjson.cpp Value Mangling Analysis
main hardware
main miscellaneous
main software
main user guide Change This
main user guide
main virtualization
pio 3 x howto
pio 6 x howto
x test home
No results
2
Finding SmartPort Devices
Norman Davie edited this page 2023-03-16 19:08:31 -03:00
Table of Contents
With the SmartPort Slot and Dispatcher found, devices can be enumerated and found using STATUS code $00.
C Implemenation
int8_t sp_find_fuji()
{
// const char fuji[9] = "THE_FUJI";
const char fuji[14] = "FUJINET_DISK_0";
const uint8_t fuji_len = sizeof(fuji);
int8_t err, num, i, j;
err = sp_status(0x00, 0x00); // get number of devices
if (err)
return -err;
num = sp_payload[0];
num++;
for (i = 1; i < num; i++)
{
//do
err = sp_status(i, 0x03); // get DIB
//while (err);
if (sp_payload[4] == fuji_len)
{
for (j = 0; j < fuji_len; j++)
if (fuji[j]!=sp_payload[5+j])
return 0;
sp_dest = i; // store the fuji unit #
return i;
}
}
return 0;
}
int8_t sp_find_network()
{
const char net[7] = "NETWORK";
const uint8_t net_len = sizeof(net);
int8_t err, num, i, j;
err = sp_status(0x00, 0x00); // get number of devices
if (err)
return -err;
num = sp_payload[0];
num+=2;
for (i = 1; i < num; i++)
{
err = sp_status(i, 0x03); // get DIB
if (sp_payload[4] == net_len)
{
for (j = 0; j < net_len; j++)
if (net[j]!=sp_payload[5+j])
return 0;
return i;
}
}
printf("NET NOT FOUND");
cgetc();
return 0;
}
Assembly Implemenation
FIND_DEVICE_BUF_LEN: .BYTE 0
FIND_DEVICE_BUF: .RES 255
relocate011:
FIND_DEVICE_BUF_ADDR: .WORD FIND_DEVICE_BUF
;******************************************************************
; SP_STATUS
; The Status command returns information about a specific device.
; The information returned by this command is determined by status code.
; On return from a Status call, the microprocessor X and Y registers are set to
; indicate the number of bytes transferred to the Apple II by the command. The X
; register is set to the low byte of the count, and the Y register is set to the high byte.
; The parameter list for this call is as follows:
; Byte Definition
; 0 parameter list length
; 1 unit number
; 2-3 status list pointer (lsb-msb)
; 4 status code
; INPUT
; X - UNIT DESTINATION
; Y - STATUS CODE
; Y='S' return SP[0..1] = Bytes waiting, SP[2] & 0x02 = connected
;******************************************************************
SP_STATUS:
LDA #SP_STATUS_PARAM_COUNT
STA CMD_LIST ; PARAMETER COUNT
STX CMD_LIST+1 ; X = DESTINATION DEVICE
LDA SP_PAYLOAD_ADDR
STA CMD_LIST+2 ; STATUS LIST POINTER LO
LDA SP_PAYLOAD_ADDR+1
STA CMD_LIST+3 ; STATUS LIST POINTER HI
STY CMD_LIST+4 ; Y = STATUS CODE
JSR CALL_DISPATCHER
.BYTE SP_CMD_STATUS ; STATUS CALL COMMAND NUMBER
relocatesp07: .WORD CMD_LIST
STX SP_COUNT
STY SP_COUNT+1
STA LAST_SP_ERR
BCC SP_STATUS_DONE
ERROR3:
RTS
SP_STATUS_DONE:
RTS
;*******************************
; SP_FIND_DEVICE
; Looks for the specified smartport device
; INPUT
; Put NULL terminated string of device to
; search for in FIND_DEVICE_STR
; RETURNS
; A = High byte address of string
; Y = Low byte address of string
; X = Device number or $FF on failure
;*********************************
SP_FIND_DEVICE:
STA ZP1_HI ; STORE THE STRING ADDRESS
STY ZP1_LO
LDX #$00
LDY #$00
LOOK_FOR_NULL:
LDA (ZP1),Y ; START OF STRING WITHOUT LENGTH
STA FIND_DEVICE_BUF,X
BEQ GOT_LENGTH ; STOP WHEN WE GET TO NULL
INY
INX
CLC
BCC LOOK_FOR_NULL
GOT_LENGTH:
STX FIND_DEVICE_BUF_LEN ; SAVE THE LENGTH INCLUDES NULL
LDX #$00
LDY #SP_CMD_STATUS ; ASK FOR SMARTPORT STATUS
JSR SP_STATUS
GOT_DEVICE_COUNT:
LDX DCOUNT ; THE NUMBER OF DEVICES
INX
STX NUM_DEVICES
LDX #$01 ; START AT DEVICE #1
NEXT_DEV2:
TXA
PHA
LDY #SP_STATUS_DIB ; X IS DEVICE
JSR SP_STATUS ; GET INFO
BCS ERROR_OUT ; QUIT IF WE GET AN ERROR
LDA SP_PAYLOAD+4 ; LENGTH OF STRING
CMP FIND_DEVICE_BUF_LEN ; IS IT THE SAME SIZE AS THE STRING WE'RE LOOKING FOR?
BNE NEXT_DEVICE ; NOPE, CHECK NEXT DEVICE
; SAME SIZE STRING, NOW CHECK AND SEE IF IT
; IS THE DEVICE WE'RE LOOKING FOR
LDX #$00
SCAN_CHAR:
LDA SP_PAYLOAD+5,X ; INFO STRING
CMP FIND_DEVICE_BUF,X ; DEVICE WE'RE LOOKING FOR
BNE NEXT_DEVICE ; NOT THE SAME, CHECK NEXT DEVICE
INX ; MOVE TO NEXT DEVICE
CPX SP_PAYLOAD+4 ; HAVE WE FINISHED LOOKING AT THE SAME NUMBER OF CHARACTERS?
BNE SCAN_CHAR ; NOPE, KEEP GOING
CLC
BCC FOUND_DEVICE ; WE FOUND OUR DEVICE
NEXT_DEVICE:
PLA ; REMOVE THE DEVICE NUMBER OFF STACK
TAX
INX ; AND INCREMENT IT
CPX NUM_DEVICES ; HAVE WE CHECKED ALL DEVICES?
BNE NEXT_DEV2 ; NOPE, KEEP GOING
; EXHAUSTED OUR LIST
LDX #SP_ERR ; NOT FOUND
LDA #SP_ERROR_NOT_FOUND
CLC
BCC FOUND_DONE
ERROR_OUT:
PLA
ERROR_OUT2:
; ERROR STRING HERE
LDX #SP_ERR ; ERROR
RTS
FOUND_DEVICE:
PLA
TAX
FOUND_DONE:
RTS
- 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
Copyright 2026 Contributors to the FujiNetWIFI project.
Join us on Discord: https://discord.gg/7MfFTvD