Skip to content

Virtual Apple2 FujiNet

andy diller edited this page Feb 4, 2024 · 13 revisions

Install prerequisite packages for builds

Assuming you have a totally fresh install of Ubuntu 22, but running this whole thing won't hurt:

sudo apt install -y build-essential checkinstall zlib1g-dev libpcap-dev libssl-dev libyaml-dev libtool autoconf libslirp-dev libminizip-dev libboost-all-dev libsdl2-image-dev unzip curl wget git python3.10-venv libmbedtls-dev default-jre

sudo snap install cmake --classic

Fork and pull Repos

Good practice is to put all the repo code into a directory called code This assumes you have forked all the repos so we can cleanly create PRs replace [GIT-USER] below with your git username....

fork AppleWin from Fujinet project into your own repo...- using web UI https://github.com/FujiNetWIFI/AppleWin.git

mkdir code
cd code
git clone [email protected]:[GIT-USER]/fujinet-platformio
git clone [email protected]:[GIT-USER]/fujinet-apps
git clone [email protected]:[GIT-USER]/AppleWin

[Now we add an upstream remote so we can use the upstream script to keep current...]

cd fujinet-apps
git remote add upstream https://github.com/FujiNetWIFI/fujinet-apps

cd ../fujinet-platformio
git remote add upstream https://github.com/FujiNetWIFI/fujinet-platformio

cd ../AppleWin
git add remote upstream https://github.com/FujiNetWIFI/AppleWin

Builds

Build the major components

APPLEWIN

cd AppleWin
git remote add upstream https://github.com/FujiNetWIFI/AppleWin.git
git fetch --all
git checkout linux
# as per instructions at https://github.com/markjfisher/AppleWin/tree/linux?tab=readme-ov-file#build
# you have to checkout the git submodules
git submodule update --init --recursive
mkdir build
cd build
# You can also use RELEASE instead of DEBUG if you're not going to be doing any gdb style debugging
cmake -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_SA2=on .. 
make

To run it

# logs are hardcoded to /tmp/AppleWin.log by the app if you specify --log
# the configuration file is at ~/.applewin/applewin.conf, you can remove slots if you have issues in that file
# sa2 stands for "SDL Apple 2", i.e. sa2
# use "./sa2 -h" to see help, defaults to x11:

./sa2 --log

# can also specify gfx, e.g. x11, wayland.
SDL_VIDEODRIVER=wayland ./sa2

Once running, open the configuration menu (System/Settings), open the Hardware TAB, In an empty slot (I've been using slot 5), choose "SPoverSLIP".

This will load the card.

If you exit AppleWin, your config is saved to the previously mentioned applwin.conf. Then when you run it again, it'll auto start with the card in.

You can preconfigure your config to load SPoverSLIP with the following section: [Configuration\Slot 5] Card type=25

change the Slot number as you desire.

[Insert images]

FujiNet-PC

  • Build FujiNet-PC for AppleWin
  • Assuming you have never done this.
  • Assuming you have follow the above part and installed all the packages as mentioned in the previous section

Install PIO

$ cd ~
$ curl -fsSL -o get-platformio.py https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py
$ python3 ./get-platformio.py
$ export PATH=$PATH:~/.platformio/penv/bin
$ echo "export PATH=$PATH:~/.platformio/penv/bin" >> ~/.bashrc
$ pio platform install espressif32
$ pip install jinja2

[Ok now go into the fujinet dir and build FujiNet-PC:]

$ cd ~/code/fujinet-platformio

$ ./build.sh -p APPLE

[... lots of output...]
[100%] Built target dist
Built PC version in build/dist folder

[run Fujinet-PC]
./build/dist/run-fujinet

You will see output:

Retrying in 5 seconds...
12:29:05.787492 > Resolving hostname "localhost"
12:29:05.787599 > Resolved to address 127.0.0.1

[go into AppleWin - Settings/Hardware/Slot5 pick SPoverSLIP] [screenshot]

output will change to:

12:29:20.820917 > 
Drive: 09

Build Applications

Build and install cc65

[cd to root of your softare repos] [we need to install cc65 to compile the Apple Test Apps to use in AppleWin]

$ cd ~/code
$ git clone https://github.com/cc65/cc65.git
$ cd cc65
$ make
$ sudo make avail

[This builds both the cc65 binaries (located in the 'bin' subdirectory) and the cc65 libraries. Now cc65 is fully functional without further steps. Enter sudo make avail. This creates symbolic links to the binaries in '/usr/local/bin'.]

[now go into the FujiNet Apps Repo - where the Actual app is located.]

cd ~/code/fujinet-apps/httpbin

$ chmod 755 ../apple-tools/add-bas.sh
$ make TARGETS=apple2 clean all dist po

$ cp dist/httpbin.po ~/code/fujinet-platformio/distfiles/SD/

More TBA

cd ~/code/fujinet-apps/testsp2
/apple-tools$ bash ./add-bas.sh ~//code/fujinet-platformio/data/BUILD_APPLE/mount-and-boot.po ~/code/fujinet-apps/testsp2/build/testsp2.apple2 TEST1

cp TEST1.Po ~/code/fujinet-platformio/build/dist/SD/


~/code/fujinet-platformio/build/dist$ ./run-fujinet

END

Clone this wiki locally