Merge remote-tracking branch 'upstream/master' into creativision

This commit is contained in:
Christian Groessler
2017-02-01 18:15:05 +01:00
404 changed files with 8404 additions and 3086 deletions

48
asminc/apple2.mac Normal file
View File

@@ -0,0 +1,48 @@
; Convert characters to screen codes
; Helper macro that converts and outputs one character
.macro _scrcode char
.if (char < 256)
.byte (char + 128)
.else
.error "scrcode: Character constant out of range"
.endif
.endmacro
.macro scrcode arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9
; Bail out if next argument is empty
.if .blank (arg1)
.exitmacro
.endif
; Check for a string
.if .match ({arg1}, "")
; Walk over all string chars
.repeat .strlen (arg1), i
_scrcode {.strat (arg1, i)}
.endrepeat
; Check for a number
.elseif .match (.left (1, {arg1}), 0)
; Just output the number
_scrcode arg1
; Check for a character
.elseif .match (.left (1, {arg1}), 'a')
; Just output the character
_scrcode arg1
; Anything else is an error
.else
.error "scrcode: invalid argument type"
.endif
; Call the macro recursively with the remaining args
scrcode arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9
.endmacro

View File

@@ -106,7 +106,7 @@ SIO_WRPERCOM = $4F ;write PERCOM block (XF551)
SIO_WRITE = $50 ;write sector
SIO_READ = $52 ;read sector
SIO_STAT = $53 ;get status information
SIO_VERIFY = $56 ;verify sector
SIO_VERIFY = $56 ;verify sector
SIO_WRITEV = $57 ;write sector with verify
SIO_WRITETRK = $60 ;write track (Speedy)
SIO_READTRK = $62 ;read track (Speedy)
@@ -183,6 +183,7 @@ FNTFND = 170 ;($AA) file not found
PNTINV = 171 ;($AB) point invalid
BADDSK = 173 ;($AD) bad disk
INCFMT = 176 ;($B0) DOS 3: incompatible file system
XNTBIN = 180 ;($B4) XDOS: file not binary
; DCB Device Bus Equates
@@ -689,7 +690,7 @@ CASFLG = $030F ;CASSETTE MODE WHEN SET
TIMER2 = $0310 ;2-byte final baud rate timer value
TEMP1 = $0312 ;TEMPORARY STORAGE REGISTER
;TEMP2 = $0314 ;##old## TEMPORARY STORAGE REGISTER
TEMP2 = $0313 ;##1200xl## 1-byte temporary
TEMP2 = $0313 ;##1200xl## 1-byte temporary
PTIMOT = $0314 ;##1200xl## 1-byte printer timeout
TEMP3 = $0315 ;TEMPORARY STORAGE REGISTER
SAVIO = $0316 ;SAVE SERIAL IN DATA PORT
@@ -765,7 +766,7 @@ CART = $BFFC ;##rev2## 1-byte cartridge present indicator
;0=Cart Exists
CARTFG = $BFFD ;##rev2## 1-byte cartridge flags
;D7 0=Not a Diagnostic Cart
; 1=Is a Diagnostic cart and control is
; 1=Is a Diagnostic cart and control is
; given to cart before any OS is init.
;D2 0=Init but Do not Start Cart
; 1=Init and Start Cart
@@ -889,6 +890,10 @@ SETVBV_org = $E45C ;vector to set VBLANK parameters
CIOV = $E456 ;vector to CIO
SIOV = $E459 ;vector to SIO
SETVBV = $E45C ;vector to set VBLANK parameters
; aliases in order not to have to sprinkle common code with .ifdefs
CIOV_org = CIOV
SIOV_org = SIOV
SETVBV_org = SETVBV
.endif
SYSVBV = $E45F ;vector to process immediate VBLANK
XITVBV = $E462 ;vector to process deferred VBLANK
@@ -925,7 +930,7 @@ RADON = 0 ;INDICATES RADIANS
DEGON = 6 ;INDICATES DEGREES
ASCZER = '0' ;ASCII ZERO
COLON = $3A ;ASCII COLON
COLON = $3A ;ASCII COLON
CR = $9B ;SYSTEM EOL (CARRIAGE RETURN)
;-------------------------------------------------------------------------
@@ -997,12 +1002,38 @@ diopp_size = 5 ; size of structure
; VALUES for dos_type
;-------------------------------------------------------------------------
ATARIDOS = 0
SPARTADOS = 1
OSADOS = 2 ; OS/A+
MYDOS = 3
XDOS = 4
SPARTADOS = 0
OSADOS = 1 ; OS/A+
XDOS = 2
ATARIDOS = 3
MYDOS = 4
NODOS = 255
; The DOSes with dos_type below or equal MAX_DOS_WITH_CMDLINE do support
; command line arguments.
MAX_DOS_WITH_CMDLINE = XDOS
;-------------------------------------------------------------------------
; XDOS defines (version 2.4, taken from xdos24.pdf)
;-------------------------------------------------------------------------
XOPT = $070B ; XDOS options
XCAR = $070C ; XDOS cartridge address (+ $70D)
XPAT = $086F ; XDOS bugfix and patch number
XVER = $0870 ; XDOS version number
XFILE = $087D ; XDOS filename buffer
XLINE = $0880 ; XDOS DUP input line
XGLIN = $0871 ; get line
XSKIP = $0874 ; skip parameter
.ifdef __ATARIXL__
.ifndef SHRAM_HANDLERS
.import XMOVE_handler
.endif
.define XMOVE XMOVE_handler
XMOVE_org = $0877 ; move filename
.else
XMOVE = $0877 ; move filename
.endif
XGNUM = $087A ; get number
;-------------------------------------------------------------------------
; End of atari.inc

7
asminc/atari2600.inc Normal file
View File

@@ -0,0 +1,7 @@
; Atari 2600 TIA & RIOT read / write registers
;
; Florent Flament (contact@florentflament.com), 2017
; TIA & RIOT registers mapping
.include "atari2600_tia.inc"
.include "atari2600_riot.inc"

20
asminc/atari2600_riot.inc Normal file
View File

@@ -0,0 +1,20 @@
; Atari 2600 RIOT read / write registers
;
; Source: DASM - vcs.h
; Details available in: Stella Programmer's Guide by Steve Wright
;
; Florent Flament (contact@florentflament.com), 2017
; Read registers
SWCHA := $0280
SWACNT := $0281
SWCHB := $0282
SWBCNT := $0283
INTIM := $0284
TIMINT := $0285
; Write registers
TIM1T := $0294
TIM8T := $0295
TIM64T := $0296
T1024T := $0297

69
asminc/atari2600_tia.inc Normal file
View File

@@ -0,0 +1,69 @@
; Atari 2600 TIA read / write registers
;
; Source: DASM - vcs.h
; Details available in: Stella Programmer's Guide by Steve Wright
;
; Florent Flament (contact@florentflament.com), 2017
; Read registers
VSYNC := $00
VBLANK := $01
WSYNC := $02
RSYNC := $03
NUSIZ0 := $04
NUSIZ1 := $05
COLUP0 := $06
COLUP1 := $07
COLUPF := $08
COLUBK := $09
CTRLPF := $0A
REFP0 := $0B
REFP1 := $0C
PF0 := $0D
PF1 := $0E
PF2 := $0F
RESP0 := $10
RESP1 := $11
RESM0 := $12
RESM1 := $13
RESBL := $14
AUDC0 := $15
AUDC1 := $16
AUDF0 := $17
AUDF1 := $18
AUDV0 := $19
AUDV1 := $1A
GRP0 := $1B
GRP1 := $1C
ENAM0 := $1D
ENAM1 := $1E
ENABL := $1F
HMP0 := $20
HMP1 := $21
HMM0 := $22
HMM1 := $23
HMBL := $24
VDELP0 := $25
VDELP1 := $26
VDELBL := $27
RESMP0 := $28
RESMP1 := $29
HMOVE := $2A
HMCLR := $2B
CXCLR := $2C
; Write registers
CXM0P := $00
CXM1P := $01
CXP0FB := $02
CXP1FB := $03
CXM0FB := $04
CXM1FB := $05
CXBLPF := $06
CXPPMM := $07
INPT0 := $08
INPT1 := $09
INPT2 := $0A
INPT3 := $0B
INPT4 := $0C
INPT5 := $0D

View File

@@ -7,6 +7,8 @@ CPU_ISET_65C02 = $0010
CPU_ISET_65816 = $0020
CPU_ISET_SWEET16 = $0040
CPU_ISET_HUC6280 = $0080
;CPU_ISET_M740 = $0100 not actually implemented
CPU_ISET_4510 = $0200
; CPU capabilities
CPU_NONE = CPU_ISET_NONE
@@ -17,3 +19,4 @@ CPU_65C02 = CPU_ISET_6502|CPU_ISET_65SC02|CPU_ISET_65C02
CPU_65816 = CPU_ISET_6502|CPU_ISET_65SC02|CPU_ISET_65816
CPU_SWEET16 = CPU_ISET_SWEET16
CPU_HUC6280 = CPU_ISET_6502|CPU_ISET_65SC02|CPU_ISET_65C02|CPU_ISET_HUC6280
CPU_4510 = CPU_ISET_6502|CPU_ISET_65SC02|CPU_ISET_65C02|CPU_ISET_4510

View File

@@ -28,6 +28,7 @@
ESPIPE ; Illegal seek
ERANGE ; Range error
EBADF ; Bad file number
ENOEXEC ; Exec format error
EUNKNOWN ; Unknown OS specific error - must be last!
EMAX = EUNKNOWN ; Highest error code

View File

@@ -4,7 +4,7 @@
;
; Reference:
; Bastian Schick's Lynx Documentation
; http://www.geocities.com/SiliconValley/Byte/4242/lynx/
; http://www.geocities.ws/SiliconValley/Byte/4242/lynx/
;
; ***

View File

@@ -1,7 +1,7 @@
; smc.mac
; ca65 Macro-Pack for Self Modifying Code (SMC)
;
; (c) Christian Kr<EFBFBD>ger, latest change: 09-Nov-2011
; (c) Christian Krüger, latest change: 17-Jul-2016
;
; This software is provided 'as-is', without any expressed or implied
; warranty. In no event will the authors be held liable for any damages
@@ -53,7 +53,7 @@ _SMCDesignator: statement
.endmacro
.macro SMC_TransferOpcode label, opcode, register
.if .paramcount = 2 .or .match ({register}, a)
.if .paramcount = 2 .or .match ({register}, a) .or .match ({register}, )
lda #opcode
sta _SMCDesignator
.elseif .match ({register}, x)
@@ -62,44 +62,52 @@ _SMCDesignator: statement
.elseif .match ({register}, y)
ldy #opcode
sty _SMCDesignator
.else
.error "Invalid usage of macro 'SMC_TransferOpcode'"
.endif
.endmacro
.macro SMC_LoadOpcode label, register
.if .paramcount = 1 .or .match ({register}, a)
.if .paramcount = 1 .or .match ({register}, a) .or .match ({register}, )
lda _SMCDesignator
.elseif .match ({register}, x)
ldx _SMCDesignator
.elseif .match ({register}, y)
ldy _SMCDesignator
.else
.error "Invalid usage of macro 'SMC_LoadOpcode'"
.endif
.endmacro
.macro SMC_StoreOpcode label, register
.if .paramcount = 1 .or .match ({register}, a)
.if .paramcount = 1 .or .match ({register}, a) .or .match ({register}, )
sta _SMCDesignator
.elseif .match ({register}, x)
stx _SMCDesignator
.elseif .match ({register}, y)
sty _SMCDesignator
.else
.error "Invalid usage of macro 'SMC_StoreOpcode'"
.endif
.endmacro
.macro SMC_ChangeBranch label, destination, register
.if .paramcount = 2 .or .match ({register}, a)
lda #(destination - _SMCDesignator -2)
.if .paramcount = 2 .or .match ({register}, a) .or .match ({register}, )
lda #(<(destination - _SMCDesignator -2))
sta _SMCDesignator+1
.elseif .match ({register}, x)
ldx #(destination - _SMCDesignator - 2)
ldx #(<(destination - _SMCDesignator - 2))
stx _SMCDesignator+1
.elseif .match ({register}, y)
ldy #(destination - _SMCDesignator - 2)
ldy #(<(destination - _SMCDesignator - 2))
sty _SMCDesignator+1
.else
.error "Invalid usage of macro 'SMC_ChangeBranch'"
.endif
.endmacro
.macro SMC_TransferValue label, value, register
.if .paramcount = 2 .or .match ({register}, a)
.if .paramcount = 2 .or .match ({register}, a) .or .match ({register}, )
lda value
sta _SMCDesignator+1
.elseif .match ({register}, x)
@@ -108,26 +116,32 @@ _SMCDesignator: statement
.elseif .match ({register}, y)
ldy value
sty _SMCDesignator+1
.else
.error "Invalid usage of macro 'SMC_TransferValue'"
.endif
.endmacro
.macro SMC_LoadValue label, register
.if .paramcount = 1 .or .match ({register}, a)
.if .paramcount = 1 .or .match ({register}, a) .or .match ({register}, )
lda _SMCDesignator+1
.elseif .match ({register}, x)
ldx _SMCDesignator+1
.elseif .match ({register}, y)
ldy _SMCDesignator+1
.else
.error "Invalid usage of macro 'SMC_LoadValue'"
.endif
.endmacro
.macro SMC_StoreValue label, register
.if .paramcount = 1 .or .match ({register}, a)
.if .paramcount = 1 .or .match ({register}, a) .or .match ({register}, )
sta _SMCDesignator+1
.elseif .match ({register}, x)
stx _SMCDesignator+1
.elseif .match ({register}, y)
sty _SMCDesignator+1
.else
.error "Invalid usage of macro 'SMC_StoreValue'"
.endif
.endmacro
@@ -145,7 +159,7 @@ SMC_StoreValue label, register
.endmacro
.macro SMC_TransferHighByte label, value, register
.if .paramcount = 2 .or .match ({register}, a)
.if .paramcount = 2 .or .match ({register}, a) .or .match ({register}, )
lda value
sta _SMCDesignator+2
.elseif .match ({register}, x)
@@ -154,31 +168,37 @@ SMC_StoreValue label, register
.elseif .match ({register}, y)
ldy value
sty _SMCDesignator+2
.else
.error "Invalid usage of macro 'SMC_TransferHighByte'"
.endif
.endmacro
.macro SMC_LoadHighByte label, register
.if .paramcount = 1 .or .match ({register}, a)
.if .paramcount = 1 .or .match ({register}, a) .or .match ({register}, )
lda _SMCDesignator+2
.elseif .match ({register}, x)
ldx _SMCDesignator+2
.elseif .match ({register}, y)
ldy _SMCDesignator+2
.else
.error "Invalid usage of macro 'SMC_LoadHighByte'"
.endif
.endmacro
.macro SMC_StoreHighByte label, register
.if .paramcount = 1 .or .match ({register}, a)
.if .paramcount = 1 .or .match ({register}, a) .or .match ({register}, )
sta _SMCDesignator+2
.elseif .match ({register}, x)
stx _SMCDesignator+2
.elseif .match ({register}, y)
sty _SMCDesignator+2
.else
.error "Invalid usage of macro 'SMC_StoreHighByte'"
.endif
.endmacro
.macro SMC_TransferAddressSingle label, address, register
.if .paramcount = 2 .or .match ((register), a)
.if .paramcount = 2 .or .match ((register), a) .or .match ({register}, )
.if (.match (.left (1, {address}), #))
; immediate mode
lda #<(.right (.tcount ({address})-1, {address}))
@@ -220,6 +240,8 @@ SMC_StoreValue label, register
ldy 1+(address)
sty _SMCDesignator+2
.endif
.else
.error "Invalid usage of macro 'SMC_TransferAddressSingle'"
.endif
.endmacro

View File

@@ -1,8 +1,7 @@
; supervision symbols
; supervision 65c02s
; in cc65 up to 2.9.1 65c02 means 65c02s
.pc02
; supervision 65c02s
; in cc65 up to 2.9.1 65c02 means 65sc02
lcd_addr = $4000
LCD_LINESIZE = $30