Up to now static drivers were created via co65 from dynamic drivers. However there was an issue with that approach:
The dynamic drivers are "o65 simple files" which obligates that they start with the 'code' segment. However dynamic drivers need to start with the module header - which is written to. For dynamic drivers this isn't more than a conceptual issue because they are always contain a 'data' segment and may therefore only be loaded into writable memory.
However when dynamic drivers are converted to static drivers using co65 then that issue becomes a real problem as then the 'code' segment may end up in non-writable memory - and thus writing to the module header fails.
Instead of changing the way dynamic drivers work I opted to rather make static driver creation totally independent from dynamic drivers. This allows to place the module header in the 'data' segment (see 'module.mac').
--- /dev/null
+.ifndef DYN_DRV
+ DYN_DRV = 1
+.endif
+
+.macro module_header module_label
+ .if DYN_DRV
+ .segment "HEADER"
+ .else
+ .data
+ .export module_label
+ module_label:
+ .endif
+.endmacro
<sect1><tt>.MACPACK atari</tt><p>
-The atari macro package will define a macro named <tt/scrcode/. It takes a
-string as argument and places this string into memory translated into screen
-codes.
+This macro package defines a macro named <tt/scrcode/. It takes a string
+as argument and places this string into memory translated into screen codes.
<sect1><tt>.MACPACK cbm</tt><p>
-The cbm macro package will define a macro named <tt/scrcode/. It takes a
-string as argument and places this string into memory translated into screen
-codes.
+This macro package defines a macro named <tt/scrcode/. It takes a string
+as argument and places this string into memory translated into screen codes.
<sect1><tt>.MACPACK cpu</tt><p>
instruction is supported, which is the case for the 65SC02, 65C02 and 65816
CPUs (the latter two are upwards compatible to the 65SC02).
+
+<sect1><tt>.MACPACK module</tt><p>
+
+This macro package defines a macro named <tt/module_header/. It takes an
+identifier as argument and is used to define the header of a module both
+in the dynamic and static variant.
+
<sect>Predefined constants<label id="predefined-constants"><p>
define DRVTYPE_template
$1_SRCDIR = $$(SRCDIR)/$1
-$1_OBJDIR = ../libwrk/$$(TARGET)/$1
+$1_STCDIR = ../libwrk/$$(TARGET)
+$1_DYNDIR = ../libwrk/$$(TARGET)/$1
$1_DRVDIR = ../$1
-$1_OBJPAT = $$($1_OBJDIR)/$$(OBJPFX)%.o
+$1_SRCPAT = $$($1_SRCDIR)/$$(OBJPFX)%.s
+$1_STCPAT = $$($1_STCDIR)/$$(OBJPFX)%-$1.o
+$1_DYNPAT = $$($1_DYNDIR)/$$(OBJPFX)%.o
$1_DRVPAT = $$($1_DRVDIR)/$$(DRVPFX)%.$1
-$1_STCPAT = ../libwrk/$$(TARGET)/$$(DRVPFX)%-$1.o
-$1_OBJS := $$(patsubst $$($1_SRCDIR)/%.s,$$($1_OBJDIR)/%.o,$$(wildcard $$($1_SRCDIR)/*.s))
+$1_SRCS := $$(wildcard $$($1_SRCDIR)/*.s)
+$1_STCS = $$(patsubst $$($1_SRCPAT),$$($1_STCPAT),$$($1_SRCS))
+$1_DYNS = $$(patsubst $$($1_SRCPAT),$$($1_DYNPAT),$$($1_SRCS))
+$1_DRVS = $$(patsubst $$($1_DYNPAT),$$($1_DRVPAT),$$($1_DYNS))
-$1_DRVS = $$(patsubst $$($1_OBJPAT),$$($1_DRVPAT),$$($1_OBJS))
+$$($1_STCPAT): $$($1_SRCPAT)
+ @echo $$(TARGET) - $$< - static
+ @$$(CA65) -t $$(TARGET) -D DYN_DRV=0 $$(CA65FLAGS) --create-dep $$(@:.o=.d) -o $$@ $$<
-$1_STCS = $$(patsubst $$($1_DRVPAT),$$($1_STCPAT),$$($1_DRVS))
+OBJS += $$($1_STCS)
+DEPS += $$($1_STCS:.o=.d)
-$$($1_OBJS): | $$($1_OBJDIR)
+$$($1_DYNS): | $$($1_DYNDIR)
-$$($1_DRVPAT): $$($1_OBJPAT) $$(ZPOBJ) | $$($1_DRVDIR)
+$$($1_DRVPAT): $$($1_DYNPAT) $$(ZPOBJ) | $$($1_DRVDIR)
@echo $$(TARGET) - $$(<F)
@$$(LD65) -o $$@ -t module $$^
-$$($1_OBJDIR) $$($1_DRVDIR):
+$$($1_DYNDIR) $$($1_DRVDIR):
@$$(call MKDIR,$$@)
$(TARGET): $$($1_DRVS)
-$$($1_STCPAT): $$($1_DRVPAT)
- @echo $$(TARGET) - $$(<F)
- @$$(CO65) -o $$(@:.o=.s) --code-label _$$(subst -,_,$$(subst .,_,$$(<F))) $$<
- @$$(CA65) -t $$(TARGET) -o $$@ $$(@:.o=.s)
-
-OBJS += $$($1_STCS)
-
-DEPS += $$($1_OBJS:.o=.d)
+DEPS += $$($1_DYNS:.o=.d)
endef # DRVTYPE_template
AR65 := $(if $(wildcard ../bin/ar65*),../bin/ar65,ar65)
CA65 := $(if $(wildcard ../bin/ca65*),../bin/ca65,ca65)
CC65 := $(if $(wildcard ../bin/cc65*),../bin/cc65,cc65)
-CO65 := $(if $(wildcard ../bin/co65*),../bin/co65,co65)
LD65 := $(if $(wildcard ../bin/ld65*),../bin/ld65,ld65)
export CC65_HOME := $(abspath ..)
.include "em-kernel.inc"
.include "em-error.inc"
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ .ifdef __APPLE2ENH__
+ module_header _a2e_auxmem_emd
+ .else
+ module_header _a2_auxmem_emd
+ .endif
; Driver signature
.include "joy-error.inc"
.include "apple2.inc"
+ .macpack module
+
; ------------------------------------------------------------------------
; Constants
; Header. Includes jump table.
- .segment "HEADER"
+ .ifdef __APPLE2ENH__
+ module_header _a2e_stdjoy_joy
+ .else
+ module_header _a2_stdjoy_joy
+ .endif
; Driver signature
.include "mouse-kernel.inc"
.include "apple2.inc"
+ .macpack module
+
; ------------------------------------------------------------------------
SETMOUSE = $12 ; Sets mouse mode
; ------------------------------------------------------------------------
- .segment "HEADER"
+ .ifdef __APPLE2ENH__
+ module_header _a2e_stdmou_mou
+ .else
+ module_header _a2_stdmou_mou
+ .endif
; Driver signature
.byte $6D, $6F, $75 ; "mou"
.include "ser-kernel.inc"
.include "ser-error.inc"
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table
- .segment "HEADER"
+ .ifdef __APPLE2ENH__
+ module_header _a2e_ssc_ser
+ .else
+ module_header _a2_ssc_ser
+ .endif
; Driver signature
.byte $73, $65, $72 ; "ser"
.include "tgi-error.inc"
.include "apple2.inc"
+ .macpack module
+
; ------------------------------------------------------------------------
; Zero page stuff
; ------------------------------------------------------------------------
- .segment "HEADER"
+ .ifdef __APPLE2ENH__
+ module_header _a2e_hi_tgi
+ .else
+ module_header _a2_hi_tgi
+ .endif
; Header. Includes jump table and constants.
.include "tgi-error.inc"
.include "apple2.inc"
+ .macpack module
+
; ------------------------------------------------------------------------
; Zero page stuff
; ------------------------------------------------------------------------
- .segment "HEADER"
+ .ifdef __APPLE2ENH__
+ module_header _a2e_lo_tgi
+ .else
+ module_header _a2_lo_tgi
+ .endif
; Header. Includes jump table and constants.
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+.ifdef __ATARIXL__
+ module_header _atrx130_emd
+.else
+ module_header _atr130_emd
+.endif
; Driver signature
.include "atari.inc"
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+.ifdef __ATARIXL__
+ module_header _atrxmj8_joy
+.else
+ module_header _atrmj8_joy
+.endif
; Driver signature
.include "atari.inc"
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+.ifdef __ATARIXL__
+ module_header _atrxstd_joy
+.else
+ module_header _atrstd_joy
+.endif
; Driver signature
.include "atari.inc"
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+.ifdef __ATARIXL__
+ module_header _atrxjoy_mou
+.else
+ module_header _atrjoy_mou
+.endif
HEADER:
.include "atari.inc"
.macpack generic
+ .macpack module
.if .not ( .defined (AMIGA_MOUSE) .or .defined (TRAK_MOUSE))
ST_MOUSE = 1
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+.if .defined (ST_MOUSE)
+
+.ifdef __ATARIXL__
+ module_header _atrxst_mou
+.else
+ module_header _atrst_mou
+.endif
+
+.elseif .defined (AMIGA_MOUSE)
+
+.ifdef __ATARIXL__
+ module_header _atrxami_mou
+.else
+ module_header _atrami_mou
+.endif
+
+.elseif .defined (TRAK_MOUSE)
+
+.ifdef __ATARIXL__
+ module_header _atrxtrk_mou
+.else
+ module_header _atrtrk_mou
+.endif
+
+.endif
HEADER:
.include "atari.inc"
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+.ifdef __ATARIXL__
+ module_header _atrxtt_mou
+.else
+ module_header _atrtt_mou
+.endif
HEADER:
.include "ser-error.inc"
.include "atari.inc"
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+.ifdef __ATARIXL__
+ module_header _atrxrdev_ser
+.else
+ module_header _atrrdev_ser
+.endif
; Driver signature
;
.macpack longbranch
+.macpack module
.ifdef __ATARIXL__
CIO_vec := my_CIOV
;
; ----------------------------------------------------------------------
-.segment "HEADER"
+.ifdef __ATARIXL__
+ .define LABEL_X "x"
+.else
+ .define LABEL_X ""
+.endif
+
+.if pages = 2
+ .define LABEL_P2 "p2"
+.else
+ .define LABEL_P2 ""
+.endif
+
+ module_header .ident (.sprintf ("_atr%s%d%s_tgi", LABEL_X, ::grmode, LABEL_P2))
; Header
.include "joy-error.inc"
.include "atari5200.inc"
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _atr5200std_joy
; Driver signature
.include "joy-error.inc"
.include "atmos.inc"
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _atmos_pase_joy
; Driver signature
.include "ser-error.inc"
.include "atmos.inc"
+ .macpack module
+
+
; ------------------------------------------------------------------------
; Header. Includes jump table
- .segment "HEADER"
+ module_header _atmos_acia_ser
; Driver signature
.byte $73, $65, $72 ; "ser"
.include "atmos.inc"
.macpack generic
+ .macpack module
XSIZE = 6 ; System font width
YSIZE = 8 ; System font height
; ------------------------------------------------------------------------
; Header. Includes jump table and constants.
-.segment "HEADER"
+ module_header _atmos_228_200_3_tgi
; The first part of the header is a structure that has a signature,
; and defines the capabilities of the driver.
.include "atmos.inc"
.macpack generic
+ .macpack module
XSIZE = 6 ; System font width
YSIZE = 8 ; System font height
; ------------------------------------------------------------------------
; Header. Includes jump table and constants.
-.segment "HEADER"
+ module_header _atmos_240_200_2_tgi
; First part of the header is a structure that has a magic and defines the
; capabilities of the driver
.include "em-kernel.inc"
.include "em-error.inc"
-
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _c128_georam_emd
; Driver signature
.include "em-error.inc"
.include "c128.inc"
-
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _c128_ram_emd
; Driver signature
.include "em-error.inc"
.include "c128.inc"
-
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _c128_ram2_emd
; Driver signature
.include "em-kernel.inc"
.include "em-error.inc"
-
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _c128_ramcart_emd
; Driver signature
.include "em-error.inc"
.include "c128.inc"
-
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _c128_reu_emd
; Driver signature
.include "em-kernel.inc"
.include "em-error.inc"
-
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _c128_vdc_emd
; Driver signature
.include "c128.inc"
.macpack generic
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table
- .segment "HEADER"
+ module_header _c128_ptvjoy_joy
; Driver signature
.include "c128.inc"
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _c128_stdjoy_joy
; Driver signature
.include "c128.inc"
.macpack generic
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _c128_1351_mou
HEADER:
.include "c128.inc"
.macpack generic
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table.
-.segment "HEADER"
+ module_header _c128_inkwell_mou
HEADER:
.include "c128.inc"
.macpack generic
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _c128_joy_mou
HEADER:
.include "c128.inc"
.macpack generic
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _c128_pot_mou
HEADER:
.include "ser-error.inc"
.include "c128.inc"
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _c128_swlink_ser
; Driver signature
.include "tgi-kernel.inc"
.include "tgi-error.inc"
-
.macpack generic
+ .macpack module
+
; ------------------------------------------------------------------------
; Constants
; ------------------------------------------------------------------------
; Header. Includes jump table and constants.
-.segment "HEADER"
+ module_header _c128_vdc_tgi
; First part of the header is a structure that has a magic and defines the
; capabilities of the driver
.include "tgi-kernel.inc"
.include "tgi-error.inc"
-
.macpack generic
+ .macpack module
+
; ------------------------------------------------------------------------
; Constants
; ------------------------------------------------------------------------
; Header. Includes jump table and constants.
-.segment "HEADER"
+ module_header _c128_vdc2_tgi
; First part of the header is a structure that has a magic and defines the
; capabilities of the driver
.include "plus4.inc"
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _c16_ram_emd
; Driver signature
; Ullrich von Bassewitz, 2002-12-21
;
- .include "../../plus4/joy/plus4-stdjoy.s"
+ .define MODULE_LABEL _c16_stdjoy_joy
+ .include "../../plus4/joy/plus4-stdjoy.s"
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _c64_c256k_emd
; Driver signature
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _c64_dqbb_emd
; Driver signature
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _c64_georam_emd
; Driver signature
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _c64_isepic_emd
; Driver signature
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _c64_ram_emd
; Driver signature
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _c64_ramcart_emd
; Driver signature
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _c64_reu_emd
; Driver signature
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _c64_vdc_emd
; Driver signature
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _dtv_himem_emd
; Driver signature
.include "c64.inc"
.macpack generic
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table
- .segment "HEADER"
+ module_header _c64_hitjoy_joy
; Driver signature
.include "c64.inc"
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _c64_numpad_joy
; Driver signature
.include "c64.inc"
.macpack generic
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table
- .segment "HEADER"
+ module_header _c64_ptvjoy_joy
; Driver signature
.include "c64.inc"
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _c64_stdjoy_joy
; Driver signature
.include "c64.inc"
.macpack generic
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _c64_1351_mou
HEADER:
.include "c64.inc"
.macpack generic
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table.
-.segment "HEADER"
+ module_header _c64_inkwell_mou
HEADER:
.include "c64.inc"
.macpack generic
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _c64_joy_mou
HEADER:
.include "c64.inc"
.macpack generic
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _c64_pot_mou
HEADER:
.include "ser-error.inc"
.include "c64.inc"
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _c64_swlink_ser
; Driver signature
.include "tgi-kernel.inc"
.include "tgi-error.inc"
-
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table and constants.
-.segment "HEADER"
+ module_header _c64_hi_tgi
; First part of the header is a structure that has a magic and defines the
; capabilities of the driver
.include "cbm510.inc"
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _cbm510_ram_emd
; Driver signature
.include "cbm510.inc"
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _cbm510_std_joy
; Driver signature
.include "cbm510.inc"
.macpack generic
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table.
-.segment "HEADER"
+ module_header _cbm510_inkwl_mou
HEADER:
.include "cbm510.inc"
.macpack generic
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _cbm510_joy_mou
HEADER:
.include "ser-error.inc"
.include "cbm510.inc"
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _cbm510_std_ser
; Driver signature
.include "cbm610.inc"
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _cbm610_ram_emd
; Driver signature
.include "ser-error.inc"
.include "cbm610.inc"
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _cbm610_std_ser
; Driver signature
.include "em-error.inc"
.macpack generic
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _geos_vdc_emd
; Driver signature
.include "geossym.inc"
.macpack generic
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
-
+ module_header _geos_stdjoy_joy
+
; Driver signature
.byte $6A, $6F, $79 ; "joy"
.include "jumptab.inc"
.include "geossym.inc"
.include "geossym2.inc"
-
+
.macpack generic
+ .macpack module
+
; ------------------------------------------------------------------------
; Constants
; ------------------------------------------------------------------------
; Header. Includes jump table and constants.
-.segment "HEADER"
+ module_header _geos_tgi_tgi
; First part of the header is a structure that has a magic signature,
; and defines the capabilities of the driver.
.include "lynx.inc"
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _lynx_stdjoy_joy
; Driver signature
.include "ser-kernel.inc"
.include "ser-error.inc"
+ .macpack module
+
+
; ------------------------------------------------------------------------
; Header. Includes jump table
- .segment "HEADER"
+ module_header _lynx_comlynx_ser
; Driver signature
.byte $73, $65, $72 ; "ser"
.include "lynx.inc"
.macpack generic
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table and constants.
-.segment "HEADER"
+ module_header _lynx_160_102_16_tgi
; First part of the header is a structure that has a magic and defines the
; capabilities of the driver
.include "joy-error.inc"
.include "nes.inc"
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _nes_stdjoy_joy
; Driver signature
.import paldata
.macpack generic
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table and constants.
-.segment "HEADER"
+ module_header _nes_64_56_2_tgi
; First part of the header is a structure that has a magic and defines the
; capabilities of the driver
.include "joy-kernel.inc"
.include "joy-error.inc"
-; .include "pet.inc"
-VIA_PRA := $E841 ; Port register A
-VIA_DDRA := $E843 ; Data direction register A
+
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table
- .segment "HEADER"
+ module_header _pet_ptvjoy_joy
; Driver signature
; ------------------------------------------------------------------------
; Constants
-JOY_COUNT = 2 ; Number of joysticks we support
+JOY_COUNT = 2 ; Number of joysticks we support
+
+VIA_PRA := $E841 ; Port register A
+VIA_DDRA := $E843 ; Data direction register A
.code
.include "joy-error.inc"
.include "pet.inc"
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table
- .segment "HEADER"
+ module_header _pet_stdjoy_joy
; Driver signature
.include "plus4.inc"
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ .if .xmatch ("MODULE_LABEL", .string(MODULE_LABEL))
+ module_header _plus4_stdjoy_joy
+ .else
+ module_header MODULE_LABEL
+ .endif
; Driver signature
.include "ser-error.inc"
.include "plus4.inc"
+ .macpack module
+
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _plus4_stdser_ser
; Driver signature
.include "joy-error.inc"
.include "vic20.inc"
+ .macpack module
+
+
; ------------------------------------------------------------------------
; Header. Includes jump table
- .segment "HEADER"
+ module_header _vic20_ptvjoy_joy
; Driver signature
.include "vic20.inc"
.macpack generic
+ .macpack module
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "HEADER"
+ module_header _vic20_stdjoy_joy
; Driver signature