From b8f8c3085d03261cb473994d1075248b04249a1f Mon Sep 17 00:00:00 2001
From: Oliver Schmidt
Date: Sun, 4 Jun 2017 00:09:22 +0200
Subject: [PATCH] Generalized Apple II slot setting.
In order to allow setting the Apple II slot from host computer independent code the slot setting function was renamed and dummies were added for the other host computers.
---
drivers/Makefile | 20 ++++++++++----------
drivers/{a2slot.s => a2init.s} | 7 ++++---
drivers/{a2slotcombo.s => a2initcombo.s} | 7 ++++---
drivers/atrinit.s | 8 ++++++++
drivers/c64init.s | 8 ++++++++
drivers/vic20init.s | 8 ++++++++
inc/net.i | 4 ++--
7 files changed, 44 insertions(+), 18 deletions(-)
rename drivers/{a2slot.s => a2init.s} (89%)
rename drivers/{a2slotcombo.s => a2initcombo.s} (91%)
create mode 100644 drivers/atrinit.s
create mode 100644 drivers/c64init.s
create mode 100644 drivers/vic20init.s
diff --git a/drivers/Makefile b/drivers/Makefile
index b8425a9..40eaa25 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -62,34 +62,34 @@ VIC20OBJS=\
vic20vt100.o \
cbmcharconv.o
-c64rrnet.lib: rr-net.o cs8900a.o cs8900adriver.o ethernet.o $(C64OBJS)
+c64rrnet.lib: rr-net.o cs8900a.o cs8900adriver.o ethernet.o c64init.o $(C64OBJS)
ar65 a $@ $^
-c64eth64.lib: eth64.o lan91c96.o lan91c96driver.o ethernet.o $(C64OBJS)
+c64eth64.lib: eth64.o lan91c96.o lan91c96driver.o ethernet.o c64init.o $(C64OBJS)
ar65 a $@ $^
-c64wiz811.lib: wiz811mj.o w5100.o w5100driver.o ethernet.o $(C64OBJS)
+c64wiz811.lib: wiz811mj.o w5100.o w5100driver.o ethernet.o c64init.o $(C64OBJS)
ar65 a $@ $^
-c64combo.lib: rr-net.o cs8900a.o eth64.o lan91c96.o wiz811mj.o w5100.o ethernetcombo.o $(C64OBJS)
+c64combo.lib: rr-net.o cs8900a.o eth64.o lan91c96.o wiz811mj.o w5100.o ethernetcombo.o c64init.o $(C64OBJS)
ar65 a $@ $^
-a2uther.lib: uthernet.o cs8900a.o cs8900adriver.o ethernet.o a2slot.o $(A2OBJS)
+a2uther.lib: uthernet.o cs8900a.o cs8900adriver.o ethernet.o a2init.o $(A2OBJS)
ar65 a $@ $^
-a2lancegs.lib: lancegs.o lan91c96.o lan91c96driver.o ethernet.o a2slot.o $(A2OBJS)
+a2lancegs.lib: lancegs.o lan91c96.o lan91c96driver.o ethernet.o a2init.o $(A2OBJS)
ar65 a $@ $^
-a2uther2.lib: uthernet2.o w5100.o w5100driver.o ethernet.o a2slot.o $(A2OBJS)
+a2uther2.lib: uthernet2.o w5100.o w5100driver.o ethernet.o a2init.o $(A2OBJS)
ar65 a $@ $^
-a2combo.lib: uthernet.o cs8900a.o lancegs.o lan91c96.o uthernet2.o w5100.o ethernetcombo.o a2slotcombo.o $(A2OBJS)
+a2combo.lib: uthernet.o cs8900a.o lancegs.o lan91c96.o uthernet2.o w5100.o ethernetcombo.o a2initcombo.o $(A2OBJS)
ar65 a $@ $^
-atrdragon.lib: dragoncart.o cs8900a.o cs8900adriver.o ethernet.o $(ATROBJS)
+atrdragon.lib: dragoncart.o cs8900a.o cs8900adriver.o ethernet.o atrinit.o $(ATROBJS)
ar65 a $@ $^
-vic20rrnet.lib: vic20-rr-net.o cs8900a.o cs8900adriver.o ethernet.o $(VIC20OBJS)
+vic20rrnet.lib: vic20-rr-net.o cs8900a.o cs8900adriver.o ethernet.o vic20init.o $(VIC20OBJS)
ar65 a $@ $^
clean:
diff --git a/drivers/a2slot.s b/drivers/a2init.s
similarity index 89%
rename from drivers/a2slot.s
rename to drivers/a2init.s
index 62197af..2c1101e 100644
--- a/drivers/a2slot.s
+++ b/drivers/a2init.s
@@ -1,6 +1,7 @@
.include "zeropage.inc"
-.export a2_set_slot
+.export drv_init
+.exportzp drv_init_default = 3 ; Apple 2 default slot
.import eth_driver_io_base
@@ -12,7 +13,7 @@
; A: slot number (1-7)
; outputs:
; none
-a2_set_slot:
+drv_init:
asl
asl
asl
@@ -27,7 +28,7 @@ a2_set_slot:
-; -- LICENSE FOR a2slot.s --
+; -- LICENSE FOR a2init.s --
; The contents of this file are subject to the Mozilla Public License
; Version 1.1 (the "License"); you may not use this file except in
; compliance with the License. You may obtain a copy of the License at
diff --git a/drivers/a2slotcombo.s b/drivers/a2initcombo.s
similarity index 91%
rename from drivers/a2slotcombo.s
rename to drivers/a2initcombo.s
index 0da6676..fef5ffc 100644
--- a/drivers/a2slotcombo.s
+++ b/drivers/a2initcombo.s
@@ -1,6 +1,7 @@
.include "zeropage.inc"
-.export a2_set_slot
+.export drv_init
+.exportzp drv_init_default = 3 ; Apple 2 default slot
.import _w5100_driver_io_base
.import _cs8900a_driver_io_base
@@ -14,7 +15,7 @@
; A: slot number (1-7)
; outputs:
; none
-a2_set_slot:
+drv_init:
asl
asl
asl
@@ -39,7 +40,7 @@ a2_set_slot:
-; -- LICENSE FOR a2slotcombo.s --
+; -- LICENSE FOR a2initcombo.s --
; The contents of this file are subject to the Mozilla Public License
; Version 1.1 (the "License"); you may not use this file except in
; compliance with the License. You may obtain a copy of the License at
diff --git a/drivers/atrinit.s b/drivers/atrinit.s
new file mode 100644
index 0000000..e682800
--- /dev/null
+++ b/drivers/atrinit.s
@@ -0,0 +1,8 @@
+.export drv_init
+.exportzp drv_init_default = 0
+
+
+.code
+
+drv_init:
+ rts
diff --git a/drivers/c64init.s b/drivers/c64init.s
new file mode 100644
index 0000000..e682800
--- /dev/null
+++ b/drivers/c64init.s
@@ -0,0 +1,8 @@
+.export drv_init
+.exportzp drv_init_default = 0
+
+
+.code
+
+drv_init:
+ rts
diff --git a/drivers/vic20init.s b/drivers/vic20init.s
new file mode 100644
index 0000000..e682800
--- /dev/null
+++ b/drivers/vic20init.s
@@ -0,0 +1,8 @@
+.export drv_init
+.exportzp drv_init_default = 0
+
+
+.code
+
+drv_init:
+ rts
diff --git a/inc/net.i b/inc/net.i
index 5437b61..5f27a3f 100644
--- a/inc/net.i
+++ b/inc/net.i
@@ -12,14 +12,14 @@
.import dhcp_server
.ifdef A2_SLOT_SCAN
-.import a2_set_slot
+.import drv_init
.endif
.macro init_ip_via_dhcp
.ifdef A2_SLOT_SCAN
lda #1
: pha
- jsr a2_set_slot
+ jsr drv_init
jsr ip65_init
pla
bcc :+