1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-07-06 00:28:58 +00:00

Move Disk ][ defs into separate platform symbol file

The Disk ][ I/O locations are generally accessed as an offset, using
something like "LDA $C08n,X".  However the range from $C080-C08F is
already used for language card in slot 0.  SourceGen doesn't have a
way to distinguish between indexed and direct accesses, and even if
it did there's no way to separate one peripheral card from another
without knowing the contents of the CPU register.

As a workaround, the Disk ][ definitions are now in a separate symbol
file.  When loaded, the definitions replace the base slot 0 equates.

I figure Disk ][ accesses are more common than language card
manipulation, so I'm making it a default for new projects.  Existing
projects that reference the Disk ][ symbols (which existed, but as
constants) will need to be updated to include the new .sym65.
This commit is contained in:
Andy McFadden 2020-07-11 13:23:46 -07:00
parent abba1c8462
commit e82dc31da6
3 changed files with 39 additions and 24 deletions

View File

@ -0,0 +1,35 @@
; Copyright 2018 faddenSoft. All Rights Reserved.
; See the LICENSE.txt file for distribution terms (Apache 2.0).
;
; Sources:
; Various Apple II reference materials found online
*SYNOPSIS C08x I/O locations for the Disk ][
; Disk ][ I/O base address locations.
;
; A few things hard-code slot 6 for disk access, in which case addresses
; like $C0E8 will work here. It's far more common for code to use indexed
; addressing like "LDA $C088,X", which clashes with the slot 0
; definitions for the language card. SourceGen doesn't distinguish
; between direct and indexed access to a location when resolving platform
; symbols, so you can have one or the other.
;
; Other peripherals may use a similar system of indexing, so it's useful
; to have each in a separate file.
IWM_PH0_OFF @ $C080 ;IWM phase 0 off
IWM_PH0_ON @ $C081 ;IWM phase 0 on
IWM_PH1_OFF @ $C082 ;IWM phase 1 off
IWM_PH1_ON @ $C083 ;IWM phase 1 on
IWM_PH2_OFF @ $C084 ;IWM phase 2 off
IWM_PH2_ON @ $C085 ;IWM phase 2 on
IWM_PH3_OFF @ $C086 ;IWM phase 3 off
IWM_PH3_ON @ $C087 ;IWM phase 3 on
IWM_MOTOR_OFF @ $C088 ;IWM motor off
IWM_MOTOR_ON @ $C089 ;IWM motor on
IWM_DRIVE_1 @ $C08A ;IWM select drive 1
IWM_DRIVE_2 @ $C08B ;IWM select drive 2
IWM_Q6_OFF @ $C08C ;IWM read
IWM_Q6_ON @ $C08D ;IWM WP-sense
IWM_Q7_OFF @ $C08E ;IWM WP-sense/read
IWM_Q7_ON @ $C08F ;IWM write

View File

@ -137,30 +137,6 @@ LCBANK1 @ $C08B ;RWx2 read/write RAM bank 1
CLRROM @ $CFFF ;disable slot C8 ROM
; Disk ][ I/O locations.
;
; A few things hard-code slot 6 for disk access, in which case addresses
; like $C0E8 will work here. It's far more common for code to use indexed
; addressing like "LDA $C088,X", which clashes with the slot 0
; definitions. We define these symbols as constants so they're not
; applied automatically but are available for use.
IWM_PH0_OFF = $C080 ;IWM phase 0 off
IWM_PH0_ON = $C081 ;IWM phase 0 on
IWM_PH1_OFF = $C082 ;IWM phase 1 off
IWM_PH1_ON = $C083 ;IWM phase 1 on
IWM_PH2_OFF = $C084 ;IWM phase 2 off
IWM_PH2_ON = $C085 ;IWM phase 2 on
IWM_PH3_OFF = $C086 ;IWM phase 3 off
IWM_PH3_ON = $C087 ;IWM phase 3 on
IWM_MOTOR_OFF = $C088 ;IWM motor off
IWM_MOTOR_ON = $C089 ;IWM motor on
IWM_DRIVE_1 = $C08A ;IWM select drive 1
IWM_DRIVE_2 = $C08B ;IWM select drive 2
IWM_Q6_OFF = $C08C ;IWM read
IWM_Q6_ON = $C08D ;IWM WP-sense
IWM_Q7_OFF = $C08E ;IWM WP-sense/read
IWM_Q7_ON = $C08F ;IWM write
; Not strictly I/O locations, but they're in the neighborhood.
ROM_AUXMOVE @ $C311

View File

@ -12,6 +12,7 @@
"SymbolFiles" : [
"RT:Apple/F8-ROM.sym65",
"RT:Apple/Cxxx-IO.sym65",
"RT:Apple/C08x-DiskII.sym65",
"RT:Apple/ProDOS8.sym65"
],
"ExtensionScripts" : [
@ -31,6 +32,7 @@
"SymbolFiles" : [
"RT:Apple/F8-ROM.sym65",
"RT:Apple/Cxxx-IO.sym65",
"RT:Apple/C08x-DiskII.sym65",
"RT:Apple/DOS33.sym65"
],
"ExtensionScripts" : [
@ -49,6 +51,7 @@
"SymbolFiles" : [
"RT:Apple/F8-ROM.sym65",
"RT:Apple/Cxxx-IO.sym65",
"RT:Apple/C08x-DiskII.sym65",
"RT:Apple/ProDOS8.sym65",
"RT:Apple/IIgs-ROM.sym65"
],
@ -69,6 +72,7 @@
"Description" : "Apple IIgs, configured for GS/OS.",
"SymbolFiles" : [
"RT:Apple/Cxxx-IO.sym65",
"RT:Apple/C08x-DiskII.sym65",
"RT:Apple/IIgs-ROM.sym65",
"RT:Apple/GSOS.sym65"
],