diff --git a/README.md b/README.md index d322c87db..c04802821 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,8 @@ What does Prog8 provide? - "c64": Commodore-64 (6502 like CPU) - "c128": Commodore-128 (6502 like CPU - the Z80 cpu mode is not supported) - "pet32": Commodore PET (limited support) -- "amiga500": Commodore Amiga 500 (32-bit 68000 CPU - the intended machine for the m68k code generator backend) +- "amiga500": Commodore Amiga 500 (16/32-bit 68000 CPU) +- "amiga1200": Commodore Amiga 1200 (32-bit 68020 CPU with optional FPU) - "qemu68k": Qemu M68k simulator (experimental) - via external configurable targets: Atari 800 XL, Neo6502, NES, C64 OS, Foenix F256, ... - If you only use standard kernal and prog8 library routines, it is possible to compile the *exact same program* for different machines (just change the compiler target flag) diff --git a/codeCore/src/prog8/code/target/Amiga1200Target.kt b/codeCore/src/prog8/code/target/Amiga1200Target.kt new file mode 100644 index 000000000..7fddf5e63 --- /dev/null +++ b/codeCore/src/prog8/code/target/Amiga1200Target.kt @@ -0,0 +1,107 @@ +package prog8.code.target + +import prog8.code.core.* +import prog8.code.target.encodings.Encoder +import java.nio.file.Path + + +class Amiga1200Target: ICompilationTarget, + IStringEncoding by Encoder(false), + IMemSizer by NormalMemSizer(4u, 4u) { + + override val name = NAME + override val supportsBankedCalls = true + override val defaultEncoding = Encoding.ISO + override val libraryPath = null + override val customLauncher = emptyList() + override val additionalAssemblerOptions = emptyList() + override val defaultOutputType = OutputType.AMIGAHUNK + override val defaultLauncherType = CbmPrgLauncherType.NONE + + companion object { + const val NAME = "amiga1200" + + /** needed to map bank numbers to libraries in extsub/CALLFAR library calls */ + val LibraryNumbers = Amiga500Target.LibraryNumbers + } + + override val cpu = CpuType.M68020 + + override val FLOAT_MAX_POSITIVE = Float.MAX_VALUE.toDouble() + override val FLOAT_MAX_NEGATIVE = -Float.MAX_VALUE.toDouble() + override val FLOAT_MEM_SIZE = 4u + override val POINTER_MEM_SIZE = 4u + override val ARRAY_SIZE_LIMIT = 32768u + override val PROGRAM_LOAD_ADDRESS = 0u // amiga executables are relocatable + override val PROGRAM_MEMTOP_ADDRESS = 0xfffffffeu // not actually used + + override val BSSHIGHRAM_START = 0u // not used + override val BSSHIGHRAM_END = 0u // not used + override val BSSGOLDENRAM_START = 0u // not used + override val BSSGOLDENRAM_END = 0u // not used + override lateinit var zeropage: Zeropage + + override fun getFloatAsmBytes(num: Number): String { + TODO("float asm bytes") + } + + override fun convertFloatToBytes(num: Double): List { + TODO("convert float to bytes") + } + + override fun convertBytesToFloat(bytes: List): Double { + require(bytes.size==4) { "need 4 bytes" } + TODO("convert bytes to float") + } + + override fun launchEmulator(selectedEmulator: Int, programNameWithPath: Path, quiet: Boolean) { + if(selectedEmulator!=1) { + System.err.println("The amiga1200 target only supports the main emulator (Amitools's vamos).") + return + } + val cpuStr = when(this.cpu) { + CpuType.M68000 -> "68000" + CpuType.M68020 -> "68020" + else -> error("invalid cpu type") + } + val exeFile = programNameWithPath.resolveSibling("${programNameWithPath.fileName}") + val cmd = + listOf( + "vamos", + "--cpu", cpuStr, + exeFile.toString(), + ) + if(!quiet) + println("Launching Amitools's Vamos...") + val pb = ProcessBuilder(cmd).inheritIO() + try { + pb.start().waitFor() + } catch(_: Exception) { + System.err.println("Cannot find 'vamos' (Amitools's Amiga emulator). Install it from: https://github.com/cnvogelg/amitools") + } + } + + override fun isIOAddress(address: UInt): Boolean = + address in 0xbfd000u..0xbfdfffu || // CIA-B + address in 0xbfe000u..0xbfefffu || // CIA-A + address in 0xdff000u..0xdff1ffu || // Custom chipset (Paula, Alice, Lisa, Denise) + address in 0xe80000u..0xefffffu // Zorro II autoconfig space + + override fun initializeMemoryAreas(compilerOptions: CompilationOptions) { + zeropage = Amiga1200Zeropage(compilerOptions) + } +} + + +private class Amiga1200Zeropage(options: CompilationOptions): Zeropage(options) { + override val SCRATCH_B1: UInt + get() = throw IllegalStateException("m68k shouldn't use this zeropage variable") + override val SCRATCH_REG: UInt + get() = throw IllegalStateException("m68k shouldn't use this zeropage variable") + override val SCRATCH_W1: UInt + get() = throw IllegalStateException("m68k shouldn't use this zeropage variable") + override val SCRATCH_W2: UInt + get() = throw IllegalStateException("m68k shouldn't use this zeropage variable") + override val SCRATCH_PTR: UInt + get() = throw IllegalStateException("m68k shouldn't use this zeropage variable") +} diff --git a/codeCore/src/prog8/code/target/C64Target.kt b/codeCore/src/prog8/code/target/C64Target.kt index 5477574b0..e2406e56c 100644 --- a/codeCore/src/prog8/code/target/C64Target.kt +++ b/codeCore/src/prog8/code/target/C64Target.kt @@ -31,7 +31,7 @@ class C64Target: ICompilationTarget, override val FLOAT_MAX_POSITIVE = Mflpt5.FLOAT_MAX_POSITIVE override val FLOAT_MAX_NEGATIVE = Mflpt5.FLOAT_MAX_NEGATIVE - override val FLOAT_MEM_SIZE = Mflpt5.FLOAT_MEM_SIZE.toUInt() + override val FLOAT_MEM_SIZE = Mflpt5.FLOAT_MEM_SIZE override val POINTER_MEM_SIZE = 2u override val ARRAY_SIZE_LIMIT = 256u override val PROGRAM_LOAD_ADDRESS = 0x0801u @@ -101,6 +101,7 @@ val CompilationTargets = listOf( PETTarget.NAME, Qemu68kTarget.NAME, Amiga500Target.NAME, + Amiga1200Target.NAME, VMTarget.NAME ) @@ -111,6 +112,7 @@ fun getCompilationTargetByName(name: String) = when(name.lowercase()) { PETTarget.NAME -> PETTarget() Qemu68kTarget.NAME -> Qemu68kTarget() Amiga500Target.NAME -> Amiga500Target() + Amiga1200Target.NAME -> Amiga1200Target() VMTarget.NAME -> VMTarget() else -> throw IllegalArgumentException("invalid compilation target") } diff --git a/codeGenIntermediate/src/prog8/codegen/intermediate/RegisterPacker.kt b/codeGenIntermediate/src/prog8/codegen/intermediate/RegisterPacker.kt index b386ef3c2..22b24c463 100644 --- a/codeGenIntermediate/src/prog8/codegen/intermediate/RegisterPacker.kt +++ b/codeGenIntermediate/src/prog8/codegen/intermediate/RegisterPacker.kt @@ -163,7 +163,7 @@ object RegisterPacker { if (chunk.instructions.isEmpty()) continue - var liveSet = liveOut[chunk]?.toMutableSet() ?: mutableSetOf() + val liveSet = liveOut[chunk]?.toMutableSet() ?: mutableSetOf() val lastUse = mutableMapOf() // Scan backward through instructions diff --git a/codeGenM68k/src/prog8/codegen/m68k/AsmGen.kt b/codeGenM68k/src/prog8/codegen/m68k/AsmGen.kt index 75155da13..1f6434449 100644 --- a/codeGenM68k/src/prog8/codegen/m68k/AsmGen.kt +++ b/codeGenM68k/src/prog8/codegen/m68k/AsmGen.kt @@ -316,10 +316,10 @@ internal class AsmGen(val program: IRProgram, internal val target: ICompilationT emitDataSection() emitBssSection() - if(target.name=="amiga500") { + if(program.options.output == OutputType.AMIGAHUNK) { emitRaw("prog8_program_end: ; end of the program") } else { - // label prog8_program_end is defined by the linker script + // label prog8_program_end is defined by the linker script (ELF) } val options = program.options @@ -406,7 +406,7 @@ internal class AsmGen(val program: IRProgram, internal val target: ICompilationT // extb.l is a 68020+ instruction; on the 68000 use the two-step EXT sequence // (ext.w then ext.l) which is functionally equivalent. internal fun AsmGen.emitSignExtendByteToLong(reg: String) { - if (cpu == CpuType.M68000) { + if (cpu <= CpuType.M68000) { emitLine("ext.w $reg") emitLine("ext.l $reg") } else { @@ -423,7 +423,7 @@ internal class AsmGen(val program: IRProgram, internal val target: ICompilationT for (block in program.blocks) { val blockLabel = fixNameSymbols(block.label) - val chipram = target.name == "amiga500" && block.options.amigaChipram + val chipram = target.name in setOf("amiga500", "amiga1200") && block.options.amigaChipram if (chipram) { emitRaw(" SECTION code_c,code,chip ; amiga CHIP ram code") } @@ -801,7 +801,7 @@ internal class AsmGen(val program: IRProgram, internal val target: ICompilationT // === data section === private fun emitDataSection() { - val chipramBlocks = if (target.name == "amiga500") chipramBlockLabels() else emptySet() + val chipramBlocks = if (target.name in setOf("amiga500", "amiga1200")) chipramBlockLabels() else emptySet() val initdVars: List = program.st.allVariables().filter { !it.inBss }.toList() val (chipramVars: List, normalVars: List) = if (chipramBlocks.isNotEmpty()) { @@ -1107,7 +1107,7 @@ internal class AsmGen(val program: IRProgram, internal val target: ICompilationT private fun emitBssSection() { - val chipramBlocks = if (target.name == "amiga500") chipramBlockLabels() else emptySet() + val chipramBlocks = if (target.name in setOf("amiga500", "amiga1200")) chipramBlockLabels() else emptySet() // 1. Map variables to their sizes and actual M68k alignment requirements val allBssVars: List = program.st.allVariables().filter { it.inBss }.toList() diff --git a/codeGenM68k/src/prog8/codegen/m68k/AssemblyProgramM68k.kt b/codeGenM68k/src/prog8/codegen/m68k/AssemblyProgramM68k.kt index a58e1bcee..31f8dbe7b 100644 --- a/codeGenM68k/src/prog8/codegen/m68k/AssemblyProgramM68k.kt +++ b/codeGenM68k/src/prog8/codegen/m68k/AssemblyProgramM68k.kt @@ -5,6 +5,7 @@ import prog8.code.core.CompilationOptions import prog8.code.core.CpuType import prog8.code.core.IErrorReporter import prog8.code.core.OutputType +import prog8.code.target.Amiga1200Target import prog8.code.target.Amiga500Target import java.nio.file.Files import java.nio.file.Path @@ -55,36 +56,7 @@ class AssemblyProgramM68k(override val name: String, private val outputDir: Path } val assemblerCpu = if(options.compTarget.name == "amiga500" && options.floats) "68020" else cpu - val loadAddr = options.compTarget.PROGRAM_LOAD_ADDRESS.toInt() when(options.output) { - OutputType.RAW -> { - val rawFile = outputDir.resolve("$name.bin") - val listFile = outputDir.resolve("$name.lis") - val assembleCmd = mutableListOf( - "vasmm68k_mot", - "-m$assemblerCpu", - "-m68881", // enable FPU - "-Fbin", - "-opt-speed", - "-warnunaligned", - "-ldots", - "-spaces", - "-join=0x${loadAddr.toString(16)}", - "-o", rawFile.toString(), - assemblyFile.toString() - ) - if (options.asmListfile) - assembleCmd.addAll(listOf("-L", listFile.toString())) - if (options.asmQuiet) - assembleCmd.add("-quiet") - // clean up any leftover ELF/obj files from previous builds - Files.deleteIfExists(outputDir.resolve("$name.elf")) - Files.deleteIfExists(outputDir.resolve("$name.o")) - val ok = runProcess(assembleCmd, options.quiet, "vasm") - if(ok && !options.quiet) - println("Executable written to '$rawFile'") - return ok - } OutputType.ELF -> { // Step 1: assemble to ELF object file val objFile = outputDir.resolve("$name.o") @@ -161,8 +133,8 @@ class AssemblyProgramM68k(override val name: String, private val outputDir: Path cmd.add("-quiet") } } - else -> { - // assume at least an amiga 1200 with 68020 and optional FPU + is Amiga1200Target -> { + // amiga 1200 with 68020 and optional FPU mutableListOf( "vasmm68k_mot", "-m$assemblerCpu", @@ -172,6 +144,7 @@ class AssemblyProgramM68k(override val name: String, private val outputDir: Path "-warnunaligned", "-ldots", "-spaces", + "-nosym", // no debug symbols "-o", exefile.toString(), assemblyFile.toString() ).also { cmd -> @@ -183,6 +156,7 @@ class AssemblyProgramM68k(override val name: String, private val outputDir: Path cmd.add("-quiet") } } + else -> error("unsupported target for AMIGAHUNK output: ${options.compTarget.name}") } if (!runProcess(assembleCmd, options.quiet, "vasm")) return false diff --git a/codeGenM68k/src/prog8/codegen/m68k/InstrBitwise.kt b/codeGenM68k/src/prog8/codegen/m68k/InstrBitwise.kt index fa145b5cb..0cd0132c9 100644 --- a/codeGenM68k/src/prog8/codegen/m68k/InstrBitwise.kt +++ b/codeGenM68k/src/prog8/codegen/m68k/InstrBitwise.kt @@ -13,6 +13,7 @@ package prog8.codegen.m68k +import prog8.code.target.Qemu68kTarget import prog8.intermediate.IRDataType import prog8.intermediate.IRInstruction import prog8.intermediate.Opcode @@ -240,7 +241,7 @@ private fun AsmGen.shiftOpcode(isLeft: Boolean, isArithmetic: Boolean, isRotate: // a0 and use `(a0)` addressing. A0 is a scratch address register in the m68k // codegen, so this is safe. private fun AsmGen.emitMemoryWordShiftOrRotate(op: String, address: String) { - if (target.name == "qemu68k") { + if (target.name == Qemu68kTarget.NAME) { emitLine("lea $address, a0") emitLine("$op.w (a0)") } else { diff --git a/codeGenM68k/test/TestInstructionSelectionOptimizations.kt b/codeGenM68k/test/TestInstructionSelectionOptimizations.kt index b13ea8437..1a27b9b31 100644 --- a/codeGenM68k/test/TestInstructionSelectionOptimizations.kt +++ b/codeGenM68k/test/TestInstructionSelectionOptimizations.kt @@ -19,8 +19,7 @@ class TestInstructionSelectionOptimizations : FunSpec({ val tempRoot = tempdir().toPath() - fun generateAsmChunks(outputDir: Path, chunks: List): List { - val target = Qemu68kTarget() + fun generateAsmChunks(outputDir: Path, chunks: List, target: ICompilationTarget = Qemu68kTarget()): List { val options = CompilationOptions.builder(target) .output(OutputType.RAW) .zeropage(ZeropageType.FLOATSAFE) @@ -46,10 +45,10 @@ class TestInstructionSelectionOptimizations : FunSpec({ return asmFile.readText().lines().map { it.trim() } } - fun generateAsm(outputDir: Path, instructions: List): List { + fun generateAsm(outputDir: Path, instructions: List, target: ICompilationTarget = Qemu68kTarget()): List { val chunk = IRCodeChunk(null, null) chunk.instructions.addAll(instructions) - return generateAsmChunks(outputDir, listOf(chunk)) + return generateAsmChunks(outputDir, listOf(chunk), target) } test("uses quick address adjustments and preserves large offsets") { @@ -1255,4 +1254,29 @@ class TestInstructionSelectionOptimizations : FunSpec({ lines.any { it.contains("move.l d0,p8_regfile+6") } shouldBe true lines.any { it.contains("move.l (a0,d0.w), a0") } shouldBe false } + + // === extb.l gate robustification === + + test("M68020 sign-extends byte to long with extb.l") { + val lines = generateAsm( + tempRoot.resolve("test-m68k-extbl-qemu"), + listOf(IRInstruction(Opcode.EXTLS, IRDataType.BYTE, reg1 = 1, reg2 = 2)) + ) + + lines.count { it == "extb.l d0" } shouldBe 1 + lines.count { it == "ext.w d0" } shouldBe 0 + lines.count { it == "ext.l d0" } shouldBe 0 + } + + test("M68000 sign-extends byte to long with ext.w plus ext.l") { + val lines = generateAsm( + tempRoot.resolve("test-m68k-extbl-amiga"), + listOf(IRInstruction(Opcode.EXTLS, IRDataType.BYTE, reg1 = 1, reg2 = 2)), + target = Amiga500Target() + ) + + lines.count { it == "extb.l d0" } shouldBe 0 + lines.count { it == "ext.w d0" } shouldBe 1 + lines.count { it == "ext.l d0" } shouldBe 1 + } }) diff --git a/compiler/res/prog8lib/amiga1200/arexx.p8 b/compiler/res/prog8lib/amiga1200/arexx.p8 new file mode 100644 index 000000000..b333cb57b --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/arexx.p8 @@ -0,0 +1,5 @@ +%import shared_amiga_arexx + +arexx { + %option no_symbol_prefixing, ignore_unused +} diff --git a/compiler/res/prog8lib/amiga1200/audio.p8 b/compiler/res/prog8lib/amiga1200/audio.p8 new file mode 100644 index 000000000..bcc85b624 --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/audio.p8 @@ -0,0 +1,5 @@ +%import shared_amiga_audio + +audio { + %option no_symbol_prefixing, ignore_unused +} diff --git a/compiler/res/prog8lib/amiga1200/bcd.p8 b/compiler/res/prog8lib/amiga1200/bcd.p8 new file mode 100644 index 000000000..2747921ea --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/bcd.p8 @@ -0,0 +1 @@ +%import shared_amiga_bcd diff --git a/compiler/res/prog8lib/amiga1200/blitter.p8 b/compiler/res/prog8lib/amiga1200/blitter.p8 new file mode 100644 index 000000000..e5e861bea --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/blitter.p8 @@ -0,0 +1,5 @@ +%import shared_amiga_blitter + +blitter { + %option no_symbol_prefixing, ignore_unused +} diff --git a/compiler/res/prog8lib/amiga1200/compression.p8 b/compiler/res/prog8lib/amiga1200/compression.p8 new file mode 100644 index 000000000..71c764b7d --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/compression.p8 @@ -0,0 +1,8 @@ +; **experimental** data compression/decompression routines, API subject to change!! + +%import shared_m68k_compression + +compression { + %option ignore_unused + +} diff --git a/compiler/res/prog8lib/amiga1200/conv.p8 b/compiler/res/prog8lib/amiga1200/conv.p8 new file mode 100644 index 000000000..86baeb7f2 --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/conv.p8 @@ -0,0 +1,5 @@ +%import shared_amiga_conv + +conv { + %option ignore_unused +} diff --git a/compiler/res/prog8lib/amiga1200/copper.p8 b/compiler/res/prog8lib/amiga1200/copper.p8 new file mode 100644 index 000000000..46bf547d6 --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/copper.p8 @@ -0,0 +1,5 @@ +%import shared_amiga_copper + +copper { + %option no_symbol_prefixing, ignore_unused +} diff --git a/compiler/res/prog8lib/amiga1200/coroutines.p8 b/compiler/res/prog8lib/amiga1200/coroutines.p8 new file mode 100644 index 000000000..543c9e8cd --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/coroutines.p8 @@ -0,0 +1,5 @@ +%import shared_m68k_coroutines + +coroutines { + %option ignore_unused +} diff --git a/compiler/res/prog8lib/amiga1200/custom.p8 b/compiler/res/prog8lib/amiga1200/custom.p8 new file mode 100644 index 000000000..e3ed249bf --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/custom.p8 @@ -0,0 +1,5 @@ +%import shared_amiga_custom + +custom { + %option no_symbol_prefixing, ignore_unused +} diff --git a/compiler/res/prog8lib/amiga1200/dos.p8 b/compiler/res/prog8lib/amiga1200/dos.p8 new file mode 100644 index 000000000..b109172aa --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/dos.p8 @@ -0,0 +1,5 @@ +%import shared_amiga_dos + +dos { + %option no_symbol_prefixing, ignore_unused +} diff --git a/compiler/res/prog8lib/amiga1200/exec.p8 b/compiler/res/prog8lib/amiga1200/exec.p8 new file mode 100644 index 000000000..ace07263f --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/exec.p8 @@ -0,0 +1,5 @@ +%import shared_amiga_exec + +exec { + %option no_symbol_prefixing, ignore_unused +} diff --git a/compiler/res/prog8lib/amiga1200/floats.p8 b/compiler/res/prog8lib/amiga1200/floats.p8 new file mode 100644 index 000000000..3387a10fb --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/floats.p8 @@ -0,0 +1,21 @@ +%import shared_m68k_floats +%import textio + +txt { + %option merge, ignore_unused + alias print_f = floats.print +} + +floats { + %option no_symbol_prefixing, ignore_unused + %asminclude "library:shared_m68k_floats.asm" + + asmsub print(float value @FP0) { + %asm {{ + jsr floats._tostr + move.l a0,d1 + move.l sys.DOSBase,a6 + jmp -948(a6) ; PutStr() + }} + } +} diff --git a/compiler/res/prog8lib/amiga1200/graphics.p8 b/compiler/res/prog8lib/amiga1200/graphics.p8 new file mode 100644 index 000000000..b609c9e4e --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/graphics.p8 @@ -0,0 +1,5 @@ +%import shared_amiga_graphics + +graphics { + %option no_symbol_prefixing, ignore_unused +} diff --git a/compiler/res/prog8lib/amiga1200/icon.p8 b/compiler/res/prog8lib/amiga1200/icon.p8 new file mode 100644 index 000000000..d8bbdaf13 --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/icon.p8 @@ -0,0 +1,5 @@ +%import shared_amiga_icon + +icon { + %option no_symbol_prefixing, ignore_unused +} diff --git a/compiler/res/prog8lib/amiga1200/iffparse.p8 b/compiler/res/prog8lib/amiga1200/iffparse.p8 new file mode 100644 index 000000000..a0ce201d6 --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/iffparse.p8 @@ -0,0 +1,5 @@ +%import shared_amiga_iffparse + +iffparse { + %option no_symbol_prefixing, ignore_unused +} diff --git a/compiler/res/prog8lib/amiga1200/intuition.p8 b/compiler/res/prog8lib/amiga1200/intuition.p8 new file mode 100644 index 000000000..93010e65b --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/intuition.p8 @@ -0,0 +1,5 @@ +%import shared_amiga_intuition + +intuition { + %option no_symbol_prefixing, ignore_unused +} diff --git a/compiler/res/prog8lib/amiga1200/lineclip.p8 b/compiler/res/prog8lib/amiga1200/lineclip.p8 new file mode 100644 index 000000000..a24653f22 --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/lineclip.p8 @@ -0,0 +1,5 @@ +%import shared_m68k_lineclip + +lineclip { + %option ignore_unused +} diff --git a/compiler/res/prog8lib/amiga1200/lists.p8 b/compiler/res/prog8lib/amiga1200/lists.p8 new file mode 100644 index 000000000..604e45147 --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/lists.p8 @@ -0,0 +1,5 @@ +%import shared_amiga_lists + +lists { + %option ignore_unused +} diff --git a/compiler/res/prog8lib/amiga1200/math.p8 b/compiler/res/prog8lib/amiga1200/math.p8 new file mode 100644 index 000000000..c15be3a27 --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/math.p8 @@ -0,0 +1,5 @@ +%import shared_m68k_math + +math { + %option no_symbol_prefixing, ignore_unused +} diff --git a/compiler/res/prog8lib/amiga1200/prog8_lib.p8 b/compiler/res/prog8lib/amiga1200/prog8_lib.p8 new file mode 100644 index 000000000..199c6d419 --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/prog8_lib.p8 @@ -0,0 +1,164 @@ +%option no_symbol_prefixing, ignore_unused + +%import exec + +p8_sys_startup { + %option force_output + + private long @shared orig_stackpointer ; saved initial SP for sys.exit() + private long @shared WBMsg + + ; NOTE: the executable loader already zero-fills the BSS section + ; (LoadSeg on Amiga HUNK, or the ELF loader on qemu68k), so this + ; manual clear is unnecessary and has been commented out. + ; asmsub clear_bss_section() { + ; %asm {{ + ; ; clear BSS section + ; lea prog8_bss_section_start, a0 + ; lea prog8_program_end, a1 + ; sub.l a0, a1 ; bss size in bytes + ; beq 2$ + ; moveq #0, d0 + ; 1$ + ; move.b d0, (a0)+ + ; subq.l #1, a1 + ; bne 1$ + ; 2$ + ; rts + ; }} + ; } + + sub init_system() { + %asm {{ + ; save CLI arguments + move.l d0,-(sp) + move.l a0,-(sp) + + ; save original stackpointer + move.l sp,a0 + add.l #4*3,a0 ; take care of JSR to this routine, and the 2 saved longs + move.l a0,p8_sys_startup.orig_stackpointer + +proc_MsgPort = 92 +proc_CLI = 172 + + move.l 4.w,a6 + move.l #-1,d0 + move.l d0,d1 + jsr -648(a6) ; CacheControl(): turn on all cpu caches + + ; Check if we are started from Workbench + sub.l a1,a1 + jsr exec.FindTask(a6) + move.l d0,a5 + beq.w 2$ + tst.l proc_CLI(a5) + bne.b 2$ + lea.l proc_MsgPort(a5),a0 + jsr exec.WaitPort(a6) ; Wait for workbench message + lea.l proc_MsgPort(a5),a0 + jsr exec.GetMsg(a6) + move.l d0,p8_sys_startup.WBMsg ; Store message pointer to reply at exit later +2$: + + ; CLI launch: restore saved arguments (if any) + move.l (sp)+,a0 + move.l (sp)+,d0 + tst.l p8_sys_startup.WBMsg + bne.s .workbench + tst.l d0 + beq.s .emptyargs + subq.l #1,d0 + clr.b (a0,d0.w) ; replace newline by 0 terminator + move.l a0,sys.arguments + bra.s .done +.emptyargs: + move.l a0,sys.arguments ; empty string, but still CLI launch + bra.s .done +.workbench: + moveq #0,d0 + move.l d0,sys.arguments ; NULL for Workbench launches +.done: + }} + + sys.DOSBase = exec.OpenLibrary("dos.library",0) + sys.GfxBase = exec.OpenLibrary("graphics.library",0) + sys.IntuitionBase = exec.OpenLibrary("intuition.library",0) + sys.IconBase = exec.OpenLibrary("icon.library",0) + sys.UtilityBase = exec.OpenLibrary("utility.library",0) + } + + sub init_system_phase2() { + %asm {{ + moveq #0,d0 + moveq #0,d1 + moveq #0,d2 + moveq #0,d3 + moveq #0,d4 + moveq #0,d5 + moveq #0,d6 + moveq #0,d7 + move.w d0,ccr + suba.l a0,a0 + suba.l a1,a1 + suba.l a2,a2 + suba.l a3,a3 + suba.l a4,a4 + suba.l a5,a5 + suba.l a6,a6 + }} + } + + sub cleanup_at_exit() { + %asm {{ + movem.l d0,-(sp) ; keep return code + + ; reply to Workbench message if it exists + move.l 4.w,a6 + tst.l p8_sys_startup.WBMsg + beq.b 1$ + move.l p8_sys_startup.WBMsg,a1 + jsr exec.ReplyMsg(a6) +1$: + }} + + if sys.RexxSysBase != 0 exec.CloseLibrary(sys.RexxSysBase) + if sys.IFFParseBase != 0 exec.CloseLibrary(sys.IFFParseBase) + if sys.UtilityBase != 0 exec.CloseLibrary(sys.UtilityBase) + if sys.IconBase != 0 exec.CloseLibrary(sys.IconBase) + if sys.IntuitionBase != 0 exec.CloseLibrary(sys.IntuitionBase) + if sys.GfxBase != 0 exec.CloseLibrary(sys.GfxBase) + if sys.DOSBase != 0 exec.CloseLibrary(sys.DOSBase) + + %asm {{ + movem.l (sp)+,d0 ; restore return code + }} + } +} + +prog8_lib { + asmsub strcmp(str st1 @D0, str st2 @D1) -> byte @D0 { + ; Compares two strings for sorting, case-sensitively. + ; Returns -1 (255 as byte), 0 or 1. + %asm {{ + movea.l d0,a0 + movea.l d1,a1 +.loop: + move.b (a0)+,d0 + move.b (a1)+,d1 + cmp.b d1,d0 + bne .diff + tst.b d0 + bne .loop + moveq #0,d0 + rts +.diff: + blo .less + moveq #1,d0 + rts +.less: + moveq #-1,d0 + rts + }} + } +} diff --git a/compiler/res/prog8lib/amiga1200/prog8_math.p8 b/compiler/res/prog8lib/amiga1200/prog8_math.p8 new file mode 100644 index 000000000..d4032a314 --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/prog8_math.p8 @@ -0,0 +1,5 @@ +prog8_math { + %option no_symbol_prefixing, ignore_unused + + %asminclude "library:shared_m68k_prog8_math.asm" +} diff --git a/compiler/res/prog8lib/amiga1200/ptplayer.p8 b/compiler/res/prog8lib/amiga1200/ptplayer.p8 new file mode 100644 index 000000000..8fc6630e5 --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/ptplayer.p8 @@ -0,0 +1,5 @@ +%import shared_amiga_ptplayer + +ptplayer { + %option ignore_unused +} diff --git a/compiler/res/prog8lib/amiga1200/sorting.p8 b/compiler/res/prog8lib/amiga1200/sorting.p8 new file mode 100644 index 000000000..1db455fbb --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/sorting.p8 @@ -0,0 +1 @@ +%import shared_amiga_sorting diff --git a/compiler/res/prog8lib/amiga1200/strings.p8 b/compiler/res/prog8lib/amiga1200/strings.p8 new file mode 100644 index 000000000..dbb37e13a --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/strings.p8 @@ -0,0 +1,5 @@ +%import shared_m68k_strings + +strings { + %option no_symbol_prefixing, ignore_unused +} diff --git a/compiler/res/prog8lib/amiga1200/syslib.p8 b/compiler/res/prog8lib/amiga1200/syslib.p8 new file mode 100644 index 000000000..860abf9e7 --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/syslib.p8 @@ -0,0 +1,136 @@ +; Prog8 definitions for the Amiga1200 target + +%option no_symbol_prefixing, ignore_unused +%import shared_m68k_memory_routines + +%import dos + +sys { + ; ------- lowlevel system routines -------- + + const ubyte target = 120 ; compilation target specifier. + + const ubyte SIZEOF_BOOL = sizeof(bool) + const ubyte SIZEOF_BYTE = sizeof(byte) + const ubyte SIZEOF_UBYTE = sizeof(ubyte) + const ubyte SIZEOF_WORD = sizeof(word) + const ubyte SIZEOF_UWORD = sizeof(uword) + const ubyte SIZEOF_LONG = sizeof(long) + const ubyte SIZEOF_POINTER = sizeof(&sys.wait) + const ubyte SIZEOF_FLOAT = sizeof(float) + const byte MIN_BYTE = -128 + const byte MAX_BYTE = 127 + const ubyte MIN_UBYTE = 0 + const ubyte MAX_UBYTE = 255 + const word MIN_WORD = -32768 + const word MAX_WORD = 32767 + const uword MIN_UWORD = 0 + const uword MAX_UWORD = 65535 + const long MIN_LONG = -2147483648 + const long MAX_LONG = 2147483647 + ; MIN_FLOAT and MAX_FLOAT are defined in the floats module if imported + + + ; SysBase/ExecBase is always simply available at 4.w + pointer @shared DOSBase + pointer @shared GfxBase + pointer @shared IntuitionBase + pointer @shared IconBase + pointer @shared UtilityBase + pointer @shared RexxSysBase ; loaded from disk on demand + pointer @shared IFFParseBase ; loaded from disk on demand + pointer @shared TimerBase ; opened on demand + + ^^ubyte @shared arguments ; CLI argument string (null-terminated), or NULL if Workbench launch + + sub reset_system() { + %asm {{ + move.l 4.w,a6 + jmp -726(a6) ; ColdReboot() + }} + } + + asmsub wait(long jiffies @D1) { + ; --- wait approximately the given number of jiffies (1/60th seconds) + %asm {{ + move.l sys.DOSBase,a6 + jmp -198(a6) ; Delay + }} + } + + inline asmsub waitvsync() { + ; --- Wait until the next vsync has occurred. + ; This routine requires the OS to be functioning. + ; If you have disabled the OS/interrupts and are banging the hardware directly, use custom.waitvsync() instead. + %asm {{ + move.l sys.GfxBase,a6 + jsr -270(a6) ; WaitTOF + }} + } + + sub exit(ubyte returnvalue) { + ; -- exit the program with a return code in D0. When invoked from Prog8 via sys.exit(), all active defers in the call chain are unwound program-wide (LIFO) before system cleanup. sys.reset_system() does not run defers. + %asm {{ + moveq.l #0,d0 + move.b sys.exit.returnvalue,d0 + move.l p8_sys_startup.orig_stackpointer,sp + jmp p8_sys_startup.cleanup_at_exit + }} + } + + sub set_carry() { + %asm {{ + ; set both C (comparison carry) and X (rotate carry) bits + moveq #$11,d0 + move.w d0,ccr + }} + } + + sub clear_carry() { + %asm {{ + ; clear C and X bits + moveq #0,d0 + move.w d0,ccr + }} + } + + inline asmsub memcopy(long source @A0, long tgt @A1, long count @D0) { + %asm {{ + move.l 4.w,a6 + jsr exec.CopyMem(a6) + }} + } + + asmsub exec_version() -> uword @D0 { + ; Returns the exec library version. + ; This corresponds to the Kickstart/ROM version: + ; 30 = KS 1.0, 33 = KS 1.2, 34 = KS 1.3, + ; 37 = KS 2.0, 39 = KS 3.0, 40 = KS 3.1 + %asm {{ + move.l $4,a0 + move.w 20(a0),d0 + rts + }} + } + + inline asmsub progstart() -> long @A0 { + %asm {{ + lea prog8_program_start,a0 + }} + } + + inline asmsub progend() -> long @A0 { + %asm {{ + lea prog8_program_end,a0 + }} + } + + asmsub cpuAtLeast68020() clobbers (A6, D0) -> bool @Pz { + %asm {{ + move.l 4.w,a6 + move.w 296(a6),d0 + andi.w #$008e,d0 + rts + }} + } +} diff --git a/compiler/res/prog8lib/amiga1200/textio.p8 b/compiler/res/prog8lib/amiga1200/textio.p8 new file mode 100644 index 000000000..72dc9d84c --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/textio.p8 @@ -0,0 +1,229 @@ +%import dos +%import conv +%import strings +%option ignore_unused + +txt { + %option ignore_unused + asmsub chrout(ubyte char @D0) clobbers(D0,D1,D2,A0,A6) { + %asm {{ + move.l sys.DOSBase,a6 + move.b d0,-(sp) ; push character, A7 now points to it + move.l sp,d1 + moveq #1,d2 + jsr -942(a6) ; WriteChars + addq.l #2, sp + rts + }} + } + + sub nl() { + chrout('\n') + } + + sub spc() { + chrout(' ') + } + + sub tab() { + chrout('\t') + } + + asmsub flush() { + %asm {{ + move.l sys.DOSBase,a6 + jsr -60(a6) ; Output() + move.l d0,d1 + jmp -360(a6) ; Flush + }} + } + + asmsub print(str text @A0) clobbers(D0,D1,A0,A6) { + %asm {{ + move.l sys.DOSBase,a6 + move.l a0,d1 + jsr -948(a6) ; PutStr() + jsr -60(a6) ; Output() + move.l d0,d1 + jmp -360(a6) ; Flush + }} + } + + private long @shared fmt_value_l + private uword @shared fmt_value_w + + sub print_ub(ubyte value) { + fmt_value_w = value as uword + void dos.VPrintf("%d", &fmt_value_w) + } + + sub print_ub0(ubyte value) { + fmt_value_w = value as uword + void dos.VPrintf("%03d", &fmt_value_w) + } + + sub print_b(byte value) { + fmt_value_w = value as uword + void dos.VPrintf("%d", &fmt_value_w) + } + + sub print_uw(uword value) { + fmt_value_l = value as long + void dos.VPrintf("%lu", &fmt_value_l) + } + + sub print_uw0(uword value) { + fmt_value_l = value as long + void dos.VPrintf("%05lu", &fmt_value_l) + } + + sub print_w(word value) { + void dos.VPrintf("%d", &value) + } + + sub print_l(long value) { + void dos.VPrintf("%ld", &value) + } + + sub print_ulhex(long value, bool prefix) { + void dos.VPrintf(if prefix then "$%08lx" else "%08lx", &value) + } + + sub print_uwhex(uword value, bool prefix) { + void dos.VPrintf(if prefix then "$%04x" else "%04x", &value) + } + + sub print_ubhex(ubyte value, bool prefix) { + fmt_value_w = value as uword + void dos.VPrintf(if prefix then "$%02x" else "%02x", &fmt_value_w) + } + + sub print_ubbin(ubyte value, bool prefix) { + if prefix + chrout('%') + print(conv.str_ubbin(value)) + } + + sub print_uwbin(uword value, bool prefix) { + if prefix + chrout('%') + print(conv.str_uwbin(value)) + } + + sub print_bool(bool value) { + if value + print("true") + else + print("false") + } + + sub input_chars(str buffer) -> ubyte { + ; Input a string (max. 80 chars) from the keyboard. Returns length of input. + ; User entered EOL is trimmed, and the string is terminated with a 0 byte. + ; Uses line-buffered input (stdin stays in its default line mode). + pointer fh = dos.Input() + if fh == 0 + return 0 + long actual = dos.Read(fh, buffer, 80) + if actual <= 0 { + buffer[0] = 0 + return 0 + } + ubyte count = actual as ubyte + if count > 0 and (buffer[count-1] == '\n' or buffer[count-1] == '\r') + count-- + buffer[count] = 0 + return count + } + + sub iso() { + ; is the default + } + + sub lowercase() { + ; is the default + } + + sub cls() { + clear_screen() + } + + sub clear_screen() { + print("\x1b[H\x1B[J") + } + + sub home() { + print("\x1b[H") + } + + sub bold() { + print("\x1b[1m") + } + + sub dim() { + print("\x1b[2m") + } + + sub italic() { + print("\x1b[3m") + } + + sub underline() { + print("\x1b[4m") + } + + sub rvs() { + print("\x1b[7m") + } + + sub normal() { + print("\x1b[0m") + } + + sub cursor_off() { + txt.print("\x1b[0 p") + } + + sub cursor_on() { + txt.print("\x1b[1 p") + } + + sub color (ubyte txtcol) { + print("\x1b[3") + chrout('0' + txtcol) + chrout('m') + } + + sub bell() { + chrout(7) + } + + sub width() -> ubyte { + ; TODO use console Query WIndow Size escape sequence + return 80 + } + + sub height() -> ubyte { + ; TODO use console Query WIndow Size escape sequence + return 25 + } + + sub size() -> ubyte, ubyte { + ; TODO use console Query WIndow Size escape sequence + return width(), height() + } + + sub plot(ubyte col, ubyte row) { + ; use ANSI escape sequence to position the cursor + print("\x1b[") + print_ub(row) + chrout(';') + print_ub(col) + chrout('H') + } + + sub setchr(ubyte col, ubyte row, ubyte char) { + plot(col, row) + chrout(char) + } +} diff --git a/compiler/res/prog8lib/amiga1200/timer.p8 b/compiler/res/prog8lib/amiga1200/timer.p8 new file mode 100644 index 000000000..800231b73 --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/timer.p8 @@ -0,0 +1,100 @@ +%import exec + +timer { + %option no_symbol_prefixing, ignore_unused + + ^^TimeRequest @shared TimerIO + + enum UNIT { + MICROHZ = 0, + VBLANK = 1, + ECLOCK = 2, + WAITUNTIL = 3, + WAITECLOCK = 4 + } + + ; timer.device IO commands: + const uword TR_ADDREQUEST = 9 + const uword TR_GETSYSTIME = 9+1 + const uword TR_SETSYSTIME = 9+2 + + + struct TimeVal { + long secs + long micro + } + + struct TimeRequest { + ; struct IORequest + ^^exec.Node Succ ; 0 + ^^exec.Node Pred ; 4 + ubyte Type ; 8 + byte Pri ; 9 + str Name ; 10 + ^^exec.MsgPort ReplyPort ; 14 + uword Length ; 18 + pointer Device ; 20 + pointer Unit ; 24 + uword Command ; 28 + ubyte Flags ; 30 + byte Error ; 31 + ; struct TimeVal + long secs ; 32 + long micro ; 36 + } + + struct EClockVal { + ; This is really a 64 bit integer value split into two 32 bit integers + long hi + long lo + } + + sub opendevice() -> bool { + ^^exec.MsgPort timerPort = exec.CreateMsgPort() + if timerPort == 0 return false + TimerIO = exec.CreateIORequest(timerPort, sizeof(timer.TimeRequest)) + if TimerIO == 0 { + exec.DeleteMsgPort(timerPort) + return false + } + + if exec.OpenDevice("timer.device", timer.UNIT::MICROHZ, TimerIO, 0)==0 { + sys.TimerBase = TimerIO.Device + return true + } + exec.DeleteIORequest(TimerIO) + exec.DeleteMsgPort(timerPort) + TimerIO = 0 + return false + } + + sub closedevice() { + if TimerIO != 0 { + ^^exec.MsgPort timerPort = TimerIO.ReplyPort + exec.CloseDevice(TimerIO) + exec.DeleteIORequest(TimerIO) + exec.DeleteMsgPort(timerPort) + TimerIO = 0 + } + } + + sub getsystime() -> long, long { + TimerIO.Command = timer.TR_GETSYSTIME + void exec.DoIO(TimerIO) + return TimerIO.secs, TimerIO.micro + } + + sub setsystime(long secs, long micro) { + TimerIO.Command = timer.TR_SETSYSTIME + TimerIO.secs = secs + TimerIO.micro = micro + void exec.DoIO(TimerIO) + } + + extsub @bank 18 -42 = AddTime( ^^TimeVal dest @A0, ^^TimeVal src @A1 ) + extsub @bank 18 -48 = SubTime( ^^TimeVal dest @A0, ^^TimeVal src @A1 ) + extsub @bank 18 -54 = CmpTime( ^^TimeVal dest @A0, ^^TimeVal src @A1 ) -> long @D0 + extsub @bank 18 -60 = ReadEClock( ^^EClockVal dest @A0 ) -> long @D0 ; returns tickrate value + extsub @bank 18 -66 = GetSysTime( ^^TimeVal dest @A0 ) + +} diff --git a/compiler/res/prog8lib/amiga1200/utility.p8 b/compiler/res/prog8lib/amiga1200/utility.p8 new file mode 100644 index 000000000..fcb2b97de --- /dev/null +++ b/compiler/res/prog8lib/amiga1200/utility.p8 @@ -0,0 +1,5 @@ +%import shared_amiga_utility + +utility { + %option no_symbol_prefixing, ignore_unused +} diff --git a/compiler/res/prog8lib/amiga500/arexx.p8 b/compiler/res/prog8lib/amiga500/arexx.p8 index 57e7b2fe8..b333cb57b 100644 --- a/compiler/res/prog8lib/amiga500/arexx.p8 +++ b/compiler/res/prog8lib/amiga500/arexx.p8 @@ -1,223 +1,5 @@ -;; Auto-generated from arexx_lib.sfd and arexx_lib.i -;; Library base: _RexxSysBase in prog8: sys.RexxSysBase -;; Bank: 29 -;; Functions: 17 - -%import exec +%import shared_amiga_arexx arexx { - %option no_symbol_prefixing - - sub openlib() -> bool { - sys.RexxSysBase = exec.OpenLibrary("rexxsyslib.library", 0) - return sys.RexxSysBase!=0 - } - - sub closelib() { - if sys.RexxSysBase!=0 { - exec.CloseLibrary(sys.RexxSysBase) - sys.RexxSysBase = 0 - } - } - - extsub @bank 29 -126 = CreateArgstring(str string @A0, long length @D0) -> pointer @D0 - extsub @bank 29 -132 = DeleteArgstring(pointer argstring @A0) - extsub @bank 29 -138 = LengthArgstring(pointer argstring @A0) -> long @D0 - extsub @bank 29 -144 = CreateRexxMsg(^^exec.MsgPort port @A0, str extension @A1, str host @D0) -> ^^RexxMsg @D0 - extsub @bank 29 -150 = DeleteRexxMsg(^^RexxMsg packet @A0) - extsub @bank 29 -156 = ClearRexxMsg(^^RexxMsg msgptr @A0, long count @D0) - extsub @bank 29 -162 = FillRexxMsg(^^RexxMsg msgptr @A0, long count @D0, long mask @D1) -> bool @D0 - extsub @bank 29 -168 = IsRexxMsg(^^RexxMsg msgptr @A0) -> bool @D0 - extsub @bank 29 -450 = LockRexxBase(long resource @D0) - extsub @bank 29 -456 = UnlockRexxBase(long resource @D0) - extsub @bank 29 -480 = CreateRexxHostPort(str basename @A0) -> ^^exec.MsgPort @D0 - extsub @bank 29 -486 = DeleteRexxHostPort(^^exec.MsgPort port @A0) - extsub @bank 29 -492 = GetRexxVarFromMsg(str var @A0, ^^RexxMsg msgptr @A2, str value @A1) -> long @D0 - extsub @bank 29 -498 = SetRexxVarFromMsg(str var @A0, ^^RexxMsg msgptr @A2, str value @A1) -> long @D0 - extsub @bank 29 -504 = LaunchRexxScript(str script @A0, ^^exec.MsgPort replyport @A1, str extension @A2, pointer input @D1, pointer output @D2) -> ^^RexxMsg @D0 - extsub @bank 29 -510 = FreeRexxMsg(^^RexxMsg msgptr @A0) - extsub @bank 29 -516 = GetRexxBufferFromMsg(str var @A0, ^^RexxMsg msgptr @A2, str buffer @A1, long buffer_size @D0) -> long @D0 - - ; ---- struct definitions ---- - - struct RexxMsg { ; total size: 128 - ^^exec.Node Succ ; 0 - ^^exec.Node Pred ; 4 - ubyte Type ; 8 - byte Pri ; 9 - str Name ; 10 - ^^exec.MsgPort ReplyPort ; 14 - uword Length ; 18 - pointer TaskBlock ; 20 - pointer LibBase ; 24 - long Action ; 28 - long Result1 ; 32 - long Result2 ; 36 - str[16] Args ; 40 - ^^exec.MsgPort PassPort ; 104 - str CommAddr ; 108 - str FileExt ; 112 - long Stdin ; 116 - long Stdout ; 120 - long Avail ; 124 - } - - ; ---- constants ---- - const ubyte ERRC_MSG = $0000 - const long RC_FAIL = -1 - const ubyte RC_OK = $0000 - const ubyte RC_WARN = $0005 - const ubyte RC_ERROR = $000a - const ubyte RC_FATAL = $0014 - const ubyte RXBUFFSZ = $00cc - const long RXIO_EXIST = -1 - const ubyte RXIO_STRF = $0000 - const ubyte RXIO_READ = $0001 - const ubyte RXIO_WRITE = $0002 - const ubyte RXIO_APPEND = $0003 - const long RXIO_BEGIN = -1 - const ubyte RXIO_CURR = $0000 - const ubyte RXIO_END = $0001 - const ubyte DT_DEV = $0000 - const ubyte DT_DIR = $0001 - const ubyte DT_VOL = $0002 - const uword ACTION_STACK = $07d2 - const uword ACTION_QUEUE = $07d3 - const ubyte RLFB_STOP = $0006 - const ubyte RLFB_CLOSE = $0007 - const ubyte RLFMASK = $0001 - const uword RXSCHUNK = $0400 - const ubyte RXSNEST = $0020 - const ubyte RXSTPRI = $0000 - const uword RXSSTACK = $1000 - const ubyte CTB_SPACE = $0000 - const ubyte CTB_DIGIT = $0001 - const ubyte CTB_ALPHA = $0002 - const ubyte CTB_REXXSYM = $0003 - const ubyte CTB_REXXOPR = $0004 - const ubyte CTB_REXXSPC = $0005 - const ubyte CTB_UPPER = $0006 - const ubyte CTB_LOWER = $0007 - const ubyte CTF_SPACE = $0001 - const ubyte CTF_DIGIT = $0001 - const ubyte CTF_ALPHA = $0001 - const ubyte CTF_REXXSYM = $0001 - const ubyte CTF_REXXOPR = $0001 - const ubyte CTF_REXXSPC = $0001 - const ubyte CTF_UPPER = $0001 - const ubyte CTF_LOWER = $0001 - const ubyte NSB_KEEP = $0000 - const ubyte NSB_STRING = $0001 - const ubyte NSB_NOTNUM = $0002 - const ubyte NSB_NUMBER = $0003 - const ubyte NSB_BINARY = $0004 - const ubyte NSB_FLOAT = $0005 - const ubyte NSB_EXT = $0006 - const ubyte NSB_SOURCE = $0007 - const ubyte NSF_KEEP = $0001 - const ubyte NSF_STRING = $0001 - const ubyte NSF_NOTNUM = $0001 - const ubyte NSF_NUMBER = $0001 - const ubyte NSF_BINARY = $0001 - const ubyte NSF_FLOAT = $0001 - const ubyte NSF_EXT = $0001 - const ubyte NSF_SOURCE = $0001 - const ubyte MAXRMARG = $000f - const long RXCOMM = $01000000 - const long RXFUNC = $02000000 - const long RXCLOSE = $03000000 - const long RXQUERY = $04000000 - const long RXADDFH = $07000000 - const long RXADDLIB = $08000000 - const long RXREMLIB = $09000000 - const long RXADDCON = $0A000000 - const long RXREMCON = $0B000000 - const long RXTCOPN = $0C000000 - const long RXTCCLS = $0D000000 - const ubyte RXFB_NOIO = $0010 - const ubyte RXFB_RESULT = $0011 - const ubyte RXFB_STRING = $0012 - const ubyte RXFB_TOKEN = $0013 - const ubyte RXFB_NONRET = $0014 - const ubyte RXFB_SCRIPT = $0015 - const ubyte RXFF_RESULT = $0001 - const ubyte RXFF_STRING = $0001 - const ubyte RXFF_TOKEN = $0001 - const ubyte RXFF_NONRET = $0001 - const ubyte RXFF_SCRIPT = $0001 - const long RXCODEMASK = $FF000000 - const long RXARGMASK = $0000000F - const ubyte RRT_ANY = $0000 - const ubyte RRT_LIB = $0001 - const ubyte RRT_PORT = $0002 - const ubyte RRT_FILE = $0003 - const ubyte RRT_HOST = $0004 - const ubyte RRT_CLIP = $0005 - const ubyte GLOBALSZ = $00c8 - const ubyte NUMLISTS = $0005 - const ubyte RTFB_TRACE = $0000 - const ubyte RTFB_HALT = $0001 - const ubyte RTFB_SUSP = $0002 - const ubyte RTFB_TCUSE = $0003 - const ubyte RTFB_WAIT = $0006 - const ubyte RTFB_CLOSE = $0007 - const ubyte MEMQUANT = $0010 - const long MEMMASK = $FFFFFFF0 - const ubyte MEMQUICK = $0001 - const long MEMCLEAR = $00010000 - const ubyte ERR10_001 = $0001 - const ubyte ERR10_002 = $0002 - const ubyte ERR10_003 = $0003 - const ubyte ERR10_005 = $0005 - const ubyte ERR10_006 = $0006 - const ubyte ERR10_008 = $0008 - const ubyte ERR10_009 = $0009 - const ubyte ERR10_010 = $000a - const ubyte ERR10_011 = $000b - const ubyte ERR10_012 = $000c - const ubyte ERR10_013 = $000d - const ubyte ERR10_014 = $000e - const ubyte ERR10_015 = $000f - const ubyte ERR10_016 = $0010 - const ubyte ERR10_017 = $0011 - const ubyte ERR10_018 = $0012 - const ubyte ERR10_019 = $0013 - const ubyte ERR10_020 = $0014 - const ubyte ERR10_021 = $0015 - const ubyte ERR10_022 = $0016 - const ubyte ERR10_023 = $0017 - const ubyte ERR10_024 = $0018 - const ubyte ERR10_025 = $0019 - const ubyte ERR10_026 = $001a - const ubyte ERR10_027 = $001b - const ubyte ERR10_028 = $001c - const ubyte ERR10_029 = $001d - const ubyte ERR10_030 = $001e - const ubyte ERR10_031 = $001f - const ubyte ERR10_032 = $0020 - const ubyte ERR10_033 = $0021 - const ubyte ERR10_034 = $0022 - const ubyte ERR10_035 = $0023 - const ubyte ERR10_036 = $0024 - const ubyte ERR10_037 = $0025 - const ubyte ERR10_039 = $0027 - const ubyte ERR10_040 = $0028 - const ubyte ERR10_041 = $0029 - const ubyte ERR10_042 = $002a - const ubyte ERR10_043 = $002b - const ubyte ERR10_044 = $002c - const ubyte ERR10_045 = $002d - const ubyte ERR10_046 = $002e - const ubyte ERR10_047 = $002f - const ubyte ERR10_048 = $0030 - const ubyte RLFB_TRACE = $0000 - const ubyte RLFB_HALT = $0001 - const ubyte RLFB_SUSP = $0002 - const ubyte NSF_INTNUM = $0001 - const ubyte NSF_DPNUM = $0001 - const ubyte NSF_ALPHA = $0001 - const ubyte NSF_OWNED = $0001 - const ubyte KEEPSTR = $0001 - const ubyte KEEPNUM = $0001 + %option no_symbol_prefixing, ignore_unused } -;; End of auto-generated arexx_lib.sfd diff --git a/compiler/res/prog8lib/amiga500/audio.p8 b/compiler/res/prog8lib/amiga500/audio.p8 index fb57d3c32..bcc85b624 100644 --- a/compiler/res/prog8lib/amiga500/audio.p8 +++ b/compiler/res/prog8lib/amiga500/audio.p8 @@ -1,296 +1,5 @@ -%import exec -%import syslib +%import shared_amiga_audio audio { %option no_symbol_prefixing, ignore_unused - - ; audio.device IO commands: - const uword ADCMD_FREE = 9 - const uword ADCMD_SETPREC = 10 - const uword ADCMD_FINISH = 11 - const uword ADCMD_PERVOL = 12 - const uword ADCMD_LOCK = 13 - const uword ADCMD_WAITCYCLE = 14 - const uword ADCMD_ALLOCATE = 32 - - ; IOAudio flags (explicit ubyte values): - const ubyte ADIOB_PERVOL = 4 - const ubyte ADIOF_PERVOL = $10 - const ubyte ADIOB_SYNCCYCLE = 5 - const ubyte ADIOF_SYNCCYCLE = $20 - const ubyte ADIOB_NOWAIT = 6 - const ubyte ADIOF_NOWAIT = $40 - const ubyte ADIOB_WRITEMESSAGE = 7 - const ubyte ADIOF_WRITEMESSAGE = $80 - - ; IOAudio error codes: - const byte ADIOERR_NOALLOCATION = -10 - const byte ADIOERR_ALLOCFAILED = -11 - const byte ADIOERR_CHANNELSTOLEN = -12 - - ; hardware constants: - const uword ADHARD_CHANNELS = 4 - const byte ADALLOC_MINPREC = -128 - const byte ADALLOC_MAXPREC = 127 - - struct IOAudio { - ; struct IORequest (base, 32 bytes) - ^^exec.Node Succ ; 0 - ^^exec.Node Pred ; 4 - ubyte Type ; 8 - byte Pri ; 9 - str Name ; 10 - ^^exec.MsgPort ReplyPort ; 14 - uword Length ; 18 - pointer Device ; 20 - pointer Unit ; 24 - uword Command ; 28 - ubyte Flags ; 30 - byte Error ; 31 - ; struct IOAudio specific fields - word AllocKey ; 32 - pointer Data ; 34 - long IOAudio_Length ; 38 - uword Period ; 42 - uword Volume ; 44 - uword Cycles ; 46 - ; struct Message ioa_WriteMsg (20 bytes) - ^^exec.Node Msg_Succ ; 48 - ^^exec.Node Msg_Pred ; 52 - ubyte Msg_Type ; 56 - byte Msg_Pri ; 57 - str Msg_Name ; 58 - ^^exec.MsgPort Msg_ReplyPort ; 62 - uword Msg_Length ; 66 - } - - ; 4 audio channel I/O structures to address each channel individually - ^^IOAudio AudioIO0 = [] - ^^IOAudio AudioIO1 = [] - ^^IOAudio AudioIO2 = [] - ^^IOAudio AudioIO3 = [] - - private ^^exec.MsgPort msgport0 = [] - private ^^exec.MsgPort msgport1 = [] - private ^^exec.MsgPort msgport2 = [] - private ^^exec.MsgPort msgport3 = [] - private bool[4] active_channels - - ; Separate control-request structures for the ADCMD_* control commands. - ; An IORequest carrying an in-flight CMD_WRITE is queued inside audio.device - ; and must not be reused for another command, so the controls get their own. - private ^^IOAudio CtrlIO0 = [] - private ^^IOAudio CtrlIO1 = [] - private ^^IOAudio CtrlIO2 = [] - private ^^IOAudio CtrlIO3 = [] - - ; ---- high level audio interface ---- - - sub init() -> bool { - ; -- Initialize the audio device on all 4 channels. - ubyte[1] channel_matrix = [15] ; allocate all 4 channels at once - for ubyte channel in 0 to 3 - active_channels[channel] = false - return opendevice(channel_matrix, 1, 0) - } - - sub closedown() { - ; -- Close down the audio device on all 4 channels. Does not wait for sounds to finish playing. - stop_all() - closedevice() - for ubyte channel in 0 to 3 - active_channels[channel] = false - } - - sub play(ubyte channel, ^^byte samples, long num_samples, uword sample_rate, ubyte volume, uword cycles) { - ; -- Play a sample asynchronously on the given channel (0-3), with the given parameters. - ^^IOAudio io = get_io(channel) - io.Command = exec.CMD_WRITE - io.Flags = ADIOF_PERVOL - io.Data = samples - io.IOAudio_Length = num_samples - io.Period = period(sample_rate) - io.Volume = volume - io.Cycles = cycles - BeginIO(io) ; not exec.DoIO/SendIO: those clear io_Flags, wiping ADIOF_PERVOL! - active_channels[channel] = true - ; sound now plays asynchronously. - } - - sub wait_channel(ubyte channel) { - ; wait for the current sound on this channel to finish playing. - if active_channels[channel] { - void exec.WaitIO(get_io(channel)) - active_channels[channel] = false - } - } - - sub wait_all() { - ; wait for all channels to finish playing their sounds. - wait_channel(0) - wait_channel(1) - wait_channel(2) - wait_channel(3) - } - - sub stop(ubyte channel) { - ; -- Abort the sound currently playing on this channel (ADCMD_FINISH). - ; The sound stops immediately; blocks until the aborted write request has completed. - if not active_channels[channel] - return - ^^IOAudio ctrl = get_ctrl(channel) - ctrl.Command = ADCMD_FINISH - ctrl.Flags = 0 - BeginIO(ctrl) - void exec.WaitIO(ctrl) ; reap the control request - void exec.WaitIO(get_io(channel)) ; reap the aborted write request - active_channels[channel] = false - } - - sub stop_all() { - ; -- Abort the sounds currently playing on all channels. - stop(0) - stop(1) - stop(2) - stop(3) - } - - sub set_freqvol(ubyte channel, uword samplerate, ubyte volume) { - ; -- Change the playback rate and volume of the sound currently playing on this channel (ADCMD_PERVOL). - ; Takes effect immediately. Both are always set together: ADCMD_PERVOL has no way to change just one. - if not active_channels[channel] - return - ^^IOAudio ctrl = get_ctrl(channel) - ctrl.Command = ADCMD_PERVOL - ctrl.Flags = 0 - ctrl.Period = period(samplerate) - ctrl.Volume = volume - BeginIO(ctrl) - } - - inline sub is_playing(ubyte channel) -> bool { - ; -- Returns true while a sound is playing on this channel, - ; i.e. between play() and wait_channel()/wait_all()/stop(). - return active_channels[channel] - } - - - ; ---- low level audio interface ---- - - sub opendevice(pointer channelPrefs, ubyte prefsLen, byte precedence) -> bool { - ; Set channel allocation preferences before opening - AudioIO0.Pri = precedence - AudioIO0.AllocKey = 0 - AudioIO0.Data = channelPrefs - AudioIO0.IOAudio_Length = prefsLen - - if exec.OpenDevice("audio.device", 0, AudioIO0, 0)!=0 { - AudioIO0.Type = 0 - return false - } - - ; Clone the other 3 IOAudio instances via CopyMem - ; This preserves AllocKey and channel binding from OpenDevice - AudioIO1^^ = AudioIO0^^ - AudioIO2^^ = AudioIO0^^ - AudioIO3^^ = AudioIO0^^ - AudioIO0.Unit = 1 ; channel 1 - AudioIO1.Unit = 2 ; channel 2 - AudioIO2.Unit = 4 ; channel 3 - AudioIO3.Unit = 8 ; channel 4 - - ; Allocate separate MsgPorts for each cloned IOAudio - AudioIO0.ReplyPort = init_msgport(msgport0) - AudioIO1.ReplyPort = init_msgport(msgport1) - AudioIO2.ReplyPort = init_msgport(msgport2) - AudioIO3.ReplyPort = init_msgport(msgport3) - - ; Clone the channel bindings into the control structures - CtrlIO0^^ = AudioIO0^^ - CtrlIO1^^ = AudioIO1^^ - CtrlIO2^^ = AudioIO2^^ - CtrlIO3^^ = AudioIO3^^ - - return true - - private sub init_msgport(^^exec.MsgPort port) -> ^^exec.MsgPort { - port.Type = exec.NT_MSGPORT - port.Flags = exec.PA_SIGNAL - port.SigBit = exec.AllocSignal(-1) as ubyte - port.SigTask = exec.FindTask(0) - exec.NewList(&port.Head) - return port - } - } - - sub closedevice() { - if AudioIO0.Type == 0 - return - - exec.CloseDevice(AudioIO0) - ^^exec.MsgPort port = AudioIO0.ReplyPort - exec.FreeSignal(port.SigBit as byte) - port = AudioIO1.ReplyPort - exec.FreeSignal(port.SigBit as byte) - port = AudioIO2.ReplyPort - exec.FreeSignal(port.SigBit as byte) - port = AudioIO3.ReplyPort - exec.FreeSignal(port.SigBit as byte) - AudioIO0.Type = 0 - AudioIO1.Type = 0 - AudioIO2.Type = 0 - AudioIO3.Type = 0 - } - - sub get_io(ubyte channel) -> ^^IOAudio { - when channel { - 0 -> return AudioIO0 - 1 -> return AudioIO1 - 2 -> return AudioIO2 - else -> return AudioIO3 - } - } - - private sub get_ctrl(ubyte channel) -> ^^IOAudio { - when channel { - 0 -> return CtrlIO0 - 1 -> return CtrlIO1 - 2 -> return CtrlIO2 - else -> return CtrlIO3 - } - } - - sub period(uword samplerate) -> uword { - ; calculate the Period to use for the desired sample rate - return clock() / samplerate as uword - } - - sub sample_rate(uword per) -> uword { - ; calculate the sample rate belonging to the given Period; the inverse of period() - return clock() / per as uword - } - - asmsub clock() clobbers (A6) -> long @D0 { - ; return the Audio/Color clock, used for Period calculations to get the correct frequency - %asm {{ - move.l sys.GfxBase, a6 - btst.b #0, $dc(a6) - bne.s .ntsc - move.l #3546895, d0 ; PAL - rts -.ntsc: - move.l #3579545, d0 ; NTSC - rts - }} - } - - private asmsub BeginIO(^^IOAudio io @A1) clobbers (D0, D1, A0, A1, A6) { - ; Calls the device's BeginIO vector directly, instead of exec DoIO/SendIO, - ; because those clear io_Flags which would wipe ADIOF_PERVOL and friends. - %asm {{ - move.l 20(a1), a6 ; a6 = io_Device (offset 20 in IORequest) - jsr -30(a6) ; device BeginIO vector - rts - }} - } } diff --git a/compiler/res/prog8lib/amiga500/bcd.p8 b/compiler/res/prog8lib/amiga500/bcd.p8 index 79f43c39b..2747921ea 100644 --- a/compiler/res/prog8lib/amiga500/bcd.p8 +++ b/compiler/res/prog8lib/amiga500/bcd.p8 @@ -1 +1 @@ -; no support for BCD +%import shared_amiga_bcd diff --git a/compiler/res/prog8lib/amiga500/blitter.p8 b/compiler/res/prog8lib/amiga500/blitter.p8 index dbbd0d364..e5e861bea 100644 --- a/compiler/res/prog8lib/amiga500/blitter.p8 +++ b/compiler/res/prog8lib/amiga500/blitter.p8 @@ -1,345 +1,5 @@ -%import custom +%import shared_amiga_blitter blitter { %option no_symbol_prefixing, ignore_unused - - ; WARNING: All pointers passed to blitter routines MUST point to CHIP RAM. - ; The Amiga blitter hardware can only access CHIP RAM directly. - ; Using fast RAM pointers will result in bus errors or corrupted data. - ; - ; WIDTH LIMITATION: The blitter can only handle 64 words (1024 pixels) width per operation. - ; Standard Amiga screens (320/640 pixels) fit within this limit. - ; For wider images, split the blit into multiple operations manually. - ; - ; WAITING BEHAVIOR: All blitter operations wait for the blitter to become idle - ; at the START of the call, but do NOT wait for the operation to finish before - ; returning. This allows the CPU to continue working while the blitter runs. - ; Call blitter.wait() explicitly when you need to ensure the blitter has completed - ; (e.g., before reading back modified memory or swapping display buffers). - - const uword MINTERM_MASKED = $CA ; (A AND B) OR (NOT A AND C) - masked sprite blit - const uword MINTERM_A_ONLY = $F0 ; channel A only (same as COPY) - const uword MINTERM_B_ONLY = $CC ; channel B only - const uword MINTERM_A_XOR_C = $5A ; A XOR C (erase/restore patterns) - - asmsub wait() { - ; Wait until the blitter is completely idle. - ; Use this before reading back blitter-modified memory or swapping buffers. - %asm {{ -.busy: - btst.b #6,custom.DMACONR - bne.s .busy - rts - }} - } - - asmsub set_blitpri(bool hasprio @D0) clobbers (D0) { - ; Set or clear blitter priority over the CPU. - ; When enabled, the blitter gets bus priority and completes faster, - ; but the CPU runs slower during the blit. - ; Disable when you need full CPU speed while the blitter runs. - %asm {{ - tst.b d0 - beq.s .clear - move.w #$8400,custom.DMACON ; SET bit + BLITPRI bit - rts -.clear: - move.w #$0400,custom.DMACON ; BLITPRI bit only (clears it) - rts - }} - } - - ; Copy a rectangular block from src to dst. - ; Waits for blitter idle at start, returns immediately after triggering the blit. - asmsub copy_rect(pointer src @A0, pointer dst @A1, uword width_words @D0, uword height @D1, uword src_mod @D2, uword dst_mod @D3, uword minterm @D4, ubyte descending @D5) clobbers (D0,D1,D2,D3,D4,D5,A0,A1) { - %asm {{ - movem.l d2-d7/a2-a6,-(sp) - move.w d0,d6 ; d6 = width - move.w d1,d7 ; d7 = height - move.w d2,d2 ; src_mod - move.w d3,d3 ; dst_mod - bsr .wait_blt - tst.w d5 - beq.s .no_desc - move.w d6,d0 - lsl.w #1,d0 - add.w d2,d0 - move.w d7,d1 - subq.w #1,d1 - mulu.w d0,d1 - move.w d6,d0 - subq.w #1,d0 - lsl.w #1,d0 - ext.l d0 - add.l d0,d1 - add.l d1,a0 - move.w d6,d0 - lsl.w #1,d0 - add.w d3,d0 - move.w d7,d1 - subq.w #1,d1 - mulu.w d0,d1 - move.w d6,d0 - subq.w #1,d0 - lsl.w #1,d0 - ext.l d0 - add.l d0,d1 - add.l d1,a1 -.no_desc: - move.w d2,custom.BLTAMOD - move.w d3,custom.BLTDMOD - move.w #$ffff,custom.BLTAFWM - move.w #$ffff,custom.BLTALWM - move.l a0,custom.BLTAPT - move.l a1,custom.BLTDPT - move.w d4,d1 - or.w #$0900,d1 - move.w d1,custom.BLTCON0 - moveq #0,d1 - tst.w d5 - beq.s .nodesc - move.w #$0002,d1 -.nodesc: - or.w #$0800,d1 ; B32: AGA 32-bit blit mode - move.w d1,custom.BLTCON1 - move.w d7,d1 - lsl.w #6,d1 - or.w d6,d1 - move.w d1,custom.BLTSIZE - movem.l (sp)+,d2-d7/a2-a6 - rts -.wait_blt: - btst.b #6,custom.DMACONR - bne.s .wait_blt - rts - }} - } - - ; Fill a rectangular block with a pattern. - ; Waits for blitter idle at start, returns immediately after triggering the blit. - asmsub fill_rect(pointer dst @A0, uword width_words @D0, uword height @D1, uword pattern @D2, uword modulo @D3) clobbers (D0,D1,D2,D3,A0) { - %asm {{ - movem.l d2-d7/a2-a6,-(sp) - bsr .wait_blt - move.w d3,custom.BLTDMOD - move.w #$ffff,custom.BLTAFWM - move.w #$ffff,custom.BLTALWM - move.w d2,custom.BLTCDAT - move.l a0,custom.BLTDPT - move.w #$01aa,custom.BLTCON0 ; USED=1, USEC=0, minterm=$AA (BLTCDAT -> D) - move.w #$0800,custom.BLTCON1 ; B32: AGA 32-bit blit mode - move.w d1,d1 - lsl.w #6,d1 - or.w d0,d1 - move.w d1,custom.BLTSIZE - movem.l (sp)+,d2-d7/a2-a6 - rts -.wait_blt: - btst.b #6,custom.DMACONR - bne.s .wait_blt - rts - }} - } - - ; Initialize the blitter for fast line drawing. - ; Call this once before drawing a batch of lines with the same parameters. - ; mask: first/last word mask (usually $ffff for full-word lines) - ; pixel: line pixel pattern in BLTADAT (usually $8000 for single pixel) - ; pattern: line fill pattern in BLTBDAT (usually $ffff for solid lines) - ; screen_mod: bytes per row of the destination bitplane (pitch) - ; Waits for blitter idle at start, returns immediately after setup. - asmsub line_init(uword mask @D0, uword pixel @D1, uword pattern @D2, uword screen_mod @D4) clobbers (D0,D1,D2,D4,A0,A1) { - %asm {{ - movem.l d2-d7/a2-a6,-(sp) - bsr .wait_blt - move.w d0,custom.BLTAFWM - move.w #$ffff,custom.BLTALWM - move.w d1,custom.BLTADAT - move.w d2,custom.BLTBDAT - move.w d4,custom.BLTCMOD - movem.l (sp)+,d2-d7/a2-a6 - rts -.wait_blt: - btst.b #6,custom.DMACONR - bne.s .wait_blt - rts - }} - } - - ; Draw a single line using the blitter's hardware Bresenham line mode. - ; Must be preceded by a call to line_init() with the appropriate parameters. - ; Uses the octant-lookup-table algorithm from coppershade.org - ; (see https://coppershade.org/asmskool/SOURCES/Developing-Demo-Effects/DDE4/LineVectors/). - ; x1, y1: starting coordinates (absolute, any direction supported) - ; x2, y2: ending coordinates - ; screen_mod: bytes per row of the destination bitplane (pitch) - ; screen_ptr: pointer to bitplane memory (CHIP RAM) - ; Waits for blitter idle at start, returns immediately after triggering the blit. - asmsub line_draw(uword x1 @D0, uword y1 @D1, uword x2 @D2, uword y2 @D3, uword screen_mod @D4, pointer screen_ptr @A1) clobbers (D0,D1,D2,D3,D5,D6,A0,A1) { - %asm {{ - movem.l d2-d7/a2-a6,-(sp) - - ; CPU setup (these would normally be done once in LineInit and - ; preserved across calls; we set them up here for self-containment). - move.w #1*64+2,a3 ; add-value for BLTSIZE - move.l #$bfa0000f,a4 ; minterm+mask for quick-rol - - ; d0=x1, d1=y1, d2=x2, d3=y2, d4=screen_mod, a1=screen_ptr - move.l a4,d6 ; minterm+mask - and.w d0,d6 ; mask x 0..15 - ror.l #4,d6 ; shift it in at top, low word cleared - - ; --- deltas --- - sub.w d1,d3 ; d3 = y2 - y1 - bpl.s .dyplus - neg.w d3 - addq.b #8,d6 -.dyplus: - sub.w d0,d2 ; d2 = x2 - x1 - bgt.s .dxplus - neg.w d2 - addq.b #4,d6 -.dxplus: - cmp.w d2,d3 - bge.s .dylarger - exg d2,d3 ; d2=Small delta, d3=Large delta - addq.b #2,d6 -.dylarger: - - ; --- blit values --- - muls d4,d1 ; d1 = y1 * screen_mod - asr.w #3,d0 ; bit 0 ignored by Blitter - add.w d0,d1 ; offset on screen - add.l a1,d1 ; add current screen buffer ptr - - add.w d2,d2 ; d2 = 2*SDelta - move.w d2,d5 ; d5 = 2*SDelta - swap d2 ; d2 high word = 2*SDelta - sub.w d3,d5 ; d5 = 2*SDelta - LDelta - smi d0 ; if (2*Sdelta-Ldelta) < 0, - sub.b d0,d6 ; add 1 (subtract -1) to octant lookup - move.b OctTbl(pc,d6.w),d6 ; look up BLTCON bits for octant - - move.w d5,d2 ; d2 low word = 2*SDelta - LDelta - sub.w d3,d2 ; d2 low word = 2*SDelta - 2*LDelta - asl.w #6,d3 ; d3 = LDelta << 6 - add.w a3,d3 ; d3 = BLTSIZE - - ; --- blit --- - bsr .wait_blt - move.l d6,custom.BLTCON0 ; shift, minterm, octant bits - move.w d5,custom.BLTAPTL ; 2*SDelta - LDelta - move.l d2,custom.BLTBMOD ; 2*SDelta | 2*SDelta - 2*LDelta - move.l d1,custom.BLTCPT ; source - move.l d1,custom.BLTDPT ; destination - move.w d3,custom.BLTSIZE - movem.l (sp)+,d2-d7/a2-a6 - rts - -.wait_blt: - btst.b #6,custom.DMACONR - bne.s .wait_blt - rts - -; Octant lookup table placed right after the rts so it is reachable via -; PC-relative addressing from the move.b OctTbl(PC,d6.w) instruction above. -; Each pair of entries encodes BLTCON1 octant bits for one of the 8 octants. -; First byte has SING=0, second has SING=1 (descending mode). -OctTbl: - dc.b 0*4+1,0*4+1+64 ;7 - dc.b 4*4+1,4*4+1+64 ;6 - dc.b 2*4+1,2*4+1+64 ;4 - dc.b 5*4+1,5*4+1+64 ;5 - dc.b 1*4+1,1*4+1+64 ;0 - dc.b 6*4+1,6*4+1+64 ;1 - dc.b 3*4+1,3*4+1+64 ;3 - dc.b 7*4+1,7*4+1+64 ;2 - ; !notreached! - }} - } - - ; Masked blit: copy src to dst using a mask channel. - ; Waits for blitter idle at start, returns immediately after triggering the blit. - asmsub masked_blit(pointer src @A0, pointer mask @A1, pointer dst @A2, uword width_words @D0, uword height @D1, uword src_mod @D2, uword mask_mod @D3, uword dst_mod @D4) clobbers (D0,D1,D2,D3,D4,A0,A1,A2) { - %asm {{ - movem.l d2-d7/a2-a6,-(sp) - bsr .wait_blt - move.w d2,custom.BLTBMOD - move.w d3,custom.BLTAMOD - move.w d4,custom.BLTDMOD - move.w d4,custom.BLTCMOD - move.w #$ffff,custom.BLTAFWM - move.w #$ffff,custom.BLTALWM - move.l a1,custom.BLTAPT - move.l a0,custom.BLTBPT - move.l a2,custom.BLTCPT - move.l a2,custom.BLTDPT - move.w #$0fca,custom.BLTCON0 - move.w #$0800,custom.BLTCON1 ; B32: AGA 32-bit blit mode - move.w d1,d1 - lsl.w #6,d1 - or.w d0,d1 - move.w d1,custom.BLTSIZE - movem.l (sp)+,d2-d7/a2-a6 - rts -.wait_blt: - btst.b #6,custom.DMACONR - bne.s .wait_blt - rts - }} - } - - ; Clear a rectangular region of a bitplane to zero. - ; Waits for blitter idle at start, returns immediately after triggering the blit. - asmsub clear_plane(pointer dst @A0, uword width_words @D0, uword height @D1) clobbers (D0,D1,A0) { - %asm {{ - movem.l d2-d7/a2-a6,-(sp) - bsr .wait_blt - move.w #$ffff,custom.BLTAFWM - move.w #$ffff,custom.BLTALWM - move.w #$0000,custom.BLTCDAT - move.w #$0000,custom.BLTDMOD - move.l a0,custom.BLTDPT - move.w #$01aa,custom.BLTCON0 - move.w #$0800,custom.BLTCON1 ; B32: AGA 32-bit blit mode - move.w d1,d1 - lsl.w #6,d1 - or.w d0,d1 - move.w d1,custom.BLTSIZE - movem.l (sp)+,d2-d7/a2-a6 - rts -.wait_blt: - btst.b #6,custom.DMACONR - bne.s .wait_blt - rts - }} - } - - ; Fill an entire bitplane (or any width_words x height block) with a 16-bit pattern. - ; pattern: the value written to every word of the destination (e.g. $0000 clears, - ; $ffff fills solid, $aaaa produces a vertical stripe pattern). - ; Waits for blitter idle at start, returns immediately after triggering the blit. - asmsub fill_plane(pointer dst @A0, uword width_words @D0, uword height @D1, uword pattern @D2) clobbers (D0,D1,D2,A0) { - %asm {{ - movem.l d2-d7/a2-a6,-(sp) - bsr .wait_blt - move.w #$ffff,custom.BLTAFWM - move.w #$ffff,custom.BLTALWM - move.w d2,custom.BLTCDAT - move.l a0,custom.BLTDPT - move.w #$01aa,custom.BLTCON0 ; USED=1, USEC=0, minterm=$AA (BLTCDAT -> D) - move.w #$0800,custom.BLTCON1 ; B32: AGA 32-bit blit mode - move.w #$0000,custom.BLTDMOD - move.w d1,d1 - lsl.w #6,d1 - or.w d0,d1 - move.w d1,custom.BLTSIZE - movem.l (sp)+,d2-d7/a2-a6 - rts -.wait_blt: - btst.b #6,custom.DMACONR - bne.s .wait_blt - rts - }} - } } diff --git a/compiler/res/prog8lib/amiga500/conv.p8 b/compiler/res/prog8lib/amiga500/conv.p8 index ca02240b2..86baeb7f2 100644 --- a/compiler/res/prog8lib/amiga500/conv.p8 +++ b/compiler/res/prog8lib/amiga500/conv.p8 @@ -1,279 +1,5 @@ -; Number conversions routines. - -%import strings +%import shared_amiga_conv conv { - -; ----- number conversions to decimal strings ---- - %option ignore_unused - str string_out = "????????????????" ; result buffer for the string conversion routines - private long @shared fmt_value_l - private uword @shared fmt_value_w - - private asmsub putcharproc(ubyte character @D0, pointer output @A3) -> ubyte @D0 { - %asm {{ - move.b d0, (a3)+ ; Store character in buffer and advance pointer - rts ; Return control to RawDoFmt loop - }} - } - -sub str_ub0(ubyte value) -> str { - ; ---- convert the ubyte in A in decimal string form, with left padding 0s (3 positions total) - fmt_value_w = value as uword - void exec.RawDoFmt("%03d", &fmt_value_w, putcharproc, string_out) - return string_out -} - -sub str_ub(ubyte value) -> str { - ; ---- convert the ubyte in A in decimal string form, without left padding 0s - fmt_value_w = value as uword - void exec.RawDoFmt("%d", &fmt_value_w, putcharproc, string_out) - return string_out -} - -sub str_b(byte value) -> str { - ; ---- convert the byte in A in decimal string form, without left padding 0s - fmt_value_w = value as uword - void exec.RawDoFmt("%d", &fmt_value_w, putcharproc, string_out) - return string_out -} - -sub str_ubhex (ubyte value) -> str { - ; ---- convert the ubyte in A in hex string form - fmt_value_w = value as uword - void exec.RawDoFmt("%02x", &fmt_value_w, putcharproc, string_out) - return string_out -} - -sub str_ubbin (ubyte value) -> str { - ; ---- convert the ubyte in binary string form - ^^ubyte out_ptr = &string_out - ubyte mask = 128 - repeat 8 { - if value & mask != 0 - @(out_ptr) = '1' - else - @(out_ptr) = '0' - out_ptr++ - mask >>= 1 - } - @(out_ptr) = 0 - return string_out -} - -sub str_uwbin (uword value) -> str { - ; ---- convert the uword in binary string form - ^^ubyte out_ptr = &string_out - uword mask = $8000 - repeat 16 { - if value & mask != 0 - @(out_ptr) = '1' - else - @(out_ptr) = '0' - out_ptr++ - mask >>= 1 - } - @(out_ptr) = 0 - return string_out -} - -sub str_uwhex (uword value) -> str { - ; ---- convert the uword in hexadecimal string form (4 digits) - void exec.RawDoFmt("%04x", &value, putcharproc, string_out) - return string_out -} - -sub str_ulhex (long value) -> str { - ; ---- convert the long in hexadecimal string form (8 digits) - void exec.RawDoFmt("%08lx", &value, putcharproc, string_out) - return string_out -} - -sub str_uw0 (uword value) -> str { - ; ---- convert the uword in decimal string form, with left padding 0s (5 positions total) - ; requires kickstart 2.0+ - fmt_value_l = value as long - void exec.RawDoFmt("%05lu", &fmt_value_l, putcharproc, string_out) - return string_out -} - -sub str_uw (uword value) -> str { - ; ---- convert the uword in decimal string form, without left padding 0s - ; requires kickstart 2.0+ - fmt_value_l = value as long - void exec.RawDoFmt("%lu", &fmt_value_l, putcharproc, string_out) - return string_out -} - -sub str_w (word value) -> str { - ; ---- convert the (signed) word into decimal string form, without left padding 0's - void exec.RawDoFmt("%d", &value, putcharproc, string_out) - return string_out -} - -sub str_l (long value) -> str { - ; ---- convert the (signed) long into decimal string form - void exec.RawDoFmt("%ld", &value, putcharproc, string_out) - return string_out -} - - -; ---- string conversion to numbers ----- - -sub str2ubyte(str string) -> ubyte { - ; -- returns in A the unsigned byte value of the string number argument in AY - ; the number may NOT be preceded by a + sign and may NOT contain spaces - ; (any non-digit character will terminate the number string that is parsed) - return str2uword(string) as ubyte -} - -sub str2byte(str string) -> byte { - ; -- returns in A the signed byte value of the string number argument in AY - ; the number may be preceded by a + or - sign but may NOT contain spaces - ; (any non-digit character will terminate the number string that is parsed) - return str2word(string) as byte -} - -sub str2uword(str string) -> uword { - uword result - ubyte ii - while string[ii] >= '0' and string[ii] <= '9' { - result = result * 10 + (string[ii] - '0') as uword - ii++ - } - return result -} - -sub str2word(str string) -> word { - bool negative - ubyte ii - if string[0] == '-' { - negative = true - ii = 1 - } else { - if string[0] == '+' - ii = 1 - } - uword result - while string[ii] >= '0' and string[ii] <= '9' { - result = result * 10 + (string[ii] - '0') as uword - ii++ - } - if negative - return 0 - result as word - return result as word -} - -sub hex2uword(str string) -> uword { - ; -- hexadecimal string (with or without '$') to uword. - ; stops parsing at the first character that's not a hex digit (except leading $) - uword result - ubyte char - if @(string)=='$' - string++ - repeat { - char = strings.lowerchar(@(string)) - if strings.isxdigit(char) { - result <<= 4 - if char>='0' and char<='9' - result |= char-'0' - else - result |= char-'a'+10 - } else - return result - string++ - } -} - -sub hex2long(str string) -> long { - ; -- hexadecimal string (with or without '$') to long. - ; stops parsing at the first character that's not a hex digit (except leading $) - long result - ubyte char - if @(string)=='$' - string++ - repeat { - char = strings.lowerchar(@(string)) - if strings.isxdigit(char) { - result <<= 4 - if char>='0' and char<='9' - result |= char-'0' - else - result |= char-'a'+10 - } else - return result - string++ - } -} - -sub str2long(str string) -> long { - ; -- convert a decimal string (terminated with a zero byte) into a long. Clobbers R0 - long result = 0 - bool negative = string[0] == '-' - if negative or string[0]=='+' - string++ - repeat { - ubyte digit_char = @(string) - if strings.isdigit(digit_char) { - result = (result<<1) + (result<<3) ; multiply by 10 - result += digit_char - '0' ; add digit - } else { - break ; Invalid character, stop processing - } - string++ - } - - if negative - return -result - else - return result -} - -sub bin2uword(str string) -> uword { - ; -- binary string (with or without '%') to uword. - ; stops parsing at the first character that's not a 0 or 1. (except leading %) - uword result - ubyte char - if @(string)=='%' - string++ - repeat { - char = @(string) - if char=='0' { - result <<= 1 - } else if char=='1' { - result <<= 1 - result |= 1 - } else - return result - string++ - } -} - -sub any2uword(str string) -> uword, ubyte { - ; -- convert any number string (any prefix allowed) to uword. - ; returns the parsed word value, and the number of processed characters (including the prefix symbol) - ubyte count - when string[0] { - '$' -> { - count = 1 - while strings.isxdigit(string[count]) - count++ - return hex2uword(string), count - } - '%' -> { - count = 1 - while string[count]=='0' or string[count]=='1' - count++ - return bin2uword(string), count - } - else -> { - count = 0 - while strings.isdigit(string[count]) - count++ - return str2uword(string), count - } - } -} - } diff --git a/compiler/res/prog8lib/amiga500/copper.p8 b/compiler/res/prog8lib/amiga500/copper.p8 index 5a4ce9b05..46bf547d6 100644 --- a/compiler/res/prog8lib/amiga500/copper.p8 +++ b/compiler/res/prog8lib/amiga500/copper.p8 @@ -1,137 +1,5 @@ -; Copper list builder and manager for Amiga custom hardware. -; IMPORTANT: Copper lists MUST be allocated in CHIP RAM (accessible by both CPU and custom chips). -; Use memory() or ensure your list buffers are in CHIP RAM range. - -%import custom +%import shared_amiga_copper copper { %option no_symbol_prefixing, ignore_unused - - ; Current write position in copper list (used by assembly routines) - pointer @shared _copper_pos - - ; ========== List building routines (assembly) ========== - - asmsub init(pointer list_ptr @A0) clobbers (A0) { - %asm {{ - move.l a0,copper._copper_pos - rts - }} - } - - asmsub move(uword reg_addr @D0, uword value @D1) clobbers (D0, D1, A0) { - ; Add a MOVE instruction to the copper list. - ; reg_addr is the custom register address offsetr (e.g., $0180 for COLOR00 / $dff180). - ; The copper MOVE instruction encodes the register offset from $dff000. - %asm {{ - move.l copper._copper_pos,a0 - and.w #$1fe,d0 ; mask to even register offset (bit 0 must be 0) - move.w d0,(a0)+ ; word 1: register offset (bit 0 = 0 identifies MOVE) - move.w d1,(a0)+ ; word 2: value - move.l a0,copper._copper_pos - rts - }} - } - - asmsub wait(ubyte vpos @D0, ubyte hpos @D1, uword compare_mask @D2) clobbers (D0, D1, D2, A0) { - ; Add a WAIT instruction to the copper list. - ; Word1 = (vpos<<8) | (hpos<<1) | 1 (bit 0 = 1 identifies WAIT/SKIP) - ; Word2 = compare_mask with bit 0 = 0 (distinguishes WAIT from SKIP). - ; Word2 bit 15 = BFD (1 = no blitter wait, 0 = also wait for blitter) - ; Word2 bits 14-8 = VE (vertical compare enable mask) - ; Word2 bits 7-1 = HE (horizontal compare enable mask) - %asm {{ - move.l copper._copper_pos,a0 - and.w #$ff,d0 ; zero-extend vpos to word - lsl.w #8,d0 ; vpos to high byte - and.w #$ff,d1 ; zero-extend hpos to word - lsl.w #1,d1 ; hpos to bit 1 - or.w d1,d0 ; combine vpos and hpos - or.w #1,d0 ; set bit 0 to identify instruction as WAIT/SKIP - move.w d0,(a0)+ ; word 1 - and.w #$fffe,d2 ; clear bit 0 to indicate WAIT (not SKIP) - move.w d2,(a0)+ ; word 2 - move.l a0,copper._copper_pos - rts - }} - } - - asmsub skip(ubyte vpos @D0, ubyte hpos @D1, uword compare_mask @D2) clobbers (D0, D1, D2, A0) { - ; Add a SKIP instruction to the copper list. - ; Word1 = (vpos<<8) | (hpos<<1) | 1 (bit 0 = 1 identifies WAIT/SKIP) - ; Word2 = compare_mask with bit 0 = 1 (distinguishes SKIP from WAIT). - %asm {{ - move.l copper._copper_pos,a0 - and.w #$ff,d0 ; zero-extend vpos to word - lsl.w #8,d0 ; vpos to high byte - and.w #$ff,d1 ; zero-extend hpos to word - lsl.w #1,d1 ; hpos to bit 1 - or.w d1,d0 ; combine vpos and hpos - or.w #1,d0 ; set bit 0 to identify instruction as WAIT/SKIP - move.w d0,(a0)+ ; word 1 - or.w #1,d2 ; set bit 0 to indicate SKIP (not WAIT) - move.w d2,(a0)+ ; word 2 - move.l a0,copper._copper_pos - rts - }} - } - - asmsub end() clobbers (A0) { - ; Terminate the copper list with the end marker ($FFFF, $FFFE). - %asm {{ - move.l copper._copper_pos,a0 - move.w #$ffff,(a0)+ ; end marker word 1 - move.w #$fffe,(a0)+ ; end marker word 2 - move.l a0,copper._copper_pos - rts - }} - } - - asmsub get_pos() -> pointer @A0 { - ; Return the current write position in the copper list. - ; Useful for calculating list size or continuing from a saved position. - %asm {{ - move.l copper._copper_pos,a0 - rts - }} - } - - ; ========== Activation routines (assembly) ========== - - asmsub start(pointer list_ptr @A0) clobbers (A0) { - ; Activate a copper list by loading its address into COP1LC and enabling Copper DMA. - ; The copper list must be in CHIP RAM. - %asm {{ - move.l a0,custom.COP1LC ; load copper list pointer (auto-increments) - move.w #$8280,custom.DMACON ; DMACON: SET(0x8000) | DMAEN(0x0200) | COPEN(0x0080) - clr.w custom.COPJMP1 ; strobe COPJMP1 to activate - rts - }} - } - - ; ========== Effects routines (Prog8) ========== - - sub append_raster_colors(ubyte vpos_start, ^^uword colors, ubyte num_lines) { - ; Append WAIT+MOVE instructions to change background color per scanline. - ; Does NOT call init() or end() - caller must handle list setup. - ; - ; Parameters: - ; vpos_start - starting vertical beam position (0-255) - ; colors - pointer to array of color values (12-bit RGB, e.g., $0F00 for red) - ; num_lines - number of scanlines to color - ; - ; Example: - ; copper.init(my_list) - ; ... add other copper instructions ... - ; copper.append_raster_colors(50, bar_colors, 8) - ; copper.end() - - ubyte vpos = vpos_start - ubyte i - for i in 0 to num_lines - 1 { - wait(vpos, 0, $fffe) - move($180, colors[i]) - vpos += 1 - } - } } diff --git a/compiler/res/prog8lib/amiga500/custom.p8 b/compiler/res/prog8lib/amiga500/custom.p8 index 15a7fd420..e3ed249bf 100644 --- a/compiler/res/prog8lib/amiga500/custom.p8 +++ b/compiler/res/prog8lib/amiga500/custom.p8 @@ -1,709 +1,5 @@ -%import exec -%import syslib +%import shared_amiga_custom custom { %option no_symbol_prefixing, ignore_unused - - - asmsub grab_system() { - ; take over the whole OS and system, to run hardware banging programs (games, demos, etc) - %asm {{ - -exec_AttnFlags = 296 -gfx_ActiView = $22 -gfx_copinit = $26 -gfx_LOFlist = $32 -VBlankFrequency = $212 -GfxLoadView = -222 -GfxWaitTOF = -270 -IRQ1 = $64 -IRQ2 = $68 -IRQ3 = $6C -IRQ4 = $70 -IRQ5 = $74 -IRQ6 = $78 -IRQ7 = $7C - - move.l 4.w,a6 - jsr exec.Forbid(a6) ; Do not run other tasks - btst.b #0,exec_AttnFlags+1(a6) ; Check if > 68000 processor - beq.s 1$ ; On 68000 no VBR (always zero) - lea.l .getvbr(PC),a5 ; Function to call as supervisor - jsr exec.Supervisor(a6) ; Call supervisor function in A5 - move.l d0,custom.cpuVBR ; Store the returned VBR contents -1$ - cmp.b #50,VBlankFrequency(a6) - seq.b custom.isPAL - - move.l sys.GfxBase,a6 ; A6 = Graphics base - move.l gfx_ActiView(a6),custom.savedView ; Store current View pointer - sub.l a1,a1 ; NULL view = default settings - jsr GfxLoadView(a6) ; Load the view - jsr GfxWaitTOF(a6) ; Wait one screen refresh - jsr GfxWaitTOF(a6) ; Wait a 2nd (in case of interlace) - - move.w #$8000,d0 ; Value - move.w custom.DMACONR,custom.savedDMACON ; Store system DMA channels - or.w d0,custom.savedDMACON ; SET/CLR set to SET - move.w custom.INTENAR,custom.savedINTENA ; Store system enabled interrupts - or.w d0,custom.savedINTENA ; SET/CLR set to SET - move.w custom.ADKCONR,custom.savedADKCON ; Audio, disk and UART - or.w d0,custom.savedADKCON ; SET/CLR set to SET - - btst.b #14-8,custom.DMACONR ; Dummy read -3$ btst.b #14-8,custom.DMACONR ; Blitter still busy? - bne.s 3$ ; If yes, wait a bit - move.w #$01FF,custom.DMACON ; Disable all DMA - move.w #$3FFF,custom.INTENA ; Disable all interrupts - - move.l custom.cpuVBR,a0 ; A0 = Pointer to vector base - move.l IRQ1(a0),custom.savedIRQ1 ; Store IRQ1 vector - move.l IRQ3(a0),custom.savedIRQ3 ; Store IRQ3 vector - move.l IRQ4(a0),custom.savedIRQ4 ; Store IRQ4 vector - bra.s .skip - -.getvbr: dc.l $4E7A0801 ; MOVEC VBR,d0 - privileged instruction - rte - -.skip: rts - - }} - } - - asmsub restore_system() { - ; restore the original OS and multitasking operation when the game/demo exits. - %asm {{ - btst.b #14-8,custom.DMACONR ; Dummy read -1$ btst.b #14-8,custom.DMACONR ; Blitter still busy? - bne.s 1$ ; If yes, wait a bit - move.w #$01FF,custom.DMACON ; Disable all DMA - move.w #$3FFF,custom.INTENA ; Disable all interrupts - - move.l custom.cpuVBR,a0 ; A0 = Pointer to vector base - move.l custom.savedIRQ4,d0 ; Restore IRQ4 vector - move.l d0,IRQ4(a0) - move.l custom.savedIRQ3,d0 ; Restore IRQ3 vector - move.l d0,IRQ3(a0) - move.l custom.savedIRQ1,d0 ; Restore IRQ1 vector - move.l d0,IRQ1(a0) - - move.l sys.GfxBase,a6 ; A6 = Graphics base - move.l gfx_copinit(a6),custom.COP1LC ; Restore coplist pointer 1 - move.l gfx_LOFlist(a6),custom.COP2LC ; Restore coplist pointer 2 - clr.w custom.COPJMP1 ; Make Copper use restored pointer - - move.w custom.savedADKCON,custom.ADKCON ; Restore audio, disk and UART - move.w custom.savedINTENA,custom.INTENA ; Restore original interrupts - move.w custom.savedDMACON,custom.DMACON ; Restore original DMA - - move.l custom.savedView,a1 ; Get original view pointer - jsr GfxLoadView(a6) ; Restore the original view - jsr GfxWaitTOF(a6) ; Wait one screen refresh - jsr GfxWaitTOF(a6) ; Wait a 2nd (in case of interlace) - - move.l 4.w,a6 - jsr exec.Permit(a6) ; Re-enable multitasking - rts - }} - } - - asmsub waitvsync() { - %asm {{ -; synchronize to the screen's vsync, this routine doesn't require the OS to be active (sys.waitvsync is the OS-compatible version of this routine) -; Wait until the raster beam reaches line 300 -.WaitLine300: - MOVE.L $DFF004, D0 ; Read VPOSR + VHPOSR simultaneously - LSR.L #8, D0 ; Shift vertical position bits into low word - AND.W #$01FF, D0 ; Mask out horizontal beam bits (get 9-bit line #) - CMP.W #300, D0 ; Are we at raster line 300? - BNE.S .WaitLine300 - - ; Wait until the beam MOVES PAST line 300 - ; (Prevents fast CPUs like 030/040/060 from executing twice on the same line) -.WaitLineNext: - MOVE.L $DFF004, D0 - LSR.L #8, D0 - AND.W #$01FF, D0 - CMP.W #300, D0 - BEQ.S .WaitLineNext - rts - }} - } - - - pointer @shared cpuVBR ; after calling grab_system: contains CPU VBR register - bool @shared isPAL ; after calling grab_system: is true when system is PAL, false if NTSC - - private pointer @shared savedView ; original graphics view pointer - private uword @shared savedDMACON ; original DMA control with SET/CLR bit - private uword @shared savedINTENA ; original interrupt enable with SET/CLR bit - private uword @shared savedADKCON ; original ADK control with SET/CLR bit - private pointer @shared savedIRQ1 ; original IRQ1 vector - private pointer @shared savedIRQ3 ; original IRQ3 vector - private pointer @shared savedIRQ4 ; original IRQ4 vector - - - ; ========== AGA palette utilities ========== - - asmsub set_aga_color(ubyte color_index @D0, long rgb24 @D1) clobbers (D0,D1,D2,D3,D4,A0) { - ; Write a 24-bit RGB color ($00RRGGBB) to an AGA palette entry. - ; AGA uses eight banks of 32 COLOR registers and two writes per color: - ; first the upper nibble of each channel, then the lower nibble. - ; Keep this routine 68000-compatible: the amiga500 target is assembled as - ; 68000 by default, even though AGA hardware is normally paired with a 68020. - %asm {{ - and.l #$ff,d0 - move.l d0,d4 - lsr.w #5,d4 - lsl.w #8,d4 - lsl.w #5,d4 - - and.w #$1f,d0 - lsl.w #1,d0 - move.l #$dff180,a0 - adda.w d0,a0 - - move.l d1,d2 - and.l #$f00000,d2 - lsr.l #8,d2 - lsr.l #4,d2 - move.l d1,d3 - and.l #$00f000,d3 - lsr.l #8,d3 - or.w d3,d2 - move.l d1,d3 - and.l #$0000f0,d3 - lsr.l #4,d3 - or.w d3,d2 - - move.l d1,d3 - and.l #$0f0000,d3 - lsr.l #8,d3 - move.l d1,d0 - and.l #$000f00,d0 - lsr.l #4,d0 - or.w d0,d3 - move.l d1,d0 - and.l #$00000f,d0 - or.w d0,d3 - - move.w d4,custom.BPLCON3 - move.w d2,(a0) - ori.w #$0200,d4 - move.w d4,custom.BPLCON3 - move.w d3,(a0) - andi.w #$fdff,d4 - move.w d4,custom.BPLCON3 - rts - }} - } - - asmsub set_aga_color_nibbles(ubyte color_index @D0, uword rgb_high_nibbles @D1, uword rgb_low_nibbles @D2) clobbers (D0,D1,D2,D3,A0) { - ; Write preformatted AGA palette nibbles. Each value is $0RGB. Result will still be 24 bit RRGGBB AGA color. - ; Keep this routine 68000-compatible: the amiga500 target is assembled as - ; 68000 by default, even though AGA hardware is normally paired with a 68020. - %asm {{ - and.l #$ff,d0 - move.l d0,d3 - lsr.w #5,d3 - lsl.w #8,d3 - lsl.w #5,d3 - - and.w #$1f,d0 - lsl.w #1,d0 - move.l #$dff180,a0 - adda.w d0,a0 - - move.w d3,custom.BPLCON3 - move.w d1,(a0) - ori.w #$0200,d3 - move.w d3,custom.BPLCON3 - move.w d2,(a0) - andi.w #$fdff,d3 - move.w d3,custom.BPLCON3 - rts - }} - } - - ; ========== audio filter ======= - - asmsub filter_on() { - ; ENABLE Audio Filter (Muffled audio / Dimmed Power LED) - %asm {{ - bclr #1,custom.CIAA_PRA ; Set Bit 1 to LOW -> Filter ON - rts - }} - } - - asmsub filter_off() { - ; DISABLE Audio Filter (Clear, crisp audio / Bright Power LED) - %asm {{ - bset #1,custom.CIAA_PRA ; Set Bit 1 to HIGH -> Filter OFF - rts - }} - } - - ; ========== mouse button status ========== - - sub left_button() -> bool { - ; Returns true if the left mouse button (port 1) is pressed. - ; Left button is CIA-A PRA bit 6, active low. - return (custom.CIAA_PRA & %01000000) == 0 - } - - sub right_button() -> bool { - ; Returns true if the right mouse button (port 1) is pressed. - ; Right button is POTGOR ($dff016) bit 10, active low. - return (custom.POTGOR & %0000010000000000) == 0 - } - - sub middle_button() -> bool { - ; Returns true if the middle mouse button (port 1) is pressed. - ; Middle button is POTGOR ($dff016) bit 8, active low. - return (custom.POTGOR & %0000000100000000) == 0 - } - - - ; Amiga custom chip registers (full addresses, base $dff000) - ; Regenerated from https://github.com/alfishe/amiga-bootcamp/blob/main/14_references/custom_chip_registers.md - ; All registers are 16-bit words accessed on even byte boundaries. - - ; ========== Read-only registers ========== - - &uword BLTDDAT = $dff000 ; blitter destination early read - &uword DMACONR = $dff002 ; DMA control read - &uword VPOSR = $dff004 ; beam position (V high bits + LOF) - &uword VHPOSR = $dff006 ; beam position (V low + H) - &uword DSKDATR = $dff008 ; disk data early read - &uword JOY0DAT = $dff00a ; joystick/mouse port 0 - &uword JOY1DAT = $dff00c ; joystick/mouse port 1 - &uword CLXDAT = $dff00e ; collision detection - &uword ADKCONR = $dff010 ; audio/disk control read - &uword POT0DAT = $dff012 ; pot port 0 data - &uword POT1DAT = $dff014 ; pot port 1 data - &uword POTGOR = $dff016 ; pot port data read - &uword SERDATR = $dff018 ; serial port data + status - &uword DSKBYTR = $dff01a ; disk data byte + status - &uword INTENAR = $dff01c ; interrupt enable read - &uword INTREQR = $dff01e ; interrupt request read - - ; ========== Write / Read-Write registers ========== - - ; Disk - &uword DSKPTH = $dff020 ; disk DMA pointer (high) - &uword DSKPTL = $dff022 ; disk DMA pointer (low) - &pointer DSKPT = $dff020 ; disk DMA pointer (full 32-bit, hi/lo auto-increment) - &uword DSKLEN = $dff024 ; disk DMA length - &uword DSKDAT = $dff026 ; disk DMA data write - &uword REFPTR = $dff028 ; refresh pointer - - ; Beam position (write) - &uword VPOSW = $dff02a ; beam position write (V) - &uword VHPOSW = $dff02c ; beam position write (H) - &uword COPCON = $dff02e ; copper control - - ; Serial - &uword SERDAT = $dff030 ; serial port data write - &uword SERPER = $dff032 ; serial port period/control - - ; Pot/Game - &uword POTGO = $dff034 ; pot port control - &uword JOYTEST = $dff036 ; joystick counter test - &uword STREQU = $dff038 ; short frame strobe (ECS) - &uword STRVBL = $dff03a ; vertical blank strobe (ECS) - &uword STRHOR = $dff03c ; horizontal sync strobe (ECS) - &uword STRLONG = $dff03e ; long frame strobe (ECS) - - ; Blitter - &uword BLTCON0 = $dff040 ; blitter control 0 - &uword BLTCON1 = $dff042 ; blitter control 1 - &uword BLTAFWM = $dff044 ; blitter A first word mask - &uword BLTALWM = $dff046 ; blitter A last word mask - &uword BLTCPTH = $dff048 ; blitter C pointer (high) - &uword BLTCPTL = $dff04a ; blitter C pointer (low) - &pointer BLTCPT = $dff048 ; blitter C pointer (full 32-bit, hi/lo auto-increment) - &uword BLTBPTH = $dff04c ; blitter B pointer (high) - &uword BLTBPTL = $dff04e ; blitter B pointer (low) - &pointer BLTBPT = $dff04c ; blitter B pointer (full 32-bit, hi/lo auto-increment) - &uword BLTAPTH = $dff050 ; blitter A pointer (high) - &uword BLTAPTL = $dff052 ; blitter A pointer (low) - &pointer BLTAPT = $dff050 ; blitter A pointer (full 32-bit, hi/lo auto-increment) - &uword BLTDPTH = $dff054 ; blitter D pointer (high) - &uword BLTDPTL = $dff056 ; blitter D pointer (low) - &pointer BLTDPT = $dff054 ; blitter D pointer (full 32-bit, hi/lo auto-increment) - &uword BLTSIZE = $dff058 ; blitter size (starts blit) - &uword BLTCON0L = $dff05a ; blitter control 0 (lower bits, ECS) - &uword BLTSIZV = $dff05c ; blitter V size (ECS) - &uword BLTSIZH = $dff05e ; blitter H size (ECS, starts blit) - &uword BLTCMOD = $dff060 ; blitter C modulo - &uword BLTBMOD = $dff062 ; blitter B modulo - &uword BLTAMOD = $dff064 ; blitter A modulo - &uword BLTDMOD = $dff066 ; blitter D modulo - &uword BLTCDAT = $dff070 ; blitter C data - &uword BLTBDAT = $dff072 ; blitter B data - &uword BLTADAT = $dff074 ; blitter A data - &uword SPRHDAT = $dff078 ; ext sprite data (ECS) - &uword DENISEID = $dff07c ; Denise/Lisa chip ID (ECS/AGA) - &uword DSKSYNC = $dff07e ; disk sync pattern - - ; Copper - &uword COP1LCH = $dff080 ; copper 1 list pointer (high) - &uword COP1LCL = $dff082 ; copper 1 list pointer (low) - &pointer COP1LC = $dff080 ; copper 1 list pointer (full 32-bit, hi/lo auto-increment) - &uword COP2LCH = $dff084 ; copper 2 list pointer (high) - &uword COP2LCL = $dff086 ; copper 2 list pointer (low) - &pointer COP2LC = $dff084 ; copper 2 list pointer (full 32-bit, hi/lo auto-increment) - &uword COPJMP1 = $dff088 ; copper jump strobe 1 - &uword COPJMP2 = $dff08a ; copper jump strobe 2 - &uword COPINS = $dff08c ; copper instruction fetch - - ; Display window / data fetch - &uword DIWSTRT = $dff08e ; display window start - &uword DIWSTOP = $dff090 ; display window stop - &uword DDFSTRT = $dff092 ; data fetch start - &uword DDFSTOP = $dff094 ; data fetch stop - - ; Control registers - &uword DMACON = $dff096 ; DMA control write - &uword CLXCON = $dff098 ; collision control - &uword INTENA = $dff09a ; interrupt enable - &uword INTREQ = $dff09c ; interrupt request - &uword ADKCON = $dff09e ; audio/disk control - - ; ========== Audio channels ========== - - &uword AUD0PTH = $dff0a0 ; audio 0 pointer (high) - &uword AUD0PTL = $dff0a2 ; audio 0 pointer (low) - &pointer AUD0PT = $dff0a0 ; audio 0 pointer (full 32-bit, hi/lo auto-increment) - &uword AUD0LEN = $dff0a4 ; audio 0 length - &uword AUD0PER = $dff0a6 ; audio 0 period - &uword AUD0VOL = $dff0a8 ; audio 0 volume - &uword AUD0DAT = $dff0aa ; audio 0 sample data - - &uword AUD1PTH = $dff0b0 ; audio 1 pointer (high) - &uword AUD1PTL = $dff0b2 ; audio 1 pointer (low) - &pointer AUD1PT = $dff0b0 ; audio 1 pointer (full 32-bit, hi/lo auto-increment) - &uword AUD1LEN = $dff0b4 ; audio 1 length - &uword AUD1PER = $dff0b6 ; audio 1 period - &uword AUD1VOL = $dff0b8 ; audio 1 volume - &uword AUD1DAT = $dff0ba ; audio 1 sample data - - &uword AUD2PTH = $dff0c0 ; audio 2 pointer (high) - &uword AUD2PTL = $dff0c2 ; audio 2 pointer (low) - &pointer AUD2PT = $dff0c0 ; audio 2 pointer (full 32-bit, hi/lo auto-increment) - &uword AUD2LEN = $dff0c4 ; audio 2 length - &uword AUD2PER = $dff0c6 ; audio 2 period - &uword AUD2VOL = $dff0c8 ; audio 2 volume - &uword AUD2DAT = $dff0ca ; audio 2 sample data - - &uword AUD3PTH = $dff0d0 ; audio 3 pointer (high) - &uword AUD3PTL = $dff0d2 ; audio 3 pointer (low) - &pointer AUD3PT = $dff0d0 ; audio 3 pointer (full 32-bit, hi/lo auto-increment) - &uword AUD3LEN = $dff0d4 ; audio 3 length - &uword AUD3PER = $dff0d6 ; audio 3 period - &uword AUD3VOL = $dff0d8 ; audio 3 volume - &uword AUD3DAT = $dff0da ; audio 3 sample data - - ; ========== Bitplane pointers ========== - - &uword BPL1PTH = $dff0e0 ; bitplane 1 pointer (high) - &uword BPL1PTL = $dff0e2 ; bitplane 1 pointer (low) - &pointer BPL1PT = $dff0e0 ; bitplane 1 pointer (full 32-bit, hi/lo auto-increment) - &uword BPL2PTH = $dff0e4 ; bitplane 2 pointer (high) - &uword BPL2PTL = $dff0e6 ; bitplane 2 pointer (low) - &pointer BPL2PT = $dff0e4 ; bitplane 2 pointer (full 32-bit, hi/lo auto-increment) - &uword BPL3PTH = $dff0e8 ; bitplane 3 pointer (high) - &uword BPL3PTL = $dff0ea ; bitplane 3 pointer (low) - &pointer BPL3PT = $dff0e8 ; bitplane 3 pointer (full 32-bit, hi/lo auto-increment) - &uword BPL4PTH = $dff0ec ; bitplane 4 pointer (high) - &uword BPL4PTL = $dff0ee ; bitplane 4 pointer (low) - &pointer BPL4PT = $dff0ec ; bitplane 4 pointer (full 32-bit, hi/lo auto-increment) - &uword BPL5PTH = $dff0f0 ; bitplane 5 pointer (high) - &uword BPL5PTL = $dff0f2 ; bitplane 5 pointer (low) - &pointer BPL5PT = $dff0f0 ; bitplane 5 pointer (full 32-bit, hi/lo auto-increment) - &uword BPL6PTH = $dff0f4 ; bitplane 6 pointer (high) - &uword BPL6PTL = $dff0f6 ; bitplane 6 pointer (low) - &pointer BPL6PT = $dff0f4 ; bitplane 6 pointer (full 32-bit, hi/lo auto-increment) - &uword BPL7PTH = $dff0f8 ; bitplane 7 pointer (high) - &uword BPL7PTL = $dff0fa ; bitplane 7 pointer (low) - &pointer BPL7PT = $dff0f8 ; bitplane 7 pointer (full 32-bit, hi/lo auto-increment) - &uword BPL8PTH = $dff0fc ; bitplane 8 pointer (high) - &uword BPL8PTL = $dff0fe ; bitplane 8 pointer (low) - &pointer BPL8PT = $dff0fc ; bitplane 8 pointer (full 32-bit, hi/lo auto-increment) - - ; ========== Bitplane control ========== - - &uword BPLCON0 = $dff100 ; bitplane control 0 - &uword BPLCON1 = $dff102 ; bitplane control 1 (scroll) - &uword BPLCON2 = $dff104 ; bitplane control 2 (priority) - &uword BPLCON3 = $dff106 ; bitplane control 3 (AGA) - &uword BPL1MOD = $dff108 ; bitplane modulo (odd planes) - &uword BPL2MOD = $dff10a ; bitplane modulo (even planes) - &uword BPLCON4 = $dff10c ; bitplane control 4 (AGA) - - &uword BPL1DAT = $dff110 ; bitplane 1 data - &uword BPL2DAT = $dff112 ; bitplane 2 data - &uword BPL3DAT = $dff114 ; bitplane 3 data - &uword BPL4DAT = $dff116 ; bitplane 4 data - &uword BPL5DAT = $dff118 ; bitplane 5 data - &uword BPL6DAT = $dff11a ; bitplane 6 data - &uword BPL7DAT = $dff11c ; bitplane 7 data - &uword BPL8DAT = $dff11e ; bitplane 8 data - - ; ========== Sprite pointers ========== - - &uword SPR0PTH = $dff120 ; sprite 0 pointer (high) - &uword SPR0PTL = $dff122 ; sprite 0 pointer (low) - &pointer SPR0PT = $dff120 ; sprite 0 pointer (full 32-bit, hi/lo auto-increment) - &uword SPR1PTH = $dff124 ; sprite 1 pointer (high) - &uword SPR1PTL = $dff126 ; sprite 1 pointer (low) - &pointer SPR1PT = $dff124 ; sprite 1 pointer (full 32-bit, hi/lo auto-increment) - &uword SPR2PTH = $dff128 ; sprite 2 pointer (high) - &uword SPR2PTL = $dff12a ; sprite 2 pointer (low) - &pointer SPR2PT = $dff128 ; sprite 2 pointer (full 32-bit, hi/lo auto-increment) - &uword SPR3PTH = $dff12c ; sprite 3 pointer (high) - &uword SPR3PTL = $dff12e ; sprite 3 pointer (low) - &pointer SPR3PT = $dff12c ; sprite 3 pointer (full 32-bit, hi/lo auto-increment) - &uword SPR4PTH = $dff130 ; sprite 4 pointer (high) - &uword SPR4PTL = $dff132 ; sprite 4 pointer (low) - &pointer SPR4PT = $dff130 ; sprite 4 pointer (full 32-bit, hi/lo auto-increment) - &uword SPR5PTH = $dff134 ; sprite 5 pointer (high) - &uword SPR5PTL = $dff136 ; sprite 5 pointer (low) - &pointer SPR5PT = $dff134 ; sprite 5 pointer (full 32-bit, hi/lo auto-increment) - &uword SPR6PTH = $dff138 ; sprite 6 pointer (high) - &uword SPR6PTL = $dff13a ; sprite 6 pointer (low) - &pointer SPR6PT = $dff138 ; sprite 6 pointer (full 32-bit, hi/lo auto-increment) - &uword SPR7PTH = $dff13c ; sprite 7 pointer (high) - &uword SPR7PTL = $dff13e ; sprite 7 pointer (low) - &pointer SPR7PT = $dff13c ; sprite 7 pointer (full 32-bit, hi/lo auto-increment) - - ; ========== Sprite data ========== - - &uword SPR0POS = $dff140 ; sprite 0 position - &uword SPR0CTL = $dff142 ; sprite 0 control - &uword SPR0DATA = $dff144 ; sprite 0 data A - &uword SPR0DATB = $dff146 ; sprite 0 data B - &uword SPR1POS = $dff148 ; sprite 1 position - &uword SPR1CTL = $dff14a ; sprite 1 control - &uword SPR1DATA = $dff14c ; sprite 1 data A - &uword SPR1DATB = $dff14e ; sprite 1 data B - &uword SPR2POS = $dff150 ; sprite 2 position - &uword SPR2CTL = $dff152 ; sprite 2 control - &uword SPR2DATA = $dff154 ; sprite 2 data A - &uword SPR2DATB = $dff156 ; sprite 2 data B - &uword SPR3POS = $dff158 ; sprite 3 position - &uword SPR3CTL = $dff15a ; sprite 3 control - &uword SPR3DATA = $dff15c ; sprite 3 data A - &uword SPR3DATB = $dff15e ; sprite 3 data B - &uword SPR4POS = $dff160 ; sprite 4 position - &uword SPR4CTL = $dff162 ; sprite 4 control - &uword SPR4DATA = $dff164 ; sprite 4 data A - &uword SPR4DATB = $dff166 ; sprite 4 data B - &uword SPR5POS = $dff168 ; sprite 5 position - &uword SPR5CTL = $dff16a ; sprite 5 control - &uword SPR5DATA = $dff16c ; sprite 5 data A - &uword SPR5DATB = $dff16e ; sprite 5 data B - &uword SPR6POS = $dff170 ; sprite 6 position - &uword SPR6CTL = $dff172 ; sprite 6 control - &uword SPR6DATA = $dff174 ; sprite 6 data A - &uword SPR6DATB = $dff176 ; sprite 6 data B - &uword SPR7POS = $dff178 ; sprite 7 position - &uword SPR7CTL = $dff17a ; sprite 7 control - &uword SPR7DATA = $dff17c ; sprite 7 data A - &uword SPR7DATB = $dff17e ; sprite 7 data B - - ; ========== Color palette ========== - - &uword COLOR00 = $dff180 ; color 0 (background) - &uword COLOR01 = $dff182 - &uword COLOR02 = $dff184 - &uword COLOR03 = $dff186 - &uword COLOR04 = $dff188 - &uword COLOR05 = $dff18a - &uword COLOR06 = $dff18c - &uword COLOR07 = $dff18e - &uword COLOR08 = $dff190 - &uword COLOR09 = $dff192 - &uword COLOR10 = $dff194 - &uword COLOR11 = $dff196 - &uword COLOR12 = $dff198 - &uword COLOR13 = $dff19a - &uword COLOR14 = $dff19c - &uword COLOR15 = $dff19e - &uword COLOR16 = $dff1a0 - &uword COLOR17 = $dff1a2 - &uword COLOR18 = $dff1a4 - &uword COLOR19 = $dff1a6 - &uword COLOR20 = $dff1a8 - &uword COLOR21 = $dff1aa - &uword COLOR22 = $dff1ac - &uword COLOR23 = $dff1ae - &uword COLOR24 = $dff1b0 - &uword COLOR25 = $dff1b2 - &uword COLOR26 = $dff1b4 - &uword COLOR27 = $dff1b6 - &uword COLOR28 = $dff1b8 - &uword COLOR29 = $dff1ba - &uword COLOR30 = $dff1bc - &uword COLOR31 = $dff1be - - ; ========== ECS/AGA extended registers ========== - - &uword HTOTAL = $dff1c0 ; H total (ECS) - &uword HSSTOP = $dff1c2 ; H sync stop (ECS) - &uword HBSTRT = $dff1c4 ; H blank start (ECS) - &uword HBSTOP = $dff1c6 ; H blank stop (ECS) - &uword VTOTAL = $dff1c8 ; V total (ECS) - &uword VSSTOP = $dff1ca ; V sync stop (ECS) - &uword VBSTRT = $dff1cc ; V blank start (ECS) - &uword VBSTOP = $dff1ce ; V blank stop (ECS) - &uword SPRHSTRT = $dff1d0 ; sprite horizontal start (AGA) - &uword SPRHSTOP = $dff1d2 ; sprite horizontal stop (AGA) - &uword BPLHSTRT = $dff1d4 ; bitplane horizontal start (AGA) - &uword BPLHSTOP = $dff1d6 ; bitplane horizontal stop (AGA) - &uword HHPOSW = $dff1d8 ; horizontal hardware position write (AGA) - &uword HHPOSR = $dff1da ; horizontal hardware position read (AGA) - &uword BEAMCON0 = $dff1dc ; beam counter control (ECS) - &uword HSSTRT = $dff1de ; H sync start (ECS) - &uword VSSTRT = $dff1e0 ; V sync start (ECS) - &uword DIWHIGH = $dff1e4 ; display window high bits (ECS) - &uword FMODE = $dff1fc ; fetch mode (AGA) - - ; ========== Blitter minterm constants ========== - - const uword ABC = $80 ; A and B and C - const uword ABNC = $40 ; A and B and not C - const uword ANBC = $20 ; A and not B and C - const uword ANBNC = $10 ; A and not B and not C - const uword NABC = $8 ; not A and B and C - const uword NABNC = $4 ; not A and not B and C - const uword NANBC = $2 ; not A and B and not C - const uword NANBNC = $1 ; not A and not B and not C - - ; Common blitter minterms - const uword MINTERM_COPY = ABC | ABNC | ANBC | NABC ; A (straight copy) - const uword MINTERM_OR = ABC | ABNC | ANBC | NABC | ANBNC | NANBC ; A or B - const uword MINTERM_AND = ABC ; A and B - const uword MINTERM_XOR = ANBC | NABC ; A xor B - const uword MINTERM_NOT = ANBNC | NANBNC ; not A - const uword MINTERM_CLEAR = 0 ; clear all - const uword MINTERM_NOP = ABNC | ANBNC ; no operation - - ; ========== DMA control bits (dmacon) ========== - - const uword DMAF_SETCLR = $8000 - const uword DMAF_AUD0 = $0001 - const uword DMAF_AUD1 = $0002 - const uword DMAF_AUD2 = $0004 - const uword DMAF_AUD3 = $0008 - const uword DMAF_AUDIO = $000f - const uword DMAF_DISK = $0010 - const uword DMAF_SPRITE = $0020 - const uword DMAF_BLITTER = $0040 - const uword DMAF_COPPER = $0080 - const uword DMAF_RASTER = $0100 - const uword DMAF_MASTER = $0200 - const uword DMAF_BLITHOG = $0400 - const uword DMAF_ALL = $01ff - - ; DMA status read bits - const uword DMAF_BLTDONE = $4000 - const uword DMAF_BLTNZERO = $2000 - - ; ========== Interrupt bits (intena/intreq) ========== - - const uword INTF_SETCLR = $8000 - const uword INTF_INTEN = $4000 - const uword INTF_EXTER = $2000 - const uword INTF_DSKSYNC = $1000 - const uword INTF_RBF = $0800 - const uword INTF_AUD3 = $0400 - const uword INTF_AUD2 = $0200 - const uword INTF_AUD1 = $0100 - const uword INTF_AUD0 = $0080 - const uword INTF_BLIT = $0040 - const uword INTF_VERTB = $0020 - const uword INTF_COPER = $0010 - const uword INTF_PORTS = $0008 - const uword INTF_SOFTINT = $0004 - const uword INTF_DSKBLK = $0002 - const uword INTF_TBE = $0001 - - ; ========== ADK control bits (adkcon) ========== - - const uword ADKF_SETCLR = $8000 - const uword ADKF_PRECOMP1 = $4000 - const uword ADKF_PRECOMP0 = $2000 - const uword ADKF_MFMPREC = $1000 - const uword ADKF_UARTBRK = $0800 - const uword ADKF_WORDSYNC = $0400 - const uword ADKF_MSBSYNC = $0200 - const uword ADKF_FAST = $0100 - const uword ADKF_USE3PN = $0080 - const uword ADKF_USE2P3 = $0040 - const uword ADKF_USE1P2 = $0020 - const uword ADKF_USE0P1 = $0010 - const uword ADKF_USE3VN = $0008 - const uword ADKF_USE2V3 = $0004 - const uword ADKF_USE1V2 = $0002 - const uword ADKF_USE0V1 = $0001 - - ; ========== Blitter control bits (bltcon0) ========== - - const uword BC0F_DEST = $0100 - const uword BC0F_SRCC = $0200 - const uword BC0F_SRCB = $0400 - const uword BC0F_SRCA = $0800 - - ; ========== Blitter control bits (bltcon1) ========== - - const uword BC1F_DESC = $0002 - const uword BC1F_LINEMODE = $0001 - const uword BC1F_FILL_OR = $0008 - const uword BC1F_FILL_XOR = $0010 - const uword BC1F_FILL_CARRYIN = $0004 - const uword BC1F_ONEDOT = $0002 - const uword BC1F_OVFLAG = $0020 - const uword BC1F_SIGNFLAG = $0040 - const uword BC1F_SUD = $0010 - const uword BC1F_SUL = $0008 - const uword BC1F_AUL = $0004 - - ; ========== CIA registers ========== - - ; CIA-A at $bfe001 (odd, accessed on D8-D15) - ; CIA-B at $bfd000 (even, accessed on D0-D7) - ; Each CIA register is spaced $100 apart - - &ubyte CIAA_PRA = $bfe001 ; CIA-A peripheral A (serial data, floppy, keyboard) - &ubyte CIAA_PRB = $bfe101 ; CIA-A peripheral B (parallel port) - &ubyte CIAA_DDRA = $bfe201 ; CIA-A data direction A - &ubyte CIAA_DDRB = $bfe301 ; CIA-A data direction B - &ubyte CIAA_TALO = $bfe401 ; CIA-A timer A low - &ubyte CIAA_TAHI = $bfe501 ; CIA-A timer A high - &ubyte CIAA_TBLO = $bfe601 ; CIA-A timer B low - &ubyte CIAA_TBHI = $bfe701 ; CIA-A timer B high - &ubyte CIAA_TODLOW = $bfe801 ; CIA-A TOD low - &ubyte CIAA_TODMID = $bfe901 ; CIA-A TOD mid - &ubyte CIAA_TODHI = $bfea01 ; CIA-A TOD high - &ubyte CIAA_SDR = $bfec01 ; CIA-A serial data - &ubyte CIAA_ICR = $bfed01 ; CIA-A interrupt control - &ubyte CIAA_CRA = $bfee01 ; CIA-A control A - &ubyte CIAA_CRB = $bfef01 ; CIA-A control B - - &ubyte CIAB_PRA = $bfd000 ; CIA-B peripheral A (RS-232) - &ubyte CIAB_PRB = $bfd100 ; CIA-B peripheral B (printer) - &ubyte CIAB_DDRA = $bfd200 ; CIA-B data direction A - &ubyte CIAB_DDRB = $bfd300 ; CIA-B data direction B - &ubyte CIAB_TALO = $bfd400 ; CIA-B timer A low - &ubyte CIAB_TAHI = $bfd500 ; CIA-B timer A high - &ubyte CIAB_TBLO = $bfd600 ; CIA-B timer B low - &ubyte CIAB_TBHI = $bfd700 ; CIA-B timer B high - &ubyte CIAB_TODLOW = $bfd800 ; CIA-B TOD low - &ubyte CIAB_TODMID = $bfd900 ; CIA-B TOD mid - &ubyte CIAB_TODHI = $bfda00 ; CIA-B TOD high - &ubyte CIAB_SDR = $bfdc00 ; CIA-B serial data - &ubyte CIAB_ICR = $bfdd00 ; CIA-B interrupt control - &ubyte CIAB_CRA = $bfde00 ; CIA-B control A - &ubyte CIAB_CRB = $bfdf00 ; CIA-B control B } diff --git a/compiler/res/prog8lib/amiga500/dos.p8 b/compiler/res/prog8lib/amiga500/dos.p8 index 0a24a5846..b109172aa 100644 --- a/compiler/res/prog8lib/amiga500/dos.p8 +++ b/compiler/res/prog8lib/amiga500/dos.p8 @@ -1,868 +1,5 @@ -;; Auto-generated from dos_lib.sfd and dos_lib.i -;; Library base: _DOSBase in prog8: sys.DOSBase -;; Bank: 2 -;; Functions: 161 - -%import exec -%import utility +%import shared_amiga_dos dos { - %option no_symbol_prefixing - extsub @bank 2 -30 = Open(str name @D1, long accessMode @D2) -> pointer @D0 - extsub @bank 2 -36 = Close(pointer file @D1) -> long @D0 - extsub @bank 2 -42 = Read(pointer file @D1, pointer buffer @D2, long length @D3) -> long @D0 - extsub @bank 2 -48 = Write(pointer file @D1, pointer buffer @D2, long length @D3) -> long @D0 - extsub @bank 2 -54 = Input() -> pointer @D0 - extsub @bank 2 -60 = Output() -> pointer @D0 - extsub @bank 2 -66 = Seek(pointer file @D1, long position @D2, long offset @D3) -> long @D0 - extsub @bank 2 -72 = DeleteFile(str name @D1) -> long @D0 - extsub @bank 2 -78 = Rename(str oldName @D1, str newName @D2) -> long @D0 - extsub @bank 2 -84 = Lock(str name @D1, long k_type @D2) -> pointer @D0 - extsub @bank 2 -90 = UnLock(pointer lock @D1) - extsub @bank 2 -96 = DupLock(pointer lock @D1) -> pointer @D0 - extsub @bank 2 -102 = Examine(pointer lock @D1, ^^FileInfoBlock fileInfoBlock @D2) -> long @D0 - extsub @bank 2 -108 = ExNext(pointer lock @D1, ^^FileInfoBlock fileInfoBlock @D2) -> long @D0 - extsub @bank 2 -114 = Info(pointer lock @D1, ^^InfoData parameterBlock @D2) -> long @D0 - extsub @bank 2 -120 = CreateDir(str name @D1) -> pointer @D0 - extsub @bank 2 -126 = CurrentDir(pointer lock @D1) -> pointer @D0 - extsub @bank 2 -132 = IoErr() -> long @D0 - extsub @bank 2 -138 = CreateProc(str name @D1, long pri @D2, pointer segList @D3, long stackSize @D4) -> ^^exec.MsgPort @D0 - extsub @bank 2 -144 = Exit(long returnCode @D1) - extsub @bank 2 -150 = LoadSeg(str name @D1) -> pointer @D0 - extsub @bank 2 -156 = UnLoadSeg(pointer seglist @D1) - extsub @bank 2 -174 = DeviceProc(str name @D1) -> ^^exec.MsgPort @D0 - extsub @bank 2 -180 = SetComment(str name @D1, str comment @D2) -> long @D0 - extsub @bank 2 -186 = SetProtection(str name @D1, long protect @D2) -> long @D0 - extsub @bank 2 -192 = DateStamp(^^DateStampStruct date @D1) -> ^^DateStampStruct @D0 - extsub @bank 2 -198 = Delay(long timeout @D1) - extsub @bank 2 -204 = WaitForChar(pointer file @D1, long timeout @D2) -> long @D0 - extsub @bank 2 -210 = ParentDir(pointer lock @D1) -> pointer @D0 - extsub @bank 2 -216 = IsInteractive(pointer file @D1) -> long @D0 - extsub @bank 2 -222 = Execute(str string @D1, pointer file @D2, pointer file2 @D3) -> long @D0 - extsub @bank 2 -228 = AllocDosObject(long k_type @D1, pointer tags @D2) -> pointer @D0 - extsub @bank 2 -234 = FreeDosObject(long k_type @D1, pointer ptr @D2) - extsub @bank 2 -240 = DoPkt(^^exec.MsgPort port @D1, long action @D2, long arg1 @D3, long arg2 @D4, long arg3 @D5, long arg4 @D6, long arg5 @D7) -> long @D0 - extsub @bank 2 -246 = SendPkt(^^DosPacket dp @D1, ^^exec.MsgPort port @D2, ^^exec.MsgPort replyport @D3) - extsub @bank 2 -252 = WaitPkt() -> ^^DosPacket @D0 - extsub @bank 2 -258 = ReplyPkt(^^DosPacket dp @D1, long res1 @D2, long res2 @D3) - extsub @bank 2 -264 = AbortPkt(^^exec.MsgPort port @D1, ^^DosPacket pkt @D2) - extsub @bank 2 -270 = LockRecord(pointer fh @D1, long offset @D2, long length @D3, long mode @D4, long timeout @D5) -> bool @D0 - extsub @bank 2 -276 = LockRecords(pointer recArray @D1, long timeout @D2) -> bool @D0 - extsub @bank 2 -282 = UnLockRecord(pointer fh @D1, long offset @D2, long length @D3) -> bool @D0 - extsub @bank 2 -288 = UnLockRecords(pointer recArray @D1) -> bool @D0 - extsub @bank 2 -294 = SelectInput(pointer fh @D1) -> pointer @D0 - extsub @bank 2 -300 = SelectOutput(pointer fh @D1) -> pointer @D0 - extsub @bank 2 -306 = FGetC(pointer fh @D1) -> long @D0 - extsub @bank 2 -312 = FPutC(pointer fh @D1, long ch @D2) -> long @D0 - extsub @bank 2 -318 = UnGetC(pointer fh @D1, long character @D2) -> long @D0 - extsub @bank 2 -324 = FRead(pointer fh @D1, pointer block @D2, long blocklen @D3, long number @D4) -> long @D0 - extsub @bank 2 -330 = FWrite(pointer fh @D1, pointer block @D2, long blocklen @D3, long number @D4) -> long @D0 - extsub @bank 2 -336 = FGets(pointer fh @D1, str buf @D2, long buflen @D3) -> str @D0 - extsub @bank 2 -342 = FPuts(pointer fh @D1, str k_str @D2) -> long @D0 - extsub @bank 2 -348 = VFWritef(pointer fh @D1, str format @D2, pointer argarray @D3) - extsub @bank 2 -354 = VFPrintf(pointer fh @D1, str format @D2, pointer argarray @D3) -> long @D0 - extsub @bank 2 -360 = Flush(pointer fh @D1) -> long @D0 - extsub @bank 2 -366 = SetVBuf(pointer fh @D1, str buff @D2, long k_type @D3, long size @D4) -> long @D0 - extsub @bank 2 -372 = DupLockFromFH(pointer fh @D1) -> pointer @D0 - extsub @bank 2 -378 = OpenFromLock(pointer lock @D1) -> pointer @D0 - extsub @bank 2 -384 = ParentOfFH(pointer fh @D1) -> pointer @D0 - extsub @bank 2 -390 = ExamineFH(pointer fh @D1, ^^FileInfoBlock fib @D2) -> bool @D0 - extsub @bank 2 -396 = SetFileDate(str name @D1, ^^DateStampStruct date @D2) -> long @D0 - extsub @bank 2 -402 = NameFromLock(pointer lock @D1, str buffer @D2, long len @D3) -> long @D0 - extsub @bank 2 -408 = NameFromFH(pointer fh @D1, str buffer @D2, long len @D3) -> long @D0 - extsub @bank 2 -414 = SplitName(str name @D1, ubyte separator @D2, str buf @D3, word oldpos @D4, long size @D5) -> word @D0 - extsub @bank 2 -420 = SameLock(pointer lock1 @D1, pointer lock2 @D2) -> long @D0 - extsub @bank 2 -426 = SetMode(pointer fh @D1, long mode @D2) -> long @D0 - extsub @bank 2 -432 = ExAll(pointer lock @D1, ^^ExAllData buffer @D2, long size @D3, long data @D4, ^^ExAllControl control @D5) -> long @D0 - extsub @bank 2 -438 = ReadLink(^^exec.MsgPort port @D1, pointer lock @D2, str path @D3, str buffer @D4, long size @D5) -> long @D0 - extsub @bank 2 -444 = MakeLink(str name @D1, long dest @D2, long soft @D3) -> long @D0 - extsub @bank 2 -450 = ChangeMode(long k_type @D1, pointer fh @D2, long newmode @D3) -> long @D0 - extsub @bank 2 -456 = SetFileSize(pointer fh @D1, long pos @D2, long mode @D3) -> long @D0 - extsub @bank 2 -462 = SetIoErr(long result @D1) -> long @D0 - extsub @bank 2 -468 = Fault(long code @D1, str header @D2, str buffer @D3, long len @D4) -> bool @D0 - extsub @bank 2 -474 = PrintFault(long code @D1, str header @D2) -> bool @D0 - extsub @bank 2 -480 = ErrorReport(long code @D1, long k_type @D2, long arg1 @D3, ^^exec.MsgPort device @D4) -> long @D0 - extsub @bank 2 -492 = Cli() -> pointer @D0 - extsub @bank 2 -498 = CreateNewProc(pointer tags @D1) -> ^^Process @D0 - extsub @bank 2 -504 = RunCommand(pointer seg @D1, long stack @D2, str paramptr @D3, long paramlen @D4) -> long @D0 - extsub @bank 2 -510 = GetConsoleTask() -> ^^exec.MsgPort @D0 - extsub @bank 2 -516 = SetConsoleTask(^^exec.MsgPort task @D1) -> ^^exec.MsgPort @D0 - extsub @bank 2 -522 = GetFileSysTask() -> ^^exec.MsgPort @D0 - extsub @bank 2 -528 = SetFileSysTask(^^exec.MsgPort task @D1) -> ^^exec.MsgPort @D0 - extsub @bank 2 -534 = GetArgStr() -> str @D0 - extsub @bank 2 -540 = SetArgStr(str string @D1) -> str @D0 - extsub @bank 2 -546 = FindCliProc(long num @D1) -> ^^Process @D0 - extsub @bank 2 -552 = MaxCli() -> long @D0 - extsub @bank 2 -558 = SetCurrentDirName(str name @D1) -> bool @D0 - extsub @bank 2 -564 = GetCurrentDirName(str buf @D1, long len @D2) -> bool @D0 - extsub @bank 2 -570 = SetProgramName(str name @D1) -> bool @D0 - extsub @bank 2 -576 = GetProgramName(str buf @D1, long len @D2) -> bool @D0 - extsub @bank 2 -582 = SetPrompt(str name @D1) -> bool @D0 - extsub @bank 2 -588 = GetPrompt(str buf @D1, long len @D2) -> bool @D0 - extsub @bank 2 -594 = SetProgramDir(pointer lock @D1) -> pointer @D0 - extsub @bank 2 -600 = GetProgramDir() -> pointer @D0 - extsub @bank 2 -606 = SystemTagList(str command @D1, pointer tags @D2) -> long @D0 - extsub @bank 2 -612 = AssignLock(str name @D1, pointer lock @D2) -> long @D0 - extsub @bank 2 -618 = AssignLate(str name @D1, str path @D2) -> bool @D0 - extsub @bank 2 -624 = AssignPath(str name @D1, str path @D2) -> bool @D0 - extsub @bank 2 -630 = AssignAdd(str name @D1, pointer lock @D2) -> bool @D0 - extsub @bank 2 -636 = RemAssignList(str name @D1, pointer lock @D2) -> long @D0 - extsub @bank 2 -642 = GetDeviceProc(str name @D1, pointer dp @D2) -> pointer @D0 - extsub @bank 2 -648 = FreeDeviceProc(pointer dp @D1) - extsub @bank 2 -654 = LockDosList(long flags @D1) -> pointer @D0 - extsub @bank 2 -660 = UnLockDosList(long flags @D1) - extsub @bank 2 -666 = AttemptLockDosList(long flags @D1) -> pointer @D0 - extsub @bank 2 -672 = RemDosEntry(pointer dlist @D1) -> bool @D0 - extsub @bank 2 -678 = AddDosEntry(pointer dlist @D1) -> long @D0 - extsub @bank 2 -684 = FindDosEntry(pointer dlist @D1, str name @D2, long flags @D3) -> pointer @D0 - extsub @bank 2 -690 = NextDosEntry(pointer dlist @D1, long flags @D2) -> pointer @D0 - extsub @bank 2 -696 = MakeDosEntry(str name @D1, long k_type @D2) -> pointer @D0 - extsub @bank 2 -702 = FreeDosEntry(pointer dlist @D1) - extsub @bank 2 -708 = IsFileSystem(str name @D1) -> bool @D0 - extsub @bank 2 -714 = Format(str filesystem @D1, str volumename @D2, long dostype @D3) -> bool @D0 - extsub @bank 2 -720 = Relabel(str drive @D1, str newname @D2) -> long @D0 - extsub @bank 2 -726 = Inhibit(str name @D1, long onoff @D2) -> long @D0 - extsub @bank 2 -732 = AddBuffers(str name @D1, long number @D2) -> long @D0 - extsub @bank 2 -738 = CompareDates(^^DateStampStruct date1 @D1, ^^DateStampStruct date2 @D2) -> long @D0 - extsub @bank 2 -744 = DateToStr(pointer datetime @D1) -> long @D0 - extsub @bank 2 -750 = StrToDate(pointer datetime @D1) -> long @D0 - extsub @bank 2 -756 = InternalLoadSeg(pointer fh @D0, pointer table @A0, pointer funcarray @A1, pointer stack @A2) -> pointer @D0 - extsub @bank 2 -762 = InternalUnLoadSeg(pointer seglist @D1, pointer freefunc @A1) -> bool @D0 - extsub @bank 2 -768 = NewLoadSeg(str file @D1, pointer tags @D2) -> pointer @D0 - extsub @bank 2 -774 = AddSegment(str name @D1, pointer seg @D2, long system @D3) -> long @D0 - extsub @bank 2 -780 = FindSegment(str name @D1, pointer seg @D2, long system @D3) -> pointer @D0 - extsub @bank 2 -786 = RemSegment(pointer seg @D1) -> long @D0 - extsub @bank 2 -792 = CheckSignal(long mask @D1) -> long @D0 - extsub @bank 2 -798 = ReadArgs(str arg_template @D1, pointer array @D2, pointer args @D3) -> pointer @D0 - extsub @bank 2 -804 = FindArg(str keyword @D1, str arg_template @D2) -> long @D0 - extsub @bank 2 -810 = ReadItem(str name @D1, long maxchars @D2, pointer cSource @D3) -> long @D0 - extsub @bank 2 -816 = StrToLong(str string @D1, pointer value @D2) -> long @D0 - extsub @bank 2 -822 = MatchFirst(str pat @D1, pointer anchor @D2) -> long @D0 - extsub @bank 2 -828 = MatchNext(pointer anchor @D1) -> long @D0 - extsub @bank 2 -834 = MatchEnd(pointer anchor @D1) - extsub @bank 2 -840 = ParsePattern(str pat @D1, pointer patbuf @D2, long patbuflen @D3) -> long @D0 - extsub @bank 2 -846 = MatchPattern(pointer patbuf @D1, str k_str @D2) -> bool @D0 - extsub @bank 2 -858 = FreeArgs(pointer args @D1) - extsub @bank 2 -870 = FilePart(str path @D1) -> str @D0 - extsub @bank 2 -876 = PathPart(str path @D1) -> str @D0 - extsub @bank 2 -882 = AddPart(str dirname @D1, str filename @D2, long size @D3) -> bool @D0 - extsub @bank 2 -888 = StartNotify(pointer notify @D1) -> bool @D0 - extsub @bank 2 -894 = EndNotify(pointer notify @D1) - extsub @bank 2 -900 = SetVar(str name @D1, str buffer @D2, long size @D3, long flags @D4) -> bool @D0 - extsub @bank 2 -906 = GetVar(str name @D1, str buffer @D2, long size @D3, long flags @D4) -> long @D0 - extsub @bank 2 -912 = DeleteVar(str name @D1, long flags @D2) -> long @D0 - extsub @bank 2 -918 = FindVar(str name @D1, long k_type @D2) -> pointer @D0 - extsub @bank 2 -930 = CliInitNewcli(^^DosPacket dp @A0) -> long @D0 - extsub @bank 2 -936 = CliInitRun(^^DosPacket dp @A0) -> long @D0 - extsub @bank 2 -942 = WriteChars(str buf @D1, long buflen @D2) -> long @D0 - extsub @bank 2 -948 = PutStr(str k_str @D1) -> long @D0 - extsub @bank 2 -954 = VPrintf(str format @D1, pointer argarray @D2) -> long @D0 - extsub @bank 2 -966 = ParsePatternNoCase(str pat @D1, pointer patbuf @D2, long patbuflen @D3) -> long @D0 - extsub @bank 2 -972 = MatchPatternNoCase(pointer patbuf @D1, str k_str @D2) -> bool @D0 - extsub @bank 2 -984 = SameDevice(pointer lock1 @D1, pointer lock2 @D2) -> bool @D0 - extsub @bank 2 -990 = ExAllEnd(pointer lock @D1, ^^ExAllData buffer @D2, long size @D3, long data @D4, ^^ExAllControl control @D5) - extsub @bank 2 -996 = SetOwner(str name @D1, long owner_info @D2) -> bool @D0 - extsub @bank 2 -1014 = VolumeRequestHook(str vol @D1) -> long @D0 - extsub @bank 2 -1026 = GetCurrentDir() -> pointer @D0 - extsub @bank 2 -1128 = PutErrStr(str k_str @D1) -> long @D0 - extsub @bank 2 -1134 = ErrorOutput() -> long @D0 - extsub @bank 2 -1140 = SelectError(pointer fh @D1) -> long @D0 - extsub @bank 2 -1152 = DoShellMethodTagList(long method @D0, pointer tags @A0) -> pointer @D0 - extsub @bank 2 -1158 = ScanStackToken(pointer seg @D1, long defaultstack @D2) -> long @D0 - - ; ---- struct definitions ---- - - struct DateStampStruct { ; total size: 12 - long Days ; 0 - long Minute ; 4 - long Tick ; 8 - } - - struct DosPacket { ; total size: 48 - ^^exec.Message Link ; 0 - ^^exec.MsgPort Port ; 4 - long Type ; 8 - long Res1 ; 12 - long Res2 ; 16 - long Arg1 ; 20 - long Arg2 ; 24 - long Arg3 ; 28 - long Arg4 ; 32 - long Arg5 ; 36 - long Arg6 ; 40 - long Arg7 ; 44 - } - - struct ErrorString { ; total size: 8 - pointer Nums ; 0 - str Strings ; 4 - } - - struct ExAllControl { ; total size: 16 - long Entries ; 0 - long LastKey ; 4 - str MatchString ; 8 - ^^utility.Hook MatchFunc ; 12 - } - - struct ExAllData { ; total size: 40 - ^^ExAllData Next ; 0 - str Name ; 4 - long Type ; 8 - long Size ; 12 - long Prot ; 16 - long Days ; 20 - long Mins ; 24 - long Ticks ; 28 - str Comment ; 32 - uword OwnerUID ; 36 - uword OwnerGID ; 38 - } - - struct FileHandle { ; total size: 44 - ^^exec.Message Link ; 0 - ^^exec.MsgPort Port ; 4 - ^^exec.MsgPort Type ; 8 - pointer Buf ; 12 - long Pos ; 16 - long End ; 20 - long Funcs ; 24 - long Func2 ; 28 - long Func3 ; 32 - long Args ; 36 - long Arg2 ; 40 - } - - struct FileInfoBlock { ; total size: 260 - long DiskKey ; 0 - long DirEntryType ; 4 - ubyte[108] FileName ; 8 - long Protection ; 116 - long EntryType ; 120 - long Size ; 124 - long NumBlocks ; 128 - long Days ; 132 - long Minute ; 136 - long Tick ; 140 - ubyte[80] Comment ; 144 - uword OwnerUID ; 224 - uword OwnerGID ; 226 - ubyte[32] Reserved ; 228 - } - - struct FileLock { ; total size: 20 - pointer Link ; 0 - long Key ; 4 - long Access ; 8 - ^^exec.MsgPort Task ; 12 - pointer Volume ; 16 - } - - struct InfoData { ; total size: 36 - long NumSoftErrors ; 0 - long UnitNumber ; 4 - long DiskState ; 8 - long NumBlocks ; 12 - long NumBlocksUsed ; 16 - long BytesPerBlock ; 20 - long DiskType ; 24 - pointer VolumeNode ; 28 - long InUse ; 32 - } - - struct Process { ; total size: 228 - ^^exec.Node Succ ; 0 - ^^exec.Node Pred ; 4 - ubyte Type ; 8 - byte Pri ; 9 - str Name ; 10 - ubyte Flags ; 14 - ubyte State ; 15 - byte IDNestCnt ; 16 - byte TDNestCnt ; 17 - long SigAlloc ; 18 - long SigWait ; 22 - long SigRecvd ; 26 - long SigExcept ; 30 - uword TrapAlloc ; 34 - uword TrapAble ; 36 - pointer ExceptData ; 38 - pointer ExceptCode ; 42 - pointer TrapData ; 46 - pointer TrapCode ; 50 - pointer SPReg ; 54 - pointer SPLower ; 58 - pointer SPUpper ; 62 - pointer Switch ; 66 - pointer Launch ; 70 - ^^exec.Node Head ; 74 - ^^exec.Node Tail ; 78 - ^^exec.Node TailPred ; 82 - ubyte Process_List_Type ; 86 - ubyte Pad ; 87 - pointer UserData ; 88 - ^^exec.Node Node_Succ ; 92 - ^^exec.Node Node_Pred ; 96 - ubyte Node_Type ; 100 - byte Node_Pri ; 101 - str Node_Name ; 102 - ubyte MsgPort_Flags ; 106 - ubyte SigBit ; 107 - pointer SigTask ; 108 - ^^exec.Node List_Head ; 112 - ^^exec.Node List_Tail ; 116 - ^^exec.Node List_TailPred ; 120 - ubyte List_Type ; 124 - ubyte List_Pad ; 125 - word Process_Pad ; 126 - pointer SegList ; 128 - long StackSize ; 132 - pointer GlobVec ; 136 - long TaskNum ; 140 - pointer StackBase ; 144 - long Result2 ; 148 - pointer CurrentDir ; 152 - pointer Cis ; 156 - pointer Cos ; 160 - pointer ConsoleTask ; 164 - pointer FileSystemTask ; 168 - pointer Cli ; 172 - pointer ReturnAddr ; 176 - pointer PktWait ; 180 - pointer WindowPtr ; 184 - pointer HomeDir ; 188 - long Process_Flags ; 192 - pointer ExitCode ; 196 - long ExitData ; 200 - str Arguments ; 204 - ^^exec.MinNode MinList_Head ; 208 - ^^exec.MinNode MinList_Tail ; 212 - ^^exec.MinNode MinList_TailPred ; 216 - long ShellPrivate ; 220 - pointer Ces ; 224 - } - - struct StandardPacket { ; total size: 68 - ^^exec.Node Succ ; 0 - ^^exec.Node Pred ; 4 - ubyte Type ; 8 - byte Pri ; 9 - str Name ; 10 - ^^exec.MsgPort ReplyPort ; 14 - uword Length ; 18 - ^^exec.Message Link ; 20 - ^^exec.MsgPort Port ; 24 - long DosPacket_Type ; 28 - long Res1 ; 32 - long Res2 ; 36 - long Arg1 ; 40 - long Arg2 ; 44 - long Arg3 ; 48 - long Arg4 ; 52 - long Arg5 ; 56 - long Arg6 ; 60 - long Arg7 ; 64 - } - - ; ---- constants ---- - const ubyte LEN_DATSTRING = $0010 - const ubyte DTB_SUBST = 0 - const ubyte DTF_SUBST = $0001 - const ubyte DTB_FUTURE = 1 - const ubyte DTF_FUTURE = $0002 - const ubyte FORMAT_DOS = $0000 - const ubyte FORMAT_INT = $0001 - const ubyte FORMAT_USA = $0002 - const ubyte FORMAT_CDN = $0003 - const ubyte FORMAT_DEF = $0004 - const long DOSTRUE = -1 - const ubyte DOSFALSE = $0000 - const uword MODE_OLDFILE = $03ed - const uword MODE_NEWFILE = $03ee - const uword MODE_READWRITE = $03ec - const long OFFSET_BEGINNING = -1 - const ubyte OFFSET_CURRENT = $0000 - const ubyte OFFSET_END = $0001 - const ubyte BITSPERBYTE = $0008 - const ubyte BYTESPERLONG = $0004 - const ubyte BITSPERLONG = $0020 - const long MAXINT = $7FFFFFFF - const long MININT = $80000000 - const long SHARED_LOCK = -2 - const long ACCESS_READ = -2 - const long EXCLUSIVE_LOCK = -1 - const long ACCESS_WRITE = -1 - const ubyte TICKS_PER_SECOND = $0032 - const ubyte FIBB_OTR_READ = 15 - const uword FIBF_OTR_READ = $8000 - const ubyte FIBB_OTR_WRITE = 14 - const uword FIBF_OTR_WRITE = $4000 - const ubyte FIBB_OTR_EXECUTE = 13 - const uword FIBF_OTR_EXECUTE = $2000 - const ubyte FIBB_OTR_DELETE = 12 - const uword FIBF_OTR_DELETE = $1000 - const ubyte FIBB_GRP_READ = 11 - const uword FIBF_GRP_READ = $0800 - const ubyte FIBB_GRP_WRITE = 10 - const uword FIBF_GRP_WRITE = $0400 - const ubyte FIBB_GRP_EXECUTE = 9 - const uword FIBF_GRP_EXECUTE = $0200 - const ubyte FIBB_GRP_DELETE = 8 - const uword FIBF_GRP_DELETE = $0100 - const ubyte FIBB_HOLD = 7 - const ubyte FIBF_HOLD = $0080 - const ubyte FIBB_SCRIPT = 6 - const ubyte FIBF_SCRIPT = $0040 - const ubyte FIBB_PURE = 5 - const ubyte FIBF_PURE = $0020 - const ubyte FIBB_ARCHIVE = 4 - const ubyte FIBF_ARCHIVE = $0010 - const ubyte FIBB_READ = 3 - const ubyte FIBF_READ = $0008 - const ubyte FIBB_WRITE = 2 - const ubyte FIBF_WRITE = $0004 - const ubyte FIBB_EXECUTE = 1 - const ubyte FIBF_EXECUTE = $0002 - const ubyte FIBB_DELETE = 0 - const ubyte FIBF_DELETE = $0001 - const ubyte FAULT_MAX = $0052 - const ubyte ID_WRITE_PROTECTED = $0050 - const ubyte ID_VALIDATING = $0051 - const ubyte ID_VALIDATED = $0052 - const long ID_NO_DISK_PRESENT = -1 - const ubyte ID_UNREADABLE_DISK = $0042 - const ubyte ID_NOT_REALLY_DOS = $004e - const ubyte ID_DOS_DISK = $0044 - const ubyte ID_FFS_DISK = $0044 - const ubyte ID_INTER_DOS_DISK = $0044 - const ubyte ID_INTER_FFS_DISK = $0044 - const ubyte ID_FASTDIR_DOS_DISK = $0044 - const ubyte ID_FASTDIR_FFS_DISK = $0044 - const ubyte ID_LONG_DOS_DISK = $0044 - const ubyte ID_LONG_FFS_DISK = $0044 - const ubyte ID_COMPLONG_FFS_DISK = $0044 - const ubyte ID_KICKSTART_DISK = $004b - const ubyte ID_MSDOS_DISK = $004d - const ubyte ERROR_NO_FREE_STORE = $0067 - const ubyte ERROR_TASK_TABLE_FULL = $0069 - const ubyte ERROR_BAD_TEMPLATE = $0072 - const ubyte ERROR_BAD_NUMBER = $0073 - const ubyte ERROR_REQUIRED_ARG_MISSING = $0074 - const ubyte ERROR_KEY_NEEDS_ARG = $0075 - const ubyte ERROR_TOO_MANY_ARGS = $0076 - const ubyte ERROR_UNMATCHED_QUOTES = $0077 - const ubyte ERROR_LINE_TOO_LONG = $0078 - const ubyte ERROR_FILE_NOT_OBJECT = $0079 - const ubyte ERROR_INVALID_RESIDENT_LIBRARY = $007a - const ubyte ERROR_NO_DEFAULT_DIR = $00c9 - const ubyte ERROR_OBJECT_IN_USE = $00ca - const ubyte ERROR_OBJECT_EXISTS = $00cb - const ubyte ERROR_DIR_NOT_FOUND = $00cc - const ubyte ERROR_OBJECT_NOT_FOUND = $00cd - const ubyte ERROR_BAD_STREAM_NAME = $00ce - const ubyte ERROR_OBJECT_TOO_LARGE = $00cf - const ubyte ERROR_ACTION_NOT_KNOWN = $00d1 - const ubyte ERROR_INVALID_COMPONENT_NAME = $00d2 - const ubyte ERROR_INVALID_LOCK = $00d3 - const ubyte ERROR_OBJECT_WRONG_TYPE = $00d4 - const ubyte ERROR_DISK_NOT_VALIDATED = $00d5 - const ubyte ERROR_DISK_WRITE_PROTECTED = $00d6 - const ubyte ERROR_RENAME_ACROSS_DEVICES = $00d7 - const ubyte ERROR_DIRECTORY_NOT_EMPTY = $00d8 - const ubyte ERROR_TOO_MANY_LEVELS = $00d9 - const ubyte ERROR_DEVICE_NOT_MOUNTED = $00da - const ubyte ERROR_SEEK_ERROR = $00db - const ubyte ERROR_COMMENT_TOO_BIG = $00dc - const ubyte ERROR_DISK_FULL = $00dd - const ubyte ERROR_DELETE_PROTECTED = $00de - const ubyte ERROR_WRITE_PROTECTED = $00df - const ubyte ERROR_READ_PROTECTED = $00e0 - const ubyte ERROR_NOT_A_DOS_DISK = $00e1 - const ubyte ERROR_NO_DISK = $00e2 - const ubyte ERROR_NO_MORE_ENTRIES = $00e8 - const ubyte ERROR_IS_SOFT_LINK = $00e9 - const ubyte ERROR_OBJECT_LINKED = $00ea - const ubyte ERROR_BAD_HUNK = $00eb - const ubyte ERROR_NOT_IMPLEMENTED = $00ec - const ubyte ERROR_RECORD_NOT_LOCKED = $00f0 - const ubyte ERROR_LOCK_COLLISION = $00f1 - const ubyte ERROR_LOCK_TIMEOUT = $00f2 - const ubyte ERROR_UNLOCK_ERROR = $00f3 - const ubyte RETURN_OK = $0000 - const ubyte RETURN_WARN = $0005 - const ubyte RETURN_ERROR = $000a - const ubyte RETURN_FAIL = $0014 - const ubyte SIGBREAKB_CTRL_C = 12 - const uword SIGBREAKF_CTRL_C = $1000 - const ubyte SIGBREAKB_CTRL_D = 13 - const uword SIGBREAKF_CTRL_D = $2000 - const ubyte SIGBREAKB_CTRL_E = 14 - const uword SIGBREAKF_CTRL_E = $4000 - const ubyte SIGBREAKB_CTRL_F = 15 - const uword SIGBREAKF_CTRL_F = $8000 - const long LOCK_DIFFERENT = -1 - const ubyte LOCK_SAME = $0000 - const ubyte LOCK_SAME_VOLUME = $0001 - const ubyte CHANGE_LOCK = $0000 - const ubyte CHANGE_FH = $0001 - const ubyte LINK_HARD = $0000 - const ubyte LINK_SOFT = $0001 - const long ITEM_EQUAL = -2 - const long ITEM_ERROR = -1 - const ubyte ITEM_NOTHING = $0000 - const ubyte ITEM_UNQUOTED = $0001 - const ubyte ITEM_QUOTED = $0002 - const ubyte DOS_FILEHANDLE = $0000 - const ubyte DOS_EXALLCONTROL = $0001 - const ubyte DOS_FIB = $0002 - const ubyte DOS_STDPKT = $0003 - const ubyte DOS_CLI = $0004 - const ubyte DOS_RDARGS = $0005 - const ubyte reserve = $0004 - const ubyte vsize = $0006 - const ubyte APB_DOWILD = 0 - const ubyte APF_DOWILD = $0001 - const ubyte APB_ITSWILD = 1 - const ubyte APF_ITSWILD = $0002 - const ubyte APB_DODIR = 2 - const ubyte APF_DODIR = $0004 - const ubyte APB_DIDDIR = 3 - const ubyte APF_DIDDIR = $0008 - const ubyte APB_NOMEMERR = 4 - const ubyte APF_NOMEMERR = $0010 - const ubyte APB_DODOT = 5 - const ubyte APF_DODOT = $0020 - const ubyte APB_DirChanged = 6 - const ubyte APF_DirChanged = $0040 - const ubyte APB_FollowHLinks = 7 - const ubyte APF_FollowHLinks = $0080 - const ubyte DDB_PatternBit = 0 - const ubyte DDF_PatternBit = $0001 - const ubyte DDB_ExaminedBit = 1 - const ubyte DDF_ExaminedBit = $0002 - const ubyte DDB_Completed = 2 - const ubyte DDF_Completed = $0004 - const ubyte DDB_AllBit = 3 - const ubyte DDF_AllBit = $0008 - const ubyte DDB_SINGLE = 4 - const ubyte DDF_SINGLE = $0010 - const ubyte P_ANY = $80 - const ubyte P_SINGLE = $81 - const ubyte P_ORSTART = $82 - const ubyte P_ORNEXT = $83 - const ubyte P_OREND = $84 - const ubyte P_NOT = $85 - const ubyte P_NOTEND = $86 - const ubyte P_NOTCLASS = $87 - const ubyte P_CLASS = $88 - const ubyte P_REPBEG = $89 - const ubyte P_REPEND = $8A - const ubyte P_STOP = $8B - const ubyte COMPLEX_BIT = $0001 - const ubyte EXAMINE_BIT = $0002 - const uword ERROR_BUFFER_OVERFLOW = $012f - const uword ERROR_BREAK = $0130 - const uword ERROR_NOT_EXECUTABLE = $0131 - const ubyte PRB_FREESEGLIST = 0 - const ubyte PRF_FREESEGLIST = $0001 - const ubyte PRB_FREECURRDIR = 1 - const ubyte PRF_FREECURRDIR = $0002 - const ubyte PRB_FREECLI = 2 - const ubyte PRF_FREECLI = $0004 - const ubyte PRB_CLOSEINPUT = 3 - const ubyte PRF_CLOSEINPUT = $0008 - const ubyte PRB_CLOSEOUTPUT = 4 - const ubyte PRF_CLOSEOUTPUT = $0010 - const ubyte PRB_FREEARGS = 5 - const ubyte PRF_FREEARGS = $0020 - const ubyte PRB_CLOSEERROR = 6 - const ubyte PRF_CLOSEERROR = $0040 - const ubyte ACTION_NIL = $0000 - const ubyte ACTION_STARTUP = $0000 - const ubyte ACTION_GET_BLOCK = $0002 - const ubyte ACTION_SET_MAP = $0004 - const ubyte ACTION_DIE = $0005 - const ubyte ACTION_EVENT = $0006 - const ubyte ACTION_CURRENT_VOLUME = $0007 - const ubyte ACTION_LOCATE_OBJECT = $0008 - const ubyte ACTION_RENAME_DISK = $0009 - const ubyte ACTION_WRITE = $0057 - const ubyte ACTION_READ = $0052 - const ubyte ACTION_FREE_LOCK = $000f - const ubyte ACTION_DELETE_OBJECT = $0010 - const ubyte ACTION_RENAME_OBJECT = $0011 - const ubyte ACTION_MORE_CACHE = $0012 - const ubyte ACTION_COPY_DIR = $0013 - const ubyte ACTION_WAIT_CHAR = $0014 - const ubyte ACTION_SET_PROTECT = $0015 - const ubyte ACTION_CREATE_DIR = $0016 - const ubyte ACTION_EXAMINE_OBJECT = $0017 - const ubyte ACTION_EXAMINE_NEXT = $0018 - const ubyte ACTION_DISK_INFO = $0019 - const ubyte ACTION_INFO = $001a - const ubyte ACTION_FLUSH = $001b - const ubyte ACTION_SET_COMMENT = $001c - const ubyte ACTION_PARENT = $001d - const ubyte ACTION_TIMER = $001e - const ubyte ACTION_INHIBIT = $001f - const ubyte ACTION_DISK_TYPE = $0020 - const ubyte ACTION_DISK_CHANGE = $0021 - const ubyte ACTION_SET_DATE = $0022 - const uword ACTION_UNDISK_INFO = $0201 - const uword ACTION_SCREEN_MODE = $03e2 - const uword ACTION_READ_RETURN = $03e9 - const uword ACTION_WRITE_RETURN = $03ea - const uword ACTION_SEEK = $03f0 - const uword ACTION_FINDUPDATE = $03ec - const uword ACTION_FINDINPUT = $03ed - const uword ACTION_FINDOUTPUT = $03ee - const uword ACTION_END = $03ef - const uword ACTION_SET_FILE_SIZE = $03fe - const uword ACTION_WRITE_PROTECT = $03ff - const ubyte ACTION_SAME_LOCK = $0028 - const uword ACTION_CHANGE_SIGNAL = $03e3 - const uword ACTION_FORMAT = $03fc - const uword ACTION_MAKE_LINK = $03fd - const uword ACTION_READ_LINK = $0400 - const uword ACTION_FH_FROM_LOCK = $0402 - const uword ACTION_IS_FILESYSTEM = $0403 - const uword ACTION_CHANGE_MODE = $0404 - const uword ACTION_COPY_DIR_FH = $0406 - const uword ACTION_PARENT_FH = $0407 - const uword ACTION_EXAMINE_ALL = $0409 - const uword ACTION_EXAMINE_FH = $040a - const uword ACTION_LOCK_RECORD = $07d8 - const uword ACTION_FREE_RECORD = $07d9 - const uword ACTION_ADD_NOTIFY = $1001 - const uword ACTION_REMOVE_NOTIFY = $1002 - const uword ACTION_EXAMINE_ALL_END = $040b - const uword ACTION_SET_OWNER = $040c - const uword ACTION_SERIALIZE_DISK = $1068 - const ubyte RNB_WILDSTAR = 24 - const long RNF_WILDSTAR = $01000000 - const ubyte RNB_PRIVATE1 = 1 - const ubyte RNF_PRIVATE1 = $0002 - const long CMD_SYSTEM = -1 - const long CMD_INTERNAL = -2 - const long CMD_DISABLED = -999 - const ubyte DLT_DEVICE = $0000 - const ubyte DLT_DIRECTORY = $0001 - const ubyte DLT_VOLUME = $0002 - const ubyte DLT_LATE = $0003 - const ubyte DLT_NONBINDING = $0004 - const long DLT_PRIVATE = -1 - const ubyte DVPB_UNLOCK = 0 - const ubyte DVPF_UNLOCK = $0001 - const ubyte DVPB_ASSIGN = 1 - const ubyte DVPF_ASSIGN = $0002 - const ubyte LDB_DEVICES = 2 - const ubyte LDF_DEVICES = $0004 - const ubyte LDB_VOLUMES = 3 - const ubyte LDF_VOLUMES = $0008 - const ubyte LDB_ASSIGNS = 4 - const ubyte LDF_ASSIGNS = $0010 - const ubyte LDB_ENTRY = 5 - const ubyte LDF_ENTRY = $0020 - const ubyte LDB_DELETE = 6 - const ubyte LDF_DELETE = $0040 - const ubyte LDB_READ = 0 - const ubyte LDF_READ = $0001 - const ubyte LDB_WRITE = 1 - const ubyte LDF_WRITE = $0002 - const ubyte REPORT_STREAM = $0000 - const ubyte REPORT_TASK = $0001 - const ubyte REPORT_LOCK = $0002 - const ubyte REPORT_VOLUME = $0003 - const ubyte REPORT_INSERT = $0004 - const uword ABORT_DISK_ERROR = $0128 - const uword ABORT_BUSY = $0120 - const long RUN_EXECUTE = -1 - const long RUN_SYSTEM = -2 - const long RUN_SYSTEM_ASYNCH = -3 - const ubyte ST_ROOT = $0001 - const ubyte ST_USERDIR = $0002 - const ubyte ST_SOFTLINK = $0003 - const ubyte ST_LINKDIR = $0004 - const long ST_FILE = -3 - const long ST_LINKFILE = -4 - const long ST_PIPEFILE = -5 - const uword HUNK_UNIT = $03e7 - const uword HUNK_NAME = $03e8 - const uword HUNK_CODE = $03e9 - const uword HUNK_DATA = $03ea - const uword HUNK_BSS = $03eb - const uword HUNK_RELOC32 = $03ec - const uword HUNK_RELOC16 = $03ed - const uword HUNK_RELOC8 = $03ee - const uword HUNK_EXT = $03ef - const uword HUNK_SYMBOL = $03f0 - const uword HUNK_DEBUG = $03f1 - const uword HUNK_END = $03f2 - const uword HUNK_HEADER = $03f3 - const uword HUNK_OVERLAY = $03f5 - const uword HUNK_BREAK = $03f6 - const uword HUNK_DREL32 = $03f7 - const uword HUNK_DREL16 = $03f8 - const uword HUNK_DREL8 = $03f9 - const uword HUNK_LIB = $03fa - const uword HUNK_INDEX = $03fb - const uword HUNK_RELOC32SHORT = $03fc - const uword HUNK_RELRELOC32 = $03fd - const uword HUNK_ABSRELOC16 = $03fe - const ubyte HUNKB_ADVISORY = 29 - const long HUNKF_ADVISORY = $20000000 - const ubyte HUNKB_CHIP = 30 - const long HUNKF_CHIP = $40000000 - const ubyte HUNKB_FAST = 31 - const long HUNKF_FAST = $80000000 - const ubyte EXT_SYMB = $0000 - const ubyte EXT_DEF = $0001 - const ubyte EXT_ABS = $0002 - const ubyte EXT_RES = $0003 - const ubyte EXT_COMMONDEF = $0004 - const ubyte EXT_REF32 = $0081 - const ubyte EXT_COMMON = $0082 - const ubyte EXT_REF16 = $0083 - const ubyte EXT_REF8 = $0084 - const ubyte EXT_DEXT32 = $0085 - const ubyte EXT_DEXT16 = $0086 - const ubyte EXT_DEXT8 = $0087 - const ubyte EXT_RELREF32 = $0088 - const ubyte EXT_RELCOMMON = $0089 - const ubyte EXT_ABSREF16 = $008a - const ubyte EXT_ABSREF8 = $008b - const long SYS_Dummy = $80000020 - const long NP_Dummy = $800003e8 - const long ADO_Dummy = $800007d0 - const ubyte ED_NAME = $0001 - const ubyte ED_TYPE = $0002 - const ubyte ED_SIZE = $0003 - const ubyte ED_PROTECTION = $0004 - const ubyte ED_DATE = $0005 - const ubyte ED_COMMENT = $0006 - const ubyte ED_OWNER = $0007 - const ubyte DE_TABLESIZE = $0000 - const ubyte DE_SIZEBLOCK = $0001 - const ubyte DE_SECORG = $0002 - const ubyte DE_NUMHEADS = $0003 - const ubyte DE_SECSPERBLK = $0004 - const ubyte DE_BLKSPERTRACK = $0005 - const ubyte DE_RESERVEDBLKS = $0006 - const ubyte DE_PREFAC = $0007 - const ubyte DE_INTERLEAVE = $0008 - const ubyte DE_LOWCYL = $0009 - const ubyte DE_UPPERCYL = $000a - const ubyte DE_NUMBUFFERS = $000b - const ubyte DE_MEMBUFTYPE = $000c - const ubyte DE_BUFMEMTYPE = $000c - const ubyte DE_MAXTRANSFER = $000d - const ubyte DE_MASK = $000e - const ubyte DE_BOOTPRI = $000f - const ubyte DE_DOSTYPE = $0010 - const ubyte DE_BAUD = $0011 - const ubyte DE_CONTROL = $0012 - const ubyte DE_BOOTBLOCKS = $0013 - const ubyte ENVB_SCSIDIRECT = 16 - const long ENVF_SCSIDIRECT = $00010000 - const ubyte ENVB_SUPERFLOPPY = 17 - const long ENVF_SUPERFLOPPY = $00020000 - const ubyte ENVB_DISABLENSD = 18 - const long ENVF_DISABLENSD = $00040000 - const long NOTIFY_CLASS = $40000000 - const uword NOTIFY_CODE = $1234 - const ubyte NRB_SEND_MESSAGE = 0 - const ubyte NRF_SEND_MESSAGE = $0001 - const ubyte NRB_SEND_SIGNAL = 1 - const ubyte NRF_SEND_SIGNAL = $0002 - const ubyte NRB_WAIT_REPLY = 3 - const ubyte NRF_WAIT_REPLY = $0008 - const ubyte NRB_NOTIFY_INITIAL = 4 - const ubyte NRF_NOTIFY_INITIAL = $0010 - const ubyte NRB_MAGIC = 31 - const long NRF_MAGIC = $80000000 - const long NR_HANDLER_FLAGS = $ffff0000 - const ubyte RDAB_STDIN = 0 - const ubyte RDAF_STDIN = $0001 - const ubyte RDAB_NOALLOC = 1 - const ubyte RDAF_NOALLOC = $0002 - const ubyte RDAB_NOPROMPT = 2 - const ubyte RDAF_NOPROMPT = $0004 - const ubyte MAX_TEMPLATE_ITEMS = $0064 - const ubyte MAX_MULTIARGS = $0080 - const ubyte REC_EXCLUSIVE = $0000 - const ubyte REC_EXCLUSIVE_IMMED = $0001 - const ubyte REC_SHARED = $0002 - const ubyte REC_SHARED_IMMED = $0003 - const long SHELL_DUMMY = $80000bb8 - const ubyte DOS_STDIO_I = $0001 - const ubyte BUF_LINE = $0000 - const ubyte BUF_FULL = $0001 - const ubyte BUF_NONE = $0002 - const long ENDSTREAMCH = -1 - const ubyte LV_VAR = $0000 - const ubyte LV_ALIAS = $0001 - const ubyte LVB_IGNORE = $0007 - const ubyte LVF_IGNORE = $80 - const ubyte GVB_GLOBAL_ONLY = 8 - const uword GVF_GLOBAL_ONLY = $0100 - const ubyte GVB_LOCAL_ONLY = 9 - const uword GVF_LOCAL_ONLY = $0200 - const ubyte GVB_BINARY_VAR = 10 - const uword GVF_BINARY_VAR = $0400 - const ubyte GVB_DONT_NULL_TERM = 11 - const uword GVF_DONT_NULL_TERM = $0800 - const ubyte GVB_SAVE_VAR = 12 - const uword GVF_SAVE_VAR = $1000 - const ubyte FORMAT_MAX = $0003 - const long OFFSET_BEGINING = -1 - const ubyte LOCK_SAME_HANDLER = $0001 - const ubyte LDF_ALL = $001c - const uword HUNK_ABSRELOC32 = $03ec - const uword HUNK_RELRELOC16 = $03ed - const uword HUNK_RELRELOC8 = $03ee - const ubyte EXT_ABSREF32 = $0081 - const ubyte EXT_ABSCOMMON = $0082 - const ubyte EXT_RELREF16 = $0083 - const ubyte EXT_RELREF8 = $0084 - const long SYS_Input = $80000021 - const long SYS_Output = $80000022 - const long SYS_Asynch = $80000023 - const long SYS_UserShell = $80000024 - const long SYS_CustomShell = $80000025 - const long SYS_Error = $80000026 - const long SYS_ExecuteInputStream = $80000020 - const long SYS_CmdStream = $80000028 - const long NP_Seglist = $800003e9 - const long NP_FreeSeglist = $800003ea - const long NP_Entry = $800003eb - const long NP_Input = $800003ec - const long NP_Output = $800003ed - const long NP_CloseInput = $800003ee - const long NP_CloseOutput = $800003ef - const long NP_Error = $800003f0 - const long NP_CloseError = $800003f1 - const long NP_CurrentDir = $800003f2 - const long NP_StackSize = $800003f3 - const long NP_Name = $800003f4 - const long NP_Priority = $800003f5 - const long NP_ConsoleTask = $800003f6 - const long NP_WindowPtr = $800003f7 - const long NP_HomeDir = $800003f8 - const long NP_CopyVars = $800003f9 - const long NP_Cli = $800003fa - const long NP_Path = $800003fb - const long NP_CommandName = $800003fc - const long NP_Arguments = $800003fd - const long NP_NotifyOnDeath = $800003fe - const long NP_Synchronous = $800003ff - const long NP_ExitCode = $80000400 - const long NP_ExitData = $80000401 - const long ADO_FH_Mode = $800007d1 - const long ADO_DirLen = $800007d2 - const long ADO_CommNameLen = $800007d3 - const long ADO_CommFileLen = $800007d4 - const long ADO_PromptLen = $800007d5 - const long SHELL_FGETS_FULL = $80000bb9 - const long SHELL_ADDH_LINE = $80000bba + %option no_symbol_prefixing, ignore_unused } -;; End of auto-generated dos_lib.sfd diff --git a/compiler/res/prog8lib/amiga500/exec.p8 b/compiler/res/prog8lib/amiga500/exec.p8 index 9bba752c4..ace07263f 100644 --- a/compiler/res/prog8lib/amiga500/exec.p8 +++ b/compiler/res/prog8lib/amiga500/exec.p8 @@ -1,656 +1,5 @@ -;; Auto-generated from exec_lib.sfd and exec_lib.i -;; Library base: _SysBase in prog8: sys.SysBase -;; Bank: 1 -;; Functions: 115 +%import shared_amiga_exec exec { - %option no_symbol_prefixing - - asmsub NewList(^^List list @A0) { - ; manually added utility routine to initialize new exec linked lists - %asm {{ - addq.l #4, a0 ; Point to lh_Tail - move.l a0, -4(a0) ; lh_Head = &lh_Tail - clr.l (a0) ; lh_Tail = NULL - subq.l #4, a0 ; Point back to &lh_Head - move.l a0, 8(a0) ; lh_TailPred = &lh_Head - rts - }} - } - - extsub @bank 1 -30 = Supervisor(pointer userFunction @A5) -> long @D0 - extsub @bank 1 -72 = InitCode(long startClass @D0, long version @D1) - extsub @bank 1 -78 = InitStruct(pointer initTable @A1, pointer k_memory @A2, long size @D0) - extsub @bank 1 -84 = MakeLibrary(pointer funcInit @A0, pointer structInit @A1, pointer libInit @A2, long dataSize @D0, long segList @D1) -> ^^Library @D0 - extsub @bank 1 -90 = MakeFunctions(pointer target @A0, pointer functionArray @A1, long funcDispBase @A2) - extsub @bank 1 -96 = FindResident(str name @A1) -> pointer @D0 - extsub @bank 1 -102 = InitResident(pointer resident @A1, long segList @D1) -> pointer @D0 - extsub @bank 1 -108 = Alert(long alertNum @D7) - extsub @bank 1 -114 = Debug(long flags @D0) - extsub @bank 1 -120 = Disable() - extsub @bank 1 -126 = Enable() - extsub @bank 1 -132 = Forbid() - extsub @bank 1 -138 = Permit() - extsub @bank 1 -144 = SetSR(long newSR @D0, long mask @D1) -> long @D0 - extsub @bank 1 -150 = SuperState() -> pointer @D0 - extsub @bank 1 -156 = UserState(pointer sysStack @D0) - extsub @bank 1 -162 = SetIntVector(long intNumber @D0, ^^Interrupt interrupt @A1) -> ^^Interrupt @D0 - extsub @bank 1 -168 = AddIntServer(long intNumber @D0, ^^Interrupt interrupt @A1) - extsub @bank 1 -174 = RemIntServer(long intNumber @D0, ^^Interrupt interrupt @A1) - extsub @bank 1 -180 = Cause(^^Interrupt interrupt @A1) - extsub @bank 1 -186 = Allocate(pointer freeList @A0, long byteSize @D0) -> pointer @D0 - extsub @bank 1 -192 = Deallocate(pointer freeList @A0, pointer memoryBlock @A1, long byteSize @D0) - extsub @bank 1 -198 = AllocMem(long byteSize @D0, long requirements @D1) -> pointer @D0 - extsub @bank 1 -204 = AllocAbs(long byteSize @D0, pointer location @A1) -> pointer @D0 - extsub @bank 1 -210 = FreeMem(pointer memoryBlock @A1, long byteSize @D0) - extsub @bank 1 -216 = AvailMem(long requirements @D1) -> long @D0 - extsub @bank 1 -222 = AllocEntry(pointer entry @A0) -> pointer @D0 - extsub @bank 1 -228 = FreeEntry(pointer entry @A0) - extsub @bank 1 -234 = Insert(^^List list @A0, ^^Node node @A1, ^^Node pred @A2) - extsub @bank 1 -240 = AddHead(^^List list @A0, ^^Node node @A1) - extsub @bank 1 -246 = AddTail(^^List list @A0, ^^Node node @A1) - extsub @bank 1 -252 = Remove(^^Node node @A1) - extsub @bank 1 -258 = RemHead(^^List list @A0) -> ^^Node @D0 - extsub @bank 1 -264 = RemTail(^^List list @A0) -> ^^Node @D0 - extsub @bank 1 -270 = Enqueue(^^List list @A0, ^^Node node @A1) - extsub @bank 1 -276 = FindName(^^List list @A0, str name @A1) -> ^^Node @D0 - extsub @bank 1 -282 = AddTask(^^Task task @A1, pointer initPC @A2, pointer finalPC @A3) -> pointer @D0 - extsub @bank 1 -288 = RemTask(^^Task task @A1) - extsub @bank 1 -294 = FindTask(str name @A1) -> ^^Task @D0 - extsub @bank 1 -300 = SetTaskPri(^^Task task @A1, long priority @D0) -> byte @D0 - extsub @bank 1 -306 = SetSignal(long newSignals @D0, long signalSet @D1) -> long @D0 - extsub @bank 1 -312 = SetExcept(long newSignals @D0, long signalSet @D1) -> long @D0 - extsub @bank 1 -318 = Wait(long signalSet @D0) -> long @D0 - extsub @bank 1 -324 = Signal(^^Task task @A1, long signalSet @D0) - extsub @bank 1 -330 = AllocSignal(byte signalNum @D0) -> byte @D0 - extsub @bank 1 -336 = FreeSignal(byte signalNum @D0) - extsub @bank 1 -342 = AllocTrap(long trapNum @D0) -> long @D0 - extsub @bank 1 -348 = FreeTrap(long trapNum @D0) - extsub @bank 1 -354 = AddPort(^^MsgPort port @A1) - extsub @bank 1 -360 = RemPort(^^MsgPort port @A1) - extsub @bank 1 -366 = PutMsg(^^MsgPort port @A0, ^^Message message @A1) - extsub @bank 1 -372 = GetMsg(^^MsgPort port @A0) -> ^^Message @D0 - extsub @bank 1 -378 = ReplyMsg(^^Message message @A1) - extsub @bank 1 -384 = WaitPort(^^MsgPort port @A0) -> ^^Message @D0 - extsub @bank 1 -390 = FindPort(str name @A1) -> ^^MsgPort @D0 - extsub @bank 1 -396 = AddLibrary(^^Library library @A1) - extsub @bank 1 -402 = RemLibrary(^^Library library @A1) - extsub @bank 1 -408 = OldOpenLibrary(str libName @A1) -> ^^Library @D0 - extsub @bank 1 -414 = CloseLibrary(^^Library library @A1) - extsub @bank 1 -420 = SetFunction(^^Library library @A1, long funcOffset @A0, pointer newFunction @D0) -> pointer @D0 - extsub @bank 1 -426 = SumLibrary(^^Library library @A1) - extsub @bank 1 -432 = AddDevice(pointer device @A1) - extsub @bank 1 -438 = RemDevice(pointer device @A1) - extsub @bank 1 -444 = OpenDevice(str devName @A0, long unit @D0, pointer ioRequest @A1, long flags @D1) -> byte @D0 - extsub @bank 1 -450 = CloseDevice(pointer ioRequest @A1) - extsub @bank 1 -456 = DoIO(pointer ioRequest @A1) -> byte @D0 - extsub @bank 1 -462 = SendIO(pointer ioRequest @A1) - extsub @bank 1 -468 = CheckIO(pointer ioRequest @A1) -> pointer @D0 - extsub @bank 1 -474 = WaitIO(pointer ioRequest @A1) -> byte @D0 - extsub @bank 1 -480 = AbortIO(pointer ioRequest @A1) - extsub @bank 1 -486 = AddResource(pointer resource @A1) - extsub @bank 1 -492 = RemResource(pointer resource @A1) - extsub @bank 1 -498 = OpenResource(str resName @A1) -> pointer @D0 - extsub @bank 1 -522 = RawDoFmt(str formatString @A0, pointer dataStream @A1, pointer putChProc @A2, pointer putChData @A3) -> pointer @D0 - extsub @bank 1 -528 = GetCC() -> long @D0 - extsub @bank 1 -534 = TypeOfMem(pointer address @A1) -> long @D0 - extsub @bank 1 -540 = Procure(pointer sigSem @A0, pointer bidMsg @A1) -> long @D0 - extsub @bank 1 -546 = Vacate(pointer sigSem @A0, pointer bidMsg @A1) - extsub @bank 1 -552 = OpenLibrary(str libName @A1, long version @D0) -> ^^Library @D0 - extsub @bank 1 -558 = InitSemaphore(pointer sigSem @A0) - extsub @bank 1 -564 = ObtainSemaphore(pointer sigSem @A0) - extsub @bank 1 -570 = ReleaseSemaphore(pointer sigSem @A0) - extsub @bank 1 -576 = AttemptSemaphore(pointer sigSem @A0) -> long @D0 - extsub @bank 1 -582 = ObtainSemaphoreList(^^List sigSem @A0) - extsub @bank 1 -588 = ReleaseSemaphoreList(^^List sigSem @A0) - extsub @bank 1 -594 = FindSemaphore(str name @A1) -> pointer @D0 - extsub @bank 1 -600 = AddSemaphore(pointer sigSem @A1) - extsub @bank 1 -606 = RemSemaphore(pointer sigSem @A1) - extsub @bank 1 -612 = SumKickData() -> long @D0 - extsub @bank 1 -618 = AddMemList(long size @D0, long attributes @D1, long pri @D2, pointer base @A0, str name @A1) - extsub @bank 1 -624 = CopyMem(pointer source @A0, pointer dest @A1, long size @D0) - extsub @bank 1 -630 = CopyMemQuick(pointer source @A0, pointer dest @A1, long size @D0) - extsub @bank 1 -636 = CacheClearU() - extsub @bank 1 -642 = CacheClearE(pointer address @A0, long length @D0, long caches @D1) - extsub @bank 1 -648 = CacheControl(long cacheBits @D0, long cacheMask @D1) -> long @D0 - extsub @bank 1 -654 = CreateIORequest(^^MsgPort port @A0, long size @D0) -> pointer @D0 - extsub @bank 1 -660 = DeleteIORequest(pointer iorequest @A0) - extsub @bank 1 -666 = CreateMsgPort() -> ^^MsgPort @D0 - extsub @bank 1 -672 = DeleteMsgPort(^^MsgPort port @A0) - extsub @bank 1 -678 = ObtainSemaphoreShared(pointer sigSem @A0) - extsub @bank 1 -684 = AllocVec(long byteSize @D0, long requirements @D1) -> pointer @D0 - extsub @bank 1 -690 = FreeVec(pointer memoryBlock @A1) - extsub @bank 1 -696 = CreatePool(long requirements @D0, long puddleSize @D1, long threshSize @D2) -> pointer @D0 - extsub @bank 1 -702 = DeletePool(pointer poolHeader @A0) - extsub @bank 1 -708 = AllocPooled(pointer poolHeader @A0, long memSize @D0) -> pointer @D0 - extsub @bank 1 -714 = FreePooled(pointer poolHeader @A0, pointer k_memory @A1, long memSize @D0) - extsub @bank 1 -720 = AttemptSemaphoreShared(pointer sigSem @A0) -> long @D0 - extsub @bank 1 -726 = ColdReboot() - extsub @bank 1 -732 = StackSwap(pointer newStack @A0) - extsub @bank 1 -762 = CachePreDMA(pointer address @A0, pointer length @A1, long flags @D0) -> pointer @D0 - extsub @bank 1 -768 = CachePostDMA(pointer address @A0, pointer length @A1, long flags @D0) - extsub @bank 1 -774 = AddMemHandler(^^Interrupt memhand @A1) - extsub @bank 1 -780 = RemMemHandler(^^Interrupt memhand @A1) - extsub @bank 1 -786 = ObtainQuickVector(pointer interruptCode @A0) -> long @D0 - extsub @bank 1 -828 = NewMinList(^^MinList minlist @A0) - - ; ---- struct definitions ---- - - struct IOStdReq { ; total size: 48 - ^^Node Succ ; 0 - ^^Node Pred ; 4 - ubyte Type ; 8 - byte Pri ; 9 - str Name ; 10 - ^^MsgPort ReplyPort ; 14 - uword Length ; 18 - pointer Device ; 20 - pointer Unit ; 24 - uword Command ; 28 - ubyte Flags ; 30 - byte Error ; 31 - long Actual ; 32 - long IOStdReq_Length ; 36 - pointer Data ; 40 - long Offset ; 44 - } - - struct IORequest { ; total size: 32 - ^^Node Succ ; 0 - ^^Node Pred ; 4 - ubyte Type ; 8 - byte Pri ; 9 - str Name ; 10 - ^^MsgPort ReplyPort ; 14 - uword Length ; 18 - pointer Device ; 20 - pointer Unit ; 24 - uword Command ; 28 - ubyte Flags ; 30 - byte Error ; 31 - } - - struct Interrupt { ; total size: 22 - ^^Node Succ ; 0 - ^^Node Pred ; 4 - ubyte Type ; 8 - byte Pri ; 9 - str Name ; 10 - pointer Data ; 14 - pointer Code ; 18 - } - - struct List { ; total size: 14 - ^^Node Head ; 0 - pointer Tail ; 4 - ^^Node TailPred ; 8 - ubyte Type ; 12 - ubyte Pad ; 13 - } - - struct Library { ; total size: 34 - ^^Node Succ ; 0 - ^^Node Pred ; 4 - ubyte Type ; 8 - byte Pri ; 9 - str Name ; 10 - ubyte Flags ; 14 - ubyte Pad ; 15 - uword NegSize ; 16 - uword PosSize ; 18 - uword Version ; 20 - uword Revision ; 22 - str IdString ; 24 - long Sum ; 28 - uword OpenCnt ; 32 - } - - struct Node { ; total size: 14 - ^^Node Succ ; 0 - ^^Node Pred ; 4 - ubyte Type ; 8 - byte Pri ; 9 - str Name ; 10 - } - - struct MinList { ; total size: 12 - ^^MinNode Head ; 0 - pointer Tail ; 4 - ^^MinNode TailPred ; 8 - } - - struct MinNode { ; total size: 8 - ^^MinNode Succ ; 0 - ^^MinNode Pred ; 4 - } - - struct Message { ; total size: 20 - ^^Message Succ ; 0 - ^^Message Pred ; 4 - ubyte Type ; 8 - byte Pri ; 9 - str Name ; 10 - ^^MsgPort ReplyPort ; 14 - uword Length ; 18 - } - - struct MsgPort { ; total size: 34 - ^^Node Succ ; 0 - ^^Node Pred ; 4 - ubyte Type ; 8 - byte Pri ; 9 - str Name ; 10 - ubyte Flags ; 14 - ubyte SigBit ; 15 - pointer SigTask ; 16 - ^^Node Head ; 20 - ^^Node Tail ; 24 - ^^Node TailPred ; 28 - ubyte List_Type ; 32 - ubyte Pad ; 33 - } - - struct Task { ; total size: 92 - ^^Node Succ ; 0 - ^^Node Pred ; 4 - ubyte Type ; 8 - byte Pri ; 9 - str Name ; 10 - ubyte Flags ; 14 - ubyte State ; 15 - byte IDNestCnt ; 16 - byte TDNestCnt ; 17 - long SigAlloc ; 18 - long SigWait ; 22 - long SigRecvd ; 26 - long SigExcept ; 30 - uword TrapAlloc ; 34 - uword TrapAble ; 36 - pointer ExceptData ; 38 - pointer ExceptCode ; 42 - pointer TrapData ; 46 - pointer TrapCode ; 50 - pointer SPReg ; 54 - pointer SPLower ; 58 - pointer SPUpper ; 62 - pointer Switch ; 66 - pointer Launch ; 70 - ^^Node Head ; 74 - ^^Node Tail ; 78 - ^^Node TailPred ; 82 - ubyte List_Type ; 86 - ubyte Pad ; 87 - pointer UserData ; 88 - } - - ; ---- constants ---- - const long ACPU_BusErr = $80000002 - const long ACPU_AddressErr = $80000003 - const long ACPU_InstErr = $80000004 - const long ACPU_DivZero = $80000005 - const long ACPU_CHK = $80000006 - const long ACPU_TRAPV = $80000007 - const long ACPU_PrivErr = $80000008 - const long ACPU_Trace = $80000009 - const long ACPU_LineA = $8000000A - const long ACPU_LineF = $8000000B - const long ACPU_Format = $8000000E - const long ACPU_Spurious = $80000018 - const long ACPU_AutoVec1 = $80000019 - const long ACPU_AutoVec2 = $8000001A - const long ACPU_AutoVec3 = $8000001B - const long ACPU_AutoVec4 = $8000001C - const long ACPU_AutoVec5 = $8000001D - const long ACPU_AutoVec6 = $8000001E - const long ACPU_AutoVec7 = $8000001F - const long AT_DeadEnd = $80000000 - const long AT_Recovery = $00000000 - const long AG_NoMemory = $00010000 - const long AG_MakeLib = $00020000 - const long AG_OpenLib = $00030000 - const long AG_OpenDev = $00040000 - const long AG_OpenRes = $00050000 - const long AG_IOError = $00060000 - const long AG_NoSignal = $00070000 - const long AG_BadParm = $00080000 - const long AG_CloseLib = $00090000 - const long AG_CloseDev = $000A0000 - const long AG_ProcCreate = $000B0000 - const long AO_ExecLib = $00008001 - const long AO_GraphicsLib = $00008002 - const long AO_LayersLib = $00008003 - const long AO_Intuition = $00008004 - const long AO_MathLib = $00008005 - const long AO_DOSLib = $00008007 - const long AO_RAMLib = $00008008 - const long AO_IconLib = $00008009 - const long AO_ExpansionLib = $0000800A - const long AO_DiskfontLib = $0000800B - const long AO_UtilityLib = $0000800C - const long AO_KeyMapLib = $0000800D - const long AO_AudioDev = $00008010 - const long AO_ConsoleDev = $00008011 - const long AO_GamePortDev = $00008012 - const long AO_KeyboardDev = $00008013 - const long AO_TrackDiskDev = $00008014 - const long AO_TimerDev = $00008015 - const long AO_CIARsrc = $00008020 - const long AO_DiskRsrc = $00008021 - const long AO_MiscRsrc = $00008022 - const long AO_BootStrap = $00008030 - const long AO_Workbench = $00008031 - const long AO_DiskCopy = $00008032 - const long AO_GadTools = $00008033 - const long AO_Unknown = $00008035 - const long AN_ExecLib = $01000000 - const long AN_ExcptVect = $01000001 - const long AN_BaseChkSum = $01000002 - const long AN_LibChkSum = $01000003 - const long AN_MemCorrupt = $81000005 - const long AN_IntrMem = $81000006 - const long AN_InitAPtr = $01000007 - const long AN_SemCorrupt = $01000008 - const long AN_FreeTwice = $01000009 - const long AN_BogusExcpt = $8100000A - const long AN_IOUsedTwice = $0100000B - const long AN_MemoryInsane = $0100000C - const long AN_IOAfterClose = $0100000D - const long AN_StackProbe = $0100000E - const long AN_BadFreeAddr = $0100000F - const long AN_BadSemaphore = $01000010 - const long AN_BadQuickInt = $810000FF - const long AN_AVLNotImpl = $01000011 - const long AN_TreeNotImpl = $01000012 - const long AN_GraphicsLib = $02000000 - const long AN_GfxNoMem = $82010000 - const long AN_GfxNoMemMspc = $82010001 - const long AN_LongFrame = $82010006 - const long AN_ShortFrame = $82010007 - const long AN_TextTmpRas = $02010009 - const long AN_BltBitMap = $8201000A - const long AN_RegionMemory = $8201000B - const long AN_MakeVPort = $82010030 - const long AN_GfxNewError = $0200000C - const long AN_GfxFreeError = $0200000D - const long AN_GfxNoLCM = $82011234 - const long AN_ObsoleteFont = $02000401 - const long AN_LayersLib = $03000000 - const long AN_LayersNoMem = $83010000 - const long AN_Intuition = $04000000 - const long AN_GadgetType = $84000001 - const long AN_BadGadget = $04000001 - const long AN_CreatePort = $84010002 - const long AN_ItemAlloc = $04010003 - const long AN_SubAlloc = $04010004 - const long AN_PlaneAlloc = $84010005 - const long AN_ItemBoxTop = $84000006 - const long AN_OpenScreen = $84010007 - const long AN_OpenScrnRast = $84010008 - const long AN_SysScrnType = $84000009 - const long AN_AddSWGadget = $8401000A - const long AN_OpenWindow = $8401000B - const long AN_BadState = $8400000C - const long AN_BadMessage = $8400000D - const long AN_WeirdEcho = $8400000E - const long AN_NoConsole = $8400000F - const long AN_NoISem = $04000010 - const long AN_ISemOrder = $04000011 - const long AN_DeadIntui = $04000012 - const long AN_MathLib = $05000000 - const long AN_DOSLib = $07000000 - const long AN_StartMem = $07010001 - const long AN_EndTask = $07000002 - const long AN_QPktFail = $07000003 - const long AN_AsyncPkt = $07000004 - const long AN_FreeVec = $07000005 - const long AN_DiskBlkSeq = $07000006 - const long AN_BitMap = $07000007 - const long AN_KeyFree = $07000008 - const long AN_BadChkSum = $07000009 - const long AN_DiskError = $0700000A - const long AN_KeyRange = $0700000B - const long AN_BadOverlay = $0700000C - const long AN_BadInitFunc = $0700000D - const long AN_FileReclosed = $0700000E - const long AN_CLIObsolete = $0700000F - const long AN_RAMLib = $08000000 - const long AN_BadSegList = $08000001 - const long AN_IconLib = $09000000 - const long AN_ExpansionLib = $0A000000 - const long AN_BadExpansionFree = $0A000001 - const long AN_DiskfontLib = $0B000000 - const long AN_AudioDev = $10000000 - const long AN_ConsoleDev = $11000000 - const long AN_NoWindow = $11000001 - const long AN_GamePortDev = $12000000 - const long AN_KeyboardDev = $13000000 - const long AN_TrackDiskDev = $14000000 - const long AN_TDCalibSeek = $14000001 - const long AN_TDDelay = $14000002 - const long AN_TimerDev = $15000000 - const long AN_TMBadReq = $15000001 - const long AN_TMBadSupply = $15000002 - const long AN_CIARsrc = $20000000 - const long AN_DiskRsrc = $21000000 - const long AN_DRHasDisk = $21000001 - const long AN_DRIntNoAct = $21000002 - const long AN_MiscRsrc = $22000000 - const long AN_BootStrap = $30000000 - const long AN_BootError = $30000001 - const long AN_Workbench = $31000000 - const long AN_NoFonts = $B1000001 - const long AN_WBBadStartupMsg1 = $31000001 - const long AN_WBBadStartupMsg2 = $31000002 - const long AN_WBBadIOMsg = $31000003 - const long AN_WBReLayoutToolMenu = $B1010009 - const long AN_DiskCopy = $32000000 - const long AN_GadTools = $33000000 - const long AN_UtilityLib = $34000000 - const long AN_Unknown = $35000000 - const ubyte UNITB_ACTIVE = 0 - const ubyte UNITF_ACTIVE = $0001 - const ubyte UNITB_INTASK = 1 - const ubyte UNITF_INTASK = $0002 - const long IOERR_OPENFAIL = -1 - const long IOERR_ABORTED = -2 - const long IOERR_NOCMD = -3 - const long IOERR_BADLENGTH = -4 - const long IOERR_BADADDRESS = -5 - const long IOERR_UNITBUSY = -6 - const long IOERR_SELFTEST = -7 - const ubyte AFB_68010 = 0 - const ubyte AFF_68010 = $0001 - const ubyte AFB_68020 = 1 - const ubyte AFF_68020 = $0002 - const ubyte AFB_68030 = 2 - const ubyte AFF_68030 = $0004 - const ubyte AFB_68040 = 3 - const ubyte AFF_68040 = $0008 - const ubyte AFB_68881 = 4 - const ubyte AFF_68881 = $0010 - const ubyte AFB_68882 = 5 - const ubyte AFF_68882 = $0020 - const ubyte AFB_FPU40 = 6 - const ubyte AFF_FPU40 = $0040 - const ubyte AFB_68060 = 7 - const ubyte AFF_68060 = $0080 - const ubyte AFB_FPGA = 10 - const uword AFF_FPGA = $0400 - const ubyte AFB_PRIVATE = 15 - const uword AFF_PRIVATE = $8000 - const ubyte CACRB_EnableI = 0 - const ubyte CACRF_EnableI = $0001 - const ubyte CACRB_FreezeI = 1 - const ubyte CACRF_FreezeI = $0002 - const ubyte CACRB_ClearI = 3 - const ubyte CACRF_ClearI = $0008 - const ubyte CACRB_IBE = 4 - const ubyte CACRF_IBE = $0010 - const ubyte CACRB_EnableD = 8 - const uword CACRF_EnableD = $0100 - const ubyte CACRB_FreezeD = 9 - const uword CACRF_FreezeD = $0200 - const ubyte CACRB_ClearD = 11 - const uword CACRF_ClearD = $0800 - const ubyte CACRB_DBE = 12 - const uword CACRF_DBE = $1000 - const ubyte CACRB_WriteAllocate = 13 - const uword CACRF_WriteAllocate = $2000 - const ubyte CACRB_EnableE = 30 - const long CACRF_EnableE = $40000000 - const ubyte CACRB_CopyBack = 31 - const long CACRF_CopyBack = $80000000 - const ubyte DMAB_Continue = 1 - const ubyte DMAF_Continue = $0002 - const ubyte DMAB_NoModify = 2 - const ubyte DMAF_NoModify = $0004 - const ubyte DMAB_ReadFromRAM = 3 - const ubyte DMAF_ReadFromRAM = $0008 - const ubyte SB_SAR = 15 - const uword SF_SAR = $8000 - const ubyte SB_TQE = 14 - const uword SF_TQE = $4000 - const ubyte SB_SINT = 13 - const uword SF_SINT = $2000 - const ubyte SIH_PRIMASK = $0F0 - const ubyte SIH_QUEUES = $0005 - const ubyte INTB_NMI = 15 - const uword INTF_NMI = $8000 - const ubyte IOB_QUICK = 0 - const ubyte IOF_QUICK = $0001 - const uword CMD_INVALID = $0000 - const uword CMD_RESET = $0001 - const uword CMD_READ = $0002 - const uword CMD_WRITE = $0003 - const uword CMD_UPDATE = $0004 - const uword CMD_CLEAR = $0005 - const uword CMD_STOP = $0006 - const uword CMD_START = $0007 - const uword CMD_FLUSH = $0008 - const uword CMD_NONSTD = $0009 - const ubyte LIB_VECTSIZE = $0006 - const ubyte LIB_RESERVED = $0004 - const ubyte LIBB_SUMMING = 0 - const ubyte LIBF_SUMMING = $0001 - const ubyte LIBB_CHANGED = 1 - const ubyte LIBF_CHANGED = $0002 - const ubyte LIBB_SUMUSED = 2 - const ubyte LIBF_SUMUSED = $0004 - const ubyte LIBB_DELEXP = 3 - const ubyte LIBF_DELEXP = $0008 - const ubyte LIBB_EXP0CNT = 4 - const ubyte LIBF_EXP0CNT = $0010 - const ubyte MEMF_ANY = $0000 - const ubyte MEMB_PUBLIC = 0 - const ubyte MEMF_PUBLIC = $0001 - const ubyte MEMB_CHIP = 1 - const ubyte MEMF_CHIP = $0002 - const ubyte MEMB_FAST = 2 - const ubyte MEMF_FAST = $0004 - const ubyte MEMB_LOCAL = 8 - const uword MEMF_LOCAL = $0100 - const ubyte MEMB_24BITDMA = 9 - const uword MEMF_24BITDMA = $0200 - const ubyte MEMB_KICK = 10 - const uword MEMF_KICK = $0400 - const ubyte MEMB_CLEAR = 16 - const long MEMF_CLEAR = $00010000 - const ubyte MEMB_LARGEST = 17 - const long MEMF_LARGEST = $00020000 - const ubyte MEMB_REVERSE = 18 - const long MEMF_REVERSE = $00040000 - const ubyte MEMB_TOTAL = 19 - const long MEMF_TOTAL = $00080000 - const ubyte MEMB_NO_EXPUNGE = 31 - const long MEMF_NO_EXPUNGE = $80000000 - const ubyte MEM_BLOCKSIZE = $0008 - const ubyte MEMHB_RECYCLE = 0 - const ubyte MEMHF_RECYCLE = $0001 - const ubyte MEM_DID_NOTHING = $0000 - const long MEM_ALL_DONE = -1 - const ubyte MEM_TRY_AGAIN = $0001 - const ubyte NT_UNKNOWN = $0000 - const ubyte NT_TASK = $0001 - const ubyte NT_INTERRUPT = $0002 - const ubyte NT_DEVICE = $0003 - const ubyte NT_MSGPORT = $0004 - const ubyte NT_MESSAGE = $0005 - const ubyte NT_FREEMSG = $0006 - const ubyte NT_REPLYMSG = $0007 - const ubyte NT_RESOURCE = $0008 - const ubyte NT_LIBRARY = $0009 - const ubyte NT_MEMORY = $000a - const ubyte NT_SOFTINT = $000b - const ubyte NT_FONT = $000c - const ubyte NT_PROCESS = $000d - const ubyte NT_SEMAPHORE = $000e - const ubyte NT_SIGNALSEM = $000f - const ubyte NT_BOOTNODE = $0010 - const ubyte NT_KICKMEM = $0011 - const ubyte NT_GRAPHICS = $0012 - const ubyte NT_DEATHMESSAGE = $0013 - const ubyte NT_USER = $00fe - const ubyte NT_EXTENDED = $00ff - const ubyte PF_ACTION = $0003 - const ubyte PA_SIGNAL = $0000 - const ubyte PA_SOFTINT = $0001 - const ubyte PA_IGNORE = $0002 - const uword RTC_MATCHWORD = $4AFC - const ubyte RTB_COLDSTART = 0 - const ubyte RTF_COLDSTART = $0001 - const ubyte RTB_SINGLETASK = 1 - const ubyte RTF_SINGLETASK = $0002 - const ubyte RTB_AFTERDOS = 2 - const ubyte RTF_AFTERDOS = $0004 - const ubyte RTB_AUTOINIT = 7 - const ubyte RTF_AUTOINIT = $0080 - const ubyte RTW_NEVER = $0000 - const ubyte RTW_COLDSTART = $0001 - const ubyte EOS = $0000 - const ubyte BELL = $0007 - const ubyte LF = $000a - const ubyte CR = $000d - const ubyte BS = $0008 - const ubyte DEL = $7F - const ubyte TB_PROCTIME = 0 - const ubyte TF_PROCTIME = $0001 - const ubyte TB_ETASK = 3 - const ubyte TF_ETASK = $0008 - const ubyte TB_STACKCHK = 4 - const ubyte TF_STACKCHK = $0010 - const ubyte TB_EXCEPT = 5 - const ubyte TF_EXCEPT = $0020 - const ubyte TB_SWITCH = 6 - const ubyte TF_SWITCH = $0040 - const ubyte TB_LAUNCH = 7 - const ubyte TF_LAUNCH = $0080 - const ubyte TS_INVALID = $0000 - const ubyte SIGB_ABORT = 0 - const ubyte SIGF_ABORT = $0001 - const ubyte SIGB_CHILD = 1 - const ubyte SIGF_CHILD = $0002 - const ubyte SIGB_BLIT = 4 - const ubyte SIGF_BLIT = $0010 - const ubyte SIGB_SINGLE = 4 - const ubyte SIGF_SINGLE = $0010 - const ubyte SIGB_INTUITION = 5 - const ubyte SIGF_INTUITION = $0020 - const ubyte SIGB_NET = 7 - const ubyte SIGF_NET = $0080 - const ubyte SIGB_DOS = 8 - const uword SIGF_DOS = $0100 - const uword SYS_SIGALLOC = $0FFFF - const uword SYS_TRAPALLOC = $08000 - const ubyte INCLUDE_VERSION = $002f - const ubyte LIBRARY_MINIMUM = $0021 - const long ERR_OPENDEVICE = -1 - const ubyte MEM_BLOCKMASK = $0007 - const ubyte NL = $000a - const ubyte TS_ADDED = $0001 - const ubyte TS_RUN = $0002 - const ubyte TS_READY = $0003 - const ubyte TS_WAIT = $0004 - const ubyte TS_EXCEPT = $0005 - const ubyte TS_REMOVED = $0006 + %option no_symbol_prefixing, ignore_unused } -;; End of auto-generated exec_lib.sfd diff --git a/compiler/res/prog8lib/amiga500/graphics.p8 b/compiler/res/prog8lib/amiga500/graphics.p8 index e94b2a8cc..b609c9e4e 100644 --- a/compiler/res/prog8lib/amiga500/graphics.p8 +++ b/compiler/res/prog8lib/amiga500/graphics.p8 @@ -1,1052 +1,5 @@ -;; Auto-generated from graphics_lib.sfd and graphics_lib.i -;; Library base: _GfxBase in prog8: sys.GfxBase -;; Bank: 3 -;; Functions: 163 - -%import exec -%import utility +%import shared_amiga_graphics graphics { - %option no_symbol_prefixing - extsub @bank 3 -30 = BltBitMap(^^BitMap srcBitMap @A0, word xSrc @D0, word ySrc @D1, ^^BitMap destBitMap @A1, word xDest @D2, word yDest @D3, word xSize @D4, word ySize @D5, ubyte minterm @D6, ubyte mask @D7, pointer tempA @A2) -> long @D0 - extsub @bank 3 -36 = BltTemplate(long source @A0, word xSrc @D0, word srcMod @D1, ^^RastPort destRP @A1, word xDest @D2, word yDest @D3, word xSize @D4, word ySize @D5) - extsub @bank 3 -42 = ClearEOL(^^RastPort rp @A1) - extsub @bank 3 -48 = ClearScreen(^^RastPort rp @A1) - extsub @bank 3 -54 = TextLength(^^RastPort rp @A1, str string @A0, uword count @D0) -> word @D0 - extsub @bank 3 -60 = Text(^^RastPort rp @A1, str string @A0, uword count @D0) -> long @D0 - extsub @bank 3 -66 = SetFont(^^RastPort rp @A1, ^^TextFont textFont @A0) -> long @D0 - extsub @bank 3 -72 = OpenFont(^^TextAttr textAttr @A0) -> ^^TextFont @D0 - extsub @bank 3 -78 = CloseFont(^^TextFont textFont @A1) - extsub @bank 3 -84 = AskSoftStyle(^^RastPort rp @A1) -> long @D0 - extsub @bank 3 -90 = SetSoftStyle(^^RastPort rp @A1, long style @D0, long enable @D1) -> long @D0 - extsub @bank 3 -96 = AddBob(pointer bob @A0, ^^RastPort rp @A1) - extsub @bank 3 -102 = AddVSprite(pointer vSprite @A0, ^^RastPort rp @A1) - extsub @bank 3 -108 = DoCollision(^^RastPort rp @A1) - extsub @bank 3 -114 = DrawGList(^^RastPort rp @A1, pointer vp @A0) - extsub @bank 3 -120 = InitGels(pointer head @A0, pointer tail @A1, pointer gelsInfo @A2) - extsub @bank 3 -126 = InitMasks(pointer vSprite @A0) - extsub @bank 3 -132 = RemIBob(pointer bob @A0, ^^RastPort rp @A1, pointer vp @A2) - extsub @bank 3 -138 = RemVSprite(pointer vSprite @A0) - extsub @bank 3 -144 = SetCollision(long num @D0, pointer routine @A0, pointer gelsInfo @A1) - extsub @bank 3 -150 = SortGList(^^RastPort rp @A1) - extsub @bank 3 -156 = AddAnimOb(pointer anOb @A0, pointer anKey @A1, ^^RastPort rp @A2) - extsub @bank 3 -162 = Animate(pointer anKey @A0, ^^RastPort rp @A1) - extsub @bank 3 -168 = GetGBuffers(pointer anOb @A0, ^^RastPort rp @A1, bool flag @D0) -> bool @D0 - extsub @bank 3 -174 = InitGMasks(pointer anOb @A0) - extsub @bank 3 -180 = DrawEllipse(^^RastPort rp @A1, word xCenter @D0, word yCenter @D1, word a @D2, word b @D3) - extsub @bank 3 -186 = AreaEllipse(^^RastPort rp @A1, word xCenter @D0, word yCenter @D1, word a @D2, word b @D3) -> long @D0 - extsub @bank 3 -192 = LoadRGB4(pointer vp @A0, pointer colors @A1, word count @D0) - extsub @bank 3 -198 = InitRastPort(^^RastPort rp @A1) - extsub @bank 3 -204 = InitVPort(pointer vp @A0) - extsub @bank 3 -210 = MrgCop(^^View view @A1) -> long @D0 - extsub @bank 3 -216 = MakeVPort(^^View view @A0, pointer vp @A1) -> long @D0 - extsub @bank 3 -222 = LoadView(^^View view @A1) - extsub @bank 3 -228 = WaitBlit() - extsub @bank 3 -234 = SetRast(^^RastPort rp @A1, ubyte pen @D0) - extsub @bank 3 -240 = Move(^^RastPort rp @A1, word x @D0, word y @D1) - extsub @bank 3 -246 = Draw(^^RastPort rp @A1, word x @D0, word y @D1) - extsub @bank 3 -252 = AreaMove(^^RastPort rp @A1, word x @D0, word y @D1) -> long @D0 - extsub @bank 3 -258 = AreaDraw(^^RastPort rp @A1, word x @D0, word y @D1) -> long @D0 - extsub @bank 3 -264 = AreaEnd(^^RastPort rp @A1) -> long @D0 - extsub @bank 3 -270 = WaitTOF() - extsub @bank 3 -276 = QBlit(pointer blit @A1) - extsub @bank 3 -282 = InitArea(^^AreaInfo areaInfo @A0, pointer vectorBuffer @A1, word maxVectors @D0) - extsub @bank 3 -288 = SetRGB4(pointer vp @A0, word index @D0, ubyte red @D1, ubyte green @D2, ubyte blue @D3) - extsub @bank 3 -294 = QBSBlit(pointer blit @A1) - extsub @bank 3 -300 = BltClear(pointer memBlock @A1, long byteCount @D0, long flags @D1) - extsub @bank 3 -306 = RectFill(^^RastPort rp @A1, word xMin @D0, word yMin @D1, word xMax @D2, word yMax @D3) - extsub @bank 3 -312 = BltPattern(^^RastPort rp @A1, long mask @A0, word xMin @D0, word yMin @D1, word xMax @D2, word yMax @D3, uword maskBPR @D4) - extsub @bank 3 -318 = ReadPixel(^^RastPort rp @A1, word x @D0, word y @D1) -> long @D0 - extsub @bank 3 -324 = WritePixel(^^RastPort rp @A1, word x @D0, word y @D1) -> long @D0 - extsub @bank 3 -330 = Flood(^^RastPort rp @A1, long mode @D2, word x @D0, word y @D1) -> bool @D0 - extsub @bank 3 -336 = PolyDraw(^^RastPort rp @A1, word count @D0, pointer polyTable @A0) - extsub @bank 3 -342 = SetAPen(^^RastPort rp @A1, ubyte pen @D0) - extsub @bank 3 -348 = SetBPen(^^RastPort rp @A1, ubyte pen @D0) - extsub @bank 3 -354 = SetDrMd(^^RastPort rp @A1, ubyte drawMode @D0) - extsub @bank 3 -360 = InitView(^^View view @A1) - extsub @bank 3 -366 = CBump(pointer copList @A1) - extsub @bank 3 -372 = CMove(pointer copList @A1, pointer destination @D0, word data @D1) -> long @D0 - extsub @bank 3 -378 = CWait(pointer copList @A1, word v @D0, word h @D1) -> long @D0 - extsub @bank 3 -384 = VBeamPos() -> long @D0 - extsub @bank 3 -390 = InitBitMap(^^BitMap bitMap @A0, byte depth @D0, word width @D1, word height @D2) - extsub @bank 3 -396 = ScrollRaster(^^RastPort rp @A1, word dx @D0, word dy @D1, word xMin @D2, word yMin @D3, word xMax @D4, word yMax @D5) - extsub @bank 3 -402 = WaitBOVP(pointer vp @A0) - extsub @bank 3 -408 = GetSprite(pointer sprite @A0, word num @D0) -> word @D0 - extsub @bank 3 -414 = FreeSprite(word num @D0) - extsub @bank 3 -420 = ChangeSprite(pointer vp @A0, pointer sprite @A1, pointer newData @A2) - extsub @bank 3 -426 = MoveSprite(pointer vp @A0, pointer sprite @A1, word x @D0, word y @D1) - extsub @bank 3 -432 = LockLayerRom(^^Layer layer @A5) - extsub @bank 3 -438 = UnlockLayerRom(^^Layer layer @A5) - extsub @bank 3 -444 = SyncSBitMap(^^Layer layer @A0) - extsub @bank 3 -450 = CopySBitMap(^^Layer layer @A0) - extsub @bank 3 -456 = OwnBlitter() - extsub @bank 3 -462 = DisownBlitter() - extsub @bank 3 -468 = InitTmpRas(^^TmpRas tmpRas @A0, pointer buffer @A1, long size @D0) -> ^^TmpRas @D0 - extsub @bank 3 -474 = AskFont(^^RastPort rp @A1, ^^TextAttr textAttr @A0) - extsub @bank 3 -480 = AddFont(^^TextFont textFont @A1) - extsub @bank 3 -486 = RemFont(^^TextFont textFont @A1) - extsub @bank 3 -492 = AllocRaster(uword width @D0, uword height @D1) -> pointer @D0 - extsub @bank 3 -498 = FreeRaster(pointer p @A0, uword width @D0, uword height @D1) - extsub @bank 3 -504 = AndRectRegion(pointer region @A0, pointer rectangle @A1) - extsub @bank 3 -510 = OrRectRegion(pointer region @A0, pointer rectangle @A1) -> bool @D0 - extsub @bank 3 -516 = NewRegion() -> pointer @D0 - extsub @bank 3 -522 = ClearRectRegion(pointer region @A0, pointer rectangle @A1) -> bool @D0 - extsub @bank 3 -528 = ClearRegion(pointer region @A0) - extsub @bank 3 -534 = DisposeRegion(pointer region @A0) - extsub @bank 3 -540 = FreeVPortCopLists(pointer vp @A0) - extsub @bank 3 -546 = FreeCopList(pointer copList @A0) - extsub @bank 3 -552 = ClipBlit(^^RastPort srcRP @A0, word xSrc @D0, word ySrc @D1, ^^RastPort destRP @A1, word xDest @D2, word yDest @D3, word xSize @D4, word ySize @D5, ubyte minterm @D6) - extsub @bank 3 -558 = XorRectRegion(pointer region @A0, pointer rectangle @A1) -> bool @D0 - extsub @bank 3 -564 = FreeCprList(pointer cprList @A0) - extsub @bank 3 -570 = GetColorMap(long entries @D0) -> ^^ColorMap @D0 - extsub @bank 3 -576 = FreeColorMap(^^ColorMap colorMap @A0) - extsub @bank 3 -582 = GetRGB4(^^ColorMap colorMap @A0, long entry @D0) -> long @D0 - extsub @bank 3 -588 = ScrollVPort(pointer vp @A0) - extsub @bank 3 -594 = UCopperListInit(pointer uCopList @A0, word n @D0) -> pointer @D0 - extsub @bank 3 -600 = FreeGBuffers(pointer anOb @A0, ^^RastPort rp @A1, bool flag @D0) - extsub @bank 3 -606 = BltBitMapRastPort(^^BitMap srcBitMap @A0, word xSrc @D0, word ySrc @D1, ^^RastPort destRP @A1, word xDest @D2, word yDest @D3, word xSize @D4, word ySize @D5, ubyte minterm @D6) - extsub @bank 3 -612 = OrRegionRegion(pointer srcRegion @A0, pointer destRegion @A1) -> bool @D0 - extsub @bank 3 -618 = XorRegionRegion(pointer srcRegion @A0, pointer destRegion @A1) -> bool @D0 - extsub @bank 3 -624 = AndRegionRegion(pointer srcRegion @A0, pointer destRegion @A1) -> bool @D0 - extsub @bank 3 -630 = SetRGB4CM(^^ColorMap colorMap @A0, word index @D0, ubyte red @D1, ubyte green @D2, ubyte blue @D3) - extsub @bank 3 -636 = BltMaskBitMapRastPort(^^BitMap srcBitMap @A0, word xSrc @D0, word ySrc @D1, ^^RastPort destRP @A1, word xDest @D2, word yDest @D3, word xSize @D4, word ySize @D5, ubyte minterm @D6, long bltMask @A2) - extsub @bank 3 -654 = AttemptLockLayerRom(^^Layer layer @A5) -> bool @D0 - extsub @bank 3 -660 = GfxNew(long gfxNodeType @D0) -> pointer @D0 - extsub @bank 3 -666 = GfxFree(pointer gfxNodePtr @A0) - extsub @bank 3 -672 = GfxAssociate(pointer associateNode @A0, pointer gfxNodePtr @A1) - extsub @bank 3 -678 = BitMapScale(pointer bitScaleArgs @A0) - extsub @bank 3 -684 = ScalerDiv(uword factor @D0, uword numerator @D1, uword denominator @D2) -> uword @D0 - extsub @bank 3 -690 = TextExtent(^^RastPort rp @A1, str string @A0, word count @D0, pointer textExtent @A2) -> word @D0 - extsub @bank 3 -696 = TextFit(^^RastPort rp @A1, str string @A0, uword strLen @D0, pointer textExtent @A2, pointer constrainingExtent @A3, word strDirection @D1, uword constrainingBitWidth @D2, uword constrainingBitHeight @D3) -> long @D0 - extsub @bank 3 -702 = GfxLookUp(pointer associateNode @A0) -> pointer @D0 - extsub @bank 3 -708 = VideoControl(^^ColorMap colorMap @A0, pointer tagarray @A1) -> bool @D0 - extsub @bank 3 -714 = OpenMonitor(str monitorName @A1, long displayID @D0) -> pointer @D0 - extsub @bank 3 -720 = CloseMonitor(pointer monitorSpec @A0) -> bool @D0 - extsub @bank 3 -726 = FindDisplayInfo(long displayID @D0) -> pointer @D0 - extsub @bank 3 -732 = NextDisplayInfo(long displayID @D0) -> long @D0 - extsub @bank 3 -756 = GetDisplayInfoData(pointer handle @A0, pointer buf @A1, long size @D0, long tagID @D1, long displayID @D2) -> long @D0 - extsub @bank 3 -762 = FontExtent(^^TextFont font @A0, pointer fontExtent @A1) - extsub @bank 3 -768 = ReadPixelLine8(^^RastPort rp @A0, uword xstart @D0, uword ystart @D1, uword width @D2, pointer array @A2, ^^RastPort tempRP @A1) -> long @D0 - extsub @bank 3 -774 = WritePixelLine8(^^RastPort rp @A0, uword xstart @D0, uword ystart @D1, uword width @D2, pointer array @A2, ^^RastPort tempRP @A1) -> long @D0 - extsub @bank 3 -780 = ReadPixelArray8(^^RastPort rp @A0, uword xstart @D0, uword ystart @D1, uword xstop @D2, uword ystop @D3, pointer array @A2, ^^RastPort temprp @A1) -> long @D0 - extsub @bank 3 -786 = WritePixelArray8(^^RastPort rp @A0, uword xstart @D0, uword ystart @D1, uword xstop @D2, uword ystop @D3, pointer array @A2, ^^RastPort temprp @A1) -> long @D0 - extsub @bank 3 -792 = GetVPModeID(pointer vp @A0) -> long @D0 - extsub @bank 3 -798 = ModeNotAvailable(long modeID @D0) -> long @D0 - extsub @bank 3 -804 = WeighTAMatch(^^TextAttr reqTextAttr @A0, ^^TextAttr targetTextAttr @A1, pointer targetTags @A2) -> word @D0 - extsub @bank 3 -810 = EraseRect(^^RastPort rp @A1, word xMin @D0, word yMin @D1, word xMax @D2, word yMax @D3) - extsub @bank 3 -816 = ExtendFont(^^TextFont font @A0, pointer fontTags @A1) -> long @D0 - extsub @bank 3 -822 = StripFont(^^TextFont font @A0) - extsub @bank 3 -828 = CalcIVG(^^View v @A0, pointer vp @A1) -> uword @D0 - extsub @bank 3 -834 = AttachPalExtra(^^ColorMap cm @A0, pointer vp @A1) -> long @D0 - extsub @bank 3 -840 = ObtainBestPenA(^^ColorMap cm @A0, long r @D1, long g @D2, long b @D3, pointer tags @A1) -> long @D0 - extsub @bank 3 -852 = SetRGB32(pointer vp @A0, long n @D0, long r @D1, long g @D2, long b @D3) - extsub @bank 3 -858 = GetAPen(^^RastPort rp @A0) -> long @D0 - extsub @bank 3 -864 = GetBPen(^^RastPort rp @A0) -> long @D0 - extsub @bank 3 -870 = GetDrMd(^^RastPort rp @A0) -> long @D0 - extsub @bank 3 -876 = GetOutlinePen(^^RastPort rp @A0) -> long @D0 - extsub @bank 3 -882 = LoadRGB32(pointer vp @A0, pointer table @A1) - extsub @bank 3 -888 = SetChipRev(long want @D0) -> long @D0 - extsub @bank 3 -894 = SetABPenDrMd(^^RastPort rp @A1, long apen @D0, long bpen @D1, long drawmode @D2) - extsub @bank 3 -900 = GetRGB32(^^ColorMap cm @A0, long firstcolor @D0, long ncolors @D1, pointer table @A1) - extsub @bank 3 -918 = AllocBitMap(long sizex @D0, long sizey @D1, long depth @D2, long flags @D3, ^^BitMap friend_bitmap @A0) -> ^^BitMap @D0 - extsub @bank 3 -924 = FreeBitMap(^^BitMap bm @A0) - extsub @bank 3 -930 = GetExtSpriteA(pointer ss @A2, pointer tags @A1) -> long @D0 - extsub @bank 3 -936 = CoerceMode(pointer vp @A0, long monitorid @D0, long flags @D1) -> long @D0 - extsub @bank 3 -942 = ChangeVPBitMap(pointer vp @A0, ^^BitMap bm @A1, pointer db @A2) - extsub @bank 3 -948 = ReleasePen(^^ColorMap cm @A0, long n @D0) - extsub @bank 3 -954 = ObtainPen(^^ColorMap cm @A0, long n @D0, long r @D1, long g @D2, long b @D3, long f @D4) -> long @D0 - extsub @bank 3 -960 = GetBitMapAttr(^^BitMap bm @A0, long attrnum @D1) -> long @D0 - extsub @bank 3 -966 = AllocDBufInfo(pointer vp @A0) -> pointer @D0 - extsub @bank 3 -972 = FreeDBufInfo(pointer dbi @A1) - extsub @bank 3 -978 = SetOutlinePen(^^RastPort rp @A0, long pen @D0) -> long @D0 - extsub @bank 3 -984 = SetWriteMask(^^RastPort rp @A0, long msk @D0) -> long @D0 - extsub @bank 3 -990 = SetMaxPen(^^RastPort rp @A0, long maxpen @D0) - extsub @bank 3 -996 = SetRGB32CM(^^ColorMap cm @A0, long n @D0, long r @D1, long g @D2, long b @D3) - extsub @bank 3 -1002 = ScrollRasterBF(^^RastPort rp @A1, word dx @D0, word dy @D1, word xMin @D2, word yMin @D3, word xMax @D4, word yMax @D5) - extsub @bank 3 -1008 = FindColor(^^ColorMap cm @A3, long r @D1, long g @D2, long b @D3, long maxcolor @D4) -> long @D0 - extsub @bank 3 -1020 = AllocSpriteDataA(^^BitMap bm @A2, pointer tags @A1) -> pointer @D0 - extsub @bank 3 -1026 = ChangeExtSpriteA(pointer vp @A0, pointer oldsprite @A1, pointer newsprite @A2, pointer tags @A3) -> long @D0 - extsub @bank 3 -1032 = FreeSpriteData(pointer sp @A2) - extsub @bank 3 -1038 = SetRPAttrsA(^^RastPort rp @A0, pointer tags @A1) - extsub @bank 3 -1044 = GetRPAttrsA(^^RastPort rp @A0, pointer tags @A1) - extsub @bank 3 -1050 = BestModeIDA(pointer tags @A0) -> long @D0 - extsub @bank 3 -1056 = WriteChunkyPixels(^^RastPort rp @A0, uword xstart @D0, uword ystart @D1, uword xstop @D2, uword ystop @D3, pointer array @A2, long bytesperrow @D4) - - ; ---- struct definitions ---- - - struct AreaInfo { ; total size: 24 - pointer VctrTbl ; 0 - pointer VctrPtr ; 4 - pointer FlagTbl ; 8 - pointer FlagPtr ; 12 - word Count ; 16 - word MaxCount ; 18 - word FirstX ; 20 - word FirstY ; 22 - } - - struct BitMap { ; total size: 40 - uword BytesPerRow ; 0 - uword Rows ; 2 - ubyte Flags ; 4 - ubyte Depth ; 5 - uword Pad ; 6 - pointer[8] Planes ; 8 - } - - struct ClipRect { ; total size: 36 - ^^ClipRect Next ; 0 - ^^ClipRect Reservedlink ; 4 - long Obscured ; 8 - ^^BitMap BitMap ; 12 - ubyte[8] emb_Bounds ; 16 - ^^ClipRect Vlink ; 24 - pointer Home ; 28 - pointer Reserved ; 32 - } - - struct ColorMap { ; total size: 52 - ubyte Flags ; 0 - ubyte Type ; 1 - uword Count ; 2 - pointer ColorTable ; 4 - pointer Vpe ; 8 - pointer LowColorBits ; 12 - ubyte TransparencyPlane ; 16 - ubyte SpriteResolution ; 17 - ubyte SpriteResDefault ; 18 - ubyte AuxFlags ; 19 - pointer Vp ; 20 - pointer NormalDisplayInfo ; 24 - pointer CoerceDisplayInfo ; 28 - ^^utility.TagItem Batch_items ; 32 - long VPModeID ; 36 - pointer PalExtra ; 40 - uword Even ; 44 - uword Odd ; 46 - uword Bp_0_base ; 48 - uword Bp_1_base ; 50 - } - - struct Layer { ; total size: 160 - ^^Layer Front ; 0 - ^^Layer Back ; 4 - ^^ClipRect ClipRect ; 8 - ^^RastPort Rp ; 12 - ubyte[8] emb_Bounds ; 16 - ^^Layer Nlink ; 24 - uword Priority ; 28 - uword Flags ; 30 - ^^BitMap SuperBitMap ; 32 - ^^ClipRect SuperClipRect ; 36 - pointer Window ; 40 - word X ; 44 - word Y ; 46 - ^^ClipRect OnScreen ; 48 - ^^ClipRect OffScreen ; 52 - ^^ClipRect Backup ; 56 - ^^ClipRect SuperSaveClipRects ; 60 - ^^ClipRect Undamaged ; 64 - pointer LayerInfo ; 68 - ubyte[46] emb_Lock ; 72 - ^^utility.Hook BackFill ; 118 - long Reserved1 ; 122 - pointer ClipRegion ; 126 - ^^ClipRect Clipped ; 130 - word Width ; 134 - word Height ; 136 - ubyte[18] Reserved2 ; 138 - pointer DamageList ; 156 - } - - struct RastPort { ; total size: 100 - ^^Layer Layer ; 0 - ^^BitMap BitMap ; 4 - pointer AreaPtrn ; 8 - ^^TmpRas TmpRas ; 12 - ^^AreaInfo AreaInfo ; 16 - pointer GelsInfo ; 20 - ubyte Mask ; 24 - byte FgPen ; 25 - byte BgPen ; 26 - byte AOlPen ; 27 - byte DrawMode ; 28 - byte AreaPtSz ; 29 - byte Linpatcnt ; 30 - byte Dummy ; 31 - uword Flags ; 32 - uword LinePtrn ; 34 - word X ; 36 - word Y ; 38 - ubyte[8] Minterms ; 40 - word PenWidth ; 48 - word PenHeight ; 50 - ^^TextFont Font ; 52 - ubyte AlgoStyle ; 56 - ubyte TxFlags ; 57 - uword TxHeight ; 58 - uword TxWidth ; 60 - uword TxBaseline ; 62 - word TxSpacing ; 64 - pointer User ; 66 - long[2] Longreserved ; 70 - uword[7] Wordreserved ; 78 - ubyte[8] Reserved ; 92 - } - - struct TextAttr { ; total size: 8 - str Name ; 0 - uword YSize ; 4 - ubyte Style ; 6 - ubyte Flags ; 7 - } - - struct TextExtent { ; total size: 12 - uword Width ; 0 - uword Height ; 2 - ubyte[8] emb_Extent ; 4 - } - - struct TextFont { ; total size: 52 - ^^exec.Node Succ ; 0 - ^^exec.Node Pred ; 4 - ubyte Type ; 8 - byte Pri ; 9 - str Name ; 10 - ^^exec.MsgPort ReplyPort ; 14 - uword Length ; 18 - uword YSize ; 20 - ubyte Style ; 22 - ubyte Flags ; 23 - uword XSize ; 24 - uword Baseline ; 26 - uword BoldSmear ; 28 - uword Accessors ; 30 - ubyte LoChar ; 32 - ubyte HiChar ; 33 - pointer CharData ; 34 - uword Modulo ; 38 - pointer CharLoc ; 40 - pointer CharSpace ; 44 - pointer CharKern ; 48 - } - - struct TmpRas { ; total size: 8 - pointer RasPtr ; 0 - long Size ; 4 - } - - struct View { ; total size: 18 - pointer ViewPort ; 0 - pointer LOFCprList ; 4 - pointer SHFCprList ; 8 - word DyOffset ; 12 - word DxOffset ; 14 - uword Modes ; 16 - } - - ; ---- constants ---- - const ubyte NEWLOCKS = $0001 - const ubyte CR_NEEDS_NO_CONCEALED_RASTERS = $0001 - const ubyte CR_NEEDS_NO_LAYERBLIT_DAMAGE = $0002 - const ubyte ISLESSX = $0001 - const ubyte ISLESSY = $0002 - const ubyte ISGRTRX = $0004 - const ubyte ISGRTRY = $0008 - const ubyte PRESERVE_COLORS = $0001 - const ubyte AVOID_FLICKER = $0002 - const ubyte IGNORE_MCOMPAT = $0004 - const ubyte COPPER_MOVE = $0000 - const ubyte COPPER_WAIT = $0001 - const ubyte CPRNXTBUF = $0002 - const uword CPR_NT_LOF = $8000 - const uword CPR_NT_SHT = $4000 - const uword CPR_NT_SYS = $2000 - const ubyte EXACT_LINE = $0001 - const ubyte HALF_LINE = $0002 - const uword MODE_640 = $8000 - const ubyte PLNCNTMSK = $7 - const ubyte PLNCNTSHFT = $000c - const ubyte PF2PRI = $40 - const uword COLORON = $0200 - const uword DBLPF = $400 - const uword HOLDNMODIFY = $800 - const ubyte INTERLACE = $0004 - const ubyte PFA_FINE_SCROLL = $F - const ubyte PFB_FINE_SCROLL_SHIFT = $0004 - const ubyte PF_FINE_SCROLL_MASK = $F - const ubyte DIW_HORIZ_POS = $7F - const uword DIW_VRTCL_POS = $1FF - const ubyte DIW_VRTCL_POS_SHIFT = $0007 - const ubyte DFTCH_MASK = $FF - const uword VPOSRLOF = $8000 - const long DTAG_DISP = $80000000 - const long DTAG_DIMS = $80001000 - const long DTAG_MNTR = $80002000 - const long DTAG_NAME = $80003000 - const long DTAG_VEC = $80004000 - const uword DI_AVAIL_NOCHIPS = $0001 - const uword DI_AVAIL_NOMONITOR = $0002 - const uword DI_AVAIL_NOTWITHGENLOCK = $0004 - const long DIPF_IS_LACE = $00000001 - const long DIPF_IS_DUALPF = $00000002 - const long DIPF_IS_PF2PRI = $00000004 - const long DIPF_IS_HAM = $00000008 - const long DIPF_IS_ECS = $00000010 - const long DIPF_IS_AA = $00010000 - const long DIPF_IS_PAL = $00000020 - const long DIPF_IS_SPRITES = $00000040 - const long DIPF_IS_GENLOCK = $00000080 - const long DIPF_IS_WB = $00000100 - const long DIPF_IS_DRAGGABLE = $00000200 - const long DIPF_IS_PANELLED = $00000400 - const long DIPF_IS_BEAMSYNC = $00000800 - const long DIPF_IS_EXTRAHALFBRITE = $00001000 - const long DIPF_IS_SPRITES_ATT = $00002000 - const long DIPF_IS_SPRITES_CHNG_RES = $00004000 - const long DIPF_IS_SPRITES_BORDER = $00008000 - const long DIPF_IS_SCANDBL = $00020000 - const long DIPF_IS_SPRITES_CHNG_BASE = $00040000 - const long DIPF_IS_SPRITES_CHNG_PRI = $00080000 - const long DIPF_IS_DBUFFER = $00100000 - const long DIPF_IS_PROGBEAM = $00200000 - const long DIPF_IS_FOREIGN = $80000000 - const ubyte MCOMPAT_MIXED = $0000 - const ubyte MCOMPAT_SELF = $0001 - const long MCOMPAT_NOBODY = -1 - const ubyte DISPLAYNAMELEN = $0020 - const uword SUSERFLAGS = $00FF - const ubyte VSB_VSPRITE = 0 - const ubyte VSF_VSPRITE = $0001 - const ubyte VSB_SAVEBACK = 1 - const ubyte VSF_SAVEBACK = $0002 - const ubyte VSB_OVERLAY = 2 - const ubyte VSF_OVERLAY = $0004 - const ubyte VSB_MUSTDRAW = 3 - const ubyte VSF_MUSTDRAW = $0008 - const ubyte VSB_BACKSAVED = 8 - const uword VSF_BACKSAVED = $0100 - const ubyte VSB_BOBUPDATE = 9 - const uword VSF_BOBUPDATE = $0200 - const ubyte VSB_GELGONE = 10 - const uword VSF_GELGONE = $0400 - const ubyte VSB_VSOVERFLOW = 11 - const uword VSF_VSOVERFLOW = $0800 - const uword BUSERFLAGS = $00FF - const ubyte BB_SAVEBOB = 0 - const ubyte BF_SAVEBOB = $0001 - const ubyte BB_BOBISCOMP = 1 - const ubyte BF_BOBISCOMP = $0002 - const ubyte BB_BWAITING = 8 - const uword BF_BWAITING = $0100 - const ubyte BB_BDRAWN = 9 - const uword BF_BDRAWN = $0200 - const ubyte BB_BOBSAWAY = 10 - const uword BF_BOBSAWAY = $0400 - const ubyte BB_BOBNIX = 11 - const uword BF_BOBNIX = $0800 - const ubyte BB_SAVEPRESERVE = 12 - const uword BF_SAVEPRESERVE = $1000 - const ubyte BB_OUTSTEP = 13 - const uword BF_OUTSTEP = $2000 - const ubyte ANFRACSIZE = $0006 - const uword ANIMHALF = $0020 - const uword RINGTRIGGER = $0001 - const uword BITSET = $8000 - const ubyte BITCLR = $0000 - const ubyte AGNUS = $0001 - const ubyte DENISE = $0001 - const ubyte BMB_CLEAR = 0 - const ubyte BMF_CLEAR = $0001 - const ubyte BMB_DISPLAYABLE = 1 - const ubyte BMF_DISPLAYABLE = $0002 - const ubyte BMB_INTERLEAVED = 2 - const ubyte BMF_INTERLEAVED = $0004 - const ubyte BMB_STANDARD = 3 - const ubyte BMF_STANDARD = $0008 - const ubyte BMB_MINPLANES = 4 - const ubyte BMF_MINPLANES = $0010 - const ubyte BMB_HIJACKED = 7 - const ubyte BMF_HIJACKED = $0080 - const ubyte BMB_RTGTAGS = 8 - const uword BMF_RTGTAGS = $0100 - const ubyte BMB_RTGCHECK = 9 - const uword BMF_RTGCHECK = $0200 - const ubyte BMB_FRIENDISTAG = 10 - const uword BMF_FRIENDISTAG = $0400 - const ubyte BMB_INVALID = 11 - const uword BMF_INVALID = $0800 - const ubyte BMA_HEIGHT = $0000 - const ubyte BMA_DEPTH = $0004 - const ubyte BMA_WIDTH = $0008 - const ubyte BMA_FLAGS = $000c - const long BMATags_Friend = $80000000 - const long BMATags_Depth = $80000001 - const long BMATags_PixelFormat = $80000002 - const long BMATags_Clear = $80000003 - const long BMATags_Displayable = $80000004 - const long BMATags_Private1 = $80000005 - const long BMATags_NoMemory = $80000006 - const long BMATags_NoSprite = $80000007 - const long BMATags_Private2 = $80000008 - const long BMATags_Private3 = $80000009 - const long BMATags_ModeWidth = $8000000a - const long BMATags_ModeHeight = $8000000b - const long BMATags_RenderFunc = $8000000c - const long BMATags_SaveFunc = $8000000d - const long BMATags_UserData = $8000000e - const long BMATags_Alignment = $8000000f - const long BMATags_ConstantBytesPerRow = $80000010 - const long BMATags_UserPrivate = $80000011 - const long BMATags_Private4 = $80000012 - const long BMATags_Private5 = $80000013 - const long BMATags_Private6 = $80000014 - const long BMATags_Private7 = $80000015 - const long BMATags_DisplayID = $80000032 - const long BMATags_BitmapInvisible = $80000037 - const long BMATags_BitmapColors = $80000029 - const long BMATags_BitmapColors32 = $80000043 - const ubyte OWNBLITTERn = $0000 - const ubyte QBOWNERn = $0001 - const ubyte BLITMSG_FAULTn = $0002 - const ubyte BLITMSG_FAULT = $0001 - const ubyte QBOWNER = $0001 - const ubyte GBFLAGSB_TIMER = 6 - const ubyte GBFLAGSF_TIMER = $0040 - const ubyte GBFLAGSB_LASTBLIT = 7 - const ubyte GBFLAGSF_LASTBLIT = $0080 - const ubyte GFXB_BIG_BLITS = 0 - const ubyte GFXF_BIG_BLITS = $0001 - const ubyte GFXB_HR_AGNUS = 0 - const ubyte GFXF_HR_AGNUS = $0001 - const ubyte GFXB_HR_DENISE = 1 - const ubyte GFXF_HR_DENISE = $0002 - const ubyte GFXB_AA_ALICE = 2 - const ubyte GFXF_AA_ALICE = $0004 - const ubyte GFXB_AA_LISA = 3 - const ubyte GFXF_AA_LISA = $0008 - const ubyte GFXB_AA_MLISA = 4 - const ubyte GFXF_AA_MLISA = $0010 - const long SETCHIPREV_BEST = $ffffffff - const ubyte BUS_16 = $0000 - const ubyte NML_CAS = $0000 - const ubyte BUS_32 = $0001 - const ubyte DBL_CAS = $0002 - const ubyte NTSCn = $0000 - const ubyte NTSC = $0001 - const ubyte GENLOCn = $0001 - const ubyte GENLOC = $0001 - const ubyte PALn = $0002 - const ubyte PAL = $0001 - const ubyte TODA_SAFEn = $0003 - const ubyte TODA_SAFE = $0001 - const ubyte REALLY_PALn = $0004 - const ubyte REALLY_PAL = $0001 - const ubyte LPEN_SWAP_FRAMESn = $0005 - const ubyte LPEN_SWAP_FRAMES = $0001 - const ubyte GRAPHICS_GFXNODES_I = $0001 - const ubyte SS_GRAPHICS = $02 - const ubyte VIEW_EXTRA_TYPE = $0001 - const ubyte VIEWPORT_EXTRA_TYPE = $0002 - const ubyte SPECIAL_MONITOR_TYPE = $0003 - const ubyte MONITOR_SPEC_TYPE = $0004 - const ubyte LAYERSIMPLE = $0001 - const ubyte LAYERSMART = $0002 - const ubyte LAYERSUPER = $0004 - const ubyte LAYERUPDATING = $10 - const ubyte LAYERBACKDROP = $40 - const ubyte LAYERREFRESH = $80 - const uword LAYERIREFRESH = $200 - const uword LAYERIREFRESH2 = $400 - const uword LAYER_CLIPRECTS_LOST = $100 - const uword LAYERSAVEBACK = $800 - const uword LAYERHIDDEN = $1000 - const ubyte NEWLAYERINFO_CALLED = $0001 - const ubyte LAYERS_NOBACKFILL = $0001 - const ubyte LAYERS_BACKFILL = $0000 - const ubyte LAYER_BACKMOST = $0000 - const ubyte LAYER_FRONTMOST = $0001 - const long MONITOR_ID_MASK = $FFFF1000 - const long DEFAULT_MONITOR_ID = $00000000 - const long NTSC_MONITOR_ID = $00011000 - const long PAL_MONITOR_ID = $00021000 - const long LORES_KEY = $00000000 - const long HIRES_KEY = $00008000 - const long SUPER_KEY = $00008020 - const long HAM_KEY = $00000800 - const long LORESLACE_KEY = $00000004 - const long HIRESLACE_KEY = $00008004 - const long SUPERLACE_KEY = $00008024 - const long HAMLACE_KEY = $00000804 - const long LORESDPF_KEY = $00000400 - const long HIRESDPF_KEY = $00008400 - const long SUPERDPF_KEY = $00008420 - const long LORESLACEDPF_KEY = $00000404 - const long HIRESLACEDPF_KEY = $00008404 - const long SUPERLACEDPF_KEY = $00008424 - const long LORESDPF2_KEY = $00000440 - const long HIRESDPF2_KEY = $00008440 - const long SUPERDPF2_KEY = $00008460 - const long LORESLACEDPF2_KEY = $00000444 - const long HIRESLACEDPF2_KEY = $00008444 - const long SUPERLACEDPF2_KEY = $00008464 - const long EXTRAHALFBRITE_KEY = $00000080 - const long EXTRAHALFBRITELACE_KEY = $00000084 - const long HIRESHAM_KEY = $00008800 - const long SUPERHAM_KEY = $00008820 - const long HIRESEHB_KEY = $00008080 - const long SUPEREHB_KEY = $000080a0 - const long HIRESHAMLACE_KEY = $00008804 - const long SUPERHAMLACE_KEY = $00008824 - const long HIRESEHBLACE_KEY = $00008084 - const long SUPEREHBLACE_KEY = $000080a4 - const long LORESSDBL_KEY = $00000008 - const long LORESHAMSDBL_KEY = $00000808 - const long LORESEHBSDBL_KEY = $00000088 - const long HIRESHAMSDBL_KEY = $00008808 - const long VGA_MONITOR_ID = $00031000 - const long VGAEXTRALORES_KEY = $00031004 - const long VGALORES_KEY = $00039004 - const long VGAPRODUCT_KEY = $00039024 - const long VGAHAM_KEY = $00031804 - const long VGAEXTRALORESLACE_KEY = $00031005 - const long VGALORESLACE_KEY = $00039005 - const long VGAPRODUCTLACE_KEY = $00039025 - const long VGAHAMLACE_KEY = $00031805 - const long VGAEXTRALORESDPF_KEY = $00031404 - const long VGALORESDPF_KEY = $00039404 - const long VGAPRODUCTDPF_KEY = $00039424 - const long VGAEXTRALORESLACEDPF_KEY = $00031405 - const long VGALORESLACEDPF_KEY = $00039405 - const long VGAPRODUCTLACEDPF_KEY = $00039425 - const long VGAEXTRALORESDPF2_KEY = $00031444 - const long VGALORESDPF2_KEY = $00039444 - const long VGAPRODUCTDPF2_KEY = $00039464 - const long VGAEXTRALORESLACEDPF2_KEY = $00031445 - const long VGALORESLACEDPF2_KEY = $00039445 - const long VGAPRODUCTLACEDPF2_KEY = $00039465 - const long VGAEXTRAHALFBRITE_KEY = $00031084 - const long VGAEXTRAHALFBRITELACE_KEY = $00031085 - const long VGAPRODUCTHAM_KEY = $00039824 - const long VGALORESHAM_KEY = $00039804 - const long VGAPRODUCTHAMLACE_KEY = $00039825 - const long VGALORESHAMLACE_KEY = $00039805 - const long VGALORESEHB_KEY = $00039084 - const long VGALORESEHBLACE_KEY = $00039085 - const long VGAEHB_KEY = $000390a4 - const long VGAEHBLACE_KEY = $000390a5 - const long A2024_MONITOR_ID = $00041000 - const long A2024TENHERTZ_KEY = $00041000 - const long A2024FIFTEENHERTZ_KEY = $00049000 - const long PROTO_MONITOR_ID = $00051000 - const long EURO72_MONITOR_ID = $00061000 - const long EURO72EXTRALORES_KEY = $00061004 - const long EURO72LORES_KEY = $00069004 - const long EURO72PRODUCT_KEY = $00069024 - const long EURO72HAM_KEY = $00061804 - const long EURO72EXTRALORESLACE_KEY = $00061005 - const long EURO72LORESLACE_KEY = $00069005 - const long EURO72PRODUCTLACE_KEY = $00069025 - const long EURO72HAMLACE_KEY = $00061805 - const long EURO72EXTRALORESDPF_KEY = $00061404 - const long EURO72LORESDPF_KEY = $00069404 - const long EURO72PRODUCTDPF_KEY = $00069424 - const long EURO72EXTRALORESLACEDPF_KEY = $00061405 - const long EURO72LORESLACEDPF_KEY = $00069405 - const long EURO72PRODUCTLACEDPF_KEY = $00069425 - const long EURO72EXTRALORESDPF2_KEY = $00061444 - const long EURO72LORESDPF2_KEY = $00069444 - const long EURO72PRODUCTDPF2_KEY = $00069464 - const long EURO72EXTRALORESLACEDPF2_KEY = $00061445 - const long EURO72LORESLACEDPF2_KEY = $00069445 - const long EURO72PRODUCTLACEDPF2_KEY = $00069465 - const long EURO72EXTRAHALFBRITE_KEY = $00061084 - const long EURO72EXTRAHALFBRITELACE_KEY = $00061085 - const long EURO72PRODUCTHAM_KEY = $00069824 - const long EURO72PRODUCTHAMLACE_KEY = $00069825 - const long EURO72LORESHAM_KEY = $00069804 - const long EURO72LORESHAMLACE_KEY = $00069805 - const long EURO72LORESEHB_KEY = $00069084 - const long EURO72LORESEHBLACE_KEY = $00069085 - const long EURO72EHB_KEY = $000690a4 - const long EURO72EHBLACE_KEY = $000690a5 - const long EURO72EXTRALORESDBL_KEY = $00061000 - const long EURO72LORESDBL_KEY = $00069000 - const long EURO72PRODUCTDBL_KEY = $00069020 - const long EURO72EXTRALORESHAMDBL_KEY = $00061800 - const long EURO72LORESHAMDBL_KEY = $00069800 - const long EURO72PRODUCTHAMDBL_KEY = $00069820 - const long EURO72EXTRALORESEHBDBL_KEY = $00061080 - const long EURO72LORESEHBDBL_KEY = $00069080 - const long EURO72PRODUCTEHBDBL_KEY = $000690a0 - const long EURO36_MONITOR_ID = $00071000 - const long SUPER72_MONITOR_ID = $00081000 - const long SUPER72LORESDBL_KEY = $00081008 - const long SUPER72HIRESDBL_KEY = $00089008 - const long SUPER72SUPERDBL_KEY = $00089028 - const long SUPER72LORESHAMDBL_KEY = $00081808 - const long SUPER72HIRESHAMDBL_KEY = $00089808 - const long SUPER72SUPERHAMDBL_KEY = $00089828 - const long SUPER72LORESEHBDBL_KEY = $00081088 - const long SUPER72HIRESEHBDBL_KEY = $00089088 - const long SUPER72SUPEREHBDBL_KEY = $000890a8 - const long DBLNTSC_MONITOR_ID = $00091000 - const long DBLNTSCLORES_KEY = $00091000 - const long DBLNTSCLORESFF_KEY = $00091004 - const long DBLNTSCLORESHAM_KEY = $00091800 - const long DBLNTSCLORESHAMFF_KEY = $00091804 - const long DBLNTSCLORESEHB_KEY = $00091080 - const long DBLNTSCLORESEHBFF_KEY = $00091084 - const long DBLNTSCLORESLACE_KEY = $00091005 - const long DBLNTSCLORESHAMLACE_KEY = $00091805 - const long DBLNTSCLORESEHBLACE_KEY = $00091085 - const long DBLNTSCLORESDPF_KEY = $00091400 - const long DBLNTSCLORESDPFFF_KEY = $00091404 - const long DBLNTSCLORESDPFLACE_KEY = $00091405 - const long DBLNTSCLORESDPF2_KEY = $00091440 - const long DBLNTSCLORESDPF2FF_KEY = $00091444 - const long DBLNTSCLORESDPF2LACE_KEY = $00091445 - const long DBLNTSCHIRES_KEY = $00099000 - const long DBLNTSCHIRESFF_KEY = $00099004 - const long DBLNTSCHIRESHAM_KEY = $00099800 - const long DBLNTSCHIRESHAMFF_KEY = $00099804 - const long DBLNTSCHIRESLACE_KEY = $00099005 - const long DBLNTSCHIRESHAMLACE_KEY = $00099805 - const long DBLNTSCHIRESEHB_KEY = $00099080 - const long DBLNTSCHIRESEHBFF_KEY = $00099084 - const long DBLNTSCHIRESEHBLACE_KEY = $00099085 - const long DBLNTSCHIRESDPF_KEY = $00099400 - const long DBLNTSCHIRESDPFFF_KEY = $00099404 - const long DBLNTSCHIRESDPFLACE_KEY = $00099405 - const long DBLNTSCHIRESDPF2_KEY = $00099440 - const long DBLNTSCHIRESDPF2FF_KEY = $00099444 - const long DBLNTSCHIRESDPF2LACE_KEY = $00099445 - const long DBLNTSCEXTRALORES_KEY = $00091200 - const long DBLNTSCEXTRALORESHAM_KEY = $00091a00 - const long DBLNTSCEXTRALORESEHB_KEY = $00091280 - const long DBLNTSCEXTRALORESDPF_KEY = $00091600 - const long DBLNTSCEXTRALORESDPF2_KEY = $00091640 - const long DBLNTSCEXTRALORESFF_KEY = $00091204 - const long DBLNTSCEXTRALORESHAMFF_KEY = $00091a04 - const long DBLNTSCEXTRALORESEHBFF_KEY = $00091284 - const long DBLNTSCEXTRALORESDPFFF_KEY = $00091604 - const long DBLNTSCEXTRALORESDPF2FF_KEY = $00091644 - const long DBLNTSCEXTRALORESLACE_KEY = $00091205 - const long DBLNTSCEXTRALORESHAMLACE_KEY = $00091a05 - const long DBLNTSCEXTRALORESEHBLACE_KEY = $00091285 - const long DBLNTSCEXTRALORESDPFLACE_KEY = $00091605 - const long DBLNTSCEXTRALORESDPF2LACE_KEY = $00091645 - const long DBLPAL_MONITOR_ID = $000a1000 - const long DBLPALLORES_KEY = $000a1000 - const long DBLPALLORESFF_KEY = $000a1004 - const long DBLPALLORESHAM_KEY = $000a1800 - const long DBLPALLORESHAMFF_KEY = $000a1804 - const long DBLPALLORESEHB_KEY = $000a1080 - const long DBLPALLORESEHBFF_KEY = $000a1084 - const long DBLPALLORESLACE_KEY = $000a1005 - const long DBLPALLORESHAMLACE_KEY = $000a1805 - const long DBLPALLORESEHBLACE_KEY = $000a1085 - const long DBLPALLORESDPF_KEY = $000a1400 - const long DBLPALLORESDPFLACE_KEY = $000a1404 - const long DBLPALLORESDPF2_KEY = $000a1440 - const long DBLPALLORESDPF2LACE_KEY = $000a1444 - const long DBLPALHIRES_KEY = $000a9000 - const long DBLPALHIRESFF_KEY = $000a9004 - const long DBLPALHIRESHAM_KEY = $000a9800 - const long DBLPALHIRESHAMFF_KEY = $000a9804 - const long DBLPALHIRESLACE_KEY = $000a9005 - const long DBLPALHIRESHAMLACE_KEY = $000a9805 - const long DBLPALHIRESEHB_KEY = $000a9080 - const long DBLPALHIRESEHBFF_KEY = $000a9084 - const long DBLPALHIRESEHBLACE_KEY = $000a9085 - const long DBLPALHIRESDPF_KEY = $000a9400 - const long DBLPALHIRESDPFLACE_KEY = $000a9404 - const long DBLPALHIRESDPF2_KEY = $000a9440 - const long DBLPALHIRESDPF2LACE_KEY = $000a9444 - const long DBLPALEXTRALORES_KEY = $000a1200 - const long DBLPALEXTRALORESHAM_KEY = $000a1a00 - const long DBLPALEXTRALORESEHB_KEY = $000a1280 - const long DBLPALEXTRALORESDPF_KEY = $000a1600 - const long DBLPALEXTRALORESDPF2_KEY = $000a1640 - const long DBLPALEXTRALORESFF_KEY = $000a1204 - const long DBLPALEXTRALORESHAMFF_KEY = $000a1a04 - const long DBLPALEXTRALORESEHBFF_KEY = $000a1284 - const long DBLPALEXTRALORESDPFFF_KEY = $000a1604 - const long DBLPALEXTRALORESDPF2FF_KEY = $000a1644 - const long DBLPALEXTRALORESLACE_KEY = $000a1205 - const long DBLPALEXTRALORESHAMLACE_KEY = $000a1a05 - const long DBLPALEXTRALORESEHBLACE_KEY = $000a1285 - const long DBLPALEXTRALORESDPFLACE_KEY = $000a1605 - const long DBLPALEXTRALORESDPF2LACE_KEY = $000a1645 - const long BIDTAG_DIPFMustHave = $80000001 - const long BIDTAG_DIPFMustNotHave = $80000002 - const long BIDTAG_ViewPort = $80000003 - const long BIDTAG_NominalWidth = $80000004 - const long BIDTAG_NominalHeight = $80000005 - const long BIDTAG_DesiredWidth = $80000006 - const long BIDTAG_DesiredHeight = $80000007 - const long BIDTAG_Depth = $80000008 - const long BIDTAG_MonitorID = $80000009 - const long BIDTAG_SourceID = $8000000a - const long BIDTAG_RedBits = $8000000b - const long BIDTAG_BlueBits = $8000000c - const long BIDTAG_GreenBits = $8000000d - const long BIDTAG_GfxPrivate = $8000000e - const ubyte MSB_REQUEST_NTSC = 0 - const ubyte MSF_REQUEST_NTSC = $0001 - const ubyte MSB_REQUEST_PAL = 1 - const ubyte MSF_REQUEST_PAL = $0002 - const ubyte MSB_REQUEST_SPECIAL = 2 - const ubyte MSF_REQUEST_SPECIAL = $0004 - const ubyte MSB_REQUEST_A2024 = 3 - const ubyte MSF_REQUEST_A2024 = $0008 - const ubyte MSB_DOUBLE_SPRITES = 4 - const ubyte MSF_DOUBLE_SPRITES = $0010 - const ubyte STANDARD_VIEW_X = $81 - const ubyte STANDARD_VIEW_Y = $2C - const ubyte RPB_FRST_DOT = 0 - const ubyte RPF_FRST_DOT = $0001 - const ubyte RPB_ONE_DOT = 1 - const ubyte RPF_ONE_DOT = $0002 - const ubyte RPB_DBUFFER = 2 - const ubyte RPF_DBUFFER = $0004 - const ubyte RPB_AREAOUTLINE = 3 - const ubyte RPF_AREAOUTLINE = $0008 - const ubyte RPB_NOCROSSFILL = 5 - const ubyte RPF_NOCROSSFILL = $0020 - const ubyte RP_JAM1 = $0000 - const ubyte RP_JAM2 = $0001 - const ubyte RP_COMPLEMENT = $0002 - const ubyte RP_INVERSVID = $0004 - const ubyte RPB_TXSCALE = 0 - const ubyte RPF_TXSCALE = $0001 - const ubyte ONE_DOTn = $0001 - const ubyte ONE_DOT = $2 - const ubyte FRST_DOTn = $0000 - const ubyte FRST_DOT = $0001 - const long RPTAG_Font = $80000000 - const long RPTAG_APen = $80000002 - const long RPTAG_BPen = $80000003 - const long RPTAG_DrMd = $80000004 - const long RPTAG_OutLinePen = $80000005 - const long RPTAG_OutlinePen = $80000005 - const long RPTAG_WriteMask = $80000006 - const long RPTAG_MaxPen = $80000007 - const long RPTAG_DrawBounds = $80000008 - const long SPRITEA_Width = $81000000 - const long SPRITEA_XReplication = $81000002 - const long SPRITEA_YReplication = $81000004 - const long SPRITEA_OutputHeight = $81000006 - const long SPRITEA_Attached = $81000008 - const long SPRITEA_OldDataFormat = $8100000a - const long GSTAG_SPRITE_NUM = $82000020 - const long GSTAG_ATTACHED = $82000022 - const long GSTAG_SOFTSPRITE = $82000024 - const long GSTAG_SCANDOUBLED = $83000000 - const ubyte FS_NORMAL = $0000 - const ubyte FSB_UNDERLINED = 0 - const ubyte FSF_UNDERLINED = $0001 - const ubyte FSB_BOLD = 1 - const ubyte FSF_BOLD = $0002 - const ubyte FSB_ITALIC = 2 - const ubyte FSF_ITALIC = $0004 - const ubyte FSB_EXTENDED = 3 - const ubyte FSF_EXTENDED = $0008 - const ubyte FSB_COLORFONT = 6 - const ubyte FSF_COLORFONT = $0040 - const ubyte FSB_TAGGED = 7 - const ubyte FSF_TAGGED = $0080 - const ubyte FPB_ROMFONT = 0 - const ubyte FPF_ROMFONT = $0001 - const ubyte FPB_DISKFONT = 1 - const ubyte FPF_DISKFONT = $0002 - const ubyte FPB_REVPATH = 2 - const ubyte FPF_REVPATH = $0004 - const ubyte FPB_TALLDOT = 3 - const ubyte FPF_TALLDOT = $0008 - const ubyte FPB_WIDEDOT = 4 - const ubyte FPF_WIDEDOT = $0010 - const ubyte FPB_PROPORTIONAL = 5 - const ubyte FPF_PROPORTIONAL = $0020 - const ubyte FPB_DESIGNED = 6 - const ubyte FPF_DESIGNED = $0040 - const ubyte FPB_REMOVED = 7 - const ubyte FPF_REMOVED = $0080 - const long TA_DeviceDPI = $80000001 - const uword MAXFONTMATCHWEIGHT = $7fff - const ubyte TE0B_NOREMFONT = 0 - const ubyte TE0F_NOREMFONT = $0001 - const uword CT_COLORFONT = $0001 - const uword CT_GREYFONT = $0002 - const uword CT_ANTIALIAS = $0004 - const ubyte CTB_MAPCOLOR = 0 - const ubyte CTF_MAPCOLOR = $0001 - const long VTAG_END_CM = $00000000 - const long VTAG_CHROMAKEY_CLR = $80000000 - const long VTAG_CHROMAKEY_SET = $80000001 - const long VTAG_BITPLANEKEY_CLR = $80000002 - const long VTAG_BITPLANEKEY_SET = $80000003 - const long VTAG_BORDERBLANK_CLR = $80000004 - const long VTAG_BORDERBLANK_SET = $80000005 - const long VTAG_BORDERNOTRANS_CLR = $80000006 - const long VTAG_BORDERNOTRANS_SET = $80000007 - const long VTAG_CHROMA_PEN_CLR = $80000008 - const long VTAG_CHROMA_PEN_SET = $80000009 - const long VTAG_CHROMA_PLANE_SET = $8000000A - const long VTAG_ATTACH_CM_SET = $8000000B - const long VTAG_NEXTBUF_CM = $8000000C - const long VTAG_BATCH_CM_CLR = $8000000D - const long VTAG_BATCH_CM_SET = $8000000E - const long VTAG_NORMAL_DISP_GET = $8000000F - const long VTAG_NORMAL_DISP_SET = $80000010 - const long VTAG_COERCE_DISP_GET = $80000011 - const long VTAG_COERCE_DISP_SET = $80000012 - const long VTAG_VIEWPORTEXTRA_GET = $80000013 - const long VTAG_VIEWPORTEXTRA_SET = $80000014 - const long VTAG_CHROMAKEY_GET = $80000015 - const long VTAG_BITPLANEKEY_GET = $80000016 - const long VTAG_BORDERBLANK_GET = $80000017 - const long VTAG_BORDERNOTRANS_GET = $80000018 - const long VTAG_CHROMA_PEN_GET = $80000019 - const long VTAG_CHROMA_PLANE_GET = $8000001A - const long VTAG_ATTACH_CM_GET = $8000001B - const long VTAG_BATCH_CM_GET = $8000001C - const long VTAG_BATCH_ITEMS_GET = $8000001D - const long VTAG_BATCH_ITEMS_SET = $8000001E - const long VTAG_BATCH_ITEMS_ADD = $8000001F - const long VTAG_VPMODEID_GET = $80000020 - const long VTAG_VPMODEID_SET = $80000021 - const long VTAG_VPMODEID_CLR = $80000022 - const long VTAG_USERCLIP_GET = $80000023 - const long VTAG_USERCLIP_SET = $80000024 - const long VTAG_USERCLIP_CLR = $80000025 - const long VTAG_PF1_BASE_GET = $80000026 - const long VTAG_PF2_BASE_GET = $80000027 - const long VTAG_SPEVEN_BASE_GET = $80000028 - const long VTAG_SPODD_BASE_GET = $80000029 - const long VTAG_PF1_BASE_SET = $8000002a - const long VTAG_PF2_BASE_SET = $8000002b - const long VTAG_SPEVEN_BASE_SET = $8000002c - const long VTAG_SPODD_BASE_SET = $8000002d - const long VTAG_BORDERSPRITE_GET = $8000002e - const long VTAG_BORDERSPRITE_SET = $8000002f - const long VTAG_BORDERSPRITE_CLR = $80000030 - const long VTAG_SPRITERESN_SET = $80000031 - const long VTAG_SPRITERESN_GET = $80000032 - const long VTAG_PF1_TO_SPRITEPRI_SET = $80000033 - const long VTAG_PF1_TO_SPRITEPRI_GET = $80000034 - const long VTAG_PF2_TO_SPRITEPRI_SET = $80000035 - const long VTAG_PF2_TO_SPRITEPRI_GET = $80000036 - const long VTAG_IMMEDIATE = $80000037 - const long VTAG_FULLPALETTE_SET = $80000038 - const long VTAG_FULLPALETTE_GET = $80000039 - const long VTAG_FULLPALETTE_CLR = $8000003A - const long VTAG_DEFSPRITERESN_SET = $8000003B - const long VTAG_DEFSPRITERESN_GET = $8000003C - const long VC_IntermediateCLUpdate = $80000080 - const long VC_IntermediateCLUpdate_Query = $80000081 - const long VC_NoColorPaletteLoad = $80000082 - const long VC_NoColorPaletteLoad_Query = $80000083 - const long VC_DUALPF_Disable = $80000084 - const long VC_DUALPF_Disable_Query = $80000085 - const ubyte GENLOCK_VIDEO = $2 - const ubyte V_LACE = $4 - const ubyte V_DOUBLESCAN = $8 - const ubyte V_SUPERHIRES = $20 - const ubyte V_PFBA = $40 - const ubyte V_EXTRA_HALFBRITE = $80 - const uword GENLOCK_AUDIO = $100 - const uword V_DUALPF = $400 - const uword V_HAM = $800 - const uword V_EXTENDED_MODE = $1000 - const uword V_VP_HIDE = $2000 - const uword V_SPRITES = $4000 - const uword V_HIRES = $8000 - const uword EXTEND_VSTRUCT = $1000 - const ubyte VPB_A2024 = 6 - const ubyte VPF_A2024 = $0040 - const ubyte VPB_TENHZ = 4 - const ubyte VPF_TENHZ = $0010 - const ubyte COLORMAP_TYPE_V1_2 = $00 - const ubyte COLORMAP_TYPE_V1_4 = $01 - const ubyte COLORMAP_TYPE_V39 = $02 - const ubyte COLORMAP_TRANSPARENCY = $01 - const ubyte COLORPLANE_TRANSPARENCY = $02 - const ubyte BORDER_BLANKING = $04 - const ubyte BORDER_NOTRANSPARENCY = $08 - const ubyte VIDEOCONTROL_BATCH = $10 - const ubyte USER_COPPER_CLIP = $20 - const ubyte BORDER_SPRITES = $40 - const ubyte CMB_CMTRANS = 0 - const ubyte CMF_CMTRANS = $0001 - const ubyte CMB_CPTRANS = 1 - const ubyte CMF_CPTRANS = $0002 - const ubyte CMB_BRDRBLNK = 2 - const ubyte CMF_BRDRBLNK = $0004 - const ubyte CMB_BRDNTRAN = 3 - const ubyte CMF_BRDNTRAN = $0008 - const ubyte CMB_BRDRSPRT = 6 - const ubyte CMF_BRDRSPRT = $0040 - const ubyte SPRITERESN_ECS = $0000 - const ubyte SPRITERESN_140NS = $0001 - const ubyte SPRITERESN_70NS = $0002 - const ubyte SPRITERESN_35NS = $0003 - const long SPRITERESN_DEFAULT = -1 - const ubyte CMAB_FULLPALETTE = 0 - const ubyte CMAF_FULLPALETTE = $0001 - const ubyte CMAB_NO_INTERMED_UPDATE = 1 - const ubyte CMAF_NO_INTERMED_UPDATE = $0002 - const ubyte CMAB_NO_COLOR_LOAD = 2 - const ubyte CMAF_NO_COLOR_LOAD = $0004 - const ubyte CMAB_DUALPF_DISABLE = 3 - const ubyte CMAF_DUALPF_DISABLE = $0008 - const long PRECISION_EXACT = -1 - const ubyte PRECISION_IMAGE = $0000 - const ubyte PRECISION_ICON = $0010 - const ubyte PRECISION_GUI = $0020 - const long OBP_Precision = $84000000 - const long OBP_FailIfBad = $84000001 - const ubyte PEN_EXCLUSIVE = $0001 - const ubyte PEN_NO_SETCOLOR = $0002 - const ubyte PENB_EXCLUSIVE = 0 - const ubyte PENF_EXCLUSIVE = $0001 - const ubyte PENB_NO_SETCOLOR = 1 - const ubyte PENF_NO_SETCOLOR = $0002 - const ubyte VPXB_FREE_ME = $0000 - const ubyte VPXF_FREE_ME = $0001 - const ubyte VPXB_VP_LAST = $0001 - const ubyte VPXF_VP_LAST = $0002 - const ubyte VPXB_STRADDLES_256 = $0004 - const ubyte VPXF_STRADDLES_256 = $0010 - const ubyte VPXB_STRADDLES_512 = $0005 - const ubyte VPXF_STRADDLES_512 = $0020 - const ubyte MVP_OK = $0000 - const ubyte MVP_NO_MEM = $0001 - const ubyte MVP_NO_VPE = $0002 - const ubyte MVP_NO_DSPINS = $0003 - const ubyte MVP_NO_DISPLAY = $0004 - const ubyte MVP_OFF_BOTTOM = $0005 - const ubyte MCOP_OK = $0000 - const ubyte MCOP_NO_MEM = $0001 - const ubyte MCOP_NOP = $0002 - const uword BMF_CHECKMASK = $0f80 - const uword BMF_CHECKVALUE = $0700 - const ubyte SETCHIPREV_A = $0001 - const ubyte SETCHIPREV_ECS = $0003 - const ubyte SETCHIPREV_AA = $000f - const ubyte BANDWIDTH_1X = $0000 - const ubyte BANDWIDTH_2XNML = $0001 - const ubyte BANDWIDTH_2XDBL = $0002 - const ubyte BANDWIDTH_4X = $0003 - const long VGAEXTRALORESHAM_KEY = $00031804 - const long VGAEXTRALORESHAMLACE_KEY = $00031805 - const long VGAEXTRALORESEHB_KEY = $00031084 - const long VGAEXTRALORESEHBLACE_KEY = $00031085 - const long EURO72EXTRALORESHAM_KEY = $00061804 - const long EURO72EXTRALORESHAMLACE_KEY = $00061805 - const long EURO72EXTRALORESEHB_KEY = $00061084 - const long EURO72EXTRALORESEHBLACE_KEY = $00061085 - const uword MUST_FLAGS = $100e - const ubyte COLORMAP_TYPE_V36 = $0001 + %option no_symbol_prefixing, ignore_unused } -;; End of auto-generated graphics_lib.sfd diff --git a/compiler/res/prog8lib/amiga500/icon.p8 b/compiler/res/prog8lib/amiga500/icon.p8 index ea6329034..d8bbdaf13 100644 --- a/compiler/res/prog8lib/amiga500/icon.p8 +++ b/compiler/res/prog8lib/amiga500/icon.p8 @@ -1,216 +1,5 @@ -;; Auto-generated from icon_lib.sfd and icon_lib.i -;; Library base: _IconBase in prog8: sys.IconBase -;; Bank: 11 -;; Functions: 24 - -%import graphics -%import intuition +%import shared_amiga_icon icon { - %option no_symbol_prefixing - extsub @bank 11 -54 = FreeFreeList(pointer freelist @A0) - extsub @bank 11 -72 = AddFreeList(pointer freelist @A0, pointer mem @A1, long size @A2) -> bool @D0 - extsub @bank 11 -78 = GetDiskObject(str name @A0) -> ^^DiskObject @D0 - extsub @bank 11 -84 = PutDiskObject(str name @A0, ^^DiskObject diskobj @A1) -> bool @D0 - extsub @bank 11 -90 = FreeDiskObject(^^DiskObject diskobj @A0) - extsub @bank 11 -96 = FindToolType(str toolTypeArray @A0, str typeName @A1) -> pointer @D0 - extsub @bank 11 -102 = MatchToolValue(str typeString @A0, str value @A1) -> bool @D0 - extsub @bank 11 -108 = BumpRevision(str newname @A0, str oldname @A1) -> str @D0 - extsub @bank 11 -114 = FreeAlloc(pointer free @A0, long len @A1, long k_type @A2) -> pointer @D0 - extsub @bank 11 -120 = GetDefDiskObject(long k_type @D0) -> ^^DiskObject @D0 - extsub @bank 11 -126 = PutDefDiskObject(^^DiskObject diskObject @A0) -> bool @D0 - extsub @bank 11 -132 = GetDiskObjectNew(str name @A0) -> ^^DiskObject @D0 - extsub @bank 11 -138 = DeleteDiskObject(str name @A0) -> bool @D0 - extsub @bank 11 -144 = FreeFree(pointer fl @A0, pointer address @A1) - extsub @bank 11 -150 = DupDiskObjectA(^^DiskObject diskObject @A0, pointer tags @A1) -> ^^DiskObject @D0 - extsub @bank 11 -156 = IconControlA(^^DiskObject icon @A0, pointer tags @A1) -> long @D0 - extsub @bank 11 -162 = DrawIconStateA(^^graphics.RastPort rp @A0, ^^DiskObject icon @A1, str label @A2, long leftOffset @D0, long topOffset @D1, long state @D2, pointer tags @A3) - extsub @bank 11 -168 = GetIconRectangleA(^^graphics.RastPort rp @A0, ^^DiskObject icon @A1, str label @A2, pointer rect @A3, pointer tags @A4) -> bool @D0 - extsub @bank 11 -174 = NewDiskObject(long k_type @D0) -> ^^DiskObject @D0 - extsub @bank 11 -180 = GetIconTagList(str name @A0, pointer tags @A1) -> ^^DiskObject @D0 - extsub @bank 11 -186 = PutIconTagList(str name @A0, ^^DiskObject icon @A1, pointer tags @A2) -> bool @D0 - extsub @bank 11 -192 = LayoutIconA(^^DiskObject icon @A0, ^^intuition.Screen screen @A1, pointer tags @A2) -> bool @D0 - extsub @bank 11 -198 = ChangeToSelectedIconColor(pointer cr @A0) - extsub @bank 11 -204 = BumpRevisionLength(str newname @A0, str oldname @A1, long maxLength @D0) -> str @D0 - - ; ---- struct definitions ---- - - struct DiskObject { ; total size: 38 - uword Magic ; 0 - uword Version ; 2 - ubyte[4] emb_do_Gadget ; 4 - ubyte Type ; 8 - ubyte Pad_byte ; 9 - pointer DefaultTool ; 10 - pointer ToolTypes ; 14 - long CurrentX ; 18 - long CurrentY ; 22 - pointer DrawerData ; 26 - pointer ToolWindow ; 30 - long StackSize ; 34 - } - - ; ---- constants ---- - const ubyte WORKBENCH_WORKBENCH_I = $0001 - const ubyte WBDISK = $0001 - const ubyte WBDRAWER = $0002 - const ubyte WBTOOL = $0003 - const ubyte WBPROJECT = $0004 - const ubyte WBGARBAGE = $0005 - const ubyte WBDEVICE = $0006 - const ubyte WBKICK = $0007 - const ubyte WBAPPICON = $0008 - const ubyte DDVM_BYDEFAULT = $0000 - const ubyte DDVM_BYICON = $0001 - const ubyte DDVM_BYNAME = $0002 - const ubyte DDVM_BYDATE = $0003 - const ubyte DDVM_BYSIZE = $0004 - const ubyte DDVM_BYTYPE = $0005 - const uword DDFLAGS_SHOWMASK = $0003 - const uword DDFLAGS_SHOWDEFAULT = $0000 - const uword DDFLAGS_SHOWICONS = $0001 - const uword DDFLAGS_SHOWALL = $0002 - const uword DDFLAGS_SORTMASK = $0300 - const uword DDFLAGS_SORTDEFAULT = $0000 - const uword DDFLAGS_SORTASC = $0100 - const uword DDFLAGS_SORTDESC = $0200 - const uword WB_DISKMAGIC = $e310 - const ubyte WB_DISKVERSION = $0001 - const ubyte WB_DISKREVISION = $0001 - const ubyte WB_DISKREVISIONMASK = $ff - const uword GFLG_GADGBACKFILL = $0001 - const uword GADGBACKFILL = $0001 - const long NO_ICON_POSITION = $80000000 - const ubyte AM_VERSION = $0001 - const ubyte AMTYPE_APPWINDOW = $0007 - const ubyte AMTYPE_APPICON = $0008 - const ubyte AMTYPE_APPMENUITEM = $0009 - const ubyte AMTYPE_APPWINDOWZONE = $000a - const ubyte AMCLASSICON_Open = $0000 - const ubyte AMCLASSICON_Copy = $0001 - const ubyte AMCLASSICON_Rename = $0002 - const ubyte AMCLASSICON_Information = $0003 - const ubyte AMCLASSICON_Snapshot = $0004 - const ubyte AMCLASSICON_UnSnapshot = $0005 - const ubyte AMCLASSICON_LeaveOut = $0006 - const ubyte AMCLASSICON_PutAway = $0007 - const ubyte AMCLASSICON_Delete = $0008 - const ubyte AMCLASSICON_FormatDisk = $0009 - const ubyte AMCLASSICON_EjectDisk = $000d - const ubyte AMCLASSICON_EmptyTrash = $000a - const ubyte AMCLASSICON_Selected = $000b - const ubyte AMCLASSICON_Unselected = $000c - const long WBA_Dummy = $8000a000 - const ubyte SCHMSTATE_TryCleanup = $0000 - const ubyte SCHMSTATE_Cleanup = $0001 - const ubyte SCHMSTATE_Setup = $0002 - const long WBF_DRAWERPOSMASK = $00000003 - const long WBF_DRAWERPOSFREE = $00000000 - const long WBF_DRAWERPOSHEAD = $00000001 - const long WBF_DRAWERPOSTAIL = $00000002 - const long WBF_BOUNDTEXTVIEW = $00000080 - const long WBF_OLDDATESFIRST = $00010000 - const ubyte WBO_NONE = $0000 - const ubyte WBO_DRAWER = $0001 - const ubyte WBO_ICON = $0002 - const ubyte ADZMACTION_Enter = $0000 - const ubyte ADZMACTION_Leave = $0001 - const ubyte ISMACTION_Unselect = $0000 - const ubyte ISMACTION_Select = $0001 - const ubyte ISMACTION_Ignore = $0002 - const ubyte ISMACTION_Stop = $0003 - const ubyte CPACTION_Begin = $0000 - const ubyte CPACTION_Copy = $0001 - const ubyte CPACTION_End = $0002 - const ubyte DLACTION_BeginDiscard = $0000 - const ubyte DLACTION_BeginEmptyTrash = $0001 - const ubyte DLACTION_DeleteContents = $0003 - const ubyte DLACTION_DeleteObject = $0004 - const ubyte DLACTION_End = $0005 - const ubyte TIACTION_Rename = $0000 - const ubyte TIACTION_RelabelVolume = $0001 - const ubyte TIACTION_NewDrawer = $0002 - const ubyte TIACTION_Execute = $0003 - const ubyte UPDATEWB_ObjectRemoved = $0000 - const ubyte UPDATEWB_ObjectAdded = $0001 - const long WBAPPICONA_SupportsOpen = $8000a001 - const long WBAPPICONA_SupportsCopy = $8000a002 - const long WBAPPICONA_SupportsRename = $8000a003 - const long WBAPPICONA_SupportsInformation = $8000a004 - const long WBAPPICONA_SupportsSnapshot = $8000a005 - const long WBAPPICONA_SupportsUnSnapshot = $8000a006 - const long WBAPPICONA_SupportsLeaveOut = $8000a007 - const long WBAPPICONA_SupportsPutAway = $8000a008 - const long WBAPPICONA_SupportsDelete = $8000a009 - const long WBAPPICONA_SupportsFormatDisk = $8000a00a - const long WBAPPICONA_SupportsEjectDisk = $8000a09e - const long WBAPPICONA_SupportsEmptyTrash = $8000a00b - const long WBAPPICONA_PropagatePosition = $8000a00c - const long WBAPPICONA_RenderHook = $8000a00d - const long WBAPPICONA_NotifySelectState = $8000a00e - const long WBAPPMENUA_CommandKeyString = $8000a00f - const long WBAPPMENUA_GetKey = $8000a041 - const long WBAPPMENUA_UseKey = $8000a042 - const long WBAPPMENUA_GetTitleKey = $8000a04d - const long WBOPENA_ArgLock = $8000a010 - const long WBOPENA_ArgName = $8000a011 - const long WBOPENA_Show = $8000a04b - const long WBOPENA_ViewBy = $8000a04c - const long WBCTRLA_IsOpen = $8000a012 - const long WBCTRLA_DuplicateSearchPath = $8000a013 - const long WBCTRLA_FreeSearchPath = $8000a014 - const long WBCTRLA_GetDefaultStackSize = $8000a015 - const long WBCTRLA_SetDefaultStackSize = $8000a016 - const long WBCTRLA_RedrawAppIcon = $8000a017 - const long WBCTRLA_GetProgramList = $8000a018 - const long WBCTRLA_FreeProgramList = $8000a019 - const long WBCTRLA_GetSelectedIconList = $8000a024 - const long WBCTRLA_FreeSelectedIconList = $8000a025 - const long WBCTRLA_GetOpenDrawerList = $8000a026 - const long WBCTRLA_FreeOpenDrawerList = $8000a027 - const long WBCTRLA_GetHiddenDeviceList = $8000a02a - const long WBCTRLA_FreeHiddenDeviceList = $8000a02b - const long WBCTRLA_AddHiddenDeviceName = $8000a02c - const long WBCTRLA_RemoveHiddenDeviceName = $8000a02d - const long WBCTRLA_GetTypeRestartTime = $8000a02f - const long WBCTRLA_SetTypeRestartTime = $8000a030 - const long WBCTRLA_GetCopyHook = $8000a045 - const long WBCTRLA_SetCopyHook = $8000a046 - const long WBCTRLA_GetDeleteHook = $8000a047 - const long WBCTRLA_SetDeleteHook = $8000a048 - const long WBCTRLA_GetTextInputHook = $8000a049 - const long WBCTRLA_SetTextInputHook = $8000a04a - const long WBCTRLA_AddSetupCleanupHook = $8000a04e - const long WBCTRLA_RemSetupCleanupHook = $8000a04f - const long WBCTRLA_SetGlobalFlags = $8000a082 - const long WBCTRLA_GetGlobalFlags = $8000a083 - const long WBCTRLA_GetDiskInfoHook = $8000a09f - const long WBCTRLA_SetDiskInfoHook = $8000a0a0 - const long WBDZA_Left = $8000a01a - const long WBDZA_RelRight = $8000a01b - const long WBDZA_Top = $8000a01c - const long WBDZA_RelBottom = $8000a01d - const long WBDZA_Width = $8000a01e - const long WBDZA_RelWidth = $8000a01f - const long WBDZA_Height = $8000a020 - const long WBDZA_RelHeight = $8000a021 - const long WBDZA_Box = $8000a022 - const long WBDZA_Hook = $8000a023 - const long WBOBJA_Type = $8000a056 - const long WBOBJA_Left = $8000a057 - const long WBOBJA_Top = $8000a058 - const long WBOBJA_Width = $8000a059 - const long WBOBJA_Height = $8000a05a - const long WBOBJA_State = $8000a05b - const long WBOBJA_IsFake = $8000a05c - const long WBOBJA_Name = $8000a05d - const long WBOBJA_NameSize = $8000a05e - const long WBOBJA_FullPath = $8000a05f - const long WBOBJA_FullPathSize = $8000a060 - const long WBOBJA_IsLink = $8000a061 - const long WBOBJA_DrawerPath = $8000a062 - const long WBOBJA_DrawerPathSize = $8000a063 - const long WBOBJA_DrawerFlags = $8000a074 - const long WBOBJA_DrawerModes = $8000a075 + %option no_symbol_prefixing, ignore_unused } -;; End of auto-generated icon_lib.sfd diff --git a/compiler/res/prog8lib/amiga500/iffparse.p8 b/compiler/res/prog8lib/amiga500/iffparse.p8 index 609ef8309..a0ce201d6 100644 --- a/compiler/res/prog8lib/amiga500/iffparse.p8 +++ b/compiler/res/prog8lib/amiga500/iffparse.p8 @@ -1,148 +1,5 @@ -;; Auto-generated from iffparse_lib.sfd and iffparse_lib.i -;; Library base: _IFFParseBase in prog8: sys.IFFParseBase -;; Bank: 14 -;; Functions: 40 - -%import exec -%import utility +%import shared_amiga_iffparse iffparse { - %option no_symbol_prefixing - - sub openlib() -> bool { - sys.IFFParseBase = exec.OpenLibrary("iffparse.library", 0) - return sys.IFFParseBase!=0 - } - - sub closelib() { - if sys.IFFParseBase!=0 { - exec.CloseLibrary(sys.IFFParseBase) - sys.IFFParseBase = 0 - } - } - - extsub @bank 14 -30 = AllocIFF() -> ^^IFFHandle @D0 - extsub @bank 14 -36 = OpenIFF(^^IFFHandle iff @A0, long rwMode @D0) -> long @D0 - extsub @bank 14 -42 = ParseIFF(^^IFFHandle iff @A0, long control @D0) -> long @D0 - extsub @bank 14 -48 = CloseIFF(^^IFFHandle iff @A0) - extsub @bank 14 -54 = FreeIFF(^^IFFHandle iff @A0) - extsub @bank 14 -60 = ReadChunkBytes(^^IFFHandle iff @A0, pointer buf @A1, long numBytes @D0) -> long @D0 - extsub @bank 14 -66 = WriteChunkBytes(^^IFFHandle iff @A0, pointer buf @A1, long numBytes @D0) -> long @D0 - extsub @bank 14 -72 = ReadChunkRecords(^^IFFHandle iff @A0, pointer buf @A1, long bytesPerRecord @D0, long numRecords @D1) -> long @D0 - extsub @bank 14 -78 = WriteChunkRecords(^^IFFHandle iff @A0, pointer buf @A1, long bytesPerRecord @D0, long numRecords @D1) -> long @D0 - extsub @bank 14 -84 = PushChunk(^^IFFHandle iff @A0, long k_type @D0, long id @D1, long size @D2) -> long @D0 - extsub @bank 14 -90 = PopChunk(^^IFFHandle iff @A0) -> long @D0 - extsub @bank 14 -102 = EntryHandler(^^IFFHandle iff @A0, long k_type @D0, long id @D1, long position @D2, ^^utility.Hook handler @A1, pointer object @A2) -> long @D0 - extsub @bank 14 -108 = ExitHandler(^^IFFHandle iff @A0, long k_type @D0, long id @D1, long position @D2, ^^utility.Hook handler @A1, pointer object @A2) -> long @D0 - extsub @bank 14 -114 = PropChunk(^^IFFHandle iff @A0, long k_type @D0, long id @D1) -> long @D0 - extsub @bank 14 -120 = PropChunks(^^IFFHandle iff @A0, pointer propArray @A1, long numPairs @D0) -> long @D0 - extsub @bank 14 -126 = StopChunk(^^IFFHandle iff @A0, long k_type @D0, long id @D1) -> long @D0 - extsub @bank 14 -132 = StopChunks(^^IFFHandle iff @A0, pointer propArray @A1, long numPairs @D0) -> long @D0 - extsub @bank 14 -138 = CollectionChunk(^^IFFHandle iff @A0, long k_type @D0, long id @D1) -> long @D0 - extsub @bank 14 -144 = CollectionChunks(^^IFFHandle iff @A0, pointer propArray @A1, long numPairs @D0) -> long @D0 - extsub @bank 14 -150 = StopOnExit(^^IFFHandle iff @A0, long k_type @D0, long id @D1) -> long @D0 - extsub @bank 14 -156 = FindProp(^^IFFHandle iff @A0, long k_type @D0, long id @D1) -> ^^StoredProperty @D0 - extsub @bank 14 -162 = FindCollection(^^IFFHandle iff @A0, long k_type @D0, long id @D1) -> ^^CollectionItem @D0 - extsub @bank 14 -168 = FindPropContext(^^IFFHandle iff @A0) -> ^^ContextNode @D0 - extsub @bank 14 -174 = CurrentChunk(^^IFFHandle iff @A0) -> ^^ContextNode @D0 - extsub @bank 14 -180 = ParentChunk(^^ContextNode contextNode @A0) -> ^^ContextNode @D0 - extsub @bank 14 -186 = AllocLocalItem(long k_type @D0, long id @D1, long ident @D2, long dataSize @D3) -> pointer @D0 - extsub @bank 14 -192 = LocalItemData(pointer localItem @A0) -> pointer @D0 - extsub @bank 14 -198 = SetLocalItemPurge(pointer localItem @A0, ^^utility.Hook purgeHook @A1) - extsub @bank 14 -204 = FreeLocalItem(pointer localItem @A0) - extsub @bank 14 -210 = FindLocalItem(^^IFFHandle iff @A0, long k_type @D0, long id @D1, long ident @D2) -> pointer @D0 - extsub @bank 14 -216 = StoreLocalItem(^^IFFHandle iff @A0, pointer localItem @A1, long position @D0) -> long @D0 - extsub @bank 14 -222 = StoreItemInContext(^^IFFHandle iff @A0, pointer localItem @A1, ^^ContextNode contextNode @A2) - extsub @bank 14 -228 = InitIFF(^^IFFHandle iff @A0, long flags @D0, ^^utility.Hook streamHook @A1) - extsub @bank 14 -234 = InitIFFasDOS(^^IFFHandle iff @A0) - extsub @bank 14 -240 = InitIFFasClip(^^IFFHandle iff @A0) - extsub @bank 14 -246 = OpenClipboard(long unitNumber @D0) -> pointer @D0 - extsub @bank 14 -252 = CloseClipboard(pointer clipHandle @A0) - extsub @bank 14 -258 = GoodID(long id @D0) -> long @D0 - extsub @bank 14 -264 = GoodType(long k_type @D0) -> long @D0 - extsub @bank 14 -270 = IDtoStr(long id @D0, str buf @A0) -> str @D0 - - ; ---- struct definitions ---- - - struct CollectionItem { ; total size: 12 - ^^CollectionItem Next ; 0 - long Size ; 4 - pointer Data ; 8 - } - - struct ContextNode { ; total size: 24 - ^^exec.MinNode Succ ; 0 - ^^exec.MinNode Pred ; 4 - long Id ; 8 - long Type ; 12 - long Size ; 16 - long Scan ; 20 - } - - struct IFFHandle { ; total size: 12 - long Stream ; 0 - long Flags ; 4 - long Depth ; 8 - } - - struct IFFStreamCmd { ; total size: 12 - long Command ; 0 - pointer Buf ; 4 - long NBytes ; 8 - } - - struct StoredProperty { ; total size: 8 - long Size ; 0 - pointer Data ; 4 - } - - ; ---- constants ---- - const ubyte IFFF_READ = $0000 - const ubyte IFFF_WRITE = $0001 - const ubyte IFFF_FSEEK = $0002 - const ubyte IFFF_RSEEK = $0004 - const long IFFF_RESERVED = $FFFF0000 - const long IFFERR_EOF = -1 - const long IFFERR_EOC = -2 - const long IFFERR_NOSCOPE = -3 - const long IFFERR_NOMEM = -4 - const long IFFERR_READ = -5 - const long IFFERR_WRITE = -6 - const long IFFERR_SEEK = -7 - const long IFFERR_MANGLED = -8 - const long IFFERR_SYNTAX = -9 - const long IFFERR_NOTIFF = -10 - const long IFFERR_NOHOOK = -11 - const long IFF_RETURN2CLIENT = -12 - const long ID_FORM = $464f524d - const long ID_LIST = $4c495354 - const long ID_CAT = $43415420 - const long ID_PROP = $50524f50 - const long ID_NULL = $20202020 - const long IFFLCI_PROP = $70726f70 - const long IFFLCI_COLLECTION = $636f6c6c - const long IFFLCI_ENTRYHANDLER = $656e6864 - const long IFFLCI_EXITHANDLER = $65786864 - const ubyte IFFPARSE_SCAN = $0000 - const ubyte IFFPARSE_STEP = $0001 - const ubyte IFFPARSE_RAWSTEP = $0002 - const ubyte IFFSLI_ROOT = $0001 - const ubyte IFFSLI_TOP = $0002 - const ubyte IFFSLI_PROP = $0003 - const long IFFSIZE_UNKNOWN = -1 - const ubyte IFFCMD_INIT = $0000 - const ubyte IFFCMD_CLEANUP = $0001 - const ubyte IFFCMD_READ = $0002 - const ubyte IFFCMD_WRITE = $0003 - const ubyte IFFCMD_SEEK = $0004 - const ubyte IFFCMD_ENTRY = $0005 - const ubyte IFFCMD_EXIT = $0006 - const ubyte IFFCMD_PURGELCI = $0007 - const ubyte IFFF_RWBITS = $0001 - const ubyte IFFSCC_INIT = $0000 - const ubyte IFFSCC_CLEANUP = $0001 - const ubyte IFFSCC_READ = $0002 - const ubyte IFFSCC_WRITE = $0003 - const ubyte IFFSCC_SEEK = $0004 + %option no_symbol_prefixing, ignore_unused } -;; End of auto-generated iffparse_lib.sfd diff --git a/compiler/res/prog8lib/amiga500/intuition.p8 b/compiler/res/prog8lib/amiga500/intuition.p8 index 3ea45fea8..93010e65b 100644 --- a/compiler/res/prog8lib/amiga500/intuition.p8 +++ b/compiler/res/prog8lib/amiga500/intuition.p8 @@ -1,1527 +1,5 @@ -;; Auto-generated from intuition_lib.sfd and intuition_lib.i -;; Library base: _IntuitionBase in prog8: sys.IntuitionBase -;; Bank: 4 -;; Functions: 127 - -%import exec -%import graphics -%import utility +%import shared_amiga_intuition intuition { - %option no_symbol_prefixing - - inline asmsub GetScreenViewPort(^^Screen screen @A0) -> pointer @A1 { - ; ViewPort is embedded at Screen offset 44; the ViewPort struct is not generated - %asm {{ - lea 44(a0), a1 - }} - } - - inline asmsub GetScreenRastPort(^^Screen screen @A0) -> ^^graphics.RastPort @A1 { - ; RastPort is embedded at Screen offset 84 - %asm {{ - lea 84(a0), a1 - }} - } - - inline asmsub GetScreenBitMap(^^Screen screen @A0) -> ^^graphics.BitMap @A1 { - ; BitMap is embedded at Screen offset 184 - %asm {{ - lea 184(a0), a1 - }} - } - - extsub @bank 4 -30 = OpenIntuition() - extsub @bank 4 -36 = Intuition(pointer iEvent @A0) - extsub @bank 4 -42 = AddGadget(^^Window window @A0, ^^Gadget gadget @A1, uword position @D0) -> uword @D0 - extsub @bank 4 -48 = ClearDMRequest(^^Window window @A0) -> bool @D0 - extsub @bank 4 -54 = ClearMenuStrip(^^Window window @A0) - extsub @bank 4 -60 = ClearPointer(^^Window window @A0) - extsub @bank 4 -66 = CloseScreen(^^Screen screen @A0) -> bool @D0 - extsub @bank 4 -72 = CloseWindow(^^Window window @A0) - extsub @bank 4 -78 = CloseWorkBench() -> long @D0 - extsub @bank 4 -84 = CurrentTime(pointer seconds @A0, pointer micros @A1) - extsub @bank 4 -90 = DisplayAlert(long alertNumber @D0, str string @A0, uword height @D1) -> bool @D0 - extsub @bank 4 -96 = DisplayBeep(^^Screen screen @A0) - extsub @bank 4 -102 = DoubleClick(long sSeconds @D0, long sMicros @D1, long cSeconds @D2, long cMicros @D3) -> bool @D0 - extsub @bank 4 -108 = DrawBorder(^^graphics.RastPort rp @A0, ^^Border border @A1, word leftOffset @D0, word topOffset @D1) - extsub @bank 4 -114 = DrawImage(^^graphics.RastPort rp @A0, ^^Image image @A1, word leftOffset @D0, word topOffset @D1) - extsub @bank 4 -120 = EndRequest(^^Requester requester @A0, ^^Window window @A1) - extsub @bank 4 -126 = GetDefPrefs(pointer preferences @A0, word size @D0) -> pointer @D0 - extsub @bank 4 -132 = GetPrefs(pointer preferences @A0, word size @D0) -> pointer @D0 - extsub @bank 4 -138 = InitRequester(^^Requester requester @A0) - extsub @bank 4 -144 = ItemAddress(^^Menu menuStrip @A0, uword menuNumber @D0) -> ^^MenuItem @D0 - extsub @bank 4 -150 = ModifyIDCMP(^^Window window @A0, long flags @D0) -> bool @D0 - extsub @bank 4 -156 = ModifyProp(^^Gadget gadget @A0, ^^Window window @A1, ^^Requester requester @A2, uword flags @D0, uword horizPot @D1, uword vertPot @D2, uword horizBody @D3, uword vertBody @D4) - extsub @bank 4 -162 = MoveScreen(^^Screen screen @A0, word dx @D0, word dy @D1) - extsub @bank 4 -168 = MoveWindow(^^Window window @A0, word dx @D0, word dy @D1) - extsub @bank 4 -174 = OffGadget(^^Gadget gadget @A0, ^^Window window @A1, ^^Requester requester @A2) - extsub @bank 4 -180 = OffMenu(^^Window window @A0, uword menuNumber @D0) - extsub @bank 4 -186 = OnGadget(^^Gadget gadget @A0, ^^Window window @A1, ^^Requester requester @A2) - extsub @bank 4 -192 = OnMenu(^^Window window @A0, uword menuNumber @D0) - extsub @bank 4 -198 = OpenScreen(^^NewScreen newScreen @A0) -> ^^Screen @D0 - extsub @bank 4 -204 = OpenWindow(^^NewWindow newWindow @A0) -> ^^Window @D0 - extsub @bank 4 -210 = OpenWorkBench() -> long @D0 - extsub @bank 4 -216 = PrintIText(^^graphics.RastPort rp @A0, ^^IntuiText iText @A1, word left @D0, word top @D1) - extsub @bank 4 -222 = RefreshGadgets(^^Gadget gadgets @A0, ^^Window window @A1, ^^Requester requester @A2) - extsub @bank 4 -228 = RemoveGadget(^^Window window @A0, ^^Gadget gadget @A1) -> uword @D0 - extsub @bank 4 -234 = ReportMouse(bool flag @D0, ^^Window window @A0) - extsub @bank 4 -240 = Request(^^Requester requester @A0, ^^Window window @A1) -> bool @D0 - extsub @bank 4 -246 = ScreenToBack(^^Screen screen @A0) - extsub @bank 4 -252 = ScreenToFront(^^Screen screen @A0) - extsub @bank 4 -258 = SetDMRequest(^^Window window @A0, ^^Requester requester @A1) -> bool @D0 - extsub @bank 4 -264 = SetMenuStrip(^^Window window @A0, ^^Menu menu @A1) -> bool @D0 - extsub @bank 4 -270 = SetPointer(^^Window window @A0, pointer k_pointer @A1, word height @D0, word width @D1, word xOffset @D2, word yOffset @D3) - extsub @bank 4 -276 = SetWindowTitles(^^Window window @A0, str windowTitle @A1, str screenTitle @A2) - extsub @bank 4 -282 = ShowTitle(^^Screen screen @A0, bool showIt @D0) - extsub @bank 4 -288 = SizeWindow(^^Window window @A0, word dx @D0, word dy @D1) - extsub @bank 4 -294 = ViewAddress() -> ^^graphics.View @D0 - extsub @bank 4 -300 = ViewPortAddress(^^Window window @A0) -> pointer @D0 - extsub @bank 4 -306 = WindowToBack(^^Window window @A0) - extsub @bank 4 -312 = WindowToFront(^^Window window @A0) - extsub @bank 4 -318 = WindowLimits(^^Window window @A0, long widthMin @D0, long heightMin @D1, long widthMax @D2, long heightMax @D3) -> bool @D0 - extsub @bank 4 -324 = SetPrefs(pointer preferences @A0, long size @D0, bool inform @D1) -> pointer @D0 - extsub @bank 4 -330 = IntuiTextLength(^^IntuiText iText @A0) -> long @D0 - extsub @bank 4 -336 = WBenchToBack() -> bool @D0 - extsub @bank 4 -342 = WBenchToFront() -> bool @D0 - extsub @bank 4 -348 = AutoRequest(^^Window window @A0, ^^IntuiText body @A1, ^^IntuiText posText @A2, ^^IntuiText negText @A3, long pFlag @D0, long nFlag @D1, uword width @D2, uword height @D3) -> bool @D0 - extsub @bank 4 -354 = BeginRefresh(^^Window window @A0) - extsub @bank 4 -360 = BuildSysRequest(^^Window window @A0, ^^IntuiText body @A1, ^^IntuiText posText @A2, ^^IntuiText negText @A3, long flags @D0, uword width @D1, uword height @D2) -> ^^Window @D0 - extsub @bank 4 -366 = EndRefresh(^^Window window @A0, long complete @D0) - extsub @bank 4 -372 = FreeSysRequest(^^Window window @A0) - extsub @bank 4 -378 = MakeScreen(^^Screen screen @A0) -> long @D0 - extsub @bank 4 -384 = RemakeDisplay() -> long @D0 - extsub @bank 4 -390 = RethinkDisplay() -> long @D0 - extsub @bank 4 -396 = AllocRemember(pointer rememberKey @A0, long size @D0, long flags @D1) -> pointer @D0 - extsub @bank 4 -402 = AlohaWorkbench(long wbport @A0) - extsub @bank 4 -408 = FreeRemember(pointer rememberKey @A0, bool reallyForget @D0) - extsub @bank 4 -414 = LockIBase(long dontknow @D0) -> long @D0 - extsub @bank 4 -420 = UnlockIBase(long ibLock @A0) - extsub @bank 4 -426 = GetScreenData(pointer buffer @A0, uword size @D0, uword k_type @D1, ^^Screen screen @A1) -> long @D0 - extsub @bank 4 -432 = RefreshGList(^^Gadget gadgets @A0, ^^Window window @A1, ^^Requester requester @A2, word numGad @D0) - extsub @bank 4 -438 = AddGList(^^Window window @A0, ^^Gadget gadget @A1, uword position @D0, word numGad @D1, ^^Requester requester @A2) -> uword @D0 - extsub @bank 4 -444 = RemoveGList(^^Window remPtr @A0, ^^Gadget gadget @A1, word numGad @D0) -> uword @D0 - extsub @bank 4 -450 = ActivateWindow(^^Window window @A0) - extsub @bank 4 -456 = RefreshWindowFrame(^^Window window @A0) - extsub @bank 4 -462 = ActivateGadget(^^Gadget gadgets @A0, ^^Window window @A1, ^^Requester requester @A2) -> bool @D0 - extsub @bank 4 -468 = NewModifyProp(^^Gadget gadget @A0, ^^Window window @A1, ^^Requester requester @A2, uword flags @D0, uword horizPot @D1, uword vertPot @D2, uword horizBody @D3, uword vertBody @D4, word numGad @D5) - extsub @bank 4 -474 = QueryOverscan(long displayID @A0, pointer rect @A1, word oScanType @D0) -> long @D0 - extsub @bank 4 -480 = MoveWindowInFrontOf(^^Window window @A0, ^^Window behindWindow @A1) - extsub @bank 4 -486 = ChangeWindowBox(^^Window window @A0, word left @D0, word top @D1, word width @D2, word height @D3) - extsub @bank 4 -492 = SetEditHook(^^utility.Hook hook @A0) -> ^^utility.Hook @D0 - extsub @bank 4 -498 = SetMouseQueue(^^Window window @A0, uword queueLength @D0) -> long @D0 - extsub @bank 4 -504 = ZipWindow(^^Window window @A0) - extsub @bank 4 -510 = LockPubScreen(str name @A0) -> ^^Screen @D0 - extsub @bank 4 -516 = UnlockPubScreen(str name @A0, ^^Screen screen @A1) - extsub @bank 4 -522 = LockPubScreenList() -> ^^exec.List @D0 - extsub @bank 4 -528 = UnlockPubScreenList() - extsub @bank 4 -534 = NextPubScreen(^^Screen screen @A0, str namebuf @A1) -> str @D0 - extsub @bank 4 -540 = SetDefaultPubScreen(str name @A0) - extsub @bank 4 -546 = SetPubScreenModes(uword modes @D0) -> uword @D0 - extsub @bank 4 -552 = PubScreenStatus(^^Screen screen @A0, uword statusFlags @D0) -> uword @D0 - extsub @bank 4 -558 = ObtainGIRPort(pointer gInfo @A0) -> ^^graphics.RastPort @D0 - extsub @bank 4 -564 = ReleaseGIRPort(^^graphics.RastPort rp @A0) - extsub @bank 4 -570 = GadgetMouse(^^Gadget gadget @A0, pointer gInfo @A1, pointer mousePoint @A2) - extsub @bank 4 -582 = GetDefaultPubScreen(str nameBuffer @A0) - extsub @bank 4 -588 = EasyRequestArgs(^^Window window @A0, ^^EasyStruct easyStruct @A1, pointer idcmpPtr @A2, pointer args @A3) -> long @D0 - extsub @bank 4 -594 = BuildEasyRequestArgs(^^Window window @A0, ^^EasyStruct easyStruct @A1, long idcmp @D0, pointer args @A3) -> ^^Window @D0 - extsub @bank 4 -600 = SysReqHandler(^^Window window @A0, pointer idcmpPtr @A1, bool waitInput @D0) -> long @D0 - extsub @bank 4 -606 = OpenWindowTagList(^^NewWindow newWindow @A0, pointer tagList @A1) -> ^^Window @D0 - extsub @bank 4 -612 = OpenScreenTagList(^^NewScreen newScreen @A0, pointer tagList @A1) -> ^^Screen @D0 - extsub @bank 4 -618 = DrawImageState(^^graphics.RastPort rp @A0, ^^Image image @A1, word leftOffset @D0, word topOffset @D1, long state @D2, ^^DrawInfo drawInfo @A2) - extsub @bank 4 -624 = PointInImage(long point @D0, ^^Image image @A0) -> bool @D0 - extsub @bank 4 -630 = EraseImage(^^graphics.RastPort rp @A0, ^^Image image @A1, word leftOffset @D0, word topOffset @D1) - extsub @bank 4 -636 = NewObjectA(pointer classPtr @A0, str classID @A1, pointer tagList @A2) -> pointer @D0 - extsub @bank 4 -642 = DisposeObject(pointer object @A0) - extsub @bank 4 -648 = SetAttrsA(pointer object @A0, pointer tagList @A1) -> long @D0 - extsub @bank 4 -654 = GetAttr(long attrID @D0, pointer object @A0, pointer storagePtr @A1) -> long @D0 - extsub @bank 4 -660 = SetGadgetAttrsA(^^Gadget gadget @A0, ^^Window window @A1, ^^Requester requester @A2, pointer tagList @A3) -> long @D0 - extsub @bank 4 -666 = NextObject(pointer objectPtrPtr @A0) -> pointer @D0 - extsub @bank 4 -678 = MakeClass(str classID @A0, str superClassID @A1, pointer superClassPtr @A2, uword instanceSize @D0, long flags @D1) -> pointer @D0 - extsub @bank 4 -684 = AddClass(pointer classPtr @A0) - extsub @bank 4 -690 = GetScreenDrawInfo(^^Screen screen @A0) -> ^^DrawInfo @D0 - extsub @bank 4 -696 = FreeScreenDrawInfo(^^Screen screen @A0, ^^DrawInfo drawInfo @A1) - extsub @bank 4 -702 = ResetMenuStrip(^^Window window @A0, ^^Menu menu @A1) -> bool @D0 - extsub @bank 4 -708 = RemoveClass(pointer classPtr @A0) - extsub @bank 4 -714 = FreeClass(pointer classPtr @A0) -> bool @D0 - extsub @bank 4 -768 = AllocScreenBuffer(^^Screen sc @A0, ^^graphics.BitMap bm @A1, long flags @D0) -> pointer @D0 - extsub @bank 4 -774 = FreeScreenBuffer(^^Screen sc @A0, pointer sb @A1) - extsub @bank 4 -780 = ChangeScreenBuffer(^^Screen sc @A0, pointer sb @A1) -> long @D0 - extsub @bank 4 -786 = ScreenDepth(^^Screen screen @A0, long flags @D0, pointer reserved @A1) - extsub @bank 4 -792 = ScreenPosition(^^Screen screen @A0, long flags @D0, long x1 @D1, long y1 @D2, long x2 @D3, long y2 @D4) - extsub @bank 4 -798 = ScrollWindowRaster(^^Window win @A1, word dx @D0, word dy @D1, word xMin @D2, word yMin @D3, word xMax @D4, word yMax @D5) - extsub @bank 4 -804 = LendMenus(^^Window fromwindow @A0, ^^Window towindow @A1) - extsub @bank 4 -810 = DoGadgetMethodA(^^Gadget gad @A0, ^^Window win @A1, ^^Requester req @A2, long message @A3) -> long @D0 - extsub @bank 4 -816 = SetWindowPointerA(^^Window win @A0, pointer taglist @A1) - extsub @bank 4 -822 = TimedDisplayAlert(long alertNumber @D0, str string @A0, uword height @D1, long time @A1) -> bool @D0 - extsub @bank 4 -828 = HelpControl(^^Window win @A0, long flags @D0) - extsub @bank 4 -834 = ShowWindow(^^Window window @A0, ^^Window other @A1) -> bool @D0 - extsub @bank 4 -840 = HideWindow(^^Window window @A0) -> bool @D0 - extsub @bank 4 -1212 = IntuitionControlA(pointer object @A0, pointer taglist @A1) -> long @D0 - - ; ---- struct definitions ---- - - struct Border { ; total size: 16 - word LeftEdge ; 0 - word TopEdge ; 2 - ubyte FrontPen ; 4 - ubyte BackPen ; 5 - ubyte DrawMode ; 6 - byte Count ; 7 - pointer Xy ; 8 - ^^Border NextBorder ; 12 - } - - struct ColorSpec { ; total size: 8 - word ColorIndex ; 0 - uword Red ; 2 - uword Green ; 4 - uword Blue ; 6 - } - - struct DrawInfo { ; total size: 50 - uword Version ; 0 - uword NumPens ; 2 - pointer Pens ; 4 - ^^graphics.TextFont Font ; 8 - uword Depth ; 12 - uword X ; 14 - uword Y ; 16 - long Flags ; 18 - ^^Image CheckMark ; 22 - ^^Image AmigaKey ; 26 - ^^Screen Screen ; 30 - long[4] Reserved ; 34 - } - - struct EasyStruct { ; total size: 20 - long StructSize ; 0 - long Flags ; 4 - str Title ; 8 - str TextFormat ; 12 - str GadgetFormat ; 16 - } - - struct ExtGadget { ; total size: 56 - ^^ExtGadget NextGadget ; 0 - word LeftEdge ; 4 - word TopEdge ; 6 - word Width ; 8 - word Height ; 10 - uword Flags ; 12 - uword Activation ; 14 - uword GadgetType ; 16 - pointer GadgetRender ; 18 - pointer SelectRender ; 22 - ^^IntuiText GadgetText ; 26 - long MutualExclude ; 30 - pointer SpecialInfo ; 34 - uword GadgetID ; 38 - pointer UserData ; 40 - long MoreFlags ; 44 - word BoundsLeftEdge ; 48 - word BoundsTopEdge ; 50 - word BoundsWidth ; 52 - word BoundsHeight ; 54 - } - - struct ExtIntuiMessage { ; total size: 56 - ubyte[20] emb_ExecMessage ; 0 - long Class ; 20 - uword Code ; 24 - uword Qualifier ; 26 - pointer IAddress ; 28 - word MouseX ; 32 - word MouseY ; 34 - long Seconds ; 36 - long Micros ; 40 - ^^Window IDCMPWindow ; 44 - ^^IntuiMessage SpecialLink ; 48 - pointer TabletData ; 52 - } - - struct Gadget { ; total size: 44 - ^^Gadget NextGadget ; 0 - word LeftEdge ; 4 - word TopEdge ; 6 - word Width ; 8 - word Height ; 10 - uword Flags ; 12 - uword Activation ; 14 - uword GadgetType ; 16 - pointer GadgetRender ; 18 - pointer SelectRender ; 22 - ^^IntuiText GadgetText ; 26 - long MutualExclude ; 30 - pointer SpecialInfo ; 34 - uword GadgetID ; 38 - pointer UserData ; 40 - } - - struct IBox { ; total size: 8 - word Left ; 0 - word Top ; 2 - word Width ; 4 - word Height ; 6 - } - - struct Image { ; total size: 20 - word LeftEdge ; 0 - word TopEdge ; 2 - word Width ; 4 - word Height ; 6 - word Depth ; 8 - pointer ImageData ; 10 - ubyte PlanePick ; 14 - ubyte PlaneOnOff ; 15 - ^^Image NextImage ; 16 - } - - struct IntuiMessage { ; total size: 52 - ubyte[20] emb_ExecMessage ; 0 - long Class ; 20 - uword Code ; 24 - uword Qualifier ; 26 - pointer IAddress ; 28 - word MouseX ; 32 - word MouseY ; 34 - long Seconds ; 36 - long Micros ; 40 - ^^Window IDCMPWindow ; 44 - ^^IntuiMessage SpecialLink ; 48 - } - - struct IntuiText { ; total size: 20 - ubyte FrontPen ; 0 - ubyte BackPen ; 1 - ubyte DrawMode ; 2 - ubyte _pad_3 ; 3 - word LeftEdge ; 4 - word TopEdge ; 6 - ^^graphics.TextAttr ITextFont ; 8 - str IText ; 12 - ^^IntuiText NextText ; 16 - } - - struct Menu { ; total size: 30 - ^^Menu NextMenu ; 0 - word LeftEdge ; 4 - word TopEdge ; 6 - word Width ; 8 - word Height ; 10 - uword Flags ; 12 - str MenuName ; 14 - ^^MenuItem FirstItem ; 18 - word JazzX ; 22 - word JazzY ; 24 - word BeatX ; 26 - word BeatY ; 28 - } - - struct MenuItem { ; total size: 34 - ^^MenuItem NextItem ; 0 - word LeftEdge ; 4 - word TopEdge ; 6 - word Width ; 8 - word Height ; 10 - uword Flags ; 12 - long MutualExclude ; 14 - pointer ItemFill ; 18 - pointer SelectFill ; 22 - byte Command ; 26 - ubyte _pad_1b ; 27 - ^^MenuItem SubItem ; 28 - uword NextSelect ; 32 - } - - struct NewScreen { ; total size: 32 - word LeftEdge ; 0 - word TopEdge ; 2 - word Width ; 4 - word Height ; 6 - word Depth ; 8 - ubyte DetailPen ; 10 - ubyte BlockPen ; 11 - uword ViewModes ; 12 - uword Type ; 14 - ^^graphics.TextAttr Font ; 16 - str DefaultTitle ; 20 - ^^Gadget Gadgets ; 24 - ^^graphics.BitMap CustomBitMap ; 28 - } - - struct NewWindow { ; total size: 48 - word LeftEdge ; 0 - word TopEdge ; 2 - word Width ; 4 - word Height ; 6 - ubyte DetailPen ; 8 - ubyte BlockPen ; 9 - long IDCMPFlags ; 10 - long Flags ; 14 - ^^Gadget FirstGadget ; 18 - ^^Image CheckMark ; 22 - str Title ; 26 - ^^Screen Screen ; 30 - ^^graphics.BitMap BitMap ; 34 - word MinWidth ; 38 - word MinHeight ; 40 - uword MaxWidth ; 42 - uword MaxHeight ; 44 - uword Type ; 46 - } - - struct Requester { ; total size: 112 - ^^Requester OlderRequest ; 0 - word LeftEdge ; 4 - word TopEdge ; 6 - word Width ; 8 - word Height ; 10 - word RelLeft ; 12 - word RelTop ; 14 - ^^Gadget ReqGadget ; 16 - ^^Border ReqBorder ; 20 - ^^IntuiText ReqText ; 24 - uword Flags ; 28 - ubyte BackFill ; 30 - ubyte _pad_1f ; 31 - ^^graphics.Layer ReqLayer ; 32 - ubyte[32] ReqPad1 ; 36 - ^^graphics.BitMap ImageBMap ; 68 - ^^Window RWindow ; 72 - ^^Image ReqImage ; 76 - ubyte[32] ReqPad2 ; 80 - } - - struct Screen { ; total size: 44 - ^^Screen NextScreen ; 0 - ^^Window FirstWindow ; 4 - word LeftEdge ; 8 - word TopEdge ; 10 - word Width ; 12 - word Height ; 14 - word MouseY ; 16 - word MouseX ; 18 - uword Flags ; 20 - str Title ; 22 - str DefaultTitle ; 26 - byte BarHeight ; 30 - byte BarVBorder ; 31 - byte BarHBorder ; 32 - byte MenuVBorder ; 33 - byte MenuHBorder ; 34 - byte WBorTop ; 35 - byte WBorLeft ; 36 - byte WBorRight ; 37 - byte WBorBottom ; 38 - ubyte _pad_27 ; 39 - ^^graphics.TextAttr Font ; 40 - ; stripped: pointer UserData (4B), pointer ExtData (4B), ^^graphics.Layer BarLayer (4B), uword SaveColor0 (2B), ubyte BlockPen (1B), ubyte DetailPen (1B), ^^Gadget FirstGadget (4B), ubyte[102] emb_LayerInfo (102B), ubyte[40] emb_BitMap (40B), ubyte[100] emb_RastPort (100B), ubyte[40] emb_ViewPort (40B) - } - - struct Window { ; total size: 136 - ^^Window NextWindow ; 0 - word LeftEdge ; 4 - word TopEdge ; 6 - word Width ; 8 - word Height ; 10 - word MouseY ; 12 - word MouseX ; 14 - word MinWidth ; 16 - word MinHeight ; 18 - uword MaxWidth ; 20 - uword MaxHeight ; 22 - long Flags ; 24 - ^^Menu MenuStrip ; 28 - str Title ; 32 - ^^Requester FirstRequest ; 36 - ^^Requester DMRequest ; 40 - word ReqCount ; 44 - ^^Screen WScreen ; 46 - ^^graphics.RastPort RPort ; 50 - byte BorderLeft ; 54 - byte BorderTop ; 55 - byte BorderRight ; 56 - byte BorderBottom ; 57 - ^^graphics.RastPort BorderRPort ; 58 - ^^Gadget FirstGadget ; 62 - ^^Window Parent ; 66 - ^^Window Descendant ; 70 - pointer Pointer ; 74 - byte PtrHeight ; 78 - byte PtrWidth ; 79 - byte XOffset ; 80 - byte YOffset ; 81 - long IDCMPFlags ; 82 - ^^exec.MsgPort UserPort ; 86 - ^^exec.MsgPort WindowPort ; 90 - ^^IntuiMessage MessageKey ; 94 - ubyte DetailPen ; 98 - ubyte BlockPen ; 99 - ^^Image CheckMark ; 100 - str ScreenTitle ; 104 - word GZZMouseX ; 108 - word GZZMouseY ; 110 - word GZZWidth ; 112 - word GZZHeight ; 114 - pointer ExtData ; 116 - pointer UserData ; 120 - ^^graphics.Layer WLayer ; 124 - ^^graphics.TextFont IFont ; 128 - long MoreFlags ; 132 - } - - ; ---- constants ---- - const ubyte CLB_INLIST = $0000 - const long CLF_INLIST = $00000001 - const uword OM_NEW = $0101 - const uword OM_DISPOSE = $0102 - const uword OM_SET = $0103 - const uword OM_GET = $0104 - const uword OM_ADDTAIL = $0105 - const uword OM_REMOVE = $0106 - const uword OM_NOTIFY = $0107 - const uword OM_UPDATE = $0108 - const uword OM_ADDMEMBER = $0109 - const uword OM_REMMEMBER = $010a - const ubyte OPUB_INTERIM = $0000 - const ubyte OPUF_INTERIM = $0001 - const long GA_Dummy = $80030000 - const long PGA_Dummy = $80031000 - const long STRINGA_Dummy = $80032000 - const ubyte SG_DEFAULTMAXCHARS = $0080 - const long LAYOUTA_Dummy = $80038000 - const ubyte LORIENT_NONE = $0000 - const ubyte LORIENT_HORIZ = $0001 - const ubyte LORIENT_VERT = $0002 - const ubyte GM_HITTEST = $0000 - const ubyte GM_RENDER = $0001 - const ubyte GM_GOACTIVE = $0002 - const ubyte GM_HANDLEINPUT = $0003 - const ubyte GM_GOINACTIVE = $0004 - const ubyte GM_HELPTEST = $0005 - const ubyte GM_LAYOUT = $0006 - const ubyte GM_DOMAIN = $0007 - const ubyte GM_KEYTEST = $0008 - const ubyte GM_KEYGOACTIVE = $0009 - const ubyte GM_KEYGOINACTIVE = $000a - const long GMR_GADGETHIT = $00000004 - const long GMR_NOHELPHIT = $00000000 - const long GMR_HELPHIT = $FFFFFFFF - const long GMR_HELPCODE = $00010000 - const ubyte GREDRAW_UPDATE = $0002 - const ubyte GREDRAW_REDRAW = $0001 - const ubyte GREDRAW_TOGGLE = $0000 - const uword GMR_MEACTIVE = $0000 - const uword GMR_NOREUSE = $0002 - const uword GMR_REUSE = $0004 - const uword GMR_VERIFY = $0008 - const uword GMR_NEXTACTIVE = $0010 - const uword GMR_PREVACTIVE = $0020 - const ubyte GMRB_NOREUSE = $0001 - const ubyte GMRB_REUSE = $0002 - const ubyte GMRB_VERIFY = $0003 - const ubyte GMRB_NEXTACTIVE = $0004 - const ubyte GMRB_PREVACTIVE = $0005 - const uword GMRF_NOREUSE = $0002 - const uword GMRF_REUSE = $0004 - const uword GMRF_VERIFY = $0008 - const uword GMRF_NEXTACTIVE = $0010 - const uword GMRF_PREVACTIVE = $0020 - const ubyte GDOMAIN_MINIMUM = $0000 - const ubyte GDOMAIN_NOMINAL = $0001 - const ubyte GDOMAIN_MAXIMUM = $0002 - const uword GMR_KEYACTIVE = $0010 - const uword GMR_KEYVERIFY = $0020 - const uword ICM_SETLOOP = $402 - const uword ICM_CLEARLOOP = $403 - const uword ICM_CHECKLOOP = $404 - const long ICA_Dummy = $80040000 - const long ICTARGET_IDCMP = $ffffffff - const long CUSTOMIMAGEDEPTH = -1 - const long IMAGE_ATTRIBUTES = $80020000 - const ubyte SYSISIZE_MEDRES = $0000 - const ubyte SYSISIZE_LOWRES = $0001 - const ubyte SYSISIZE_HIRES = $0002 - const ubyte DEPTHIMAGE = $00 - const ubyte ZOOMIMAGE = $01 - const ubyte SIZEIMAGE = $02 - const ubyte CLOSEIMAGE = $03 - const ubyte SDEPTHIMAGE = $05 - const ubyte LEFTIMAGE = $0A - const ubyte UPIMAGE = $0B - const ubyte RIGHTIMAGE = $0C - const ubyte DOWNIMAGE = $0D - const ubyte CHECKIMAGE = $0E - const ubyte MXIMAGE = $0F - const ubyte MENUCHECK = $10 - const ubyte AMIGAKEY = $11 - const ubyte ICONIFYIMAGE = $16 - const ubyte MENUMX = $1B - const ubyte MENUSUB = $1C - const ubyte SHIFTKEYIMAGE = $2A - const ubyte FRAME_DEFAULT = $0000 - const ubyte FRAME_BUTTON = $0001 - const ubyte FRAME_RIDGE = $0002 - const ubyte FRAME_ICONDROPBOX = $0003 - const ubyte FRAME_PROPBORDER = $0004 - const ubyte FRAME_PROPKNOB = $0005 - const ubyte FRAME_DISPLAY = $0006 - const ubyte FRAME_CONTEXT = $0007 - const uword IM_DRAW = $0202 - const uword IM_HITTEST = $0203 - const uword IM_ERASE = $0204 - const uword IM_MOVE = $0205 - const uword IM_DRAWFRAME = $0206 - const uword IM_FRAMEBOX = $0207 - const uword IM_HITFRAME = $0208 - const uword IM_ERASEFRAME = $0209 - const uword IM_DOMAINFRAME = $020A - const ubyte IDS_NORMAL = $0000 - const ubyte IDS_SELECTED = $0001 - const ubyte IDS_DISABLED = $0002 - const ubyte IDS_BUSY = $0003 - const ubyte IDS_INDETERMINATE = $0004 - const ubyte IDS_INACTIVENORMAL = $0005 - const ubyte IDS_INACTIVESELECTED = $0006 - const ubyte IDS_INACTIVEDISABLED = $0007 - const ubyte IDS_SELECTEDDISABLED = $0008 - const ubyte FRAMEB_SPECIFY = $0000 - const ubyte FRAMEF_SPECIFY = $0001 - const ubyte FRAMEB_MINIMAL = $0001 - const ubyte FRAMEF_MINIMAL = $0002 - const ubyte IDOMAIN_MINIMUM = $0000 - const ubyte IDOMAIN_NOMINAL = $0001 - const ubyte IDOMAIN_MAXIMUM = $0002 - const uword MENUENABLED = $0001 - const uword MIDRAWN = $0100 - const uword CHECKIT = $0001 - const uword ITEMTEXT = $0002 - const uword COMMSEQ = $0004 - const uword MENUTOGGLE = $0008 - const uword ITEMENABLED = $0010 - const uword HIGHFLAGS = $00C0 - const uword HIGHIMAGE = $0000 - const uword HIGHCOMP = $0040 - const uword HIGHBOX = $0080 - const uword HIGHNONE = $00C0 - const uword CHECKED = $0100 - const uword ISDRAWN = $1000 - const uword HIGHITEM = $2000 - const uword MENUTOGGLED = $4000 - const uword POINTREL = $0001 - const uword PREDRAWN = $0002 - const uword NOISYREQ = $0004 - const uword SIMPLEREQ = $0010 - const uword USEREQIMAGE = $0020 - const uword NOREQBACKFILL = $0040 - const uword REQOFFWINDOW = $1000 - const uword REQACTIVE = $2000 - const uword SYSREQUEST = $4000 - const uword DEFERREFRESH = $8000 - const uword GFLG_GADGHIGHBITS = $0003 - const uword GFLG_GADGHCOMP = $0000 - const uword GFLG_GADGHBOX = $0001 - const uword GFLG_GADGHIMAGE = $0002 - const uword GFLG_GADGHNONE = $0003 - const uword GFLG_GADGIMAGE = $0004 - const uword GFLG_RELBOTTOM = $0008 - const uword GFLG_RELRIGHT = $0010 - const uword GFLG_RELWIDTH = $0020 - const uword GFLG_RELHEIGHT = $0040 - const uword GFLG_RELSPECIAL = $4000 - const uword GFLG_SELECTED = $0080 - const uword GFLG_DISABLED = $0100 - const uword GFLG_LABELMASK = $3000 - const uword GFLG_LABELITEXT = $0000 - const uword GFLG_LABELSTRING = $1000 - const uword GFLG_LABELIMAGE = $2000 - const uword GFLG_TABCYCLE = $0200 - const uword GFLG_STRINGEXTEND = $0400 - const uword GFLG_IMAGEDISABLE = $0800 - const uword GFLG_EXTENDED = $8000 - const uword GACT_RELVERIFY = $0001 - const uword GACT_IMMEDIATE = $0002 - const uword GACT_ENDGADGET = $0004 - const uword GACT_FOLLOWMOUSE = $0008 - const uword GACT_RIGHTBORDER = $0010 - const uword GACT_LEFTBORDER = $0020 - const uword GACT_TOPBORDER = $0040 - const uword GACT_BOTTOMBORDER = $0080 - const uword GACT_BORDERSNIFF = $8000 - const uword GACT_TOGGLESELECT = $0100 - const uword GACT_BOOLEXTEND = $2000 - const uword GACT_STRINGLEFT = $0000 - const uword GACT_STRINGCENTER = $0200 - const uword GACT_STRINGRIGHT = $0400 - const uword GACT_LONGINT = $0800 - const uword GACT_ALTKEYMAP = $1000 - const uword GACT_STRINGEXTEND = $2000 - const uword GACT_ACTIVEGADGET = $4000 - const uword GTYP_GADGETTYPE = $FC00 - const uword GTYP_SCRGADGET = $4000 - const uword GTYP_GZZGADGET = $2000 - const uword GTYP_REQGADGET = $1000 - const uword GTYP_SYSGADGET = $8000 - const uword GTYP_SYSTYPEMASK = $00F0 - const uword GTYP_SIZING = $0010 - const uword GTYP_WDRAGGING = $0020 - const uword GTYP_SDRAGGING = $0030 - const uword GTYP_WDEPTH = $0040 - const uword GTYP_SDEPTH = $0050 - const uword GTYP_WZOOM = $0060 - const uword GTYP_SUNUSED = $0070 - const uword GTYP_CLOSE = $0080 - const uword GTYP_ICONIFY = $0090 - const uword GTYP_GTYPEMASK = $0007 - const uword GTYP_BOOLGADGET = $0001 - const uword GTYP_GADGET0002 = $0002 - const uword GTYP_PROPGADGET = $0003 - const uword GTYP_STRGADGET = $0004 - const uword GTYP_CUSTOMGADGET = $0005 - const long GMORE_BOUNDS = $00000001 - const long GMORE_GADGETHELP = $00000002 - const long GMORE_SCROLLRASTER = $00000004 - const long GMORE_HIDDEN = $00000010 - const long GMORE_BOOPSIGADGET = $00000400 - const long GMORE_FREEIMAGE = $00000800 - const long GMORE_PARENTHIDDEN = $01000000 - const uword BOOLMASK = $0001 - const uword AUTOKNOB = $0001 - const uword FREEHORIZ = $0002 - const uword FREEVERT = $0004 - const uword PROPBORDERLESS = $0008 - const uword KNOBHIT = $0100 - const uword PROPNEWLOOK = $0010 - const uword SMARTKNOBIMAGE = $0020 - const ubyte KNOBHMIN = $0006 - const ubyte KNOBVMIN = $0004 - const uword MAXBODY = $FFFF - const uword MAXPOT = $FFFF - const long IDCMP_SIZEVERIFY = $00000001 - const long IDCMP_NEWSIZE = $00000002 - const long IDCMP_REFRESHWINDOW = $00000004 - const long IDCMP_MOUSEBUTTONS = $00000008 - const long IDCMP_MOUSEMOVE = $00000010 - const long IDCMP_GADGETDOWN = $00000020 - const long IDCMP_GADGETUP = $00000040 - const long IDCMP_REQSET = $00000080 - const long IDCMP_MENUPICK = $00000100 - const long IDCMP_CLOSEWINDOW = $00000200 - const long IDCMP_RAWKEY = $00000400 - const long IDCMP_REQVERIFY = $00000800 - const long IDCMP_REQCLEAR = $00001000 - const long IDCMP_MENUVERIFY = $00002000 - const long IDCMP_NEWPREFS = $00004000 - const long IDCMP_DISKINSERTED = $00008000 - const long IDCMP_DISKREMOVED = $00010000 - const long IDCMP_WBENCHMESSAGE = $00020000 - const long IDCMP_ACTIVEWINDOW = $00040000 - const long IDCMP_INACTIVEWINDOW = $00080000 - const long IDCMP_DELTAMOVE = $00100000 - const long IDCMP_VANILLAKEY = $00200000 - const long IDCMP_INTUITICKS = $00400000 - const long IDCMP_IDCMPUPDATE = $00800000 - const long IDCMP_MENUHELP = $01000000 - const long IDCMP_CHANGEWINDOW = $02000000 - const long IDCMP_GADGETHELP = $04000000 - const long IDCMP_LONELYMESSAGE = $80000000 - const uword CWCODE_MOVESIZE = $0000 - const uword CWCODE_DEPTH = $0001 - const uword CWCODE_HIDE = $0002 - const uword CWCODE_SHOW = $0003 - const uword MENUHOT = $0001 - const uword MENUCANCEL = $0002 - const uword MENUWAITING = $0003 - const uword OKABORT = $0004 - const uword WBENCHOPEN = $0001 - const uword WBENCHCLOSE = $0002 - const uword WFLG_SIZEGADGET = $0001 - const uword WFLG_DRAGBAR = $0002 - const uword WFLG_DEPTHGADGET = $0004 - const uword WFLG_CLOSEGADGET = $0008 - const uword WFLG_SIZEBRIGHT = $0010 - const uword WFLG_SIZEBBOTTOM = $0020 - const uword WFLG_REFRESHBITS = $00C0 - const uword WFLG_SMART_REFRESH = $0000 - const uword WFLG_SIMPLE_REFRESH = $0040 - const uword WFLG_SUPER_BITMAP = $0080 - const uword WFLG_OTHER_REFRESH = $00C0 - const uword WFLG_BACKDROP = $0100 - const uword WFLG_REPORTMOUSE = $0200 - const uword WFLG_GIMMEZEROZERO = $0400 - const uword WFLG_BORDERLESS = $0800 - const uword WFLG_ACTIVATE = $1000 - const long WFLG_RMBTRAP = $00010000 - const long WFLG_NOCAREREFRESH = $00020000 - const long WFLG_NW_EXTENDED = $00040000 - const long WFLG_NEWLOOKMENUS = $00200000 - const uword WFLG_WINDOWACTIVE = $2000 - const uword WFLG_INREQUEST = $4000 - const uword WFLG_MENUSTATE = $8000 - const long WFLG_WINDOWREFRESH = $01000000 - const long WFLG_WBENCHWINDOW = $02000000 - const long WFLG_WINDOWTICKED = $04000000 - const long WFLG_VISITOR = $08000000 - const long WFLG_ZOOMED = $10000000 - const long WFLG_HASZOOM = $20000000 - const long WFLG_HASICONIFY = $40000000 - const long SUPER_UNUSED = $FCFC0000 - const ubyte DEFAULTMOUSEQUEUE = $0005 - const long WA_Left = $80000064 - const long WA_Top = $80000065 - const long WA_Width = $80000066 - const long WA_Height = $80000067 - const long WA_DetailPen = $80000068 - const long WA_BlockPen = $80000069 - const long WA_IDCMP = $8000006a - const long WA_Flags = $8000006b - const long WA_Gadgets = $8000006c - const long WA_Checkmark = $8000006d - const long WA_Title = $8000006e - const long WA_ScreenTitle = $8000006f - const long WA_CustomScreen = $80000070 - const long WA_SuperBitMap = $80000071 - const long WA_MinWidth = $80000072 - const long WA_MinHeight = $80000073 - const long WA_MaxWidth = $80000074 - const long WA_MaxHeight = $80000075 - const long WA_InnerWidth = $80000076 - const long WA_InnerHeight = $80000077 - const long WA_PubScreenName = $80000078 - const long WA_PubScreen = $80000079 - const long WA_PubScreenFallBack = $8000007a - const long WA_WindowName = $8000007b - const long WA_Colors = $8000007c - const long WA_Zoom = $8000007d - const long WA_MouseQueue = $8000007e - const long WA_BackFill = $8000007f - const long WA_RptQueue = $80000080 - const long WA_SizeGadget = $80000081 - const long WA_DragBar = $80000082 - const long WA_DepthGadget = $80000083 - const long WA_CloseGadget = $80000084 - const long WA_Backdrop = $80000085 - const long WA_ReportMouse = $80000086 - const long WA_NoCareRefresh = $80000087 - const long WA_Borderless = $80000088 - const long WA_Activate = $80000089 - const long WA_RMBTrap = $8000008a - const long WA_WBenchWindow = $8000008b - const long WA_SimpleRefresh = $8000008c - const long WA_SmartRefresh = $8000008d - const long WA_SizeBRight = $8000008e - const long WA_SizeBBottom = $8000008f - const long WA_AutoAdjust = $80000090 - const long WA_GimmeZeroZero = $80000091 - const long WA_MenuHelp = $80000092 - const long WA_NewLookMenus = $80000093 - const long WA_AmigaKey = $80000094 - const long WA_NotifyDepth = $80000095 - const long WA_Obsolete = $80000096 - const long WA_Pointer = $80000097 - const long WA_BusyPointer = $80000098 - const long WA_PointerDelay = $80000099 - const long WA_TabletMessages = $8000009a - const long WA_HelpGroup = $8000009b - const long WA_HelpGroupWindow = $8000009c - const long WA_Hidden = $8000009f - const long WA_PointerType = $800000b3 - const long WA_IconifyGadget = $800000c3 - const ubyte HC_GADGETHELP = $0001 - const ubyte WINDOW_BACKMOST = $0000 - const ubyte WINDOW_FRONTMOST = $0001 - const uword NOMENU = $001F - const uword NOITEM = $003F - const uword NOSUB = $001F - const uword MENUNULL = $FFFF - const ubyte CHECKWIDTH = $0013 - const ubyte COMMWIDTH = $001b - const ubyte LOWCHECKWIDTH = $000d - const ubyte LOWCOMMWIDTH = $0010 - const long ALERT_TYPE = $80000000 - const long RECOVERY_ALERT = $00000000 - const long DEADEND_ALERT = $80000000 - const ubyte AUTOFRONTPEN = $0000 - const ubyte AUTOBACKPEN = $0001 - const ubyte AUTOLEFTEDGE = $0006 - const ubyte AUTOTOPEDGE = $0003 - const ubyte AUTOITEXTFONT = $0000 - const ubyte AUTONEXTTEXT = $0000 - const ubyte CURSORUP = $4C - const ubyte CURSORLEFT = $4F - const ubyte CURSORRIGHT = $4E - const ubyte CURSORDOWN = $4D - const ubyte KEYCODE_Q = $10 - const ubyte KEYCODE_Z = $31 - const ubyte KEYCODE_X = $32 - const ubyte KEYCODE_V = $34 - const ubyte KEYCODE_B = $35 - const ubyte KEYCODE_N = $36 - const ubyte KEYCODE_M = $37 - const ubyte KEYCODE_LESS = $38 - const ubyte KEYCODE_GREATER = $39 - const long TABLETA_Dummy = $8003a000 - const long POINTERA_Dummy = $80039000 - const ubyte POINTERXRESN_DEFAULT = $0000 - const ubyte POINTERXRESN_140NS = $0001 - const ubyte POINTERXRESN_70NS = $0002 - const ubyte POINTERXRESN_35NS = $0003 - const ubyte POINTERXRESN_SCREENRES = $0004 - const ubyte POINTERXRESN_LORES = $0005 - const ubyte POINTERXRESN_HIRES = $0006 - const ubyte POINTERYRESN_DEFAULT = $0000 - const ubyte POINTERYRESN_HIGH = $0002 - const ubyte POINTERYRESN_HIGHASPECT = $0003 - const ubyte POINTERYRESN_SCREENRES = $0004 - const ubyte POINTERYRESN_SCREENRESASPECT = $0005 - const ubyte FILENAME_SIZE = $001e - const ubyte DEVNAME_SIZE = $0010 - const ubyte TOPAZ_EIGHTY = $0008 - const ubyte TOPAZ_SIXTY = $0009 - const ubyte LACEWB = $01 - const uword SCREEN_DRAG = $4000 - const uword MOUSE_ACCEL = $8000 - const ubyte PARALLEL_PRINTER = $00 - const ubyte SERIAL_PRINTER = $01 - const ubyte BAUD_110 = $00 - const ubyte BAUD_300 = $01 - const ubyte BAUD_1200 = $02 - const ubyte BAUD_2400 = $03 - const ubyte BAUD_4800 = $04 - const ubyte BAUD_9600 = $05 - const ubyte BAUD_19200 = $06 - const ubyte BAUD_MIDI = $07 - const ubyte FANFOLD = $00 - const ubyte SINGLE = $80 - const ubyte PICA = $000 - const uword ELITE = $400 - const uword FINE = $800 - const ubyte DRAFT = $000 - const uword LETTER = $100 - const ubyte SIX_LPI = $000 - const uword EIGHT_LPI = $200 - const ubyte IMAGE_POSITIVE = $00 - const ubyte IMAGE_NEGATIVE = $01 - const ubyte ASPECT_HORIZ = $00 - const ubyte ASPECT_VERT = $01 - const ubyte SHADE_BW = $00 - const ubyte SHADE_GREYSCALE = $01 - const ubyte SHADE_COLOR = $02 - const ubyte US_LETTER = $00 - const ubyte US_LEGAL = $10 - const ubyte N_TRACTOR = $20 - const ubyte W_TRACTOR = $30 - const ubyte CUSTOM = $40 - const ubyte EURO_A0 = $50 - const ubyte EURO_A1 = $60 - const ubyte EURO_A2 = $70 - const ubyte EURO_A3 = $80 - const ubyte EURO_A4 = $90 - const ubyte EURO_A5 = $A0 - const ubyte EURO_A6 = $B0 - const ubyte EURO_A7 = $C0 - const ubyte EURO_A8 = $D0 - const ubyte CUSTOM_NAME = $00 - const ubyte ALPHA_P_101 = $01 - const ubyte BROTHER_15XL = $02 - const ubyte CBM_MPS1000 = $03 - const ubyte DIAB_630 = $04 - const ubyte DIAB_ADV_D25 = $05 - const ubyte DIAB_C_150 = $06 - const ubyte EPSON = $07 - const ubyte EPSON_JX_80 = $08 - const ubyte OKIMATE_20 = $09 - const ubyte QUME_LP_20 = $0A - const ubyte HP_LASERJET = $0B - const ubyte HP_LASERJET_PLUS = $0C - const ubyte SBUF_512 = $00 - const ubyte SBUF_1024 = $01 - const ubyte SBUF_2048 = $02 - const ubyte SBUF_4096 = $03 - const ubyte SBUF_8000 = $04 - const ubyte SBUF_16000 = $05 - const ubyte SREAD_BITS = $F0 - const ubyte SWRITE_BITS = $0F - const ubyte SSTOP_BITS = $F0 - const ubyte SBUFSIZE_BITS = $0F - const ubyte SPARITY_BITS = $F0 - const ubyte SHSHAKE_BITS = $0F - const ubyte SPARITY_NONE = $00 - const ubyte SPARITY_EVEN = $01 - const ubyte SPARITY_ODD = $02 - const ubyte SPARITY_MARK = $03 - const ubyte SPARITY_SPACE = $04 - const ubyte SHSHAKE_XON = $00 - const ubyte SHSHAKE_RTS = $01 - const ubyte SHSHAKE_NONE = $02 - const uword CORRECT_RED = $0001 - const uword CORRECT_GREEN = $0002 - const uword CORRECT_BLUE = $0004 - const uword CENTER_IMAGE = $0008 - const uword IGNORE_DIMENSIONS = $0000 - const uword BOUNDED_DIMENSIONS = $0010 - const uword ABSOLUTE_DIMENSIONS = $0020 - const uword PIXEL_DIMENSIONS = $0040 - const uword MULTIPLY_DIMENSIONS = $0080 - const uword INTEGER_SCALING = $0100 - const uword ORDERED_DITHERING = $0000 - const uword HALFTONE_DITHERING = $0200 - const uword FLOYD_DITHERING = $0400 - const uword ANTI_ALIAS = $0800 - const uword GREY_SCALE2 = $1000 - const ubyte DRI_VERSION = $0002 - const long DRIF_NEWLOOK = $00000001 - const ubyte DRIB_NEWLOOK = $0000 - const uword PEN_C3 = $FEFC - const uword PEN_C2 = $FEFD - const uword PEN_C1 = $FEFE - const uword PEN_C0 = $FEFF - const uword SCREENTYPE = $000F - const uword WBENCHSCREEN = $0001 - const uword PUBLICSCREEN = $0002 - const uword CUSTOMSCREEN = $000F - const uword SHOWTITLE = $0010 - const uword BEEPING = $0020 - const uword CUSTOMBITMAP = $0040 - const uword SCREENBEHIND = $0080 - const uword SCREENQUIET = $0100 - const uword SCREENHIRES = $0200 - const long STDSCREENHEIGHT = -1 - const long STDSCREENWIDTH = -1 - const uword NS_EXTENDED = $1000 - const uword AUTOSCROLL = $4000 - const uword PENSHARED = $0400 - const long SA_Left = $80000021 - const long SA_Top = $80000022 - const long SA_Width = $80000023 - const long SA_Height = $80000024 - const long SA_Depth = $80000025 - const long SA_DetailPen = $80000026 - const long SA_BlockPen = $80000027 - const long SA_Title = $80000028 - const long SA_Colors = $80000029 - const long SA_ErrorCode = $8000002a - const long SA_Font = $8000002b - const long SA_SysFont = $8000002c - const long SA_Type = $8000002d - const long SA_BitMap = $8000002e - const long SA_PubName = $8000002f - const long SA_PubSig = $80000030 - const long SA_PubTask = $80000031 - const long SA_DisplayID = $80000032 - const long SA_DClip = $80000033 - const long SA_Overscan = $80000034 - const long SA_Obsolete1 = $80000035 - const long SA_ShowTitle = $80000036 - const long SA_Behind = $80000037 - const long SA_Quiet = $80000038 - const long SA_AutoScroll = $80000039 - const long SA_Pens = $8000003a - const long SA_FullPalette = $8000003b - const long SA_ColorMapEntries = $8000003c - const long SA_Parent = $8000003d - const long SA_Draggable = $8000003e - const long SA_Exclusive = $8000003f - const long SA_SharePens = $80000040 - const long SA_BackFill = $80000041 - const long SA_Interleaved = $80000042 - const long SA_Colors32 = $80000043 - const long SA_VideoControl = $80000044 - const long SA_FrontChild = $80000045 - const long SA_BackChild = $80000046 - const long SA_LikeWorkbench = $80000047 - const long SA_Reserved = $80000048 - const long SA_MinimizeISG = $80000049 - const long SA_OffScreenDragging = $8000004a - const ubyte OSERR_NOMONITOR = $0001 - const ubyte OSERR_NOCHIPS = $0002 - const ubyte OSERR_NOMEM = $0003 - const ubyte OSERR_NOCHIPMEM = $0004 - const ubyte OSERR_PUBNOTUNIQUE = $0005 - const ubyte OSERR_UNKNOWNMODE = $0006 - const ubyte OSERR_TOODEEP = $0007 - const ubyte OSERR_ATTACHFAIL = $0008 - const ubyte OSERR_NOTAVAILABLE = $0009 - const ubyte OSCAN_TEXT = $0001 - const ubyte OSCAN_STANDARD = $0002 - const ubyte OSCAN_MAX = $0003 - const ubyte OSCAN_VIDEO = $0004 - const uword PSNF_PRIVATE = $0001 - const ubyte MAXPUBSCREENNAME = $008b - const uword SHANGHAI = $0001 - const uword POPPUBSCREEN = $0002 - const ubyte SDEPTH_TOFRONT = $0000 - const ubyte SDEPTH_TOBACK = $0001 - const ubyte SDEPTH_INFAMILY = $0002 - const ubyte SPOS_RELATIVE = $0000 - const ubyte SPOS_ABSOLUTE = $0001 - const ubyte SPOS_MAKEVISIBLE = $0002 - const ubyte SPOS_FORCEDRAG = $0004 - const ubyte SB_SCREEN_BITMAP = $0001 - const ubyte SB_COPY_BITMAP = $0002 - const uword EO_NOOP = $0001 - const uword EO_DELBACKWARD = $0002 - const uword EO_DELFORWARD = $0003 - const uword EO_MOVECURSOR = $0004 - const uword EO_ENTER = $0005 - const uword EO_RESET = $0006 - const uword EO_REPLACECHAR = $0007 - const uword EO_INSERTCHAR = $0008 - const uword EO_BADFORMAT = $0009 - const uword EO_BIGCHANGE = $000A - const uword EO_UNDO = $000B - const uword EO_CLEAR = $000C - const uword EO_SPECIAL = $000D - const ubyte SGM_REPLACE = $0001 - const ubyte SGMB_REPLACE = $0000 - const ubyte SGMF_REPLACE = $0001 - const long SGM_FIXEDFIELD = $00000002 - const ubyte SGMB_FIXEDFIELD = $0001 - const ubyte SGMF_FIXEDFIELD = $0002 - const long SGM_NOFILTER = $00000004 - const ubyte SGMB_NOFILTER = $0002 - const ubyte SGMF_NOFILTER = $0004 - const long SGM_EXITHELP = $00000080 - const ubyte SGMB_EXITHELP = $0007 - const ubyte SGMF_EXITHELP = $80 - const ubyte SGA_USE = $1 - const ubyte SGAB_USE = $0000 - const ubyte SGAF_USE = $1 - const ubyte SGA_END = $2 - const ubyte SGAB_END = $0001 - const ubyte SGAF_END = $2 - const ubyte SGA_BEEP = $4 - const ubyte SGAB_BEEP = $0002 - const ubyte SGAF_BEEP = $4 - const ubyte SGA_REUSE = $8 - const ubyte SGAB_REUSE = $0003 - const ubyte SGAF_REUSE = $8 - const ubyte SGA_REDISPLAY = $10 - const ubyte SGAB_REDISPLAY = $0004 - const ubyte SGAF_REDISPLAY = $10 - const ubyte SGA_NEXTACTIVE = $20 - const ubyte SGAB_NEXTACTIVE = $0005 - const ubyte SGAF_NEXTACTIVE = $20 - const ubyte SGA_PREVACTIVE = $40 - const ubyte SGAB_PREVACTIVE = $0006 - const ubyte SGAF_PREVACTIVE = $40 - const ubyte SGH_KEY = $0001 - const ubyte SGH_CLICK = $0002 - const uword IECLASS_NULL = $00 - const uword IECLASS_RAWKEY = $01 - const uword IECLASS_RAWMOUSE = $02 - const uword IECLASS_EVENT = $03 - const uword IECLASS_POINTERPOS = $04 - const uword IECLASS_TIMER = $06 - const uword IECLASS_GADGETDOWN = $07 - const uword IECLASS_GADGETUP = $08 - const uword IECLASS_REQUESTER = $09 - const uword IECLASS_MENULIST = $0A - const uword IECLASS_CLOSEWINDOW = $0B - const uword IECLASS_SIZEWINDOW = $0C - const uword IECLASS_REFRESHWINDOW = $0D - const uword IECLASS_NEWPREFS = $0E - const uword IECLASS_DISKREMOVED = $0F - const uword IECLASS_DISKINSERTED = $10 - const uword IECLASS_ACTIVEWINDOW = $11 - const uword IECLASS_INACTIVEWINDOW = $12 - const uword IECLASS_NEWPOINTERPOS = $13 - const uword IECLASS_MENUHELP = $14 - const uword IECLASS_CHANGEWINDOW = $15 - const uword IECLASS_MAX = $15 - const uword IESUBCLASS_COMPATIBLE = $00 - const uword IESUBCLASS_PIXEL = $01 - const uword IESUBCLASS_TABLET = $02 - const uword IESUBCLASS_NEWTABLET = $03 - const uword IECODE_UP_PREFIX = $80 - const uword IECODEB_UP_PREFIX = $0007 - const uword IECODE_KEY_CODE_FIRST = $00 - const uword IECODE_KEY_CODE_LAST = $77 - const uword IECODE_COMM_CODE_FIRST = $78 - const uword IECODE_COMM_CODE_LAST = $7F - const uword IECODE_C0_FIRST = $00 - const uword IECODE_C0_LAST = $1F - const uword IECODE_ASCII_FIRST = $20 - const uword IECODE_ASCII_LAST = $7E - const uword IECODE_ASCII_DEL = $7F - const uword IECODE_C1_FIRST = $80 - const uword IECODE_C1_LAST = $9F - const uword IECODE_LATIN1_FIRST = $A0 - const uword IECODE_LATIN1_LAST = $FF - const uword IECODE_LBUTTON = $68 - const uword IECODE_RBUTTON = $69 - const uword IECODE_MBUTTON = $6A - const uword IECODE_NOBUTTON = $FF - const uword IECODE_NEWACTIVE = $01 - const uword IECODE_NEWSIZE = $02 - const uword IECODE_REFRESH = $03 - const uword IECODE_REQSET = $01 - const uword IECODE_REQCLEAR = $00 - const uword IEQUALIFIER_LSHIFT = $0001 - const uword IEQUALIFIER_RSHIFT = $0002 - const uword IEQUALIFIER_CAPSLOCK = $0004 - const uword IEQUALIFIER_CONTROL = $0008 - const uword IEQUALIFIER_LALT = $0010 - const uword IEQUALIFIER_RALT = $0020 - const uword IEQUALIFIER_LCOMMAND = $0040 - const uword IEQUALIFIER_RCOMMAND = $0080 - const uword IEQUALIFIER_NUMERICPAD = $0100 - const uword IEQUALIFIER_REPEAT = $0200 - const uword IEQUALIFIER_INTERRUPT = $0400 - const uword IEQUALIFIER_MULTIBROADCAST = $0800 - const uword IEQUALIFIER_MIDBUTTON = $1000 - const uword IEQUALIFIER_RBUTTON = $2000 - const uword IEQUALIFIER_LEFTBUTTON = $4000 - const uword IEQUALIFIER_RELATIVEMOUSE = $8000 - const uword IEQUALIFIERB_LSHIFT = $0000 - const uword IEQUALIFIERB_RSHIFT = $0001 - const uword IEQUALIFIERB_CAPSLOCK = $0002 - const uword IEQUALIFIERB_CONTROL = $0003 - const uword IEQUALIFIERB_LALT = $0004 - const uword IEQUALIFIERB_RALT = $0005 - const uword IEQUALIFIERB_LCOMMAND = $0006 - const uword IEQUALIFIERB_RCOMMAND = $0007 - const uword IEQUALIFIERB_NUMERICPAD = $0008 - const uword IEQUALIFIERB_REPEAT = $0009 - const uword IEQUALIFIERB_INTERRUPT = $000a - const uword IEQUALIFIERB_MULTIBROADCAST = $000b - const uword IEQUALIFIERB_MIDBUTTON = $000c - const uword IEQUALIFIERB_RBUTTON = $000d - const uword IEQUALIFIERB_LEFTBUTTON = $000e - const uword IEQUALIFIERB_RELATIVEMOUSE = $000f - const long GA_Left = $80030001 - const long GA_RelRight = $80030002 - const long GA_Top = $80030003 - const long GA_RelBottom = $80030004 - const long GA_Width = $80030005 - const long GA_RelWidth = $80030006 - const long GA_Height = $80030007 - const long GA_RelHeight = $80030008 - const long GA_Text = $80030009 - const long GA_Image = $8003000a - const long GA_Border = $8003000b - const long GA_SelectRender = $8003000c - const long GA_Highlight = $8003000d - const long GA_Disabled = $8003000e - const long GA_GZZGadget = $8003000f - const long GA_ID = $80030010 - const long GA_UserData = $80030011 - const long GA_SpecialInfo = $80030012 - const long GA_Selected = $80030013 - const long GA_EndGadget = $80030014 - const long GA_Immediate = $80030015 - const long GA_RelVerify = $80030016 - const long GA_FollowMouse = $80030017 - const long GA_RightBorder = $80030018 - const long GA_LeftBorder = $80030019 - const long GA_TopBorder = $8003001a - const long GA_BottomBorder = $8003001b - const long GA_ToggleSelect = $8003001c - const long GA_SysGadget = $8003001d - const long GA_SysGType = $8003001e - const long GA_Previous = $8003001f - const long GA_Next = $80030020 - const long GA_DrawInfo = $80030021 - const long GA_IntuiText = $80030022 - const long GA_LabelImage = $80030023 - const long GA_TabCycle = $80030024 - const long GA_GadgetHelp = $80030025 - const long GA_Bounds = $80030026 - const long GA_RelSpecial = $80030027 - const long GA_TextAttr = $80030028 - const long GA_ReadOnly = $80030029 - const long GA_Underscore = $8003002a - const long GA_ActivateKey = $8003002b - const long GA_BackFill = $8003002c - const long GA_GadgetHelpText = $8003002d - const long GA_UserInput = $8003002e - const long PGA_Freedom = $80031001 - const long PGA_Borderless = $80031002 - const long PGA_HorizPot = $80031003 - const long PGA_HorizBody = $80031004 - const long PGA_VertPot = $80031005 - const long PGA_VertBody = $80031006 - const long PGA_Total = $80031007 - const long PGA_Visible = $80031008 - const long PGA_Top = $80031009 - const long PGA_NewLook = $8003100a - const long PGA_KnobImage = $8003100d - const long STRINGA_MaxChars = $80032001 - const long STRINGA_Buffer = $80032002 - const long STRINGA_UndoBuffer = $80032003 - const long STRINGA_WorkBuffer = $80032004 - const long STRINGA_BufferPos = $80032005 - const long STRINGA_DispPos = $80032006 - const long STRINGA_AltKeyMap = $80032007 - const long STRINGA_Font = $80032008 - const long STRINGA_Pens = $80032009 - const long STRINGA_ActivePens = $8003200a - const long STRINGA_EditHook = $8003200b - const long STRINGA_EditModes = $8003200c - const long STRINGA_ReplaceMode = $8003200d - const long STRINGA_FixedFieldMode = $8003200e - const long STRINGA_NoFilterMode = $8003200f - const long STRINGA_Justification = $80032010 - const long STRINGA_LongVal = $80032011 - const long STRINGA_TextVal = $80032012 - const long STRINGA_ExitHelp = $80032013 - const long LAYOUTA_LayoutObj = $80038001 - const long LAYOUTA_Spacing = $80038002 - const long LAYOUTA_Orientation = $80038003 - const long LAYOUTA_ChildMaxWidth = $80038004 - const long LAYOUTA_ChildMaxHeight = $80038005 - const long ICA_TARGET = $80040001 - const long ICA_MAP = $80040002 - const long ICSPECIAL_CODE = $80040003 - const long IA_Left = $80020001 - const long IA_Top = $80020002 - const long IA_Width = $80020003 - const long IA_Height = $80020004 - const long IA_FGPen = $80020005 - const long IA_BGPen = $80020006 - const long IA_Data = $80020007 - const long IA_LineWidth = $80020008 - const long IA_Pens = $8002000e - const long IA_Resolution = $8002000f - const long IA_APattern = $80020010 - const long IA_APatSize = $80020011 - const long IA_Mode = $80020012 - const long IA_Font = $80020013 - const long IA_Outline = $80020014 - const long IA_Recessed = $80020015 - const long IA_DoubleEmboss = $80020016 - const long IA_EdgesOnly = $80020017 - const long SYSIA_Size = $8002000b - const long SYSIA_Depth = $8002000c - const long SYSIA_Which = $8002000d - const long SYSIA_DrawInfo = $80020018 - const long SYSIA_Pens = $8002000e - const long IA_ShadowPen = $80020009 - const long IA_HighlightPen = $8002000a - const long SYSIA_ReferenceFont = $80020019 - const long IA_SupportsDisable = $8002001a - const long IA_FrameType = $8002001b - const long IA_Underscore = $8002001c - const long IA_Scalable = $8002001d - const long IA_ActivateKey = $8002001e - const long IA_Screen = $8002001f - const long IA_Precision = $80020020 - const long IA_Orientation = $80020023 - const long IA_Label = $80020028 - const long IA_EraseBackground = $8002002d - const long IA_LabelPen = $80020038 - const ubyte IDS_INDETERMINANT = $0004 - const long GTYP_WUPFRONT = $0040 - const long GTYP_SUPFRONT = $0050 - const long GTYP_WDOWNBACK = $0060 - const long GTYP_SDOWNBACK = $0070 - const ubyte OKOK = $0001 - const ubyte OKCANCEL = $0002 - const uword SELECTUP = $00e8 - const uword SELECTDOWN = $0068 - const uword MENUUP = $00e9 - const uword MENUDOWN = $0069 - const uword MIDDLEUP = $00ea - const uword MIDDLEDOWN = $006a - const ubyte ALTLEFT = $0010 - const ubyte ALTRIGHT = $0020 - const ubyte AMIGALEFT = $0040 - const ubyte AMIGARIGHT = $0080 - const ubyte AMIGAKEYS = $00c0 - const long TABLETA_TabletZ = $8003a001 - const long TABLETA_RangeZ = $8003a002 - const long TABLETA_AngleX = $8003a003 - const long TABLETA_AngleY = $8003a004 - const long TABLETA_AngleZ = $8003a005 - const long TABLETA_Pressure = $8003a006 - const long TABLETA_ButtonBits = $8003a007 - const long TABLETA_InProximity = $8003a008 - const long TABLETA_ResolutionX = $8003a009 - const long TABLETA_ResolutionY = $8003a00a - const ubyte GADGHIGHBITS = $0003 - const ubyte GADGHCOMP = $0000 - const ubyte GADGHBOX = $0001 - const ubyte GADGHIMAGE = $0002 - const ubyte GADGHNONE = $0003 - const ubyte GADGIMAGE = $0004 - const ubyte GRELBOTTOM = $0008 - const ubyte GRELRIGHT = $0010 - const ubyte GRELWIDTH = $0020 - const ubyte GRELHEIGHT = $0040 - const ubyte SELECTED = $0080 - const uword GADGDISABLED = $0100 - const uword LABELMASK = $3000 - const ubyte LABELITEXT = $0000 - const uword LABELSTRING = $1000 - const uword LABELIMAGE = $2000 - const ubyte RELVERIFY = $0001 - const ubyte GADGIMMEDIATE = $0002 - const ubyte ENDGADGET = $0004 - const ubyte FOLLOWMOUSE = $0008 - const ubyte RIGHTBORDER = $0010 - const ubyte LEFTBORDER = $0020 - const ubyte TOPBORDER = $0040 - const ubyte BOTTOMBORDER = $0080 - const uword BORDERSNIFF = $8000 - const uword TOGGLESELECT = $0100 - const uword BOOLEXTEND = $2000 - const ubyte STRINGLEFT = $0000 - const uword STRINGCENTER = $0200 - const uword STRINGRIGHT = $0400 - const uword LONGINT = $0800 - const uword ALTKEYMAP = $1000 - const uword STRINGEXTEND = $2000 - const uword ACTIVEGADGET = $4000 - const uword GADGETTYPE = $fc00 - const uword SYSGADGET = $8000 - const uword SCRGADGET = $4000 - const uword GZZGADGET = $2000 - const uword REQGADGET = $1000 - const ubyte SIZING = $0010 - const ubyte WDRAGGING = $0020 - const ubyte SDRAGGING = $0030 - const ubyte WUPFRONT = $0040 - const ubyte SUPFRONT = $0050 - const ubyte WDOWNBACK = $0060 - const ubyte SDOWNBACK = $0070 - const ubyte CLOSE = $0080 - const ubyte BOOLGADGET = $0001 - const ubyte GADGET0002 = $0002 - const ubyte PROPGADGET = $0003 - const ubyte STRGADGET = $0004 - const ubyte CUSTOMGADGET = $0005 - const ubyte GTYPEMASK = $0007 - const ubyte SIZEVERIFY = $0001 - const ubyte NEWSIZE = $0002 - const ubyte REFRESHWINDOW = $0004 - const ubyte MOUSEBUTTONS = $0008 - const ubyte MOUSEMOVE = $0010 - const ubyte GADGETDOWN = $0020 - const ubyte GADGETUP = $0040 - const ubyte REQSET = $0080 - const uword MENUPICK = $0100 - const uword CLOSEWINDOW = $0200 - const uword RAWKEY = $0400 - const uword REQVERIFY = $0800 - const uword REQCLEAR = $1000 - const uword MENUVERIFY = $2000 - const uword NEWPREFS = $4000 - const uword DISKINSERTED = $8000 - const long DISKREMOVED = $00010000 - const long WBENCHMESSAGE = $00020000 - const long ACTIVEWINDOW = $00040000 - const long INACTIVEWINDOW = $00080000 - const long DELTAMOVE = $00100000 - const long VANILLAKEY = $00200000 - const long INTUITICKS = $00400000 - const long IDCMPUPDATE = $00800000 - const long MENUHELP = $01000000 - const long CHANGEWINDOW = $02000000 - const long LONELYMESSAGE = $80000000 - const ubyte WINDOWSIZING = $0001 - const ubyte WINDOWDRAG = $0002 - const ubyte WINDOWDEPTH = $0004 - const ubyte WINDOWCLOSE = $0008 - const ubyte SIZEBRIGHT = $0010 - const ubyte SIZEBBOTTOM = $0020 - const ubyte REFRESHBITS = $00c0 - const ubyte SMART_REFRESH = $0000 - const ubyte SIMPLE_REFRESH = $0040 - const ubyte SUPER_BITMAP = $0080 - const ubyte OTHER_REFRESH = $00c0 - const uword BACKDROP = $0100 - const uword REPORTMOUSE = $0200 - const uword GIMMEZEROZERO = $0400 - const uword BORDERLESS = $0800 - const uword ACTIVATE = $1000 - const uword WINDOWACTIVE = $2000 - const uword INREQUEST = $4000 - const uword MENUSTATE = $8000 - const long RMBTRAP = $00010000 - const long NOCAREREFRESH = $00020000 - const long WINDOWREFRESH = $01000000 - const long WBENCHWINDOW = $02000000 - const long WINDOWTICKED = $04000000 - const long NW_EXTENDED = $00040000 - const long VISITOR = $08000000 - const long ZOOMED = $10000000 - const long HASZOOM = $20000000 - const long GA_LEFT = $80030001 - const long GA_RELRIGHT = $80030002 - const long GA_TOP = $80030003 - const long GA_RELBOTTOM = $80030004 - const long GA_WIDTH = $80030005 - const long GA_RELWIDTH = $80030006 - const long GA_HEIGHT = $80030007 - const long GA_RELHEIGHT = $80030008 - const long GA_TEXT = $80030009 - const long GA_IMAGE = $8003000a - const long GA_BORDER = $8003000b - const long GA_SELECTRENDER = $8003000c - const long GA_HIGHLIGHT = $8003000d - const long GA_DISABLED = $8003000e - const long GA_GZZGADGET = $8003000f - const long GA_USERDATA = $80030011 - const long GA_SPECIALINFO = $80030012 - const long GA_SELECTED = $80030013 - const long GA_ENDGADGET = $80030014 - const long GA_IMMEDIATE = $80030015 - const long GA_RELVERIFY = $80030016 - const long GA_FOLLOWMOUSE = $80030017 - const long GA_RIGHTBORDER = $80030018 - const long GA_LEFTBORDER = $80030019 - const long GA_TOPBORDER = $8003001a - const long GA_BOTTOMBORDER = $8003001b - const long GA_TOGGLESELECT = $8003001c - const long GA_SYSGADGET = $8003001d - const long GA_SYSGTYPE = $8003001e - const long GA_PREVIOUS = $8003001f - const long GA_NEXT = $80030020 - const long GA_DRAWINFO = $80030021 - const long GA_INTUITEXT = $80030022 - const long GA_LABELIMAGE = $80030023 - const long PGA_FREEDOM = $80031001 - const long PGA_BORDERLESS = $80031002 - const long PGA_HORIZPOT = $80031003 - const long PGA_HORIZBODY = $80031004 - const long PGA_VERTPOT = $80031005 - const long PGA_VERTBODY = $80031006 - const long PGA_TOTAL = $80031007 - const long PGA_VISIBLE = $80031008 - const long PGA_TOP = $80031009 - const long LAYOUTA_LAYOUTOBJ = $80038001 - const long LAYOUTA_SPACING = $80038002 - const long LAYOUTA_ORIENTATION = $80038003 - const long IA_LEFT = $80020001 - const long IA_TOP = $80020002 - const long IA_WIDTH = $80020003 - const long IA_HEIGHT = $80020004 - const long IA_FGPEN = $80020005 - const long IA_BGPEN = $80020006 - const long IA_DATA = $80020007 - const long IA_LINEWIDTH = $80020008 - const long IA_PENS = $8002000e - const long IA_RESOLUTION = $8002000f - const long IA_APATTERN = $80020010 - const long IA_APATSIZE = $80020011 - const long IA_MODE = $80020012 - const long IA_FONT = $80020013 - const long IA_OUTLINE = $80020014 - const long IA_RECESSED = $80020015 - const long IA_DOUBLEEMBOSS = $80020016 - const long IA_EDGESONLY = $80020017 - const long IA_SHADOWPEN = $80020009 - const long IA_HIGHLIGHTPEN = $8002000a - const long POINTERA_BitMap = $80039001 - const long POINTERA_XOffset = $80039002 - const long POINTERA_YOffset = $80039003 - const long POINTERA_WordWidth = $80039004 - const long POINTERA_XResolution = $80039005 - const long POINTERA_YResolution = $80039006 - const ubyte CORRECT_RGB_MASK = $0007 - const ubyte DIMENSIONS_MASK = $00f0 - const uword DITHERING_MASK = $0600 - const ubyte SDEPTH_CHILDONLY = $0002 + %option no_symbol_prefixing, ignore_unused } -;; End of auto-generated intuition_lib.sfd diff --git a/compiler/res/prog8lib/amiga500/lists.p8 b/compiler/res/prog8lib/amiga500/lists.p8 index a8655e67c..604e45147 100644 --- a/compiler/res/prog8lib/amiga500/lists.p8 +++ b/compiler/res/prog8lib/amiga500/lists.p8 @@ -1,151 +1,5 @@ -;; Exec doubly linked lists - usage summary -;; -;; Purpose: this module is a super thin wrapper over the exec list -;; headers and library routines. It exists for source code -;; compatibility with other targets that supply their own lists.p8 -;; implementation. On amiga500 everything simply forwards to exec.library. -;; -;; Data structures (from Include_H/exec/nodes.h and exec/lists.h): -;; -;; A full Node is 14 bytes: Succ and Pred pointers at offsets 0 and 4, -;; an ubyte Type at 8, a signed priority byte Pri at 9 and a Name -;; string pointer at 10. A MinNode holds just the two link pointers -;; (8 bytes). The list headers mirror this split: List consists of -;; Head, Tail and TailPred pointers plus Type and Pad bytes (14 bytes), -;; MinList has only the three pointers (12 bytes). This module aliases -;; List/Node to the minimal variants; use FullNode when you need the -;; Type/Pri/Name fields. -;; -;; Layout: an Exec list is a circular doubly linked list in which the -;; header itself acts as the sentinel node - there are no separate -;; head/tail marker pointers. The header's Tail field stays zero -;; forever and serves as terminator: forward traversal via Succ ends -;; when it reaches &Header.Tail, backward traversal via Pred ends when -;; it reaches the header itself. The first real node's Pred points at -;; the header, the last real node's Succ points at &Header.Tail. -;; -;; Creation and initialization: -;; Place the list header in static memory or allocate it, then call -;; init(listptr) once before any other use. init() is a thin wrapper -;; around exec.NewList(), which sets Head = &Tail, Tail = 0 and -;; TailPred = &Head. Nodes need no explicit setup beyond being -;; cleared; fill in Type/Pri/Name as needed before using the routines -;; below that depend on them. For MinList headers on very new -;; Kickstarts there is also NewMinList (LVO -828), but NewList covers -;; both variants because their layouts coincide. -;; -;; Empty test: the list is empty iff TailPred points back at the -;; header itself (equivalently Head == &Tail); see is_empty(). -;; -;; Operations (all resolve to exec.library LVO calls): -;; - add_head / add_tail: link node at front / back of list -;; (AddHead LVO -240, AddTail LVO -246). -;; - insert(list, node, pred): links node after the given predecessor -;; node anywhere in the list; pred = 0 means insert at head -;; (Insert LVO -234). -;; - enqueue(list, node): priority-sorted insertion using Pri, placed -;; before the first lower-priority node so equal priorities come out -;; FIFO. Requires full Nodes (Enqueue LVO -270). -;; - remove(node): unlinks a node from whichever list it currently -;; sits in; it must actually be linked into one (Remove LVO -252). -;; - remove_head / remove_tail: unlink and return the first / last -;; node, or null if empty; these give you queue and stack behaviour -;; (RemHead LVO -258, RemTail LVO -264). -;; - find_name(list, name): linear search over Name strings, returns -;; matching node or null; requires full Nodes (FindName LVO -276). -;; -;; Concurrency warning: none of these routines arbitrate access to -;; the list. If tasks or interrupts share a list you must serialize -;; access yourself (Forbid/Permit, Disable/Enable, or semaphores). -;; -;; Allocator agnostic: the routines never allocate or free memory -;; themselves, they only link the `pointer` values you pass in. Nodes -;; and headers can come from static `[]` variables, `memory()` slabs, -;; or any arena/bump allocator such as `arena_alloc(sizeof(MyNode))` -;; as `^^MyNode` or `exec.AllocMem` on amiga. Just ensure the -;; allocation is suitably aligned (long-aligned on m68k). -;; -;; Custom nodes: you can define your own node struct for use with the -;; exec/lists routines and with `for node in mylist` loops. The only -;; requirement is that the link pointers are the first fields at offset -;; 0 (Succ at 0, Pred at 4 on 32-bit amiga). Minimal operations only -;; need Succ/Pred; enqueue() and find_name() require the full -;; Type/Pri/Name layout of exec.Node / lists.FullNode. Define the list -;; header with your node type so `for`-iteration infers the correct -;; type. Example: -;; -;; main { -;; struct MyNode { -;; ^^MyNode Succ ; must be first (offset 0) -;; ^^MyNode Pred ; must be second (offset 4) -;; ubyte Type ; include for FullNode compatibility if needed -;; byte Pri -;; str Name -;; ubyte value ; your payload follows -;; } -;; struct MyList { -;; ^^MyNode Head -;; pointer Tail -;; ^^MyNode TailPred -;; } -;; sub start() { -;; ^^MyList mylist = [] ; zero-initialized header -;; ^^MyNode n1 = [0, 0, 0, 0, 0, 11] ; Succ, Pred, Type, Pri, Name, value -;; ^^MyNode n2 = [0, 0, 0, 0, 0, 22] -;; exec.NewList(mylist as ^^exec.List) ; or lists.init(mylist as pointer) -;; lists.add_tail(mylist as pointer, n1 as pointer) -;; lists.add_tail(mylist as pointer, n2 as pointer) -;; ; or directly: exec.AddTail(mylist as pointer, n1 as pointer) -;; } -;; } - -%import exec +%import shared_amiga_lists lists { %option ignore_unused - - alias Node = exec.MinNode - alias List = exec.MinList - alias FullNode = exec.Node - - inline sub init(pointer listptr) { - exec.NewList(listptr as ^^exec.List) - } - - inline sub is_empty(pointer listptr) -> bool { - ^^List lst = listptr as ^^List - return lst.TailPred == (&lst.Head as ^^Node) - } - - inline sub add_head(pointer listptr, pointer node) { - exec.AddHead(listptr, node) - } - - inline sub add_tail(pointer listptr, pointer node) { - exec.AddTail(listptr, node) - } - - inline sub insert(pointer listptr, pointer node, pointer pred) { - exec.Insert(listptr, node, pred) - } - - inline sub remove(pointer node) { - exec.Remove(node) - } - - inline sub remove_head(pointer listptr) -> pointer { - return exec.RemHead(listptr) - } - - inline sub remove_tail(pointer listptr) -> pointer { - return exec.RemTail(listptr) - } - - inline sub enqueue(pointer listptr, pointer node) { - exec.Enqueue(listptr, node) - } - - inline sub find_name(pointer listptr, str name) -> pointer { - return exec.FindName(listptr, name) - } } diff --git a/compiler/res/prog8lib/amiga500/ptplayer.p8 b/compiler/res/prog8lib/amiga500/ptplayer.p8 index 95d232134..8fc6630e5 100644 --- a/compiler/res/prog8lib/amiga500/ptplayer.p8 +++ b/compiler/res/prog8lib/amiga500/ptplayer.p8 @@ -1,4178 +1,5 @@ -;************************************************** -;* ----- Protracker V2.3B Playroutine ----- * -;************************************************** -; -; Version 6.4 -; Written by Frank Wille in 2013, 2016-2024. -; -; I, the copyright holder of this work, hereby release it into the -; public domain. This applies worldwide. - +%import shared_amiga_ptplayer ptplayer { - - asmsub install() -> bool @D0 { - ; -- install playback interrupt handler routine - %asm {{ - jmp _mt_install - }} - } - - asmsub remove() { - ; -- remove playback interrupt handler routine - %asm {{ - jmp _mt_remove - }} - } - - asmsub init(pointer moduledata @A0) { - ; -- initialize a loaded protracker module for playback. Module must be loaded into CHIP ram. - %asm {{ - lea $dff000,a6 - sub.l a1,a1 ;; assume sample data is always inside the module - clr.l d0 ;; start at beginning - bsr _mt_init - ;; reset note-trigger detection state - lea vu_prevstarts(pc),a0 - movem.l d1-d3,-(sp) - moveq #0,d1 - move.l d1,(a0) - move.l d1,4(a0) - move.l d1,8(a0) - move.l d1,12(a0) - movem.l (sp)+,d1-d3 - rts - }} - } - - asmsub enable() { - ; -- enable module playback - %asm {{ - move.b #1,_mt_Enable - rts - }} - } - - asmsub disable() { - ; -- disable module playback - %asm {{ - clr.b _mt_Enable - rts - }} - } - - asmsub end() { - ; -- disable all sound playbacks - %asm {{ - lea $dff000,a6 - jmp _mt_end - }} - } - - asmsub songname() -> pointer @A0 { - ; -- returns a pointer to the 20-byte song name of the current module (NULL if no module was initialized) - %asm {{ - lea mt_data(pc),a0 - move.l mt_mod(a0),a0 - rts - }} - } - - asmsub numpatterns() -> ubyte @D0 { - ; -- returns the number of patterns of the current module (highest arrangement entry + 1) - %asm {{ - moveq #0,d0 - lea mt_data(pc),a0 - tst.l mt_mod(a0) - beq .done - move.l mt_mod(a0),a1 - lea MTMOD_ARRANGEMENT(a1),a1 ; song arrangement list - moveq #127,d1 - moveq #0,d0 ; highest pattern number - .1: cmp.b (a1),d0 - bhs .2 - move.b (a1),d0 - .2: addq.l #1,a1 - dbf d1,.1 - addq.b #1,d0 ; number of patterns = highest + 1 - .done: - rts - }} - } - - asmsub currentpos() -> ubyte @D0, ubyte @D1, ubyte @D2 { - ; -- returns the current song position (index into the arrangement list), - ; the pattern number currently being played, - ; and the current row within that pattern (0-63) - %asm {{ - moveq #0,d0 - moveq #0,d1 - moveq #0,d2 - lea mt_data(pc),a0 - tst.l mt_mod(a0) - beq .done - move.b mt_SongPos(a0),d0 ; song position - move.l mt_mod(a0),a1 - lea MTMOD_ARRANGEMENT(a1),a1 ; song arrangement list - move.b (a1,d0.w),d1 ; current pattern number (like get_new_note does) - move.w mt_PatternPos(a0),d2 - lsr.w #4,d2 ; PatternPos is a byte offset, 16 bytes per row - .done: - rts - }} - } - - asmsub volumes() -> ubyte @D0, ubyte @D1, ubyte @D2, ubyte @D3 { - ; -- returns the current volumes of the music channels (each byte is 0-64) - %asm {{ - lea mt_data(pc),a0 - moveq #0,d0 - move.b mt_chan1+n_volume+1(a0),d0 ; low byte of volume word (big-endian) - moveq #0,d1 - move.b mt_chan2+n_volume+1(a0),d1 - moveq #0,d2 - move.b mt_chan3+n_volume+1(a0),d2 - moveq #0,d3 - move.b mt_chan4+n_volume+1(a0),d3 - rts - }} - } - - asmsub notestrike() clobbers (D4) -> bool @D0, bool @D1, bool @D2, bool @D3 { - ; -- returns true for each channel on which a new instrument was triggered - ; -- since the previous call of this routine (poll at least once per row, ~50 Hz) - %asm {{ - lea mt_data(pc),a1 - lea vu_prevstarts(pc),a0 - moveq #0,d0 - moveq #0,d1 - moveq #0,d2 - moveq #0,d3 - - move.l mt_chan1+n_start(a1),d4 - cmp.l (a0)+,d4 - beq .2 - move.l d4,-(a0) - tst.l d4 - beq .2 - moveq #1,d0 - .2: move.l mt_chan2+n_start(a1),d4 - cmp.l (a0)+,d4 - beq .3 - move.l d4,-(a0) - tst.l d4 - beq .3 - moveq #1,d1 - .3: move.l mt_chan3+n_start(a1),d4 - cmp.l (a0)+,d4 - beq .4 - move.l d4,-(a0) - tst.l d4 - beq .4 - moveq #1,d2 - .4: move.l mt_chan4+n_start(a1),d4 - cmp.l (a0),d4 - beq .done - move.l d4,(a0) - tst.l d4 - beq .done - moveq #1,d3 - .done: - rts - }} - } - - - %asm {{ - -;************************************************** -;* ----- Protracker V2.3B Playroutine ----- * -;************************************************** -; -; Version 6.4 -; Written by Frank Wille in 2013, 2016-2024. -; -; I, the copyright holder of this work, hereby release it into the -; public domain. This applies worldwide. -; -; The default version (single section, local base register) should -; work with most assemblers. Tested are: Devpac, vasm, PhxAss, -; Barfly-Asm, SNMA, AsmOne, AsmPro. -; -; The small data model can be enabled by defining the symbol SDATA. In -; this case all functions expect a4 to be initialized with the small -; data base register. Interrupt functions restore a4 from _LinkerDB. -; Small data may work with vasm and PhxAss only. -; -; Exported functions and variables: -; (CUSTOM is the custom-chip register set base address $dff000.) -; -; _mt_install(a6=CUSTOM, a0=VectorBase, d0=PALflag.b) [OSCOMPAT=0] -; Install a CIA-B interrupt for calling mt_music or mt_sfxonly. -; The music module is replayed via mt_music when _mt_Enable is non-zero. -; Otherwise the interrupt handler calls mt_sfxonly to play sound -; effects only. VectorBase is 0 for 68000, otherwise set it to the CPU's -; VBR register. A non-zero PALflag selects PAL-clock for the CIA timers -; (NTSC otherwise). -; -; ok(d0) = _mt_install() [OSCOMPAT=1] -; Register CIA-B interrupts with AmigaOS for calling mt_music or -; mt_sfxonly. Allocate all Paula audio channels via audio.device. -; The music module is replayed via mt_music when _mt_Enable is non-zero. -; Otherwise the interrupt handler calls mt_sfxonly to play sound -; effects only. -; Returns true (1) on success, false (0) otherwise. You must not call -; _mt_remove(), when _mt_install() failed! -; -; _mt_remove(a6=CUSTOM) [OSCOMPAT=0] -; Remove the CIA-B music interrupt, restore the previous handler and -; reset the CIA timer registers to their original values. -; -; _mt_remove() [OSCOMPAT=1] -; Unregister the CIA-B interrupts handlers and deallocate all -; audio channels. -; -; _mt_init(a6=CUSTOM, a0=TrackerModule, a1=Samples|NULL, d0=InitialSongPos.b) -; Initialize a new module. -; Reset speed to 6, tempo to 125 and start at the given song position. -; Master volume is at 64 (maximum). -; When a1 is NULL the samples are assumed to be stored after the patterns. -; -; _mt_end(a6=CUSTOM) -; Stop playing current module and sound effects. -; -; _mt_soundfx(a6=CUSTOM, a0=SamplePointer, -; d0=SampleLength.w, d1=SamplePeriod.w, d2=SampleVolume.w) -; Request playing of an external sound effect on the most unused channel. -; This function is for compatibility with the old API only. -; You may prefer _mt_playfx instead. MINIMAL=0 only. -; -; channelStatus(d0) = _mt_playfx(a6=CUSTOM, a0=SfxStructurePointer) -; Request playing of a prioritized external sound effect, either on a -; fixed channel or on the most unused one. -; Structure layout of SfxStructure: -; void *sfx_ptr (pointer to sample start in Chip RAM, even address) -; WORD sfx_len (sample length in words) -; WORD sfx_per (hardware replay period for sample) -; WORD sfx_vol (volume 0..64, is unaffected by the song's master volume) -; BYTE sfx_cha (0..3 selected replay channel, -1 selects best channel) -; BYTE sfx_pri (priority, must be in the range 1..127) -; When multiple samples are assigned to the same channel the lower -; priority sample will be replaced. When priorities are the same, then -; the older sample is replaced. -; The chosen channel is blocked for music until the effect has -; completely been replayed. -; Returns a pointer to a channel-status structure when the sample -; is scheduled for playing, and NULL when the request was ignored. -; MINIMAL=0 only. -; -; _mt_loopfx(a6=CUSTOM, a0=SfxStructurePointer) -; Request playing of a looped sound effect on a fixed channel, which -; will be blocked for music until the effect is stopped (_mt_stopfx). -; It uses the same sfx-structure as _mt_playfx, but the priority is -; ignored. A looped sound effect has always highest priority and will -; replace a previous effect on the same channel. No automatic channel -; selection possible! -; Also make sure the sample starts with a zero-word, which is used -; for idling when the effect is stopped. This word is included in the -; total length calculation, but excluded when actually playing the loop. -; MINIMAL=0 only. -; -; _mt_stopfx(a6=CUSTOM, d0=Channel.b) [MINIMAL=0] -; Immediately stop a currently playing sound effect on a channel (0..3) -; and make it available for music, or other effects, again. This is the -; only way to stop a looped sound effect (_mt_loopfx) besides stopping -; replay completely (_mt_end). -; -; _mt_musicmask(a6=CUSTOM, d0=ChannelMask.b) [MINIMAL=0] -; Bits set in the ChannelMask define which specific channels are reserved -; for music only. Set bit 0 for channel 0, ..., bit 3 for channel 3. -; When calling _mt_soundfx or _mt_playfx with automatic channel selection -; (sfx_cha=-1) then these masked channels will never be picked. -; The mask defaults to 0. -; -; _mt_mastervol(a6=CUSTOM, d0=MasterVolume.w) [MINIMAL=0] -; Set a master volume from 0 to 64 for all music channels. -; Note that the master volume does not affect the volume of external -; sound effects (which is desired). -; -; _mt_samplevol(d0=SampleNumber.w, d1=Volume.b) [MINIMAL=0] -; Redefine a sample's volume. May also be done while the song is playing. -; Warning: Does not check arguments for valid range! You must have done -; _mt_init before calling this function! -; The new volume is persistent. Even when the song is restarted. -; -; _mt_channelmask(a6=CUSTOM, d0=ChannelMask.b) [MINIMAL=0] -; Bits cleared in the ChannelMask define which specific channels are muted -; for music replay. Clear bit 0 for channel 0, ..., bit 3 for channel 3. -; Additionally a cleared bit prevents any access to the sample pointers -; of this channel. -; The mask defaults to all channels unmuted (bits set) and is reset to -; this state on _mt_init and _mt_end. -; -; _mt_music(a6=CUSTOM) -; The replayer routine. Can be called from your own VBlank interrupt -; handler when VBLANK_MUSIC is set. Is otherwise called automatically -; by Timer-A interrupts after _mt_install. -; -; _mt_dmaon() [NO_TIMERS=1] -; MUST be called ca. 550 ticks after calling _mt_music. Enables Audio -; DMA to play a new note. -; -; _mt_setrep() [NO_TIMERS=1] -; MUST be called ca. 550 ticks after calling _mt_dmaon. Sets the -; repetition pointers and lengths for looped samples. -; -; Byte Variables: -; -; _mt_Enable [VBLANK_MUSIC=0] -; Set this byte to non-zero to play music, zero to pause playing. -; Note that you can still play sound effects, while music is stopped. -; It is set to 0 by _mt_install. -; -; _mt_E8Trigger -; This byte reflects the value of the last E8 command. -; It is reset to 0 after _mt_init. -; -; _mt_MusicChannels [MINIMAL=0] -; This byte defines the number of channels which should be dedicated -; for playing music. So sound effects will never use more -; than 4 - _mt_MusicChannels channels at once. Defaults to 0. -; - -; Set this if you want to build a version which uses AmigaOS to -; register interrupts and reserve audio channels. - ifnd OSCOMPAT -OSCOMPAT equ 1 - endc - -; Optionally you can build a minimal version, which includes only -; the basic player. No sound effects insertion, no master volume, no -; sample volume, etc. Define the symbol MINIMAL=1 for it. - ifnd MINIMAL -MINIMAL equ 1 - endc - -; You may disable sawtooth and rectangle vibratos/tremolos here, which -; will be replaced by sine-waves. They are rarely used and disabling -; them will free a lot of memory for the tables. - ifnd ENABLE_SAWRECT -ENABLE_SAWRECT equ 1 - endc - -; Set this if you can guarantee that the word at $0 is cleared, and if -; you want to use it for idle-looping of samples. - ifnd NULL_IS_CLEARED -NULL_IS_CLEARED equ 0 - endc - -; Setting NO_TIMERS disables the use of both CIA-B timers completely, which -; means that the player doesn't depend on level-6 EXTER interrupts anymore. -; NO_TIMERS=1 automatically includes VBLANK_MUSIC=1 (see below). -; With NO_TIMERS set, your main program has to call all music subroutines -; itself. The typical procedure in a VERTB-based main loop would be: -; 1. call _mt_music -; 2. wait at least 550 ticks, then call _mt_dmaon -; 3. wait at least 550 ticks again, then call _mt_setrep -; The last two steps could for example be performed by Copper interrupts. - ifnd NO_TIMERS -NO_TIMERS equ 0 - else - ifne NO_TIMERS - ifd VBLANK_MUSIC - ifeq VBLANK_MUSIC - fail "NO_TIMERS=1 requires VBLANK_MUSIC=1" - endc - endc ; VBLANK_MUSIC - endc ; NO_TIMERS=1 - endc ; NO_TIMERS - -; This disables only initialization of CIA Timer-A interrupts for music -; replay, which means you cannot set the tempo with the F-command -; anymore and you have to call _mt_music yourself out of your own -; VBlank interrupt handler. Also sound effects will no longer work, -; when no music is playing (_mt_Enable=0). - ifnd VBLANK_MUSIC -VBLANK_MUSIC equ NO_TIMERS - endc - -; Delay in CIA-ticks, which guarantees that at least one Audio-DMA -; took place, even with the lowest periods. -; 496 should be the correct value. But there are some A1200 which -; need at least 550. -DMADELAY equ 576 ; was 496 - - -; exec.library (OSCOMPAT) -_LVOAllocSignal equ -330 -_LVOFreeSignal equ -336 -_LVOOpenDevice equ -444 -_LVOCloseDevice equ -450 -_LVOOpenResource equ -498 - -; cia.resource (OSCOMPAT) -_LVOAddICRVector equ -6 -_LVORemICRVector equ -12 -_LVOAbleICR equ -18 -CIAICRB_TA equ 0 -CIAICRB_TB equ 1 - - -; Custom chip registers -CUSTOM equ $dff000 -INTREQR equ $01e -INTENAR equ $01c -DMACON equ $096 -INTENA equ $09a -INTREQ equ $09c -AUD0LC equ $0a0 -AUD0LEN equ $0a4 -AUD0VOL equ $0a8 -AUD1LC equ $0b0 -AUD1LEN equ $0b4 -AUD1VOL equ $0b8 -AUD2LC equ $0c0 -AUD2LEN equ $0c4 -AUD2VOL equ $0c8 -AUD3LC equ $0d0 -AUD3LEN equ $0d4 -AUD3VOL equ $0d8 - -; Audio channel registers -AUDLC equ 0 -AUDLEN equ 4 -AUDPER equ 6 -AUDVOL equ 8 - -; CIA registers -CIAA equ $bfe001 -CIAB equ $bfd000 -CIAPRA equ $000 -CIATALO equ $400 -CIATAHI equ $500 -CIATBLO equ $600 -CIATBHI equ $700 -CIAICR equ $d00 -CIACRA equ $e00 -CIACRB equ $f00 - -; Protracker module layout -MTMOD_SONGNAME equ 0 ; 20 bytes song title -MTMOD_SAMPLEINFO equ 20 ; 31*30 bytes sample info table -MTMOD_SONGLEN equ 950 ; song length in positions -MTMOD_ARRANGEMENT equ 952 ; 128 bytes song arrangement list -MTMOD_PATTERNS equ 1084 ; start of pattern data - - -; Sound effects structure, passed into _mt_playfx - rsreset -sfx_ptr rs.l 1 -sfx_len rs.w 1 -sfx_per rs.w 1 -sfx_vol rs.w 1 -sfx_cha rs.b 1 -sfx_pri rs.b 1 -sfx_sizeof rs.b 0 - - -; Channel Status - rsreset -n_note rs.w 1 -n_cmd rs.b 1 -n_cmdlo rs.b 1 -n_index rs.b 1 -n_sfxpri rs.b 1 -n_reserved1 rs.b 2 -n_start rs.l 1 -n_loopstart rs.l 1 -n_length rs.w 1 -n_replen rs.w 1 -n_period rs.w 1 -n_volume rs.w 1 -n_pertab rs.l 1 -n_dmabit rs.w 1 -n_noteoff rs.w 1 -n_toneportspeed rs.w 1 -n_wantedperiod rs.w 1 -n_pattpos rs.w 1 -n_funk rs.w 1 -n_wavestart rs.l 1 -n_reallength rs.w 1 -n_intbit rs.w 1 -n_sfxptr rs.l 1 -n_sfxlen rs.w 1 -n_sfxper rs.w 1 -n_sfxvol rs.w 1 -n_looped rs.b 1 -n_minusft rs.b 1 -n_vibratoamp rs.b 1 -n_vibratospd rs.b 1 -n_vibratopos rs.b 1 -n_vibratoctrl rs.b 1 -n_tremoloamp rs.b 1 -n_tremolospd rs.b 1 -n_tremolopos rs.b 1 -n_tremoloctrl rs.b 1 -n_gliss rs.b 1 -n_sampleoffset rs.b 1 -n_loopcount rs.b 1 -n_funkoffset rs.b 1 -n_retrigcount rs.b 1 - ifeq MINIMAL -n_freecnt rs.b 1 -n_musiconly rs.b 1 -n_enable rs.b 1 - else -n_reserved2 rs.b 3 - endc -n_sizeof rs.b 0 - - -DISABLE macro - ifeq NO_TIMERS - move.w #$4000,INTENA(a6) - endc - endm - -ENABLE macro - ifeq NO_TIMERS - move.w #$c000,INTENA(a6) - endc - endm - - - ifd SDATA - xref _LinkerDB ; small data base from linker - near a4 - code - endc - - - - ifne OSCOMPAT -;--------------------------------------------------------------------------- - xdef _mt_install -_mt_install: -; Register a CIA-B interrupt with AmigaOS for calling mt_music. -; Reserve all audio channels for our use. -; -> d0.l = status (1 for success, 0 for error) - - move.l a6,-(sp) - - ifnd SDATA - move.l a4,-(sp) - lea mt_data(pc),a4 - endc - - ; open audio.device and allocate all four audio channels - move.l 4.w,a6 - moveq #-1,d0 - jsr _LVOAllocSignal(a6) - lea mt_ioport+20(pc),a0 - move.b d0,-5(a0) ; MP_SIGBIT - bmi .fail - move.l a0,8(a0) ; NewList MP_MSGLIST - addq.l #4,a0 - clr.l (a0) - move.l a0,-(a0) - move.l 276(a6),-(a0) ; MP_SIGTASK = ThisTask - lea mt_audio_name(pc),a0 - lea mt_ioaudio(pc),a1 - moveq #0,d0 - moveq #0,d1 - jsr _LVOOpenDevice(a6) - tst.b d0 - bne .no_device - - ifeq NO_TIMERS - ; attempt to allocate CIA-B timers A and B - lea mt_ciab_name(pc),a1 - jsr _LVOOpenResource(a6) - tst.l d0 - beq .no_rsrc - - move.l d0,a6 - - clr.b mt_Enable(a4) - lea TB_toggle(pc),a0 - clr.b (a0) - - ifeq VBLANK_MUSIC - moveq #CIAICRB_TA,d0 - lea mt_extern_timer_a_is(pc),a1 - jsr _LVOAddICRVector(a6) - tst.l d0 - bne .no_timer_a - endc ; !VBLANK_MUSIC - - moveq #CIAICRB_TB,d0 - lea mt_extern_timer_b_is(pc),a1 - jsr _LVOAddICRVector(a6) - tst.l d0 - bne .no_timer_b - - ; TimerA and TimerB interrupt disable - ifne VBLANK_MUSIC - moveq #$2,d0 ; TimerB only for VBLANK_MUSIC - else - moveq #$3,d0 - endc - jsr _LVOAbleICR(a6) - - lea CIAB,a0 - - ; Stop Timer B - moveq #0,d0 - move.b d0,CIACRB(a0) - - ifeq VBLANK_MUSIC - ; Stop Timer A - move.b d0,CIACRA(a0) - - ; determine if 02 clock for timers is based on PAL or NTSC - move.l 4.w,a1 - cmp.b #50,531(a1) ; PowerSupplyFrequency - beq .1 - move.l #1789773,d0 ; NTSC - bra .2 -.1: move.l #1773447,d0 ; PAL -.2: move.l d0,mt_timerval(a4) - - ; load TimerA in continuous mode for the default tempo of 125 - divu #125,d0 - move.b d0,CIATALO(a0) - lsr.w #8,d0 - move.b d0,CIATAHI(a0) - move.b #$11,CIACRA(a0) ; load timer, start continuous - endc ; !VBLANK_MUSIC - - ; load TimerB with DMADELAY ticks for setting DMA and repeat - move.b #DMADELAY&255,CIATBLO(a0) - move.b #DMADELAY>>8,CIATBHI(a0) - - ; TimerA and TimerB interrupt enable - ifne VBLANK_MUSIC - move.w #$82,d0 ; TimerB only for VBLANK_MUSIC - else - move.w #$83,d0 - endc - jsr _LVOAbleICR(a6) - - endc ; !NO_TIMERS - - ; reset the player - pea .popout(pc) - ifnd SDATA - move.l a4,-(sp) - endc - lea CUSTOM,a6 - bra mt_reset - - ifeq NO_TIMERS -.no_timer_b: - ifeq VBLANK_MUSIC - moveq #CIAICRB_TA,d0 - lea mt_extern_timer_a_is(pc),a1 - jsr _LVORemICRVector(a6) -.no_timer_a: - endc ; !VBLANK_MUSIC - endc ; !NO_TIMERS - - move.l 4.w,a6 -.no_rsrc: - lea mt_ioaudio(pc),a1 - jsr _LVOCloseDevice(a6) -.no_device: - moveq #0,d0 - move.b mt_ioport+15(pc),d0 - jsr _LVOFreeSignal(a6) -.fail: - moveq #0,d0 ; Indicate failure - bra .out -.popout: - moveq #1,d0 ; Indicate success -.out: - ifnd SDATA - move.l (sp)+,a4 - endc - move.l (sp)+,a6 - rts - - -mt_ioport: - dc.l 0,0 - dc.b 4,0 ; MT_MSGPORT - dc.l 0 - dc.b 0,-1 ; PA_SIGNAL - dc.l 0 -.head: dc.l .tail -.tail: dc.l 0 - dc.l .head - -mt_ioaudio: - dc.l 0,0 - dc.b 7,127 ; NT_REPLYMSG, ADALLOC_MAXPREC - dc.l 0,mt_ioport - dc.w .end-mt_ioaudio - dc.l 0,0 - dc.w $20 ; ADCMD_ALLOCATE - dc.b $40,0 ; ADIOF_NOWAIT - dc.w 0 ; ioa_AllocKey - dc.l mt_ch_alloc ; ioa_Data - dc.l 1 ; ioa_Length - dc.w 0,0,0 - ds.b 20 ; ioa_WriteMsg -.end: - - ifeq NO_TIMERS - ifeq VBLANK_MUSIC -mt_extern_timer_a_is: - dc.l 0,0 - dc.b 2 ; NT_INTERRUPT - dc.b 0 ; priority - dc.l mt_timer_int_name - dc.l 0 - dc.l mt_cia_timer_a_code - endc ; !VBLANK_MUSIC - -mt_extern_timer_b_is: - dc.l 0,0 - dc.b 2 ; NT_INTERRUPT - dc.b 0 ; priority - dc.l mt_timer_int_name - dc.l 0 - dc.l mt_cia_timer_b_code - -mt_ciab_name: - dc.b "ciab.resource",0 -mt_timer_int_name: - dc.b "ptplayer timer",0 - endc ; !NO_TIMERS - - even -mt_audio_name: - dc.b "audio.device",0 -mt_ch_alloc: - dc.b %1111 ; allocate all four channels - even - - -;--------------------------------------------------------------------------- - xdef _mt_remove -_mt_remove: -; Unregister our CIA-B interrupt with AmigaOS. Free all audio channels. - - move.l a6,-(sp) - - ifeq NO_TIMERS - move.l 4.w,a6 - lea mt_ciab_name(pc),a1 - jsr _LVOOpenResource(a6) - tst.l d0 - beq .nociares - - move.l d0,a6 - - ; TimerA and TimerB interrupt disable - ifne VBLANK_MUSIC - moveq #$02,d0 ; TimerB only for VBLANK_MUSIC - else - moveq #$03,d0 - endc - jsr _LVOAbleICR(a6) - - moveq #CIAICRB_TB,d0 - lea mt_extern_timer_b_is(pc),a1 - jsr _LVORemICRVector(a6) - - ifeq VBLANK_MUSIC - moveq #CIAICRB_TA,d0 - lea mt_extern_timer_a_is(pc),a1 - jsr _LVORemICRVector(a6) - endc ; !VBLANK_MUSIC -.nociares: - endc ; !NO_TIMERS - - ; close audio.device, free channels - move.l 4.w,a6 - lea mt_ioaudio(pc),a1 - jsr _LVOCloseDevice(a6) - moveq #0,d0 - move.b mt_ioport+15(pc),d0 - jsr _LVOFreeSignal(a6) - - move.l (sp)+,a6 - rts - - - ifeq NO_TIMERS - ifeq VBLANK_MUSIC -;--------------------------------------------------------------------------- -mt_cia_timer_a_code: -; TimerA interrupt calls mt_music at a selectable tempo (Fxx command), -; which defaults to 50 times per second. - - movem.l d2-d7/a2-a6,-(sp) - lea CUSTOM,a6 - ifd SDATA - lea _LinkerDB,a4 - else - lea mt_data(pc),a4 - endc - - ; do music when enabled - tst.b mt_Enable(a4) - ifeq MINIMAL - beq .2 - else - beq .1 - endc - - bsr mt_music ; music with sfx inserted -.1: movem.l (sp)+,d2-d7/a2-a6 - rts - - ifeq MINIMAL -.2: bsr mt_sfxonly ; no music, only sfx - movem.l (sp)+,d2-d7/a2-a6 - rts - endc - endc ; !VBLANK_MUSIC - - -;--------------------------------------------------------------------------- -mt_cia_timer_b_code: -; Handle one-shot TimerB interrupt. -; TB_toggle-technique suggested by Ross/EAB. - - lea TB_toggle(pc),a0 - not.b (a0) - lea CUSTOM+INTREQ,a0 - beq mt_TimerBsetrep - - ; restart timer for repeat, enable audio DMA after DMADELAY ticks - move.b #$19,CIAB+CIACRB - move.w mt_dmaon(pc),DMACON-INTREQ(a0) - rts - -TB_toggle: - dc.b 0 - even - - -mt_TimerBsetrep: -; Oneshot TimerB interrupt to set repeat samples after another DMADELAY ticks. - - move.l a4,-(sp) - - ifd SDATA - lea _LinkerDB,a4 - else - lea mt_data(pc),a4 - endc - - ; clear possible audio interrupt flags - moveq #0,d0 - or.b mt_dmaon+1(pc),d0 - lsl.w #7,d0 - move.w d0,(a0) - - ; set repeat sample pointers and lengths - ifne MINIMAL - move.l mt_chan1+n_loopstart(a4),AUD0LC-INTREQ(a0) - move.w mt_chan1+n_replen(a4),AUD0LEN-INTREQ(a0) - move.l mt_chan2+n_loopstart(a4),AUD1LC-INTREQ(a0) - move.w mt_chan2+n_replen(a4),AUD1LEN-INTREQ(a0) - move.l mt_chan3+n_loopstart(a4),AUD2LC-INTREQ(a0) - move.w mt_chan3+n_replen(a4),AUD2LEN-INTREQ(a0) - move.l mt_chan4+n_loopstart(a4),AUD3LC-INTREQ(a0) - move.w mt_chan4+n_replen(a4),AUD3LEN-INTREQ(a0) - - else ; !MINIMAL - tst.b mt_chan1+n_enable(a4) - beq .1 - move.l mt_chan1+n_loopstart(a4),AUD0LC-INTREQ(a0) - move.w mt_chan1+n_replen(a4),AUD0LEN-INTREQ(a0) -.1: tst.b mt_chan2+n_enable(a4) - beq .2 - move.l mt_chan2+n_loopstart(a4),AUD1LC-INTREQ(a0) - move.w mt_chan2+n_replen(a4),AUD1LEN-INTREQ(a0) -.2: tst.b mt_chan3+n_enable(a4) - beq .3 - move.l mt_chan3+n_loopstart(a4),AUD2LC-INTREQ(a0) - move.w mt_chan3+n_replen(a4),AUD2LEN-INTREQ(a0) -.3: tst.b mt_chan4+n_enable(a4) - beq .4 - move.l mt_chan4+n_loopstart(a4),AUD3LC-INTREQ(a0) - move.w mt_chan4+n_replen(a4),AUD3LEN-INTREQ(a0) -.4: - endc - - move.l (sp)+,a4 - rts - endc ; !NO_TIMERS - - - else !OSCOMPAT -;--------------------------------------------------------------------------- - xdef _mt_install - xdef _mt_install_cia -_mt_install: -_mt_install_cia: -; Install a CIA-B interrupt for calling mt_music. -; a6 = CUSTOM -; a0 = VectorBase -; d0 = PALflag.b (0 is NTSC) - - ifnd SDATA - move.l a4,-(sp) - lea mt_data(pc),a4 - endc - - clr.b mt_Enable(a4) - - ifeq NO_TIMERS - ; remember level 6 vector and interrupt enable - lea $78(a0),a0 - move.l a0,mt_Lev6Int(a4) - move.w #$2000,d1 - and.w INTENAR(a6),d1 - or.w #$8000,d1 - move.w d1,mt_Lev6Ena(a4) - - ; disable level 6 EXTER interrupts, set player interrupt vector - move.w #$2000,INTENA(a6) - move.l (a0),mt_oldLev6(a4) - lea mt_TimerAInt(pc),a1 - move.l a1,(a0) - - ; reset TimerB toggle - lea TB_toggle(pc),a0 - clr.b (a0) - - ; disable CIA-B interrupts, stop and save all timers - lea CIAB,a0 - moveq #0,d1 - move.b #$7f,CIAICR(a0) - move.b d1,CIACRA(a0) - move.b d1,CIACRB(a0) - lea mt_oldtimers(a4),a1 - move.b CIATALO(a0),(a1)+ - move.b CIATAHI(a0),(a1)+ - move.b CIATBLO(a0),(a1)+ - move.b CIATBHI(a0),(a1) - - ifeq VBLANK_MUSIC - ; determine if 02 clock for timers is based on PAL or NTSC - tst.b d0 - bne .1 - move.l #1789773,d0 ; NTSC - bra .2 -.1: move.l #1773447,d0 ; PAL -.2: move.l d0,mt_timerval(a4) - - ; load TimerA in continuous mode for the default tempo of 125 - divu #125,d0 - move.b d0,CIATALO(a0) - lsr.w #8,d0 - move.b d0,CIATAHI(a0) - move.b #$11,CIACRA(a0) ; load timer, start continuous - endc ; !VBLANK_MUSIC - - ; load TimerB with DMADELAY ticks for setting DMA and repeat - move.b #DMADELAY&255,CIATBLO(a0) - move.b #DMADELAY>>8,CIATBHI(a0) - - ; Ack. pending interrupts, TimerA and TimerB interrupt enable - tst.b CIAICR(a0) - move.w #$2000,INTREQ(a6) - ifne VBLANK_MUSIC - move.b #$82,CIAICR(a0) ; TimerB only for VBLANK_MUSIC - else - move.b #$83,CIAICR(a0) - endc - - ; enable level 6 interrupts - move.w #$a000,INTENA(a6) - endc ; !NO_TIMERS - - bra mt_reset - - -;--------------------------------------------------------------------------- - xdef _mt_remove_cia - xdef _mt_remove -_mt_remove_cia: -_mt_remove: -; Remove CIA-B music interrupt and restore the old vector. -; a6 = CUSTOM - - ifeq NO_TIMERS - ifnd SDATA - move.l a4,-(sp) - lea mt_data(pc),a4 - endc - - ; disable level 6 and CIA-B interrupts - lea CIAB,a0 - move.w #$2000,d0 - move.b #$7f,CIAICR(a0) - move.w d0,INTENA(a6) - tst.b CIAICR(a0) - move.w d0,INTREQ(a6) - - ; restore old timer values - lea mt_oldtimers(a4),a1 - move.b (a1)+,CIATALO(a0) - move.b (a1)+,CIATAHI(a0) - move.b (a1)+,CIATBLO(a0) - move.b (a1),CIATBHI(a0) - move.b #$10,CIACRA(a0) - move.b #$10,CIACRB(a0) - - ; restore original level 6 interrupt vector - move.l mt_Lev6Int(a4),a1 - move.l mt_oldLev6(a4),(a1) - - ; reenable CIA-B ALRM interrupt, which was set by AmigaOS - move.b #$84,CIAICR(a0) - - ; reenable previous level 6 interrupt - move.w mt_Lev6Ena(a4),INTENA(a6) - - ifnd SDATA - move.l (sp)+,a4 - endc - endc ; !NO_TIMERS - rts - - - ifeq NO_TIMERS -;--------------------------------------------------------------------------- -mt_TimerAInt: -; TimerA interrupt calls mt_music at a selectable tempo (Fxx command), -; which defaults to 50 times per second. - - ; check for TB interrupt and clear CIAB interrupt flags - btst #1,CIAB+CIAICR - bne mt_TimerBInt - - ifne VBLANK_MUSIC - move.w #$2000,CUSTOM+INTREQ ; ack interrupt and leave - nop - rte - - else - ; Now it should be a TA interrupt. - ; Other level 6 interrupt sources have to be handled elsewhere. - movem.l d0-d7/a0-a6,-(sp) - lea CUSTOM,a6 - ifd SDATA - lea _LinkerDB,a4 - else - lea mt_data(pc),a4 - endc - - ; clear EXTER interrupt flag - move.w #$2000,INTREQ(a6) - - ; do music when enabled - tst.b mt_Enable(a4) - ifeq MINIMAL - beq .2 - else - beq .1 - endc - - bsr mt_music ; music with sfx inserted -.1: movem.l (sp)+,d0-d7/a0-a6 - nop - rte - - ifeq MINIMAL -.2: bsr mt_sfxonly ; no music, only sfx - movem.l (sp)+,d0-d7/a0-a6 - nop - rte - endc - endc ; !VBLANK_MUSIC - - -;--------------------------------------------------------------------------- -mt_TimerBInt: -; Handle one-shot TimerB interrupt. -; TB_toggle-technique suggested by Ross/EAB. - - move.l a0,-(sp) - lea TB_toggle(pc),a0 - not.b (a0) - lea CUSTOM+INTREQ,a0 - beq mt_TimerBsetrep - - ; restart timer for repeat, enable audio DMA after DMADELAY ticks - move.w #$2000,(a0) ; clear EXTER interrupt flag - move.b #$19,CIAB+CIACRB - move.w mt_dmaon(pc),DMACON-INTREQ(a0) - - move.l (sp)+,a0 - nop - rte - - -mt_TimerBsetrep: -; Oneshot TimerB interrupt to set repeat samples after another DMADELAY ticks. - - ; clear EXTER and possible audio interrupt flags - move.l a4,-(sp) - move.l d0,a4 - moveq #$2000>>7,d0 ; EXTER-flag - or.b mt_dmaon+1(pc),d0 - lsl.w #7,d0 - move.w d0,(a0) - move.l a4,d0 - - ifd SDATA - lea _LinkerDB,a4 - else - lea mt_data(pc),a4 - endc - - ; set repeat sample pointers and lengths - ifne MINIMAL - move.l mt_chan1+n_loopstart(a4),AUD0LC-INTREQ(a0) - move.w mt_chan1+n_replen(a4),AUD0LEN-INTREQ(a0) - move.l mt_chan2+n_loopstart(a4),AUD1LC-INTREQ(a0) - move.w mt_chan2+n_replen(a4),AUD1LEN-INTREQ(a0) - move.l mt_chan3+n_loopstart(a4),AUD2LC-INTREQ(a0) - move.w mt_chan3+n_replen(a4),AUD2LEN-INTREQ(a0) - move.l mt_chan4+n_loopstart(a4),AUD3LC-INTREQ(a0) - move.w mt_chan4+n_replen(a4),AUD3LEN-INTREQ(a0) - - else ; !MINIMAL - tst.b mt_chan1+n_enable(a4) - beq .1 - move.l mt_chan1+n_loopstart(a4),AUD0LC-INTREQ(a0) - move.w mt_chan1+n_replen(a4),AUD0LEN-INTREQ(a0) -.1: tst.b mt_chan2+n_enable(a4) - beq .2 - move.l mt_chan2+n_loopstart(a4),AUD1LC-INTREQ(a0) - move.w mt_chan2+n_replen(a4),AUD1LEN-INTREQ(a0) -.2: tst.b mt_chan3+n_enable(a4) - beq .3 - move.l mt_chan3+n_loopstart(a4),AUD2LC-INTREQ(a0) - move.w mt_chan3+n_replen(a4),AUD2LEN-INTREQ(a0) -.3: tst.b mt_chan4+n_enable(a4) - beq .4 - move.l mt_chan4+n_loopstart(a4),AUD3LC-INTREQ(a0) - move.w mt_chan4+n_replen(a4),AUD3LEN-INTREQ(a0) -.4: - endc - - move.l (sp)+,a4 - move.l (sp)+,a0 - nop - rte - -TB_toggle: - dc.b 0 - even - endc ; !NO_TIMERS - endc ; !OSCOMPAT - - - ifne NO_TIMERS -;--------------------------------------------------------------------------- - - xdef _mt_dmaon -_mt_dmaon: -; Enable audio DMA after some delay. -; Called by main program, for example out of a copper-interrupt. - - move.w mt_dmaon(pc),CUSTOM+DMACON - rts - - - xdef _mt_setrep -_mt_setrep: -; Set repeat sample pointers and lengths. -; Called by main program, for example out of a copper-interrupt. - - movem.l a0/a4,-(sp) - - ; reset audio interrupt flags - lea CUSTOM+INTREQ,a0 - move.l d0,a4 - move.w mt_dmaon(pc),d0 - lsl.w #7,d0 - move.w d0,(a0) - move.l a4,d0 - - ifd SDATA - lea _LinkerDB,a4 - else - lea mt_data(pc),a4 - endc - - ; set repeat sample pointers and lengths - ifne MINIMAL - move.l mt_chan1+n_loopstart(a4),AUD0LC-INTREQ(a0) - move.w mt_chan1+n_replen(a4),AUD0LEN-INTREQ(a0) - move.l mt_chan2+n_loopstart(a4),AUD1LC-INTREQ(a0) - move.w mt_chan2+n_replen(a4),AUD1LEN-INTREQ(a0) - move.l mt_chan3+n_loopstart(a4),AUD2LC-INTREQ(a0) - move.w mt_chan3+n_replen(a4),AUD2LEN-INTREQ(a0) - move.l mt_chan4+n_loopstart(a4),AUD3LC-INTREQ(a0) - move.w mt_chan4+n_replen(a4),AUD3LEN-INTREQ(a0) - - else ; !MINIMAL - tst.b mt_chan1+n_enable(a4) - beq .1 - move.l mt_chan1+n_loopstart(a4),AUD0LC-INTREQ(a0) - move.w mt_chan1+n_replen(a4),AUD0LEN-INTREQ(a0) -.1: tst.b mt_chan2+n_enable(a4) - beq .2 - move.l mt_chan2+n_loopstart(a4),AUD1LC-INTREQ(a0) - move.w mt_chan2+n_replen(a4),AUD1LEN-INTREQ(a0) -.2: tst.b mt_chan3+n_enable(a4) - beq .3 - move.l mt_chan3+n_loopstart(a4),AUD2LC-INTREQ(a0) - move.w mt_chan3+n_replen(a4),AUD2LEN-INTREQ(a0) -.3: tst.b mt_chan4+n_enable(a4) - beq .4 - move.l mt_chan4+n_loopstart(a4),AUD3LC-INTREQ(a0) - move.w mt_chan4+n_replen(a4),AUD3LEN-INTREQ(a0) -.4: - endc - - movem.l (sp)+,a0/a4 - rts - endc ; NO_TIMERS - - even -mt_dmaon: - dc.w $8000 - - -;--------------------------------------------------------------------------- - xdef _mt_init -_mt_init: -; Initialize new module. -; Reset speed to 6, tempo to 125 and start at given song position. -; Master volume is at 64 (maximum). -; a6 = CUSTOM -; a0 = module pointer -; a1 = sample pointer (NULL means samples are stored within the module) -; d0 = initial song position - - ifnd SDATA - move.l a4,-(sp) - lea mt_data(pc),a4 - endc - - move.l a0,mt_mod(a4) - movem.l d2/a2,-(sp) - - ; set initial song position - cmp.b 950(a0),d0 - blo .1 - moveq #0,d0 -.1: move.b d0,mt_SongPos(a4) - - move.l a1,d0 ; sample data location is given? - bne .4 - - ; get number of highest pattern - lea 952(a0),a1 ; song arrangement list - moveq #127,d0 - moveq #0,d2 -.2: move.b (a1)+,d1 - cmp.b d2,d1 - bls .3 - move.b d1,d2 -.3: dbf d0,.2 - addq.b #1,d2 ; number of patterns - - ; now we can calculate the base address of the sample data - moveq #10,d0 - asl.l d0,d2 - lea (a0,d2.l),a1 - add.w #1084,a1 - - ; save start address of each sample and do some fixes for broken mods -.4: lea mt_SampleStarts(a4),a2 - moveq #1,d2 - moveq #31-1,d0 -.5: move.l a1,(a2)+ - moveq #0,d1 - move.w 42(a0),d1 - cmp.w d2,d1 ; length 0 and 1 define unused samples - bls .6 - add.l d1,d1 - add.l d1,a1 - bra .7 -.6: clr.w 42(a0) ; length 1 means zero -> no sample -.7: lea 30(a0),a0 - dbf d0,.5 - - movem.l (sp)+,d2/a2 - - ifeq VBLANK_MUSIC - ; reset CIA timer A to default (125) - move.l mt_timerval(a4),d0 - divu #125,d0 - move.b d0,CIAB+CIATALO - lsr.w #8,d0 - move.b d0,CIAB+CIATAHI - endc - -mt_reset: -; a4 must be initialized with base register - - ; reset speed and counters - move.b #6,mt_Speed(a4) - clr.b mt_Counter(a4) - clr.w mt_PatternPos(a4) - clr.b mt_PattDelTime(a4) - clr.b mt_PattDelTime2(a4) - clr.w mt_PBreakPos(a4) - clr.b mt_PBreakFlag(a4) - clr.b mt_PosJumpFlag(a4) - - ; disable the filter - or.b #2,CIAA+CIAPRA - - ifeq MINIMAL - ; set master volume to 64 - lea MasterVolTab64(pc),a0 - move.l a0,mt_MasterVolTab(a4) - endc - - ; set channel index - clr.b mt_chan1+n_index(a4) - move.b #1,mt_chan2+n_index(a4) - move.b #2,mt_chan3+n_index(a4) - move.b #3,mt_chan4+n_index(a4) - - ; initialize channel DMA and interrupt bits - move.w #$0001,mt_chan1+n_dmabit(a4) - move.w #$0002,mt_chan2+n_dmabit(a4) - move.w #$0004,mt_chan3+n_dmabit(a4) - move.w #$0008,mt_chan4+n_dmabit(a4) - move.w #$0080,mt_chan1+n_intbit(a4) - move.w #$0100,mt_chan2+n_intbit(a4) - move.w #$0200,mt_chan3+n_intbit(a4) - move.w #$0400,mt_chan4+n_intbit(a4) - - clr.b mt_E8Trigger(a4) - ifeq MINIMAL - clr.b mt_SongEnd(a4) - clr.b mt_SilCntValid(a4) - endc - - ifnd SDATA - move.l (sp)+,a4 - endc - - -;--------------------------------------------------------------------------- - xdef _mt_end -_mt_end: -; Stop playing current module. -; a6 = CUSTOM - - DISABLE - ifd SDATA - clr.b mt_Enable(a4) - lea mt_chan1(a4),a0 - bsr resetch - lea mt_chan2(a4),a0 - bsr resetch - lea mt_chan3(a4),a0 - bsr resetch - lea mt_chan4(a4),a0 - bsr resetch - else - lea mt_data(pc),a1 - clr.b mt_Enable(a1) - lea mt_chan1(a1),a0 - bsr resetch - lea mt_chan2(a1),a0 - bsr resetch - lea mt_chan3(a1),a0 - bsr resetch - lea mt_chan4(a1),a0 - bsr resetch - endc - moveq #0,d0 - move.w d0,AUD0VOL(a6) - move.w d0,AUD1VOL(a6) - move.w d0,AUD2VOL(a6) - move.w d0,AUD3VOL(a6) - move.w #$000f,DMACON(a6) - ENABLE - rts - - -resetch: -; a0 = channel status -; All registers are preserved! - - move.w #320,n_period(a0) ; make sure period is not illegal - clr.w n_volume(a0) - clr.w n_sfxlen(a0) - clr.w n_funk(a0) - clr.b n_sfxpri(a0) - clr.b n_looped(a0) - clr.b n_gliss(a0) - ifeq MINIMAL - clr.b n_musiconly(a0) - st n_enable(a0) - endc - rts - - - ifeq MINIMAL -;--------------------------------------------------------------------------- - xdef _mt_soundfx -_mt_soundfx: -; Request playing of an external sound effect on the most unused channel. -; This function is for compatibility with the old API only! -; You should call _mt_playfx instead! -; a6 = CUSTOM -; a0 = sample pointer -; d0.w = sample length in words -; d1.w = sample period -; d2.w = sample volume - - lea -sfx_sizeof(sp),sp - move.l a0,sfx_ptr(sp) - movem.w d0-d2,sfx_len(sp) - move.w #$ff01,sfx_cha(sp) ; any channel, priority=1 - move.l sp,a0 - bsr _mt_playfx - lea sfx_sizeof(sp),sp - rts - - -;--------------------------------------------------------------------------- - xdef _mt_playfx -_mt_playfx: -; Request playing of a prioritized external sound effect, either on a -; fixed channel or on the most unused one. -; A negative channel specification means to use the best one. -; The priority is unsigned and should be greater than zero. -; This channel will be blocked for music until the effect has finished. -; a6 = CUSTOM -; a0 = sfx-structure pointer with the following layout: -; 0: ptr, 4: len.w, 6: period.w, 8: vol.w, 10: channel.b, 11: priority.b -; -> d0 = pointer to channel status or NULL when sample was ignored - - ifd SDATA - movem.l d2-d7/a0-a3/a5,-(sp) - else - movem.l d2-d7/a0-a5,-(sp) - lea mt_data(pc),a4 - endc - - DISABLE - moveq #0,d0 - move.b sfx_cha(a0),d0 - bpl channelsfx ; use fixed channel for effect - - ; Did we already calculate the n_freecnt values for all channels? - tst.b mt_SilCntValid(a4) - bne freecnt_valid - - ; Look at the next 8 pattern steps to find the longest sequence - ; of silence (no new note or instrument). - moveq #8,d2 - move.l #$fffff000,d3 ; mask to ignore effects - - ; reset freecnts for all channels - moveq #0,d0 - move.b d0,mt_chan1+n_freecnt(a4) - move.b d0,mt_chan2+n_freecnt(a4) - move.b d0,mt_chan3+n_freecnt(a4) - move.b d0,mt_chan4+n_freecnt(a4) - moveq #-1,d4 - moveq #-1,d5 - moveq #-1,d6 - moveq #-1,d7 - - ; get pattern pointer - move.l mt_mod(a4),a3 ; a3 mod pointer - lea 952(a3),a5 ; a5 song arrangement list - move.w mt_PatternPos(a4),d1 - move.b mt_SongPos(a4),d0 -.1: move.b (a5,d0.w),d0 - swap d0 - lea 1084(a3),a1 - lsr.l #6,d0 - add.l d0,a1 - lea 1024(a1),a2 ; a2 end of pattern - add.w d1,a1 ; a1 current pattern pos - -.2: moveq #0,d0 - - move.l (a1)+,d1 - and.l d3,d1 - seq d1 - and.b d1,d4 - sub.b d4,mt_chan1+n_freecnt(a4) - add.b d4,d0 - - move.l (a1)+,d1 - and.l d3,d1 - seq d1 - and.b d1,d5 - sub.b d5,mt_chan2+n_freecnt(a4) - add.b d5,d0 - - move.l (a1)+,d1 - and.l d3,d1 - seq d1 - and.b d1,d6 - sub.b d6,mt_chan3+n_freecnt(a4) - add.b d6,d0 - - move.l (a1)+,d1 - and.l d3,d1 - seq d1 - and.b d1,d7 - sub.b d7,mt_chan4+n_freecnt(a4) - add.b d7,d0 - - ; break the loop when no channel has any more free pattern steps - beq .7 - - ; otherwise break after 8 pattern steps - subq.w #1,d2 - beq .7 - - ; End of pattern reached? Then load next pattern pointer. - cmp.l a2,a1 - blo .2 - moveq #0,d1 - moveq #1,d0 - add.b mt_SongPos(a4),d0 - and.w #$007f,d0 - cmp.b 950(a3),d0 ; end of song reached? - blo .1 - moveq #0,d0 - bra .1 - -.7: st mt_SilCntValid(a4) - -freecnt_valid: - sub.l a2,a2 - move.b sfx_pri(a0),d2 - - ; Determine which channels are already allocated for sound - ; effects and check if the limit was reached. In this case only - ; replace sound effect channels by higher priority. - moveq #3,d0 - sub.b mt_MusicChannels(a4),d0 - move.b mt_chan1+n_sfxpri(a4),d4 - or.b mt_chan1+n_musiconly(a4),d4 - sne d1 - add.b d1,d0 - move.b mt_chan2+n_sfxpri(a4),d5 - or.b mt_chan2+n_musiconly(a4),d5 - sne d1 - add.b d1,d0 - move.b mt_chan3+n_sfxpri(a4),d6 - or.b mt_chan3+n_musiconly(a4),d6 - sne d1 - add.b d1,d0 - move.b mt_chan4+n_sfxpri(a4),d7 - or.b mt_chan4+n_musiconly(a4),d7 - sne d1 - add.b d1,d0 - bmi .overwrite ; all channels reserved/playing effects - - ; We will prefer a music channel which had an audio interrupt, - ; because that means the last instrument sample has been played - ; completely, and the channel is now in an idle loop. - ; Also exclude channels which have set a repeat loop. - ; Try not to break them! - moveq #0,d3 - tst.b mt_chan1+n_looped(a4) - bne .1 - or.w #$0080,d3 -.1: tst.b mt_chan2+n_looped(a4) - bne .2 - or.w #$0100,d3 -.2: tst.b mt_chan3+n_looped(a4) - bne .3 - or.w #$0200,d3 -.3: tst.b mt_chan4+n_looped(a4) - bne .4 - or.w #$0400,d3 -.4: move.w INTREQR(a6),d1 - and.w d3,d1 - bne .6 - - ; All channels are busy. Then break the non-looped ones first... - move.w d3,d1 - bne .6 - - ; ..except there are none. Then it doesn't matter. :| - move.w #$0780,d1 - - ; first look for the best unused channel -.6: moveq #0,d3 - btst #7,d1 - seq d0 - or.b d4,d0 - bne .7 - lea mt_chan1+n_freecnt(a4),a1 - cmp.b (a1),d3 - bhi .7 - move.l a1,a2 - move.b (a1),d3 -.7: btst #8,d1 - seq d0 - or.b d5,d0 - bne .8 - lea mt_chan2+n_freecnt(a4),a1 - cmp.b (a1),d3 - bhi .8 - move.l a1,a2 - move.b (a1),d3 -.8: btst #9,d1 - seq d0 - or.b d6,d0 - bne .9 - lea mt_chan3+n_freecnt(a4),a1 - cmp.b (a1),d3 - bhi .9 - move.l a1,a2 - move.b (a1),d3 -.9: btst #10,d1 - seq d0 - or.b d7,d0 - bne .10 - lea mt_chan4+n_freecnt(a4),a1 - cmp.b (a1),d3 - bhi .10 - move.l a1,a2 - bra found_sfx_ch - -.10: move.l a2,d3 - bne found_sfx_ch - -.overwrite: - ; finally try to overwrite a sound effect with lower/equal priority - moveq #0,d3 - tst.b d4 - beq .11 - cmp.b d4,d2 - blo .11 - lea mt_chan1+n_freecnt(a4),a2 - move.b (a2),d3 -.11: tst.b d5 - beq .12 - cmp.b d5,d2 - blo .12 - lea mt_chan2+n_freecnt(a4),a1 - cmp.b (a1),d3 - bhi .12 - move.l a1,a2 - move.b (a1),d3 -.12: tst.b d6 - beq .13 - cmp.b d6,d2 - blo .13 - lea mt_chan3+n_freecnt(a4),a1 - cmp.b (a1),d3 - bhi .13 - move.l a1,a2 - move.b (a1),d3 -.13: tst.b d7 - beq .14 - cmp.b d7,d2 - blo .14 - lea mt_chan4+n_freecnt(a4),a1 - cmp.b (a1),d3 - bhi .14 - move.l a1,a2 - -.14: move.l a2,d3 - beq exit_playfx ; ignore new sfx due to low priority - -found_sfx_ch: - lea -n_freecnt(a2),a2 - bra set_sfx - -channelsfx: -; a0 = sfx structure -; d0 = fixed channel for new sound effect - add.w d0,d0 - lea mt_chan1(a4),a2 - add.w channel_offsets(pc,d0.w),a2 - - ; priority high enough to replace a present effect on this channel? - move.b sfx_pri(a0),d2 - cmp.b n_sfxpri(a2),d2 - bhs set_sfx - sub.l a2,a2 - bra exit_playfx - -set_sfx: -; activate the sound effect on this channel -; a0 = sfx structure -; d2 = sfx priority -; a2 = channel status - move.l (a0)+,n_sfxptr(a2) ; sfx_ptr - move.w (a0)+,n_sfxlen(a2) ; sfx_len - move.w (a0)+,n_sfxper(a2) ; sfx_per - move.w (a0),n_sfxvol(a2) ; sfx_vol - move.b d2,n_sfxpri(a2) - -exit_playfx: - ENABLE - move.l a2,d0 ; ptr to selected channel or NULL - - ifd SDATA - movem.l (sp)+,d2-d7/a0-a3/a5 - else - movem.l (sp)+,d2-d7/a0-a5 - endc - rts - -channel_offsets: - dc.w 0*n_sizeof,1*n_sizeof,2*n_sizeof,3*n_sizeof - - -;--------------------------------------------------------------------------- - xdef _mt_loopfx -_mt_loopfx: -; Request playing of a looped sound effect on a fixed channel, which -; will be blocked for music until the effect is stopped (_mt_stopfx). -; It uses the same sfx-structure as _mt_playfx, but the priority is -; ignored. A looped sound effect has always highest priority and will -; replace a previous effect on the same channel. No automatic channel -; selection possible! -; Also make sure the sample starts with a zero-word, which is used -; for idling when the effect is stopped. This word is included in the -; total length calculation, but excluded when actually playing the loop. -; a6 = CUSTOM -; a0 = sfx-structure pointer with the following layout: -; 0: ptr, 4: len.w, 6: period.w, 8: vol.w, 10: channel.b - - ifnd SDATA - lea mt_data+mt_chan1(pc),a1 - else - lea mt_chan1(a4),a1 - endc - - moveq #3,d0 - and.b sfx_cha(a0),d0 - add.w d0,d0 - add.w channel_offsets(pc,d0.w),a1 - - DISABLE - move.l (a0)+,n_sfxptr(a1) ; sfx_ptr - move.w (a0)+,n_sfxlen(a1) ; sfx_len - move.w (a0)+,n_sfxper(a1) ; sfx_per - move.w (a0),n_sfxvol(a1) ; sfx_vol - st n_sfxpri(a1) ; sfx_pri -1 enables looped mode - ENABLE - rts - - -;--------------------------------------------------------------------------- - xdef _mt_stopfx -_mt_stopfx: -; Immediately stop a currently playing sound effect on a channel. -; a6 = CUSTOM -; d0.b = channel (0..3) - - ifnd SDATA - lea mt_data+mt_chan1(pc),a0 - else - lea mt_chan1(a4),a0 - endc - - and.w #3,d0 - add.w d0,d0 - add.w channel_offsets(pc,d0.w),a0 - - DISABLE - tst.b n_sfxpri(a0) - beq .1 ; no sfx playing anyway - moveq #1,d0 - move.b d0,n_sfxpri(a0) - move.w d0,n_sfxlen(a0) ; idle loop - move.w #108,n_sfxper(a0) ; enter idle as quickly as possible - clr.w n_sfxvol(a0) ; and cut volume - ifne NULL_IS_CLEARED - clr.b n_looped(a0) - clr.l n_sfxptr(a0) ; use $0 for idle-looping - else - tst.b n_looped(a0) - beq .1 - clr.b n_looped(a0) - subq.l #2,n_sfxptr(a0) ; idle loop at sample-start - 2 - endc -.1: ENABLE - - rts - - -;--------------------------------------------------------------------------- - xdef _mt_musicmask -_mt_musicmask: -; Set bits in the mask define which specific channels are reserved -; for music only. -; a6 = CUSTOM -; d0.b = channel-mask (bit 0 for channel 0, ..., bit 3 for channel 3) - - ifnd SDATA - move.l a4,-(sp) - lea mt_data(pc),a4 - endc - - DISABLE - - lsl.b #5,d0 - scs mt_chan4+n_musiconly(a4) - add.b d0,d0 - scs mt_chan3+n_musiconly(a4) - add.b d0,d0 - scs mt_chan2+n_musiconly(a4) - add.b d0,d0 - scs mt_chan1+n_musiconly(a4) - - ENABLE - - ifnd SDATA - move.l (sp)+,a4 - endc - rts - - -;--------------------------------------------------------------------------- - xdef _mt_mastervol -_mt_mastervol: -; Set a master volume from 0 to 64 for all music channels. -; Note that the master volume does not affect the volume of external -; sound effects (which is desired). -; a6 = CUSTOM -; d0.w = master volume - - ifnd SDATA - move.l a4,-(sp) - lea mt_data(pc),a4 - endc - - ; stingray, since each volume table has a size of 65 bytes - ; we simply multiply (optimised of course) by 65 to get the - ; offset to the correct table - lea MasterVolTab0(pc),a0 - add.w d0,a0 - lsl.w #6,d0 - add.w d0,a0 - - ; set new table and adapt all channel volumes immediately - DISABLE - move.l a0,mt_MasterVolTab(a4) - bsr set_all_volumes - ENABLE - - ifnd SDATA - move.l (sp)+,a4 - endc - rts - - -;--------------------------------------------------------------------------- - xdef _mt_channelmask -_mt_channelmask: -; Define which music channels are muted. Doesn't affect sound effects. -; a6 = CUSTOM -; d0.b = channel-mask (bit 0 for channel 0, ..., bit 3 for channel 3) - - ifnd SDATA - move.l a4,-(sp) - lea mt_data(pc),a4 - endc - - DISABLE - - lsl.b #5,d0 - scs mt_chan4+n_enable(a4) - add.b d0,d0 - scs mt_chan3+n_enable(a4) - add.b d0,d0 - scs mt_chan2+n_enable(a4) - add.b d0,d0 - scs mt_chan1+n_enable(a4) - move.l mt_MasterVolTab(a4),a0 - bsr set_all_volumes - - ENABLE - - ifnd SDATA - move.l (sp)+,a4 - endc - rts - - -;--------------------------------------------------------------------------- -set_all_volumes: -; a0 = Master volume table - - tst.b mt_chan1+n_sfxpri(a4) - bne .1 - move.w mt_chan1+n_volume(a4),d0 - move.b (a0,d0.w),d0 - and.b mt_chan1+n_enable(a4),d0 - move.w d0,AUD0VOL(a6) - ifd VOL0_UNLOOPS - bne .1 - clr.b mt_chan1+n_looped(a4) - endc -.1: tst.b mt_chan2+n_sfxpri(a4) - bne .2 - move.w mt_chan2+n_volume(a4),d0 - move.b (a0,d0.w),d0 - and.b mt_chan2+n_enable(a4),d0 - move.w d0,AUD1VOL(a6) - ifd VOL0_UNLOOPS - bne .2 - clr.b mt_chan2+n_looped(a4) - endc -.2: tst.b mt_chan3+n_sfxpri(a4) - bne .3 - move.w mt_chan3+n_volume(a4),d0 - move.b (a0,d0.w),d0 - and.b mt_chan3+n_enable(a4),d0 - move.w d0,AUD2VOL(a6) - ifd VOL0_UNLOOPS - bne .3 - clr.b mt_chan3+n_looped(a4) - endc -.3: tst.b mt_chan4+n_sfxpri(a4) - bne .4 - move.w mt_chan4+n_volume(a4),d0 - move.b (a0,d0.w),d0 - and.b mt_chan4+n_enable(a4),d0 - move.w d0,AUD3VOL(a6) - ifd VOL0_UNLOOPS - bne .4 - clr.b mt_chan4+n_looped(a4) - endc -.4: rts - - -;--------------------------------------------------------------------------- - xdef _mt_samplevol -_mt_samplevol: -; Redefine a sample's volume. May also be done while the song is playing. -; Warning: Does not check arguments for valid range! You must have done -; _mt_init before calling this function! -; The new volume is persistent. Even when the song is restarted. -; d0.w = sample number (0-31) -; d1.b = volume (0-64) - - ifd SDATA - move.l mt_mod(a4),a0 - else - move.l mt_data+mt_mod(pc),a0 - endc - - swap d1 - move.w d0,d1 - add.w d1,d1 - lsl.w #5,d0 - sub.w d1,d0 ; table index: sample number * 30 - swap d1 - move.b d1,12+3(a0,d0.w) ; set sample's volume - rts - endc ; !MINIMAL - - -;--------------------------------------------------------------------------- - xdef _mt_music -_mt_music: -; Used when called by external interrupt handler. -; Saves/restores all registers and sets up A4 when needed. -; a6 = CUSTOM - - ifd SDATA - movem.l d2-d7/a2-a3/a5,-(sp) - bsr mt_music - movem.l (sp)+,d2-d7/a2-a3/a5 - else ; !SDATA - movem.l d2-d7/a2-a5,-(sp) - lea mt_data(pc),a4 - bsr mt_music - movem.l (sp)+,d2-d7/a2-a5 - endc - rts - -mt_music: -; Called from interrupt. -; Play next position when Counter equals Speed. -; Effects are always handled. -; a6 = CUSTOM - - moveq #0,d7 ; d7 is always zero - - lea mt_dmaon+1(pc),a0 - move.b d7,(a0) - - addq.b #1,mt_Counter(a4) - - move.b mt_Counter(a4),d0 - cmp.b mt_Speed(a4),d0 - blo no_new_note - - ; handle a new note - move.b d7,mt_Counter(a4) - tst.b mt_PattDelTime2(a4) - beq get_new_note - - ; we have a pattern delay, check effects then step - lea AUD0LC(a6),a5 - lea mt_chan1(a4),a2 - bsr mt_checkfx - lea AUD1LC(a6),a5 - lea mt_chan2(a4),a2 - bsr mt_checkfx - lea AUD2LC(a6),a5 - lea mt_chan3(a4),a2 - bsr mt_checkfx - lea AUD3LC(a6),a5 - lea mt_chan4(a4),a2 - bsr mt_checkfx - bra settb_step - -no_new_note: - ; no new note, just check effects, don't step to next position - lea AUD0LC(a6),a5 - lea mt_chan1(a4),a2 - bsr mt_checkfx - lea AUD1LC(a6),a5 - lea mt_chan2(a4),a2 - bsr mt_checkfx - lea AUD2LC(a6),a5 - lea mt_chan3(a4),a2 - bsr mt_checkfx - lea AUD3LC(a6),a5 - lea mt_chan4(a4),a2 - bsr mt_checkfx - - ifeq NO_TIMERS - ; set one-shot TimerB interrupt for enabling DMA, when needed - move.b mt_dmaon+1(pc),d0 - beq same_pattern - move.b #$19,CIAB+CIACRB ; load/start timer B, one-shot - endc - bra same_pattern - -get_new_note: - ; determine pointer to current pattern line - move.l mt_mod(a4),a0 - lea 12(a0),a3 ; sample info table - lea 1084(a0),a1 ; pattern data - lea 952(a0),a0 - moveq #0,d0 - move.b mt_SongPos(a4),d0 - move.b (a0,d0.w),d0 ; current pattern number - swap d0 - lsr.l #6,d0 - add.l d0,a1 ; pattern base - add.w mt_PatternPos(a4),a1 ; a1 pattern line - - ; play new note for each channel, apply some effects - lea AUD0LC(a6),a5 - lea mt_chan1(a4),a2 - bsr mt_playvoice - lea AUD1LC(a6),a5 - lea mt_chan2(a4),a2 - bsr mt_playvoice - lea AUD2LC(a6),a5 - lea mt_chan3(a4),a2 - bsr mt_playvoice - lea AUD3LC(a6),a5 - lea mt_chan4(a4),a2 - bsr mt_playvoice - -settb_step: - ifeq NO_TIMERS - ; set one-shot TimerB interrupt for enabling DMA, when needed - move.b mt_dmaon+1(pc),d0 - beq pattern_step - move.b #$19,CIAB+CIACRB ; load/start timer B, one-shot - endc - -pattern_step: - ; next pattern line, handle delay and break - ifeq MINIMAL - clr.b mt_SilCntValid(a4) ; recalculate silence counters - endc - moveq #16,d2 ; offset to next pattern line - - move.b mt_PattDelTime2(a4),d1 - move.b mt_PattDelTime(a4),d0 - beq .1 - move.b d0,d1 - move.b d7,mt_PattDelTime(a4) -.1: tst.b d1 - beq .3 - subq.b #1,d1 - beq .2 - moveq #0,d2 ; do not advance to next line -.2: move.b d1,mt_PattDelTime2(a4) - -.3: add.w mt_PatternPos(a4),d2 ; d2 PatternPos - - ; check for break - bclr d7,mt_PBreakFlag(a4) - beq .4 - move.w mt_PBreakPos(a4),d2 - move.w d7,mt_PBreakPos(a4) - - ; check whether end of pattern is reached -.4: move.w d2,mt_PatternPos(a4) - cmp.w #1024,d2 - blo same_pattern - -song_step: - move.w mt_PBreakPos(a4),mt_PatternPos(a4) - move.w d7,mt_PBreakPos(a4) - move.b d7,mt_PosJumpFlag(a4) - - ; next position in song - moveq #1,d0 - add.b mt_SongPos(a4),d0 - and.w #$007f,d0 - move.l mt_mod(a4),a0 - cmp.b 950(a0),d0 ; end of song reached? - blo .1 - moveq #0,d0 ; restart the song from the beginning - ifeq MINIMAL - addq.b #1,mt_SongEnd(a4) - bne .2 - clr.b mt_Enable(a4) ; stop the song when mt_SongEnd was -1 -.2: and.b #$7f,mt_SongEnd(a4) - endc -.1: move.b d0,mt_SongPos(a4) - -same_pattern: - tst.b mt_PosJumpFlag(a4) - bne song_step - - rts - - - ifeq MINIMAL -;--------------------------------------------------------------------------- -mt_sfxonly: -; Called from interrupt. -; Plays sound effects on free channels. -; a6 = CUSTOM - - moveq #0,d7 ; d7 is always zero - - lea mt_dmaon+1(pc),a0 - move.b d7,(a0) - - lea AUD0LC(a6),a5 - lea mt_chan1(a4),a2 - bsr chan_sfx_only - lea AUD1LC(a6),a5 - lea mt_chan2(a4),a2 - bsr chan_sfx_only - lea AUD2LC(a6),a5 - lea mt_chan3(a4),a2 - bsr chan_sfx_only - lea AUD3LC(a6),a5 - lea mt_chan4(a4),a2 - bsr chan_sfx_only - - ifeq NO_TIMERS - move.b mt_dmaon+1(pc),d0 - beq .1 - move.b #$19,CIAB+CIACRB ; load/start timer B, one-shot - endc - -.1: rts - - -chan_sfx_only: -; Check for new sound samples. Check if previous ones are finished. -; a2 = channel data -; a5 = audio registers - - tst.b n_sfxpri(a2) - beq .1 - - move.w n_sfxlen(a2),d0 - bne start_sfx - tst.b n_looped(a2) - bne .1 - - move.w n_intbit(a2),d0 - and.w INTREQR(a6),d0 - beq .1 - move.w n_dmabit(a2),d0 - and.w mt_dmaon(pc),d0 - bne .1 - - ; last sound effect sample has played, so unblock this channel again - move.b d7,n_sfxpri(a2) - -.1: rts - - -;--------------------------------------------------------------------------- -start_sfx: -; d0 = sfx_len in words -; a2 = channel data -; a5 = audio registers - - ; play new sound effect on this channel - move.w n_dmabit(a2),d1 - move.w d1,DMACON(a6) - - move.l n_sfxptr(a2),a0 - tst.b n_sfxpri(a2) - bpl .1 - - ; looped sound effect - st n_looped(a2) - addq.l #2,a0 ; skip first word, used for idling - subq.w #1,d0 - move.l a0,AUDLC(a5) - move.w d0,AUDLEN(a5) - bra .2 - - ; normal sound effect -.1: move.b d7,n_looped(a2) - move.l a0,AUDLC(a5) - move.w d0,AUDLEN(a5) - moveq #1,d0 ; idles after playing once - ifne NULL_IS_CLEARED - sub.l a0,a0 - endc - - ; save repeat and period for TimerB interrupt -.2: move.l a0,n_loopstart(a2) - move.w d0,n_replen(a2) - move.w n_sfxper(a2),d0 - move.w d0,AUDPER(a5) - move.w d0,n_period(a2) - move.w n_sfxvol(a2),AUDVOL(a5) - - move.w d7,n_sfxlen(a2) ; don't call start_sfx again - - lea mt_dmaon(pc),a0 - or.w d1,(a0) ; DMA-channel to enable on TimerB - rts - endc ; !MINIMAL - - -;--------------------------------------------------------------------------- -mt_checkfx: -; a2 = channel data -; a5 = audio registers - - ifeq MINIMAL - tst.b n_sfxpri(a2) - beq .3 - - move.w n_sfxlen(a2),d0 - beq .2 - bsr start_sfx - - ; channel is blocked, only check some E-commands -.1: move.w #$0fff,d4 - and.w n_cmd(a2),d4 - move.w d4,d0 - clr.b d0 - cmp.w #$0e00,d0 - bne mt_nop - and.w #$00ff,d4 - bra blocked_e_cmds - -.2: tst.b n_looped(a2) - bne .1 - move.w n_intbit(a2),d0 - and.w INTREQR(a6),d0 - beq .1 - move.w n_dmabit(a2),d0 - and.w mt_dmaon(pc),d0 - bne .1 - - ; sound effect sample has played, so unblock this channel again - move.b d7,n_sfxpri(a2) - endc ; !MINIMAL - - ; do channel effects between notes -.3: move.w n_funk(a2),d0 - beq .4 - bsr mt_updatefunk - -.4: move.w #$0fff,d4 - and.w n_cmd(a2),d4 - beq mt_pernop - and.w #$00ff,d4 - - moveq #$0f,d0 - and.b n_cmd(a2),d0 - add.w d0,d0 - move.w fx_tab(pc,d0.w),d0 - jmp fx_tab(pc,d0.w) - -fx_tab: - dc.w mt_arpeggio-fx_tab ; $0 - dc.w mt_portaup-fx_tab - dc.w mt_portadown-fx_tab - dc.w mt_toneporta-fx_tab - dc.w mt_vibrato-fx_tab ; $4 - dc.w mt_tonevolslide-fx_tab - dc.w mt_vibrvolslide-fx_tab - dc.w mt_tremolo-fx_tab - dc.w mt_nop-fx_tab ; $8 - dc.w mt_nop-fx_tab - dc.w mt_volumeslide-fx_tab - dc.w mt_nop-fx_tab - dc.w mt_nop-fx_tab ; $C - dc.w mt_nop-fx_tab - dc.w mt_e_cmds-fx_tab - dc.w mt_nop-fx_tab - - -mt_pernop: -; just set the current period - - move.w n_period(a2),AUDPER(a5) -mt_nop: - rts - - -;--------------------------------------------------------------------------- -mt_playvoice: -; a1 = pattern ptr -; a2 = channel data -; a3 = sample info table -; a5 = audio registers - - move.l (a1)+,d6 ; d6 current note/cmd words - - ifeq MINIMAL - ; channel blocked by external sound effect? - tst.b n_sfxpri(a2) - beq .2 - - move.w n_sfxlen(a2),d0 - beq .1 - bsr start_sfx - bra moreblockedfx - - ; do only some limited commands, while sound effect is in progress -.1: tst.b n_looped(a2) - bne moreblockedfx - move.w n_intbit(a2),d0 - and.w INTREQR(a6),d0 - beq moreblockedfx - move.w n_dmabit(a2),d0 - and.w mt_dmaon(pc),d0 - bne moreblockedfx - - ; sound effect sample has played, so unblock this channel again - move.b d7,n_sfxpri(a2) - endc ; !MINIMAL - -.2: tst.l (a2) ; n_note/cmd: any note or cmd set? - bne .3 - move.w n_period(a2),AUDPER(a5) -.3: move.l d6,(a2) - - moveq #15,d5 - and.b n_cmd(a2),d5 - add.w d5,d5 ; d5 cmd*2 - - moveq #0,d4 - move.b d6,d4 ; d4 cmd argument (in MSW) - swap d4 - move.w #$0ff0,d4 - and.w d6,d4 ; d4 for checking E-cmd (in LSW) - - swap d6 - move.l d6,d0 ; S...S... - clr.b d0 - rol.w #4,d0 - rol.l #4,d0 ; ....00SS - - and.w #$0fff,d6 ; d6 note - - ; get sample start address - add.w d0,d0 ; sample number * 2 - beq set_regs - move.w mult30tab(pc,d0.w),d1 ; d1 sample info table offset - lea mt_SampleStarts(a4),a0 - add.w d0,d0 - move.l -4(a0,d0.w),d2 - - ; read length, volume and repeat from sample info table - lea (a3,d1.w),a0 - move.w (a0)+,d0 ; length - bne .4 - - ifne NULL_IS_CLEARED - moveq #0,d2 ; use $0 for empty samples - else - ; use the first two bytes from the first sample for empty samples - move.l mt_SampleStarts(a4),d2 - endc - addq.w #1,d0 - -.4: move.l d2,n_start(a2) - move.w d0,n_reallength(a2) - - ; determine period table from fine-tune parameter - moveq #0,d3 - move.b (a0)+,d3 - add.w d3,d3 - move.l a0,d1 - lea mt_PerFineTune(pc),a0 - add.w (a0,d3.w),a0 - move.l a0,n_pertab(a2) - move.l d1,a0 - cmp.w #2*8,d3 - shs n_minusft(a2) - - moveq #0,d1 - move.b (a0)+,d1 ; volume - move.w d1,n_volume(a2) - move.w (a0)+,d3 ; repeat offset - beq no_offset - - ; set repeat - add.l d3,d2 - add.l d3,d2 - move.w (a0),d0 - move.w d0,n_replen(a2) - exg d0,d3 ; n_replen to d3 - add.w d3,d0 - bra set_len_start - -mult30tab: - dc.w 0*30,1*30,2*30,3*30,4*30,5*30,6*30,7*30 - dc.w 8*30,9*30,10*30,11*30,12*30,13*30,14*30,15*30 - dc.w 16*30,17*30,18*30,19*30,20*30,21*30,22*30,23*30 - dc.w 24*30,25*30,26*30,27*30,28*30,29*30,30*30,31*30 - -no_offset: - move.w (a0),d3 - ifne NULL_IS_CLEARED - cmp.w #1,d3 - beq .1 - bhi set_replen - else - bne set_replen - endc - ; repeat length zero means idle-looping - addq.w #1,d3 -.1: moveq #0,d2 ; expect two zero bytes at $0 -set_replen: - move.w d3,n_replen(a2) -set_len_start: - move.w d0,n_length(a2) - move.l d2,n_loopstart(a2) - move.l d2,n_wavestart(a2) - - ifeq MINIMAL - move.l mt_MasterVolTab(a4),a0 - move.b (a0,d1.w),d1 - and.b n_enable(a2),d1 - endc - move.w d1,AUDVOL(a5) - - ; remember if sample is looped - ; @@@ FIXME: also need to check if n_loopstart equals n_start - subq.w #1,d3 - sne n_looped(a2) - -set_regs: -; d4 = cmd argument | masked E-cmd -; d5 = cmd*2 -; d6 = cmd.w | note.w - - move.w d4,d3 ; d3 masked E-cmd - swap d4 ; d4 cmd argument into LSW - - tst.w d6 - beq checkmorefx ; no new note - - cmp.w #$0e50,d3 - beq set_finetune - - move.w prefx_tab(pc,d5.w),d0 - jmp prefx_tab(pc,d0.w) - -prefx_tab: - dc.w set_period-prefx_tab,set_period-prefx_tab,set_period-prefx_tab - dc.w set_toneporta-prefx_tab ; $3 - dc.w set_period-prefx_tab - dc.w set_toneporta-prefx_tab ; $5 - dc.w set_period-prefx_tab,set_period-prefx_tab,set_period-prefx_tab - dc.w set_sampleoffset-prefx_tab ; $9 - dc.w set_period-prefx_tab,set_period-prefx_tab,set_period-prefx_tab - dc.w set_period-prefx_tab,set_period-prefx_tab,set_period-prefx_tab - - -mt_sampleoffset: -; cmd 9 x y (xy = offset in 256 bytes) -; d4 = xy - - moveq #0,d0 - move.b d4,d0 - bne .1 - move.b n_sampleoffset(a2),d0 - bra .2 -.1: move.b d0,n_sampleoffset(a2) - -.2: lsl.w #7,d0 - cmp.w n_length(a2),d0 - bhs .3 - sub.w d0,n_length(a2) - add.w d0,d0 - add.l d0,n_start(a2) - rts - -.3: move.w #1,n_length(a2) - rts - - -set_sampleoffset: - bsr mt_sampleoffset - bra set_period - -set_finetune: - lea mt_PerFineTune(pc),a0 - moveq #$0f,d0 - and.b d4,d0 - add.w d0,d0 - add.w (a0,d0.w),a0 - move.l a0,n_pertab(a2) - cmp.w #2*8,d0 - shs n_minusft(a2) - -set_period: -; find nearest period for a note value, then apply finetuning -; d3 = masked E-cmd -; d4 = cmd argument -; d5 = cmd*2 -; d6 = note.w - - lea mt_PeriodTable(pc),a0 - moveq #36-1,d0 - moveq #-2,d1 -.1: addq.w #2,d1 ; table offset - cmp.w (a0)+,d6 - dbhs d0,.1 - - ; apply finetuning, set period and note-offset - move.l n_pertab(a2),a0 - move.w (a0,d1.w),d2 - move.w d2,n_period(a2) - move.w d1,n_noteoff(a2) - - ; check for notedelay - cmp.w #$0ed0,d3 ; notedelay - beq checkmorefx - - ; disable DMA - move.w n_dmabit(a2),d0 - move.w d0,DMACON(a6) - - btst #2,n_vibratoctrl(a2) - bne .2 - move.b d7,n_vibratopos(a2) - -.2: btst #2,n_tremoloctrl(a2) - bne .3 - move.b d7,n_tremolopos(a2) - -.3: move.l n_start(a2),AUDLC(a5) - move.w n_length(a2),AUDLEN(a5) - move.w d2,AUDPER(a5) - lea mt_dmaon(pc),a0 - or.w d0,(a0) - -checkmorefx: -; d4 = cmd argument -; d5 = cmd*2 -; d6 = note.w - - move.w n_funk(a2),d0 - beq .1 - bsr mt_updatefunk - -.1: move.w morefx_tab(pc,d5.w),d0 - jmp morefx_tab(pc,d0.w) - -morefx_tab: - dc.w mt_pernop-morefx_tab,mt_pernop-morefx_tab,mt_pernop-morefx_tab - dc.w mt_pernop-morefx_tab,mt_pernop-morefx_tab,mt_pernop-morefx_tab - dc.w mt_pernop-morefx_tab,mt_pernop-morefx_tab,mt_pernop-morefx_tab - dc.w mt_sampleoffset-morefx_tab ; $9 - dc.w mt_pernop-morefx_tab - dc.w mt_posjump-morefx_tab ; $B - dc.w mt_volchange-morefx_tab - dc.w mt_patternbrk-morefx_tab ; $D - dc.w mt_e_cmds-morefx_tab - dc.w mt_setspeed-morefx_tab - - -set_toneporta: - move.l n_pertab(a2),a0 ; tuned period table - - ; find first period which is less or equal the note in d6 - moveq #36-1,d0 - moveq #-2,d1 -.1: addq.w #2,d1 - cmp.w (a0)+,d6 - dbhs d0,.1 - - tst.b n_minusft(a2) ; negative fine tune? - beq .2 - tst.w d1 - beq .2 - subq.l #2,a0 ; then take previous period - subq.w #2,d1 - -.2: move.w d1,n_noteoff(a2) ; note offset in period table - move.w n_period(a2),d2 - move.w -(a0),d1 - cmp.w d1,d2 - bne .3 - moveq #0,d1 -.3: move.w d1,n_wantedperiod(a2) - - move.w n_funk(a2),d0 - beq .4 - bsr mt_updatefunk - -.4: move.w d2,AUDPER(a5) - rts - - - ifeq MINIMAL -moreblockedfx: -; d6 = note.w | cmd.w - - moveq #0,d4 - move.b d6,d4 ; cmd argument - and.w #$0f00,d6 - lsr.w #7,d6 - move.w blmorefx_tab(pc,d6.w),d0 - jmp blmorefx_tab(pc,d0.w) - -blmorefx_tab: - dc.w mt_nop-blmorefx_tab,mt_nop-blmorefx_tab - dc.w mt_nop-blmorefx_tab,mt_nop-blmorefx_tab - dc.w mt_nop-blmorefx_tab,mt_nop-blmorefx_tab - dc.w mt_nop-blmorefx_tab,mt_nop-blmorefx_tab - dc.w mt_nop-blmorefx_tab,mt_nop-blmorefx_tab - dc.w mt_nop-blmorefx_tab - dc.w mt_posjump-blmorefx_tab ; $B - dc.w mt_nop-blmorefx_tab - dc.w mt_patternbrk-blmorefx_tab ; $D - dc.w blocked_e_cmds-blmorefx_tab - dc.w mt_setspeed-blmorefx_tab ; $F - endc ; !MINIMAL - - -mt_arpeggio: -; cmd 0 x y (x = first arpeggio offset, y = second arpeggio offset) -; d4 = xy - - moveq #0,d0 - move.b mt_Counter(a4),d0 - move.b arptab(pc,d0.w),d0 - beq mt_pernop ; step 0, just use normal period - bmi .1 - - ; step 1, arpeggio by left nibble - lsr.b #4,d4 - bra .2 - - ; step 2, arpeggio by right nibble -.1: and.w #$000f,d4 - - ; offset current note -.2: add.w d4,d4 - add.w n_noteoff(a2),d4 - cmp.w #2*36,d4 - bhs .4 - - ; set period with arpeggio offset from note table - move.l n_pertab(a2),a0 - move.w (a0,d4.w),AUDPER(a5) -.4: rts - -arptab: - dc.b 0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0 - dc.b 1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1 - - -mt_fineportaup: -; cmd E 1 x (subtract x from period) -; d0 = x - - tst.b mt_Counter(a4) - beq do_porta_up - rts - - -mt_portaup: -; cmd 1 x x (subtract xx from period) -; d4 = xx - - move.w d4,d0 - -do_porta_up: - move.w n_period(a2),d1 - sub.w d0,d1 - cmp.w #113,d1 - bge .1 - moveq #113,d1 -.1: move.w d1,n_period(a2) - move.w d1,AUDPER(a5) - rts - - -mt_fineportadn: -; cmd E 2 x (add x to period) -; d0 = x - - tst.b mt_Counter(a4) - beq do_porta_down - rts - - -mt_portadown: -; cmd 2 x x (add xx to period) -; d4 = xx - - move.w d4,d0 - -do_porta_down: - move.w n_period(a2),d1 - add.w d0,d1 - cmp.w #856,d1 - bls .1 - move.w #856,d1 -.1: move.w d1,n_period(a2) - move.w d1,AUDPER(a5) - rts - - -mt_toneporta: -; cmd 3 x y (xy = tone portamento speed) -; d4 = xy - - tst.b d4 - beq mt_toneporta_nc - move.w d4,n_toneportspeed(a2) - move.b d7,n_cmdlo(a2) - -mt_toneporta_nc: - move.w n_wantedperiod(a2),d1 - beq .6 - - move.w n_toneportspeed(a2),d0 - move.w n_period(a2),d2 - cmp.w d1,d2 - blo .2 - - ; tone porta up - sub.w d0,d2 - cmp.w d1,d2 - bgt .3 - move.w d1,d2 - move.w d7,n_wantedperiod(a2) - bra .3 - - ; tone porta down -.2: add.w d0,d2 - cmp.w d1,d2 - blt .3 - move.w d1,d2 - move.w d7,n_wantedperiod(a2) - -.3: move.w d2,n_period(a2) - - tst.b n_gliss(a2) - beq .5 - - ; glissando: find nearest note for new period - move.l n_pertab(a2),a0 - moveq #36-1,d0 - moveq #-2,d1 -.4: addq.w #2,d1 - cmp.w (a0)+,d2 - dbhs d0,.4 - - move.w d1,n_noteoff(a2) ; @@@ needed? - move.w -(a0),d2 - -.5: move.w d2,AUDPER(a5) -.6 rts - - -mt_vibrato: -; cmd 4 x y (x = speed, y = amplitude) -; d4 = xy - - moveq #$0f,d2 - and.b d4,d2 - beq .1 - move.b d2,n_vibratoamp(a2) - bra .2 -.1: move.b n_vibratoamp(a2),d2 - -.2: lsr.b #4,d4 - beq .3 - move.b d4,n_vibratospd(a2) - bra mt_vibrato_nc -.3: move.b n_vibratospd(a2),d4 - -mt_vibrato_nc: - ; calculate vibrato table offset: 64 * amplitude + (pos & 63) - lsl.w #6,d2 - moveq #63,d0 - and.b n_vibratopos(a2),d0 - add.w d0,d2 - - ifne ENABLE_SAWRECT - ; select vibrato waveform - moveq #3,d1 - and.b n_vibratoctrl(a2),d1 - beq .6 - subq.b #1,d1 - beq .5 - - ; ctrl 2 & 3 select a rectangle vibrato - lea mt_VibratoRectTable(pc),a0 - bra .9 - - ; ctrl 1 selects a sawtooth vibrato -.5: lea mt_VibratoSawTable(pc),a0 - bra .9 - endc ; ENABLE_SAWRECT - - ; ctrl 0 selects a sine vibrato -.6: lea mt_VibratoSineTable(pc),a0 - - ; add vibrato-offset to period -.9: move.b (a0,d2.w),d0 - ext.w d0 - add.w n_period(a2),d0 - move.w d0,AUDPER(a5) - - ; increase vibratopos by speed - add.b d4,n_vibratopos(a2) - rts - - -mt_tonevolslide: -; cmd 5 x y (x = volume-up, y = volume-down) -; d4 = xy - - pea mt_volumeslide(pc) - bra mt_toneporta_nc - - -mt_vibrvolslide: -; cmd 6 x y (x = volume-up, y = volume-down) -; d4 = xy - - move.w d4,d3 - move.b n_vibratoamp(a2),d2 - move.b n_vibratospd(a2),d4 - bsr mt_vibrato_nc - - move.w d3,d4 - bra mt_volumeslide - - -mt_tremolo: -; cmd 7 x y (x = speed, y = amplitude) -; d4 = xy - - moveq #$0f,d2 - and.b d4,d2 - beq .1 - move.b d2,n_tremoloamp(a2) - bra .2 -.1: move.b n_tremoloamp(a2),d2 - -.2: lsr.b #4,d4 - beq .3 - move.b d4,n_tremolospd(a2) - bra .4 -.3: move.b n_tremolospd(a2),d4 - - ; calculate tremolo table offset: 64 * amplitude + (pos & 63) -.4: lsl.w #6,d2 - moveq #63,d0 - and.b n_tremolopos(a2),d0 - add.w d0,d2 - - ifne ENABLE_SAWRECT - ; select tremolo waveform - moveq #3,d1 - and.b n_tremoloctrl(a2),d1 - beq .6 - subq.b #1,d1 - beq .5 - - ; ctrl 2 & 3 select a rectangle tremolo - lea mt_VibratoRectTable(pc),a0 - bra .9 - - ; ctrl 1 selects a sawtooth tremolo -.5: lea mt_VibratoSawTable(pc),a0 - bra .9 - endc ; ENABLE_SAWRECT - - ; ctrl 0 selects a sine tremolo -.6: lea mt_VibratoSineTable(pc),a0 - - ; add tremolo-offset to volume -.9: move.w n_volume(a2),d0 - add.b (a0,d2.w),d0 - bpl .10 - moveq #0,d0 -.10: cmp.w #64,d0 - bls .11 - moveq #64,d0 -.11: move.w n_period(a2),AUDPER(a5) - ifeq MINIMAL - move.l mt_MasterVolTab(a4),a0 - move.b (a0,d0.w),d0 - and.b n_enable(a2),d0 - endc - move.w d0,AUDVOL(a5) - ifd VOL0_UNLOOPS - bne .12 - move.b d7,n_looped(a2) - endc - - ; increase tremolopos by speed -.12: add.b d4,n_tremolopos(a2) - rts - - -mt_volumeslide: -; cmd A x y (x = volume-up, y = volume-down) -; d4 = xy - - move.w n_volume(a2),d0 - moveq #$0f,d1 - and.b d4,d1 - lsr.b #4,d4 - beq vol_slide_down - - ; slide up, until 64 - add.b d4,d0 -vol_slide_up: - cmp.b #64,d0 - bls set_pervol - moveq #64,d0 - bra set_pervol - - ; slide down, until 0 -vol_slide_down: - sub.b d1,d0 - bpl set_pervol - moveq #0,d0 - -set_pervol: - move.w n_period(a2),AUDPER(a5) -set_vol: - move.w d0,n_volume(a2) - ifeq MINIMAL - move.l mt_MasterVolTab(a4),a0 - move.b (a0,d0.w),d0 - and.b n_enable(a2),d0 - endc - move.w d0,AUDVOL(a5) - ifd VOL0_UNLOOPS - bne .1 - move.b d7,n_looped(a2) - endc -.1: rts - - -mt_posjump: -; cmd B x y (xy = new song position) -; d4 = xy - - move.b d4,d0 - subq.b #1,d0 - move.b d0,mt_SongPos(a4) - -jump_pos0: - move.w d7,mt_PBreakPos(a4) - st mt_PosJumpFlag(a4) - rts - - -mt_volchange: -; cmd C x y (xy = new volume) -; d4 = xy - - move.w d4,d0 - cmp.w #64,d0 - bls set_vol - moveq #64,d0 - bra set_vol - - -mt_patternbrk: -; cmd D x y (xy = break pos in decimal) -; d4 = xy - - moveq #$0f,d0 - and.w d4,d0 - move.w d4,d1 - lsr.w #4,d1 - add.b mult10tab(pc,d1.w),d0 - cmp.b #63,d0 - bhi jump_pos0 - - lsl.w #4,d0 - move.w d0,mt_PBreakPos(a4) - st mt_PosJumpFlag(a4) - rts - -mult10tab: - dc.b 0,10,20,30,40,50,60,70,80,90,0,0,0,0,0,0 - - -mt_setspeed: -; cmd F x y (xy<$20 new speed, xy>=$20 new tempo) -; d4 = xy - - ifeq VBLANK_MUSIC - cmp.b #$20,d4 - bhs .1 - endc - - move.b d4,mt_Speed(a4) - beq _mt_end - rts - - ifeq VBLANK_MUSIC - ; set tempo (CIA only) -.1: and.w #$00ff,d4 - move.l mt_timerval(a4),d0 - divu d4,d0 - move.b d0,CIAB+CIATALO - lsr.w #8,d0 - move.b d0,CIAB+CIATAHI - rts - endc - - -mt_e_cmds: -; cmd E x y (x=command, y=argument) -; d4 = xy - - moveq #$0f,d0 - and.w d4,d0 ; pass E-cmd argument in d0 - - move.w d4,d1 - lsr.w #4,d1 - add.w d1,d1 - move.w ecmd_tab(pc,d1.w),d1 - jmp ecmd_tab(pc,d1.w) - -ecmd_tab: - dc.w mt_filter-ecmd_tab - dc.w mt_fineportaup-ecmd_tab - dc.w mt_fineportadn-ecmd_tab - dc.w mt_glissctrl-ecmd_tab - dc.w mt_vibratoctrl-ecmd_tab - dc.w mt_finetune-ecmd_tab - dc.w mt_jumploop-ecmd_tab - dc.w mt_tremoctrl-ecmd_tab - dc.w mt_e8-ecmd_tab - dc.w mt_retrignote-ecmd_tab - dc.w mt_volfineup-ecmd_tab - dc.w mt_volfinedn-ecmd_tab - dc.w mt_notecut-ecmd_tab - dc.w mt_notedelay-ecmd_tab - dc.w mt_patterndelay-ecmd_tab - dc.w mt_funk-ecmd_tab - - -blocked_e_cmds: -; cmd E x y (x=command, y=argument) -; d4 = xy - - moveq #$0f,d0 - and.w d4,d0 ; pass E-cmd argument in d0 - - move.w d4,d1 - lsr.w #4,d1 - add.w d1,d1 - move.w blecmd_tab(pc,d1.w),d1 - jmp blecmd_tab(pc,d1.w) - -blecmd_tab: - dc.w mt_filter-blecmd_tab - dc.w mt_rts-blecmd_tab - dc.w mt_rts-blecmd_tab - dc.w mt_glissctrl-blecmd_tab - dc.w mt_vibratoctrl-blecmd_tab - dc.w mt_finetune-blecmd_tab - dc.w mt_jumploop-blecmd_tab - dc.w mt_tremoctrl-blecmd_tab - dc.w mt_e8-blecmd_tab - dc.w mt_rts-blecmd_tab - dc.w mt_rts-blecmd_tab - dc.w mt_rts-blecmd_tab - dc.w mt_rts-blecmd_tab - dc.w mt_rts-blecmd_tab - dc.w mt_patterndelay-blecmd_tab - dc.w mt_rts-blecmd_tab - - -mt_filter: -; cmd E 0 x (x=1 disable, x=0 enable) -; d0 = x - - lsr.b #1,d0 - bcs .1 - bclr #1,CIAA+CIAPRA - rts -.1: bset #1,CIAA+CIAPRA -mt_rts: - rts - - -mt_glissctrl: -; cmd E 3 x (x gliss) -; d0 = x - - move.b d0,n_gliss(a2) - rts - - -mt_vibratoctrl: -; cmd E 4 x (x = vibrato) -; d0 = x - - move.b d0,n_vibratoctrl(a2) - rts - - -mt_finetune: -; cmd E 5 x (x = finetune) -; d0 = x - - lea mt_PerFineTune(pc),a0 - add.w d0,d0 - add.w (a0,d0.w),a0 - move.l a0,n_pertab(a2) - cmp.w #2*8,d0 - shs n_minusft(a2) - rts - - -mt_jumploop: -; cmd E 6 x (x=0 loop start, else loop count) -; d0 = x - - tst.b mt_Counter(a4) - bne .4 - -.1: tst.b d0 - beq .3 ; set start - - ; otherwise we are at the end of the loop - subq.b #1,n_loopcount(a2) - beq .4 ; loop finished - bpl .2 - - ; initialize loop counter - move.b d0,n_loopcount(a2) - - ; jump back to start of loop -.2: move.w n_pattpos(a2),mt_PBreakPos(a4) - st mt_PBreakFlag(a4) - rts - - ; remember start of loop position -.3: move.w mt_PatternPos(a4),n_pattpos(a2) -.4: rts - - -mt_tremoctrl: -; cmd E 7 x (x = tremolo) -; d0 = x - - move.b d0,n_tremoloctrl(a2) - rts - - -mt_e8: -; cmd E 8 x (x = trigger value) -; d0 = x - - move.b d0,mt_E8Trigger(a4) - rts - - -mt_retrignote: -; cmd E 9 x (x = retrigger count) -; d0 = x - - tst.b d0 - beq .1 - - ; set new retrigger count when Counter=0 - tst.b mt_Counter(a4) - bne .2 - move.b d0,n_retrigcount(a2) - - ; avoid double retrigger, when Counter=0 and a note was set - move.w #$0fff,d2 - and.w (a2),d2 - beq do_retrigger -.1: rts - - ; check if retrigger count is reached -.2: subq.b #1,n_retrigcount(a2) - bne .1 - move.b d0,n_retrigcount(a2) ; reset - -do_retrigger: - ; DMA off, set sample pointer and length - move.w n_dmabit(a2),d0 - move.w d0,DMACON(a6) - move.l n_start(a2),AUDLC(a5) - move.w n_length(a2),AUDLEN(a5) - lea mt_dmaon(pc),a0 - or.w d0,(a0) - rts - - -mt_volfineup: -; cmd E A x (x = volume add) -; d0 = x - - tst.b mt_Counter(a4) - beq .1 - rts - -.1: add.w n_volume(a2),d0 - bra vol_slide_up - - -mt_volfinedn: -; cmd E B x (x = volume sub) -; d0 = x - - tst.b mt_Counter(a4) - beq .1 - rts - -.1: move.b d0,d1 - move.w n_volume(a2),d0 - bra vol_slide_down - - -mt_notecut: -; cmd E C x (x = counter to cut at) -; d0 = x - - cmp.b mt_Counter(a4),d0 - bne .1 - move.w d7,n_volume(a2) - move.w d7,AUDVOL(a5) - ifd VOL0_UNLOOPS - move.b d7,n_looped(a2) - endc -.1: rts - - -mt_notedelay: -; cmd E D x (x = counter to retrigger at) -; d0 = x - - cmp.b mt_Counter(a4),d0 - bne .1 - tst.w (a2) ; trigger note when given - bne .2 -.1: rts -.2: move.w n_period(a2),AUDPER(a5) - bra do_retrigger - - -mt_patterndelay: -; cmd E E x (x = delay count) -; d0 = x - - tst.b mt_Counter(a4) - bne .1 - tst.b mt_PattDelTime2(a4) - bne .1 - addq.b #1,d0 - move.b d0,mt_PattDelTime(a4) -.1: rts - - -mt_funk: -; cmd E F x (x = funk speed) -; d0 = x - - tst.b mt_Counter(a4) - bne .1 - move.w d0,n_funk(a2) - bne mt_updatefunk -.1: rts - -mt_updatefunk: -; d0 = funk speed - - move.b mt_FunkTable(pc,d0.w),d0 - add.b d0,n_funkoffset(a2) - bpl .2 - move.b d7,n_funkoffset(a2) - - move.l n_loopstart(a2),d0 - moveq #0,d1 - move.w n_replen(a2),d1 - add.l d1,d1 - add.l d0,d1 - move.l n_wavestart(a2),a0 - addq.l #1,a0 - cmp.l d1,a0 - blo .1 - move.l d0,a0 -.1: move.l a0,n_wavestart(a2) - not.b (a0) - -.2: rts - - -mt_FunkTable: - dc.b 0,5,6,7,8,10,11,13,16,19,22,26,32,43,64,128 - -mt_VibratoSineTable: - dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - dc.b 0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1 - dc.b 1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0 - dc.b 0,0,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 - dc.b -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0 - dc.b 0,0,0,1,1,1,2,2,2,3,3,3,3,3,3,3 - dc.b 3,3,3,3,3,3,3,3,2,2,2,1,1,1,0,0 - dc.b 0,0,0,-1,-1,-1,-2,-2,-2,-3,-3,-3,-3,-3,-3,-3 - dc.b -3,-3,-3,-3,-3,-3,-3,-3,-2,-2,-2,-1,-1,-1,0,0 - dc.b 0,0,1,1,2,2,3,3,4,4,4,5,5,5,5,5 - dc.b 5,5,5,5,5,5,4,4,4,3,3,2,2,1,1,0 - dc.b 0,0,-1,-1,-2,-2,-3,-3,-4,-4,-4,-5,-5,-5,-5,-5 - dc.b -5,-5,-5,-5,-5,-5,-4,-4,-4,-3,-3,-2,-2,-1,-1,0 - dc.b 0,0,1,2,3,3,4,5,5,6,6,7,7,7,7,7 - dc.b 7,7,7,7,7,7,6,6,5,5,4,3,3,2,1,0 - dc.b 0,0,-1,-2,-3,-3,-4,-5,-5,-6,-6,-7,-7,-7,-7,-7 - dc.b -7,-7,-7,-7,-7,-7,-6,-6,-5,-5,-4,-3,-3,-2,-1,0 - dc.b 0,0,1,2,3,4,5,6,7,7,8,8,9,9,9,9 - dc.b 9,9,9,9,9,8,8,7,7,6,5,4,3,2,1,0 - dc.b 0,0,-1,-2,-3,-4,-5,-6,-7,-7,-8,-8,-9,-9,-9,-9 - dc.b -9,-9,-9,-9,-9,-8,-8,-7,-7,-6,-5,-4,-3,-2,-1,0 - dc.b 0,1,2,3,4,5,6,7,8,9,9,10,11,11,11,11 - dc.b 11,11,11,11,11,10,9,9,8,7,6,5,4,3,2,1 - dc.b 0,-1,-2,-3,-4,-5,-6,-7,-8,-9,-9,-10,-11,-11,-11,-11 - dc.b -11,-11,-11,-11,-11,-10,-9,-9,-8,-7,-6,-5,-4,-3,-2,-1 - dc.b 0,1,2,4,5,6,7,8,9,10,11,12,12,13,13,13 - dc.b 13,13,13,13,12,12,11,10,9,8,7,6,5,4,2,1 - dc.b 0,-1,-2,-4,-5,-6,-7,-8,-9,-10,-11,-12,-12,-13,-13,-13 - dc.b -13,-13,-13,-13,-12,-12,-11,-10,-9,-8,-7,-6,-5,-4,-2,-1 - dc.b 0,1,3,4,6,7,8,10,11,12,13,14,14,15,15,15 - dc.b 15,15,15,15,14,14,13,12,11,10,8,7,6,4,3,1 - dc.b 0,-1,-3,-4,-6,-7,-8,-10,-11,-12,-13,-14,-14,-15,-15,-15 - dc.b -15,-15,-15,-15,-14,-14,-13,-12,-11,-10,-8,-7,-6,-4,-3,-1 - dc.b 0,1,3,5,6,8,9,11,12,13,14,15,16,17,17,17 - dc.b 17,17,17,17,16,15,14,13,12,11,9,8,6,5,3,1 - dc.b 0,-1,-3,-5,-6,-8,-9,-11,-12,-13,-14,-15,-16,-17,-17,-17 - dc.b -17,-17,-17,-17,-16,-15,-14,-13,-12,-11,-9,-8,-6,-5,-3,-1 - dc.b 0,1,3,5,7,9,11,12,14,15,16,17,18,19,19,19 - dc.b 19,19,19,19,18,17,16,15,14,12,11,9,7,5,3,1 - dc.b 0,-1,-3,-5,-7,-9,-11,-12,-14,-15,-16,-17,-18,-19,-19,-19 - dc.b -19,-19,-19,-19,-18,-17,-16,-15,-14,-12,-11,-9,-7,-5,-3,-1 - dc.b 0,2,4,6,8,10,12,13,15,16,18,19,20,20,21,21 - dc.b 21,21,21,20,20,19,18,16,15,13,12,10,8,6,4,2 - dc.b 0,-2,-4,-6,-8,-10,-12,-13,-15,-16,-18,-19,-20,-20,-21,-21 - dc.b -21,-21,-21,-20,-20,-19,-18,-16,-15,-13,-12,-10,-8,-6,-4,-2 - dc.b 0,2,4,6,9,11,13,15,16,18,19,21,22,22,23,23 - dc.b 23,23,23,22,22,21,19,18,16,15,13,11,9,6,4,2 - dc.b 0,-2,-4,-6,-9,-11,-13,-15,-16,-18,-19,-21,-22,-22,-23,-23 - dc.b -23,-23,-23,-22,-22,-21,-19,-18,-16,-15,-13,-11,-9,-6,-4,-2 - dc.b 0,2,4,7,9,12,14,16,18,20,21,22,23,24,25,25 - dc.b 25,25,25,24,23,22,21,20,18,16,14,12,9,7,4,2 - dc.b 0,-2,-4,-7,-9,-12,-14,-16,-18,-20,-21,-22,-23,-24,-25,-25 - dc.b -25,-25,-25,-24,-23,-22,-21,-20,-18,-16,-14,-12,-9,-7,-4,-2 - dc.b 0,2,5,8,10,13,15,17,19,21,23,24,25,26,27,27 - dc.b 27,27,27,26,25,24,23,21,19,17,15,13,10,8,5,2 - dc.b 0,-2,-5,-8,-10,-13,-15,-17,-19,-21,-23,-24,-25,-26,-27,-27 - dc.b -27,-27,-27,-26,-25,-24,-23,-21,-19,-17,-15,-13,-10,-8,-5,-2 - dc.b 0,2,5,8,11,14,16,18,21,23,24,26,27,28,29,29 - dc.b 29,29,29,28,27,26,24,23,21,18,16,14,11,8,5,2 - dc.b 0,-2,-5,-8,-11,-14,-16,-18,-21,-23,-24,-26,-27,-28,-29,-29 - dc.b -29,-29,-29,-28,-27,-26,-24,-23,-21,-18,-16,-14,-11,-8,-5,-2 - - ifne ENABLE_SAWRECT -mt_VibratoSawTable: - dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - dc.b 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 - dc.b -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 - dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - dc.b 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1 - dc.b 2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3 - dc.b -3,-3,-3,-3,-3,-3,-3,-3,-2,-2,-2,-2,-2,-2,-2,-2 - dc.b -1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0 - dc.b 0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,2 - dc.b 3,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5 - dc.b -5,-5,-5,-5,-5,-5,-4,-4,-4,-4,-4,-3,-3,-3,-3,-3 - dc.b -2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,0,0,0,0,0 - dc.b 0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3 - dc.b 4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,7 - dc.b -7,-7,-7,-7,-6,-6,-6,-6,-5,-5,-5,-5,-4,-4,-4,-4 - dc.b -3,-3,-3,-3,-2,-2,-2,-2,-1,-1,-1,-1,0,0,0,0 - dc.b 0,0,0,0,1,1,1,2,2,2,3,3,3,4,4,4 - dc.b 5,5,5,5,6,6,6,7,7,7,8,8,8,9,9,9 - dc.b -9,-9,-9,-9,-8,-8,-8,-7,-7,-7,-6,-6,-6,-5,-5,-5 - dc.b -4,-4,-4,-4,-3,-3,-3,-2,-2,-2,-1,-1,-1,0,0,0 - dc.b 0,0,0,1,1,1,2,2,3,3,3,4,4,4,5,5 - dc.b 6,6,6,7,7,7,8,8,9,9,9,10,10,10,11,11 - dc.b -11,-11,-11,-10,-10,-10,-9,-9,-8,-8,-8,-7,-7,-7,-6,-6 - dc.b -5,-5,-5,-4,-4,-4,-3,-3,-2,-2,-2,-1,-1,-1,0,0 - dc.b 0,0,0,1,1,2,2,3,3,3,4,4,5,5,6,6 - dc.b 7,7,7,8,8,9,9,10,10,10,11,11,12,12,13,13 - dc.b -13,-13,-13,-12,-12,-11,-11,-10,-10,-10,-9,-9,-8,-8,-7,-7 - dc.b -6,-6,-6,-5,-5,-4,-4,-3,-3,-3,-2,-2,-1,-1,0,0 - dc.b 0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7 - dc.b 8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15 - dc.b -15,-15,-14,-14,-13,-13,-12,-12,-11,-11,-10,-10,-9,-9,-8,-8 - dc.b -7,-7,-6,-6,-5,-5,-4,-4,-3,-3,-2,-2,-1,-1,0,0 - dc.b 0,0,1,1,2,2,3,3,4,5,5,6,6,7,7,8 - dc.b 9,9,10,10,11,11,12,12,13,14,14,15,15,16,16,17 - dc.b -17,-17,-16,-16,-15,-15,-14,-13,-13,-12,-12,-11,-11,-10,-10,-9 - dc.b -8,-8,-7,-7,-6,-6,-5,-4,-4,-3,-3,-2,-2,-1,-1,0 - dc.b 0,0,1,1,2,3,3,4,5,5,6,6,7,8,8,9 - dc.b 10,10,11,11,12,13,13,14,15,15,16,16,17,18,18,19 - dc.b -19,-19,-18,-18,-17,-16,-16,-15,-14,-14,-13,-13,-12,-11,-11,-10 - dc.b -9,-9,-8,-8,-7,-6,-6,-5,-4,-4,-3,-3,-2,-1,-1,0 - dc.b 0,0,1,2,2,3,4,4,5,6,6,7,8,8,9,10 - dc.b 11,11,12,13,13,14,15,15,16,17,17,18,19,19,20,21 - dc.b -21,-21,-20,-19,-19,-18,-17,-17,-16,-15,-15,-14,-13,-12,-12,-11 - dc.b -10,-10,-9,-8,-8,-7,-6,-6,-5,-4,-4,-3,-2,-1,-1,0 - dc.b 0,0,1,2,3,3,4,5,6,6,7,8,9,9,10,11 - dc.b 12,12,13,14,15,15,16,17,18,18,19,20,21,21,22,23 - dc.b -23,-23,-22,-21,-20,-20,-19,-18,-17,-17,-16,-15,-14,-14,-13,-12 - dc.b -11,-11,-10,-9,-8,-8,-7,-6,-5,-5,-4,-3,-2,-2,-1,0 - dc.b 0,0,1,2,3,4,4,5,6,7,8,8,9,10,11,12 - dc.b 13,13,14,15,16,17,17,18,19,20,21,21,22,23,24,25 - dc.b -25,-25,-24,-23,-22,-21,-21,-20,-19,-18,-17,-16,-16,-15,-14,-13 - dc.b -12,-12,-11,-10,-9,-8,-8,-7,-6,-5,-4,-3,-3,-2,-1,0 - dc.b 0,0,1,2,3,4,5,6,7,7,8,9,10,11,12,13 - dc.b 14,14,15,16,17,18,19,20,21,21,22,23,24,25,26,27 - dc.b -27,-27,-26,-25,-24,-23,-22,-21,-20,-20,-19,-18,-17,-16,-15,-14 - dc.b -13,-13,-12,-11,-10,-9,-8,-7,-6,-6,-5,-4,-3,-2,-1,0 - dc.b 0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14 - dc.b 15,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29 - dc.b -29,-28,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17,-16,-15 - dc.b -14,-13,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0 - -mt_VibratoRectTable: - dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - dc.b 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 - dc.b 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 - dc.b -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 - dc.b -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 - dc.b 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 - dc.b 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 - dc.b -3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3 - dc.b -3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3 - dc.b 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5 - dc.b 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5 - dc.b -5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5 - dc.b -5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5 - dc.b 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7 - dc.b 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7 - dc.b -7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7 - dc.b -7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7 - dc.b 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9 - dc.b 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9 - dc.b -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9 - dc.b -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9 - dc.b 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11 - dc.b 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11 - dc.b -11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11 - dc.b -11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11 - dc.b 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13 - dc.b 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13 - dc.b -13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13 - dc.b -13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13 - dc.b 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15 - dc.b 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15 - dc.b -15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15 - dc.b -15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15 - dc.b 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17 - dc.b 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17 - dc.b -17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17 - dc.b -17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17 - dc.b 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19 - dc.b 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19 - dc.b -19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19 - dc.b -19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19 - dc.b 21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21 - dc.b 21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21 - dc.b -21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21 - dc.b -21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21 - dc.b 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23 - dc.b 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23 - dc.b -23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23 - dc.b -23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23 - dc.b 25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25 - dc.b 25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25 - dc.b -25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 - dc.b -25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 - dc.b 27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27 - dc.b 27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27 - dc.b -27,-27,-27,-27,-27,-27,-27,-27,-27,-27,-27,-27,-27,-27,-27,-27 - dc.b -27,-27,-27,-27,-27,-27,-27,-27,-27,-27,-27,-27,-27,-27,-27,-27 - dc.b 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29 - dc.b 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29 - dc.b -29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29 - dc.b -29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29 - endc ; ENABLE_SAWRECT - - -mt_PerFineTune: - dc.w mt_Tuning0-mt_PerFineTune,mt_Tuning1-mt_PerFineTune - dc.w mt_Tuning2-mt_PerFineTune,mt_Tuning3-mt_PerFineTune - dc.w mt_Tuning4-mt_PerFineTune,mt_Tuning5-mt_PerFineTune - dc.w mt_Tuning6-mt_PerFineTune,mt_Tuning7-mt_PerFineTune - dc.w mt_TuningM8-mt_PerFineTune,mt_TuningM7-mt_PerFineTune - dc.w mt_TuningM6-mt_PerFineTune,mt_TuningM5-mt_PerFineTune - dc.w mt_TuningM4-mt_PerFineTune,mt_TuningM3-mt_PerFineTune - dc.w mt_TuningM2-mt_PerFineTune,mt_TuningM1-mt_PerFineTune - -mt_PeriodTable: -mt_Tuning0: ; Tuning 0, Normal c-1 - b3 - dc.w 856,808,762,720,678,640,604,570,538,508,480,453 - dc.w 428,404,381,360,339,320,302,285,269,254,240,226 - dc.w 214,202,190,180,170,160,151,143,135,127,120,113 -mt_Tuning1: - dc.w 850,802,757,715,674,637,601,567,535,505,477,450 - dc.w 425,401,379,357,337,318,300,284,268,253,239,225 - dc.w 213,201,189,179,169,159,150,142,134,126,119,113 -mt_Tuning2: - dc.w 844,796,752,709,670,632,597,563,532,502,474,447 - dc.w 422,398,376,355,335,316,298,282,266,251,237,224 - dc.w 211,199,188,177,167,158,149,141,133,125,118,112 -mt_Tuning3: - dc.w 838,791,746,704,665,628,592,559,528,498,470,444 - dc.w 419,395,373,352,332,314,296,280,264,249,235,222 - dc.w 209,198,187,176,166,157,148,140,132,125,118,111 -mt_Tuning4: - dc.w 832,785,741,699,660,623,588,555,524,495,467,441 - dc.w 416,392,370,350,330,312,294,278,262,247,233,220 - dc.w 208,196,185,175,165,156,147,139,131,124,117,110 -mt_Tuning5: - dc.w 826,779,736,694,655,619,584,551,520,491,463,437 - dc.w 413,390,368,347,328,309,292,276,260,245,232,219 - dc.w 206,195,184,174,164,155,146,138,130,123,116,109 -mt_Tuning6: - dc.w 820,774,730,689,651,614,580,547,516,487,460,434 - dc.w 410,387,365,345,325,307,290,274,258,244,230,217 - dc.w 205,193,183,172,163,154,145,137,129,122,115,109 -mt_Tuning7: - dc.w 814,768,725,684,646,610,575,543,513,484,457,431 - dc.w 407,384,363,342,323,305,288,272,256,242,228,216 - dc.w 204,192,181,171,161,152,144,136,128,121,114,108 -mt_TuningM8: - dc.w 907,856,808,762,720,678,640,604,570,538,508,480 - dc.w 453,428,404,381,360,339,320,302,285,269,254,240 - dc.w 226,214,202,190,180,170,160,151,143,135,127,120 -mt_TuningM7: - dc.w 900,850,802,757,715,675,636,601,567,535,505,477 - dc.w 450,425,401,379,357,337,318,300,284,268,253,238 - dc.w 225,212,200,189,179,169,159,150,142,134,126,119 -mt_TuningM6: - dc.w 894,844,796,752,709,670,632,597,563,532,502,474 - dc.w 447,422,398,376,355,335,316,298,282,266,251,237 - dc.w 223,211,199,188,177,167,158,149,141,133,125,118 -mt_TuningM5: - dc.w 887,838,791,746,704,665,628,592,559,528,498,470 - dc.w 444,419,395,373,352,332,314,296,280,264,249,235 - dc.w 222,209,198,187,176,166,157,148,140,132,125,118 -mt_TuningM4: - dc.w 881,832,785,741,699,660,623,588,555,524,494,467 - dc.w 441,416,392,370,350,330,312,294,278,262,247,233 - dc.w 220,208,196,185,175,165,156,147,139,131,123,117 -mt_TuningM3: - dc.w 875,826,779,736,694,655,619,584,551,520,491,463 - dc.w 437,413,390,368,347,328,309,292,276,260,245,232 - dc.w 219,206,195,184,174,164,155,146,138,130,123,116 -mt_TuningM2: - dc.w 868,820,774,730,689,651,614,580,547,516,487,460 - dc.w 434,410,387,365,345,325,307,290,274,258,244,230 - dc.w 217,205,193,183,172,163,154,145,137,129,122,115 -mt_TuningM1: - dc.w 862,814,768,725,684,646,610,575,543,513,484,457 - dc.w 431,407,384,363,342,323,305,288,272,256,242,228 - dc.w 216,203,192,181,171,161,152,144,136,128,121,114 - - ifeq MINIMAL -MasterVolTab0: - dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - dc.b 0 -MasterVolTab1: - dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - dc.b 1 -MasterVolTab2: - dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - dc.b 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 - dc.b 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 - dc.b 2 -MasterVolTab3: - dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - dc.b 0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1 - dc.b 1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2 - dc.b 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 - dc.b 3 -MasterVolTab4: - dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - dc.b 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 - dc.b 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 - dc.b 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 - dc.b 4 -MasterVolTab5: - dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1 - dc.b 1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2 - dc.b 2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3 - dc.b 3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4 - dc.b 5 -MasterVolTab6: - dc.b 0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1 - dc.b 1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2 - dc.b 3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4 - dc.b 4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5 - dc.b 6 -MasterVolTab7: - dc.b 0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1 - dc.b 1,1,1,2,2,2,2,2,2,2,2,2,3,3,3,3 - dc.b 3,3,3,3,3,4,4,4,4,4,4,4,4,4,5,5 - dc.b 5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6 - dc.b 7 -MasterVolTab8: - dc.b 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1 - dc.b 2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3 - dc.b 4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5 - dc.b 6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7 - dc.b 8 -MasterVolTab9: - dc.b 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,2 - dc.b 2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4 - dc.b 4,4,4,4,5,5,5,5,5,5,5,6,6,6,6,6 - dc.b 6,6,7,7,7,7,7,7,7,8,8,8,8,8,8,8 - dc.b 9 -MasterVolTab10: - dc.b 0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2 - dc.b 2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4 - dc.b 5,5,5,5,5,5,5,6,6,6,6,6,6,7,7,7 - dc.b 7,7,7,7,8,8,8,8,8,8,9,9,9,9,9,9 - dc.b 10 -MasterVolTab11: - dc.b 0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2 - dc.b 2,2,3,3,3,3,3,3,4,4,4,4,4,4,5,5 - dc.b 5,5,5,6,6,6,6,6,6,7,7,7,7,7,7,8 - dc.b 8,8,8,8,8,9,9,9,9,9,9,10,10,10,10,10 - dc.b 11 -MasterVolTab12: - dc.b 0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,2 - dc.b 3,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5 - dc.b 6,6,6,6,6,6,7,7,7,7,7,8,8,8,8,8 - dc.b 9,9,9,9,9,9,10,10,10,10,10,11,11,11,11,11 - dc.b 12 -MasterVolTab13: - dc.b 0,0,0,0,0,1,1,1,1,1,2,2,2,2,2,3 - dc.b 3,3,3,3,4,4,4,4,4,5,5,5,5,5,6,6 - dc.b 6,6,6,7,7,7,7,7,8,8,8,8,8,9,9,9 - dc.b 9,9,10,10,10,10,10,11,11,11,11,11,12,12,12,12 - dc.b 13 -MasterVolTab14: - dc.b 0,0,0,0,0,1,1,1,1,1,2,2,2,2,3,3 - dc.b 3,3,3,4,4,4,4,5,5,5,5,5,6,6,6,6 - dc.b 7,7,7,7,7,8,8,8,8,8,9,9,9,9,10,10 - dc.b 10,10,10,11,11,11,11,12,12,12,12,12,13,13,13,13 - dc.b 14 -MasterVolTab15: - dc.b 0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3 - dc.b 3,3,4,4,4,4,5,5,5,5,6,6,6,6,7,7 - dc.b 7,7,7,8,8,8,8,9,9,9,9,10,10,10,10,11 - dc.b 11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,14 - dc.b 15 -MasterVolTab16: - dc.b 0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3 - dc.b 4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,7 - dc.b 8,8,8,8,9,9,9,9,10,10,10,10,11,11,11,11 - dc.b 12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15 - dc.b 16 -MasterVolTab17: - dc.b 0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3 - dc.b 4,4,4,5,5,5,5,6,6,6,6,7,7,7,7,8 - dc.b 8,8,9,9,9,9,10,10,10,10,11,11,11,11,12,12 - dc.b 12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16 - dc.b 17 -MasterVolTab18: - dc.b 0,0,0,0,1,1,1,1,2,2,2,3,3,3,3,4 - dc.b 4,4,5,5,5,5,6,6,6,7,7,7,7,8,8,8 - dc.b 9,9,9,9,10,10,10,10,11,11,11,12,12,12,12,13 - dc.b 13,13,14,14,14,14,15,15,15,16,16,16,16,17,17,17 - dc.b 18 -MasterVolTab19: - dc.b 0,0,0,0,1,1,1,2,2,2,2,3,3,3,4,4 - dc.b 4,5,5,5,5,6,6,6,7,7,7,8,8,8,8,9 - dc.b 9,9,10,10,10,10,11,11,11,12,12,12,13,13,13,13 - dc.b 14,14,14,15,15,15,16,16,16,16,17,17,17,18,18,18 - dc.b 19 -MasterVolTab20: - dc.b 0,0,0,0,1,1,1,2,2,2,3,3,3,4,4,4 - dc.b 5,5,5,5,6,6,6,7,7,7,8,8,8,9,9,9 - dc.b 10,10,10,10,11,11,11,12,12,12,13,13,13,14,14,14 - dc.b 15,15,15,15,16,16,16,17,17,17,18,18,18,19,19,19 - dc.b 20 -MasterVolTab21: - dc.b 0,0,0,0,1,1,1,2,2,2,3,3,3,4,4,4 - dc.b 5,5,5,6,6,6,7,7,7,8,8,8,9,9,9,10 - dc.b 10,10,11,11,11,12,12,12,13,13,13,14,14,14,15,15 - dc.b 15,16,16,16,17,17,17,18,18,18,19,19,19,20,20,20 - dc.b 21 -MasterVolTab22: - dc.b 0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,5 - dc.b 5,5,6,6,6,7,7,7,8,8,8,9,9,9,10,10 - dc.b 11,11,11,12,12,12,13,13,13,14,14,14,15,15,15,16 - dc.b 16,16,17,17,17,18,18,18,19,19,19,20,20,20,21,21 - dc.b 22 -MasterVolTab23: - dc.b 0,0,0,1,1,1,2,2,2,3,3,3,4,4,5,5 - dc.b 5,6,6,6,7,7,7,8,8,8,9,9,10,10,10,11 - dc.b 11,11,12,12,12,13,13,14,14,14,15,15,15,16,16,16 - dc.b 17,17,17,18,18,19,19,19,20,20,20,21,21,21,22,22 - dc.b 23 -MasterVolTab24: - dc.b 0,0,0,1,1,1,2,2,3,3,3,4,4,4,5,5 - dc.b 6,6,6,7,7,7,8,8,9,9,9,10,10,10,11,11 - dc.b 12,12,12,13,13,13,14,14,15,15,15,16,16,16,17,17 - dc.b 18,18,18,19,19,19,20,20,21,21,21,22,22,22,23,23 - dc.b 24 -MasterVolTab25: - dc.b 0,0,0,1,1,1,2,2,3,3,3,4,4,5,5,5 - dc.b 6,6,7,7,7,8,8,8,9,9,10,10,10,11,11,12 - dc.b 12,12,13,13,14,14,14,15,15,16,16,16,17,17,17,18 - dc.b 18,19,19,19,20,20,21,21,21,22,22,23,23,23,24,24 - dc.b 25 -MasterVolTab26: - dc.b 0,0,0,1,1,2,2,2,3,3,4,4,4,5,5,6 - dc.b 6,6,7,7,8,8,8,9,9,10,10,10,11,11,12,12 - dc.b 13,13,13,14,14,15,15,15,16,16,17,17,17,18,18,19 - dc.b 19,19,20,20,21,21,21,22,22,23,23,23,24,24,25,25 - dc.b 26 -MasterVolTab27: - dc.b 0,0,0,1,1,2,2,2,3,3,4,4,5,5,5,6 - dc.b 6,7,7,8,8,8,9,9,10,10,10,11,11,12,12,13 - dc.b 13,13,14,14,15,15,16,16,16,17,17,18,18,18,19,19 - dc.b 20,20,21,21,21,22,22,23,23,24,24,24,25,25,26,26 - dc.b 27 -MasterVolTab28: - dc.b 0,0,0,1,1,2,2,3,3,3,4,4,5,5,6,6 - dc.b 7,7,7,8,8,9,9,10,10,10,11,11,12,12,13,13 - dc.b 14,14,14,15,15,16,16,17,17,17,18,18,19,19,20,20 - dc.b 21,21,21,22,22,23,23,24,24,24,25,25,26,26,27,27 - dc.b 28 -MasterVolTab29: - dc.b 0,0,0,1,1,2,2,3,3,4,4,4,5,5,6,6 - dc.b 7,7,8,8,9,9,9,10,10,11,11,12,12,13,13,14 - dc.b 14,14,15,15,16,16,17,17,18,18,19,19,19,20,20,21 - dc.b 21,22,22,23,23,24,24,24,25,25,26,26,27,27,28,28 - dc.b 29 -MasterVolTab30: - dc.b 0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7 - dc.b 7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14 - dc.b 15,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22 - dc.b 22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29 - dc.b 30 -MasterVolTab31: - dc.b 0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7 - dc.b 7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15 - dc.b 15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,22 - dc.b 23,23,24,24,25,25,26,26,27,27,28,28,29,29,30,30 - dc.b 31 -MasterVolTab32: - dc.b 0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7 - dc.b 8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15 - dc.b 16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23 - dc.b 24,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31 - dc.b 32 -MasterVolTab33: - dc.b 0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7 - dc.b 8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15 - dc.b 16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24 - dc.b 24,25,25,26,26,27,27,28,28,29,29,30,30,31,31,32 - dc.b 33 -MasterVolTab34: - dc.b 0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7 - dc.b 8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16 - dc.b 17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24 - dc.b 25,26,26,27,27,28,28,29,29,30,30,31,31,32,32,33 - dc.b 34 -MasterVolTab35: - dc.b 0,0,1,1,2,2,3,3,4,4,5,6,6,7,7,8 - dc.b 8,9,9,10,10,11,12,12,13,13,14,14,15,15,16,16 - dc.b 17,18,18,19,19,20,20,21,21,22,22,23,24,24,25,25 - dc.b 26,26,27,27,28,28,29,30,30,31,31,32,32,33,33,34 - dc.b 35 -MasterVolTab36: - dc.b 0,0,1,1,2,2,3,3,4,5,5,6,6,7,7,8 - dc.b 9,9,10,10,11,11,12,12,13,14,14,15,15,16,16,17 - dc.b 18,18,19,19,20,20,21,21,22,23,23,24,24,25,25,26 - dc.b 27,27,28,28,29,29,30,30,31,32,32,33,33,34,34,35 - dc.b 36 -MasterVolTab37: - dc.b 0,0,1,1,2,2,3,4,4,5,5,6,6,7,8,8 - dc.b 9,9,10,10,11,12,12,13,13,14,15,15,16,16,17,17 - dc.b 18,19,19,20,20,21,21,22,23,23,24,24,25,26,26,27 - dc.b 27,28,28,29,30,30,31,31,32,32,33,34,34,35,35,36 - dc.b 37 -MasterVolTab38: - dc.b 0,0,1,1,2,2,3,4,4,5,5,6,7,7,8,8 - dc.b 9,10,10,11,11,12,13,13,14,14,15,16,16,17,17,18 - dc.b 19,19,20,20,21,21,22,23,23,24,24,25,26,26,27,27 - dc.b 28,29,29,30,30,31,32,32,33,33,34,35,35,36,36,37 - dc.b 38 -MasterVolTab39: - dc.b 0,0,1,1,2,3,3,4,4,5,6,6,7,7,8,9 - dc.b 9,10,10,11,12,12,13,14,14,15,15,16,17,17,18,18 - dc.b 19,20,20,21,21,22,23,23,24,24,25,26,26,27,28,28 - dc.b 29,29,30,31,31,32,32,33,34,34,35,35,36,37,37,38 - dc.b 39 -MasterVolTab40: - dc.b 0,0,1,1,2,3,3,4,5,5,6,6,7,8,8,9 - dc.b 10,10,11,11,12,13,13,14,15,15,16,16,17,18,18,19 - dc.b 20,20,21,21,22,23,23,24,25,25,26,26,27,28,28,29 - dc.b 30,30,31,31,32,33,33,34,35,35,36,36,37,38,38,39 - dc.b 40 -MasterVolTab41: - dc.b 0,0,1,1,2,3,3,4,5,5,6,7,7,8,8,9 - dc.b 10,10,11,12,12,13,14,14,15,16,16,17,17,18,19,19 - dc.b 20,21,21,22,23,23,24,24,25,26,26,27,28,28,29,30 - dc.b 30,31,32,32,33,33,34,35,35,36,37,37,38,39,39,40 - dc.b 41 -MasterVolTab42: - dc.b 0,0,1,1,2,3,3,4,5,5,6,7,7,8,9,9 - dc.b 10,11,11,12,13,13,14,15,15,16,17,17,18,19,19,20 - dc.b 21,21,22,22,23,24,24,25,26,26,27,28,28,29,30,30 - dc.b 31,32,32,33,34,34,35,36,36,37,38,38,39,40,40,41 - dc.b 42 -MasterVolTab43: - dc.b 0,0,1,2,2,3,4,4,5,6,6,7,8,8,9,10 - dc.b 10,11,12,12,13,14,14,15,16,16,17,18,18,19,20,20 - dc.b 21,22,22,23,24,24,25,26,26,27,28,28,29,30,30,31 - dc.b 32,32,33,34,34,35,36,36,37,38,38,39,40,40,41,42 - dc.b 43 -MasterVolTab44: - dc.b 0,0,1,2,2,3,4,4,5,6,6,7,8,8,9,10 - dc.b 11,11,12,13,13,14,15,15,16,17,17,18,19,19,20,21 - dc.b 22,22,23,24,24,25,26,26,27,28,28,29,30,30,31,32 - dc.b 33,33,34,35,35,36,37,37,38,39,39,40,41,41,42,43 - dc.b 44 -MasterVolTab45: - dc.b 0,0,1,2,2,3,4,4,5,6,7,7,8,9,9,10 - dc.b 11,11,12,13,14,14,15,16,16,17,18,18,19,20,21,21 - dc.b 22,23,23,24,25,26,26,27,28,28,29,30,30,31,32,33 - dc.b 33,34,35,35,36,37,37,38,39,40,40,41,42,42,43,44 - dc.b 45 -MasterVolTab46: - dc.b 0,0,1,2,2,3,4,5,5,6,7,7,8,9,10,10 - dc.b 11,12,12,13,14,15,15,16,17,17,18,19,20,20,21,22 - dc.b 23,23,24,25,25,26,27,28,28,29,30,30,31,32,33,33 - dc.b 34,35,35,36,37,38,38,39,40,40,41,42,43,43,44,45 - dc.b 46 -MasterVolTab47: - dc.b 0,0,1,2,2,3,4,5,5,6,7,8,8,9,10,11 - dc.b 11,12,13,13,14,15,16,16,17,18,19,19,20,21,22,22 - dc.b 23,24,24,25,26,27,27,28,29,30,30,31,32,33,33,34 - dc.b 35,35,36,37,38,38,39,40,41,41,42,43,44,44,45,46 - dc.b 47 -MasterVolTab48: - dc.b 0,0,1,2,3,3,4,5,6,6,7,8,9,9,10,11 - dc.b 12,12,13,14,15,15,16,17,18,18,19,20,21,21,22,23 - dc.b 24,24,25,26,27,27,28,29,30,30,31,32,33,33,34,35 - dc.b 36,36,37,38,39,39,40,41,42,42,43,44,45,45,46,47 - dc.b 48 -MasterVolTab49: - dc.b 0,0,1,2,3,3,4,5,6,6,7,8,9,9,10,11 - dc.b 12,13,13,14,15,16,16,17,18,19,19,20,21,22,22,23 - dc.b 24,25,26,26,27,28,29,29,30,31,32,32,33,34,35,35 - dc.b 36,37,38,39,39,40,41,42,42,43,44,45,45,46,47,48 - dc.b 49 -MasterVolTab50: - dc.b 0,0,1,2,3,3,4,5,6,7,7,8,9,10,10,11 - dc.b 12,13,14,14,15,16,17,17,18,19,20,21,21,22,23,24 - dc.b 25,25,26,27,28,28,29,30,31,32,32,33,34,35,35,36 - dc.b 37,38,39,39,40,41,42,42,43,44,45,46,46,47,48,49 - dc.b 50 -MasterVolTab51: - dc.b 0,0,1,2,3,3,4,5,6,7,7,8,9,10,11,11 - dc.b 12,13,14,15,15,16,17,18,19,19,20,21,22,23,23,24 - dc.b 25,26,27,27,28,29,30,31,31,32,33,34,35,35,36,37 - dc.b 38,39,39,40,41,42,43,43,44,45,46,47,47,48,49,50 - dc.b 51 -MasterVolTab52: - dc.b 0,0,1,2,3,4,4,5,6,7,8,8,9,10,11,12 - dc.b 13,13,14,15,16,17,17,18,19,20,21,21,22,23,24,25 - dc.b 26,26,27,28,29,30,30,31,32,33,34,34,35,36,37,38 - dc.b 39,39,40,41,42,43,43,44,45,46,47,47,48,49,50,51 - dc.b 52 -MasterVolTab53: - dc.b 0,0,1,2,3,4,4,5,6,7,8,9,9,10,11,12 - dc.b 13,14,14,15,16,17,18,19,19,20,21,22,23,24,24,25 - dc.b 26,27,28,28,29,30,31,32,33,33,34,35,36,37,38,38 - dc.b 39,40,41,42,43,43,44,45,46,47,48,48,49,50,51,52 - dc.b 53 -MasterVolTab54: - dc.b 0,0,1,2,3,4,5,5,6,7,8,9,10,10,11,12 - dc.b 13,14,15,16,16,17,18,19,20,21,21,22,23,24,25,26 - dc.b 27,27,28,29,30,31,32,32,33,34,35,36,37,37,38,39 - dc.b 40,41,42,43,43,44,45,46,47,48,48,49,50,51,52,53 - dc.b 54 -MasterVolTab55: - dc.b 0,0,1,2,3,4,5,6,6,7,8,9,10,11,12,12 - dc.b 13,14,15,16,17,18,18,19,20,21,22,23,24,24,25,26 - dc.b 27,28,29,30,30,31,32,33,34,35,36,36,37,38,39,40 - dc.b 41,42,42,43,44,45,46,47,48,48,49,50,51,52,53,54 - dc.b 55 -MasterVolTab56: - dc.b 0,0,1,2,3,4,5,6,7,7,8,9,10,11,12,13 - dc.b 14,14,15,16,17,18,19,20,21,21,22,23,24,25,26,27 - dc.b 28,28,29,30,31,32,33,34,35,35,36,37,38,39,40,41 - dc.b 42,42,43,44,45,46,47,48,49,49,50,51,52,53,54,55 - dc.b 56 -MasterVolTab57: - dc.b 0,0,1,2,3,4,5,6,7,8,8,9,10,11,12,13 - dc.b 14,15,16,16,17,18,19,20,21,22,23,24,24,25,26,27 - dc.b 28,29,30,31,32,32,33,34,35,36,37,38,39,40,40,41 - dc.b 42,43,44,45,46,47,48,48,49,50,51,52,53,54,55,56 - dc.b 57 -MasterVolTab58: - dc.b 0,0,1,2,3,4,5,6,7,8,9,9,10,11,12,13 - dc.b 14,15,16,17,18,19,19,20,21,22,23,24,25,26,27,28 - dc.b 29,29,30,31,32,33,34,35,36,37,38,38,39,40,41,42 - dc.b 43,44,45,46,47,48,48,49,50,51,52,53,54,55,56,57 - dc.b 58 -MasterVolTab59: - dc.b 0,0,1,2,3,4,5,6,7,8,9,10,11,11,12,13 - dc.b 14,15,16,17,18,19,20,21,22,23,23,24,25,26,27,28 - dc.b 29,30,31,32,33,34,35,35,36,37,38,39,40,41,42,43 - dc.b 44,45,46,47,47,48,49,50,51,52,53,54,55,56,57,58 - dc.b 59 -MasterVolTab60: - dc.b 0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14 - dc.b 15,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29 - dc.b 30,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44 - dc.b 45,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59 - dc.b 60 -MasterVolTab61: - dc.b 0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14 - dc.b 15,16,17,18,19,20,20,21,22,23,24,25,26,27,28,29 - dc.b 30,31,32,33,34,35,36,37,38,39,40,40,41,42,43,44 - dc.b 45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60 - dc.b 61 -MasterVolTab62: - dc.b 0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14 - dc.b 15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 - dc.b 31,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45 - dc.b 46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61 - dc.b 62 -MasterVolTab63: - dc.b 0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14 - dc.b 15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 - dc.b 31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46 - dc.b 47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62 - dc.b 63 -MasterVolTab64: - dc.b 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 - dc.b 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 - dc.b 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47 - dc.b 48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63 - dc.b 64 - even - endc ; !MINIMAL - - - ifd SDATA - - section __MERGED,bss - -mt_chan1: - ds.b n_sizeof -mt_chan2: - ds.b n_sizeof -mt_chan3: - ds.b n_sizeof -mt_chan4: - ds.b n_sizeof - -mt_SampleStarts: - ds.l 31 - -mt_mod: - ds.l 1 -mt_oldLev6: - ds.l 1 -mt_timerval: - ds.l 1 -mt_oldtimers: - ds.b 4 -mt_Lev6Int: - ds.l 1 -mt_Lev6Ena: - ds.w 1 -mt_PatternPos: - ds.w 1 -mt_PBreakPos: - ds.w 1 -mt_PosJumpFlag: - ds.b 1 -mt_PBreakFlag: - ds.b 1 -mt_Speed: - ds.b 1 -mt_Counter: - ds.b 1 -mt_SongPos: - ds.b 1 -mt_PattDelTime: - ds.b 1 -mt_PattDelTime2: - ds.b 1 - - ifeq MINIMAL -mt_SilCntValid: - ds.b 1 -mt_MasterVolTab: - ds.l 1 - endc - - xdef _mt_Enable -_mt_Enable: -mt_Enable: - ds.b 1 - - xdef _mt_E8Trigger -_mt_E8Trigger: -mt_E8Trigger: - ds.b 1 - - ifeq MINIMAL - xdef _mt_MusicChannels -_mt_MusicChannels: -mt_MusicChannels: - ds.b 1 - - xdef _mt_SongEnd -_mt_SongEnd: -mt_SongEnd: - ds.b 1 - endc ; !MINIMAL - - else ; !SDATA : single section with local base register - - rsreset -mt_chan1 rs.b n_sizeof -mt_chan2 rs.b n_sizeof -mt_chan3 rs.b n_sizeof -mt_chan4 rs.b n_sizeof -mt_SampleStarts rs.l 31 -mt_mod rs.l 1 -mt_oldLev6 rs.l 1 -mt_timerval rs.l 1 -mt_oldtimers rs.b 4 -mt_Lev6Int rs.l 1 -mt_Lev6Ena rs.w 1 -mt_PatternPos rs.w 1 -mt_PBreakPos rs.w 1 -mt_PosJumpFlag rs.b 1 -mt_PBreakFlag rs.b 1 -mt_Speed rs.b 1 -mt_Counter rs.b 1 -mt_SongPos rs.b 1 -mt_PattDelTime rs.b 1 -mt_PattDelTime2 rs.b 1 - ifeq MINIMAL -mt_SilCntValid rs.b 1 -mt_MasterVolTab rs.l 1 - endc -mt_Enable rs.b 1 ; exported as _mt_Enable -mt_E8Trigger rs.b 1 ; exported as _mt_E8Trigger -mt_MusicChannels rs.b 1 ; exported as _mt_MusicChannels -mt_SongEnd rs.b 1 ; exported as _mt_SongEnd - -mt_data: - ds.b mt_Enable - xdef _mt_Enable -_mt_Enable: - ds.b 1 - xdef _mt_E8Trigger -_mt_E8Trigger: - ds.b 1 - ifeq MINIMAL - xdef _mt_MusicChannels -_mt_MusicChannels: - ds.b 1 - xdef _mt_SongEnd -_mt_SongEnd: - ds.b 1 - endc ; !MINIMAL - - endc ; SDATA/!SDATA - -; --- note-trigger detection state (used by the notestrike accessor) --- - even -vu_prevstarts: - ds.l 4 - - }} - + %option ignore_unused } diff --git a/compiler/res/prog8lib/amiga500/sorting.p8 b/compiler/res/prog8lib/amiga500/sorting.p8 index 29aba2b3a..1db455fbb 100644 --- a/compiler/res/prog8lib/amiga500/sorting.p8 +++ b/compiler/res/prog8lib/amiga500/sorting.p8 @@ -1 +1 @@ -; TODO +%import shared_amiga_sorting diff --git a/compiler/res/prog8lib/amiga500/textio.p8 b/compiler/res/prog8lib/amiga500/textio.p8 index 42c4a7295..217bb71d1 100644 --- a/compiler/res/prog8lib/amiga500/textio.p8 +++ b/compiler/res/prog8lib/amiga500/textio.p8 @@ -4,6 +4,7 @@ %option ignore_unused txt { + %option ignore_unused asmsub chrout(ubyte char @D0) clobbers(D0,D1,D2,D3,A0,A6) { %asm {{ move.l sys.DOSBase,a6 diff --git a/compiler/res/prog8lib/amiga500/utility.p8 b/compiler/res/prog8lib/amiga500/utility.p8 index 9eda6d406..fcb2b97de 100644 --- a/compiler/res/prog8lib/amiga500/utility.p8 +++ b/compiler/res/prog8lib/amiga500/utility.p8 @@ -1,109 +1,5 @@ -;; Auto-generated from utility_lib.sfd and utility_lib.i -;; Library base: _UtilityBase in prog8: sys.UtilityBase -;; Bank: 9 -;; Functions: 43 - -%import exec +%import shared_amiga_utility utility { - %option no_symbol_prefixing - extsub @bank 9 -30 = FindTagItem(long tagVal @D0, pointer tagList @A0) -> ^^TagItem @D0 - extsub @bank 9 -36 = GetTagData(long tagValue @D0, long defaultVal @D1, pointer tagList @A0) -> long @D0 - extsub @bank 9 -42 = PackBoolTags(long initialFlags @D0, pointer tagList @A0, pointer boolMap @A1) -> long @D0 - extsub @bank 9 -48 = NextTagItem(pointer tagListPtr @A0) -> ^^TagItem @D0 - extsub @bank 9 -54 = FilterTagChanges(pointer changeList @A0, pointer originalList @A1, long apply @D0) - extsub @bank 9 -60 = MapTags(pointer tagList @A0, pointer mapList @A1, long mapType @D0) - extsub @bank 9 -66 = AllocateTagItems(long numTags @D0) -> ^^TagItem @D0 - extsub @bank 9 -72 = CloneTagItems(pointer tagList @A0) -> ^^TagItem @D0 - extsub @bank 9 -78 = FreeTagItems(pointer tagList @A0) - extsub @bank 9 -84 = RefreshTagItemClones(pointer clone @A0, pointer original @A1) - extsub @bank 9 -90 = TagInArray(long tagValue @D0, pointer tagArray @A0) -> bool @D0 - extsub @bank 9 -96 = FilterTagItems(pointer tagList @A0, pointer filterArray @A1, long logic @D0) -> long @D0 - extsub @bank 9 -102 = CallHookPkt(^^Hook hook @A0, pointer object @A2, pointer paramPacket @A1) -> long @D0 - extsub @bank 9 -120 = Amiga2Date(long seconds @D0, ^^ClockData result @A0) - extsub @bank 9 -126 = Date2Amiga(^^ClockData date @A0) -> long @D0 - extsub @bank 9 -132 = CheckDate(^^ClockData date @A0) -> long @D0 - extsub @bank 9 -138 = SMult32(long arg1 @D0, long arg2 @D1) -> long @D0 - extsub @bank 9 -144 = UMult32(long arg1 @D0, long arg2 @D1) -> long @D0 - extsub @bank 9 -150 = SDivMod32(long dividend @D0, long divisor @D1) -> long @D0 - extsub @bank 9 -156 = UDivMod32(long dividend @D0, long divisor @D1) -> long @D0 - extsub @bank 9 -162 = Stricmp(str string1 @A0, str string2 @A1) -> long @D0 - extsub @bank 9 -168 = Strnicmp(str string1 @A0, str string2 @A1, long length @D0) -> long @D0 - extsub @bank 9 -174 = ToUpper(ubyte character @D0) -> ubyte @D0 - extsub @bank 9 -180 = ToLower(ubyte character @D0) -> ubyte @D0 - extsub @bank 9 -186 = ApplyTagChanges(pointer list @A0, pointer changeList @A1) - extsub @bank 9 -198 = SMult64(long arg1 @D0, long arg2 @D1) -> long @D0 - extsub @bank 9 -204 = UMult64(long arg1 @D0, long arg2 @D1) -> long @D0 - extsub @bank 9 -210 = PackStructureTags(pointer pack @A0, pointer packTable @A1, pointer tagList @A2) -> long @D0 - extsub @bank 9 -216 = UnpackStructureTags(pointer pack @A0, pointer packTable @A1, pointer tagList @A2) -> long @D0 - extsub @bank 9 -222 = AddNamedObject(pointer nameSpace @A0, pointer object @A1) -> bool @D0 - extsub @bank 9 -228 = AllocNamedObjectA(str name @A0, pointer tagList @A1) -> pointer @D0 - extsub @bank 9 -234 = AttemptRemNamedObject(pointer object @A0) -> long @D0 - extsub @bank 9 -240 = FindNamedObject(pointer nameSpace @A0, str name @A1, pointer lastObject @A2) -> pointer @D0 - extsub @bank 9 -246 = FreeNamedObject(pointer object @A0) - extsub @bank 9 -252 = NamedObjectName(pointer object @A0) -> str @D0 - extsub @bank 9 -258 = ReleaseNamedObject(pointer object @A0) - extsub @bank 9 -264 = RemNamedObject(pointer object @A0, ^^exec.Message message @A1) - extsub @bank 9 -270 = GetUniqueID() -> long @D0 - extsub @bank 9 -312 = VSNPrintf(str buffer @A0, long bufsize @D0, str fmt @A1, pointer data @A2) -> long @D0 - extsub @bank 9 -438 = Strncpy(str dst @A1, str src @A0, long size @D0) -> str @D0 - extsub @bank 9 -444 = Strncat(str dst @A1, str src @A0, long size @D0) -> str @D0 - extsub @bank 9 -450 = SDivMod64(long hi @D1, long lo @D0, long divisor @D2) -> long @D0 - extsub @bank 9 -456 = UDivMod64(long hi @D1, long lo @D0, long divisor @D2) -> long @D0 - - ; ---- struct definitions ---- - - struct ClockData { ; total size: 14 - uword Sec ; 0 - uword Min ; 2 - uword Hour ; 4 - uword Mday ; 6 - uword Month ; 8 - uword Year ; 10 - uword Wday ; 12 - } - - struct Hook { ; total size: 20 - ^^exec.MinNode Succ ; 0 - ^^exec.MinNode Pred ; 4 - pointer Entry ; 8 - pointer SubEntry ; 12 - pointer Data ; 16 - } - - struct TagItem { ; total size: 8 - long Tag ; 0 - long Data ; 4 - } - - ; ---- constants ---- - const ubyte UTILITY_NAME_I = $0001 - const uword ANO_NameSpace = $0fa0 - const uword ANO_UserSpace = $0fa1 - const uword ANO_Priority = $0fa2 - const uword ANO_Flags = $0fa3 - const ubyte NSB_NODUPS = 0 - const ubyte NSF_NODUPS = $0001 - const ubyte NSB_CASE = 1 - const ubyte NSF_CASE = $0002 - const ubyte UTILITY_PACK_I = $0001 - const ubyte PSTB_SIGNED = 31 - const long PSTF_SIGNED = $80000000 - const ubyte PSTB_UNPACK = 30 - const long PSTF_UNPACK = $40000000 - const ubyte PSTB_PACK = 29 - const long PSTF_PACK = $20000000 - const ubyte PSTB_EXISTS = 26 - const long PSTF_EXISTS = $04000000 - const ubyte TAG_DONE = $0000 - const ubyte TAG_END = $0000 - const ubyte TAG_IGNORE = $0001 - const ubyte TAG_MORE = $0002 - const ubyte TAG_SKIP = $0003 - const long TAG_USER = $80000000 - const ubyte TAGFILTER_AND = $0000 - const ubyte TAGFILTER_NOT = $0001 - const ubyte MAP_REMOVE_NOT_FOUND = $0000 - const ubyte MAP_KEEP_NOT_FOUND = $0001 + %option no_symbol_prefixing, ignore_unused } -;; End of auto-generated utility_lib.sfd diff --git a/compiler/res/prog8lib/shared_amiga_arexx.p8 b/compiler/res/prog8lib/shared_amiga_arexx.p8 new file mode 100644 index 000000000..21c04cac4 --- /dev/null +++ b/compiler/res/prog8lib/shared_amiga_arexx.p8 @@ -0,0 +1,223 @@ +;; Auto-generated from arexx_lib.sfd and arexx_lib.i +;; Library base: _RexxSysBase in prog8: sys.RexxSysBase +;; Bank: 29 +;; Functions: 17 + +%import exec + +arexx { + %option merge, no_symbol_prefixing + + sub openlib() -> bool { + sys.RexxSysBase = exec.OpenLibrary("rexxsyslib.library", 0) + return sys.RexxSysBase!=0 + } + + sub closelib() { + if sys.RexxSysBase!=0 { + exec.CloseLibrary(sys.RexxSysBase) + sys.RexxSysBase = 0 + } + } + + extsub @bank 29 -126 = CreateArgstring(str string @A0, long length @D0) -> pointer @D0 + extsub @bank 29 -132 = DeleteArgstring(pointer argstring @A0) + extsub @bank 29 -138 = LengthArgstring(pointer argstring @A0) -> long @D0 + extsub @bank 29 -144 = CreateRexxMsg(^^exec.MsgPort port @A0, str extension @A1, str host @D0) -> ^^RexxMsg @D0 + extsub @bank 29 -150 = DeleteRexxMsg(^^RexxMsg packet @A0) + extsub @bank 29 -156 = ClearRexxMsg(^^RexxMsg msgptr @A0, long count @D0) + extsub @bank 29 -162 = FillRexxMsg(^^RexxMsg msgptr @A0, long count @D0, long mask @D1) -> bool @D0 + extsub @bank 29 -168 = IsRexxMsg(^^RexxMsg msgptr @A0) -> bool @D0 + extsub @bank 29 -450 = LockRexxBase(long resource @D0) + extsub @bank 29 -456 = UnlockRexxBase(long resource @D0) + extsub @bank 29 -480 = CreateRexxHostPort(str basename @A0) -> ^^exec.MsgPort @D0 + extsub @bank 29 -486 = DeleteRexxHostPort(^^exec.MsgPort port @A0) + extsub @bank 29 -492 = GetRexxVarFromMsg(str var @A0, ^^RexxMsg msgptr @A2, str value @A1) -> long @D0 + extsub @bank 29 -498 = SetRexxVarFromMsg(str var @A0, ^^RexxMsg msgptr @A2, str value @A1) -> long @D0 + extsub @bank 29 -504 = LaunchRexxScript(str script @A0, ^^exec.MsgPort replyport @A1, str extension @A2, pointer input @D1, pointer output @D2) -> ^^RexxMsg @D0 + extsub @bank 29 -510 = FreeRexxMsg(^^RexxMsg msgptr @A0) + extsub @bank 29 -516 = GetRexxBufferFromMsg(str var @A0, ^^RexxMsg msgptr @A2, str buffer @A1, long buffer_size @D0) -> long @D0 + + ; ---- struct definitions ---- + + struct RexxMsg { ; total size: 128 + ^^exec.Node Succ ; 0 + ^^exec.Node Pred ; 4 + ubyte Type ; 8 + byte Pri ; 9 + str Name ; 10 + ^^exec.MsgPort ReplyPort ; 14 + uword Length ; 18 + pointer TaskBlock ; 20 + pointer LibBase ; 24 + long Action ; 28 + long Result1 ; 32 + long Result2 ; 36 + str[16] Args ; 40 + ^^exec.MsgPort PassPort ; 104 + str CommAddr ; 108 + str FileExt ; 112 + long Stdin ; 116 + long Stdout ; 120 + long Avail ; 124 + } + + ; ---- constants ---- + const ubyte ERRC_MSG = $0000 + const long RC_FAIL = -1 + const ubyte RC_OK = $0000 + const ubyte RC_WARN = $0005 + const ubyte RC_ERROR = $000a + const ubyte RC_FATAL = $0014 + const ubyte RXBUFFSZ = $00cc + const long RXIO_EXIST = -1 + const ubyte RXIO_STRF = $0000 + const ubyte RXIO_READ = $0001 + const ubyte RXIO_WRITE = $0002 + const ubyte RXIO_APPEND = $0003 + const long RXIO_BEGIN = -1 + const ubyte RXIO_CURR = $0000 + const ubyte RXIO_END = $0001 + const ubyte DT_DEV = $0000 + const ubyte DT_DIR = $0001 + const ubyte DT_VOL = $0002 + const uword ACTION_STACK = $07d2 + const uword ACTION_QUEUE = $07d3 + const ubyte RLFB_STOP = $0006 + const ubyte RLFB_CLOSE = $0007 + const ubyte RLFMASK = $0001 + const uword RXSCHUNK = $0400 + const ubyte RXSNEST = $0020 + const ubyte RXSTPRI = $0000 + const uword RXSSTACK = $1000 + const ubyte CTB_SPACE = $0000 + const ubyte CTB_DIGIT = $0001 + const ubyte CTB_ALPHA = $0002 + const ubyte CTB_REXXSYM = $0003 + const ubyte CTB_REXXOPR = $0004 + const ubyte CTB_REXXSPC = $0005 + const ubyte CTB_UPPER = $0006 + const ubyte CTB_LOWER = $0007 + const ubyte CTF_SPACE = $0001 + const ubyte CTF_DIGIT = $0001 + const ubyte CTF_ALPHA = $0001 + const ubyte CTF_REXXSYM = $0001 + const ubyte CTF_REXXOPR = $0001 + const ubyte CTF_REXXSPC = $0001 + const ubyte CTF_UPPER = $0001 + const ubyte CTF_LOWER = $0001 + const ubyte NSB_KEEP = $0000 + const ubyte NSB_STRING = $0001 + const ubyte NSB_NOTNUM = $0002 + const ubyte NSB_NUMBER = $0003 + const ubyte NSB_BINARY = $0004 + const ubyte NSB_FLOAT = $0005 + const ubyte NSB_EXT = $0006 + const ubyte NSB_SOURCE = $0007 + const ubyte NSF_KEEP = $0001 + const ubyte NSF_STRING = $0001 + const ubyte NSF_NOTNUM = $0001 + const ubyte NSF_NUMBER = $0001 + const ubyte NSF_BINARY = $0001 + const ubyte NSF_FLOAT = $0001 + const ubyte NSF_EXT = $0001 + const ubyte NSF_SOURCE = $0001 + const ubyte MAXRMARG = $000f + const long RXCOMM = $01000000 + const long RXFUNC = $02000000 + const long RXCLOSE = $03000000 + const long RXQUERY = $04000000 + const long RXADDFH = $07000000 + const long RXADDLIB = $08000000 + const long RXREMLIB = $09000000 + const long RXADDCON = $0A000000 + const long RXREMCON = $0B000000 + const long RXTCOPN = $0C000000 + const long RXTCCLS = $0D000000 + const ubyte RXFB_NOIO = $0010 + const ubyte RXFB_RESULT = $0011 + const ubyte RXFB_STRING = $0012 + const ubyte RXFB_TOKEN = $0013 + const ubyte RXFB_NONRET = $0014 + const ubyte RXFB_SCRIPT = $0015 + const ubyte RXFF_RESULT = $0001 + const ubyte RXFF_STRING = $0001 + const ubyte RXFF_TOKEN = $0001 + const ubyte RXFF_NONRET = $0001 + const ubyte RXFF_SCRIPT = $0001 + const long RXCODEMASK = $FF000000 + const long RXARGMASK = $0000000F + const ubyte RRT_ANY = $0000 + const ubyte RRT_LIB = $0001 + const ubyte RRT_PORT = $0002 + const ubyte RRT_FILE = $0003 + const ubyte RRT_HOST = $0004 + const ubyte RRT_CLIP = $0005 + const ubyte GLOBALSZ = $00c8 + const ubyte NUMLISTS = $0005 + const ubyte RTFB_TRACE = $0000 + const ubyte RTFB_HALT = $0001 + const ubyte RTFB_SUSP = $0002 + const ubyte RTFB_TCUSE = $0003 + const ubyte RTFB_WAIT = $0006 + const ubyte RTFB_CLOSE = $0007 + const ubyte MEMQUANT = $0010 + const long MEMMASK = $FFFFFFF0 + const ubyte MEMQUICK = $0001 + const long MEMCLEAR = $00010000 + const ubyte ERR10_001 = $0001 + const ubyte ERR10_002 = $0002 + const ubyte ERR10_003 = $0003 + const ubyte ERR10_005 = $0005 + const ubyte ERR10_006 = $0006 + const ubyte ERR10_008 = $0008 + const ubyte ERR10_009 = $0009 + const ubyte ERR10_010 = $000a + const ubyte ERR10_011 = $000b + const ubyte ERR10_012 = $000c + const ubyte ERR10_013 = $000d + const ubyte ERR10_014 = $000e + const ubyte ERR10_015 = $000f + const ubyte ERR10_016 = $0010 + const ubyte ERR10_017 = $0011 + const ubyte ERR10_018 = $0012 + const ubyte ERR10_019 = $0013 + const ubyte ERR10_020 = $0014 + const ubyte ERR10_021 = $0015 + const ubyte ERR10_022 = $0016 + const ubyte ERR10_023 = $0017 + const ubyte ERR10_024 = $0018 + const ubyte ERR10_025 = $0019 + const ubyte ERR10_026 = $001a + const ubyte ERR10_027 = $001b + const ubyte ERR10_028 = $001c + const ubyte ERR10_029 = $001d + const ubyte ERR10_030 = $001e + const ubyte ERR10_031 = $001f + const ubyte ERR10_032 = $0020 + const ubyte ERR10_033 = $0021 + const ubyte ERR10_034 = $0022 + const ubyte ERR10_035 = $0023 + const ubyte ERR10_036 = $0024 + const ubyte ERR10_037 = $0025 + const ubyte ERR10_039 = $0027 + const ubyte ERR10_040 = $0028 + const ubyte ERR10_041 = $0029 + const ubyte ERR10_042 = $002a + const ubyte ERR10_043 = $002b + const ubyte ERR10_044 = $002c + const ubyte ERR10_045 = $002d + const ubyte ERR10_046 = $002e + const ubyte ERR10_047 = $002f + const ubyte ERR10_048 = $0030 + const ubyte RLFB_TRACE = $0000 + const ubyte RLFB_HALT = $0001 + const ubyte RLFB_SUSP = $0002 + const ubyte NSF_INTNUM = $0001 + const ubyte NSF_DPNUM = $0001 + const ubyte NSF_ALPHA = $0001 + const ubyte NSF_OWNED = $0001 + const ubyte KEEPSTR = $0001 + const ubyte KEEPNUM = $0001 +} +;; End of auto-generated arexx_lib.sfd diff --git a/compiler/res/prog8lib/shared_amiga_audio.p8 b/compiler/res/prog8lib/shared_amiga_audio.p8 new file mode 100644 index 000000000..78382cf5e --- /dev/null +++ b/compiler/res/prog8lib/shared_amiga_audio.p8 @@ -0,0 +1,296 @@ +%import exec +%import syslib + +audio { + %option merge, no_symbol_prefixing, ignore_unused + + ; audio.device IO commands: + const uword ADCMD_FREE = 9 + const uword ADCMD_SETPREC = 10 + const uword ADCMD_FINISH = 11 + const uword ADCMD_PERVOL = 12 + const uword ADCMD_LOCK = 13 + const uword ADCMD_WAITCYCLE = 14 + const uword ADCMD_ALLOCATE = 32 + + ; IOAudio flags (explicit ubyte values): + const ubyte ADIOB_PERVOL = 4 + const ubyte ADIOF_PERVOL = $10 + const ubyte ADIOB_SYNCCYCLE = 5 + const ubyte ADIOF_SYNCCYCLE = $20 + const ubyte ADIOB_NOWAIT = 6 + const ubyte ADIOF_NOWAIT = $40 + const ubyte ADIOB_WRITEMESSAGE = 7 + const ubyte ADIOF_WRITEMESSAGE = $80 + + ; IOAudio error codes: + const byte ADIOERR_NOALLOCATION = -10 + const byte ADIOERR_ALLOCFAILED = -11 + const byte ADIOERR_CHANNELSTOLEN = -12 + + ; hardware constants: + const uword ADHARD_CHANNELS = 4 + const byte ADALLOC_MINPREC = -128 + const byte ADALLOC_MAXPREC = 127 + + struct IOAudio { + ; struct IORequest (base, 32 bytes) + ^^exec.Node Succ ; 0 + ^^exec.Node Pred ; 4 + ubyte Type ; 8 + byte Pri ; 9 + str Name ; 10 + ^^exec.MsgPort ReplyPort ; 14 + uword Length ; 18 + pointer Device ; 20 + pointer Unit ; 24 + uword Command ; 28 + ubyte Flags ; 30 + byte Error ; 31 + ; struct IOAudio specific fields + word AllocKey ; 32 + pointer Data ; 34 + long IOAudio_Length ; 38 + uword Period ; 42 + uword Volume ; 44 + uword Cycles ; 46 + ; struct Message ioa_WriteMsg (20 bytes) + ^^exec.Node Msg_Succ ; 48 + ^^exec.Node Msg_Pred ; 52 + ubyte Msg_Type ; 56 + byte Msg_Pri ; 57 + str Msg_Name ; 58 + ^^exec.MsgPort Msg_ReplyPort ; 62 + uword Msg_Length ; 66 + } + + ; 4 audio channel I/O structures to address each channel individually + ^^IOAudio AudioIO0 = [] + ^^IOAudio AudioIO1 = [] + ^^IOAudio AudioIO2 = [] + ^^IOAudio AudioIO3 = [] + + private ^^exec.MsgPort msgport0 = [] + private ^^exec.MsgPort msgport1 = [] + private ^^exec.MsgPort msgport2 = [] + private ^^exec.MsgPort msgport3 = [] + private bool[4] active_channels + + ; Separate control-request structures for the ADCMD_* control commands. + ; An IORequest carrying an in-flight CMD_WRITE is queued inside audio.device + ; and must not be reused for another command, so the controls get their own. + private ^^IOAudio CtrlIO0 = [] + private ^^IOAudio CtrlIO1 = [] + private ^^IOAudio CtrlIO2 = [] + private ^^IOAudio CtrlIO3 = [] + + ; ---- high level audio interface ---- + + sub init() -> bool { + ; -- Initialize the audio device on all 4 channels. + ubyte[1] channel_matrix = [15] ; allocate all 4 channels at once + for ubyte channel in 0 to 3 + active_channels[channel] = false + return opendevice(channel_matrix, 1, 0) + } + + sub closedown() { + ; -- Close down the audio device on all 4 channels. Does not wait for sounds to finish playing. + stop_all() + closedevice() + for ubyte channel in 0 to 3 + active_channels[channel] = false + } + + sub play(ubyte channel, ^^byte samples, long num_samples, uword sample_rate, ubyte volume, uword cycles) { + ; -- Play a sample asynchronously on the given channel (0-3), with the given parameters. + ^^IOAudio io = get_io(channel) + io.Command = exec.CMD_WRITE + io.Flags = ADIOF_PERVOL + io.Data = samples + io.IOAudio_Length = num_samples + io.Period = period(sample_rate) + io.Volume = volume + io.Cycles = cycles + BeginIO(io) ; not exec.DoIO/SendIO: those clear io_Flags, wiping ADIOF_PERVOL! + active_channels[channel] = true + ; sound now plays asynchronously. + } + + sub wait_channel(ubyte channel) { + ; wait for the current sound on this channel to finish playing. + if active_channels[channel] { + void exec.WaitIO(get_io(channel)) + active_channels[channel] = false + } + } + + sub wait_all() { + ; wait for all channels to finish playing their sounds. + wait_channel(0) + wait_channel(1) + wait_channel(2) + wait_channel(3) + } + + sub stop(ubyte channel) { + ; -- Abort the sound currently playing on this channel (ADCMD_FINISH). + ; The sound stops immediately; blocks until the aborted write request has completed. + if not active_channels[channel] + return + ^^IOAudio ctrl = get_ctrl(channel) + ctrl.Command = ADCMD_FINISH + ctrl.Flags = 0 + BeginIO(ctrl) + void exec.WaitIO(ctrl) ; reap the control request + void exec.WaitIO(get_io(channel)) ; reap the aborted write request + active_channels[channel] = false + } + + sub stop_all() { + ; -- Abort the sounds currently playing on all channels. + stop(0) + stop(1) + stop(2) + stop(3) + } + + sub set_freqvol(ubyte channel, uword samplerate, ubyte volume) { + ; -- Change the playback rate and volume of the sound currently playing on this channel (ADCMD_PERVOL). + ; Takes effect immediately. Both are always set together: ADCMD_PERVOL has no way to change just one. + if not active_channels[channel] + return + ^^IOAudio ctrl = get_ctrl(channel) + ctrl.Command = ADCMD_PERVOL + ctrl.Flags = 0 + ctrl.Period = period(samplerate) + ctrl.Volume = volume + BeginIO(ctrl) + } + + inline sub is_playing(ubyte channel) -> bool { + ; -- Returns true while a sound is playing on this channel, + ; i.e. between play() and wait_channel()/wait_all()/stop(). + return active_channels[channel] + } + + + ; ---- low level audio interface ---- + + sub opendevice(pointer channelPrefs, ubyte prefsLen, byte precedence) -> bool { + ; Set channel allocation preferences before opening + AudioIO0.Pri = precedence + AudioIO0.AllocKey = 0 + AudioIO0.Data = channelPrefs + AudioIO0.IOAudio_Length = prefsLen + + if exec.OpenDevice("audio.device", 0, AudioIO0, 0)!=0 { + AudioIO0.Type = 0 + return false + } + + ; Clone the other 3 IOAudio instances via CopyMem + ; This preserves AllocKey and channel binding from OpenDevice + AudioIO1^^ = AudioIO0^^ + AudioIO2^^ = AudioIO0^^ + AudioIO3^^ = AudioIO0^^ + AudioIO0.Unit = 1 ; channel 1 + AudioIO1.Unit = 2 ; channel 2 + AudioIO2.Unit = 4 ; channel 3 + AudioIO3.Unit = 8 ; channel 4 + + ; Allocate separate MsgPorts for each cloned IOAudio + AudioIO0.ReplyPort = init_msgport(msgport0) + AudioIO1.ReplyPort = init_msgport(msgport1) + AudioIO2.ReplyPort = init_msgport(msgport2) + AudioIO3.ReplyPort = init_msgport(msgport3) + + ; Clone the channel bindings into the control structures + CtrlIO0^^ = AudioIO0^^ + CtrlIO1^^ = AudioIO1^^ + CtrlIO2^^ = AudioIO2^^ + CtrlIO3^^ = AudioIO3^^ + + return true + + private sub init_msgport(^^exec.MsgPort port) -> ^^exec.MsgPort { + port.Type = exec.NT_MSGPORT + port.Flags = exec.PA_SIGNAL + port.SigBit = exec.AllocSignal(-1) as ubyte + port.SigTask = exec.FindTask(0) + exec.NewList(&port.Head) + return port + } + } + + sub closedevice() { + if AudioIO0.Type == 0 + return + + exec.CloseDevice(AudioIO0) + ^^exec.MsgPort port = AudioIO0.ReplyPort + exec.FreeSignal(port.SigBit as byte) + port = AudioIO1.ReplyPort + exec.FreeSignal(port.SigBit as byte) + port = AudioIO2.ReplyPort + exec.FreeSignal(port.SigBit as byte) + port = AudioIO3.ReplyPort + exec.FreeSignal(port.SigBit as byte) + AudioIO0.Type = 0 + AudioIO1.Type = 0 + AudioIO2.Type = 0 + AudioIO3.Type = 0 + } + + sub get_io(ubyte channel) -> ^^IOAudio { + when channel { + 0 -> return AudioIO0 + 1 -> return AudioIO1 + 2 -> return AudioIO2 + else -> return AudioIO3 + } + } + + private sub get_ctrl(ubyte channel) -> ^^IOAudio { + when channel { + 0 -> return CtrlIO0 + 1 -> return CtrlIO1 + 2 -> return CtrlIO2 + else -> return CtrlIO3 + } + } + + sub period(uword samplerate) -> uword { + ; calculate the Period to use for the desired sample rate + return clock() / samplerate as uword + } + + sub sample_rate(uword per) -> uword { + ; calculate the sample rate belonging to the given Period; the inverse of period() + return clock() / per as uword + } + + asmsub clock() clobbers (A6) -> long @D0 { + ; return the Audio/Color clock, used for Period calculations to get the correct frequency + %asm {{ + move.l sys.GfxBase, a6 + btst.b #0, $dc(a6) + bne.s .ntsc + move.l #3546895, d0 ; PAL + rts +.ntsc: + move.l #3579545, d0 ; NTSC + rts + }} + } + + private asmsub BeginIO(^^IOAudio io @A1) clobbers (D0, D1, A0, A1, A6) { + ; Calls the device's BeginIO vector directly, instead of exec DoIO/SendIO, + ; because those clear io_Flags which would wipe ADIOF_PERVOL and friends. + %asm {{ + move.l 20(a1), a6 ; a6 = io_Device (offset 20 in IORequest) + jsr -30(a6) ; device BeginIO vector + rts + }} + } +} diff --git a/compiler/res/prog8lib/shared_amiga_bcd.p8 b/compiler/res/prog8lib/shared_amiga_bcd.p8 new file mode 100644 index 000000000..79f43c39b --- /dev/null +++ b/compiler/res/prog8lib/shared_amiga_bcd.p8 @@ -0,0 +1 @@ +; no support for BCD diff --git a/compiler/res/prog8lib/shared_amiga_blitter.p8 b/compiler/res/prog8lib/shared_amiga_blitter.p8 new file mode 100644 index 000000000..ec90aadee --- /dev/null +++ b/compiler/res/prog8lib/shared_amiga_blitter.p8 @@ -0,0 +1,345 @@ +%import custom + +blitter { + %option merge, no_symbol_prefixing, ignore_unused + + ; WARNING: All pointers passed to blitter routines MUST point to CHIP RAM. + ; The Amiga blitter hardware can only access CHIP RAM directly. + ; Using fast RAM pointers will result in bus errors or corrupted data. + ; + ; WIDTH LIMITATION: The blitter can only handle 64 words (1024 pixels) width per operation. + ; Standard Amiga screens (320/640 pixels) fit within this limit. + ; For wider images, split the blit into multiple operations manually. + ; + ; WAITING BEHAVIOR: All blitter operations wait for the blitter to become idle + ; at the START of the call, but do NOT wait for the operation to finish before + ; returning. This allows the CPU to continue working while the blitter runs. + ; Call blitter.wait() explicitly when you need to ensure the blitter has completed + ; (e.g., before reading back modified memory or swapping display buffers). + + const uword MINTERM_MASKED = $CA ; (A AND B) OR (NOT A AND C) - masked sprite blit + const uword MINTERM_A_ONLY = $F0 ; channel A only (same as COPY) + const uword MINTERM_B_ONLY = $CC ; channel B only + const uword MINTERM_A_XOR_C = $5A ; A XOR C (erase/restore patterns) + + asmsub wait() { + ; Wait until the blitter is completely idle. + ; Use this before reading back blitter-modified memory or swapping buffers. + %asm {{ +.busy: + btst.b #6,custom.DMACONR + bne.s .busy + rts + }} + } + + asmsub set_blitpri(bool hasprio @D0) clobbers (D0) { + ; Set or clear blitter priority over the CPU. + ; When enabled, the blitter gets bus priority and completes faster, + ; but the CPU runs slower during the blit. + ; Disable when you need full CPU speed while the blitter runs. + %asm {{ + tst.b d0 + beq.s .clear + move.w #$8400,custom.DMACON ; SET bit + BLITPRI bit + rts +.clear: + move.w #$0400,custom.DMACON ; BLITPRI bit only (clears it) + rts + }} + } + + ; Copy a rectangular block from src to dst. + ; Waits for blitter idle at start, returns immediately after triggering the blit. + asmsub copy_rect(pointer src @A0, pointer dst @A1, uword width_words @D0, uword height @D1, uword src_mod @D2, uword dst_mod @D3, uword minterm @D4, ubyte descending @D5) clobbers (D0,D1,D2,D3,D4,D5,A0,A1) { + %asm {{ + movem.l d2-d7/a2-a6,-(sp) + move.w d0,d6 ; d6 = width + move.w d1,d7 ; d7 = height + move.w d2,d2 ; src_mod + move.w d3,d3 ; dst_mod + bsr .wait_blt + tst.w d5 + beq.s .no_desc + move.w d6,d0 + lsl.w #1,d0 + add.w d2,d0 + move.w d7,d1 + subq.w #1,d1 + mulu.w d0,d1 + move.w d6,d0 + subq.w #1,d0 + lsl.w #1,d0 + ext.l d0 + add.l d0,d1 + add.l d1,a0 + move.w d6,d0 + lsl.w #1,d0 + add.w d3,d0 + move.w d7,d1 + subq.w #1,d1 + mulu.w d0,d1 + move.w d6,d0 + subq.w #1,d0 + lsl.w #1,d0 + ext.l d0 + add.l d0,d1 + add.l d1,a1 +.no_desc: + move.w d2,custom.BLTAMOD + move.w d3,custom.BLTDMOD + move.w #$ffff,custom.BLTAFWM + move.w #$ffff,custom.BLTALWM + move.l a0,custom.BLTAPT + move.l a1,custom.BLTDPT + move.w d4,d1 + or.w #$0900,d1 + move.w d1,custom.BLTCON0 + moveq #0,d1 + tst.w d5 + beq.s .nodesc + move.w #$0002,d1 +.nodesc: + or.w #$0800,d1 ; B32: AGA 32-bit blit mode + move.w d1,custom.BLTCON1 + move.w d7,d1 + lsl.w #6,d1 + or.w d6,d1 + move.w d1,custom.BLTSIZE + movem.l (sp)+,d2-d7/a2-a6 + rts +.wait_blt: + btst.b #6,custom.DMACONR + bne.s .wait_blt + rts + }} + } + + ; Fill a rectangular block with a pattern. + ; Waits for blitter idle at start, returns immediately after triggering the blit. + asmsub fill_rect(pointer dst @A0, uword width_words @D0, uword height @D1, uword pattern @D2, uword modulo @D3) clobbers (D0,D1,D2,D3,A0) { + %asm {{ + movem.l d2-d7/a2-a6,-(sp) + bsr .wait_blt + move.w d3,custom.BLTDMOD + move.w #$ffff,custom.BLTAFWM + move.w #$ffff,custom.BLTALWM + move.w d2,custom.BLTCDAT + move.l a0,custom.BLTDPT + move.w #$01aa,custom.BLTCON0 ; USED=1, USEC=0, minterm=$AA (BLTCDAT -> D) + move.w #$0800,custom.BLTCON1 ; B32: AGA 32-bit blit mode + move.w d1,d1 + lsl.w #6,d1 + or.w d0,d1 + move.w d1,custom.BLTSIZE + movem.l (sp)+,d2-d7/a2-a6 + rts +.wait_blt: + btst.b #6,custom.DMACONR + bne.s .wait_blt + rts + }} + } + + ; Initialize the blitter for fast line drawing. + ; Call this once before drawing a batch of lines with the same parameters. + ; mask: first/last word mask (usually $ffff for full-word lines) + ; pixel: line pixel pattern in BLTADAT (usually $8000 for single pixel) + ; pattern: line fill pattern in BLTBDAT (usually $ffff for solid lines) + ; screen_mod: bytes per row of the destination bitplane (pitch) + ; Waits for blitter idle at start, returns immediately after setup. + asmsub line_init(uword mask @D0, uword pixel @D1, uword pattern @D2, uword screen_mod @D4) clobbers (D0,D1,D2,D4,A0,A1) { + %asm {{ + movem.l d2-d7/a2-a6,-(sp) + bsr .wait_blt + move.w d0,custom.BLTAFWM + move.w #$ffff,custom.BLTALWM + move.w d1,custom.BLTADAT + move.w d2,custom.BLTBDAT + move.w d4,custom.BLTCMOD + movem.l (sp)+,d2-d7/a2-a6 + rts +.wait_blt: + btst.b #6,custom.DMACONR + bne.s .wait_blt + rts + }} + } + + ; Draw a single line using the blitter's hardware Bresenham line mode. + ; Must be preceded by a call to line_init() with the appropriate parameters. + ; Uses the octant-lookup-table algorithm from coppershade.org + ; (see https://coppershade.org/asmskool/SOURCES/Developing-Demo-Effects/DDE4/LineVectors/). + ; x1, y1: starting coordinates (absolute, any direction supported) + ; x2, y2: ending coordinates + ; screen_mod: bytes per row of the destination bitplane (pitch) + ; screen_ptr: pointer to bitplane memory (CHIP RAM) + ; Waits for blitter idle at start, returns immediately after triggering the blit. + asmsub line_draw(uword x1 @D0, uword y1 @D1, uword x2 @D2, uword y2 @D3, uword screen_mod @D4, pointer screen_ptr @A1) clobbers (D0,D1,D2,D3,D5,D6,A0,A1) { + %asm {{ + movem.l d2-d7/a2-a6,-(sp) + + ; CPU setup (these would normally be done once in LineInit and + ; preserved across calls; we set them up here for self-containment). + move.w #1*64+2,a3 ; add-value for BLTSIZE + move.l #$bfa0000f,a4 ; minterm+mask for quick-rol + + ; d0=x1, d1=y1, d2=x2, d3=y2, d4=screen_mod, a1=screen_ptr + move.l a4,d6 ; minterm+mask + and.w d0,d6 ; mask x 0..15 + ror.l #4,d6 ; shift it in at top, low word cleared + + ; --- deltas --- + sub.w d1,d3 ; d3 = y2 - y1 + bpl.s .dyplus + neg.w d3 + addq.b #8,d6 +.dyplus: + sub.w d0,d2 ; d2 = x2 - x1 + bgt.s .dxplus + neg.w d2 + addq.b #4,d6 +.dxplus: + cmp.w d2,d3 + bge.s .dylarger + exg d2,d3 ; d2=Small delta, d3=Large delta + addq.b #2,d6 +.dylarger: + + ; --- blit values --- + muls d4,d1 ; d1 = y1 * screen_mod + asr.w #3,d0 ; bit 0 ignored by Blitter + add.w d0,d1 ; offset on screen + add.l a1,d1 ; add current screen buffer ptr + + add.w d2,d2 ; d2 = 2*SDelta + move.w d2,d5 ; d5 = 2*SDelta + swap d2 ; d2 high word = 2*SDelta + sub.w d3,d5 ; d5 = 2*SDelta - LDelta + smi d0 ; if (2*Sdelta-Ldelta) < 0, + sub.b d0,d6 ; add 1 (subtract -1) to octant lookup + move.b OctTbl(pc,d6.w),d6 ; look up BLTCON bits for octant + + move.w d5,d2 ; d2 low word = 2*SDelta - LDelta + sub.w d3,d2 ; d2 low word = 2*SDelta - 2*LDelta + asl.w #6,d3 ; d3 = LDelta << 6 + add.w a3,d3 ; d3 = BLTSIZE + + ; --- blit --- + bsr .wait_blt + move.l d6,custom.BLTCON0 ; shift, minterm, octant bits + move.w d5,custom.BLTAPTL ; 2*SDelta - LDelta + move.l d2,custom.BLTBMOD ; 2*SDelta | 2*SDelta - 2*LDelta + move.l d1,custom.BLTCPT ; source + move.l d1,custom.BLTDPT ; destination + move.w d3,custom.BLTSIZE + movem.l (sp)+,d2-d7/a2-a6 + rts + +.wait_blt: + btst.b #6,custom.DMACONR + bne.s .wait_blt + rts + +; Octant lookup table placed right after the rts so it is reachable via +; PC-relative addressing from the move.b OctTbl(PC,d6.w) instruction above. +; Each pair of entries encodes BLTCON1 octant bits for one of the 8 octants. +; First byte has SING=0, second has SING=1 (descending mode). +OctTbl: + dc.b 0*4+1,0*4+1+64 ;7 + dc.b 4*4+1,4*4+1+64 ;6 + dc.b 2*4+1,2*4+1+64 ;4 + dc.b 5*4+1,5*4+1+64 ;5 + dc.b 1*4+1,1*4+1+64 ;0 + dc.b 6*4+1,6*4+1+64 ;1 + dc.b 3*4+1,3*4+1+64 ;3 + dc.b 7*4+1,7*4+1+64 ;2 + ; !notreached! + }} + } + + ; Masked blit: copy src to dst using a mask channel. + ; Waits for blitter idle at start, returns immediately after triggering the blit. + asmsub masked_blit(pointer src @A0, pointer mask @A1, pointer dst @A2, uword width_words @D0, uword height @D1, uword src_mod @D2, uword mask_mod @D3, uword dst_mod @D4) clobbers (D0,D1,D2,D3,D4,A0,A1,A2) { + %asm {{ + movem.l d2-d7/a2-a6,-(sp) + bsr .wait_blt + move.w d2,custom.BLTBMOD + move.w d3,custom.BLTAMOD + move.w d4,custom.BLTDMOD + move.w d4,custom.BLTCMOD + move.w #$ffff,custom.BLTAFWM + move.w #$ffff,custom.BLTALWM + move.l a1,custom.BLTAPT + move.l a0,custom.BLTBPT + move.l a2,custom.BLTCPT + move.l a2,custom.BLTDPT + move.w #$0fca,custom.BLTCON0 + move.w #$0800,custom.BLTCON1 ; B32: AGA 32-bit blit mode + move.w d1,d1 + lsl.w #6,d1 + or.w d0,d1 + move.w d1,custom.BLTSIZE + movem.l (sp)+,d2-d7/a2-a6 + rts +.wait_blt: + btst.b #6,custom.DMACONR + bne.s .wait_blt + rts + }} + } + + ; Clear a rectangular region of a bitplane to zero. + ; Waits for blitter idle at start, returns immediately after triggering the blit. + asmsub clear_plane(pointer dst @A0, uword width_words @D0, uword height @D1) clobbers (D0,D1,A0) { + %asm {{ + movem.l d2-d7/a2-a6,-(sp) + bsr .wait_blt + move.w #$ffff,custom.BLTAFWM + move.w #$ffff,custom.BLTALWM + move.w #$0000,custom.BLTCDAT + move.w #$0000,custom.BLTDMOD + move.l a0,custom.BLTDPT + move.w #$01aa,custom.BLTCON0 + move.w #$0800,custom.BLTCON1 ; B32: AGA 32-bit blit mode + move.w d1,d1 + lsl.w #6,d1 + or.w d0,d1 + move.w d1,custom.BLTSIZE + movem.l (sp)+,d2-d7/a2-a6 + rts +.wait_blt: + btst.b #6,custom.DMACONR + bne.s .wait_blt + rts + }} + } + + ; Fill an entire bitplane (or any width_words x height block) with a 16-bit pattern. + ; pattern: the value written to every word of the destination (e.g. $0000 clears, + ; $ffff fills solid, $aaaa produces a vertical stripe pattern). + ; Waits for blitter idle at start, returns immediately after triggering the blit. + asmsub fill_plane(pointer dst @A0, uword width_words @D0, uword height @D1, uword pattern @D2) clobbers (D0,D1,D2,A0) { + %asm {{ + movem.l d2-d7/a2-a6,-(sp) + bsr .wait_blt + move.w #$ffff,custom.BLTAFWM + move.w #$ffff,custom.BLTALWM + move.w d2,custom.BLTCDAT + move.l a0,custom.BLTDPT + move.w #$01aa,custom.BLTCON0 ; USED=1, USEC=0, minterm=$AA (BLTCDAT -> D) + move.w #$0800,custom.BLTCON1 ; B32: AGA 32-bit blit mode + move.w #$0000,custom.BLTDMOD + move.w d1,d1 + lsl.w #6,d1 + or.w d0,d1 + move.w d1,custom.BLTSIZE + movem.l (sp)+,d2-d7/a2-a6 + rts +.wait_blt: + btst.b #6,custom.DMACONR + bne.s .wait_blt + rts + }} + } +} diff --git a/compiler/res/prog8lib/shared_amiga_conv.p8 b/compiler/res/prog8lib/shared_amiga_conv.p8 new file mode 100644 index 000000000..ada857ea6 --- /dev/null +++ b/compiler/res/prog8lib/shared_amiga_conv.p8 @@ -0,0 +1,279 @@ +; Number conversions routines. + +%import strings + +conv { + +; ----- number conversions to decimal strings ---- + + %option merge, ignore_unused + str string_out = "????????????????" ; result buffer for the string conversion routines + private long @shared fmt_value_l + private uword @shared fmt_value_w + + private asmsub putcharproc(ubyte character @D0, pointer output @A3) -> ubyte @D0 { + %asm {{ + move.b d0, (a3)+ ; Store character in buffer and advance pointer + rts ; Return control to RawDoFmt loop + }} + } + +sub str_ub0(ubyte value) -> str { + ; ---- convert the ubyte in A in decimal string form, with left padding 0s (3 positions total) + fmt_value_w = value as uword + void exec.RawDoFmt("%03d", &fmt_value_w, putcharproc, string_out) + return string_out +} + +sub str_ub(ubyte value) -> str { + ; ---- convert the ubyte in A in decimal string form, without left padding 0s + fmt_value_w = value as uword + void exec.RawDoFmt("%d", &fmt_value_w, putcharproc, string_out) + return string_out +} + +sub str_b(byte value) -> str { + ; ---- convert the byte in A in decimal string form, without left padding 0s + fmt_value_w = value as uword + void exec.RawDoFmt("%d", &fmt_value_w, putcharproc, string_out) + return string_out +} + +sub str_ubhex (ubyte value) -> str { + ; ---- convert the ubyte in A in hex string form + fmt_value_w = value as uword + void exec.RawDoFmt("%02x", &fmt_value_w, putcharproc, string_out) + return string_out +} + +sub str_ubbin (ubyte value) -> str { + ; ---- convert the ubyte in binary string form + ^^ubyte out_ptr = &string_out + ubyte mask = 128 + repeat 8 { + if value & mask != 0 + @(out_ptr) = '1' + else + @(out_ptr) = '0' + out_ptr++ + mask >>= 1 + } + @(out_ptr) = 0 + return string_out +} + +sub str_uwbin (uword value) -> str { + ; ---- convert the uword in binary string form + ^^ubyte out_ptr = &string_out + uword mask = $8000 + repeat 16 { + if value & mask != 0 + @(out_ptr) = '1' + else + @(out_ptr) = '0' + out_ptr++ + mask >>= 1 + } + @(out_ptr) = 0 + return string_out +} + +sub str_uwhex (uword value) -> str { + ; ---- convert the uword in hexadecimal string form (4 digits) + void exec.RawDoFmt("%04x", &value, putcharproc, string_out) + return string_out +} + +sub str_ulhex (long value) -> str { + ; ---- convert the long in hexadecimal string form (8 digits) + void exec.RawDoFmt("%08lx", &value, putcharproc, string_out) + return string_out +} + +sub str_uw0 (uword value) -> str { + ; ---- convert the uword in decimal string form, with left padding 0s (5 positions total) + ; requires kickstart 2.0+ + fmt_value_l = value as long + void exec.RawDoFmt("%05lu", &fmt_value_l, putcharproc, string_out) + return string_out +} + +sub str_uw (uword value) -> str { + ; ---- convert the uword in decimal string form, without left padding 0s + ; requires kickstart 2.0+ + fmt_value_l = value as long + void exec.RawDoFmt("%lu", &fmt_value_l, putcharproc, string_out) + return string_out +} + +sub str_w (word value) -> str { + ; ---- convert the (signed) word into decimal string form, without left padding 0's + void exec.RawDoFmt("%d", &value, putcharproc, string_out) + return string_out +} + +sub str_l (long value) -> str { + ; ---- convert the (signed) long into decimal string form + void exec.RawDoFmt("%ld", &value, putcharproc, string_out) + return string_out +} + + +; ---- string conversion to numbers ----- + +sub str2ubyte(str string) -> ubyte { + ; -- returns in A the unsigned byte value of the string number argument in AY + ; the number may NOT be preceded by a + sign and may NOT contain spaces + ; (any non-digit character will terminate the number string that is parsed) + return str2uword(string) as ubyte +} + +sub str2byte(str string) -> byte { + ; -- returns in A the signed byte value of the string number argument in AY + ; the number may be preceded by a + or - sign but may NOT contain spaces + ; (any non-digit character will terminate the number string that is parsed) + return str2word(string) as byte +} + +sub str2uword(str string) -> uword { + uword result + ubyte ii + while string[ii] >= '0' and string[ii] <= '9' { + result = result * 10 + (string[ii] - '0') as uword + ii++ + } + return result +} + +sub str2word(str string) -> word { + bool negative + ubyte ii + if string[0] == '-' { + negative = true + ii = 1 + } else { + if string[0] == '+' + ii = 1 + } + uword result + while string[ii] >= '0' and string[ii] <= '9' { + result = result * 10 + (string[ii] - '0') as uword + ii++ + } + if negative + return 0 - result as word + return result as word +} + +sub hex2uword(str string) -> uword { + ; -- hexadecimal string (with or without '$') to uword. + ; stops parsing at the first character that's not a hex digit (except leading $) + uword result + ubyte char + if @(string)=='$' + string++ + repeat { + char = strings.lowerchar(@(string)) + if strings.isxdigit(char) { + result <<= 4 + if char>='0' and char<='9' + result |= char-'0' + else + result |= char-'a'+10 + } else + return result + string++ + } +} + +sub hex2long(str string) -> long { + ; -- hexadecimal string (with or without '$') to long. + ; stops parsing at the first character that's not a hex digit (except leading $) + long result + ubyte char + if @(string)=='$' + string++ + repeat { + char = strings.lowerchar(@(string)) + if strings.isxdigit(char) { + result <<= 4 + if char>='0' and char<='9' + result |= char-'0' + else + result |= char-'a'+10 + } else + return result + string++ + } +} + +sub str2long(str string) -> long { + ; -- convert a decimal string (terminated with a zero byte) into a long. Clobbers R0 + long result = 0 + bool negative = string[0] == '-' + if negative or string[0]=='+' + string++ + repeat { + ubyte digit_char = @(string) + if strings.isdigit(digit_char) { + result = (result<<1) + (result<<3) ; multiply by 10 + result += digit_char - '0' ; add digit + } else { + break ; Invalid character, stop processing + } + string++ + } + + if negative + return -result + else + return result +} + +sub bin2uword(str string) -> uword { + ; -- binary string (with or without '%') to uword. + ; stops parsing at the first character that's not a 0 or 1. (except leading %) + uword result + ubyte char + if @(string)=='%' + string++ + repeat { + char = @(string) + if char=='0' { + result <<= 1 + } else if char=='1' { + result <<= 1 + result |= 1 + } else + return result + string++ + } +} + +sub any2uword(str string) -> uword, ubyte { + ; -- convert any number string (any prefix allowed) to uword. + ; returns the parsed word value, and the number of processed characters (including the prefix symbol) + ubyte count + when string[0] { + '$' -> { + count = 1 + while strings.isxdigit(string[count]) + count++ + return hex2uword(string), count + } + '%' -> { + count = 1 + while string[count]=='0' or string[count]=='1' + count++ + return bin2uword(string), count + } + else -> { + count = 0 + while strings.isdigit(string[count]) + count++ + return str2uword(string), count + } + } +} + +} diff --git a/compiler/res/prog8lib/shared_amiga_copper.p8 b/compiler/res/prog8lib/shared_amiga_copper.p8 new file mode 100644 index 000000000..5bc99202d --- /dev/null +++ b/compiler/res/prog8lib/shared_amiga_copper.p8 @@ -0,0 +1,137 @@ +; Copper list builder and manager for Amiga custom hardware. +; IMPORTANT: Copper lists MUST be allocated in CHIP RAM (accessible by both CPU and custom chips). +; Use memory() or ensure your list buffers are in CHIP RAM range. + +%import custom + +copper { + %option merge, no_symbol_prefixing, ignore_unused + + ; Current write position in copper list (used by assembly routines) + pointer @shared _copper_pos + + ; ========== List building routines (assembly) ========== + + asmsub init(pointer list_ptr @A0) clobbers (A0) { + %asm {{ + move.l a0,copper._copper_pos + rts + }} + } + + asmsub move(uword reg_addr @D0, uword value @D1) clobbers (D0, D1, A0) { + ; Add a MOVE instruction to the copper list. + ; reg_addr is the custom register address offsetr (e.g., $0180 for COLOR00 / $dff180). + ; The copper MOVE instruction encodes the register offset from $dff000. + %asm {{ + move.l copper._copper_pos,a0 + and.w #$1fe,d0 ; mask to even register offset (bit 0 must be 0) + move.w d0,(a0)+ ; word 1: register offset (bit 0 = 0 identifies MOVE) + move.w d1,(a0)+ ; word 2: value + move.l a0,copper._copper_pos + rts + }} + } + + asmsub wait(ubyte vpos @D0, ubyte hpos @D1, uword compare_mask @D2) clobbers (D0, D1, D2, A0) { + ; Add a WAIT instruction to the copper list. + ; Word1 = (vpos<<8) | (hpos<<1) | 1 (bit 0 = 1 identifies WAIT/SKIP) + ; Word2 = compare_mask with bit 0 = 0 (distinguishes WAIT from SKIP). + ; Word2 bit 15 = BFD (1 = no blitter wait, 0 = also wait for blitter) + ; Word2 bits 14-8 = VE (vertical compare enable mask) + ; Word2 bits 7-1 = HE (horizontal compare enable mask) + %asm {{ + move.l copper._copper_pos,a0 + and.w #$ff,d0 ; zero-extend vpos to word + lsl.w #8,d0 ; vpos to high byte + and.w #$ff,d1 ; zero-extend hpos to word + lsl.w #1,d1 ; hpos to bit 1 + or.w d1,d0 ; combine vpos and hpos + or.w #1,d0 ; set bit 0 to identify instruction as WAIT/SKIP + move.w d0,(a0)+ ; word 1 + and.w #$fffe,d2 ; clear bit 0 to indicate WAIT (not SKIP) + move.w d2,(a0)+ ; word 2 + move.l a0,copper._copper_pos + rts + }} + } + + asmsub skip(ubyte vpos @D0, ubyte hpos @D1, uword compare_mask @D2) clobbers (D0, D1, D2, A0) { + ; Add a SKIP instruction to the copper list. + ; Word1 = (vpos<<8) | (hpos<<1) | 1 (bit 0 = 1 identifies WAIT/SKIP) + ; Word2 = compare_mask with bit 0 = 1 (distinguishes SKIP from WAIT). + %asm {{ + move.l copper._copper_pos,a0 + and.w #$ff,d0 ; zero-extend vpos to word + lsl.w #8,d0 ; vpos to high byte + and.w #$ff,d1 ; zero-extend hpos to word + lsl.w #1,d1 ; hpos to bit 1 + or.w d1,d0 ; combine vpos and hpos + or.w #1,d0 ; set bit 0 to identify instruction as WAIT/SKIP + move.w d0,(a0)+ ; word 1 + or.w #1,d2 ; set bit 0 to indicate SKIP (not WAIT) + move.w d2,(a0)+ ; word 2 + move.l a0,copper._copper_pos + rts + }} + } + + asmsub end() clobbers (A0) { + ; Terminate the copper list with the end marker ($FFFF, $FFFE). + %asm {{ + move.l copper._copper_pos,a0 + move.w #$ffff,(a0)+ ; end marker word 1 + move.w #$fffe,(a0)+ ; end marker word 2 + move.l a0,copper._copper_pos + rts + }} + } + + asmsub get_pos() -> pointer @A0 { + ; Return the current write position in the copper list. + ; Useful for calculating list size or continuing from a saved position. + %asm {{ + move.l copper._copper_pos,a0 + rts + }} + } + + ; ========== Activation routines (assembly) ========== + + asmsub start(pointer list_ptr @A0) clobbers (A0) { + ; Activate a copper list by loading its address into COP1LC and enabling Copper DMA. + ; The copper list must be in CHIP RAM. + %asm {{ + move.l a0,custom.COP1LC ; load copper list pointer (auto-increments) + move.w #$8280,custom.DMACON ; DMACON: SET(0x8000) | DMAEN(0x0200) | COPEN(0x0080) + clr.w custom.COPJMP1 ; strobe COPJMP1 to activate + rts + }} + } + + ; ========== Effects routines (Prog8) ========== + + sub append_raster_colors(ubyte vpos_start, ^^uword colors, ubyte num_lines) { + ; Append WAIT+MOVE instructions to change background color per scanline. + ; Does NOT call init() or end() - caller must handle list setup. + ; + ; Parameters: + ; vpos_start - starting vertical beam position (0-255) + ; colors - pointer to array of color values (12-bit RGB, e.g., $0F00 for red) + ; num_lines - number of scanlines to color + ; + ; Example: + ; copper.init(my_list) + ; ... add other copper instructions ... + ; copper.append_raster_colors(50, bar_colors, 8) + ; copper.end() + + ubyte vpos = vpos_start + ubyte i + for i in 0 to num_lines - 1 { + wait(vpos, 0, $fffe) + move($180, colors[i]) + vpos += 1 + } + } +} diff --git a/compiler/res/prog8lib/shared_amiga_custom.p8 b/compiler/res/prog8lib/shared_amiga_custom.p8 new file mode 100644 index 000000000..c0e9568d4 --- /dev/null +++ b/compiler/res/prog8lib/shared_amiga_custom.p8 @@ -0,0 +1,709 @@ +%import exec +%import syslib + +custom { + %option merge, no_symbol_prefixing, ignore_unused + + + asmsub grab_system() { + ; take over the whole OS and system, to run hardware banging programs (games, demos, etc) + %asm {{ + +exec_AttnFlags = 296 +gfx_ActiView = $22 +gfx_copinit = $26 +gfx_LOFlist = $32 +VBlankFrequency = $212 +GfxLoadView = -222 +GfxWaitTOF = -270 +IRQ1 = $64 +IRQ2 = $68 +IRQ3 = $6C +IRQ4 = $70 +IRQ5 = $74 +IRQ6 = $78 +IRQ7 = $7C + + move.l 4.w,a6 + jsr exec.Forbid(a6) ; Do not run other tasks + btst.b #0,exec_AttnFlags+1(a6) ; Check if > 68000 processor + beq.s 1$ ; On 68000 no VBR (always zero) + lea.l .getvbr(PC),a5 ; Function to call as supervisor + jsr exec.Supervisor(a6) ; Call supervisor function in A5 + move.l d0,custom.cpuVBR ; Store the returned VBR contents +1$ + cmp.b #50,VBlankFrequency(a6) + seq.b custom.isPAL + + move.l sys.GfxBase,a6 ; A6 = Graphics base + move.l gfx_ActiView(a6),custom.savedView ; Store current View pointer + sub.l a1,a1 ; NULL view = default settings + jsr GfxLoadView(a6) ; Load the view + jsr GfxWaitTOF(a6) ; Wait one screen refresh + jsr GfxWaitTOF(a6) ; Wait a 2nd (in case of interlace) + + move.w #$8000,d0 ; Value + move.w custom.DMACONR,custom.savedDMACON ; Store system DMA channels + or.w d0,custom.savedDMACON ; SET/CLR set to SET + move.w custom.INTENAR,custom.savedINTENA ; Store system enabled interrupts + or.w d0,custom.savedINTENA ; SET/CLR set to SET + move.w custom.ADKCONR,custom.savedADKCON ; Audio, disk and UART + or.w d0,custom.savedADKCON ; SET/CLR set to SET + + btst.b #14-8,custom.DMACONR ; Dummy read +3$ btst.b #14-8,custom.DMACONR ; Blitter still busy? + bne.s 3$ ; If yes, wait a bit + move.w #$01FF,custom.DMACON ; Disable all DMA + move.w #$3FFF,custom.INTENA ; Disable all interrupts + + move.l custom.cpuVBR,a0 ; A0 = Pointer to vector base + move.l IRQ1(a0),custom.savedIRQ1 ; Store IRQ1 vector + move.l IRQ3(a0),custom.savedIRQ3 ; Store IRQ3 vector + move.l IRQ4(a0),custom.savedIRQ4 ; Store IRQ4 vector + bra.s .skip + +.getvbr: dc.l $4E7A0801 ; MOVEC VBR,d0 - privileged instruction + rte + +.skip: rts + + }} + } + + asmsub restore_system() { + ; restore the original OS and multitasking operation when the game/demo exits. + %asm {{ + btst.b #14-8,custom.DMACONR ; Dummy read +1$ btst.b #14-8,custom.DMACONR ; Blitter still busy? + bne.s 1$ ; If yes, wait a bit + move.w #$01FF,custom.DMACON ; Disable all DMA + move.w #$3FFF,custom.INTENA ; Disable all interrupts + + move.l custom.cpuVBR,a0 ; A0 = Pointer to vector base + move.l custom.savedIRQ4,d0 ; Restore IRQ4 vector + move.l d0,IRQ4(a0) + move.l custom.savedIRQ3,d0 ; Restore IRQ3 vector + move.l d0,IRQ3(a0) + move.l custom.savedIRQ1,d0 ; Restore IRQ1 vector + move.l d0,IRQ1(a0) + + move.l sys.GfxBase,a6 ; A6 = Graphics base + move.l gfx_copinit(a6),custom.COP1LC ; Restore coplist pointer 1 + move.l gfx_LOFlist(a6),custom.COP2LC ; Restore coplist pointer 2 + clr.w custom.COPJMP1 ; Make Copper use restored pointer + + move.w custom.savedADKCON,custom.ADKCON ; Restore audio, disk and UART + move.w custom.savedINTENA,custom.INTENA ; Restore original interrupts + move.w custom.savedDMACON,custom.DMACON ; Restore original DMA + + move.l custom.savedView,a1 ; Get original view pointer + jsr GfxLoadView(a6) ; Restore the original view + jsr GfxWaitTOF(a6) ; Wait one screen refresh + jsr GfxWaitTOF(a6) ; Wait a 2nd (in case of interlace) + + move.l 4.w,a6 + jsr exec.Permit(a6) ; Re-enable multitasking + rts + }} + } + + asmsub waitvsync() { + %asm {{ +; synchronize to the screen's vsync, this routine doesn't require the OS to be active (sys.waitvsync is the OS-compatible version of this routine) +; Wait until the raster beam reaches line 300 +.WaitLine300: + MOVE.L $DFF004, D0 ; Read VPOSR + VHPOSR simultaneously + LSR.L #8, D0 ; Shift vertical position bits into low word + AND.W #$01FF, D0 ; Mask out horizontal beam bits (get 9-bit line #) + CMP.W #300, D0 ; Are we at raster line 300? + BNE.S .WaitLine300 + + ; Wait until the beam MOVES PAST line 300 + ; (Prevents fast CPUs like 030/040/060 from executing twice on the same line) +.WaitLineNext: + MOVE.L $DFF004, D0 + LSR.L #8, D0 + AND.W #$01FF, D0 + CMP.W #300, D0 + BEQ.S .WaitLineNext + rts + }} + } + + + pointer @shared cpuVBR ; after calling grab_system: contains CPU VBR register + bool @shared isPAL ; after calling grab_system: is true when system is PAL, false if NTSC + + private pointer @shared savedView ; original graphics view pointer + private uword @shared savedDMACON ; original DMA control with SET/CLR bit + private uword @shared savedINTENA ; original interrupt enable with SET/CLR bit + private uword @shared savedADKCON ; original ADK control with SET/CLR bit + private pointer @shared savedIRQ1 ; original IRQ1 vector + private pointer @shared savedIRQ3 ; original IRQ3 vector + private pointer @shared savedIRQ4 ; original IRQ4 vector + + + ; ========== AGA palette utilities ========== + + asmsub set_aga_color(ubyte color_index @D0, long rgb24 @D1) clobbers (D0,D1,D2,D3,D4,A0) { + ; Write a 24-bit RGB color ($00RRGGBB) to an AGA palette entry. + ; AGA uses eight banks of 32 COLOR registers and two writes per color: + ; first the upper nibble of each channel, then the lower nibble. + ; Keep this routine 68000-compatible: the amiga500 target is assembled as + ; 68000 by default, even though AGA hardware is normally paired with a 68020. + %asm {{ + and.l #$ff,d0 + move.l d0,d4 + lsr.w #5,d4 + lsl.w #8,d4 + lsl.w #5,d4 + + and.w #$1f,d0 + lsl.w #1,d0 + move.l #$dff180,a0 + adda.w d0,a0 + + move.l d1,d2 + and.l #$f00000,d2 + lsr.l #8,d2 + lsr.l #4,d2 + move.l d1,d3 + and.l #$00f000,d3 + lsr.l #8,d3 + or.w d3,d2 + move.l d1,d3 + and.l #$0000f0,d3 + lsr.l #4,d3 + or.w d3,d2 + + move.l d1,d3 + and.l #$0f0000,d3 + lsr.l #8,d3 + move.l d1,d0 + and.l #$000f00,d0 + lsr.l #4,d0 + or.w d0,d3 + move.l d1,d0 + and.l #$00000f,d0 + or.w d0,d3 + + move.w d4,custom.BPLCON3 + move.w d2,(a0) + ori.w #$0200,d4 + move.w d4,custom.BPLCON3 + move.w d3,(a0) + andi.w #$fdff,d4 + move.w d4,custom.BPLCON3 + rts + }} + } + + asmsub set_aga_color_nibbles(ubyte color_index @D0, uword rgb_high_nibbles @D1, uword rgb_low_nibbles @D2) clobbers (D0,D1,D2,D3,A0) { + ; Write preformatted AGA palette nibbles. Each value is $0RGB. Result will still be 24 bit RRGGBB AGA color. + ; Keep this routine 68000-compatible: the amiga500 target is assembled as + ; 68000 by default, even though AGA hardware is normally paired with a 68020. + %asm {{ + and.l #$ff,d0 + move.l d0,d3 + lsr.w #5,d3 + lsl.w #8,d3 + lsl.w #5,d3 + + and.w #$1f,d0 + lsl.w #1,d0 + move.l #$dff180,a0 + adda.w d0,a0 + + move.w d3,custom.BPLCON3 + move.w d1,(a0) + ori.w #$0200,d3 + move.w d3,custom.BPLCON3 + move.w d2,(a0) + andi.w #$fdff,d3 + move.w d3,custom.BPLCON3 + rts + }} + } + + ; ========== audio filter ======= + + asmsub filter_on() { + ; ENABLE Audio Filter (Muffled audio / Dimmed Power LED) + %asm {{ + bclr #1,custom.CIAA_PRA ; Set Bit 1 to LOW -> Filter ON + rts + }} + } + + asmsub filter_off() { + ; DISABLE Audio Filter (Clear, crisp audio / Bright Power LED) + %asm {{ + bset #1,custom.CIAA_PRA ; Set Bit 1 to HIGH -> Filter OFF + rts + }} + } + + ; ========== mouse button status ========== + + sub left_button() -> bool { + ; Returns true if the left mouse button (port 1) is pressed. + ; Left button is CIA-A PRA bit 6, active low. + return (custom.CIAA_PRA & %01000000) == 0 + } + + sub right_button() -> bool { + ; Returns true if the right mouse button (port 1) is pressed. + ; Right button is POTGOR ($dff016) bit 10, active low. + return (custom.POTGOR & %0000010000000000) == 0 + } + + sub middle_button() -> bool { + ; Returns true if the middle mouse button (port 1) is pressed. + ; Middle button is POTGOR ($dff016) bit 8, active low. + return (custom.POTGOR & %0000000100000000) == 0 + } + + + ; Amiga custom chip registers (full addresses, base $dff000) + ; Regenerated from https://github.com/alfishe/amiga-bootcamp/blob/main/14_references/custom_chip_registers.md + ; All registers are 16-bit words accessed on even byte boundaries. + + ; ========== Read-only registers ========== + + &uword BLTDDAT = $dff000 ; blitter destination early read + &uword DMACONR = $dff002 ; DMA control read + &uword VPOSR = $dff004 ; beam position (V high bits + LOF) + &uword VHPOSR = $dff006 ; beam position (V low + H) + &uword DSKDATR = $dff008 ; disk data early read + &uword JOY0DAT = $dff00a ; joystick/mouse port 0 + &uword JOY1DAT = $dff00c ; joystick/mouse port 1 + &uword CLXDAT = $dff00e ; collision detection + &uword ADKCONR = $dff010 ; audio/disk control read + &uword POT0DAT = $dff012 ; pot port 0 data + &uword POT1DAT = $dff014 ; pot port 1 data + &uword POTGOR = $dff016 ; pot port data read + &uword SERDATR = $dff018 ; serial port data + status + &uword DSKBYTR = $dff01a ; disk data byte + status + &uword INTENAR = $dff01c ; interrupt enable read + &uword INTREQR = $dff01e ; interrupt request read + + ; ========== Write / Read-Write registers ========== + + ; Disk + &uword DSKPTH = $dff020 ; disk DMA pointer (high) + &uword DSKPTL = $dff022 ; disk DMA pointer (low) + &pointer DSKPT = $dff020 ; disk DMA pointer (full 32-bit, hi/lo auto-increment) + &uword DSKLEN = $dff024 ; disk DMA length + &uword DSKDAT = $dff026 ; disk DMA data write + &uword REFPTR = $dff028 ; refresh pointer + + ; Beam position (write) + &uword VPOSW = $dff02a ; beam position write (V) + &uword VHPOSW = $dff02c ; beam position write (H) + &uword COPCON = $dff02e ; copper control + + ; Serial + &uword SERDAT = $dff030 ; serial port data write + &uword SERPER = $dff032 ; serial port period/control + + ; Pot/Game + &uword POTGO = $dff034 ; pot port control + &uword JOYTEST = $dff036 ; joystick counter test + &uword STREQU = $dff038 ; short frame strobe (ECS) + &uword STRVBL = $dff03a ; vertical blank strobe (ECS) + &uword STRHOR = $dff03c ; horizontal sync strobe (ECS) + &uword STRLONG = $dff03e ; long frame strobe (ECS) + + ; Blitter + &uword BLTCON0 = $dff040 ; blitter control 0 + &uword BLTCON1 = $dff042 ; blitter control 1 + &uword BLTAFWM = $dff044 ; blitter A first word mask + &uword BLTALWM = $dff046 ; blitter A last word mask + &uword BLTCPTH = $dff048 ; blitter C pointer (high) + &uword BLTCPTL = $dff04a ; blitter C pointer (low) + &pointer BLTCPT = $dff048 ; blitter C pointer (full 32-bit, hi/lo auto-increment) + &uword BLTBPTH = $dff04c ; blitter B pointer (high) + &uword BLTBPTL = $dff04e ; blitter B pointer (low) + &pointer BLTBPT = $dff04c ; blitter B pointer (full 32-bit, hi/lo auto-increment) + &uword BLTAPTH = $dff050 ; blitter A pointer (high) + &uword BLTAPTL = $dff052 ; blitter A pointer (low) + &pointer BLTAPT = $dff050 ; blitter A pointer (full 32-bit, hi/lo auto-increment) + &uword BLTDPTH = $dff054 ; blitter D pointer (high) + &uword BLTDPTL = $dff056 ; blitter D pointer (low) + &pointer BLTDPT = $dff054 ; blitter D pointer (full 32-bit, hi/lo auto-increment) + &uword BLTSIZE = $dff058 ; blitter size (starts blit) + &uword BLTCON0L = $dff05a ; blitter control 0 (lower bits, ECS) + &uword BLTSIZV = $dff05c ; blitter V size (ECS) + &uword BLTSIZH = $dff05e ; blitter H size (ECS, starts blit) + &uword BLTCMOD = $dff060 ; blitter C modulo + &uword BLTBMOD = $dff062 ; blitter B modulo + &uword BLTAMOD = $dff064 ; blitter A modulo + &uword BLTDMOD = $dff066 ; blitter D modulo + &uword BLTCDAT = $dff070 ; blitter C data + &uword BLTBDAT = $dff072 ; blitter B data + &uword BLTADAT = $dff074 ; blitter A data + &uword SPRHDAT = $dff078 ; ext sprite data (ECS) + &uword DENISEID = $dff07c ; Denise/Lisa chip ID (ECS/AGA) + &uword DSKSYNC = $dff07e ; disk sync pattern + + ; Copper + &uword COP1LCH = $dff080 ; copper 1 list pointer (high) + &uword COP1LCL = $dff082 ; copper 1 list pointer (low) + &pointer COP1LC = $dff080 ; copper 1 list pointer (full 32-bit, hi/lo auto-increment) + &uword COP2LCH = $dff084 ; copper 2 list pointer (high) + &uword COP2LCL = $dff086 ; copper 2 list pointer (low) + &pointer COP2LC = $dff084 ; copper 2 list pointer (full 32-bit, hi/lo auto-increment) + &uword COPJMP1 = $dff088 ; copper jump strobe 1 + &uword COPJMP2 = $dff08a ; copper jump strobe 2 + &uword COPINS = $dff08c ; copper instruction fetch + + ; Display window / data fetch + &uword DIWSTRT = $dff08e ; display window start + &uword DIWSTOP = $dff090 ; display window stop + &uword DDFSTRT = $dff092 ; data fetch start + &uword DDFSTOP = $dff094 ; data fetch stop + + ; Control registers + &uword DMACON = $dff096 ; DMA control write + &uword CLXCON = $dff098 ; collision control + &uword INTENA = $dff09a ; interrupt enable + &uword INTREQ = $dff09c ; interrupt request + &uword ADKCON = $dff09e ; audio/disk control + + ; ========== Audio channels ========== + + &uword AUD0PTH = $dff0a0 ; audio 0 pointer (high) + &uword AUD0PTL = $dff0a2 ; audio 0 pointer (low) + &pointer AUD0PT = $dff0a0 ; audio 0 pointer (full 32-bit, hi/lo auto-increment) + &uword AUD0LEN = $dff0a4 ; audio 0 length + &uword AUD0PER = $dff0a6 ; audio 0 period + &uword AUD0VOL = $dff0a8 ; audio 0 volume + &uword AUD0DAT = $dff0aa ; audio 0 sample data + + &uword AUD1PTH = $dff0b0 ; audio 1 pointer (high) + &uword AUD1PTL = $dff0b2 ; audio 1 pointer (low) + &pointer AUD1PT = $dff0b0 ; audio 1 pointer (full 32-bit, hi/lo auto-increment) + &uword AUD1LEN = $dff0b4 ; audio 1 length + &uword AUD1PER = $dff0b6 ; audio 1 period + &uword AUD1VOL = $dff0b8 ; audio 1 volume + &uword AUD1DAT = $dff0ba ; audio 1 sample data + + &uword AUD2PTH = $dff0c0 ; audio 2 pointer (high) + &uword AUD2PTL = $dff0c2 ; audio 2 pointer (low) + &pointer AUD2PT = $dff0c0 ; audio 2 pointer (full 32-bit, hi/lo auto-increment) + &uword AUD2LEN = $dff0c4 ; audio 2 length + &uword AUD2PER = $dff0c6 ; audio 2 period + &uword AUD2VOL = $dff0c8 ; audio 2 volume + &uword AUD2DAT = $dff0ca ; audio 2 sample data + + &uword AUD3PTH = $dff0d0 ; audio 3 pointer (high) + &uword AUD3PTL = $dff0d2 ; audio 3 pointer (low) + &pointer AUD3PT = $dff0d0 ; audio 3 pointer (full 32-bit, hi/lo auto-increment) + &uword AUD3LEN = $dff0d4 ; audio 3 length + &uword AUD3PER = $dff0d6 ; audio 3 period + &uword AUD3VOL = $dff0d8 ; audio 3 volume + &uword AUD3DAT = $dff0da ; audio 3 sample data + + ; ========== Bitplane pointers ========== + + &uword BPL1PTH = $dff0e0 ; bitplane 1 pointer (high) + &uword BPL1PTL = $dff0e2 ; bitplane 1 pointer (low) + &pointer BPL1PT = $dff0e0 ; bitplane 1 pointer (full 32-bit, hi/lo auto-increment) + &uword BPL2PTH = $dff0e4 ; bitplane 2 pointer (high) + &uword BPL2PTL = $dff0e6 ; bitplane 2 pointer (low) + &pointer BPL2PT = $dff0e4 ; bitplane 2 pointer (full 32-bit, hi/lo auto-increment) + &uword BPL3PTH = $dff0e8 ; bitplane 3 pointer (high) + &uword BPL3PTL = $dff0ea ; bitplane 3 pointer (low) + &pointer BPL3PT = $dff0e8 ; bitplane 3 pointer (full 32-bit, hi/lo auto-increment) + &uword BPL4PTH = $dff0ec ; bitplane 4 pointer (high) + &uword BPL4PTL = $dff0ee ; bitplane 4 pointer (low) + &pointer BPL4PT = $dff0ec ; bitplane 4 pointer (full 32-bit, hi/lo auto-increment) + &uword BPL5PTH = $dff0f0 ; bitplane 5 pointer (high) + &uword BPL5PTL = $dff0f2 ; bitplane 5 pointer (low) + &pointer BPL5PT = $dff0f0 ; bitplane 5 pointer (full 32-bit, hi/lo auto-increment) + &uword BPL6PTH = $dff0f4 ; bitplane 6 pointer (high) + &uword BPL6PTL = $dff0f6 ; bitplane 6 pointer (low) + &pointer BPL6PT = $dff0f4 ; bitplane 6 pointer (full 32-bit, hi/lo auto-increment) + &uword BPL7PTH = $dff0f8 ; bitplane 7 pointer (high) + &uword BPL7PTL = $dff0fa ; bitplane 7 pointer (low) + &pointer BPL7PT = $dff0f8 ; bitplane 7 pointer (full 32-bit, hi/lo auto-increment) + &uword BPL8PTH = $dff0fc ; bitplane 8 pointer (high) + &uword BPL8PTL = $dff0fe ; bitplane 8 pointer (low) + &pointer BPL8PT = $dff0fc ; bitplane 8 pointer (full 32-bit, hi/lo auto-increment) + + ; ========== Bitplane control ========== + + &uword BPLCON0 = $dff100 ; bitplane control 0 + &uword BPLCON1 = $dff102 ; bitplane control 1 (scroll) + &uword BPLCON2 = $dff104 ; bitplane control 2 (priority) + &uword BPLCON3 = $dff106 ; bitplane control 3 (AGA) + &uword BPL1MOD = $dff108 ; bitplane modulo (odd planes) + &uword BPL2MOD = $dff10a ; bitplane modulo (even planes) + &uword BPLCON4 = $dff10c ; bitplane control 4 (AGA) + + &uword BPL1DAT = $dff110 ; bitplane 1 data + &uword BPL2DAT = $dff112 ; bitplane 2 data + &uword BPL3DAT = $dff114 ; bitplane 3 data + &uword BPL4DAT = $dff116 ; bitplane 4 data + &uword BPL5DAT = $dff118 ; bitplane 5 data + &uword BPL6DAT = $dff11a ; bitplane 6 data + &uword BPL7DAT = $dff11c ; bitplane 7 data + &uword BPL8DAT = $dff11e ; bitplane 8 data + + ; ========== Sprite pointers ========== + + &uword SPR0PTH = $dff120 ; sprite 0 pointer (high) + &uword SPR0PTL = $dff122 ; sprite 0 pointer (low) + &pointer SPR0PT = $dff120 ; sprite 0 pointer (full 32-bit, hi/lo auto-increment) + &uword SPR1PTH = $dff124 ; sprite 1 pointer (high) + &uword SPR1PTL = $dff126 ; sprite 1 pointer (low) + &pointer SPR1PT = $dff124 ; sprite 1 pointer (full 32-bit, hi/lo auto-increment) + &uword SPR2PTH = $dff128 ; sprite 2 pointer (high) + &uword SPR2PTL = $dff12a ; sprite 2 pointer (low) + &pointer SPR2PT = $dff128 ; sprite 2 pointer (full 32-bit, hi/lo auto-increment) + &uword SPR3PTH = $dff12c ; sprite 3 pointer (high) + &uword SPR3PTL = $dff12e ; sprite 3 pointer (low) + &pointer SPR3PT = $dff12c ; sprite 3 pointer (full 32-bit, hi/lo auto-increment) + &uword SPR4PTH = $dff130 ; sprite 4 pointer (high) + &uword SPR4PTL = $dff132 ; sprite 4 pointer (low) + &pointer SPR4PT = $dff130 ; sprite 4 pointer (full 32-bit, hi/lo auto-increment) + &uword SPR5PTH = $dff134 ; sprite 5 pointer (high) + &uword SPR5PTL = $dff136 ; sprite 5 pointer (low) + &pointer SPR5PT = $dff134 ; sprite 5 pointer (full 32-bit, hi/lo auto-increment) + &uword SPR6PTH = $dff138 ; sprite 6 pointer (high) + &uword SPR6PTL = $dff13a ; sprite 6 pointer (low) + &pointer SPR6PT = $dff138 ; sprite 6 pointer (full 32-bit, hi/lo auto-increment) + &uword SPR7PTH = $dff13c ; sprite 7 pointer (high) + &uword SPR7PTL = $dff13e ; sprite 7 pointer (low) + &pointer SPR7PT = $dff13c ; sprite 7 pointer (full 32-bit, hi/lo auto-increment) + + ; ========== Sprite data ========== + + &uword SPR0POS = $dff140 ; sprite 0 position + &uword SPR0CTL = $dff142 ; sprite 0 control + &uword SPR0DATA = $dff144 ; sprite 0 data A + &uword SPR0DATB = $dff146 ; sprite 0 data B + &uword SPR1POS = $dff148 ; sprite 1 position + &uword SPR1CTL = $dff14a ; sprite 1 control + &uword SPR1DATA = $dff14c ; sprite 1 data A + &uword SPR1DATB = $dff14e ; sprite 1 data B + &uword SPR2POS = $dff150 ; sprite 2 position + &uword SPR2CTL = $dff152 ; sprite 2 control + &uword SPR2DATA = $dff154 ; sprite 2 data A + &uword SPR2DATB = $dff156 ; sprite 2 data B + &uword SPR3POS = $dff158 ; sprite 3 position + &uword SPR3CTL = $dff15a ; sprite 3 control + &uword SPR3DATA = $dff15c ; sprite 3 data A + &uword SPR3DATB = $dff15e ; sprite 3 data B + &uword SPR4POS = $dff160 ; sprite 4 position + &uword SPR4CTL = $dff162 ; sprite 4 control + &uword SPR4DATA = $dff164 ; sprite 4 data A + &uword SPR4DATB = $dff166 ; sprite 4 data B + &uword SPR5POS = $dff168 ; sprite 5 position + &uword SPR5CTL = $dff16a ; sprite 5 control + &uword SPR5DATA = $dff16c ; sprite 5 data A + &uword SPR5DATB = $dff16e ; sprite 5 data B + &uword SPR6POS = $dff170 ; sprite 6 position + &uword SPR6CTL = $dff172 ; sprite 6 control + &uword SPR6DATA = $dff174 ; sprite 6 data A + &uword SPR6DATB = $dff176 ; sprite 6 data B + &uword SPR7POS = $dff178 ; sprite 7 position + &uword SPR7CTL = $dff17a ; sprite 7 control + &uword SPR7DATA = $dff17c ; sprite 7 data A + &uword SPR7DATB = $dff17e ; sprite 7 data B + + ; ========== Color palette ========== + + &uword COLOR00 = $dff180 ; color 0 (background) + &uword COLOR01 = $dff182 + &uword COLOR02 = $dff184 + &uword COLOR03 = $dff186 + &uword COLOR04 = $dff188 + &uword COLOR05 = $dff18a + &uword COLOR06 = $dff18c + &uword COLOR07 = $dff18e + &uword COLOR08 = $dff190 + &uword COLOR09 = $dff192 + &uword COLOR10 = $dff194 + &uword COLOR11 = $dff196 + &uword COLOR12 = $dff198 + &uword COLOR13 = $dff19a + &uword COLOR14 = $dff19c + &uword COLOR15 = $dff19e + &uword COLOR16 = $dff1a0 + &uword COLOR17 = $dff1a2 + &uword COLOR18 = $dff1a4 + &uword COLOR19 = $dff1a6 + &uword COLOR20 = $dff1a8 + &uword COLOR21 = $dff1aa + &uword COLOR22 = $dff1ac + &uword COLOR23 = $dff1ae + &uword COLOR24 = $dff1b0 + &uword COLOR25 = $dff1b2 + &uword COLOR26 = $dff1b4 + &uword COLOR27 = $dff1b6 + &uword COLOR28 = $dff1b8 + &uword COLOR29 = $dff1ba + &uword COLOR30 = $dff1bc + &uword COLOR31 = $dff1be + + ; ========== ECS/AGA extended registers ========== + + &uword HTOTAL = $dff1c0 ; H total (ECS) + &uword HSSTOP = $dff1c2 ; H sync stop (ECS) + &uword HBSTRT = $dff1c4 ; H blank start (ECS) + &uword HBSTOP = $dff1c6 ; H blank stop (ECS) + &uword VTOTAL = $dff1c8 ; V total (ECS) + &uword VSSTOP = $dff1ca ; V sync stop (ECS) + &uword VBSTRT = $dff1cc ; V blank start (ECS) + &uword VBSTOP = $dff1ce ; V blank stop (ECS) + &uword SPRHSTRT = $dff1d0 ; sprite horizontal start (AGA) + &uword SPRHSTOP = $dff1d2 ; sprite horizontal stop (AGA) + &uword BPLHSTRT = $dff1d4 ; bitplane horizontal start (AGA) + &uword BPLHSTOP = $dff1d6 ; bitplane horizontal stop (AGA) + &uword HHPOSW = $dff1d8 ; horizontal hardware position write (AGA) + &uword HHPOSR = $dff1da ; horizontal hardware position read (AGA) + &uword BEAMCON0 = $dff1dc ; beam counter control (ECS) + &uword HSSTRT = $dff1de ; H sync start (ECS) + &uword VSSTRT = $dff1e0 ; V sync start (ECS) + &uword DIWHIGH = $dff1e4 ; display window high bits (ECS) + &uword FMODE = $dff1fc ; fetch mode (AGA) + + ; ========== Blitter minterm constants ========== + + const uword ABC = $80 ; A and B and C + const uword ABNC = $40 ; A and B and not C + const uword ANBC = $20 ; A and not B and C + const uword ANBNC = $10 ; A and not B and not C + const uword NABC = $8 ; not A and B and C + const uword NABNC = $4 ; not A and not B and C + const uword NANBC = $2 ; not A and B and not C + const uword NANBNC = $1 ; not A and not B and not C + + ; Common blitter minterms + const uword MINTERM_COPY = ABC | ABNC | ANBC | NABC ; A (straight copy) + const uword MINTERM_OR = ABC | ABNC | ANBC | NABC | ANBNC | NANBC ; A or B + const uword MINTERM_AND = ABC ; A and B + const uword MINTERM_XOR = ANBC | NABC ; A xor B + const uword MINTERM_NOT = ANBNC | NANBNC ; not A + const uword MINTERM_CLEAR = 0 ; clear all + const uword MINTERM_NOP = ABNC | ANBNC ; no operation + + ; ========== DMA control bits (dmacon) ========== + + const uword DMAF_SETCLR = $8000 + const uword DMAF_AUD0 = $0001 + const uword DMAF_AUD1 = $0002 + const uword DMAF_AUD2 = $0004 + const uword DMAF_AUD3 = $0008 + const uword DMAF_AUDIO = $000f + const uword DMAF_DISK = $0010 + const uword DMAF_SPRITE = $0020 + const uword DMAF_BLITTER = $0040 + const uword DMAF_COPPER = $0080 + const uword DMAF_RASTER = $0100 + const uword DMAF_MASTER = $0200 + const uword DMAF_BLITHOG = $0400 + const uword DMAF_ALL = $01ff + + ; DMA status read bits + const uword DMAF_BLTDONE = $4000 + const uword DMAF_BLTNZERO = $2000 + + ; ========== Interrupt bits (intena/intreq) ========== + + const uword INTF_SETCLR = $8000 + const uword INTF_INTEN = $4000 + const uword INTF_EXTER = $2000 + const uword INTF_DSKSYNC = $1000 + const uword INTF_RBF = $0800 + const uword INTF_AUD3 = $0400 + const uword INTF_AUD2 = $0200 + const uword INTF_AUD1 = $0100 + const uword INTF_AUD0 = $0080 + const uword INTF_BLIT = $0040 + const uword INTF_VERTB = $0020 + const uword INTF_COPER = $0010 + const uword INTF_PORTS = $0008 + const uword INTF_SOFTINT = $0004 + const uword INTF_DSKBLK = $0002 + const uword INTF_TBE = $0001 + + ; ========== ADK control bits (adkcon) ========== + + const uword ADKF_SETCLR = $8000 + const uword ADKF_PRECOMP1 = $4000 + const uword ADKF_PRECOMP0 = $2000 + const uword ADKF_MFMPREC = $1000 + const uword ADKF_UARTBRK = $0800 + const uword ADKF_WORDSYNC = $0400 + const uword ADKF_MSBSYNC = $0200 + const uword ADKF_FAST = $0100 + const uword ADKF_USE3PN = $0080 + const uword ADKF_USE2P3 = $0040 + const uword ADKF_USE1P2 = $0020 + const uword ADKF_USE0P1 = $0010 + const uword ADKF_USE3VN = $0008 + const uword ADKF_USE2V3 = $0004 + const uword ADKF_USE1V2 = $0002 + const uword ADKF_USE0V1 = $0001 + + ; ========== Blitter control bits (bltcon0) ========== + + const uword BC0F_DEST = $0100 + const uword BC0F_SRCC = $0200 + const uword BC0F_SRCB = $0400 + const uword BC0F_SRCA = $0800 + + ; ========== Blitter control bits (bltcon1) ========== + + const uword BC1F_DESC = $0002 + const uword BC1F_LINEMODE = $0001 + const uword BC1F_FILL_OR = $0008 + const uword BC1F_FILL_XOR = $0010 + const uword BC1F_FILL_CARRYIN = $0004 + const uword BC1F_ONEDOT = $0002 + const uword BC1F_OVFLAG = $0020 + const uword BC1F_SIGNFLAG = $0040 + const uword BC1F_SUD = $0010 + const uword BC1F_SUL = $0008 + const uword BC1F_AUL = $0004 + + ; ========== CIA registers ========== + + ; CIA-A at $bfe001 (odd, accessed on D8-D15) + ; CIA-B at $bfd000 (even, accessed on D0-D7) + ; Each CIA register is spaced $100 apart + + &ubyte CIAA_PRA = $bfe001 ; CIA-A peripheral A (serial data, floppy, keyboard) + &ubyte CIAA_PRB = $bfe101 ; CIA-A peripheral B (parallel port) + &ubyte CIAA_DDRA = $bfe201 ; CIA-A data direction A + &ubyte CIAA_DDRB = $bfe301 ; CIA-A data direction B + &ubyte CIAA_TALO = $bfe401 ; CIA-A timer A low + &ubyte CIAA_TAHI = $bfe501 ; CIA-A timer A high + &ubyte CIAA_TBLO = $bfe601 ; CIA-A timer B low + &ubyte CIAA_TBHI = $bfe701 ; CIA-A timer B high + &ubyte CIAA_TODLOW = $bfe801 ; CIA-A TOD low + &ubyte CIAA_TODMID = $bfe901 ; CIA-A TOD mid + &ubyte CIAA_TODHI = $bfea01 ; CIA-A TOD high + &ubyte CIAA_SDR = $bfec01 ; CIA-A serial data + &ubyte CIAA_ICR = $bfed01 ; CIA-A interrupt control + &ubyte CIAA_CRA = $bfee01 ; CIA-A control A + &ubyte CIAA_CRB = $bfef01 ; CIA-A control B + + &ubyte CIAB_PRA = $bfd000 ; CIA-B peripheral A (RS-232) + &ubyte CIAB_PRB = $bfd100 ; CIA-B peripheral B (printer) + &ubyte CIAB_DDRA = $bfd200 ; CIA-B data direction A + &ubyte CIAB_DDRB = $bfd300 ; CIA-B data direction B + &ubyte CIAB_TALO = $bfd400 ; CIA-B timer A low + &ubyte CIAB_TAHI = $bfd500 ; CIA-B timer A high + &ubyte CIAB_TBLO = $bfd600 ; CIA-B timer B low + &ubyte CIAB_TBHI = $bfd700 ; CIA-B timer B high + &ubyte CIAB_TODLOW = $bfd800 ; CIA-B TOD low + &ubyte CIAB_TODMID = $bfd900 ; CIA-B TOD mid + &ubyte CIAB_TODHI = $bfda00 ; CIA-B TOD high + &ubyte CIAB_SDR = $bfdc00 ; CIA-B serial data + &ubyte CIAB_ICR = $bfdd00 ; CIA-B interrupt control + &ubyte CIAB_CRA = $bfde00 ; CIA-B control A + &ubyte CIAB_CRB = $bfdf00 ; CIA-B control B +} diff --git a/compiler/res/prog8lib/shared_amiga_dos.p8 b/compiler/res/prog8lib/shared_amiga_dos.p8 new file mode 100644 index 000000000..ed3b7a106 --- /dev/null +++ b/compiler/res/prog8lib/shared_amiga_dos.p8 @@ -0,0 +1,868 @@ +;; Auto-generated from dos_lib.sfd and dos_lib.i +;; Library base: _DOSBase in prog8: sys.DOSBase +;; Bank: 2 +;; Functions: 161 + +%import exec +%import utility + +dos { + %option merge, no_symbol_prefixing + extsub @bank 2 -30 = Open(str name @D1, long accessMode @D2) -> pointer @D0 + extsub @bank 2 -36 = Close(pointer file @D1) -> long @D0 + extsub @bank 2 -42 = Read(pointer file @D1, pointer buffer @D2, long length @D3) -> long @D0 + extsub @bank 2 -48 = Write(pointer file @D1, pointer buffer @D2, long length @D3) -> long @D0 + extsub @bank 2 -54 = Input() -> pointer @D0 + extsub @bank 2 -60 = Output() -> pointer @D0 + extsub @bank 2 -66 = Seek(pointer file @D1, long position @D2, long offset @D3) -> long @D0 + extsub @bank 2 -72 = DeleteFile(str name @D1) -> long @D0 + extsub @bank 2 -78 = Rename(str oldName @D1, str newName @D2) -> long @D0 + extsub @bank 2 -84 = Lock(str name @D1, long k_type @D2) -> pointer @D0 + extsub @bank 2 -90 = UnLock(pointer lock @D1) + extsub @bank 2 -96 = DupLock(pointer lock @D1) -> pointer @D0 + extsub @bank 2 -102 = Examine(pointer lock @D1, ^^FileInfoBlock fileInfoBlock @D2) -> long @D0 + extsub @bank 2 -108 = ExNext(pointer lock @D1, ^^FileInfoBlock fileInfoBlock @D2) -> long @D0 + extsub @bank 2 -114 = Info(pointer lock @D1, ^^InfoData parameterBlock @D2) -> long @D0 + extsub @bank 2 -120 = CreateDir(str name @D1) -> pointer @D0 + extsub @bank 2 -126 = CurrentDir(pointer lock @D1) -> pointer @D0 + extsub @bank 2 -132 = IoErr() -> long @D0 + extsub @bank 2 -138 = CreateProc(str name @D1, long pri @D2, pointer segList @D3, long stackSize @D4) -> ^^exec.MsgPort @D0 + extsub @bank 2 -144 = Exit(long returnCode @D1) + extsub @bank 2 -150 = LoadSeg(str name @D1) -> pointer @D0 + extsub @bank 2 -156 = UnLoadSeg(pointer seglist @D1) + extsub @bank 2 -174 = DeviceProc(str name @D1) -> ^^exec.MsgPort @D0 + extsub @bank 2 -180 = SetComment(str name @D1, str comment @D2) -> long @D0 + extsub @bank 2 -186 = SetProtection(str name @D1, long protect @D2) -> long @D0 + extsub @bank 2 -192 = DateStamp(^^DateStampStruct date @D1) -> ^^DateStampStruct @D0 + extsub @bank 2 -198 = Delay(long timeout @D1) + extsub @bank 2 -204 = WaitForChar(pointer file @D1, long timeout @D2) -> long @D0 + extsub @bank 2 -210 = ParentDir(pointer lock @D1) -> pointer @D0 + extsub @bank 2 -216 = IsInteractive(pointer file @D1) -> long @D0 + extsub @bank 2 -222 = Execute(str string @D1, pointer file @D2, pointer file2 @D3) -> long @D0 + extsub @bank 2 -228 = AllocDosObject(long k_type @D1, pointer tags @D2) -> pointer @D0 + extsub @bank 2 -234 = FreeDosObject(long k_type @D1, pointer ptr @D2) + extsub @bank 2 -240 = DoPkt(^^exec.MsgPort port @D1, long action @D2, long arg1 @D3, long arg2 @D4, long arg3 @D5, long arg4 @D6, long arg5 @D7) -> long @D0 + extsub @bank 2 -246 = SendPkt(^^DosPacket dp @D1, ^^exec.MsgPort port @D2, ^^exec.MsgPort replyport @D3) + extsub @bank 2 -252 = WaitPkt() -> ^^DosPacket @D0 + extsub @bank 2 -258 = ReplyPkt(^^DosPacket dp @D1, long res1 @D2, long res2 @D3) + extsub @bank 2 -264 = AbortPkt(^^exec.MsgPort port @D1, ^^DosPacket pkt @D2) + extsub @bank 2 -270 = LockRecord(pointer fh @D1, long offset @D2, long length @D3, long mode @D4, long timeout @D5) -> bool @D0 + extsub @bank 2 -276 = LockRecords(pointer recArray @D1, long timeout @D2) -> bool @D0 + extsub @bank 2 -282 = UnLockRecord(pointer fh @D1, long offset @D2, long length @D3) -> bool @D0 + extsub @bank 2 -288 = UnLockRecords(pointer recArray @D1) -> bool @D0 + extsub @bank 2 -294 = SelectInput(pointer fh @D1) -> pointer @D0 + extsub @bank 2 -300 = SelectOutput(pointer fh @D1) -> pointer @D0 + extsub @bank 2 -306 = FGetC(pointer fh @D1) -> long @D0 + extsub @bank 2 -312 = FPutC(pointer fh @D1, long ch @D2) -> long @D0 + extsub @bank 2 -318 = UnGetC(pointer fh @D1, long character @D2) -> long @D0 + extsub @bank 2 -324 = FRead(pointer fh @D1, pointer block @D2, long blocklen @D3, long number @D4) -> long @D0 + extsub @bank 2 -330 = FWrite(pointer fh @D1, pointer block @D2, long blocklen @D3, long number @D4) -> long @D0 + extsub @bank 2 -336 = FGets(pointer fh @D1, str buf @D2, long buflen @D3) -> str @D0 + extsub @bank 2 -342 = FPuts(pointer fh @D1, str k_str @D2) -> long @D0 + extsub @bank 2 -348 = VFWritef(pointer fh @D1, str format @D2, pointer argarray @D3) + extsub @bank 2 -354 = VFPrintf(pointer fh @D1, str format @D2, pointer argarray @D3) -> long @D0 + extsub @bank 2 -360 = Flush(pointer fh @D1) -> long @D0 + extsub @bank 2 -366 = SetVBuf(pointer fh @D1, str buff @D2, long k_type @D3, long size @D4) -> long @D0 + extsub @bank 2 -372 = DupLockFromFH(pointer fh @D1) -> pointer @D0 + extsub @bank 2 -378 = OpenFromLock(pointer lock @D1) -> pointer @D0 + extsub @bank 2 -384 = ParentOfFH(pointer fh @D1) -> pointer @D0 + extsub @bank 2 -390 = ExamineFH(pointer fh @D1, ^^FileInfoBlock fib @D2) -> bool @D0 + extsub @bank 2 -396 = SetFileDate(str name @D1, ^^DateStampStruct date @D2) -> long @D0 + extsub @bank 2 -402 = NameFromLock(pointer lock @D1, str buffer @D2, long len @D3) -> long @D0 + extsub @bank 2 -408 = NameFromFH(pointer fh @D1, str buffer @D2, long len @D3) -> long @D0 + extsub @bank 2 -414 = SplitName(str name @D1, ubyte separator @D2, str buf @D3, word oldpos @D4, long size @D5) -> word @D0 + extsub @bank 2 -420 = SameLock(pointer lock1 @D1, pointer lock2 @D2) -> long @D0 + extsub @bank 2 -426 = SetMode(pointer fh @D1, long mode @D2) -> long @D0 + extsub @bank 2 -432 = ExAll(pointer lock @D1, ^^ExAllData buffer @D2, long size @D3, long data @D4, ^^ExAllControl control @D5) -> long @D0 + extsub @bank 2 -438 = ReadLink(^^exec.MsgPort port @D1, pointer lock @D2, str path @D3, str buffer @D4, long size @D5) -> long @D0 + extsub @bank 2 -444 = MakeLink(str name @D1, long dest @D2, long soft @D3) -> long @D0 + extsub @bank 2 -450 = ChangeMode(long k_type @D1, pointer fh @D2, long newmode @D3) -> long @D0 + extsub @bank 2 -456 = SetFileSize(pointer fh @D1, long pos @D2, long mode @D3) -> long @D0 + extsub @bank 2 -462 = SetIoErr(long result @D1) -> long @D0 + extsub @bank 2 -468 = Fault(long code @D1, str header @D2, str buffer @D3, long len @D4) -> bool @D0 + extsub @bank 2 -474 = PrintFault(long code @D1, str header @D2) -> bool @D0 + extsub @bank 2 -480 = ErrorReport(long code @D1, long k_type @D2, long arg1 @D3, ^^exec.MsgPort device @D4) -> long @D0 + extsub @bank 2 -492 = Cli() -> pointer @D0 + extsub @bank 2 -498 = CreateNewProc(pointer tags @D1) -> ^^Process @D0 + extsub @bank 2 -504 = RunCommand(pointer seg @D1, long stack @D2, str paramptr @D3, long paramlen @D4) -> long @D0 + extsub @bank 2 -510 = GetConsoleTask() -> ^^exec.MsgPort @D0 + extsub @bank 2 -516 = SetConsoleTask(^^exec.MsgPort task @D1) -> ^^exec.MsgPort @D0 + extsub @bank 2 -522 = GetFileSysTask() -> ^^exec.MsgPort @D0 + extsub @bank 2 -528 = SetFileSysTask(^^exec.MsgPort task @D1) -> ^^exec.MsgPort @D0 + extsub @bank 2 -534 = GetArgStr() -> str @D0 + extsub @bank 2 -540 = SetArgStr(str string @D1) -> str @D0 + extsub @bank 2 -546 = FindCliProc(long num @D1) -> ^^Process @D0 + extsub @bank 2 -552 = MaxCli() -> long @D0 + extsub @bank 2 -558 = SetCurrentDirName(str name @D1) -> bool @D0 + extsub @bank 2 -564 = GetCurrentDirName(str buf @D1, long len @D2) -> bool @D0 + extsub @bank 2 -570 = SetProgramName(str name @D1) -> bool @D0 + extsub @bank 2 -576 = GetProgramName(str buf @D1, long len @D2) -> bool @D0 + extsub @bank 2 -582 = SetPrompt(str name @D1) -> bool @D0 + extsub @bank 2 -588 = GetPrompt(str buf @D1, long len @D2) -> bool @D0 + extsub @bank 2 -594 = SetProgramDir(pointer lock @D1) -> pointer @D0 + extsub @bank 2 -600 = GetProgramDir() -> pointer @D0 + extsub @bank 2 -606 = SystemTagList(str command @D1, pointer tags @D2) -> long @D0 + extsub @bank 2 -612 = AssignLock(str name @D1, pointer lock @D2) -> long @D0 + extsub @bank 2 -618 = AssignLate(str name @D1, str path @D2) -> bool @D0 + extsub @bank 2 -624 = AssignPath(str name @D1, str path @D2) -> bool @D0 + extsub @bank 2 -630 = AssignAdd(str name @D1, pointer lock @D2) -> bool @D0 + extsub @bank 2 -636 = RemAssignList(str name @D1, pointer lock @D2) -> long @D0 + extsub @bank 2 -642 = GetDeviceProc(str name @D1, pointer dp @D2) -> pointer @D0 + extsub @bank 2 -648 = FreeDeviceProc(pointer dp @D1) + extsub @bank 2 -654 = LockDosList(long flags @D1) -> pointer @D0 + extsub @bank 2 -660 = UnLockDosList(long flags @D1) + extsub @bank 2 -666 = AttemptLockDosList(long flags @D1) -> pointer @D0 + extsub @bank 2 -672 = RemDosEntry(pointer dlist @D1) -> bool @D0 + extsub @bank 2 -678 = AddDosEntry(pointer dlist @D1) -> long @D0 + extsub @bank 2 -684 = FindDosEntry(pointer dlist @D1, str name @D2, long flags @D3) -> pointer @D0 + extsub @bank 2 -690 = NextDosEntry(pointer dlist @D1, long flags @D2) -> pointer @D0 + extsub @bank 2 -696 = MakeDosEntry(str name @D1, long k_type @D2) -> pointer @D0 + extsub @bank 2 -702 = FreeDosEntry(pointer dlist @D1) + extsub @bank 2 -708 = IsFileSystem(str name @D1) -> bool @D0 + extsub @bank 2 -714 = Format(str filesystem @D1, str volumename @D2, long dostype @D3) -> bool @D0 + extsub @bank 2 -720 = Relabel(str drive @D1, str newname @D2) -> long @D0 + extsub @bank 2 -726 = Inhibit(str name @D1, long onoff @D2) -> long @D0 + extsub @bank 2 -732 = AddBuffers(str name @D1, long number @D2) -> long @D0 + extsub @bank 2 -738 = CompareDates(^^DateStampStruct date1 @D1, ^^DateStampStruct date2 @D2) -> long @D0 + extsub @bank 2 -744 = DateToStr(pointer datetime @D1) -> long @D0 + extsub @bank 2 -750 = StrToDate(pointer datetime @D1) -> long @D0 + extsub @bank 2 -756 = InternalLoadSeg(pointer fh @D0, pointer table @A0, pointer funcarray @A1, pointer stack @A2) -> pointer @D0 + extsub @bank 2 -762 = InternalUnLoadSeg(pointer seglist @D1, pointer freefunc @A1) -> bool @D0 + extsub @bank 2 -768 = NewLoadSeg(str file @D1, pointer tags @D2) -> pointer @D0 + extsub @bank 2 -774 = AddSegment(str name @D1, pointer seg @D2, long system @D3) -> long @D0 + extsub @bank 2 -780 = FindSegment(str name @D1, pointer seg @D2, long system @D3) -> pointer @D0 + extsub @bank 2 -786 = RemSegment(pointer seg @D1) -> long @D0 + extsub @bank 2 -792 = CheckSignal(long mask @D1) -> long @D0 + extsub @bank 2 -798 = ReadArgs(str arg_template @D1, pointer array @D2, pointer args @D3) -> pointer @D0 + extsub @bank 2 -804 = FindArg(str keyword @D1, str arg_template @D2) -> long @D0 + extsub @bank 2 -810 = ReadItem(str name @D1, long maxchars @D2, pointer cSource @D3) -> long @D0 + extsub @bank 2 -816 = StrToLong(str string @D1, pointer value @D2) -> long @D0 + extsub @bank 2 -822 = MatchFirst(str pat @D1, pointer anchor @D2) -> long @D0 + extsub @bank 2 -828 = MatchNext(pointer anchor @D1) -> long @D0 + extsub @bank 2 -834 = MatchEnd(pointer anchor @D1) + extsub @bank 2 -840 = ParsePattern(str pat @D1, pointer patbuf @D2, long patbuflen @D3) -> long @D0 + extsub @bank 2 -846 = MatchPattern(pointer patbuf @D1, str k_str @D2) -> bool @D0 + extsub @bank 2 -858 = FreeArgs(pointer args @D1) + extsub @bank 2 -870 = FilePart(str path @D1) -> str @D0 + extsub @bank 2 -876 = PathPart(str path @D1) -> str @D0 + extsub @bank 2 -882 = AddPart(str dirname @D1, str filename @D2, long size @D3) -> bool @D0 + extsub @bank 2 -888 = StartNotify(pointer notify @D1) -> bool @D0 + extsub @bank 2 -894 = EndNotify(pointer notify @D1) + extsub @bank 2 -900 = SetVar(str name @D1, str buffer @D2, long size @D3, long flags @D4) -> bool @D0 + extsub @bank 2 -906 = GetVar(str name @D1, str buffer @D2, long size @D3, long flags @D4) -> long @D0 + extsub @bank 2 -912 = DeleteVar(str name @D1, long flags @D2) -> long @D0 + extsub @bank 2 -918 = FindVar(str name @D1, long k_type @D2) -> pointer @D0 + extsub @bank 2 -930 = CliInitNewcli(^^DosPacket dp @A0) -> long @D0 + extsub @bank 2 -936 = CliInitRun(^^DosPacket dp @A0) -> long @D0 + extsub @bank 2 -942 = WriteChars(str buf @D1, long buflen @D2) -> long @D0 + extsub @bank 2 -948 = PutStr(str k_str @D1) -> long @D0 + extsub @bank 2 -954 = VPrintf(str format @D1, pointer argarray @D2) -> long @D0 + extsub @bank 2 -966 = ParsePatternNoCase(str pat @D1, pointer patbuf @D2, long patbuflen @D3) -> long @D0 + extsub @bank 2 -972 = MatchPatternNoCase(pointer patbuf @D1, str k_str @D2) -> bool @D0 + extsub @bank 2 -984 = SameDevice(pointer lock1 @D1, pointer lock2 @D2) -> bool @D0 + extsub @bank 2 -990 = ExAllEnd(pointer lock @D1, ^^ExAllData buffer @D2, long size @D3, long data @D4, ^^ExAllControl control @D5) + extsub @bank 2 -996 = SetOwner(str name @D1, long owner_info @D2) -> bool @D0 + extsub @bank 2 -1014 = VolumeRequestHook(str vol @D1) -> long @D0 + extsub @bank 2 -1026 = GetCurrentDir() -> pointer @D0 + extsub @bank 2 -1128 = PutErrStr(str k_str @D1) -> long @D0 + extsub @bank 2 -1134 = ErrorOutput() -> long @D0 + extsub @bank 2 -1140 = SelectError(pointer fh @D1) -> long @D0 + extsub @bank 2 -1152 = DoShellMethodTagList(long method @D0, pointer tags @A0) -> pointer @D0 + extsub @bank 2 -1158 = ScanStackToken(pointer seg @D1, long defaultstack @D2) -> long @D0 + + ; ---- struct definitions ---- + + struct DateStampStruct { ; total size: 12 + long Days ; 0 + long Minute ; 4 + long Tick ; 8 + } + + struct DosPacket { ; total size: 48 + ^^exec.Message Link ; 0 + ^^exec.MsgPort Port ; 4 + long Type ; 8 + long Res1 ; 12 + long Res2 ; 16 + long Arg1 ; 20 + long Arg2 ; 24 + long Arg3 ; 28 + long Arg4 ; 32 + long Arg5 ; 36 + long Arg6 ; 40 + long Arg7 ; 44 + } + + struct ErrorString { ; total size: 8 + pointer Nums ; 0 + str Strings ; 4 + } + + struct ExAllControl { ; total size: 16 + long Entries ; 0 + long LastKey ; 4 + str MatchString ; 8 + ^^utility.Hook MatchFunc ; 12 + } + + struct ExAllData { ; total size: 40 + ^^ExAllData Next ; 0 + str Name ; 4 + long Type ; 8 + long Size ; 12 + long Prot ; 16 + long Days ; 20 + long Mins ; 24 + long Ticks ; 28 + str Comment ; 32 + uword OwnerUID ; 36 + uword OwnerGID ; 38 + } + + struct FileHandle { ; total size: 44 + ^^exec.Message Link ; 0 + ^^exec.MsgPort Port ; 4 + ^^exec.MsgPort Type ; 8 + pointer Buf ; 12 + long Pos ; 16 + long End ; 20 + long Funcs ; 24 + long Func2 ; 28 + long Func3 ; 32 + long Args ; 36 + long Arg2 ; 40 + } + + struct FileInfoBlock { ; total size: 260 + long DiskKey ; 0 + long DirEntryType ; 4 + ubyte[108] FileName ; 8 + long Protection ; 116 + long EntryType ; 120 + long Size ; 124 + long NumBlocks ; 128 + long Days ; 132 + long Minute ; 136 + long Tick ; 140 + ubyte[80] Comment ; 144 + uword OwnerUID ; 224 + uword OwnerGID ; 226 + ubyte[32] Reserved ; 228 + } + + struct FileLock { ; total size: 20 + pointer Link ; 0 + long Key ; 4 + long Access ; 8 + ^^exec.MsgPort Task ; 12 + pointer Volume ; 16 + } + + struct InfoData { ; total size: 36 + long NumSoftErrors ; 0 + long UnitNumber ; 4 + long DiskState ; 8 + long NumBlocks ; 12 + long NumBlocksUsed ; 16 + long BytesPerBlock ; 20 + long DiskType ; 24 + pointer VolumeNode ; 28 + long InUse ; 32 + } + + struct Process { ; total size: 228 + ^^exec.Node Succ ; 0 + ^^exec.Node Pred ; 4 + ubyte Type ; 8 + byte Pri ; 9 + str Name ; 10 + ubyte Flags ; 14 + ubyte State ; 15 + byte IDNestCnt ; 16 + byte TDNestCnt ; 17 + long SigAlloc ; 18 + long SigWait ; 22 + long SigRecvd ; 26 + long SigExcept ; 30 + uword TrapAlloc ; 34 + uword TrapAble ; 36 + pointer ExceptData ; 38 + pointer ExceptCode ; 42 + pointer TrapData ; 46 + pointer TrapCode ; 50 + pointer SPReg ; 54 + pointer SPLower ; 58 + pointer SPUpper ; 62 + pointer Switch ; 66 + pointer Launch ; 70 + ^^exec.Node Head ; 74 + ^^exec.Node Tail ; 78 + ^^exec.Node TailPred ; 82 + ubyte Process_List_Type ; 86 + ubyte Pad ; 87 + pointer UserData ; 88 + ^^exec.Node Node_Succ ; 92 + ^^exec.Node Node_Pred ; 96 + ubyte Node_Type ; 100 + byte Node_Pri ; 101 + str Node_Name ; 102 + ubyte MsgPort_Flags ; 106 + ubyte SigBit ; 107 + pointer SigTask ; 108 + ^^exec.Node List_Head ; 112 + ^^exec.Node List_Tail ; 116 + ^^exec.Node List_TailPred ; 120 + ubyte List_Type ; 124 + ubyte List_Pad ; 125 + word Process_Pad ; 126 + pointer SegList ; 128 + long StackSize ; 132 + pointer GlobVec ; 136 + long TaskNum ; 140 + pointer StackBase ; 144 + long Result2 ; 148 + pointer CurrentDir ; 152 + pointer Cis ; 156 + pointer Cos ; 160 + pointer ConsoleTask ; 164 + pointer FileSystemTask ; 168 + pointer Cli ; 172 + pointer ReturnAddr ; 176 + pointer PktWait ; 180 + pointer WindowPtr ; 184 + pointer HomeDir ; 188 + long Process_Flags ; 192 + pointer ExitCode ; 196 + long ExitData ; 200 + str Arguments ; 204 + ^^exec.MinNode MinList_Head ; 208 + ^^exec.MinNode MinList_Tail ; 212 + ^^exec.MinNode MinList_TailPred ; 216 + long ShellPrivate ; 220 + pointer Ces ; 224 + } + + struct StandardPacket { ; total size: 68 + ^^exec.Node Succ ; 0 + ^^exec.Node Pred ; 4 + ubyte Type ; 8 + byte Pri ; 9 + str Name ; 10 + ^^exec.MsgPort ReplyPort ; 14 + uword Length ; 18 + ^^exec.Message Link ; 20 + ^^exec.MsgPort Port ; 24 + long DosPacket_Type ; 28 + long Res1 ; 32 + long Res2 ; 36 + long Arg1 ; 40 + long Arg2 ; 44 + long Arg3 ; 48 + long Arg4 ; 52 + long Arg5 ; 56 + long Arg6 ; 60 + long Arg7 ; 64 + } + + ; ---- constants ---- + const ubyte LEN_DATSTRING = $0010 + const ubyte DTB_SUBST = 0 + const ubyte DTF_SUBST = $0001 + const ubyte DTB_FUTURE = 1 + const ubyte DTF_FUTURE = $0002 + const ubyte FORMAT_DOS = $0000 + const ubyte FORMAT_INT = $0001 + const ubyte FORMAT_USA = $0002 + const ubyte FORMAT_CDN = $0003 + const ubyte FORMAT_DEF = $0004 + const long DOSTRUE = -1 + const ubyte DOSFALSE = $0000 + const uword MODE_OLDFILE = $03ed + const uword MODE_NEWFILE = $03ee + const uword MODE_READWRITE = $03ec + const long OFFSET_BEGINNING = -1 + const ubyte OFFSET_CURRENT = $0000 + const ubyte OFFSET_END = $0001 + const ubyte BITSPERBYTE = $0008 + const ubyte BYTESPERLONG = $0004 + const ubyte BITSPERLONG = $0020 + const long MAXINT = $7FFFFFFF + const long MININT = $80000000 + const long SHARED_LOCK = -2 + const long ACCESS_READ = -2 + const long EXCLUSIVE_LOCK = -1 + const long ACCESS_WRITE = -1 + const ubyte TICKS_PER_SECOND = $0032 + const ubyte FIBB_OTR_READ = 15 + const uword FIBF_OTR_READ = $8000 + const ubyte FIBB_OTR_WRITE = 14 + const uword FIBF_OTR_WRITE = $4000 + const ubyte FIBB_OTR_EXECUTE = 13 + const uword FIBF_OTR_EXECUTE = $2000 + const ubyte FIBB_OTR_DELETE = 12 + const uword FIBF_OTR_DELETE = $1000 + const ubyte FIBB_GRP_READ = 11 + const uword FIBF_GRP_READ = $0800 + const ubyte FIBB_GRP_WRITE = 10 + const uword FIBF_GRP_WRITE = $0400 + const ubyte FIBB_GRP_EXECUTE = 9 + const uword FIBF_GRP_EXECUTE = $0200 + const ubyte FIBB_GRP_DELETE = 8 + const uword FIBF_GRP_DELETE = $0100 + const ubyte FIBB_HOLD = 7 + const ubyte FIBF_HOLD = $0080 + const ubyte FIBB_SCRIPT = 6 + const ubyte FIBF_SCRIPT = $0040 + const ubyte FIBB_PURE = 5 + const ubyte FIBF_PURE = $0020 + const ubyte FIBB_ARCHIVE = 4 + const ubyte FIBF_ARCHIVE = $0010 + const ubyte FIBB_READ = 3 + const ubyte FIBF_READ = $0008 + const ubyte FIBB_WRITE = 2 + const ubyte FIBF_WRITE = $0004 + const ubyte FIBB_EXECUTE = 1 + const ubyte FIBF_EXECUTE = $0002 + const ubyte FIBB_DELETE = 0 + const ubyte FIBF_DELETE = $0001 + const ubyte FAULT_MAX = $0052 + const ubyte ID_WRITE_PROTECTED = $0050 + const ubyte ID_VALIDATING = $0051 + const ubyte ID_VALIDATED = $0052 + const long ID_NO_DISK_PRESENT = -1 + const ubyte ID_UNREADABLE_DISK = $0042 + const ubyte ID_NOT_REALLY_DOS = $004e + const ubyte ID_DOS_DISK = $0044 + const ubyte ID_FFS_DISK = $0044 + const ubyte ID_INTER_DOS_DISK = $0044 + const ubyte ID_INTER_FFS_DISK = $0044 + const ubyte ID_FASTDIR_DOS_DISK = $0044 + const ubyte ID_FASTDIR_FFS_DISK = $0044 + const ubyte ID_LONG_DOS_DISK = $0044 + const ubyte ID_LONG_FFS_DISK = $0044 + const ubyte ID_COMPLONG_FFS_DISK = $0044 + const ubyte ID_KICKSTART_DISK = $004b + const ubyte ID_MSDOS_DISK = $004d + const ubyte ERROR_NO_FREE_STORE = $0067 + const ubyte ERROR_TASK_TABLE_FULL = $0069 + const ubyte ERROR_BAD_TEMPLATE = $0072 + const ubyte ERROR_BAD_NUMBER = $0073 + const ubyte ERROR_REQUIRED_ARG_MISSING = $0074 + const ubyte ERROR_KEY_NEEDS_ARG = $0075 + const ubyte ERROR_TOO_MANY_ARGS = $0076 + const ubyte ERROR_UNMATCHED_QUOTES = $0077 + const ubyte ERROR_LINE_TOO_LONG = $0078 + const ubyte ERROR_FILE_NOT_OBJECT = $0079 + const ubyte ERROR_INVALID_RESIDENT_LIBRARY = $007a + const ubyte ERROR_NO_DEFAULT_DIR = $00c9 + const ubyte ERROR_OBJECT_IN_USE = $00ca + const ubyte ERROR_OBJECT_EXISTS = $00cb + const ubyte ERROR_DIR_NOT_FOUND = $00cc + const ubyte ERROR_OBJECT_NOT_FOUND = $00cd + const ubyte ERROR_BAD_STREAM_NAME = $00ce + const ubyte ERROR_OBJECT_TOO_LARGE = $00cf + const ubyte ERROR_ACTION_NOT_KNOWN = $00d1 + const ubyte ERROR_INVALID_COMPONENT_NAME = $00d2 + const ubyte ERROR_INVALID_LOCK = $00d3 + const ubyte ERROR_OBJECT_WRONG_TYPE = $00d4 + const ubyte ERROR_DISK_NOT_VALIDATED = $00d5 + const ubyte ERROR_DISK_WRITE_PROTECTED = $00d6 + const ubyte ERROR_RENAME_ACROSS_DEVICES = $00d7 + const ubyte ERROR_DIRECTORY_NOT_EMPTY = $00d8 + const ubyte ERROR_TOO_MANY_LEVELS = $00d9 + const ubyte ERROR_DEVICE_NOT_MOUNTED = $00da + const ubyte ERROR_SEEK_ERROR = $00db + const ubyte ERROR_COMMENT_TOO_BIG = $00dc + const ubyte ERROR_DISK_FULL = $00dd + const ubyte ERROR_DELETE_PROTECTED = $00de + const ubyte ERROR_WRITE_PROTECTED = $00df + const ubyte ERROR_READ_PROTECTED = $00e0 + const ubyte ERROR_NOT_A_DOS_DISK = $00e1 + const ubyte ERROR_NO_DISK = $00e2 + const ubyte ERROR_NO_MORE_ENTRIES = $00e8 + const ubyte ERROR_IS_SOFT_LINK = $00e9 + const ubyte ERROR_OBJECT_LINKED = $00ea + const ubyte ERROR_BAD_HUNK = $00eb + const ubyte ERROR_NOT_IMPLEMENTED = $00ec + const ubyte ERROR_RECORD_NOT_LOCKED = $00f0 + const ubyte ERROR_LOCK_COLLISION = $00f1 + const ubyte ERROR_LOCK_TIMEOUT = $00f2 + const ubyte ERROR_UNLOCK_ERROR = $00f3 + const ubyte RETURN_OK = $0000 + const ubyte RETURN_WARN = $0005 + const ubyte RETURN_ERROR = $000a + const ubyte RETURN_FAIL = $0014 + const ubyte SIGBREAKB_CTRL_C = 12 + const uword SIGBREAKF_CTRL_C = $1000 + const ubyte SIGBREAKB_CTRL_D = 13 + const uword SIGBREAKF_CTRL_D = $2000 + const ubyte SIGBREAKB_CTRL_E = 14 + const uword SIGBREAKF_CTRL_E = $4000 + const ubyte SIGBREAKB_CTRL_F = 15 + const uword SIGBREAKF_CTRL_F = $8000 + const long LOCK_DIFFERENT = -1 + const ubyte LOCK_SAME = $0000 + const ubyte LOCK_SAME_VOLUME = $0001 + const ubyte CHANGE_LOCK = $0000 + const ubyte CHANGE_FH = $0001 + const ubyte LINK_HARD = $0000 + const ubyte LINK_SOFT = $0001 + const long ITEM_EQUAL = -2 + const long ITEM_ERROR = -1 + const ubyte ITEM_NOTHING = $0000 + const ubyte ITEM_UNQUOTED = $0001 + const ubyte ITEM_QUOTED = $0002 + const ubyte DOS_FILEHANDLE = $0000 + const ubyte DOS_EXALLCONTROL = $0001 + const ubyte DOS_FIB = $0002 + const ubyte DOS_STDPKT = $0003 + const ubyte DOS_CLI = $0004 + const ubyte DOS_RDARGS = $0005 + const ubyte reserve = $0004 + const ubyte vsize = $0006 + const ubyte APB_DOWILD = 0 + const ubyte APF_DOWILD = $0001 + const ubyte APB_ITSWILD = 1 + const ubyte APF_ITSWILD = $0002 + const ubyte APB_DODIR = 2 + const ubyte APF_DODIR = $0004 + const ubyte APB_DIDDIR = 3 + const ubyte APF_DIDDIR = $0008 + const ubyte APB_NOMEMERR = 4 + const ubyte APF_NOMEMERR = $0010 + const ubyte APB_DODOT = 5 + const ubyte APF_DODOT = $0020 + const ubyte APB_DirChanged = 6 + const ubyte APF_DirChanged = $0040 + const ubyte APB_FollowHLinks = 7 + const ubyte APF_FollowHLinks = $0080 + const ubyte DDB_PatternBit = 0 + const ubyte DDF_PatternBit = $0001 + const ubyte DDB_ExaminedBit = 1 + const ubyte DDF_ExaminedBit = $0002 + const ubyte DDB_Completed = 2 + const ubyte DDF_Completed = $0004 + const ubyte DDB_AllBit = 3 + const ubyte DDF_AllBit = $0008 + const ubyte DDB_SINGLE = 4 + const ubyte DDF_SINGLE = $0010 + const ubyte P_ANY = $80 + const ubyte P_SINGLE = $81 + const ubyte P_ORSTART = $82 + const ubyte P_ORNEXT = $83 + const ubyte P_OREND = $84 + const ubyte P_NOT = $85 + const ubyte P_NOTEND = $86 + const ubyte P_NOTCLASS = $87 + const ubyte P_CLASS = $88 + const ubyte P_REPBEG = $89 + const ubyte P_REPEND = $8A + const ubyte P_STOP = $8B + const ubyte COMPLEX_BIT = $0001 + const ubyte EXAMINE_BIT = $0002 + const uword ERROR_BUFFER_OVERFLOW = $012f + const uword ERROR_BREAK = $0130 + const uword ERROR_NOT_EXECUTABLE = $0131 + const ubyte PRB_FREESEGLIST = 0 + const ubyte PRF_FREESEGLIST = $0001 + const ubyte PRB_FREECURRDIR = 1 + const ubyte PRF_FREECURRDIR = $0002 + const ubyte PRB_FREECLI = 2 + const ubyte PRF_FREECLI = $0004 + const ubyte PRB_CLOSEINPUT = 3 + const ubyte PRF_CLOSEINPUT = $0008 + const ubyte PRB_CLOSEOUTPUT = 4 + const ubyte PRF_CLOSEOUTPUT = $0010 + const ubyte PRB_FREEARGS = 5 + const ubyte PRF_FREEARGS = $0020 + const ubyte PRB_CLOSEERROR = 6 + const ubyte PRF_CLOSEERROR = $0040 + const ubyte ACTION_NIL = $0000 + const ubyte ACTION_STARTUP = $0000 + const ubyte ACTION_GET_BLOCK = $0002 + const ubyte ACTION_SET_MAP = $0004 + const ubyte ACTION_DIE = $0005 + const ubyte ACTION_EVENT = $0006 + const ubyte ACTION_CURRENT_VOLUME = $0007 + const ubyte ACTION_LOCATE_OBJECT = $0008 + const ubyte ACTION_RENAME_DISK = $0009 + const ubyte ACTION_WRITE = $0057 + const ubyte ACTION_READ = $0052 + const ubyte ACTION_FREE_LOCK = $000f + const ubyte ACTION_DELETE_OBJECT = $0010 + const ubyte ACTION_RENAME_OBJECT = $0011 + const ubyte ACTION_MORE_CACHE = $0012 + const ubyte ACTION_COPY_DIR = $0013 + const ubyte ACTION_WAIT_CHAR = $0014 + const ubyte ACTION_SET_PROTECT = $0015 + const ubyte ACTION_CREATE_DIR = $0016 + const ubyte ACTION_EXAMINE_OBJECT = $0017 + const ubyte ACTION_EXAMINE_NEXT = $0018 + const ubyte ACTION_DISK_INFO = $0019 + const ubyte ACTION_INFO = $001a + const ubyte ACTION_FLUSH = $001b + const ubyte ACTION_SET_COMMENT = $001c + const ubyte ACTION_PARENT = $001d + const ubyte ACTION_TIMER = $001e + const ubyte ACTION_INHIBIT = $001f + const ubyte ACTION_DISK_TYPE = $0020 + const ubyte ACTION_DISK_CHANGE = $0021 + const ubyte ACTION_SET_DATE = $0022 + const uword ACTION_UNDISK_INFO = $0201 + const uword ACTION_SCREEN_MODE = $03e2 + const uword ACTION_READ_RETURN = $03e9 + const uword ACTION_WRITE_RETURN = $03ea + const uword ACTION_SEEK = $03f0 + const uword ACTION_FINDUPDATE = $03ec + const uword ACTION_FINDINPUT = $03ed + const uword ACTION_FINDOUTPUT = $03ee + const uword ACTION_END = $03ef + const uword ACTION_SET_FILE_SIZE = $03fe + const uword ACTION_WRITE_PROTECT = $03ff + const ubyte ACTION_SAME_LOCK = $0028 + const uword ACTION_CHANGE_SIGNAL = $03e3 + const uword ACTION_FORMAT = $03fc + const uword ACTION_MAKE_LINK = $03fd + const uword ACTION_READ_LINK = $0400 + const uword ACTION_FH_FROM_LOCK = $0402 + const uword ACTION_IS_FILESYSTEM = $0403 + const uword ACTION_CHANGE_MODE = $0404 + const uword ACTION_COPY_DIR_FH = $0406 + const uword ACTION_PARENT_FH = $0407 + const uword ACTION_EXAMINE_ALL = $0409 + const uword ACTION_EXAMINE_FH = $040a + const uword ACTION_LOCK_RECORD = $07d8 + const uword ACTION_FREE_RECORD = $07d9 + const uword ACTION_ADD_NOTIFY = $1001 + const uword ACTION_REMOVE_NOTIFY = $1002 + const uword ACTION_EXAMINE_ALL_END = $040b + const uword ACTION_SET_OWNER = $040c + const uword ACTION_SERIALIZE_DISK = $1068 + const ubyte RNB_WILDSTAR = 24 + const long RNF_WILDSTAR = $01000000 + const ubyte RNB_PRIVATE1 = 1 + const ubyte RNF_PRIVATE1 = $0002 + const long CMD_SYSTEM = -1 + const long CMD_INTERNAL = -2 + const long CMD_DISABLED = -999 + const ubyte DLT_DEVICE = $0000 + const ubyte DLT_DIRECTORY = $0001 + const ubyte DLT_VOLUME = $0002 + const ubyte DLT_LATE = $0003 + const ubyte DLT_NONBINDING = $0004 + const long DLT_PRIVATE = -1 + const ubyte DVPB_UNLOCK = 0 + const ubyte DVPF_UNLOCK = $0001 + const ubyte DVPB_ASSIGN = 1 + const ubyte DVPF_ASSIGN = $0002 + const ubyte LDB_DEVICES = 2 + const ubyte LDF_DEVICES = $0004 + const ubyte LDB_VOLUMES = 3 + const ubyte LDF_VOLUMES = $0008 + const ubyte LDB_ASSIGNS = 4 + const ubyte LDF_ASSIGNS = $0010 + const ubyte LDB_ENTRY = 5 + const ubyte LDF_ENTRY = $0020 + const ubyte LDB_DELETE = 6 + const ubyte LDF_DELETE = $0040 + const ubyte LDB_READ = 0 + const ubyte LDF_READ = $0001 + const ubyte LDB_WRITE = 1 + const ubyte LDF_WRITE = $0002 + const ubyte REPORT_STREAM = $0000 + const ubyte REPORT_TASK = $0001 + const ubyte REPORT_LOCK = $0002 + const ubyte REPORT_VOLUME = $0003 + const ubyte REPORT_INSERT = $0004 + const uword ABORT_DISK_ERROR = $0128 + const uword ABORT_BUSY = $0120 + const long RUN_EXECUTE = -1 + const long RUN_SYSTEM = -2 + const long RUN_SYSTEM_ASYNCH = -3 + const ubyte ST_ROOT = $0001 + const ubyte ST_USERDIR = $0002 + const ubyte ST_SOFTLINK = $0003 + const ubyte ST_LINKDIR = $0004 + const long ST_FILE = -3 + const long ST_LINKFILE = -4 + const long ST_PIPEFILE = -5 + const uword HUNK_UNIT = $03e7 + const uword HUNK_NAME = $03e8 + const uword HUNK_CODE = $03e9 + const uword HUNK_DATA = $03ea + const uword HUNK_BSS = $03eb + const uword HUNK_RELOC32 = $03ec + const uword HUNK_RELOC16 = $03ed + const uword HUNK_RELOC8 = $03ee + const uword HUNK_EXT = $03ef + const uword HUNK_SYMBOL = $03f0 + const uword HUNK_DEBUG = $03f1 + const uword HUNK_END = $03f2 + const uword HUNK_HEADER = $03f3 + const uword HUNK_OVERLAY = $03f5 + const uword HUNK_BREAK = $03f6 + const uword HUNK_DREL32 = $03f7 + const uword HUNK_DREL16 = $03f8 + const uword HUNK_DREL8 = $03f9 + const uword HUNK_LIB = $03fa + const uword HUNK_INDEX = $03fb + const uword HUNK_RELOC32SHORT = $03fc + const uword HUNK_RELRELOC32 = $03fd + const uword HUNK_ABSRELOC16 = $03fe + const ubyte HUNKB_ADVISORY = 29 + const long HUNKF_ADVISORY = $20000000 + const ubyte HUNKB_CHIP = 30 + const long HUNKF_CHIP = $40000000 + const ubyte HUNKB_FAST = 31 + const long HUNKF_FAST = $80000000 + const ubyte EXT_SYMB = $0000 + const ubyte EXT_DEF = $0001 + const ubyte EXT_ABS = $0002 + const ubyte EXT_RES = $0003 + const ubyte EXT_COMMONDEF = $0004 + const ubyte EXT_REF32 = $0081 + const ubyte EXT_COMMON = $0082 + const ubyte EXT_REF16 = $0083 + const ubyte EXT_REF8 = $0084 + const ubyte EXT_DEXT32 = $0085 + const ubyte EXT_DEXT16 = $0086 + const ubyte EXT_DEXT8 = $0087 + const ubyte EXT_RELREF32 = $0088 + const ubyte EXT_RELCOMMON = $0089 + const ubyte EXT_ABSREF16 = $008a + const ubyte EXT_ABSREF8 = $008b + const long SYS_Dummy = $80000020 + const long NP_Dummy = $800003e8 + const long ADO_Dummy = $800007d0 + const ubyte ED_NAME = $0001 + const ubyte ED_TYPE = $0002 + const ubyte ED_SIZE = $0003 + const ubyte ED_PROTECTION = $0004 + const ubyte ED_DATE = $0005 + const ubyte ED_COMMENT = $0006 + const ubyte ED_OWNER = $0007 + const ubyte DE_TABLESIZE = $0000 + const ubyte DE_SIZEBLOCK = $0001 + const ubyte DE_SECORG = $0002 + const ubyte DE_NUMHEADS = $0003 + const ubyte DE_SECSPERBLK = $0004 + const ubyte DE_BLKSPERTRACK = $0005 + const ubyte DE_RESERVEDBLKS = $0006 + const ubyte DE_PREFAC = $0007 + const ubyte DE_INTERLEAVE = $0008 + const ubyte DE_LOWCYL = $0009 + const ubyte DE_UPPERCYL = $000a + const ubyte DE_NUMBUFFERS = $000b + const ubyte DE_MEMBUFTYPE = $000c + const ubyte DE_BUFMEMTYPE = $000c + const ubyte DE_MAXTRANSFER = $000d + const ubyte DE_MASK = $000e + const ubyte DE_BOOTPRI = $000f + const ubyte DE_DOSTYPE = $0010 + const ubyte DE_BAUD = $0011 + const ubyte DE_CONTROL = $0012 + const ubyte DE_BOOTBLOCKS = $0013 + const ubyte ENVB_SCSIDIRECT = 16 + const long ENVF_SCSIDIRECT = $00010000 + const ubyte ENVB_SUPERFLOPPY = 17 + const long ENVF_SUPERFLOPPY = $00020000 + const ubyte ENVB_DISABLENSD = 18 + const long ENVF_DISABLENSD = $00040000 + const long NOTIFY_CLASS = $40000000 + const uword NOTIFY_CODE = $1234 + const ubyte NRB_SEND_MESSAGE = 0 + const ubyte NRF_SEND_MESSAGE = $0001 + const ubyte NRB_SEND_SIGNAL = 1 + const ubyte NRF_SEND_SIGNAL = $0002 + const ubyte NRB_WAIT_REPLY = 3 + const ubyte NRF_WAIT_REPLY = $0008 + const ubyte NRB_NOTIFY_INITIAL = 4 + const ubyte NRF_NOTIFY_INITIAL = $0010 + const ubyte NRB_MAGIC = 31 + const long NRF_MAGIC = $80000000 + const long NR_HANDLER_FLAGS = $ffff0000 + const ubyte RDAB_STDIN = 0 + const ubyte RDAF_STDIN = $0001 + const ubyte RDAB_NOALLOC = 1 + const ubyte RDAF_NOALLOC = $0002 + const ubyte RDAB_NOPROMPT = 2 + const ubyte RDAF_NOPROMPT = $0004 + const ubyte MAX_TEMPLATE_ITEMS = $0064 + const ubyte MAX_MULTIARGS = $0080 + const ubyte REC_EXCLUSIVE = $0000 + const ubyte REC_EXCLUSIVE_IMMED = $0001 + const ubyte REC_SHARED = $0002 + const ubyte REC_SHARED_IMMED = $0003 + const long SHELL_DUMMY = $80000bb8 + const ubyte DOS_STDIO_I = $0001 + const ubyte BUF_LINE = $0000 + const ubyte BUF_FULL = $0001 + const ubyte BUF_NONE = $0002 + const long ENDSTREAMCH = -1 + const ubyte LV_VAR = $0000 + const ubyte LV_ALIAS = $0001 + const ubyte LVB_IGNORE = $0007 + const ubyte LVF_IGNORE = $80 + const ubyte GVB_GLOBAL_ONLY = 8 + const uword GVF_GLOBAL_ONLY = $0100 + const ubyte GVB_LOCAL_ONLY = 9 + const uword GVF_LOCAL_ONLY = $0200 + const ubyte GVB_BINARY_VAR = 10 + const uword GVF_BINARY_VAR = $0400 + const ubyte GVB_DONT_NULL_TERM = 11 + const uword GVF_DONT_NULL_TERM = $0800 + const ubyte GVB_SAVE_VAR = 12 + const uword GVF_SAVE_VAR = $1000 + const ubyte FORMAT_MAX = $0003 + const long OFFSET_BEGINING = -1 + const ubyte LOCK_SAME_HANDLER = $0001 + const ubyte LDF_ALL = $001c + const uword HUNK_ABSRELOC32 = $03ec + const uword HUNK_RELRELOC16 = $03ed + const uword HUNK_RELRELOC8 = $03ee + const ubyte EXT_ABSREF32 = $0081 + const ubyte EXT_ABSCOMMON = $0082 + const ubyte EXT_RELREF16 = $0083 + const ubyte EXT_RELREF8 = $0084 + const long SYS_Input = $80000021 + const long SYS_Output = $80000022 + const long SYS_Asynch = $80000023 + const long SYS_UserShell = $80000024 + const long SYS_CustomShell = $80000025 + const long SYS_Error = $80000026 + const long SYS_ExecuteInputStream = $80000020 + const long SYS_CmdStream = $80000028 + const long NP_Seglist = $800003e9 + const long NP_FreeSeglist = $800003ea + const long NP_Entry = $800003eb + const long NP_Input = $800003ec + const long NP_Output = $800003ed + const long NP_CloseInput = $800003ee + const long NP_CloseOutput = $800003ef + const long NP_Error = $800003f0 + const long NP_CloseError = $800003f1 + const long NP_CurrentDir = $800003f2 + const long NP_StackSize = $800003f3 + const long NP_Name = $800003f4 + const long NP_Priority = $800003f5 + const long NP_ConsoleTask = $800003f6 + const long NP_WindowPtr = $800003f7 + const long NP_HomeDir = $800003f8 + const long NP_CopyVars = $800003f9 + const long NP_Cli = $800003fa + const long NP_Path = $800003fb + const long NP_CommandName = $800003fc + const long NP_Arguments = $800003fd + const long NP_NotifyOnDeath = $800003fe + const long NP_Synchronous = $800003ff + const long NP_ExitCode = $80000400 + const long NP_ExitData = $80000401 + const long ADO_FH_Mode = $800007d1 + const long ADO_DirLen = $800007d2 + const long ADO_CommNameLen = $800007d3 + const long ADO_CommFileLen = $800007d4 + const long ADO_PromptLen = $800007d5 + const long SHELL_FGETS_FULL = $80000bb9 + const long SHELL_ADDH_LINE = $80000bba +} +;; End of auto-generated dos_lib.sfd diff --git a/compiler/res/prog8lib/shared_amiga_exec.p8 b/compiler/res/prog8lib/shared_amiga_exec.p8 new file mode 100644 index 000000000..407d63d17 --- /dev/null +++ b/compiler/res/prog8lib/shared_amiga_exec.p8 @@ -0,0 +1,656 @@ +;; Auto-generated from exec_lib.sfd and exec_lib.i +;; Library base: _SysBase in prog8: sys.SysBase +;; Bank: 1 +;; Functions: 115 + +exec { + %option merge, no_symbol_prefixing + + asmsub NewList(^^List list @A0) { + ; manually added utility routine to initialize new exec linked lists + %asm {{ + addq.l #4, a0 ; Point to lh_Tail + move.l a0, -4(a0) ; lh_Head = &lh_Tail + clr.l (a0) ; lh_Tail = NULL + subq.l #4, a0 ; Point back to &lh_Head + move.l a0, 8(a0) ; lh_TailPred = &lh_Head + rts + }} + } + + extsub @bank 1 -30 = Supervisor(pointer userFunction @A5) -> long @D0 + extsub @bank 1 -72 = InitCode(long startClass @D0, long version @D1) + extsub @bank 1 -78 = InitStruct(pointer initTable @A1, pointer k_memory @A2, long size @D0) + extsub @bank 1 -84 = MakeLibrary(pointer funcInit @A0, pointer structInit @A1, pointer libInit @A2, long dataSize @D0, long segList @D1) -> ^^Library @D0 + extsub @bank 1 -90 = MakeFunctions(pointer target @A0, pointer functionArray @A1, long funcDispBase @A2) + extsub @bank 1 -96 = FindResident(str name @A1) -> pointer @D0 + extsub @bank 1 -102 = InitResident(pointer resident @A1, long segList @D1) -> pointer @D0 + extsub @bank 1 -108 = Alert(long alertNum @D7) + extsub @bank 1 -114 = Debug(long flags @D0) + extsub @bank 1 -120 = Disable() + extsub @bank 1 -126 = Enable() + extsub @bank 1 -132 = Forbid() + extsub @bank 1 -138 = Permit() + extsub @bank 1 -144 = SetSR(long newSR @D0, long mask @D1) -> long @D0 + extsub @bank 1 -150 = SuperState() -> pointer @D0 + extsub @bank 1 -156 = UserState(pointer sysStack @D0) + extsub @bank 1 -162 = SetIntVector(long intNumber @D0, ^^Interrupt interrupt @A1) -> ^^Interrupt @D0 + extsub @bank 1 -168 = AddIntServer(long intNumber @D0, ^^Interrupt interrupt @A1) + extsub @bank 1 -174 = RemIntServer(long intNumber @D0, ^^Interrupt interrupt @A1) + extsub @bank 1 -180 = Cause(^^Interrupt interrupt @A1) + extsub @bank 1 -186 = Allocate(pointer freeList @A0, long byteSize @D0) -> pointer @D0 + extsub @bank 1 -192 = Deallocate(pointer freeList @A0, pointer memoryBlock @A1, long byteSize @D0) + extsub @bank 1 -198 = AllocMem(long byteSize @D0, long requirements @D1) -> pointer @D0 + extsub @bank 1 -204 = AllocAbs(long byteSize @D0, pointer location @A1) -> pointer @D0 + extsub @bank 1 -210 = FreeMem(pointer memoryBlock @A1, long byteSize @D0) + extsub @bank 1 -216 = AvailMem(long requirements @D1) -> long @D0 + extsub @bank 1 -222 = AllocEntry(pointer entry @A0) -> pointer @D0 + extsub @bank 1 -228 = FreeEntry(pointer entry @A0) + extsub @bank 1 -234 = Insert(^^List list @A0, ^^Node node @A1, ^^Node pred @A2) + extsub @bank 1 -240 = AddHead(^^List list @A0, ^^Node node @A1) + extsub @bank 1 -246 = AddTail(^^List list @A0, ^^Node node @A1) + extsub @bank 1 -252 = Remove(^^Node node @A1) + extsub @bank 1 -258 = RemHead(^^List list @A0) -> ^^Node @D0 + extsub @bank 1 -264 = RemTail(^^List list @A0) -> ^^Node @D0 + extsub @bank 1 -270 = Enqueue(^^List list @A0, ^^Node node @A1) + extsub @bank 1 -276 = FindName(^^List list @A0, str name @A1) -> ^^Node @D0 + extsub @bank 1 -282 = AddTask(^^Task task @A1, pointer initPC @A2, pointer finalPC @A3) -> pointer @D0 + extsub @bank 1 -288 = RemTask(^^Task task @A1) + extsub @bank 1 -294 = FindTask(str name @A1) -> ^^Task @D0 + extsub @bank 1 -300 = SetTaskPri(^^Task task @A1, long priority @D0) -> byte @D0 + extsub @bank 1 -306 = SetSignal(long newSignals @D0, long signalSet @D1) -> long @D0 + extsub @bank 1 -312 = SetExcept(long newSignals @D0, long signalSet @D1) -> long @D0 + extsub @bank 1 -318 = Wait(long signalSet @D0) -> long @D0 + extsub @bank 1 -324 = Signal(^^Task task @A1, long signalSet @D0) + extsub @bank 1 -330 = AllocSignal(byte signalNum @D0) -> byte @D0 + extsub @bank 1 -336 = FreeSignal(byte signalNum @D0) + extsub @bank 1 -342 = AllocTrap(long trapNum @D0) -> long @D0 + extsub @bank 1 -348 = FreeTrap(long trapNum @D0) + extsub @bank 1 -354 = AddPort(^^MsgPort port @A1) + extsub @bank 1 -360 = RemPort(^^MsgPort port @A1) + extsub @bank 1 -366 = PutMsg(^^MsgPort port @A0, ^^Message message @A1) + extsub @bank 1 -372 = GetMsg(^^MsgPort port @A0) -> ^^Message @D0 + extsub @bank 1 -378 = ReplyMsg(^^Message message @A1) + extsub @bank 1 -384 = WaitPort(^^MsgPort port @A0) -> ^^Message @D0 + extsub @bank 1 -390 = FindPort(str name @A1) -> ^^MsgPort @D0 + extsub @bank 1 -396 = AddLibrary(^^Library library @A1) + extsub @bank 1 -402 = RemLibrary(^^Library library @A1) + extsub @bank 1 -408 = OldOpenLibrary(str libName @A1) -> ^^Library @D0 + extsub @bank 1 -414 = CloseLibrary(^^Library library @A1) + extsub @bank 1 -420 = SetFunction(^^Library library @A1, long funcOffset @A0, pointer newFunction @D0) -> pointer @D0 + extsub @bank 1 -426 = SumLibrary(^^Library library @A1) + extsub @bank 1 -432 = AddDevice(pointer device @A1) + extsub @bank 1 -438 = RemDevice(pointer device @A1) + extsub @bank 1 -444 = OpenDevice(str devName @A0, long unit @D0, pointer ioRequest @A1, long flags @D1) -> byte @D0 + extsub @bank 1 -450 = CloseDevice(pointer ioRequest @A1) + extsub @bank 1 -456 = DoIO(pointer ioRequest @A1) -> byte @D0 + extsub @bank 1 -462 = SendIO(pointer ioRequest @A1) + extsub @bank 1 -468 = CheckIO(pointer ioRequest @A1) -> pointer @D0 + extsub @bank 1 -474 = WaitIO(pointer ioRequest @A1) -> byte @D0 + extsub @bank 1 -480 = AbortIO(pointer ioRequest @A1) + extsub @bank 1 -486 = AddResource(pointer resource @A1) + extsub @bank 1 -492 = RemResource(pointer resource @A1) + extsub @bank 1 -498 = OpenResource(str resName @A1) -> pointer @D0 + extsub @bank 1 -522 = RawDoFmt(str formatString @A0, pointer dataStream @A1, pointer putChProc @A2, pointer putChData @A3) -> pointer @D0 + extsub @bank 1 -528 = GetCC() -> long @D0 + extsub @bank 1 -534 = TypeOfMem(pointer address @A1) -> long @D0 + extsub @bank 1 -540 = Procure(pointer sigSem @A0, pointer bidMsg @A1) -> long @D0 + extsub @bank 1 -546 = Vacate(pointer sigSem @A0, pointer bidMsg @A1) + extsub @bank 1 -552 = OpenLibrary(str libName @A1, long version @D0) -> ^^Library @D0 + extsub @bank 1 -558 = InitSemaphore(pointer sigSem @A0) + extsub @bank 1 -564 = ObtainSemaphore(pointer sigSem @A0) + extsub @bank 1 -570 = ReleaseSemaphore(pointer sigSem @A0) + extsub @bank 1 -576 = AttemptSemaphore(pointer sigSem @A0) -> long @D0 + extsub @bank 1 -582 = ObtainSemaphoreList(^^List sigSem @A0) + extsub @bank 1 -588 = ReleaseSemaphoreList(^^List sigSem @A0) + extsub @bank 1 -594 = FindSemaphore(str name @A1) -> pointer @D0 + extsub @bank 1 -600 = AddSemaphore(pointer sigSem @A1) + extsub @bank 1 -606 = RemSemaphore(pointer sigSem @A1) + extsub @bank 1 -612 = SumKickData() -> long @D0 + extsub @bank 1 -618 = AddMemList(long size @D0, long attributes @D1, long pri @D2, pointer base @A0, str name @A1) + extsub @bank 1 -624 = CopyMem(pointer source @A0, pointer dest @A1, long size @D0) + extsub @bank 1 -630 = CopyMemQuick(pointer source @A0, pointer dest @A1, long size @D0) + extsub @bank 1 -636 = CacheClearU() + extsub @bank 1 -642 = CacheClearE(pointer address @A0, long length @D0, long caches @D1) + extsub @bank 1 -648 = CacheControl(long cacheBits @D0, long cacheMask @D1) -> long @D0 + extsub @bank 1 -654 = CreateIORequest(^^MsgPort port @A0, long size @D0) -> pointer @D0 + extsub @bank 1 -660 = DeleteIORequest(pointer iorequest @A0) + extsub @bank 1 -666 = CreateMsgPort() -> ^^MsgPort @D0 + extsub @bank 1 -672 = DeleteMsgPort(^^MsgPort port @A0) + extsub @bank 1 -678 = ObtainSemaphoreShared(pointer sigSem @A0) + extsub @bank 1 -684 = AllocVec(long byteSize @D0, long requirements @D1) -> pointer @D0 + extsub @bank 1 -690 = FreeVec(pointer memoryBlock @A1) + extsub @bank 1 -696 = CreatePool(long requirements @D0, long puddleSize @D1, long threshSize @D2) -> pointer @D0 + extsub @bank 1 -702 = DeletePool(pointer poolHeader @A0) + extsub @bank 1 -708 = AllocPooled(pointer poolHeader @A0, long memSize @D0) -> pointer @D0 + extsub @bank 1 -714 = FreePooled(pointer poolHeader @A0, pointer k_memory @A1, long memSize @D0) + extsub @bank 1 -720 = AttemptSemaphoreShared(pointer sigSem @A0) -> long @D0 + extsub @bank 1 -726 = ColdReboot() + extsub @bank 1 -732 = StackSwap(pointer newStack @A0) + extsub @bank 1 -762 = CachePreDMA(pointer address @A0, pointer length @A1, long flags @D0) -> pointer @D0 + extsub @bank 1 -768 = CachePostDMA(pointer address @A0, pointer length @A1, long flags @D0) + extsub @bank 1 -774 = AddMemHandler(^^Interrupt memhand @A1) + extsub @bank 1 -780 = RemMemHandler(^^Interrupt memhand @A1) + extsub @bank 1 -786 = ObtainQuickVector(pointer interruptCode @A0) -> long @D0 + extsub @bank 1 -828 = NewMinList(^^MinList minlist @A0) + + ; ---- struct definitions ---- + + struct IOStdReq { ; total size: 48 + ^^Node Succ ; 0 + ^^Node Pred ; 4 + ubyte Type ; 8 + byte Pri ; 9 + str Name ; 10 + ^^MsgPort ReplyPort ; 14 + uword Length ; 18 + pointer Device ; 20 + pointer Unit ; 24 + uword Command ; 28 + ubyte Flags ; 30 + byte Error ; 31 + long Actual ; 32 + long IOStdReq_Length ; 36 + pointer Data ; 40 + long Offset ; 44 + } + + struct IORequest { ; total size: 32 + ^^Node Succ ; 0 + ^^Node Pred ; 4 + ubyte Type ; 8 + byte Pri ; 9 + str Name ; 10 + ^^MsgPort ReplyPort ; 14 + uword Length ; 18 + pointer Device ; 20 + pointer Unit ; 24 + uword Command ; 28 + ubyte Flags ; 30 + byte Error ; 31 + } + + struct Interrupt { ; total size: 22 + ^^Node Succ ; 0 + ^^Node Pred ; 4 + ubyte Type ; 8 + byte Pri ; 9 + str Name ; 10 + pointer Data ; 14 + pointer Code ; 18 + } + + struct List { ; total size: 14 + ^^Node Head ; 0 + pointer Tail ; 4 + ^^Node TailPred ; 8 + ubyte Type ; 12 + ubyte Pad ; 13 + } + + struct Library { ; total size: 34 + ^^Node Succ ; 0 + ^^Node Pred ; 4 + ubyte Type ; 8 + byte Pri ; 9 + str Name ; 10 + ubyte Flags ; 14 + ubyte Pad ; 15 + uword NegSize ; 16 + uword PosSize ; 18 + uword Version ; 20 + uword Revision ; 22 + str IdString ; 24 + long Sum ; 28 + uword OpenCnt ; 32 + } + + struct Node { ; total size: 14 + ^^Node Succ ; 0 + ^^Node Pred ; 4 + ubyte Type ; 8 + byte Pri ; 9 + str Name ; 10 + } + + struct MinList { ; total size: 12 + ^^MinNode Head ; 0 + pointer Tail ; 4 + ^^MinNode TailPred ; 8 + } + + struct MinNode { ; total size: 8 + ^^MinNode Succ ; 0 + ^^MinNode Pred ; 4 + } + + struct Message { ; total size: 20 + ^^Message Succ ; 0 + ^^Message Pred ; 4 + ubyte Type ; 8 + byte Pri ; 9 + str Name ; 10 + ^^MsgPort ReplyPort ; 14 + uword Length ; 18 + } + + struct MsgPort { ; total size: 34 + ^^Node Succ ; 0 + ^^Node Pred ; 4 + ubyte Type ; 8 + byte Pri ; 9 + str Name ; 10 + ubyte Flags ; 14 + ubyte SigBit ; 15 + pointer SigTask ; 16 + ^^Node Head ; 20 + ^^Node Tail ; 24 + ^^Node TailPred ; 28 + ubyte List_Type ; 32 + ubyte Pad ; 33 + } + + struct Task { ; total size: 92 + ^^Node Succ ; 0 + ^^Node Pred ; 4 + ubyte Type ; 8 + byte Pri ; 9 + str Name ; 10 + ubyte Flags ; 14 + ubyte State ; 15 + byte IDNestCnt ; 16 + byte TDNestCnt ; 17 + long SigAlloc ; 18 + long SigWait ; 22 + long SigRecvd ; 26 + long SigExcept ; 30 + uword TrapAlloc ; 34 + uword TrapAble ; 36 + pointer ExceptData ; 38 + pointer ExceptCode ; 42 + pointer TrapData ; 46 + pointer TrapCode ; 50 + pointer SPReg ; 54 + pointer SPLower ; 58 + pointer SPUpper ; 62 + pointer Switch ; 66 + pointer Launch ; 70 + ^^Node Head ; 74 + ^^Node Tail ; 78 + ^^Node TailPred ; 82 + ubyte List_Type ; 86 + ubyte Pad ; 87 + pointer UserData ; 88 + } + + ; ---- constants ---- + const long ACPU_BusErr = $80000002 + const long ACPU_AddressErr = $80000003 + const long ACPU_InstErr = $80000004 + const long ACPU_DivZero = $80000005 + const long ACPU_CHK = $80000006 + const long ACPU_TRAPV = $80000007 + const long ACPU_PrivErr = $80000008 + const long ACPU_Trace = $80000009 + const long ACPU_LineA = $8000000A + const long ACPU_LineF = $8000000B + const long ACPU_Format = $8000000E + const long ACPU_Spurious = $80000018 + const long ACPU_AutoVec1 = $80000019 + const long ACPU_AutoVec2 = $8000001A + const long ACPU_AutoVec3 = $8000001B + const long ACPU_AutoVec4 = $8000001C + const long ACPU_AutoVec5 = $8000001D + const long ACPU_AutoVec6 = $8000001E + const long ACPU_AutoVec7 = $8000001F + const long AT_DeadEnd = $80000000 + const long AT_Recovery = $00000000 + const long AG_NoMemory = $00010000 + const long AG_MakeLib = $00020000 + const long AG_OpenLib = $00030000 + const long AG_OpenDev = $00040000 + const long AG_OpenRes = $00050000 + const long AG_IOError = $00060000 + const long AG_NoSignal = $00070000 + const long AG_BadParm = $00080000 + const long AG_CloseLib = $00090000 + const long AG_CloseDev = $000A0000 + const long AG_ProcCreate = $000B0000 + const long AO_ExecLib = $00008001 + const long AO_GraphicsLib = $00008002 + const long AO_LayersLib = $00008003 + const long AO_Intuition = $00008004 + const long AO_MathLib = $00008005 + const long AO_DOSLib = $00008007 + const long AO_RAMLib = $00008008 + const long AO_IconLib = $00008009 + const long AO_ExpansionLib = $0000800A + const long AO_DiskfontLib = $0000800B + const long AO_UtilityLib = $0000800C + const long AO_KeyMapLib = $0000800D + const long AO_AudioDev = $00008010 + const long AO_ConsoleDev = $00008011 + const long AO_GamePortDev = $00008012 + const long AO_KeyboardDev = $00008013 + const long AO_TrackDiskDev = $00008014 + const long AO_TimerDev = $00008015 + const long AO_CIARsrc = $00008020 + const long AO_DiskRsrc = $00008021 + const long AO_MiscRsrc = $00008022 + const long AO_BootStrap = $00008030 + const long AO_Workbench = $00008031 + const long AO_DiskCopy = $00008032 + const long AO_GadTools = $00008033 + const long AO_Unknown = $00008035 + const long AN_ExecLib = $01000000 + const long AN_ExcptVect = $01000001 + const long AN_BaseChkSum = $01000002 + const long AN_LibChkSum = $01000003 + const long AN_MemCorrupt = $81000005 + const long AN_IntrMem = $81000006 + const long AN_InitAPtr = $01000007 + const long AN_SemCorrupt = $01000008 + const long AN_FreeTwice = $01000009 + const long AN_BogusExcpt = $8100000A + const long AN_IOUsedTwice = $0100000B + const long AN_MemoryInsane = $0100000C + const long AN_IOAfterClose = $0100000D + const long AN_StackProbe = $0100000E + const long AN_BadFreeAddr = $0100000F + const long AN_BadSemaphore = $01000010 + const long AN_BadQuickInt = $810000FF + const long AN_AVLNotImpl = $01000011 + const long AN_TreeNotImpl = $01000012 + const long AN_GraphicsLib = $02000000 + const long AN_GfxNoMem = $82010000 + const long AN_GfxNoMemMspc = $82010001 + const long AN_LongFrame = $82010006 + const long AN_ShortFrame = $82010007 + const long AN_TextTmpRas = $02010009 + const long AN_BltBitMap = $8201000A + const long AN_RegionMemory = $8201000B + const long AN_MakeVPort = $82010030 + const long AN_GfxNewError = $0200000C + const long AN_GfxFreeError = $0200000D + const long AN_GfxNoLCM = $82011234 + const long AN_ObsoleteFont = $02000401 + const long AN_LayersLib = $03000000 + const long AN_LayersNoMem = $83010000 + const long AN_Intuition = $04000000 + const long AN_GadgetType = $84000001 + const long AN_BadGadget = $04000001 + const long AN_CreatePort = $84010002 + const long AN_ItemAlloc = $04010003 + const long AN_SubAlloc = $04010004 + const long AN_PlaneAlloc = $84010005 + const long AN_ItemBoxTop = $84000006 + const long AN_OpenScreen = $84010007 + const long AN_OpenScrnRast = $84010008 + const long AN_SysScrnType = $84000009 + const long AN_AddSWGadget = $8401000A + const long AN_OpenWindow = $8401000B + const long AN_BadState = $8400000C + const long AN_BadMessage = $8400000D + const long AN_WeirdEcho = $8400000E + const long AN_NoConsole = $8400000F + const long AN_NoISem = $04000010 + const long AN_ISemOrder = $04000011 + const long AN_DeadIntui = $04000012 + const long AN_MathLib = $05000000 + const long AN_DOSLib = $07000000 + const long AN_StartMem = $07010001 + const long AN_EndTask = $07000002 + const long AN_QPktFail = $07000003 + const long AN_AsyncPkt = $07000004 + const long AN_FreeVec = $07000005 + const long AN_DiskBlkSeq = $07000006 + const long AN_BitMap = $07000007 + const long AN_KeyFree = $07000008 + const long AN_BadChkSum = $07000009 + const long AN_DiskError = $0700000A + const long AN_KeyRange = $0700000B + const long AN_BadOverlay = $0700000C + const long AN_BadInitFunc = $0700000D + const long AN_FileReclosed = $0700000E + const long AN_CLIObsolete = $0700000F + const long AN_RAMLib = $08000000 + const long AN_BadSegList = $08000001 + const long AN_IconLib = $09000000 + const long AN_ExpansionLib = $0A000000 + const long AN_BadExpansionFree = $0A000001 + const long AN_DiskfontLib = $0B000000 + const long AN_AudioDev = $10000000 + const long AN_ConsoleDev = $11000000 + const long AN_NoWindow = $11000001 + const long AN_GamePortDev = $12000000 + const long AN_KeyboardDev = $13000000 + const long AN_TrackDiskDev = $14000000 + const long AN_TDCalibSeek = $14000001 + const long AN_TDDelay = $14000002 + const long AN_TimerDev = $15000000 + const long AN_TMBadReq = $15000001 + const long AN_TMBadSupply = $15000002 + const long AN_CIARsrc = $20000000 + const long AN_DiskRsrc = $21000000 + const long AN_DRHasDisk = $21000001 + const long AN_DRIntNoAct = $21000002 + const long AN_MiscRsrc = $22000000 + const long AN_BootStrap = $30000000 + const long AN_BootError = $30000001 + const long AN_Workbench = $31000000 + const long AN_NoFonts = $B1000001 + const long AN_WBBadStartupMsg1 = $31000001 + const long AN_WBBadStartupMsg2 = $31000002 + const long AN_WBBadIOMsg = $31000003 + const long AN_WBReLayoutToolMenu = $B1010009 + const long AN_DiskCopy = $32000000 + const long AN_GadTools = $33000000 + const long AN_UtilityLib = $34000000 + const long AN_Unknown = $35000000 + const ubyte UNITB_ACTIVE = 0 + const ubyte UNITF_ACTIVE = $0001 + const ubyte UNITB_INTASK = 1 + const ubyte UNITF_INTASK = $0002 + const long IOERR_OPENFAIL = -1 + const long IOERR_ABORTED = -2 + const long IOERR_NOCMD = -3 + const long IOERR_BADLENGTH = -4 + const long IOERR_BADADDRESS = -5 + const long IOERR_UNITBUSY = -6 + const long IOERR_SELFTEST = -7 + const ubyte AFB_68010 = 0 + const ubyte AFF_68010 = $0001 + const ubyte AFB_68020 = 1 + const ubyte AFF_68020 = $0002 + const ubyte AFB_68030 = 2 + const ubyte AFF_68030 = $0004 + const ubyte AFB_68040 = 3 + const ubyte AFF_68040 = $0008 + const ubyte AFB_68881 = 4 + const ubyte AFF_68881 = $0010 + const ubyte AFB_68882 = 5 + const ubyte AFF_68882 = $0020 + const ubyte AFB_FPU40 = 6 + const ubyte AFF_FPU40 = $0040 + const ubyte AFB_68060 = 7 + const ubyte AFF_68060 = $0080 + const ubyte AFB_FPGA = 10 + const uword AFF_FPGA = $0400 + const ubyte AFB_PRIVATE = 15 + const uword AFF_PRIVATE = $8000 + const ubyte CACRB_EnableI = 0 + const ubyte CACRF_EnableI = $0001 + const ubyte CACRB_FreezeI = 1 + const ubyte CACRF_FreezeI = $0002 + const ubyte CACRB_ClearI = 3 + const ubyte CACRF_ClearI = $0008 + const ubyte CACRB_IBE = 4 + const ubyte CACRF_IBE = $0010 + const ubyte CACRB_EnableD = 8 + const uword CACRF_EnableD = $0100 + const ubyte CACRB_FreezeD = 9 + const uword CACRF_FreezeD = $0200 + const ubyte CACRB_ClearD = 11 + const uword CACRF_ClearD = $0800 + const ubyte CACRB_DBE = 12 + const uword CACRF_DBE = $1000 + const ubyte CACRB_WriteAllocate = 13 + const uword CACRF_WriteAllocate = $2000 + const ubyte CACRB_EnableE = 30 + const long CACRF_EnableE = $40000000 + const ubyte CACRB_CopyBack = 31 + const long CACRF_CopyBack = $80000000 + const ubyte DMAB_Continue = 1 + const ubyte DMAF_Continue = $0002 + const ubyte DMAB_NoModify = 2 + const ubyte DMAF_NoModify = $0004 + const ubyte DMAB_ReadFromRAM = 3 + const ubyte DMAF_ReadFromRAM = $0008 + const ubyte SB_SAR = 15 + const uword SF_SAR = $8000 + const ubyte SB_TQE = 14 + const uword SF_TQE = $4000 + const ubyte SB_SINT = 13 + const uword SF_SINT = $2000 + const ubyte SIH_PRIMASK = $0F0 + const ubyte SIH_QUEUES = $0005 + const ubyte INTB_NMI = 15 + const uword INTF_NMI = $8000 + const ubyte IOB_QUICK = 0 + const ubyte IOF_QUICK = $0001 + const uword CMD_INVALID = $0000 + const uword CMD_RESET = $0001 + const uword CMD_READ = $0002 + const uword CMD_WRITE = $0003 + const uword CMD_UPDATE = $0004 + const uword CMD_CLEAR = $0005 + const uword CMD_STOP = $0006 + const uword CMD_START = $0007 + const uword CMD_FLUSH = $0008 + const uword CMD_NONSTD = $0009 + const ubyte LIB_VECTSIZE = $0006 + const ubyte LIB_RESERVED = $0004 + const ubyte LIBB_SUMMING = 0 + const ubyte LIBF_SUMMING = $0001 + const ubyte LIBB_CHANGED = 1 + const ubyte LIBF_CHANGED = $0002 + const ubyte LIBB_SUMUSED = 2 + const ubyte LIBF_SUMUSED = $0004 + const ubyte LIBB_DELEXP = 3 + const ubyte LIBF_DELEXP = $0008 + const ubyte LIBB_EXP0CNT = 4 + const ubyte LIBF_EXP0CNT = $0010 + const ubyte MEMF_ANY = $0000 + const ubyte MEMB_PUBLIC = 0 + const ubyte MEMF_PUBLIC = $0001 + const ubyte MEMB_CHIP = 1 + const ubyte MEMF_CHIP = $0002 + const ubyte MEMB_FAST = 2 + const ubyte MEMF_FAST = $0004 + const ubyte MEMB_LOCAL = 8 + const uword MEMF_LOCAL = $0100 + const ubyte MEMB_24BITDMA = 9 + const uword MEMF_24BITDMA = $0200 + const ubyte MEMB_KICK = 10 + const uword MEMF_KICK = $0400 + const ubyte MEMB_CLEAR = 16 + const long MEMF_CLEAR = $00010000 + const ubyte MEMB_LARGEST = 17 + const long MEMF_LARGEST = $00020000 + const ubyte MEMB_REVERSE = 18 + const long MEMF_REVERSE = $00040000 + const ubyte MEMB_TOTAL = 19 + const long MEMF_TOTAL = $00080000 + const ubyte MEMB_NO_EXPUNGE = 31 + const long MEMF_NO_EXPUNGE = $80000000 + const ubyte MEM_BLOCKSIZE = $0008 + const ubyte MEMHB_RECYCLE = 0 + const ubyte MEMHF_RECYCLE = $0001 + const ubyte MEM_DID_NOTHING = $0000 + const long MEM_ALL_DONE = -1 + const ubyte MEM_TRY_AGAIN = $0001 + const ubyte NT_UNKNOWN = $0000 + const ubyte NT_TASK = $0001 + const ubyte NT_INTERRUPT = $0002 + const ubyte NT_DEVICE = $0003 + const ubyte NT_MSGPORT = $0004 + const ubyte NT_MESSAGE = $0005 + const ubyte NT_FREEMSG = $0006 + const ubyte NT_REPLYMSG = $0007 + const ubyte NT_RESOURCE = $0008 + const ubyte NT_LIBRARY = $0009 + const ubyte NT_MEMORY = $000a + const ubyte NT_SOFTINT = $000b + const ubyte NT_FONT = $000c + const ubyte NT_PROCESS = $000d + const ubyte NT_SEMAPHORE = $000e + const ubyte NT_SIGNALSEM = $000f + const ubyte NT_BOOTNODE = $0010 + const ubyte NT_KICKMEM = $0011 + const ubyte NT_GRAPHICS = $0012 + const ubyte NT_DEATHMESSAGE = $0013 + const ubyte NT_USER = $00fe + const ubyte NT_EXTENDED = $00ff + const ubyte PF_ACTION = $0003 + const ubyte PA_SIGNAL = $0000 + const ubyte PA_SOFTINT = $0001 + const ubyte PA_IGNORE = $0002 + const uword RTC_MATCHWORD = $4AFC + const ubyte RTB_COLDSTART = 0 + const ubyte RTF_COLDSTART = $0001 + const ubyte RTB_SINGLETASK = 1 + const ubyte RTF_SINGLETASK = $0002 + const ubyte RTB_AFTERDOS = 2 + const ubyte RTF_AFTERDOS = $0004 + const ubyte RTB_AUTOINIT = 7 + const ubyte RTF_AUTOINIT = $0080 + const ubyte RTW_NEVER = $0000 + const ubyte RTW_COLDSTART = $0001 + const ubyte EOS = $0000 + const ubyte BELL = $0007 + const ubyte LF = $000a + const ubyte CR = $000d + const ubyte BS = $0008 + const ubyte DEL = $7F + const ubyte TB_PROCTIME = 0 + const ubyte TF_PROCTIME = $0001 + const ubyte TB_ETASK = 3 + const ubyte TF_ETASK = $0008 + const ubyte TB_STACKCHK = 4 + const ubyte TF_STACKCHK = $0010 + const ubyte TB_EXCEPT = 5 + const ubyte TF_EXCEPT = $0020 + const ubyte TB_SWITCH = 6 + const ubyte TF_SWITCH = $0040 + const ubyte TB_LAUNCH = 7 + const ubyte TF_LAUNCH = $0080 + const ubyte TS_INVALID = $0000 + const ubyte SIGB_ABORT = 0 + const ubyte SIGF_ABORT = $0001 + const ubyte SIGB_CHILD = 1 + const ubyte SIGF_CHILD = $0002 + const ubyte SIGB_BLIT = 4 + const ubyte SIGF_BLIT = $0010 + const ubyte SIGB_SINGLE = 4 + const ubyte SIGF_SINGLE = $0010 + const ubyte SIGB_INTUITION = 5 + const ubyte SIGF_INTUITION = $0020 + const ubyte SIGB_NET = 7 + const ubyte SIGF_NET = $0080 + const ubyte SIGB_DOS = 8 + const uword SIGF_DOS = $0100 + const uword SYS_SIGALLOC = $0FFFF + const uword SYS_TRAPALLOC = $08000 + const ubyte INCLUDE_VERSION = $002f + const ubyte LIBRARY_MINIMUM = $0021 + const long ERR_OPENDEVICE = -1 + const ubyte MEM_BLOCKMASK = $0007 + const ubyte NL = $000a + const ubyte TS_ADDED = $0001 + const ubyte TS_RUN = $0002 + const ubyte TS_READY = $0003 + const ubyte TS_WAIT = $0004 + const ubyte TS_EXCEPT = $0005 + const ubyte TS_REMOVED = $0006 +} +;; End of auto-generated exec_lib.sfd diff --git a/compiler/res/prog8lib/shared_amiga_graphics.p8 b/compiler/res/prog8lib/shared_amiga_graphics.p8 new file mode 100644 index 000000000..280109a80 --- /dev/null +++ b/compiler/res/prog8lib/shared_amiga_graphics.p8 @@ -0,0 +1,1052 @@ +;; Auto-generated from graphics_lib.sfd and graphics_lib.i +;; Library base: _GfxBase in prog8: sys.GfxBase +;; Bank: 3 +;; Functions: 163 + +%import exec +%import utility + +graphics { + %option merge, no_symbol_prefixing + extsub @bank 3 -30 = BltBitMap(^^BitMap srcBitMap @A0, word xSrc @D0, word ySrc @D1, ^^BitMap destBitMap @A1, word xDest @D2, word yDest @D3, word xSize @D4, word ySize @D5, ubyte minterm @D6, ubyte mask @D7, pointer tempA @A2) -> long @D0 + extsub @bank 3 -36 = BltTemplate(long source @A0, word xSrc @D0, word srcMod @D1, ^^RastPort destRP @A1, word xDest @D2, word yDest @D3, word xSize @D4, word ySize @D5) + extsub @bank 3 -42 = ClearEOL(^^RastPort rp @A1) + extsub @bank 3 -48 = ClearScreen(^^RastPort rp @A1) + extsub @bank 3 -54 = TextLength(^^RastPort rp @A1, str string @A0, uword count @D0) -> word @D0 + extsub @bank 3 -60 = Text(^^RastPort rp @A1, str string @A0, uword count @D0) -> long @D0 + extsub @bank 3 -66 = SetFont(^^RastPort rp @A1, ^^TextFont textFont @A0) -> long @D0 + extsub @bank 3 -72 = OpenFont(^^TextAttr textAttr @A0) -> ^^TextFont @D0 + extsub @bank 3 -78 = CloseFont(^^TextFont textFont @A1) + extsub @bank 3 -84 = AskSoftStyle(^^RastPort rp @A1) -> long @D0 + extsub @bank 3 -90 = SetSoftStyle(^^RastPort rp @A1, long style @D0, long enable @D1) -> long @D0 + extsub @bank 3 -96 = AddBob(pointer bob @A0, ^^RastPort rp @A1) + extsub @bank 3 -102 = AddVSprite(pointer vSprite @A0, ^^RastPort rp @A1) + extsub @bank 3 -108 = DoCollision(^^RastPort rp @A1) + extsub @bank 3 -114 = DrawGList(^^RastPort rp @A1, pointer vp @A0) + extsub @bank 3 -120 = InitGels(pointer head @A0, pointer tail @A1, pointer gelsInfo @A2) + extsub @bank 3 -126 = InitMasks(pointer vSprite @A0) + extsub @bank 3 -132 = RemIBob(pointer bob @A0, ^^RastPort rp @A1, pointer vp @A2) + extsub @bank 3 -138 = RemVSprite(pointer vSprite @A0) + extsub @bank 3 -144 = SetCollision(long num @D0, pointer routine @A0, pointer gelsInfo @A1) + extsub @bank 3 -150 = SortGList(^^RastPort rp @A1) + extsub @bank 3 -156 = AddAnimOb(pointer anOb @A0, pointer anKey @A1, ^^RastPort rp @A2) + extsub @bank 3 -162 = Animate(pointer anKey @A0, ^^RastPort rp @A1) + extsub @bank 3 -168 = GetGBuffers(pointer anOb @A0, ^^RastPort rp @A1, bool flag @D0) -> bool @D0 + extsub @bank 3 -174 = InitGMasks(pointer anOb @A0) + extsub @bank 3 -180 = DrawEllipse(^^RastPort rp @A1, word xCenter @D0, word yCenter @D1, word a @D2, word b @D3) + extsub @bank 3 -186 = AreaEllipse(^^RastPort rp @A1, word xCenter @D0, word yCenter @D1, word a @D2, word b @D3) -> long @D0 + extsub @bank 3 -192 = LoadRGB4(pointer vp @A0, pointer colors @A1, word count @D0) + extsub @bank 3 -198 = InitRastPort(^^RastPort rp @A1) + extsub @bank 3 -204 = InitVPort(pointer vp @A0) + extsub @bank 3 -210 = MrgCop(^^View view @A1) -> long @D0 + extsub @bank 3 -216 = MakeVPort(^^View view @A0, pointer vp @A1) -> long @D0 + extsub @bank 3 -222 = LoadView(^^View view @A1) + extsub @bank 3 -228 = WaitBlit() + extsub @bank 3 -234 = SetRast(^^RastPort rp @A1, ubyte pen @D0) + extsub @bank 3 -240 = Move(^^RastPort rp @A1, word x @D0, word y @D1) + extsub @bank 3 -246 = Draw(^^RastPort rp @A1, word x @D0, word y @D1) + extsub @bank 3 -252 = AreaMove(^^RastPort rp @A1, word x @D0, word y @D1) -> long @D0 + extsub @bank 3 -258 = AreaDraw(^^RastPort rp @A1, word x @D0, word y @D1) -> long @D0 + extsub @bank 3 -264 = AreaEnd(^^RastPort rp @A1) -> long @D0 + extsub @bank 3 -270 = WaitTOF() + extsub @bank 3 -276 = QBlit(pointer blit @A1) + extsub @bank 3 -282 = InitArea(^^AreaInfo areaInfo @A0, pointer vectorBuffer @A1, word maxVectors @D0) + extsub @bank 3 -288 = SetRGB4(pointer vp @A0, word index @D0, ubyte red @D1, ubyte green @D2, ubyte blue @D3) + extsub @bank 3 -294 = QBSBlit(pointer blit @A1) + extsub @bank 3 -300 = BltClear(pointer memBlock @A1, long byteCount @D0, long flags @D1) + extsub @bank 3 -306 = RectFill(^^RastPort rp @A1, word xMin @D0, word yMin @D1, word xMax @D2, word yMax @D3) + extsub @bank 3 -312 = BltPattern(^^RastPort rp @A1, long mask @A0, word xMin @D0, word yMin @D1, word xMax @D2, word yMax @D3, uword maskBPR @D4) + extsub @bank 3 -318 = ReadPixel(^^RastPort rp @A1, word x @D0, word y @D1) -> long @D0 + extsub @bank 3 -324 = WritePixel(^^RastPort rp @A1, word x @D0, word y @D1) -> long @D0 + extsub @bank 3 -330 = Flood(^^RastPort rp @A1, long mode @D2, word x @D0, word y @D1) -> bool @D0 + extsub @bank 3 -336 = PolyDraw(^^RastPort rp @A1, word count @D0, pointer polyTable @A0) + extsub @bank 3 -342 = SetAPen(^^RastPort rp @A1, ubyte pen @D0) + extsub @bank 3 -348 = SetBPen(^^RastPort rp @A1, ubyte pen @D0) + extsub @bank 3 -354 = SetDrMd(^^RastPort rp @A1, ubyte drawMode @D0) + extsub @bank 3 -360 = InitView(^^View view @A1) + extsub @bank 3 -366 = CBump(pointer copList @A1) + extsub @bank 3 -372 = CMove(pointer copList @A1, pointer destination @D0, word data @D1) -> long @D0 + extsub @bank 3 -378 = CWait(pointer copList @A1, word v @D0, word h @D1) -> long @D0 + extsub @bank 3 -384 = VBeamPos() -> long @D0 + extsub @bank 3 -390 = InitBitMap(^^BitMap bitMap @A0, byte depth @D0, word width @D1, word height @D2) + extsub @bank 3 -396 = ScrollRaster(^^RastPort rp @A1, word dx @D0, word dy @D1, word xMin @D2, word yMin @D3, word xMax @D4, word yMax @D5) + extsub @bank 3 -402 = WaitBOVP(pointer vp @A0) + extsub @bank 3 -408 = GetSprite(pointer sprite @A0, word num @D0) -> word @D0 + extsub @bank 3 -414 = FreeSprite(word num @D0) + extsub @bank 3 -420 = ChangeSprite(pointer vp @A0, pointer sprite @A1, pointer newData @A2) + extsub @bank 3 -426 = MoveSprite(pointer vp @A0, pointer sprite @A1, word x @D0, word y @D1) + extsub @bank 3 -432 = LockLayerRom(^^Layer layer @A5) + extsub @bank 3 -438 = UnlockLayerRom(^^Layer layer @A5) + extsub @bank 3 -444 = SyncSBitMap(^^Layer layer @A0) + extsub @bank 3 -450 = CopySBitMap(^^Layer layer @A0) + extsub @bank 3 -456 = OwnBlitter() + extsub @bank 3 -462 = DisownBlitter() + extsub @bank 3 -468 = InitTmpRas(^^TmpRas tmpRas @A0, pointer buffer @A1, long size @D0) -> ^^TmpRas @D0 + extsub @bank 3 -474 = AskFont(^^RastPort rp @A1, ^^TextAttr textAttr @A0) + extsub @bank 3 -480 = AddFont(^^TextFont textFont @A1) + extsub @bank 3 -486 = RemFont(^^TextFont textFont @A1) + extsub @bank 3 -492 = AllocRaster(uword width @D0, uword height @D1) -> pointer @D0 + extsub @bank 3 -498 = FreeRaster(pointer p @A0, uword width @D0, uword height @D1) + extsub @bank 3 -504 = AndRectRegion(pointer region @A0, pointer rectangle @A1) + extsub @bank 3 -510 = OrRectRegion(pointer region @A0, pointer rectangle @A1) -> bool @D0 + extsub @bank 3 -516 = NewRegion() -> pointer @D0 + extsub @bank 3 -522 = ClearRectRegion(pointer region @A0, pointer rectangle @A1) -> bool @D0 + extsub @bank 3 -528 = ClearRegion(pointer region @A0) + extsub @bank 3 -534 = DisposeRegion(pointer region @A0) + extsub @bank 3 -540 = FreeVPortCopLists(pointer vp @A0) + extsub @bank 3 -546 = FreeCopList(pointer copList @A0) + extsub @bank 3 -552 = ClipBlit(^^RastPort srcRP @A0, word xSrc @D0, word ySrc @D1, ^^RastPort destRP @A1, word xDest @D2, word yDest @D3, word xSize @D4, word ySize @D5, ubyte minterm @D6) + extsub @bank 3 -558 = XorRectRegion(pointer region @A0, pointer rectangle @A1) -> bool @D0 + extsub @bank 3 -564 = FreeCprList(pointer cprList @A0) + extsub @bank 3 -570 = GetColorMap(long entries @D0) -> ^^ColorMap @D0 + extsub @bank 3 -576 = FreeColorMap(^^ColorMap colorMap @A0) + extsub @bank 3 -582 = GetRGB4(^^ColorMap colorMap @A0, long entry @D0) -> long @D0 + extsub @bank 3 -588 = ScrollVPort(pointer vp @A0) + extsub @bank 3 -594 = UCopperListInit(pointer uCopList @A0, word n @D0) -> pointer @D0 + extsub @bank 3 -600 = FreeGBuffers(pointer anOb @A0, ^^RastPort rp @A1, bool flag @D0) + extsub @bank 3 -606 = BltBitMapRastPort(^^BitMap srcBitMap @A0, word xSrc @D0, word ySrc @D1, ^^RastPort destRP @A1, word xDest @D2, word yDest @D3, word xSize @D4, word ySize @D5, ubyte minterm @D6) + extsub @bank 3 -612 = OrRegionRegion(pointer srcRegion @A0, pointer destRegion @A1) -> bool @D0 + extsub @bank 3 -618 = XorRegionRegion(pointer srcRegion @A0, pointer destRegion @A1) -> bool @D0 + extsub @bank 3 -624 = AndRegionRegion(pointer srcRegion @A0, pointer destRegion @A1) -> bool @D0 + extsub @bank 3 -630 = SetRGB4CM(^^ColorMap colorMap @A0, word index @D0, ubyte red @D1, ubyte green @D2, ubyte blue @D3) + extsub @bank 3 -636 = BltMaskBitMapRastPort(^^BitMap srcBitMap @A0, word xSrc @D0, word ySrc @D1, ^^RastPort destRP @A1, word xDest @D2, word yDest @D3, word xSize @D4, word ySize @D5, ubyte minterm @D6, long bltMask @A2) + extsub @bank 3 -654 = AttemptLockLayerRom(^^Layer layer @A5) -> bool @D0 + extsub @bank 3 -660 = GfxNew(long gfxNodeType @D0) -> pointer @D0 + extsub @bank 3 -666 = GfxFree(pointer gfxNodePtr @A0) + extsub @bank 3 -672 = GfxAssociate(pointer associateNode @A0, pointer gfxNodePtr @A1) + extsub @bank 3 -678 = BitMapScale(pointer bitScaleArgs @A0) + extsub @bank 3 -684 = ScalerDiv(uword factor @D0, uword numerator @D1, uword denominator @D2) -> uword @D0 + extsub @bank 3 -690 = TextExtent(^^RastPort rp @A1, str string @A0, word count @D0, pointer textExtent @A2) -> word @D0 + extsub @bank 3 -696 = TextFit(^^RastPort rp @A1, str string @A0, uword strLen @D0, pointer textExtent @A2, pointer constrainingExtent @A3, word strDirection @D1, uword constrainingBitWidth @D2, uword constrainingBitHeight @D3) -> long @D0 + extsub @bank 3 -702 = GfxLookUp(pointer associateNode @A0) -> pointer @D0 + extsub @bank 3 -708 = VideoControl(^^ColorMap colorMap @A0, pointer tagarray @A1) -> bool @D0 + extsub @bank 3 -714 = OpenMonitor(str monitorName @A1, long displayID @D0) -> pointer @D0 + extsub @bank 3 -720 = CloseMonitor(pointer monitorSpec @A0) -> bool @D0 + extsub @bank 3 -726 = FindDisplayInfo(long displayID @D0) -> pointer @D0 + extsub @bank 3 -732 = NextDisplayInfo(long displayID @D0) -> long @D0 + extsub @bank 3 -756 = GetDisplayInfoData(pointer handle @A0, pointer buf @A1, long size @D0, long tagID @D1, long displayID @D2) -> long @D0 + extsub @bank 3 -762 = FontExtent(^^TextFont font @A0, pointer fontExtent @A1) + extsub @bank 3 -768 = ReadPixelLine8(^^RastPort rp @A0, uword xstart @D0, uword ystart @D1, uword width @D2, pointer array @A2, ^^RastPort tempRP @A1) -> long @D0 + extsub @bank 3 -774 = WritePixelLine8(^^RastPort rp @A0, uword xstart @D0, uword ystart @D1, uword width @D2, pointer array @A2, ^^RastPort tempRP @A1) -> long @D0 + extsub @bank 3 -780 = ReadPixelArray8(^^RastPort rp @A0, uword xstart @D0, uword ystart @D1, uword xstop @D2, uword ystop @D3, pointer array @A2, ^^RastPort temprp @A1) -> long @D0 + extsub @bank 3 -786 = WritePixelArray8(^^RastPort rp @A0, uword xstart @D0, uword ystart @D1, uword xstop @D2, uword ystop @D3, pointer array @A2, ^^RastPort temprp @A1) -> long @D0 + extsub @bank 3 -792 = GetVPModeID(pointer vp @A0) -> long @D0 + extsub @bank 3 -798 = ModeNotAvailable(long modeID @D0) -> long @D0 + extsub @bank 3 -804 = WeighTAMatch(^^TextAttr reqTextAttr @A0, ^^TextAttr targetTextAttr @A1, pointer targetTags @A2) -> word @D0 + extsub @bank 3 -810 = EraseRect(^^RastPort rp @A1, word xMin @D0, word yMin @D1, word xMax @D2, word yMax @D3) + extsub @bank 3 -816 = ExtendFont(^^TextFont font @A0, pointer fontTags @A1) -> long @D0 + extsub @bank 3 -822 = StripFont(^^TextFont font @A0) + extsub @bank 3 -828 = CalcIVG(^^View v @A0, pointer vp @A1) -> uword @D0 + extsub @bank 3 -834 = AttachPalExtra(^^ColorMap cm @A0, pointer vp @A1) -> long @D0 + extsub @bank 3 -840 = ObtainBestPenA(^^ColorMap cm @A0, long r @D1, long g @D2, long b @D3, pointer tags @A1) -> long @D0 + extsub @bank 3 -852 = SetRGB32(pointer vp @A0, long n @D0, long r @D1, long g @D2, long b @D3) + extsub @bank 3 -858 = GetAPen(^^RastPort rp @A0) -> long @D0 + extsub @bank 3 -864 = GetBPen(^^RastPort rp @A0) -> long @D0 + extsub @bank 3 -870 = GetDrMd(^^RastPort rp @A0) -> long @D0 + extsub @bank 3 -876 = GetOutlinePen(^^RastPort rp @A0) -> long @D0 + extsub @bank 3 -882 = LoadRGB32(pointer vp @A0, pointer table @A1) + extsub @bank 3 -888 = SetChipRev(long want @D0) -> long @D0 + extsub @bank 3 -894 = SetABPenDrMd(^^RastPort rp @A1, long apen @D0, long bpen @D1, long drawmode @D2) + extsub @bank 3 -900 = GetRGB32(^^ColorMap cm @A0, long firstcolor @D0, long ncolors @D1, pointer table @A1) + extsub @bank 3 -918 = AllocBitMap(long sizex @D0, long sizey @D1, long depth @D2, long flags @D3, ^^BitMap friend_bitmap @A0) -> ^^BitMap @D0 + extsub @bank 3 -924 = FreeBitMap(^^BitMap bm @A0) + extsub @bank 3 -930 = GetExtSpriteA(pointer ss @A2, pointer tags @A1) -> long @D0 + extsub @bank 3 -936 = CoerceMode(pointer vp @A0, long monitorid @D0, long flags @D1) -> long @D0 + extsub @bank 3 -942 = ChangeVPBitMap(pointer vp @A0, ^^BitMap bm @A1, pointer db @A2) + extsub @bank 3 -948 = ReleasePen(^^ColorMap cm @A0, long n @D0) + extsub @bank 3 -954 = ObtainPen(^^ColorMap cm @A0, long n @D0, long r @D1, long g @D2, long b @D3, long f @D4) -> long @D0 + extsub @bank 3 -960 = GetBitMapAttr(^^BitMap bm @A0, long attrnum @D1) -> long @D0 + extsub @bank 3 -966 = AllocDBufInfo(pointer vp @A0) -> pointer @D0 + extsub @bank 3 -972 = FreeDBufInfo(pointer dbi @A1) + extsub @bank 3 -978 = SetOutlinePen(^^RastPort rp @A0, long pen @D0) -> long @D0 + extsub @bank 3 -984 = SetWriteMask(^^RastPort rp @A0, long msk @D0) -> long @D0 + extsub @bank 3 -990 = SetMaxPen(^^RastPort rp @A0, long maxpen @D0) + extsub @bank 3 -996 = SetRGB32CM(^^ColorMap cm @A0, long n @D0, long r @D1, long g @D2, long b @D3) + extsub @bank 3 -1002 = ScrollRasterBF(^^RastPort rp @A1, word dx @D0, word dy @D1, word xMin @D2, word yMin @D3, word xMax @D4, word yMax @D5) + extsub @bank 3 -1008 = FindColor(^^ColorMap cm @A3, long r @D1, long g @D2, long b @D3, long maxcolor @D4) -> long @D0 + extsub @bank 3 -1020 = AllocSpriteDataA(^^BitMap bm @A2, pointer tags @A1) -> pointer @D0 + extsub @bank 3 -1026 = ChangeExtSpriteA(pointer vp @A0, pointer oldsprite @A1, pointer newsprite @A2, pointer tags @A3) -> long @D0 + extsub @bank 3 -1032 = FreeSpriteData(pointer sp @A2) + extsub @bank 3 -1038 = SetRPAttrsA(^^RastPort rp @A0, pointer tags @A1) + extsub @bank 3 -1044 = GetRPAttrsA(^^RastPort rp @A0, pointer tags @A1) + extsub @bank 3 -1050 = BestModeIDA(pointer tags @A0) -> long @D0 + extsub @bank 3 -1056 = WriteChunkyPixels(^^RastPort rp @A0, uword xstart @D0, uword ystart @D1, uword xstop @D2, uword ystop @D3, pointer array @A2, long bytesperrow @D4) + + ; ---- struct definitions ---- + + struct AreaInfo { ; total size: 24 + pointer VctrTbl ; 0 + pointer VctrPtr ; 4 + pointer FlagTbl ; 8 + pointer FlagPtr ; 12 + word Count ; 16 + word MaxCount ; 18 + word FirstX ; 20 + word FirstY ; 22 + } + + struct BitMap { ; total size: 40 + uword BytesPerRow ; 0 + uword Rows ; 2 + ubyte Flags ; 4 + ubyte Depth ; 5 + uword Pad ; 6 + pointer[8] Planes ; 8 + } + + struct ClipRect { ; total size: 36 + ^^ClipRect Next ; 0 + ^^ClipRect Reservedlink ; 4 + long Obscured ; 8 + ^^BitMap BitMap ; 12 + ubyte[8] emb_Bounds ; 16 + ^^ClipRect Vlink ; 24 + pointer Home ; 28 + pointer Reserved ; 32 + } + + struct ColorMap { ; total size: 52 + ubyte Flags ; 0 + ubyte Type ; 1 + uword Count ; 2 + pointer ColorTable ; 4 + pointer Vpe ; 8 + pointer LowColorBits ; 12 + ubyte TransparencyPlane ; 16 + ubyte SpriteResolution ; 17 + ubyte SpriteResDefault ; 18 + ubyte AuxFlags ; 19 + pointer Vp ; 20 + pointer NormalDisplayInfo ; 24 + pointer CoerceDisplayInfo ; 28 + ^^utility.TagItem Batch_items ; 32 + long VPModeID ; 36 + pointer PalExtra ; 40 + uword Even ; 44 + uword Odd ; 46 + uword Bp_0_base ; 48 + uword Bp_1_base ; 50 + } + + struct Layer { ; total size: 160 + ^^Layer Front ; 0 + ^^Layer Back ; 4 + ^^ClipRect ClipRect ; 8 + ^^RastPort Rp ; 12 + ubyte[8] emb_Bounds ; 16 + ^^Layer Nlink ; 24 + uword Priority ; 28 + uword Flags ; 30 + ^^BitMap SuperBitMap ; 32 + ^^ClipRect SuperClipRect ; 36 + pointer Window ; 40 + word X ; 44 + word Y ; 46 + ^^ClipRect OnScreen ; 48 + ^^ClipRect OffScreen ; 52 + ^^ClipRect Backup ; 56 + ^^ClipRect SuperSaveClipRects ; 60 + ^^ClipRect Undamaged ; 64 + pointer LayerInfo ; 68 + ubyte[46] emb_Lock ; 72 + ^^utility.Hook BackFill ; 118 + long Reserved1 ; 122 + pointer ClipRegion ; 126 + ^^ClipRect Clipped ; 130 + word Width ; 134 + word Height ; 136 + ubyte[18] Reserved2 ; 138 + pointer DamageList ; 156 + } + + struct RastPort { ; total size: 100 + ^^Layer Layer ; 0 + ^^BitMap BitMap ; 4 + pointer AreaPtrn ; 8 + ^^TmpRas TmpRas ; 12 + ^^AreaInfo AreaInfo ; 16 + pointer GelsInfo ; 20 + ubyte Mask ; 24 + byte FgPen ; 25 + byte BgPen ; 26 + byte AOlPen ; 27 + byte DrawMode ; 28 + byte AreaPtSz ; 29 + byte Linpatcnt ; 30 + byte Dummy ; 31 + uword Flags ; 32 + uword LinePtrn ; 34 + word X ; 36 + word Y ; 38 + ubyte[8] Minterms ; 40 + word PenWidth ; 48 + word PenHeight ; 50 + ^^TextFont Font ; 52 + ubyte AlgoStyle ; 56 + ubyte TxFlags ; 57 + uword TxHeight ; 58 + uword TxWidth ; 60 + uword TxBaseline ; 62 + word TxSpacing ; 64 + pointer User ; 66 + long[2] Longreserved ; 70 + uword[7] Wordreserved ; 78 + ubyte[8] Reserved ; 92 + } + + struct TextAttr { ; total size: 8 + str Name ; 0 + uword YSize ; 4 + ubyte Style ; 6 + ubyte Flags ; 7 + } + + struct TextExtent { ; total size: 12 + uword Width ; 0 + uword Height ; 2 + ubyte[8] emb_Extent ; 4 + } + + struct TextFont { ; total size: 52 + ^^exec.Node Succ ; 0 + ^^exec.Node Pred ; 4 + ubyte Type ; 8 + byte Pri ; 9 + str Name ; 10 + ^^exec.MsgPort ReplyPort ; 14 + uword Length ; 18 + uword YSize ; 20 + ubyte Style ; 22 + ubyte Flags ; 23 + uword XSize ; 24 + uword Baseline ; 26 + uword BoldSmear ; 28 + uword Accessors ; 30 + ubyte LoChar ; 32 + ubyte HiChar ; 33 + pointer CharData ; 34 + uword Modulo ; 38 + pointer CharLoc ; 40 + pointer CharSpace ; 44 + pointer CharKern ; 48 + } + + struct TmpRas { ; total size: 8 + pointer RasPtr ; 0 + long Size ; 4 + } + + struct View { ; total size: 18 + pointer ViewPort ; 0 + pointer LOFCprList ; 4 + pointer SHFCprList ; 8 + word DyOffset ; 12 + word DxOffset ; 14 + uword Modes ; 16 + } + + ; ---- constants ---- + const ubyte NEWLOCKS = $0001 + const ubyte CR_NEEDS_NO_CONCEALED_RASTERS = $0001 + const ubyte CR_NEEDS_NO_LAYERBLIT_DAMAGE = $0002 + const ubyte ISLESSX = $0001 + const ubyte ISLESSY = $0002 + const ubyte ISGRTRX = $0004 + const ubyte ISGRTRY = $0008 + const ubyte PRESERVE_COLORS = $0001 + const ubyte AVOID_FLICKER = $0002 + const ubyte IGNORE_MCOMPAT = $0004 + const ubyte COPPER_MOVE = $0000 + const ubyte COPPER_WAIT = $0001 + const ubyte CPRNXTBUF = $0002 + const uword CPR_NT_LOF = $8000 + const uword CPR_NT_SHT = $4000 + const uword CPR_NT_SYS = $2000 + const ubyte EXACT_LINE = $0001 + const ubyte HALF_LINE = $0002 + const uword MODE_640 = $8000 + const ubyte PLNCNTMSK = $7 + const ubyte PLNCNTSHFT = $000c + const ubyte PF2PRI = $40 + const uword COLORON = $0200 + const uword DBLPF = $400 + const uword HOLDNMODIFY = $800 + const ubyte INTERLACE = $0004 + const ubyte PFA_FINE_SCROLL = $F + const ubyte PFB_FINE_SCROLL_SHIFT = $0004 + const ubyte PF_FINE_SCROLL_MASK = $F + const ubyte DIW_HORIZ_POS = $7F + const uword DIW_VRTCL_POS = $1FF + const ubyte DIW_VRTCL_POS_SHIFT = $0007 + const ubyte DFTCH_MASK = $FF + const uword VPOSRLOF = $8000 + const long DTAG_DISP = $80000000 + const long DTAG_DIMS = $80001000 + const long DTAG_MNTR = $80002000 + const long DTAG_NAME = $80003000 + const long DTAG_VEC = $80004000 + const uword DI_AVAIL_NOCHIPS = $0001 + const uword DI_AVAIL_NOMONITOR = $0002 + const uword DI_AVAIL_NOTWITHGENLOCK = $0004 + const long DIPF_IS_LACE = $00000001 + const long DIPF_IS_DUALPF = $00000002 + const long DIPF_IS_PF2PRI = $00000004 + const long DIPF_IS_HAM = $00000008 + const long DIPF_IS_ECS = $00000010 + const long DIPF_IS_AA = $00010000 + const long DIPF_IS_PAL = $00000020 + const long DIPF_IS_SPRITES = $00000040 + const long DIPF_IS_GENLOCK = $00000080 + const long DIPF_IS_WB = $00000100 + const long DIPF_IS_DRAGGABLE = $00000200 + const long DIPF_IS_PANELLED = $00000400 + const long DIPF_IS_BEAMSYNC = $00000800 + const long DIPF_IS_EXTRAHALFBRITE = $00001000 + const long DIPF_IS_SPRITES_ATT = $00002000 + const long DIPF_IS_SPRITES_CHNG_RES = $00004000 + const long DIPF_IS_SPRITES_BORDER = $00008000 + const long DIPF_IS_SCANDBL = $00020000 + const long DIPF_IS_SPRITES_CHNG_BASE = $00040000 + const long DIPF_IS_SPRITES_CHNG_PRI = $00080000 + const long DIPF_IS_DBUFFER = $00100000 + const long DIPF_IS_PROGBEAM = $00200000 + const long DIPF_IS_FOREIGN = $80000000 + const ubyte MCOMPAT_MIXED = $0000 + const ubyte MCOMPAT_SELF = $0001 + const long MCOMPAT_NOBODY = -1 + const ubyte DISPLAYNAMELEN = $0020 + const uword SUSERFLAGS = $00FF + const ubyte VSB_VSPRITE = 0 + const ubyte VSF_VSPRITE = $0001 + const ubyte VSB_SAVEBACK = 1 + const ubyte VSF_SAVEBACK = $0002 + const ubyte VSB_OVERLAY = 2 + const ubyte VSF_OVERLAY = $0004 + const ubyte VSB_MUSTDRAW = 3 + const ubyte VSF_MUSTDRAW = $0008 + const ubyte VSB_BACKSAVED = 8 + const uword VSF_BACKSAVED = $0100 + const ubyte VSB_BOBUPDATE = 9 + const uword VSF_BOBUPDATE = $0200 + const ubyte VSB_GELGONE = 10 + const uword VSF_GELGONE = $0400 + const ubyte VSB_VSOVERFLOW = 11 + const uword VSF_VSOVERFLOW = $0800 + const uword BUSERFLAGS = $00FF + const ubyte BB_SAVEBOB = 0 + const ubyte BF_SAVEBOB = $0001 + const ubyte BB_BOBISCOMP = 1 + const ubyte BF_BOBISCOMP = $0002 + const ubyte BB_BWAITING = 8 + const uword BF_BWAITING = $0100 + const ubyte BB_BDRAWN = 9 + const uword BF_BDRAWN = $0200 + const ubyte BB_BOBSAWAY = 10 + const uword BF_BOBSAWAY = $0400 + const ubyte BB_BOBNIX = 11 + const uword BF_BOBNIX = $0800 + const ubyte BB_SAVEPRESERVE = 12 + const uword BF_SAVEPRESERVE = $1000 + const ubyte BB_OUTSTEP = 13 + const uword BF_OUTSTEP = $2000 + const ubyte ANFRACSIZE = $0006 + const uword ANIMHALF = $0020 + const uword RINGTRIGGER = $0001 + const uword BITSET = $8000 + const ubyte BITCLR = $0000 + const ubyte AGNUS = $0001 + const ubyte DENISE = $0001 + const ubyte BMB_CLEAR = 0 + const ubyte BMF_CLEAR = $0001 + const ubyte BMB_DISPLAYABLE = 1 + const ubyte BMF_DISPLAYABLE = $0002 + const ubyte BMB_INTERLEAVED = 2 + const ubyte BMF_INTERLEAVED = $0004 + const ubyte BMB_STANDARD = 3 + const ubyte BMF_STANDARD = $0008 + const ubyte BMB_MINPLANES = 4 + const ubyte BMF_MINPLANES = $0010 + const ubyte BMB_HIJACKED = 7 + const ubyte BMF_HIJACKED = $0080 + const ubyte BMB_RTGTAGS = 8 + const uword BMF_RTGTAGS = $0100 + const ubyte BMB_RTGCHECK = 9 + const uword BMF_RTGCHECK = $0200 + const ubyte BMB_FRIENDISTAG = 10 + const uword BMF_FRIENDISTAG = $0400 + const ubyte BMB_INVALID = 11 + const uword BMF_INVALID = $0800 + const ubyte BMA_HEIGHT = $0000 + const ubyte BMA_DEPTH = $0004 + const ubyte BMA_WIDTH = $0008 + const ubyte BMA_FLAGS = $000c + const long BMATags_Friend = $80000000 + const long BMATags_Depth = $80000001 + const long BMATags_PixelFormat = $80000002 + const long BMATags_Clear = $80000003 + const long BMATags_Displayable = $80000004 + const long BMATags_Private1 = $80000005 + const long BMATags_NoMemory = $80000006 + const long BMATags_NoSprite = $80000007 + const long BMATags_Private2 = $80000008 + const long BMATags_Private3 = $80000009 + const long BMATags_ModeWidth = $8000000a + const long BMATags_ModeHeight = $8000000b + const long BMATags_RenderFunc = $8000000c + const long BMATags_SaveFunc = $8000000d + const long BMATags_UserData = $8000000e + const long BMATags_Alignment = $8000000f + const long BMATags_ConstantBytesPerRow = $80000010 + const long BMATags_UserPrivate = $80000011 + const long BMATags_Private4 = $80000012 + const long BMATags_Private5 = $80000013 + const long BMATags_Private6 = $80000014 + const long BMATags_Private7 = $80000015 + const long BMATags_DisplayID = $80000032 + const long BMATags_BitmapInvisible = $80000037 + const long BMATags_BitmapColors = $80000029 + const long BMATags_BitmapColors32 = $80000043 + const ubyte OWNBLITTERn = $0000 + const ubyte QBOWNERn = $0001 + const ubyte BLITMSG_FAULTn = $0002 + const ubyte BLITMSG_FAULT = $0001 + const ubyte QBOWNER = $0001 + const ubyte GBFLAGSB_TIMER = 6 + const ubyte GBFLAGSF_TIMER = $0040 + const ubyte GBFLAGSB_LASTBLIT = 7 + const ubyte GBFLAGSF_LASTBLIT = $0080 + const ubyte GFXB_BIG_BLITS = 0 + const ubyte GFXF_BIG_BLITS = $0001 + const ubyte GFXB_HR_AGNUS = 0 + const ubyte GFXF_HR_AGNUS = $0001 + const ubyte GFXB_HR_DENISE = 1 + const ubyte GFXF_HR_DENISE = $0002 + const ubyte GFXB_AA_ALICE = 2 + const ubyte GFXF_AA_ALICE = $0004 + const ubyte GFXB_AA_LISA = 3 + const ubyte GFXF_AA_LISA = $0008 + const ubyte GFXB_AA_MLISA = 4 + const ubyte GFXF_AA_MLISA = $0010 + const long SETCHIPREV_BEST = $ffffffff + const ubyte BUS_16 = $0000 + const ubyte NML_CAS = $0000 + const ubyte BUS_32 = $0001 + const ubyte DBL_CAS = $0002 + const ubyte NTSCn = $0000 + const ubyte NTSC = $0001 + const ubyte GENLOCn = $0001 + const ubyte GENLOC = $0001 + const ubyte PALn = $0002 + const ubyte PAL = $0001 + const ubyte TODA_SAFEn = $0003 + const ubyte TODA_SAFE = $0001 + const ubyte REALLY_PALn = $0004 + const ubyte REALLY_PAL = $0001 + const ubyte LPEN_SWAP_FRAMESn = $0005 + const ubyte LPEN_SWAP_FRAMES = $0001 + const ubyte GRAPHICS_GFXNODES_I = $0001 + const ubyte SS_GRAPHICS = $02 + const ubyte VIEW_EXTRA_TYPE = $0001 + const ubyte VIEWPORT_EXTRA_TYPE = $0002 + const ubyte SPECIAL_MONITOR_TYPE = $0003 + const ubyte MONITOR_SPEC_TYPE = $0004 + const ubyte LAYERSIMPLE = $0001 + const ubyte LAYERSMART = $0002 + const ubyte LAYERSUPER = $0004 + const ubyte LAYERUPDATING = $10 + const ubyte LAYERBACKDROP = $40 + const ubyte LAYERREFRESH = $80 + const uword LAYERIREFRESH = $200 + const uword LAYERIREFRESH2 = $400 + const uword LAYER_CLIPRECTS_LOST = $100 + const uword LAYERSAVEBACK = $800 + const uword LAYERHIDDEN = $1000 + const ubyte NEWLAYERINFO_CALLED = $0001 + const ubyte LAYERS_NOBACKFILL = $0001 + const ubyte LAYERS_BACKFILL = $0000 + const ubyte LAYER_BACKMOST = $0000 + const ubyte LAYER_FRONTMOST = $0001 + const long MONITOR_ID_MASK = $FFFF1000 + const long DEFAULT_MONITOR_ID = $00000000 + const long NTSC_MONITOR_ID = $00011000 + const long PAL_MONITOR_ID = $00021000 + const long LORES_KEY = $00000000 + const long HIRES_KEY = $00008000 + const long SUPER_KEY = $00008020 + const long HAM_KEY = $00000800 + const long LORESLACE_KEY = $00000004 + const long HIRESLACE_KEY = $00008004 + const long SUPERLACE_KEY = $00008024 + const long HAMLACE_KEY = $00000804 + const long LORESDPF_KEY = $00000400 + const long HIRESDPF_KEY = $00008400 + const long SUPERDPF_KEY = $00008420 + const long LORESLACEDPF_KEY = $00000404 + const long HIRESLACEDPF_KEY = $00008404 + const long SUPERLACEDPF_KEY = $00008424 + const long LORESDPF2_KEY = $00000440 + const long HIRESDPF2_KEY = $00008440 + const long SUPERDPF2_KEY = $00008460 + const long LORESLACEDPF2_KEY = $00000444 + const long HIRESLACEDPF2_KEY = $00008444 + const long SUPERLACEDPF2_KEY = $00008464 + const long EXTRAHALFBRITE_KEY = $00000080 + const long EXTRAHALFBRITELACE_KEY = $00000084 + const long HIRESHAM_KEY = $00008800 + const long SUPERHAM_KEY = $00008820 + const long HIRESEHB_KEY = $00008080 + const long SUPEREHB_KEY = $000080a0 + const long HIRESHAMLACE_KEY = $00008804 + const long SUPERHAMLACE_KEY = $00008824 + const long HIRESEHBLACE_KEY = $00008084 + const long SUPEREHBLACE_KEY = $000080a4 + const long LORESSDBL_KEY = $00000008 + const long LORESHAMSDBL_KEY = $00000808 + const long LORESEHBSDBL_KEY = $00000088 + const long HIRESHAMSDBL_KEY = $00008808 + const long VGA_MONITOR_ID = $00031000 + const long VGAEXTRALORES_KEY = $00031004 + const long VGALORES_KEY = $00039004 + const long VGAPRODUCT_KEY = $00039024 + const long VGAHAM_KEY = $00031804 + const long VGAEXTRALORESLACE_KEY = $00031005 + const long VGALORESLACE_KEY = $00039005 + const long VGAPRODUCTLACE_KEY = $00039025 + const long VGAHAMLACE_KEY = $00031805 + const long VGAEXTRALORESDPF_KEY = $00031404 + const long VGALORESDPF_KEY = $00039404 + const long VGAPRODUCTDPF_KEY = $00039424 + const long VGAEXTRALORESLACEDPF_KEY = $00031405 + const long VGALORESLACEDPF_KEY = $00039405 + const long VGAPRODUCTLACEDPF_KEY = $00039425 + const long VGAEXTRALORESDPF2_KEY = $00031444 + const long VGALORESDPF2_KEY = $00039444 + const long VGAPRODUCTDPF2_KEY = $00039464 + const long VGAEXTRALORESLACEDPF2_KEY = $00031445 + const long VGALORESLACEDPF2_KEY = $00039445 + const long VGAPRODUCTLACEDPF2_KEY = $00039465 + const long VGAEXTRAHALFBRITE_KEY = $00031084 + const long VGAEXTRAHALFBRITELACE_KEY = $00031085 + const long VGAPRODUCTHAM_KEY = $00039824 + const long VGALORESHAM_KEY = $00039804 + const long VGAPRODUCTHAMLACE_KEY = $00039825 + const long VGALORESHAMLACE_KEY = $00039805 + const long VGALORESEHB_KEY = $00039084 + const long VGALORESEHBLACE_KEY = $00039085 + const long VGAEHB_KEY = $000390a4 + const long VGAEHBLACE_KEY = $000390a5 + const long A2024_MONITOR_ID = $00041000 + const long A2024TENHERTZ_KEY = $00041000 + const long A2024FIFTEENHERTZ_KEY = $00049000 + const long PROTO_MONITOR_ID = $00051000 + const long EURO72_MONITOR_ID = $00061000 + const long EURO72EXTRALORES_KEY = $00061004 + const long EURO72LORES_KEY = $00069004 + const long EURO72PRODUCT_KEY = $00069024 + const long EURO72HAM_KEY = $00061804 + const long EURO72EXTRALORESLACE_KEY = $00061005 + const long EURO72LORESLACE_KEY = $00069005 + const long EURO72PRODUCTLACE_KEY = $00069025 + const long EURO72HAMLACE_KEY = $00061805 + const long EURO72EXTRALORESDPF_KEY = $00061404 + const long EURO72LORESDPF_KEY = $00069404 + const long EURO72PRODUCTDPF_KEY = $00069424 + const long EURO72EXTRALORESLACEDPF_KEY = $00061405 + const long EURO72LORESLACEDPF_KEY = $00069405 + const long EURO72PRODUCTLACEDPF_KEY = $00069425 + const long EURO72EXTRALORESDPF2_KEY = $00061444 + const long EURO72LORESDPF2_KEY = $00069444 + const long EURO72PRODUCTDPF2_KEY = $00069464 + const long EURO72EXTRALORESLACEDPF2_KEY = $00061445 + const long EURO72LORESLACEDPF2_KEY = $00069445 + const long EURO72PRODUCTLACEDPF2_KEY = $00069465 + const long EURO72EXTRAHALFBRITE_KEY = $00061084 + const long EURO72EXTRAHALFBRITELACE_KEY = $00061085 + const long EURO72PRODUCTHAM_KEY = $00069824 + const long EURO72PRODUCTHAMLACE_KEY = $00069825 + const long EURO72LORESHAM_KEY = $00069804 + const long EURO72LORESHAMLACE_KEY = $00069805 + const long EURO72LORESEHB_KEY = $00069084 + const long EURO72LORESEHBLACE_KEY = $00069085 + const long EURO72EHB_KEY = $000690a4 + const long EURO72EHBLACE_KEY = $000690a5 + const long EURO72EXTRALORESDBL_KEY = $00061000 + const long EURO72LORESDBL_KEY = $00069000 + const long EURO72PRODUCTDBL_KEY = $00069020 + const long EURO72EXTRALORESHAMDBL_KEY = $00061800 + const long EURO72LORESHAMDBL_KEY = $00069800 + const long EURO72PRODUCTHAMDBL_KEY = $00069820 + const long EURO72EXTRALORESEHBDBL_KEY = $00061080 + const long EURO72LORESEHBDBL_KEY = $00069080 + const long EURO72PRODUCTEHBDBL_KEY = $000690a0 + const long EURO36_MONITOR_ID = $00071000 + const long SUPER72_MONITOR_ID = $00081000 + const long SUPER72LORESDBL_KEY = $00081008 + const long SUPER72HIRESDBL_KEY = $00089008 + const long SUPER72SUPERDBL_KEY = $00089028 + const long SUPER72LORESHAMDBL_KEY = $00081808 + const long SUPER72HIRESHAMDBL_KEY = $00089808 + const long SUPER72SUPERHAMDBL_KEY = $00089828 + const long SUPER72LORESEHBDBL_KEY = $00081088 + const long SUPER72HIRESEHBDBL_KEY = $00089088 + const long SUPER72SUPEREHBDBL_KEY = $000890a8 + const long DBLNTSC_MONITOR_ID = $00091000 + const long DBLNTSCLORES_KEY = $00091000 + const long DBLNTSCLORESFF_KEY = $00091004 + const long DBLNTSCLORESHAM_KEY = $00091800 + const long DBLNTSCLORESHAMFF_KEY = $00091804 + const long DBLNTSCLORESEHB_KEY = $00091080 + const long DBLNTSCLORESEHBFF_KEY = $00091084 + const long DBLNTSCLORESLACE_KEY = $00091005 + const long DBLNTSCLORESHAMLACE_KEY = $00091805 + const long DBLNTSCLORESEHBLACE_KEY = $00091085 + const long DBLNTSCLORESDPF_KEY = $00091400 + const long DBLNTSCLORESDPFFF_KEY = $00091404 + const long DBLNTSCLORESDPFLACE_KEY = $00091405 + const long DBLNTSCLORESDPF2_KEY = $00091440 + const long DBLNTSCLORESDPF2FF_KEY = $00091444 + const long DBLNTSCLORESDPF2LACE_KEY = $00091445 + const long DBLNTSCHIRES_KEY = $00099000 + const long DBLNTSCHIRESFF_KEY = $00099004 + const long DBLNTSCHIRESHAM_KEY = $00099800 + const long DBLNTSCHIRESHAMFF_KEY = $00099804 + const long DBLNTSCHIRESLACE_KEY = $00099005 + const long DBLNTSCHIRESHAMLACE_KEY = $00099805 + const long DBLNTSCHIRESEHB_KEY = $00099080 + const long DBLNTSCHIRESEHBFF_KEY = $00099084 + const long DBLNTSCHIRESEHBLACE_KEY = $00099085 + const long DBLNTSCHIRESDPF_KEY = $00099400 + const long DBLNTSCHIRESDPFFF_KEY = $00099404 + const long DBLNTSCHIRESDPFLACE_KEY = $00099405 + const long DBLNTSCHIRESDPF2_KEY = $00099440 + const long DBLNTSCHIRESDPF2FF_KEY = $00099444 + const long DBLNTSCHIRESDPF2LACE_KEY = $00099445 + const long DBLNTSCEXTRALORES_KEY = $00091200 + const long DBLNTSCEXTRALORESHAM_KEY = $00091a00 + const long DBLNTSCEXTRALORESEHB_KEY = $00091280 + const long DBLNTSCEXTRALORESDPF_KEY = $00091600 + const long DBLNTSCEXTRALORESDPF2_KEY = $00091640 + const long DBLNTSCEXTRALORESFF_KEY = $00091204 + const long DBLNTSCEXTRALORESHAMFF_KEY = $00091a04 + const long DBLNTSCEXTRALORESEHBFF_KEY = $00091284 + const long DBLNTSCEXTRALORESDPFFF_KEY = $00091604 + const long DBLNTSCEXTRALORESDPF2FF_KEY = $00091644 + const long DBLNTSCEXTRALORESLACE_KEY = $00091205 + const long DBLNTSCEXTRALORESHAMLACE_KEY = $00091a05 + const long DBLNTSCEXTRALORESEHBLACE_KEY = $00091285 + const long DBLNTSCEXTRALORESDPFLACE_KEY = $00091605 + const long DBLNTSCEXTRALORESDPF2LACE_KEY = $00091645 + const long DBLPAL_MONITOR_ID = $000a1000 + const long DBLPALLORES_KEY = $000a1000 + const long DBLPALLORESFF_KEY = $000a1004 + const long DBLPALLORESHAM_KEY = $000a1800 + const long DBLPALLORESHAMFF_KEY = $000a1804 + const long DBLPALLORESEHB_KEY = $000a1080 + const long DBLPALLORESEHBFF_KEY = $000a1084 + const long DBLPALLORESLACE_KEY = $000a1005 + const long DBLPALLORESHAMLACE_KEY = $000a1805 + const long DBLPALLORESEHBLACE_KEY = $000a1085 + const long DBLPALLORESDPF_KEY = $000a1400 + const long DBLPALLORESDPFLACE_KEY = $000a1404 + const long DBLPALLORESDPF2_KEY = $000a1440 + const long DBLPALLORESDPF2LACE_KEY = $000a1444 + const long DBLPALHIRES_KEY = $000a9000 + const long DBLPALHIRESFF_KEY = $000a9004 + const long DBLPALHIRESHAM_KEY = $000a9800 + const long DBLPALHIRESHAMFF_KEY = $000a9804 + const long DBLPALHIRESLACE_KEY = $000a9005 + const long DBLPALHIRESHAMLACE_KEY = $000a9805 + const long DBLPALHIRESEHB_KEY = $000a9080 + const long DBLPALHIRESEHBFF_KEY = $000a9084 + const long DBLPALHIRESEHBLACE_KEY = $000a9085 + const long DBLPALHIRESDPF_KEY = $000a9400 + const long DBLPALHIRESDPFLACE_KEY = $000a9404 + const long DBLPALHIRESDPF2_KEY = $000a9440 + const long DBLPALHIRESDPF2LACE_KEY = $000a9444 + const long DBLPALEXTRALORES_KEY = $000a1200 + const long DBLPALEXTRALORESHAM_KEY = $000a1a00 + const long DBLPALEXTRALORESEHB_KEY = $000a1280 + const long DBLPALEXTRALORESDPF_KEY = $000a1600 + const long DBLPALEXTRALORESDPF2_KEY = $000a1640 + const long DBLPALEXTRALORESFF_KEY = $000a1204 + const long DBLPALEXTRALORESHAMFF_KEY = $000a1a04 + const long DBLPALEXTRALORESEHBFF_KEY = $000a1284 + const long DBLPALEXTRALORESDPFFF_KEY = $000a1604 + const long DBLPALEXTRALORESDPF2FF_KEY = $000a1644 + const long DBLPALEXTRALORESLACE_KEY = $000a1205 + const long DBLPALEXTRALORESHAMLACE_KEY = $000a1a05 + const long DBLPALEXTRALORESEHBLACE_KEY = $000a1285 + const long DBLPALEXTRALORESDPFLACE_KEY = $000a1605 + const long DBLPALEXTRALORESDPF2LACE_KEY = $000a1645 + const long BIDTAG_DIPFMustHave = $80000001 + const long BIDTAG_DIPFMustNotHave = $80000002 + const long BIDTAG_ViewPort = $80000003 + const long BIDTAG_NominalWidth = $80000004 + const long BIDTAG_NominalHeight = $80000005 + const long BIDTAG_DesiredWidth = $80000006 + const long BIDTAG_DesiredHeight = $80000007 + const long BIDTAG_Depth = $80000008 + const long BIDTAG_MonitorID = $80000009 + const long BIDTAG_SourceID = $8000000a + const long BIDTAG_RedBits = $8000000b + const long BIDTAG_BlueBits = $8000000c + const long BIDTAG_GreenBits = $8000000d + const long BIDTAG_GfxPrivate = $8000000e + const ubyte MSB_REQUEST_NTSC = 0 + const ubyte MSF_REQUEST_NTSC = $0001 + const ubyte MSB_REQUEST_PAL = 1 + const ubyte MSF_REQUEST_PAL = $0002 + const ubyte MSB_REQUEST_SPECIAL = 2 + const ubyte MSF_REQUEST_SPECIAL = $0004 + const ubyte MSB_REQUEST_A2024 = 3 + const ubyte MSF_REQUEST_A2024 = $0008 + const ubyte MSB_DOUBLE_SPRITES = 4 + const ubyte MSF_DOUBLE_SPRITES = $0010 + const ubyte STANDARD_VIEW_X = $81 + const ubyte STANDARD_VIEW_Y = $2C + const ubyte RPB_FRST_DOT = 0 + const ubyte RPF_FRST_DOT = $0001 + const ubyte RPB_ONE_DOT = 1 + const ubyte RPF_ONE_DOT = $0002 + const ubyte RPB_DBUFFER = 2 + const ubyte RPF_DBUFFER = $0004 + const ubyte RPB_AREAOUTLINE = 3 + const ubyte RPF_AREAOUTLINE = $0008 + const ubyte RPB_NOCROSSFILL = 5 + const ubyte RPF_NOCROSSFILL = $0020 + const ubyte RP_JAM1 = $0000 + const ubyte RP_JAM2 = $0001 + const ubyte RP_COMPLEMENT = $0002 + const ubyte RP_INVERSVID = $0004 + const ubyte RPB_TXSCALE = 0 + const ubyte RPF_TXSCALE = $0001 + const ubyte ONE_DOTn = $0001 + const ubyte ONE_DOT = $2 + const ubyte FRST_DOTn = $0000 + const ubyte FRST_DOT = $0001 + const long RPTAG_Font = $80000000 + const long RPTAG_APen = $80000002 + const long RPTAG_BPen = $80000003 + const long RPTAG_DrMd = $80000004 + const long RPTAG_OutLinePen = $80000005 + const long RPTAG_OutlinePen = $80000005 + const long RPTAG_WriteMask = $80000006 + const long RPTAG_MaxPen = $80000007 + const long RPTAG_DrawBounds = $80000008 + const long SPRITEA_Width = $81000000 + const long SPRITEA_XReplication = $81000002 + const long SPRITEA_YReplication = $81000004 + const long SPRITEA_OutputHeight = $81000006 + const long SPRITEA_Attached = $81000008 + const long SPRITEA_OldDataFormat = $8100000a + const long GSTAG_SPRITE_NUM = $82000020 + const long GSTAG_ATTACHED = $82000022 + const long GSTAG_SOFTSPRITE = $82000024 + const long GSTAG_SCANDOUBLED = $83000000 + const ubyte FS_NORMAL = $0000 + const ubyte FSB_UNDERLINED = 0 + const ubyte FSF_UNDERLINED = $0001 + const ubyte FSB_BOLD = 1 + const ubyte FSF_BOLD = $0002 + const ubyte FSB_ITALIC = 2 + const ubyte FSF_ITALIC = $0004 + const ubyte FSB_EXTENDED = 3 + const ubyte FSF_EXTENDED = $0008 + const ubyte FSB_COLORFONT = 6 + const ubyte FSF_COLORFONT = $0040 + const ubyte FSB_TAGGED = 7 + const ubyte FSF_TAGGED = $0080 + const ubyte FPB_ROMFONT = 0 + const ubyte FPF_ROMFONT = $0001 + const ubyte FPB_DISKFONT = 1 + const ubyte FPF_DISKFONT = $0002 + const ubyte FPB_REVPATH = 2 + const ubyte FPF_REVPATH = $0004 + const ubyte FPB_TALLDOT = 3 + const ubyte FPF_TALLDOT = $0008 + const ubyte FPB_WIDEDOT = 4 + const ubyte FPF_WIDEDOT = $0010 + const ubyte FPB_PROPORTIONAL = 5 + const ubyte FPF_PROPORTIONAL = $0020 + const ubyte FPB_DESIGNED = 6 + const ubyte FPF_DESIGNED = $0040 + const ubyte FPB_REMOVED = 7 + const ubyte FPF_REMOVED = $0080 + const long TA_DeviceDPI = $80000001 + const uword MAXFONTMATCHWEIGHT = $7fff + const ubyte TE0B_NOREMFONT = 0 + const ubyte TE0F_NOREMFONT = $0001 + const uword CT_COLORFONT = $0001 + const uword CT_GREYFONT = $0002 + const uword CT_ANTIALIAS = $0004 + const ubyte CTB_MAPCOLOR = 0 + const ubyte CTF_MAPCOLOR = $0001 + const long VTAG_END_CM = $00000000 + const long VTAG_CHROMAKEY_CLR = $80000000 + const long VTAG_CHROMAKEY_SET = $80000001 + const long VTAG_BITPLANEKEY_CLR = $80000002 + const long VTAG_BITPLANEKEY_SET = $80000003 + const long VTAG_BORDERBLANK_CLR = $80000004 + const long VTAG_BORDERBLANK_SET = $80000005 + const long VTAG_BORDERNOTRANS_CLR = $80000006 + const long VTAG_BORDERNOTRANS_SET = $80000007 + const long VTAG_CHROMA_PEN_CLR = $80000008 + const long VTAG_CHROMA_PEN_SET = $80000009 + const long VTAG_CHROMA_PLANE_SET = $8000000A + const long VTAG_ATTACH_CM_SET = $8000000B + const long VTAG_NEXTBUF_CM = $8000000C + const long VTAG_BATCH_CM_CLR = $8000000D + const long VTAG_BATCH_CM_SET = $8000000E + const long VTAG_NORMAL_DISP_GET = $8000000F + const long VTAG_NORMAL_DISP_SET = $80000010 + const long VTAG_COERCE_DISP_GET = $80000011 + const long VTAG_COERCE_DISP_SET = $80000012 + const long VTAG_VIEWPORTEXTRA_GET = $80000013 + const long VTAG_VIEWPORTEXTRA_SET = $80000014 + const long VTAG_CHROMAKEY_GET = $80000015 + const long VTAG_BITPLANEKEY_GET = $80000016 + const long VTAG_BORDERBLANK_GET = $80000017 + const long VTAG_BORDERNOTRANS_GET = $80000018 + const long VTAG_CHROMA_PEN_GET = $80000019 + const long VTAG_CHROMA_PLANE_GET = $8000001A + const long VTAG_ATTACH_CM_GET = $8000001B + const long VTAG_BATCH_CM_GET = $8000001C + const long VTAG_BATCH_ITEMS_GET = $8000001D + const long VTAG_BATCH_ITEMS_SET = $8000001E + const long VTAG_BATCH_ITEMS_ADD = $8000001F + const long VTAG_VPMODEID_GET = $80000020 + const long VTAG_VPMODEID_SET = $80000021 + const long VTAG_VPMODEID_CLR = $80000022 + const long VTAG_USERCLIP_GET = $80000023 + const long VTAG_USERCLIP_SET = $80000024 + const long VTAG_USERCLIP_CLR = $80000025 + const long VTAG_PF1_BASE_GET = $80000026 + const long VTAG_PF2_BASE_GET = $80000027 + const long VTAG_SPEVEN_BASE_GET = $80000028 + const long VTAG_SPODD_BASE_GET = $80000029 + const long VTAG_PF1_BASE_SET = $8000002a + const long VTAG_PF2_BASE_SET = $8000002b + const long VTAG_SPEVEN_BASE_SET = $8000002c + const long VTAG_SPODD_BASE_SET = $8000002d + const long VTAG_BORDERSPRITE_GET = $8000002e + const long VTAG_BORDERSPRITE_SET = $8000002f + const long VTAG_BORDERSPRITE_CLR = $80000030 + const long VTAG_SPRITERESN_SET = $80000031 + const long VTAG_SPRITERESN_GET = $80000032 + const long VTAG_PF1_TO_SPRITEPRI_SET = $80000033 + const long VTAG_PF1_TO_SPRITEPRI_GET = $80000034 + const long VTAG_PF2_TO_SPRITEPRI_SET = $80000035 + const long VTAG_PF2_TO_SPRITEPRI_GET = $80000036 + const long VTAG_IMMEDIATE = $80000037 + const long VTAG_FULLPALETTE_SET = $80000038 + const long VTAG_FULLPALETTE_GET = $80000039 + const long VTAG_FULLPALETTE_CLR = $8000003A + const long VTAG_DEFSPRITERESN_SET = $8000003B + const long VTAG_DEFSPRITERESN_GET = $8000003C + const long VC_IntermediateCLUpdate = $80000080 + const long VC_IntermediateCLUpdate_Query = $80000081 + const long VC_NoColorPaletteLoad = $80000082 + const long VC_NoColorPaletteLoad_Query = $80000083 + const long VC_DUALPF_Disable = $80000084 + const long VC_DUALPF_Disable_Query = $80000085 + const ubyte GENLOCK_VIDEO = $2 + const ubyte V_LACE = $4 + const ubyte V_DOUBLESCAN = $8 + const ubyte V_SUPERHIRES = $20 + const ubyte V_PFBA = $40 + const ubyte V_EXTRA_HALFBRITE = $80 + const uword GENLOCK_AUDIO = $100 + const uword V_DUALPF = $400 + const uword V_HAM = $800 + const uword V_EXTENDED_MODE = $1000 + const uword V_VP_HIDE = $2000 + const uword V_SPRITES = $4000 + const uword V_HIRES = $8000 + const uword EXTEND_VSTRUCT = $1000 + const ubyte VPB_A2024 = 6 + const ubyte VPF_A2024 = $0040 + const ubyte VPB_TENHZ = 4 + const ubyte VPF_TENHZ = $0010 + const ubyte COLORMAP_TYPE_V1_2 = $00 + const ubyte COLORMAP_TYPE_V1_4 = $01 + const ubyte COLORMAP_TYPE_V39 = $02 + const ubyte COLORMAP_TRANSPARENCY = $01 + const ubyte COLORPLANE_TRANSPARENCY = $02 + const ubyte BORDER_BLANKING = $04 + const ubyte BORDER_NOTRANSPARENCY = $08 + const ubyte VIDEOCONTROL_BATCH = $10 + const ubyte USER_COPPER_CLIP = $20 + const ubyte BORDER_SPRITES = $40 + const ubyte CMB_CMTRANS = 0 + const ubyte CMF_CMTRANS = $0001 + const ubyte CMB_CPTRANS = 1 + const ubyte CMF_CPTRANS = $0002 + const ubyte CMB_BRDRBLNK = 2 + const ubyte CMF_BRDRBLNK = $0004 + const ubyte CMB_BRDNTRAN = 3 + const ubyte CMF_BRDNTRAN = $0008 + const ubyte CMB_BRDRSPRT = 6 + const ubyte CMF_BRDRSPRT = $0040 + const ubyte SPRITERESN_ECS = $0000 + const ubyte SPRITERESN_140NS = $0001 + const ubyte SPRITERESN_70NS = $0002 + const ubyte SPRITERESN_35NS = $0003 + const long SPRITERESN_DEFAULT = -1 + const ubyte CMAB_FULLPALETTE = 0 + const ubyte CMAF_FULLPALETTE = $0001 + const ubyte CMAB_NO_INTERMED_UPDATE = 1 + const ubyte CMAF_NO_INTERMED_UPDATE = $0002 + const ubyte CMAB_NO_COLOR_LOAD = 2 + const ubyte CMAF_NO_COLOR_LOAD = $0004 + const ubyte CMAB_DUALPF_DISABLE = 3 + const ubyte CMAF_DUALPF_DISABLE = $0008 + const long PRECISION_EXACT = -1 + const ubyte PRECISION_IMAGE = $0000 + const ubyte PRECISION_ICON = $0010 + const ubyte PRECISION_GUI = $0020 + const long OBP_Precision = $84000000 + const long OBP_FailIfBad = $84000001 + const ubyte PEN_EXCLUSIVE = $0001 + const ubyte PEN_NO_SETCOLOR = $0002 + const ubyte PENB_EXCLUSIVE = 0 + const ubyte PENF_EXCLUSIVE = $0001 + const ubyte PENB_NO_SETCOLOR = 1 + const ubyte PENF_NO_SETCOLOR = $0002 + const ubyte VPXB_FREE_ME = $0000 + const ubyte VPXF_FREE_ME = $0001 + const ubyte VPXB_VP_LAST = $0001 + const ubyte VPXF_VP_LAST = $0002 + const ubyte VPXB_STRADDLES_256 = $0004 + const ubyte VPXF_STRADDLES_256 = $0010 + const ubyte VPXB_STRADDLES_512 = $0005 + const ubyte VPXF_STRADDLES_512 = $0020 + const ubyte MVP_OK = $0000 + const ubyte MVP_NO_MEM = $0001 + const ubyte MVP_NO_VPE = $0002 + const ubyte MVP_NO_DSPINS = $0003 + const ubyte MVP_NO_DISPLAY = $0004 + const ubyte MVP_OFF_BOTTOM = $0005 + const ubyte MCOP_OK = $0000 + const ubyte MCOP_NO_MEM = $0001 + const ubyte MCOP_NOP = $0002 + const uword BMF_CHECKMASK = $0f80 + const uword BMF_CHECKVALUE = $0700 + const ubyte SETCHIPREV_A = $0001 + const ubyte SETCHIPREV_ECS = $0003 + const ubyte SETCHIPREV_AA = $000f + const ubyte BANDWIDTH_1X = $0000 + const ubyte BANDWIDTH_2XNML = $0001 + const ubyte BANDWIDTH_2XDBL = $0002 + const ubyte BANDWIDTH_4X = $0003 + const long VGAEXTRALORESHAM_KEY = $00031804 + const long VGAEXTRALORESHAMLACE_KEY = $00031805 + const long VGAEXTRALORESEHB_KEY = $00031084 + const long VGAEXTRALORESEHBLACE_KEY = $00031085 + const long EURO72EXTRALORESHAM_KEY = $00061804 + const long EURO72EXTRALORESHAMLACE_KEY = $00061805 + const long EURO72EXTRALORESEHB_KEY = $00061084 + const long EURO72EXTRALORESEHBLACE_KEY = $00061085 + const uword MUST_FLAGS = $100e + const ubyte COLORMAP_TYPE_V36 = $0001 +} +;; End of auto-generated graphics_lib.sfd diff --git a/compiler/res/prog8lib/shared_amiga_icon.p8 b/compiler/res/prog8lib/shared_amiga_icon.p8 new file mode 100644 index 000000000..af9cd4b82 --- /dev/null +++ b/compiler/res/prog8lib/shared_amiga_icon.p8 @@ -0,0 +1,216 @@ +;; Auto-generated from icon_lib.sfd and icon_lib.i +;; Library base: _IconBase in prog8: sys.IconBase +;; Bank: 11 +;; Functions: 24 + +%import graphics +%import intuition + +icon { + %option merge, no_symbol_prefixing + extsub @bank 11 -54 = FreeFreeList(pointer freelist @A0) + extsub @bank 11 -72 = AddFreeList(pointer freelist @A0, pointer mem @A1, long size @A2) -> bool @D0 + extsub @bank 11 -78 = GetDiskObject(str name @A0) -> ^^DiskObject @D0 + extsub @bank 11 -84 = PutDiskObject(str name @A0, ^^DiskObject diskobj @A1) -> bool @D0 + extsub @bank 11 -90 = FreeDiskObject(^^DiskObject diskobj @A0) + extsub @bank 11 -96 = FindToolType(str toolTypeArray @A0, str typeName @A1) -> pointer @D0 + extsub @bank 11 -102 = MatchToolValue(str typeString @A0, str value @A1) -> bool @D0 + extsub @bank 11 -108 = BumpRevision(str newname @A0, str oldname @A1) -> str @D0 + extsub @bank 11 -114 = FreeAlloc(pointer free @A0, long len @A1, long k_type @A2) -> pointer @D0 + extsub @bank 11 -120 = GetDefDiskObject(long k_type @D0) -> ^^DiskObject @D0 + extsub @bank 11 -126 = PutDefDiskObject(^^DiskObject diskObject @A0) -> bool @D0 + extsub @bank 11 -132 = GetDiskObjectNew(str name @A0) -> ^^DiskObject @D0 + extsub @bank 11 -138 = DeleteDiskObject(str name @A0) -> bool @D0 + extsub @bank 11 -144 = FreeFree(pointer fl @A0, pointer address @A1) + extsub @bank 11 -150 = DupDiskObjectA(^^DiskObject diskObject @A0, pointer tags @A1) -> ^^DiskObject @D0 + extsub @bank 11 -156 = IconControlA(^^DiskObject icon @A0, pointer tags @A1) -> long @D0 + extsub @bank 11 -162 = DrawIconStateA(^^graphics.RastPort rp @A0, ^^DiskObject icon @A1, str label @A2, long leftOffset @D0, long topOffset @D1, long state @D2, pointer tags @A3) + extsub @bank 11 -168 = GetIconRectangleA(^^graphics.RastPort rp @A0, ^^DiskObject icon @A1, str label @A2, pointer rect @A3, pointer tags @A4) -> bool @D0 + extsub @bank 11 -174 = NewDiskObject(long k_type @D0) -> ^^DiskObject @D0 + extsub @bank 11 -180 = GetIconTagList(str name @A0, pointer tags @A1) -> ^^DiskObject @D0 + extsub @bank 11 -186 = PutIconTagList(str name @A0, ^^DiskObject icon @A1, pointer tags @A2) -> bool @D0 + extsub @bank 11 -192 = LayoutIconA(^^DiskObject icon @A0, ^^intuition.Screen screen @A1, pointer tags @A2) -> bool @D0 + extsub @bank 11 -198 = ChangeToSelectedIconColor(pointer cr @A0) + extsub @bank 11 -204 = BumpRevisionLength(str newname @A0, str oldname @A1, long maxLength @D0) -> str @D0 + + ; ---- struct definitions ---- + + struct DiskObject { ; total size: 38 + uword Magic ; 0 + uword Version ; 2 + ubyte[4] emb_do_Gadget ; 4 + ubyte Type ; 8 + ubyte Pad_byte ; 9 + pointer DefaultTool ; 10 + pointer ToolTypes ; 14 + long CurrentX ; 18 + long CurrentY ; 22 + pointer DrawerData ; 26 + pointer ToolWindow ; 30 + long StackSize ; 34 + } + + ; ---- constants ---- + const ubyte WORKBENCH_WORKBENCH_I = $0001 + const ubyte WBDISK = $0001 + const ubyte WBDRAWER = $0002 + const ubyte WBTOOL = $0003 + const ubyte WBPROJECT = $0004 + const ubyte WBGARBAGE = $0005 + const ubyte WBDEVICE = $0006 + const ubyte WBKICK = $0007 + const ubyte WBAPPICON = $0008 + const ubyte DDVM_BYDEFAULT = $0000 + const ubyte DDVM_BYICON = $0001 + const ubyte DDVM_BYNAME = $0002 + const ubyte DDVM_BYDATE = $0003 + const ubyte DDVM_BYSIZE = $0004 + const ubyte DDVM_BYTYPE = $0005 + const uword DDFLAGS_SHOWMASK = $0003 + const uword DDFLAGS_SHOWDEFAULT = $0000 + const uword DDFLAGS_SHOWICONS = $0001 + const uword DDFLAGS_SHOWALL = $0002 + const uword DDFLAGS_SORTMASK = $0300 + const uword DDFLAGS_SORTDEFAULT = $0000 + const uword DDFLAGS_SORTASC = $0100 + const uword DDFLAGS_SORTDESC = $0200 + const uword WB_DISKMAGIC = $e310 + const ubyte WB_DISKVERSION = $0001 + const ubyte WB_DISKREVISION = $0001 + const ubyte WB_DISKREVISIONMASK = $ff + const uword GFLG_GADGBACKFILL = $0001 + const uword GADGBACKFILL = $0001 + const long NO_ICON_POSITION = $80000000 + const ubyte AM_VERSION = $0001 + const ubyte AMTYPE_APPWINDOW = $0007 + const ubyte AMTYPE_APPICON = $0008 + const ubyte AMTYPE_APPMENUITEM = $0009 + const ubyte AMTYPE_APPWINDOWZONE = $000a + const ubyte AMCLASSICON_Open = $0000 + const ubyte AMCLASSICON_Copy = $0001 + const ubyte AMCLASSICON_Rename = $0002 + const ubyte AMCLASSICON_Information = $0003 + const ubyte AMCLASSICON_Snapshot = $0004 + const ubyte AMCLASSICON_UnSnapshot = $0005 + const ubyte AMCLASSICON_LeaveOut = $0006 + const ubyte AMCLASSICON_PutAway = $0007 + const ubyte AMCLASSICON_Delete = $0008 + const ubyte AMCLASSICON_FormatDisk = $0009 + const ubyte AMCLASSICON_EjectDisk = $000d + const ubyte AMCLASSICON_EmptyTrash = $000a + const ubyte AMCLASSICON_Selected = $000b + const ubyte AMCLASSICON_Unselected = $000c + const long WBA_Dummy = $8000a000 + const ubyte SCHMSTATE_TryCleanup = $0000 + const ubyte SCHMSTATE_Cleanup = $0001 + const ubyte SCHMSTATE_Setup = $0002 + const long WBF_DRAWERPOSMASK = $00000003 + const long WBF_DRAWERPOSFREE = $00000000 + const long WBF_DRAWERPOSHEAD = $00000001 + const long WBF_DRAWERPOSTAIL = $00000002 + const long WBF_BOUNDTEXTVIEW = $00000080 + const long WBF_OLDDATESFIRST = $00010000 + const ubyte WBO_NONE = $0000 + const ubyte WBO_DRAWER = $0001 + const ubyte WBO_ICON = $0002 + const ubyte ADZMACTION_Enter = $0000 + const ubyte ADZMACTION_Leave = $0001 + const ubyte ISMACTION_Unselect = $0000 + const ubyte ISMACTION_Select = $0001 + const ubyte ISMACTION_Ignore = $0002 + const ubyte ISMACTION_Stop = $0003 + const ubyte CPACTION_Begin = $0000 + const ubyte CPACTION_Copy = $0001 + const ubyte CPACTION_End = $0002 + const ubyte DLACTION_BeginDiscard = $0000 + const ubyte DLACTION_BeginEmptyTrash = $0001 + const ubyte DLACTION_DeleteContents = $0003 + const ubyte DLACTION_DeleteObject = $0004 + const ubyte DLACTION_End = $0005 + const ubyte TIACTION_Rename = $0000 + const ubyte TIACTION_RelabelVolume = $0001 + const ubyte TIACTION_NewDrawer = $0002 + const ubyte TIACTION_Execute = $0003 + const ubyte UPDATEWB_ObjectRemoved = $0000 + const ubyte UPDATEWB_ObjectAdded = $0001 + const long WBAPPICONA_SupportsOpen = $8000a001 + const long WBAPPICONA_SupportsCopy = $8000a002 + const long WBAPPICONA_SupportsRename = $8000a003 + const long WBAPPICONA_SupportsInformation = $8000a004 + const long WBAPPICONA_SupportsSnapshot = $8000a005 + const long WBAPPICONA_SupportsUnSnapshot = $8000a006 + const long WBAPPICONA_SupportsLeaveOut = $8000a007 + const long WBAPPICONA_SupportsPutAway = $8000a008 + const long WBAPPICONA_SupportsDelete = $8000a009 + const long WBAPPICONA_SupportsFormatDisk = $8000a00a + const long WBAPPICONA_SupportsEjectDisk = $8000a09e + const long WBAPPICONA_SupportsEmptyTrash = $8000a00b + const long WBAPPICONA_PropagatePosition = $8000a00c + const long WBAPPICONA_RenderHook = $8000a00d + const long WBAPPICONA_NotifySelectState = $8000a00e + const long WBAPPMENUA_CommandKeyString = $8000a00f + const long WBAPPMENUA_GetKey = $8000a041 + const long WBAPPMENUA_UseKey = $8000a042 + const long WBAPPMENUA_GetTitleKey = $8000a04d + const long WBOPENA_ArgLock = $8000a010 + const long WBOPENA_ArgName = $8000a011 + const long WBOPENA_Show = $8000a04b + const long WBOPENA_ViewBy = $8000a04c + const long WBCTRLA_IsOpen = $8000a012 + const long WBCTRLA_DuplicateSearchPath = $8000a013 + const long WBCTRLA_FreeSearchPath = $8000a014 + const long WBCTRLA_GetDefaultStackSize = $8000a015 + const long WBCTRLA_SetDefaultStackSize = $8000a016 + const long WBCTRLA_RedrawAppIcon = $8000a017 + const long WBCTRLA_GetProgramList = $8000a018 + const long WBCTRLA_FreeProgramList = $8000a019 + const long WBCTRLA_GetSelectedIconList = $8000a024 + const long WBCTRLA_FreeSelectedIconList = $8000a025 + const long WBCTRLA_GetOpenDrawerList = $8000a026 + const long WBCTRLA_FreeOpenDrawerList = $8000a027 + const long WBCTRLA_GetHiddenDeviceList = $8000a02a + const long WBCTRLA_FreeHiddenDeviceList = $8000a02b + const long WBCTRLA_AddHiddenDeviceName = $8000a02c + const long WBCTRLA_RemoveHiddenDeviceName = $8000a02d + const long WBCTRLA_GetTypeRestartTime = $8000a02f + const long WBCTRLA_SetTypeRestartTime = $8000a030 + const long WBCTRLA_GetCopyHook = $8000a045 + const long WBCTRLA_SetCopyHook = $8000a046 + const long WBCTRLA_GetDeleteHook = $8000a047 + const long WBCTRLA_SetDeleteHook = $8000a048 + const long WBCTRLA_GetTextInputHook = $8000a049 + const long WBCTRLA_SetTextInputHook = $8000a04a + const long WBCTRLA_AddSetupCleanupHook = $8000a04e + const long WBCTRLA_RemSetupCleanupHook = $8000a04f + const long WBCTRLA_SetGlobalFlags = $8000a082 + const long WBCTRLA_GetGlobalFlags = $8000a083 + const long WBCTRLA_GetDiskInfoHook = $8000a09f + const long WBCTRLA_SetDiskInfoHook = $8000a0a0 + const long WBDZA_Left = $8000a01a + const long WBDZA_RelRight = $8000a01b + const long WBDZA_Top = $8000a01c + const long WBDZA_RelBottom = $8000a01d + const long WBDZA_Width = $8000a01e + const long WBDZA_RelWidth = $8000a01f + const long WBDZA_Height = $8000a020 + const long WBDZA_RelHeight = $8000a021 + const long WBDZA_Box = $8000a022 + const long WBDZA_Hook = $8000a023 + const long WBOBJA_Type = $8000a056 + const long WBOBJA_Left = $8000a057 + const long WBOBJA_Top = $8000a058 + const long WBOBJA_Width = $8000a059 + const long WBOBJA_Height = $8000a05a + const long WBOBJA_State = $8000a05b + const long WBOBJA_IsFake = $8000a05c + const long WBOBJA_Name = $8000a05d + const long WBOBJA_NameSize = $8000a05e + const long WBOBJA_FullPath = $8000a05f + const long WBOBJA_FullPathSize = $8000a060 + const long WBOBJA_IsLink = $8000a061 + const long WBOBJA_DrawerPath = $8000a062 + const long WBOBJA_DrawerPathSize = $8000a063 + const long WBOBJA_DrawerFlags = $8000a074 + const long WBOBJA_DrawerModes = $8000a075 +} +;; End of auto-generated icon_lib.sfd diff --git a/compiler/res/prog8lib/shared_amiga_iffparse.p8 b/compiler/res/prog8lib/shared_amiga_iffparse.p8 new file mode 100644 index 000000000..e7fdeef63 --- /dev/null +++ b/compiler/res/prog8lib/shared_amiga_iffparse.p8 @@ -0,0 +1,148 @@ +;; Auto-generated from iffparse_lib.sfd and iffparse_lib.i +;; Library base: _IFFParseBase in prog8: sys.IFFParseBase +;; Bank: 14 +;; Functions: 40 + +%import exec +%import utility + +iffparse { + %option merge, no_symbol_prefixing + + sub openlib() -> bool { + sys.IFFParseBase = exec.OpenLibrary("iffparse.library", 0) + return sys.IFFParseBase!=0 + } + + sub closelib() { + if sys.IFFParseBase!=0 { + exec.CloseLibrary(sys.IFFParseBase) + sys.IFFParseBase = 0 + } + } + + extsub @bank 14 -30 = AllocIFF() -> ^^IFFHandle @D0 + extsub @bank 14 -36 = OpenIFF(^^IFFHandle iff @A0, long rwMode @D0) -> long @D0 + extsub @bank 14 -42 = ParseIFF(^^IFFHandle iff @A0, long control @D0) -> long @D0 + extsub @bank 14 -48 = CloseIFF(^^IFFHandle iff @A0) + extsub @bank 14 -54 = FreeIFF(^^IFFHandle iff @A0) + extsub @bank 14 -60 = ReadChunkBytes(^^IFFHandle iff @A0, pointer buf @A1, long numBytes @D0) -> long @D0 + extsub @bank 14 -66 = WriteChunkBytes(^^IFFHandle iff @A0, pointer buf @A1, long numBytes @D0) -> long @D0 + extsub @bank 14 -72 = ReadChunkRecords(^^IFFHandle iff @A0, pointer buf @A1, long bytesPerRecord @D0, long numRecords @D1) -> long @D0 + extsub @bank 14 -78 = WriteChunkRecords(^^IFFHandle iff @A0, pointer buf @A1, long bytesPerRecord @D0, long numRecords @D1) -> long @D0 + extsub @bank 14 -84 = PushChunk(^^IFFHandle iff @A0, long k_type @D0, long id @D1, long size @D2) -> long @D0 + extsub @bank 14 -90 = PopChunk(^^IFFHandle iff @A0) -> long @D0 + extsub @bank 14 -102 = EntryHandler(^^IFFHandle iff @A0, long k_type @D0, long id @D1, long position @D2, ^^utility.Hook handler @A1, pointer object @A2) -> long @D0 + extsub @bank 14 -108 = ExitHandler(^^IFFHandle iff @A0, long k_type @D0, long id @D1, long position @D2, ^^utility.Hook handler @A1, pointer object @A2) -> long @D0 + extsub @bank 14 -114 = PropChunk(^^IFFHandle iff @A0, long k_type @D0, long id @D1) -> long @D0 + extsub @bank 14 -120 = PropChunks(^^IFFHandle iff @A0, pointer propArray @A1, long numPairs @D0) -> long @D0 + extsub @bank 14 -126 = StopChunk(^^IFFHandle iff @A0, long k_type @D0, long id @D1) -> long @D0 + extsub @bank 14 -132 = StopChunks(^^IFFHandle iff @A0, pointer propArray @A1, long numPairs @D0) -> long @D0 + extsub @bank 14 -138 = CollectionChunk(^^IFFHandle iff @A0, long k_type @D0, long id @D1) -> long @D0 + extsub @bank 14 -144 = CollectionChunks(^^IFFHandle iff @A0, pointer propArray @A1, long numPairs @D0) -> long @D0 + extsub @bank 14 -150 = StopOnExit(^^IFFHandle iff @A0, long k_type @D0, long id @D1) -> long @D0 + extsub @bank 14 -156 = FindProp(^^IFFHandle iff @A0, long k_type @D0, long id @D1) -> ^^StoredProperty @D0 + extsub @bank 14 -162 = FindCollection(^^IFFHandle iff @A0, long k_type @D0, long id @D1) -> ^^CollectionItem @D0 + extsub @bank 14 -168 = FindPropContext(^^IFFHandle iff @A0) -> ^^ContextNode @D0 + extsub @bank 14 -174 = CurrentChunk(^^IFFHandle iff @A0) -> ^^ContextNode @D0 + extsub @bank 14 -180 = ParentChunk(^^ContextNode contextNode @A0) -> ^^ContextNode @D0 + extsub @bank 14 -186 = AllocLocalItem(long k_type @D0, long id @D1, long ident @D2, long dataSize @D3) -> pointer @D0 + extsub @bank 14 -192 = LocalItemData(pointer localItem @A0) -> pointer @D0 + extsub @bank 14 -198 = SetLocalItemPurge(pointer localItem @A0, ^^utility.Hook purgeHook @A1) + extsub @bank 14 -204 = FreeLocalItem(pointer localItem @A0) + extsub @bank 14 -210 = FindLocalItem(^^IFFHandle iff @A0, long k_type @D0, long id @D1, long ident @D2) -> pointer @D0 + extsub @bank 14 -216 = StoreLocalItem(^^IFFHandle iff @A0, pointer localItem @A1, long position @D0) -> long @D0 + extsub @bank 14 -222 = StoreItemInContext(^^IFFHandle iff @A0, pointer localItem @A1, ^^ContextNode contextNode @A2) + extsub @bank 14 -228 = InitIFF(^^IFFHandle iff @A0, long flags @D0, ^^utility.Hook streamHook @A1) + extsub @bank 14 -234 = InitIFFasDOS(^^IFFHandle iff @A0) + extsub @bank 14 -240 = InitIFFasClip(^^IFFHandle iff @A0) + extsub @bank 14 -246 = OpenClipboard(long unitNumber @D0) -> pointer @D0 + extsub @bank 14 -252 = CloseClipboard(pointer clipHandle @A0) + extsub @bank 14 -258 = GoodID(long id @D0) -> long @D0 + extsub @bank 14 -264 = GoodType(long k_type @D0) -> long @D0 + extsub @bank 14 -270 = IDtoStr(long id @D0, str buf @A0) -> str @D0 + + ; ---- struct definitions ---- + + struct CollectionItem { ; total size: 12 + ^^CollectionItem Next ; 0 + long Size ; 4 + pointer Data ; 8 + } + + struct ContextNode { ; total size: 24 + ^^exec.MinNode Succ ; 0 + ^^exec.MinNode Pred ; 4 + long Id ; 8 + long Type ; 12 + long Size ; 16 + long Scan ; 20 + } + + struct IFFHandle { ; total size: 12 + long Stream ; 0 + long Flags ; 4 + long Depth ; 8 + } + + struct IFFStreamCmd { ; total size: 12 + long Command ; 0 + pointer Buf ; 4 + long NBytes ; 8 + } + + struct StoredProperty { ; total size: 8 + long Size ; 0 + pointer Data ; 4 + } + + ; ---- constants ---- + const ubyte IFFF_READ = $0000 + const ubyte IFFF_WRITE = $0001 + const ubyte IFFF_FSEEK = $0002 + const ubyte IFFF_RSEEK = $0004 + const long IFFF_RESERVED = $FFFF0000 + const long IFFERR_EOF = -1 + const long IFFERR_EOC = -2 + const long IFFERR_NOSCOPE = -3 + const long IFFERR_NOMEM = -4 + const long IFFERR_READ = -5 + const long IFFERR_WRITE = -6 + const long IFFERR_SEEK = -7 + const long IFFERR_MANGLED = -8 + const long IFFERR_SYNTAX = -9 + const long IFFERR_NOTIFF = -10 + const long IFFERR_NOHOOK = -11 + const long IFF_RETURN2CLIENT = -12 + const long ID_FORM = $464f524d + const long ID_LIST = $4c495354 + const long ID_CAT = $43415420 + const long ID_PROP = $50524f50 + const long ID_NULL = $20202020 + const long IFFLCI_PROP = $70726f70 + const long IFFLCI_COLLECTION = $636f6c6c + const long IFFLCI_ENTRYHANDLER = $656e6864 + const long IFFLCI_EXITHANDLER = $65786864 + const ubyte IFFPARSE_SCAN = $0000 + const ubyte IFFPARSE_STEP = $0001 + const ubyte IFFPARSE_RAWSTEP = $0002 + const ubyte IFFSLI_ROOT = $0001 + const ubyte IFFSLI_TOP = $0002 + const ubyte IFFSLI_PROP = $0003 + const long IFFSIZE_UNKNOWN = -1 + const ubyte IFFCMD_INIT = $0000 + const ubyte IFFCMD_CLEANUP = $0001 + const ubyte IFFCMD_READ = $0002 + const ubyte IFFCMD_WRITE = $0003 + const ubyte IFFCMD_SEEK = $0004 + const ubyte IFFCMD_ENTRY = $0005 + const ubyte IFFCMD_EXIT = $0006 + const ubyte IFFCMD_PURGELCI = $0007 + const ubyte IFFF_RWBITS = $0001 + const ubyte IFFSCC_INIT = $0000 + const ubyte IFFSCC_CLEANUP = $0001 + const ubyte IFFSCC_READ = $0002 + const ubyte IFFSCC_WRITE = $0003 + const ubyte IFFSCC_SEEK = $0004 +} +;; End of auto-generated iffparse_lib.sfd diff --git a/compiler/res/prog8lib/shared_amiga_intuition.p8 b/compiler/res/prog8lib/shared_amiga_intuition.p8 new file mode 100644 index 000000000..9298900a6 --- /dev/null +++ b/compiler/res/prog8lib/shared_amiga_intuition.p8 @@ -0,0 +1,1527 @@ +;; Auto-generated from intuition_lib.sfd and intuition_lib.i +;; Library base: _IntuitionBase in prog8: sys.IntuitionBase +;; Bank: 4 +;; Functions: 127 + +%import exec +%import graphics +%import utility + +intuition { + %option merge, no_symbol_prefixing + + inline asmsub GetScreenViewPort(^^Screen screen @A0) -> pointer @A1 { + ; ViewPort is embedded at Screen offset 44; the ViewPort struct is not generated + %asm {{ + lea 44(a0), a1 + }} + } + + inline asmsub GetScreenRastPort(^^Screen screen @A0) -> ^^graphics.RastPort @A1 { + ; RastPort is embedded at Screen offset 84 + %asm {{ + lea 84(a0), a1 + }} + } + + inline asmsub GetScreenBitMap(^^Screen screen @A0) -> ^^graphics.BitMap @A1 { + ; BitMap is embedded at Screen offset 184 + %asm {{ + lea 184(a0), a1 + }} + } + + extsub @bank 4 -30 = OpenIntuition() + extsub @bank 4 -36 = Intuition(pointer iEvent @A0) + extsub @bank 4 -42 = AddGadget(^^Window window @A0, ^^Gadget gadget @A1, uword position @D0) -> uword @D0 + extsub @bank 4 -48 = ClearDMRequest(^^Window window @A0) -> bool @D0 + extsub @bank 4 -54 = ClearMenuStrip(^^Window window @A0) + extsub @bank 4 -60 = ClearPointer(^^Window window @A0) + extsub @bank 4 -66 = CloseScreen(^^Screen screen @A0) -> bool @D0 + extsub @bank 4 -72 = CloseWindow(^^Window window @A0) + extsub @bank 4 -78 = CloseWorkBench() -> long @D0 + extsub @bank 4 -84 = CurrentTime(pointer seconds @A0, pointer micros @A1) + extsub @bank 4 -90 = DisplayAlert(long alertNumber @D0, str string @A0, uword height @D1) -> bool @D0 + extsub @bank 4 -96 = DisplayBeep(^^Screen screen @A0) + extsub @bank 4 -102 = DoubleClick(long sSeconds @D0, long sMicros @D1, long cSeconds @D2, long cMicros @D3) -> bool @D0 + extsub @bank 4 -108 = DrawBorder(^^graphics.RastPort rp @A0, ^^Border border @A1, word leftOffset @D0, word topOffset @D1) + extsub @bank 4 -114 = DrawImage(^^graphics.RastPort rp @A0, ^^Image image @A1, word leftOffset @D0, word topOffset @D1) + extsub @bank 4 -120 = EndRequest(^^Requester requester @A0, ^^Window window @A1) + extsub @bank 4 -126 = GetDefPrefs(pointer preferences @A0, word size @D0) -> pointer @D0 + extsub @bank 4 -132 = GetPrefs(pointer preferences @A0, word size @D0) -> pointer @D0 + extsub @bank 4 -138 = InitRequester(^^Requester requester @A0) + extsub @bank 4 -144 = ItemAddress(^^Menu menuStrip @A0, uword menuNumber @D0) -> ^^MenuItem @D0 + extsub @bank 4 -150 = ModifyIDCMP(^^Window window @A0, long flags @D0) -> bool @D0 + extsub @bank 4 -156 = ModifyProp(^^Gadget gadget @A0, ^^Window window @A1, ^^Requester requester @A2, uword flags @D0, uword horizPot @D1, uword vertPot @D2, uword horizBody @D3, uword vertBody @D4) + extsub @bank 4 -162 = MoveScreen(^^Screen screen @A0, word dx @D0, word dy @D1) + extsub @bank 4 -168 = MoveWindow(^^Window window @A0, word dx @D0, word dy @D1) + extsub @bank 4 -174 = OffGadget(^^Gadget gadget @A0, ^^Window window @A1, ^^Requester requester @A2) + extsub @bank 4 -180 = OffMenu(^^Window window @A0, uword menuNumber @D0) + extsub @bank 4 -186 = OnGadget(^^Gadget gadget @A0, ^^Window window @A1, ^^Requester requester @A2) + extsub @bank 4 -192 = OnMenu(^^Window window @A0, uword menuNumber @D0) + extsub @bank 4 -198 = OpenScreen(^^NewScreen newScreen @A0) -> ^^Screen @D0 + extsub @bank 4 -204 = OpenWindow(^^NewWindow newWindow @A0) -> ^^Window @D0 + extsub @bank 4 -210 = OpenWorkBench() -> long @D0 + extsub @bank 4 -216 = PrintIText(^^graphics.RastPort rp @A0, ^^IntuiText iText @A1, word left @D0, word top @D1) + extsub @bank 4 -222 = RefreshGadgets(^^Gadget gadgets @A0, ^^Window window @A1, ^^Requester requester @A2) + extsub @bank 4 -228 = RemoveGadget(^^Window window @A0, ^^Gadget gadget @A1) -> uword @D0 + extsub @bank 4 -234 = ReportMouse(bool flag @D0, ^^Window window @A0) + extsub @bank 4 -240 = Request(^^Requester requester @A0, ^^Window window @A1) -> bool @D0 + extsub @bank 4 -246 = ScreenToBack(^^Screen screen @A0) + extsub @bank 4 -252 = ScreenToFront(^^Screen screen @A0) + extsub @bank 4 -258 = SetDMRequest(^^Window window @A0, ^^Requester requester @A1) -> bool @D0 + extsub @bank 4 -264 = SetMenuStrip(^^Window window @A0, ^^Menu menu @A1) -> bool @D0 + extsub @bank 4 -270 = SetPointer(^^Window window @A0, pointer k_pointer @A1, word height @D0, word width @D1, word xOffset @D2, word yOffset @D3) + extsub @bank 4 -276 = SetWindowTitles(^^Window window @A0, str windowTitle @A1, str screenTitle @A2) + extsub @bank 4 -282 = ShowTitle(^^Screen screen @A0, bool showIt @D0) + extsub @bank 4 -288 = SizeWindow(^^Window window @A0, word dx @D0, word dy @D1) + extsub @bank 4 -294 = ViewAddress() -> ^^graphics.View @D0 + extsub @bank 4 -300 = ViewPortAddress(^^Window window @A0) -> pointer @D0 + extsub @bank 4 -306 = WindowToBack(^^Window window @A0) + extsub @bank 4 -312 = WindowToFront(^^Window window @A0) + extsub @bank 4 -318 = WindowLimits(^^Window window @A0, long widthMin @D0, long heightMin @D1, long widthMax @D2, long heightMax @D3) -> bool @D0 + extsub @bank 4 -324 = SetPrefs(pointer preferences @A0, long size @D0, bool inform @D1) -> pointer @D0 + extsub @bank 4 -330 = IntuiTextLength(^^IntuiText iText @A0) -> long @D0 + extsub @bank 4 -336 = WBenchToBack() -> bool @D0 + extsub @bank 4 -342 = WBenchToFront() -> bool @D0 + extsub @bank 4 -348 = AutoRequest(^^Window window @A0, ^^IntuiText body @A1, ^^IntuiText posText @A2, ^^IntuiText negText @A3, long pFlag @D0, long nFlag @D1, uword width @D2, uword height @D3) -> bool @D0 + extsub @bank 4 -354 = BeginRefresh(^^Window window @A0) + extsub @bank 4 -360 = BuildSysRequest(^^Window window @A0, ^^IntuiText body @A1, ^^IntuiText posText @A2, ^^IntuiText negText @A3, long flags @D0, uword width @D1, uword height @D2) -> ^^Window @D0 + extsub @bank 4 -366 = EndRefresh(^^Window window @A0, long complete @D0) + extsub @bank 4 -372 = FreeSysRequest(^^Window window @A0) + extsub @bank 4 -378 = MakeScreen(^^Screen screen @A0) -> long @D0 + extsub @bank 4 -384 = RemakeDisplay() -> long @D0 + extsub @bank 4 -390 = RethinkDisplay() -> long @D0 + extsub @bank 4 -396 = AllocRemember(pointer rememberKey @A0, long size @D0, long flags @D1) -> pointer @D0 + extsub @bank 4 -402 = AlohaWorkbench(long wbport @A0) + extsub @bank 4 -408 = FreeRemember(pointer rememberKey @A0, bool reallyForget @D0) + extsub @bank 4 -414 = LockIBase(long dontknow @D0) -> long @D0 + extsub @bank 4 -420 = UnlockIBase(long ibLock @A0) + extsub @bank 4 -426 = GetScreenData(pointer buffer @A0, uword size @D0, uword k_type @D1, ^^Screen screen @A1) -> long @D0 + extsub @bank 4 -432 = RefreshGList(^^Gadget gadgets @A0, ^^Window window @A1, ^^Requester requester @A2, word numGad @D0) + extsub @bank 4 -438 = AddGList(^^Window window @A0, ^^Gadget gadget @A1, uword position @D0, word numGad @D1, ^^Requester requester @A2) -> uword @D0 + extsub @bank 4 -444 = RemoveGList(^^Window remPtr @A0, ^^Gadget gadget @A1, word numGad @D0) -> uword @D0 + extsub @bank 4 -450 = ActivateWindow(^^Window window @A0) + extsub @bank 4 -456 = RefreshWindowFrame(^^Window window @A0) + extsub @bank 4 -462 = ActivateGadget(^^Gadget gadgets @A0, ^^Window window @A1, ^^Requester requester @A2) -> bool @D0 + extsub @bank 4 -468 = NewModifyProp(^^Gadget gadget @A0, ^^Window window @A1, ^^Requester requester @A2, uword flags @D0, uword horizPot @D1, uword vertPot @D2, uword horizBody @D3, uword vertBody @D4, word numGad @D5) + extsub @bank 4 -474 = QueryOverscan(long displayID @A0, pointer rect @A1, word oScanType @D0) -> long @D0 + extsub @bank 4 -480 = MoveWindowInFrontOf(^^Window window @A0, ^^Window behindWindow @A1) + extsub @bank 4 -486 = ChangeWindowBox(^^Window window @A0, word left @D0, word top @D1, word width @D2, word height @D3) + extsub @bank 4 -492 = SetEditHook(^^utility.Hook hook @A0) -> ^^utility.Hook @D0 + extsub @bank 4 -498 = SetMouseQueue(^^Window window @A0, uword queueLength @D0) -> long @D0 + extsub @bank 4 -504 = ZipWindow(^^Window window @A0) + extsub @bank 4 -510 = LockPubScreen(str name @A0) -> ^^Screen @D0 + extsub @bank 4 -516 = UnlockPubScreen(str name @A0, ^^Screen screen @A1) + extsub @bank 4 -522 = LockPubScreenList() -> ^^exec.List @D0 + extsub @bank 4 -528 = UnlockPubScreenList() + extsub @bank 4 -534 = NextPubScreen(^^Screen screen @A0, str namebuf @A1) -> str @D0 + extsub @bank 4 -540 = SetDefaultPubScreen(str name @A0) + extsub @bank 4 -546 = SetPubScreenModes(uword modes @D0) -> uword @D0 + extsub @bank 4 -552 = PubScreenStatus(^^Screen screen @A0, uword statusFlags @D0) -> uword @D0 + extsub @bank 4 -558 = ObtainGIRPort(pointer gInfo @A0) -> ^^graphics.RastPort @D0 + extsub @bank 4 -564 = ReleaseGIRPort(^^graphics.RastPort rp @A0) + extsub @bank 4 -570 = GadgetMouse(^^Gadget gadget @A0, pointer gInfo @A1, pointer mousePoint @A2) + extsub @bank 4 -582 = GetDefaultPubScreen(str nameBuffer @A0) + extsub @bank 4 -588 = EasyRequestArgs(^^Window window @A0, ^^EasyStruct easyStruct @A1, pointer idcmpPtr @A2, pointer args @A3) -> long @D0 + extsub @bank 4 -594 = BuildEasyRequestArgs(^^Window window @A0, ^^EasyStruct easyStruct @A1, long idcmp @D0, pointer args @A3) -> ^^Window @D0 + extsub @bank 4 -600 = SysReqHandler(^^Window window @A0, pointer idcmpPtr @A1, bool waitInput @D0) -> long @D0 + extsub @bank 4 -606 = OpenWindowTagList(^^NewWindow newWindow @A0, pointer tagList @A1) -> ^^Window @D0 + extsub @bank 4 -612 = OpenScreenTagList(^^NewScreen newScreen @A0, pointer tagList @A1) -> ^^Screen @D0 + extsub @bank 4 -618 = DrawImageState(^^graphics.RastPort rp @A0, ^^Image image @A1, word leftOffset @D0, word topOffset @D1, long state @D2, ^^DrawInfo drawInfo @A2) + extsub @bank 4 -624 = PointInImage(long point @D0, ^^Image image @A0) -> bool @D0 + extsub @bank 4 -630 = EraseImage(^^graphics.RastPort rp @A0, ^^Image image @A1, word leftOffset @D0, word topOffset @D1) + extsub @bank 4 -636 = NewObjectA(pointer classPtr @A0, str classID @A1, pointer tagList @A2) -> pointer @D0 + extsub @bank 4 -642 = DisposeObject(pointer object @A0) + extsub @bank 4 -648 = SetAttrsA(pointer object @A0, pointer tagList @A1) -> long @D0 + extsub @bank 4 -654 = GetAttr(long attrID @D0, pointer object @A0, pointer storagePtr @A1) -> long @D0 + extsub @bank 4 -660 = SetGadgetAttrsA(^^Gadget gadget @A0, ^^Window window @A1, ^^Requester requester @A2, pointer tagList @A3) -> long @D0 + extsub @bank 4 -666 = NextObject(pointer objectPtrPtr @A0) -> pointer @D0 + extsub @bank 4 -678 = MakeClass(str classID @A0, str superClassID @A1, pointer superClassPtr @A2, uword instanceSize @D0, long flags @D1) -> pointer @D0 + extsub @bank 4 -684 = AddClass(pointer classPtr @A0) + extsub @bank 4 -690 = GetScreenDrawInfo(^^Screen screen @A0) -> ^^DrawInfo @D0 + extsub @bank 4 -696 = FreeScreenDrawInfo(^^Screen screen @A0, ^^DrawInfo drawInfo @A1) + extsub @bank 4 -702 = ResetMenuStrip(^^Window window @A0, ^^Menu menu @A1) -> bool @D0 + extsub @bank 4 -708 = RemoveClass(pointer classPtr @A0) + extsub @bank 4 -714 = FreeClass(pointer classPtr @A0) -> bool @D0 + extsub @bank 4 -768 = AllocScreenBuffer(^^Screen sc @A0, ^^graphics.BitMap bm @A1, long flags @D0) -> pointer @D0 + extsub @bank 4 -774 = FreeScreenBuffer(^^Screen sc @A0, pointer sb @A1) + extsub @bank 4 -780 = ChangeScreenBuffer(^^Screen sc @A0, pointer sb @A1) -> long @D0 + extsub @bank 4 -786 = ScreenDepth(^^Screen screen @A0, long flags @D0, pointer reserved @A1) + extsub @bank 4 -792 = ScreenPosition(^^Screen screen @A0, long flags @D0, long x1 @D1, long y1 @D2, long x2 @D3, long y2 @D4) + extsub @bank 4 -798 = ScrollWindowRaster(^^Window win @A1, word dx @D0, word dy @D1, word xMin @D2, word yMin @D3, word xMax @D4, word yMax @D5) + extsub @bank 4 -804 = LendMenus(^^Window fromwindow @A0, ^^Window towindow @A1) + extsub @bank 4 -810 = DoGadgetMethodA(^^Gadget gad @A0, ^^Window win @A1, ^^Requester req @A2, long message @A3) -> long @D0 + extsub @bank 4 -816 = SetWindowPointerA(^^Window win @A0, pointer taglist @A1) + extsub @bank 4 -822 = TimedDisplayAlert(long alertNumber @D0, str string @A0, uword height @D1, long time @A1) -> bool @D0 + extsub @bank 4 -828 = HelpControl(^^Window win @A0, long flags @D0) + extsub @bank 4 -834 = ShowWindow(^^Window window @A0, ^^Window other @A1) -> bool @D0 + extsub @bank 4 -840 = HideWindow(^^Window window @A0) -> bool @D0 + extsub @bank 4 -1212 = IntuitionControlA(pointer object @A0, pointer taglist @A1) -> long @D0 + + ; ---- struct definitions ---- + + struct Border { ; total size: 16 + word LeftEdge ; 0 + word TopEdge ; 2 + ubyte FrontPen ; 4 + ubyte BackPen ; 5 + ubyte DrawMode ; 6 + byte Count ; 7 + pointer Xy ; 8 + ^^Border NextBorder ; 12 + } + + struct ColorSpec { ; total size: 8 + word ColorIndex ; 0 + uword Red ; 2 + uword Green ; 4 + uword Blue ; 6 + } + + struct DrawInfo { ; total size: 50 + uword Version ; 0 + uword NumPens ; 2 + pointer Pens ; 4 + ^^graphics.TextFont Font ; 8 + uword Depth ; 12 + uword X ; 14 + uword Y ; 16 + long Flags ; 18 + ^^Image CheckMark ; 22 + ^^Image AmigaKey ; 26 + ^^Screen Screen ; 30 + long[4] Reserved ; 34 + } + + struct EasyStruct { ; total size: 20 + long StructSize ; 0 + long Flags ; 4 + str Title ; 8 + str TextFormat ; 12 + str GadgetFormat ; 16 + } + + struct ExtGadget { ; total size: 56 + ^^ExtGadget NextGadget ; 0 + word LeftEdge ; 4 + word TopEdge ; 6 + word Width ; 8 + word Height ; 10 + uword Flags ; 12 + uword Activation ; 14 + uword GadgetType ; 16 + pointer GadgetRender ; 18 + pointer SelectRender ; 22 + ^^IntuiText GadgetText ; 26 + long MutualExclude ; 30 + pointer SpecialInfo ; 34 + uword GadgetID ; 38 + pointer UserData ; 40 + long MoreFlags ; 44 + word BoundsLeftEdge ; 48 + word BoundsTopEdge ; 50 + word BoundsWidth ; 52 + word BoundsHeight ; 54 + } + + struct ExtIntuiMessage { ; total size: 56 + ubyte[20] emb_ExecMessage ; 0 + long Class ; 20 + uword Code ; 24 + uword Qualifier ; 26 + pointer IAddress ; 28 + word MouseX ; 32 + word MouseY ; 34 + long Seconds ; 36 + long Micros ; 40 + ^^Window IDCMPWindow ; 44 + ^^IntuiMessage SpecialLink ; 48 + pointer TabletData ; 52 + } + + struct Gadget { ; total size: 44 + ^^Gadget NextGadget ; 0 + word LeftEdge ; 4 + word TopEdge ; 6 + word Width ; 8 + word Height ; 10 + uword Flags ; 12 + uword Activation ; 14 + uword GadgetType ; 16 + pointer GadgetRender ; 18 + pointer SelectRender ; 22 + ^^IntuiText GadgetText ; 26 + long MutualExclude ; 30 + pointer SpecialInfo ; 34 + uword GadgetID ; 38 + pointer UserData ; 40 + } + + struct IBox { ; total size: 8 + word Left ; 0 + word Top ; 2 + word Width ; 4 + word Height ; 6 + } + + struct Image { ; total size: 20 + word LeftEdge ; 0 + word TopEdge ; 2 + word Width ; 4 + word Height ; 6 + word Depth ; 8 + pointer ImageData ; 10 + ubyte PlanePick ; 14 + ubyte PlaneOnOff ; 15 + ^^Image NextImage ; 16 + } + + struct IntuiMessage { ; total size: 52 + ubyte[20] emb_ExecMessage ; 0 + long Class ; 20 + uword Code ; 24 + uword Qualifier ; 26 + pointer IAddress ; 28 + word MouseX ; 32 + word MouseY ; 34 + long Seconds ; 36 + long Micros ; 40 + ^^Window IDCMPWindow ; 44 + ^^IntuiMessage SpecialLink ; 48 + } + + struct IntuiText { ; total size: 20 + ubyte FrontPen ; 0 + ubyte BackPen ; 1 + ubyte DrawMode ; 2 + ubyte _pad_3 ; 3 + word LeftEdge ; 4 + word TopEdge ; 6 + ^^graphics.TextAttr ITextFont ; 8 + str IText ; 12 + ^^IntuiText NextText ; 16 + } + + struct Menu { ; total size: 30 + ^^Menu NextMenu ; 0 + word LeftEdge ; 4 + word TopEdge ; 6 + word Width ; 8 + word Height ; 10 + uword Flags ; 12 + str MenuName ; 14 + ^^MenuItem FirstItem ; 18 + word JazzX ; 22 + word JazzY ; 24 + word BeatX ; 26 + word BeatY ; 28 + } + + struct MenuItem { ; total size: 34 + ^^MenuItem NextItem ; 0 + word LeftEdge ; 4 + word TopEdge ; 6 + word Width ; 8 + word Height ; 10 + uword Flags ; 12 + long MutualExclude ; 14 + pointer ItemFill ; 18 + pointer SelectFill ; 22 + byte Command ; 26 + ubyte _pad_1b ; 27 + ^^MenuItem SubItem ; 28 + uword NextSelect ; 32 + } + + struct NewScreen { ; total size: 32 + word LeftEdge ; 0 + word TopEdge ; 2 + word Width ; 4 + word Height ; 6 + word Depth ; 8 + ubyte DetailPen ; 10 + ubyte BlockPen ; 11 + uword ViewModes ; 12 + uword Type ; 14 + ^^graphics.TextAttr Font ; 16 + str DefaultTitle ; 20 + ^^Gadget Gadgets ; 24 + ^^graphics.BitMap CustomBitMap ; 28 + } + + struct NewWindow { ; total size: 48 + word LeftEdge ; 0 + word TopEdge ; 2 + word Width ; 4 + word Height ; 6 + ubyte DetailPen ; 8 + ubyte BlockPen ; 9 + long IDCMPFlags ; 10 + long Flags ; 14 + ^^Gadget FirstGadget ; 18 + ^^Image CheckMark ; 22 + str Title ; 26 + ^^Screen Screen ; 30 + ^^graphics.BitMap BitMap ; 34 + word MinWidth ; 38 + word MinHeight ; 40 + uword MaxWidth ; 42 + uword MaxHeight ; 44 + uword Type ; 46 + } + + struct Requester { ; total size: 112 + ^^Requester OlderRequest ; 0 + word LeftEdge ; 4 + word TopEdge ; 6 + word Width ; 8 + word Height ; 10 + word RelLeft ; 12 + word RelTop ; 14 + ^^Gadget ReqGadget ; 16 + ^^Border ReqBorder ; 20 + ^^IntuiText ReqText ; 24 + uword Flags ; 28 + ubyte BackFill ; 30 + ubyte _pad_1f ; 31 + ^^graphics.Layer ReqLayer ; 32 + ubyte[32] ReqPad1 ; 36 + ^^graphics.BitMap ImageBMap ; 68 + ^^Window RWindow ; 72 + ^^Image ReqImage ; 76 + ubyte[32] ReqPad2 ; 80 + } + + struct Screen { ; total size: 44 + ^^Screen NextScreen ; 0 + ^^Window FirstWindow ; 4 + word LeftEdge ; 8 + word TopEdge ; 10 + word Width ; 12 + word Height ; 14 + word MouseY ; 16 + word MouseX ; 18 + uword Flags ; 20 + str Title ; 22 + str DefaultTitle ; 26 + byte BarHeight ; 30 + byte BarVBorder ; 31 + byte BarHBorder ; 32 + byte MenuVBorder ; 33 + byte MenuHBorder ; 34 + byte WBorTop ; 35 + byte WBorLeft ; 36 + byte WBorRight ; 37 + byte WBorBottom ; 38 + ubyte _pad_27 ; 39 + ^^graphics.TextAttr Font ; 40 + ; stripped: pointer UserData (4B), pointer ExtData (4B), ^^graphics.Layer BarLayer (4B), uword SaveColor0 (2B), ubyte BlockPen (1B), ubyte DetailPen (1B), ^^Gadget FirstGadget (4B), ubyte[102] emb_LayerInfo (102B), ubyte[40] emb_BitMap (40B), ubyte[100] emb_RastPort (100B), ubyte[40] emb_ViewPort (40B) + } + + struct Window { ; total size: 136 + ^^Window NextWindow ; 0 + word LeftEdge ; 4 + word TopEdge ; 6 + word Width ; 8 + word Height ; 10 + word MouseY ; 12 + word MouseX ; 14 + word MinWidth ; 16 + word MinHeight ; 18 + uword MaxWidth ; 20 + uword MaxHeight ; 22 + long Flags ; 24 + ^^Menu MenuStrip ; 28 + str Title ; 32 + ^^Requester FirstRequest ; 36 + ^^Requester DMRequest ; 40 + word ReqCount ; 44 + ^^Screen WScreen ; 46 + ^^graphics.RastPort RPort ; 50 + byte BorderLeft ; 54 + byte BorderTop ; 55 + byte BorderRight ; 56 + byte BorderBottom ; 57 + ^^graphics.RastPort BorderRPort ; 58 + ^^Gadget FirstGadget ; 62 + ^^Window Parent ; 66 + ^^Window Descendant ; 70 + pointer Pointer ; 74 + byte PtrHeight ; 78 + byte PtrWidth ; 79 + byte XOffset ; 80 + byte YOffset ; 81 + long IDCMPFlags ; 82 + ^^exec.MsgPort UserPort ; 86 + ^^exec.MsgPort WindowPort ; 90 + ^^IntuiMessage MessageKey ; 94 + ubyte DetailPen ; 98 + ubyte BlockPen ; 99 + ^^Image CheckMark ; 100 + str ScreenTitle ; 104 + word GZZMouseX ; 108 + word GZZMouseY ; 110 + word GZZWidth ; 112 + word GZZHeight ; 114 + pointer ExtData ; 116 + pointer UserData ; 120 + ^^graphics.Layer WLayer ; 124 + ^^graphics.TextFont IFont ; 128 + long MoreFlags ; 132 + } + + ; ---- constants ---- + const ubyte CLB_INLIST = $0000 + const long CLF_INLIST = $00000001 + const uword OM_NEW = $0101 + const uword OM_DISPOSE = $0102 + const uword OM_SET = $0103 + const uword OM_GET = $0104 + const uword OM_ADDTAIL = $0105 + const uword OM_REMOVE = $0106 + const uword OM_NOTIFY = $0107 + const uword OM_UPDATE = $0108 + const uword OM_ADDMEMBER = $0109 + const uword OM_REMMEMBER = $010a + const ubyte OPUB_INTERIM = $0000 + const ubyte OPUF_INTERIM = $0001 + const long GA_Dummy = $80030000 + const long PGA_Dummy = $80031000 + const long STRINGA_Dummy = $80032000 + const ubyte SG_DEFAULTMAXCHARS = $0080 + const long LAYOUTA_Dummy = $80038000 + const ubyte LORIENT_NONE = $0000 + const ubyte LORIENT_HORIZ = $0001 + const ubyte LORIENT_VERT = $0002 + const ubyte GM_HITTEST = $0000 + const ubyte GM_RENDER = $0001 + const ubyte GM_GOACTIVE = $0002 + const ubyte GM_HANDLEINPUT = $0003 + const ubyte GM_GOINACTIVE = $0004 + const ubyte GM_HELPTEST = $0005 + const ubyte GM_LAYOUT = $0006 + const ubyte GM_DOMAIN = $0007 + const ubyte GM_KEYTEST = $0008 + const ubyte GM_KEYGOACTIVE = $0009 + const ubyte GM_KEYGOINACTIVE = $000a + const long GMR_GADGETHIT = $00000004 + const long GMR_NOHELPHIT = $00000000 + const long GMR_HELPHIT = $FFFFFFFF + const long GMR_HELPCODE = $00010000 + const ubyte GREDRAW_UPDATE = $0002 + const ubyte GREDRAW_REDRAW = $0001 + const ubyte GREDRAW_TOGGLE = $0000 + const uword GMR_MEACTIVE = $0000 + const uword GMR_NOREUSE = $0002 + const uword GMR_REUSE = $0004 + const uword GMR_VERIFY = $0008 + const uword GMR_NEXTACTIVE = $0010 + const uword GMR_PREVACTIVE = $0020 + const ubyte GMRB_NOREUSE = $0001 + const ubyte GMRB_REUSE = $0002 + const ubyte GMRB_VERIFY = $0003 + const ubyte GMRB_NEXTACTIVE = $0004 + const ubyte GMRB_PREVACTIVE = $0005 + const uword GMRF_NOREUSE = $0002 + const uword GMRF_REUSE = $0004 + const uword GMRF_VERIFY = $0008 + const uword GMRF_NEXTACTIVE = $0010 + const uword GMRF_PREVACTIVE = $0020 + const ubyte GDOMAIN_MINIMUM = $0000 + const ubyte GDOMAIN_NOMINAL = $0001 + const ubyte GDOMAIN_MAXIMUM = $0002 + const uword GMR_KEYACTIVE = $0010 + const uword GMR_KEYVERIFY = $0020 + const uword ICM_SETLOOP = $402 + const uword ICM_CLEARLOOP = $403 + const uword ICM_CHECKLOOP = $404 + const long ICA_Dummy = $80040000 + const long ICTARGET_IDCMP = $ffffffff + const long CUSTOMIMAGEDEPTH = -1 + const long IMAGE_ATTRIBUTES = $80020000 + const ubyte SYSISIZE_MEDRES = $0000 + const ubyte SYSISIZE_LOWRES = $0001 + const ubyte SYSISIZE_HIRES = $0002 + const ubyte DEPTHIMAGE = $00 + const ubyte ZOOMIMAGE = $01 + const ubyte SIZEIMAGE = $02 + const ubyte CLOSEIMAGE = $03 + const ubyte SDEPTHIMAGE = $05 + const ubyte LEFTIMAGE = $0A + const ubyte UPIMAGE = $0B + const ubyte RIGHTIMAGE = $0C + const ubyte DOWNIMAGE = $0D + const ubyte CHECKIMAGE = $0E + const ubyte MXIMAGE = $0F + const ubyte MENUCHECK = $10 + const ubyte AMIGAKEY = $11 + const ubyte ICONIFYIMAGE = $16 + const ubyte MENUMX = $1B + const ubyte MENUSUB = $1C + const ubyte SHIFTKEYIMAGE = $2A + const ubyte FRAME_DEFAULT = $0000 + const ubyte FRAME_BUTTON = $0001 + const ubyte FRAME_RIDGE = $0002 + const ubyte FRAME_ICONDROPBOX = $0003 + const ubyte FRAME_PROPBORDER = $0004 + const ubyte FRAME_PROPKNOB = $0005 + const ubyte FRAME_DISPLAY = $0006 + const ubyte FRAME_CONTEXT = $0007 + const uword IM_DRAW = $0202 + const uword IM_HITTEST = $0203 + const uword IM_ERASE = $0204 + const uword IM_MOVE = $0205 + const uword IM_DRAWFRAME = $0206 + const uword IM_FRAMEBOX = $0207 + const uword IM_HITFRAME = $0208 + const uword IM_ERASEFRAME = $0209 + const uword IM_DOMAINFRAME = $020A + const ubyte IDS_NORMAL = $0000 + const ubyte IDS_SELECTED = $0001 + const ubyte IDS_DISABLED = $0002 + const ubyte IDS_BUSY = $0003 + const ubyte IDS_INDETERMINATE = $0004 + const ubyte IDS_INACTIVENORMAL = $0005 + const ubyte IDS_INACTIVESELECTED = $0006 + const ubyte IDS_INACTIVEDISABLED = $0007 + const ubyte IDS_SELECTEDDISABLED = $0008 + const ubyte FRAMEB_SPECIFY = $0000 + const ubyte FRAMEF_SPECIFY = $0001 + const ubyte FRAMEB_MINIMAL = $0001 + const ubyte FRAMEF_MINIMAL = $0002 + const ubyte IDOMAIN_MINIMUM = $0000 + const ubyte IDOMAIN_NOMINAL = $0001 + const ubyte IDOMAIN_MAXIMUM = $0002 + const uword MENUENABLED = $0001 + const uword MIDRAWN = $0100 + const uword CHECKIT = $0001 + const uword ITEMTEXT = $0002 + const uword COMMSEQ = $0004 + const uword MENUTOGGLE = $0008 + const uword ITEMENABLED = $0010 + const uword HIGHFLAGS = $00C0 + const uword HIGHIMAGE = $0000 + const uword HIGHCOMP = $0040 + const uword HIGHBOX = $0080 + const uword HIGHNONE = $00C0 + const uword CHECKED = $0100 + const uword ISDRAWN = $1000 + const uword HIGHITEM = $2000 + const uword MENUTOGGLED = $4000 + const uword POINTREL = $0001 + const uword PREDRAWN = $0002 + const uword NOISYREQ = $0004 + const uword SIMPLEREQ = $0010 + const uword USEREQIMAGE = $0020 + const uword NOREQBACKFILL = $0040 + const uword REQOFFWINDOW = $1000 + const uword REQACTIVE = $2000 + const uword SYSREQUEST = $4000 + const uword DEFERREFRESH = $8000 + const uword GFLG_GADGHIGHBITS = $0003 + const uword GFLG_GADGHCOMP = $0000 + const uword GFLG_GADGHBOX = $0001 + const uword GFLG_GADGHIMAGE = $0002 + const uword GFLG_GADGHNONE = $0003 + const uword GFLG_GADGIMAGE = $0004 + const uword GFLG_RELBOTTOM = $0008 + const uword GFLG_RELRIGHT = $0010 + const uword GFLG_RELWIDTH = $0020 + const uword GFLG_RELHEIGHT = $0040 + const uword GFLG_RELSPECIAL = $4000 + const uword GFLG_SELECTED = $0080 + const uword GFLG_DISABLED = $0100 + const uword GFLG_LABELMASK = $3000 + const uword GFLG_LABELITEXT = $0000 + const uword GFLG_LABELSTRING = $1000 + const uword GFLG_LABELIMAGE = $2000 + const uword GFLG_TABCYCLE = $0200 + const uword GFLG_STRINGEXTEND = $0400 + const uword GFLG_IMAGEDISABLE = $0800 + const uword GFLG_EXTENDED = $8000 + const uword GACT_RELVERIFY = $0001 + const uword GACT_IMMEDIATE = $0002 + const uword GACT_ENDGADGET = $0004 + const uword GACT_FOLLOWMOUSE = $0008 + const uword GACT_RIGHTBORDER = $0010 + const uword GACT_LEFTBORDER = $0020 + const uword GACT_TOPBORDER = $0040 + const uword GACT_BOTTOMBORDER = $0080 + const uword GACT_BORDERSNIFF = $8000 + const uword GACT_TOGGLESELECT = $0100 + const uword GACT_BOOLEXTEND = $2000 + const uword GACT_STRINGLEFT = $0000 + const uword GACT_STRINGCENTER = $0200 + const uword GACT_STRINGRIGHT = $0400 + const uword GACT_LONGINT = $0800 + const uword GACT_ALTKEYMAP = $1000 + const uword GACT_STRINGEXTEND = $2000 + const uword GACT_ACTIVEGADGET = $4000 + const uword GTYP_GADGETTYPE = $FC00 + const uword GTYP_SCRGADGET = $4000 + const uword GTYP_GZZGADGET = $2000 + const uword GTYP_REQGADGET = $1000 + const uword GTYP_SYSGADGET = $8000 + const uword GTYP_SYSTYPEMASK = $00F0 + const uword GTYP_SIZING = $0010 + const uword GTYP_WDRAGGING = $0020 + const uword GTYP_SDRAGGING = $0030 + const uword GTYP_WDEPTH = $0040 + const uword GTYP_SDEPTH = $0050 + const uword GTYP_WZOOM = $0060 + const uword GTYP_SUNUSED = $0070 + const uword GTYP_CLOSE = $0080 + const uword GTYP_ICONIFY = $0090 + const uword GTYP_GTYPEMASK = $0007 + const uword GTYP_BOOLGADGET = $0001 + const uword GTYP_GADGET0002 = $0002 + const uword GTYP_PROPGADGET = $0003 + const uword GTYP_STRGADGET = $0004 + const uword GTYP_CUSTOMGADGET = $0005 + const long GMORE_BOUNDS = $00000001 + const long GMORE_GADGETHELP = $00000002 + const long GMORE_SCROLLRASTER = $00000004 + const long GMORE_HIDDEN = $00000010 + const long GMORE_BOOPSIGADGET = $00000400 + const long GMORE_FREEIMAGE = $00000800 + const long GMORE_PARENTHIDDEN = $01000000 + const uword BOOLMASK = $0001 + const uword AUTOKNOB = $0001 + const uword FREEHORIZ = $0002 + const uword FREEVERT = $0004 + const uword PROPBORDERLESS = $0008 + const uword KNOBHIT = $0100 + const uword PROPNEWLOOK = $0010 + const uword SMARTKNOBIMAGE = $0020 + const ubyte KNOBHMIN = $0006 + const ubyte KNOBVMIN = $0004 + const uword MAXBODY = $FFFF + const uword MAXPOT = $FFFF + const long IDCMP_SIZEVERIFY = $00000001 + const long IDCMP_NEWSIZE = $00000002 + const long IDCMP_REFRESHWINDOW = $00000004 + const long IDCMP_MOUSEBUTTONS = $00000008 + const long IDCMP_MOUSEMOVE = $00000010 + const long IDCMP_GADGETDOWN = $00000020 + const long IDCMP_GADGETUP = $00000040 + const long IDCMP_REQSET = $00000080 + const long IDCMP_MENUPICK = $00000100 + const long IDCMP_CLOSEWINDOW = $00000200 + const long IDCMP_RAWKEY = $00000400 + const long IDCMP_REQVERIFY = $00000800 + const long IDCMP_REQCLEAR = $00001000 + const long IDCMP_MENUVERIFY = $00002000 + const long IDCMP_NEWPREFS = $00004000 + const long IDCMP_DISKINSERTED = $00008000 + const long IDCMP_DISKREMOVED = $00010000 + const long IDCMP_WBENCHMESSAGE = $00020000 + const long IDCMP_ACTIVEWINDOW = $00040000 + const long IDCMP_INACTIVEWINDOW = $00080000 + const long IDCMP_DELTAMOVE = $00100000 + const long IDCMP_VANILLAKEY = $00200000 + const long IDCMP_INTUITICKS = $00400000 + const long IDCMP_IDCMPUPDATE = $00800000 + const long IDCMP_MENUHELP = $01000000 + const long IDCMP_CHANGEWINDOW = $02000000 + const long IDCMP_GADGETHELP = $04000000 + const long IDCMP_LONELYMESSAGE = $80000000 + const uword CWCODE_MOVESIZE = $0000 + const uword CWCODE_DEPTH = $0001 + const uword CWCODE_HIDE = $0002 + const uword CWCODE_SHOW = $0003 + const uword MENUHOT = $0001 + const uword MENUCANCEL = $0002 + const uword MENUWAITING = $0003 + const uword OKABORT = $0004 + const uword WBENCHOPEN = $0001 + const uword WBENCHCLOSE = $0002 + const uword WFLG_SIZEGADGET = $0001 + const uword WFLG_DRAGBAR = $0002 + const uword WFLG_DEPTHGADGET = $0004 + const uword WFLG_CLOSEGADGET = $0008 + const uword WFLG_SIZEBRIGHT = $0010 + const uword WFLG_SIZEBBOTTOM = $0020 + const uword WFLG_REFRESHBITS = $00C0 + const uword WFLG_SMART_REFRESH = $0000 + const uword WFLG_SIMPLE_REFRESH = $0040 + const uword WFLG_SUPER_BITMAP = $0080 + const uword WFLG_OTHER_REFRESH = $00C0 + const uword WFLG_BACKDROP = $0100 + const uword WFLG_REPORTMOUSE = $0200 + const uword WFLG_GIMMEZEROZERO = $0400 + const uword WFLG_BORDERLESS = $0800 + const uword WFLG_ACTIVATE = $1000 + const long WFLG_RMBTRAP = $00010000 + const long WFLG_NOCAREREFRESH = $00020000 + const long WFLG_NW_EXTENDED = $00040000 + const long WFLG_NEWLOOKMENUS = $00200000 + const uword WFLG_WINDOWACTIVE = $2000 + const uword WFLG_INREQUEST = $4000 + const uword WFLG_MENUSTATE = $8000 + const long WFLG_WINDOWREFRESH = $01000000 + const long WFLG_WBENCHWINDOW = $02000000 + const long WFLG_WINDOWTICKED = $04000000 + const long WFLG_VISITOR = $08000000 + const long WFLG_ZOOMED = $10000000 + const long WFLG_HASZOOM = $20000000 + const long WFLG_HASICONIFY = $40000000 + const long SUPER_UNUSED = $FCFC0000 + const ubyte DEFAULTMOUSEQUEUE = $0005 + const long WA_Left = $80000064 + const long WA_Top = $80000065 + const long WA_Width = $80000066 + const long WA_Height = $80000067 + const long WA_DetailPen = $80000068 + const long WA_BlockPen = $80000069 + const long WA_IDCMP = $8000006a + const long WA_Flags = $8000006b + const long WA_Gadgets = $8000006c + const long WA_Checkmark = $8000006d + const long WA_Title = $8000006e + const long WA_ScreenTitle = $8000006f + const long WA_CustomScreen = $80000070 + const long WA_SuperBitMap = $80000071 + const long WA_MinWidth = $80000072 + const long WA_MinHeight = $80000073 + const long WA_MaxWidth = $80000074 + const long WA_MaxHeight = $80000075 + const long WA_InnerWidth = $80000076 + const long WA_InnerHeight = $80000077 + const long WA_PubScreenName = $80000078 + const long WA_PubScreen = $80000079 + const long WA_PubScreenFallBack = $8000007a + const long WA_WindowName = $8000007b + const long WA_Colors = $8000007c + const long WA_Zoom = $8000007d + const long WA_MouseQueue = $8000007e + const long WA_BackFill = $8000007f + const long WA_RptQueue = $80000080 + const long WA_SizeGadget = $80000081 + const long WA_DragBar = $80000082 + const long WA_DepthGadget = $80000083 + const long WA_CloseGadget = $80000084 + const long WA_Backdrop = $80000085 + const long WA_ReportMouse = $80000086 + const long WA_NoCareRefresh = $80000087 + const long WA_Borderless = $80000088 + const long WA_Activate = $80000089 + const long WA_RMBTrap = $8000008a + const long WA_WBenchWindow = $8000008b + const long WA_SimpleRefresh = $8000008c + const long WA_SmartRefresh = $8000008d + const long WA_SizeBRight = $8000008e + const long WA_SizeBBottom = $8000008f + const long WA_AutoAdjust = $80000090 + const long WA_GimmeZeroZero = $80000091 + const long WA_MenuHelp = $80000092 + const long WA_NewLookMenus = $80000093 + const long WA_AmigaKey = $80000094 + const long WA_NotifyDepth = $80000095 + const long WA_Obsolete = $80000096 + const long WA_Pointer = $80000097 + const long WA_BusyPointer = $80000098 + const long WA_PointerDelay = $80000099 + const long WA_TabletMessages = $8000009a + const long WA_HelpGroup = $8000009b + const long WA_HelpGroupWindow = $8000009c + const long WA_Hidden = $8000009f + const long WA_PointerType = $800000b3 + const long WA_IconifyGadget = $800000c3 + const ubyte HC_GADGETHELP = $0001 + const ubyte WINDOW_BACKMOST = $0000 + const ubyte WINDOW_FRONTMOST = $0001 + const uword NOMENU = $001F + const uword NOITEM = $003F + const uword NOSUB = $001F + const uword MENUNULL = $FFFF + const ubyte CHECKWIDTH = $0013 + const ubyte COMMWIDTH = $001b + const ubyte LOWCHECKWIDTH = $000d + const ubyte LOWCOMMWIDTH = $0010 + const long ALERT_TYPE = $80000000 + const long RECOVERY_ALERT = $00000000 + const long DEADEND_ALERT = $80000000 + const ubyte AUTOFRONTPEN = $0000 + const ubyte AUTOBACKPEN = $0001 + const ubyte AUTOLEFTEDGE = $0006 + const ubyte AUTOTOPEDGE = $0003 + const ubyte AUTOITEXTFONT = $0000 + const ubyte AUTONEXTTEXT = $0000 + const ubyte CURSORUP = $4C + const ubyte CURSORLEFT = $4F + const ubyte CURSORRIGHT = $4E + const ubyte CURSORDOWN = $4D + const ubyte KEYCODE_Q = $10 + const ubyte KEYCODE_Z = $31 + const ubyte KEYCODE_X = $32 + const ubyte KEYCODE_V = $34 + const ubyte KEYCODE_B = $35 + const ubyte KEYCODE_N = $36 + const ubyte KEYCODE_M = $37 + const ubyte KEYCODE_LESS = $38 + const ubyte KEYCODE_GREATER = $39 + const long TABLETA_Dummy = $8003a000 + const long POINTERA_Dummy = $80039000 + const ubyte POINTERXRESN_DEFAULT = $0000 + const ubyte POINTERXRESN_140NS = $0001 + const ubyte POINTERXRESN_70NS = $0002 + const ubyte POINTERXRESN_35NS = $0003 + const ubyte POINTERXRESN_SCREENRES = $0004 + const ubyte POINTERXRESN_LORES = $0005 + const ubyte POINTERXRESN_HIRES = $0006 + const ubyte POINTERYRESN_DEFAULT = $0000 + const ubyte POINTERYRESN_HIGH = $0002 + const ubyte POINTERYRESN_HIGHASPECT = $0003 + const ubyte POINTERYRESN_SCREENRES = $0004 + const ubyte POINTERYRESN_SCREENRESASPECT = $0005 + const ubyte FILENAME_SIZE = $001e + const ubyte DEVNAME_SIZE = $0010 + const ubyte TOPAZ_EIGHTY = $0008 + const ubyte TOPAZ_SIXTY = $0009 + const ubyte LACEWB = $01 + const uword SCREEN_DRAG = $4000 + const uword MOUSE_ACCEL = $8000 + const ubyte PARALLEL_PRINTER = $00 + const ubyte SERIAL_PRINTER = $01 + const ubyte BAUD_110 = $00 + const ubyte BAUD_300 = $01 + const ubyte BAUD_1200 = $02 + const ubyte BAUD_2400 = $03 + const ubyte BAUD_4800 = $04 + const ubyte BAUD_9600 = $05 + const ubyte BAUD_19200 = $06 + const ubyte BAUD_MIDI = $07 + const ubyte FANFOLD = $00 + const ubyte SINGLE = $80 + const ubyte PICA = $000 + const uword ELITE = $400 + const uword FINE = $800 + const ubyte DRAFT = $000 + const uword LETTER = $100 + const ubyte SIX_LPI = $000 + const uword EIGHT_LPI = $200 + const ubyte IMAGE_POSITIVE = $00 + const ubyte IMAGE_NEGATIVE = $01 + const ubyte ASPECT_HORIZ = $00 + const ubyte ASPECT_VERT = $01 + const ubyte SHADE_BW = $00 + const ubyte SHADE_GREYSCALE = $01 + const ubyte SHADE_COLOR = $02 + const ubyte US_LETTER = $00 + const ubyte US_LEGAL = $10 + const ubyte N_TRACTOR = $20 + const ubyte W_TRACTOR = $30 + const ubyte CUSTOM = $40 + const ubyte EURO_A0 = $50 + const ubyte EURO_A1 = $60 + const ubyte EURO_A2 = $70 + const ubyte EURO_A3 = $80 + const ubyte EURO_A4 = $90 + const ubyte EURO_A5 = $A0 + const ubyte EURO_A6 = $B0 + const ubyte EURO_A7 = $C0 + const ubyte EURO_A8 = $D0 + const ubyte CUSTOM_NAME = $00 + const ubyte ALPHA_P_101 = $01 + const ubyte BROTHER_15XL = $02 + const ubyte CBM_MPS1000 = $03 + const ubyte DIAB_630 = $04 + const ubyte DIAB_ADV_D25 = $05 + const ubyte DIAB_C_150 = $06 + const ubyte EPSON = $07 + const ubyte EPSON_JX_80 = $08 + const ubyte OKIMATE_20 = $09 + const ubyte QUME_LP_20 = $0A + const ubyte HP_LASERJET = $0B + const ubyte HP_LASERJET_PLUS = $0C + const ubyte SBUF_512 = $00 + const ubyte SBUF_1024 = $01 + const ubyte SBUF_2048 = $02 + const ubyte SBUF_4096 = $03 + const ubyte SBUF_8000 = $04 + const ubyte SBUF_16000 = $05 + const ubyte SREAD_BITS = $F0 + const ubyte SWRITE_BITS = $0F + const ubyte SSTOP_BITS = $F0 + const ubyte SBUFSIZE_BITS = $0F + const ubyte SPARITY_BITS = $F0 + const ubyte SHSHAKE_BITS = $0F + const ubyte SPARITY_NONE = $00 + const ubyte SPARITY_EVEN = $01 + const ubyte SPARITY_ODD = $02 + const ubyte SPARITY_MARK = $03 + const ubyte SPARITY_SPACE = $04 + const ubyte SHSHAKE_XON = $00 + const ubyte SHSHAKE_RTS = $01 + const ubyte SHSHAKE_NONE = $02 + const uword CORRECT_RED = $0001 + const uword CORRECT_GREEN = $0002 + const uword CORRECT_BLUE = $0004 + const uword CENTER_IMAGE = $0008 + const uword IGNORE_DIMENSIONS = $0000 + const uword BOUNDED_DIMENSIONS = $0010 + const uword ABSOLUTE_DIMENSIONS = $0020 + const uword PIXEL_DIMENSIONS = $0040 + const uword MULTIPLY_DIMENSIONS = $0080 + const uword INTEGER_SCALING = $0100 + const uword ORDERED_DITHERING = $0000 + const uword HALFTONE_DITHERING = $0200 + const uword FLOYD_DITHERING = $0400 + const uword ANTI_ALIAS = $0800 + const uword GREY_SCALE2 = $1000 + const ubyte DRI_VERSION = $0002 + const long DRIF_NEWLOOK = $00000001 + const ubyte DRIB_NEWLOOK = $0000 + const uword PEN_C3 = $FEFC + const uword PEN_C2 = $FEFD + const uword PEN_C1 = $FEFE + const uword PEN_C0 = $FEFF + const uword SCREENTYPE = $000F + const uword WBENCHSCREEN = $0001 + const uword PUBLICSCREEN = $0002 + const uword CUSTOMSCREEN = $000F + const uword SHOWTITLE = $0010 + const uword BEEPING = $0020 + const uword CUSTOMBITMAP = $0040 + const uword SCREENBEHIND = $0080 + const uword SCREENQUIET = $0100 + const uword SCREENHIRES = $0200 + const long STDSCREENHEIGHT = -1 + const long STDSCREENWIDTH = -1 + const uword NS_EXTENDED = $1000 + const uword AUTOSCROLL = $4000 + const uword PENSHARED = $0400 + const long SA_Left = $80000021 + const long SA_Top = $80000022 + const long SA_Width = $80000023 + const long SA_Height = $80000024 + const long SA_Depth = $80000025 + const long SA_DetailPen = $80000026 + const long SA_BlockPen = $80000027 + const long SA_Title = $80000028 + const long SA_Colors = $80000029 + const long SA_ErrorCode = $8000002a + const long SA_Font = $8000002b + const long SA_SysFont = $8000002c + const long SA_Type = $8000002d + const long SA_BitMap = $8000002e + const long SA_PubName = $8000002f + const long SA_PubSig = $80000030 + const long SA_PubTask = $80000031 + const long SA_DisplayID = $80000032 + const long SA_DClip = $80000033 + const long SA_Overscan = $80000034 + const long SA_Obsolete1 = $80000035 + const long SA_ShowTitle = $80000036 + const long SA_Behind = $80000037 + const long SA_Quiet = $80000038 + const long SA_AutoScroll = $80000039 + const long SA_Pens = $8000003a + const long SA_FullPalette = $8000003b + const long SA_ColorMapEntries = $8000003c + const long SA_Parent = $8000003d + const long SA_Draggable = $8000003e + const long SA_Exclusive = $8000003f + const long SA_SharePens = $80000040 + const long SA_BackFill = $80000041 + const long SA_Interleaved = $80000042 + const long SA_Colors32 = $80000043 + const long SA_VideoControl = $80000044 + const long SA_FrontChild = $80000045 + const long SA_BackChild = $80000046 + const long SA_LikeWorkbench = $80000047 + const long SA_Reserved = $80000048 + const long SA_MinimizeISG = $80000049 + const long SA_OffScreenDragging = $8000004a + const ubyte OSERR_NOMONITOR = $0001 + const ubyte OSERR_NOCHIPS = $0002 + const ubyte OSERR_NOMEM = $0003 + const ubyte OSERR_NOCHIPMEM = $0004 + const ubyte OSERR_PUBNOTUNIQUE = $0005 + const ubyte OSERR_UNKNOWNMODE = $0006 + const ubyte OSERR_TOODEEP = $0007 + const ubyte OSERR_ATTACHFAIL = $0008 + const ubyte OSERR_NOTAVAILABLE = $0009 + const ubyte OSCAN_TEXT = $0001 + const ubyte OSCAN_STANDARD = $0002 + const ubyte OSCAN_MAX = $0003 + const ubyte OSCAN_VIDEO = $0004 + const uword PSNF_PRIVATE = $0001 + const ubyte MAXPUBSCREENNAME = $008b + const uword SHANGHAI = $0001 + const uword POPPUBSCREEN = $0002 + const ubyte SDEPTH_TOFRONT = $0000 + const ubyte SDEPTH_TOBACK = $0001 + const ubyte SDEPTH_INFAMILY = $0002 + const ubyte SPOS_RELATIVE = $0000 + const ubyte SPOS_ABSOLUTE = $0001 + const ubyte SPOS_MAKEVISIBLE = $0002 + const ubyte SPOS_FORCEDRAG = $0004 + const ubyte SB_SCREEN_BITMAP = $0001 + const ubyte SB_COPY_BITMAP = $0002 + const uword EO_NOOP = $0001 + const uword EO_DELBACKWARD = $0002 + const uword EO_DELFORWARD = $0003 + const uword EO_MOVECURSOR = $0004 + const uword EO_ENTER = $0005 + const uword EO_RESET = $0006 + const uword EO_REPLACECHAR = $0007 + const uword EO_INSERTCHAR = $0008 + const uword EO_BADFORMAT = $0009 + const uword EO_BIGCHANGE = $000A + const uword EO_UNDO = $000B + const uword EO_CLEAR = $000C + const uword EO_SPECIAL = $000D + const ubyte SGM_REPLACE = $0001 + const ubyte SGMB_REPLACE = $0000 + const ubyte SGMF_REPLACE = $0001 + const long SGM_FIXEDFIELD = $00000002 + const ubyte SGMB_FIXEDFIELD = $0001 + const ubyte SGMF_FIXEDFIELD = $0002 + const long SGM_NOFILTER = $00000004 + const ubyte SGMB_NOFILTER = $0002 + const ubyte SGMF_NOFILTER = $0004 + const long SGM_EXITHELP = $00000080 + const ubyte SGMB_EXITHELP = $0007 + const ubyte SGMF_EXITHELP = $80 + const ubyte SGA_USE = $1 + const ubyte SGAB_USE = $0000 + const ubyte SGAF_USE = $1 + const ubyte SGA_END = $2 + const ubyte SGAB_END = $0001 + const ubyte SGAF_END = $2 + const ubyte SGA_BEEP = $4 + const ubyte SGAB_BEEP = $0002 + const ubyte SGAF_BEEP = $4 + const ubyte SGA_REUSE = $8 + const ubyte SGAB_REUSE = $0003 + const ubyte SGAF_REUSE = $8 + const ubyte SGA_REDISPLAY = $10 + const ubyte SGAB_REDISPLAY = $0004 + const ubyte SGAF_REDISPLAY = $10 + const ubyte SGA_NEXTACTIVE = $20 + const ubyte SGAB_NEXTACTIVE = $0005 + const ubyte SGAF_NEXTACTIVE = $20 + const ubyte SGA_PREVACTIVE = $40 + const ubyte SGAB_PREVACTIVE = $0006 + const ubyte SGAF_PREVACTIVE = $40 + const ubyte SGH_KEY = $0001 + const ubyte SGH_CLICK = $0002 + const uword IECLASS_NULL = $00 + const uword IECLASS_RAWKEY = $01 + const uword IECLASS_RAWMOUSE = $02 + const uword IECLASS_EVENT = $03 + const uword IECLASS_POINTERPOS = $04 + const uword IECLASS_TIMER = $06 + const uword IECLASS_GADGETDOWN = $07 + const uword IECLASS_GADGETUP = $08 + const uword IECLASS_REQUESTER = $09 + const uword IECLASS_MENULIST = $0A + const uword IECLASS_CLOSEWINDOW = $0B + const uword IECLASS_SIZEWINDOW = $0C + const uword IECLASS_REFRESHWINDOW = $0D + const uword IECLASS_NEWPREFS = $0E + const uword IECLASS_DISKREMOVED = $0F + const uword IECLASS_DISKINSERTED = $10 + const uword IECLASS_ACTIVEWINDOW = $11 + const uword IECLASS_INACTIVEWINDOW = $12 + const uword IECLASS_NEWPOINTERPOS = $13 + const uword IECLASS_MENUHELP = $14 + const uword IECLASS_CHANGEWINDOW = $15 + const uword IECLASS_MAX = $15 + const uword IESUBCLASS_COMPATIBLE = $00 + const uword IESUBCLASS_PIXEL = $01 + const uword IESUBCLASS_TABLET = $02 + const uword IESUBCLASS_NEWTABLET = $03 + const uword IECODE_UP_PREFIX = $80 + const uword IECODEB_UP_PREFIX = $0007 + const uword IECODE_KEY_CODE_FIRST = $00 + const uword IECODE_KEY_CODE_LAST = $77 + const uword IECODE_COMM_CODE_FIRST = $78 + const uword IECODE_COMM_CODE_LAST = $7F + const uword IECODE_C0_FIRST = $00 + const uword IECODE_C0_LAST = $1F + const uword IECODE_ASCII_FIRST = $20 + const uword IECODE_ASCII_LAST = $7E + const uword IECODE_ASCII_DEL = $7F + const uword IECODE_C1_FIRST = $80 + const uword IECODE_C1_LAST = $9F + const uword IECODE_LATIN1_FIRST = $A0 + const uword IECODE_LATIN1_LAST = $FF + const uword IECODE_LBUTTON = $68 + const uword IECODE_RBUTTON = $69 + const uword IECODE_MBUTTON = $6A + const uword IECODE_NOBUTTON = $FF + const uword IECODE_NEWACTIVE = $01 + const uword IECODE_NEWSIZE = $02 + const uword IECODE_REFRESH = $03 + const uword IECODE_REQSET = $01 + const uword IECODE_REQCLEAR = $00 + const uword IEQUALIFIER_LSHIFT = $0001 + const uword IEQUALIFIER_RSHIFT = $0002 + const uword IEQUALIFIER_CAPSLOCK = $0004 + const uword IEQUALIFIER_CONTROL = $0008 + const uword IEQUALIFIER_LALT = $0010 + const uword IEQUALIFIER_RALT = $0020 + const uword IEQUALIFIER_LCOMMAND = $0040 + const uword IEQUALIFIER_RCOMMAND = $0080 + const uword IEQUALIFIER_NUMERICPAD = $0100 + const uword IEQUALIFIER_REPEAT = $0200 + const uword IEQUALIFIER_INTERRUPT = $0400 + const uword IEQUALIFIER_MULTIBROADCAST = $0800 + const uword IEQUALIFIER_MIDBUTTON = $1000 + const uword IEQUALIFIER_RBUTTON = $2000 + const uword IEQUALIFIER_LEFTBUTTON = $4000 + const uword IEQUALIFIER_RELATIVEMOUSE = $8000 + const uword IEQUALIFIERB_LSHIFT = $0000 + const uword IEQUALIFIERB_RSHIFT = $0001 + const uword IEQUALIFIERB_CAPSLOCK = $0002 + const uword IEQUALIFIERB_CONTROL = $0003 + const uword IEQUALIFIERB_LALT = $0004 + const uword IEQUALIFIERB_RALT = $0005 + const uword IEQUALIFIERB_LCOMMAND = $0006 + const uword IEQUALIFIERB_RCOMMAND = $0007 + const uword IEQUALIFIERB_NUMERICPAD = $0008 + const uword IEQUALIFIERB_REPEAT = $0009 + const uword IEQUALIFIERB_INTERRUPT = $000a + const uword IEQUALIFIERB_MULTIBROADCAST = $000b + const uword IEQUALIFIERB_MIDBUTTON = $000c + const uword IEQUALIFIERB_RBUTTON = $000d + const uword IEQUALIFIERB_LEFTBUTTON = $000e + const uword IEQUALIFIERB_RELATIVEMOUSE = $000f + const long GA_Left = $80030001 + const long GA_RelRight = $80030002 + const long GA_Top = $80030003 + const long GA_RelBottom = $80030004 + const long GA_Width = $80030005 + const long GA_RelWidth = $80030006 + const long GA_Height = $80030007 + const long GA_RelHeight = $80030008 + const long GA_Text = $80030009 + const long GA_Image = $8003000a + const long GA_Border = $8003000b + const long GA_SelectRender = $8003000c + const long GA_Highlight = $8003000d + const long GA_Disabled = $8003000e + const long GA_GZZGadget = $8003000f + const long GA_ID = $80030010 + const long GA_UserData = $80030011 + const long GA_SpecialInfo = $80030012 + const long GA_Selected = $80030013 + const long GA_EndGadget = $80030014 + const long GA_Immediate = $80030015 + const long GA_RelVerify = $80030016 + const long GA_FollowMouse = $80030017 + const long GA_RightBorder = $80030018 + const long GA_LeftBorder = $80030019 + const long GA_TopBorder = $8003001a + const long GA_BottomBorder = $8003001b + const long GA_ToggleSelect = $8003001c + const long GA_SysGadget = $8003001d + const long GA_SysGType = $8003001e + const long GA_Previous = $8003001f + const long GA_Next = $80030020 + const long GA_DrawInfo = $80030021 + const long GA_IntuiText = $80030022 + const long GA_LabelImage = $80030023 + const long GA_TabCycle = $80030024 + const long GA_GadgetHelp = $80030025 + const long GA_Bounds = $80030026 + const long GA_RelSpecial = $80030027 + const long GA_TextAttr = $80030028 + const long GA_ReadOnly = $80030029 + const long GA_Underscore = $8003002a + const long GA_ActivateKey = $8003002b + const long GA_BackFill = $8003002c + const long GA_GadgetHelpText = $8003002d + const long GA_UserInput = $8003002e + const long PGA_Freedom = $80031001 + const long PGA_Borderless = $80031002 + const long PGA_HorizPot = $80031003 + const long PGA_HorizBody = $80031004 + const long PGA_VertPot = $80031005 + const long PGA_VertBody = $80031006 + const long PGA_Total = $80031007 + const long PGA_Visible = $80031008 + const long PGA_Top = $80031009 + const long PGA_NewLook = $8003100a + const long PGA_KnobImage = $8003100d + const long STRINGA_MaxChars = $80032001 + const long STRINGA_Buffer = $80032002 + const long STRINGA_UndoBuffer = $80032003 + const long STRINGA_WorkBuffer = $80032004 + const long STRINGA_BufferPos = $80032005 + const long STRINGA_DispPos = $80032006 + const long STRINGA_AltKeyMap = $80032007 + const long STRINGA_Font = $80032008 + const long STRINGA_Pens = $80032009 + const long STRINGA_ActivePens = $8003200a + const long STRINGA_EditHook = $8003200b + const long STRINGA_EditModes = $8003200c + const long STRINGA_ReplaceMode = $8003200d + const long STRINGA_FixedFieldMode = $8003200e + const long STRINGA_NoFilterMode = $8003200f + const long STRINGA_Justification = $80032010 + const long STRINGA_LongVal = $80032011 + const long STRINGA_TextVal = $80032012 + const long STRINGA_ExitHelp = $80032013 + const long LAYOUTA_LayoutObj = $80038001 + const long LAYOUTA_Spacing = $80038002 + const long LAYOUTA_Orientation = $80038003 + const long LAYOUTA_ChildMaxWidth = $80038004 + const long LAYOUTA_ChildMaxHeight = $80038005 + const long ICA_TARGET = $80040001 + const long ICA_MAP = $80040002 + const long ICSPECIAL_CODE = $80040003 + const long IA_Left = $80020001 + const long IA_Top = $80020002 + const long IA_Width = $80020003 + const long IA_Height = $80020004 + const long IA_FGPen = $80020005 + const long IA_BGPen = $80020006 + const long IA_Data = $80020007 + const long IA_LineWidth = $80020008 + const long IA_Pens = $8002000e + const long IA_Resolution = $8002000f + const long IA_APattern = $80020010 + const long IA_APatSize = $80020011 + const long IA_Mode = $80020012 + const long IA_Font = $80020013 + const long IA_Outline = $80020014 + const long IA_Recessed = $80020015 + const long IA_DoubleEmboss = $80020016 + const long IA_EdgesOnly = $80020017 + const long SYSIA_Size = $8002000b + const long SYSIA_Depth = $8002000c + const long SYSIA_Which = $8002000d + const long SYSIA_DrawInfo = $80020018 + const long SYSIA_Pens = $8002000e + const long IA_ShadowPen = $80020009 + const long IA_HighlightPen = $8002000a + const long SYSIA_ReferenceFont = $80020019 + const long IA_SupportsDisable = $8002001a + const long IA_FrameType = $8002001b + const long IA_Underscore = $8002001c + const long IA_Scalable = $8002001d + const long IA_ActivateKey = $8002001e + const long IA_Screen = $8002001f + const long IA_Precision = $80020020 + const long IA_Orientation = $80020023 + const long IA_Label = $80020028 + const long IA_EraseBackground = $8002002d + const long IA_LabelPen = $80020038 + const ubyte IDS_INDETERMINANT = $0004 + const long GTYP_WUPFRONT = $0040 + const long GTYP_SUPFRONT = $0050 + const long GTYP_WDOWNBACK = $0060 + const long GTYP_SDOWNBACK = $0070 + const ubyte OKOK = $0001 + const ubyte OKCANCEL = $0002 + const uword SELECTUP = $00e8 + const uword SELECTDOWN = $0068 + const uword MENUUP = $00e9 + const uword MENUDOWN = $0069 + const uword MIDDLEUP = $00ea + const uword MIDDLEDOWN = $006a + const ubyte ALTLEFT = $0010 + const ubyte ALTRIGHT = $0020 + const ubyte AMIGALEFT = $0040 + const ubyte AMIGARIGHT = $0080 + const ubyte AMIGAKEYS = $00c0 + const long TABLETA_TabletZ = $8003a001 + const long TABLETA_RangeZ = $8003a002 + const long TABLETA_AngleX = $8003a003 + const long TABLETA_AngleY = $8003a004 + const long TABLETA_AngleZ = $8003a005 + const long TABLETA_Pressure = $8003a006 + const long TABLETA_ButtonBits = $8003a007 + const long TABLETA_InProximity = $8003a008 + const long TABLETA_ResolutionX = $8003a009 + const long TABLETA_ResolutionY = $8003a00a + const ubyte GADGHIGHBITS = $0003 + const ubyte GADGHCOMP = $0000 + const ubyte GADGHBOX = $0001 + const ubyte GADGHIMAGE = $0002 + const ubyte GADGHNONE = $0003 + const ubyte GADGIMAGE = $0004 + const ubyte GRELBOTTOM = $0008 + const ubyte GRELRIGHT = $0010 + const ubyte GRELWIDTH = $0020 + const ubyte GRELHEIGHT = $0040 + const ubyte SELECTED = $0080 + const uword GADGDISABLED = $0100 + const uword LABELMASK = $3000 + const ubyte LABELITEXT = $0000 + const uword LABELSTRING = $1000 + const uword LABELIMAGE = $2000 + const ubyte RELVERIFY = $0001 + const ubyte GADGIMMEDIATE = $0002 + const ubyte ENDGADGET = $0004 + const ubyte FOLLOWMOUSE = $0008 + const ubyte RIGHTBORDER = $0010 + const ubyte LEFTBORDER = $0020 + const ubyte TOPBORDER = $0040 + const ubyte BOTTOMBORDER = $0080 + const uword BORDERSNIFF = $8000 + const uword TOGGLESELECT = $0100 + const uword BOOLEXTEND = $2000 + const ubyte STRINGLEFT = $0000 + const uword STRINGCENTER = $0200 + const uword STRINGRIGHT = $0400 + const uword LONGINT = $0800 + const uword ALTKEYMAP = $1000 + const uword STRINGEXTEND = $2000 + const uword ACTIVEGADGET = $4000 + const uword GADGETTYPE = $fc00 + const uword SYSGADGET = $8000 + const uword SCRGADGET = $4000 + const uword GZZGADGET = $2000 + const uword REQGADGET = $1000 + const ubyte SIZING = $0010 + const ubyte WDRAGGING = $0020 + const ubyte SDRAGGING = $0030 + const ubyte WUPFRONT = $0040 + const ubyte SUPFRONT = $0050 + const ubyte WDOWNBACK = $0060 + const ubyte SDOWNBACK = $0070 + const ubyte CLOSE = $0080 + const ubyte BOOLGADGET = $0001 + const ubyte GADGET0002 = $0002 + const ubyte PROPGADGET = $0003 + const ubyte STRGADGET = $0004 + const ubyte CUSTOMGADGET = $0005 + const ubyte GTYPEMASK = $0007 + const ubyte SIZEVERIFY = $0001 + const ubyte NEWSIZE = $0002 + const ubyte REFRESHWINDOW = $0004 + const ubyte MOUSEBUTTONS = $0008 + const ubyte MOUSEMOVE = $0010 + const ubyte GADGETDOWN = $0020 + const ubyte GADGETUP = $0040 + const ubyte REQSET = $0080 + const uword MENUPICK = $0100 + const uword CLOSEWINDOW = $0200 + const uword RAWKEY = $0400 + const uword REQVERIFY = $0800 + const uword REQCLEAR = $1000 + const uword MENUVERIFY = $2000 + const uword NEWPREFS = $4000 + const uword DISKINSERTED = $8000 + const long DISKREMOVED = $00010000 + const long WBENCHMESSAGE = $00020000 + const long ACTIVEWINDOW = $00040000 + const long INACTIVEWINDOW = $00080000 + const long DELTAMOVE = $00100000 + const long VANILLAKEY = $00200000 + const long INTUITICKS = $00400000 + const long IDCMPUPDATE = $00800000 + const long MENUHELP = $01000000 + const long CHANGEWINDOW = $02000000 + const long LONELYMESSAGE = $80000000 + const ubyte WINDOWSIZING = $0001 + const ubyte WINDOWDRAG = $0002 + const ubyte WINDOWDEPTH = $0004 + const ubyte WINDOWCLOSE = $0008 + const ubyte SIZEBRIGHT = $0010 + const ubyte SIZEBBOTTOM = $0020 + const ubyte REFRESHBITS = $00c0 + const ubyte SMART_REFRESH = $0000 + const ubyte SIMPLE_REFRESH = $0040 + const ubyte SUPER_BITMAP = $0080 + const ubyte OTHER_REFRESH = $00c0 + const uword BACKDROP = $0100 + const uword REPORTMOUSE = $0200 + const uword GIMMEZEROZERO = $0400 + const uword BORDERLESS = $0800 + const uword ACTIVATE = $1000 + const uword WINDOWACTIVE = $2000 + const uword INREQUEST = $4000 + const uword MENUSTATE = $8000 + const long RMBTRAP = $00010000 + const long NOCAREREFRESH = $00020000 + const long WINDOWREFRESH = $01000000 + const long WBENCHWINDOW = $02000000 + const long WINDOWTICKED = $04000000 + const long NW_EXTENDED = $00040000 + const long VISITOR = $08000000 + const long ZOOMED = $10000000 + const long HASZOOM = $20000000 + const long GA_LEFT = $80030001 + const long GA_RELRIGHT = $80030002 + const long GA_TOP = $80030003 + const long GA_RELBOTTOM = $80030004 + const long GA_WIDTH = $80030005 + const long GA_RELWIDTH = $80030006 + const long GA_HEIGHT = $80030007 + const long GA_RELHEIGHT = $80030008 + const long GA_TEXT = $80030009 + const long GA_IMAGE = $8003000a + const long GA_BORDER = $8003000b + const long GA_SELECTRENDER = $8003000c + const long GA_HIGHLIGHT = $8003000d + const long GA_DISABLED = $8003000e + const long GA_GZZGADGET = $8003000f + const long GA_USERDATA = $80030011 + const long GA_SPECIALINFO = $80030012 + const long GA_SELECTED = $80030013 + const long GA_ENDGADGET = $80030014 + const long GA_IMMEDIATE = $80030015 + const long GA_RELVERIFY = $80030016 + const long GA_FOLLOWMOUSE = $80030017 + const long GA_RIGHTBORDER = $80030018 + const long GA_LEFTBORDER = $80030019 + const long GA_TOPBORDER = $8003001a + const long GA_BOTTOMBORDER = $8003001b + const long GA_TOGGLESELECT = $8003001c + const long GA_SYSGADGET = $8003001d + const long GA_SYSGTYPE = $8003001e + const long GA_PREVIOUS = $8003001f + const long GA_NEXT = $80030020 + const long GA_DRAWINFO = $80030021 + const long GA_INTUITEXT = $80030022 + const long GA_LABELIMAGE = $80030023 + const long PGA_FREEDOM = $80031001 + const long PGA_BORDERLESS = $80031002 + const long PGA_HORIZPOT = $80031003 + const long PGA_HORIZBODY = $80031004 + const long PGA_VERTPOT = $80031005 + const long PGA_VERTBODY = $80031006 + const long PGA_TOTAL = $80031007 + const long PGA_VISIBLE = $80031008 + const long PGA_TOP = $80031009 + const long LAYOUTA_LAYOUTOBJ = $80038001 + const long LAYOUTA_SPACING = $80038002 + const long LAYOUTA_ORIENTATION = $80038003 + const long IA_LEFT = $80020001 + const long IA_TOP = $80020002 + const long IA_WIDTH = $80020003 + const long IA_HEIGHT = $80020004 + const long IA_FGPEN = $80020005 + const long IA_BGPEN = $80020006 + const long IA_DATA = $80020007 + const long IA_LINEWIDTH = $80020008 + const long IA_PENS = $8002000e + const long IA_RESOLUTION = $8002000f + const long IA_APATTERN = $80020010 + const long IA_APATSIZE = $80020011 + const long IA_MODE = $80020012 + const long IA_FONT = $80020013 + const long IA_OUTLINE = $80020014 + const long IA_RECESSED = $80020015 + const long IA_DOUBLEEMBOSS = $80020016 + const long IA_EDGESONLY = $80020017 + const long IA_SHADOWPEN = $80020009 + const long IA_HIGHLIGHTPEN = $8002000a + const long POINTERA_BitMap = $80039001 + const long POINTERA_XOffset = $80039002 + const long POINTERA_YOffset = $80039003 + const long POINTERA_WordWidth = $80039004 + const long POINTERA_XResolution = $80039005 + const long POINTERA_YResolution = $80039006 + const ubyte CORRECT_RGB_MASK = $0007 + const ubyte DIMENSIONS_MASK = $00f0 + const uword DITHERING_MASK = $0600 + const ubyte SDEPTH_CHILDONLY = $0002 +} +;; End of auto-generated intuition_lib.sfd diff --git a/compiler/res/prog8lib/shared_amiga_lists.p8 b/compiler/res/prog8lib/shared_amiga_lists.p8 new file mode 100644 index 000000000..628bc5f51 --- /dev/null +++ b/compiler/res/prog8lib/shared_amiga_lists.p8 @@ -0,0 +1,151 @@ +;; Exec doubly linked lists - usage summary +;; +;; Purpose: this module is a super thin wrapper over the exec list +;; headers and library routines. It exists for source code +;; compatibility with other targets that supply their own lists.p8 +;; implementation. On amiga500 everything simply forwards to exec.library. +;; +;; Data structures (from Include_H/exec/nodes.h and exec/lists.h): +;; +;; A full Node is 14 bytes: Succ and Pred pointers at offsets 0 and 4, +;; an ubyte Type at 8, a signed priority byte Pri at 9 and a Name +;; string pointer at 10. A MinNode holds just the two link pointers +;; (8 bytes). The list headers mirror this split: List consists of +;; Head, Tail and TailPred pointers plus Type and Pad bytes (14 bytes), +;; MinList has only the three pointers (12 bytes). This module aliases +;; List/Node to the minimal variants; use FullNode when you need the +;; Type/Pri/Name fields. +;; +;; Layout: an Exec list is a circular doubly linked list in which the +;; header itself acts as the sentinel node - there are no separate +;; head/tail marker pointers. The header's Tail field stays zero +;; forever and serves as terminator: forward traversal via Succ ends +;; when it reaches &Header.Tail, backward traversal via Pred ends when +;; it reaches the header itself. The first real node's Pred points at +;; the header, the last real node's Succ points at &Header.Tail. +;; +;; Creation and initialization: +;; Place the list header in static memory or allocate it, then call +;; init(listptr) once before any other use. init() is a thin wrapper +;; around exec.NewList(), which sets Head = &Tail, Tail = 0 and +;; TailPred = &Head. Nodes need no explicit setup beyond being +;; cleared; fill in Type/Pri/Name as needed before using the routines +;; below that depend on them. For MinList headers on very new +;; Kickstarts there is also NewMinList (LVO -828), but NewList covers +;; both variants because their layouts coincide. +;; +;; Empty test: the list is empty iff TailPred points back at the +;; header itself (equivalently Head == &Tail); see is_empty(). +;; +;; Operations (all resolve to exec.library LVO calls): +;; - add_head / add_tail: link node at front / back of list +;; (AddHead LVO -240, AddTail LVO -246). +;; - insert(list, node, pred): links node after the given predecessor +;; node anywhere in the list; pred = 0 means insert at head +;; (Insert LVO -234). +;; - enqueue(list, node): priority-sorted insertion using Pri, placed +;; before the first lower-priority node so equal priorities come out +;; FIFO. Requires full Nodes (Enqueue LVO -270). +;; - remove(node): unlinks a node from whichever list it currently +;; sits in; it must actually be linked into one (Remove LVO -252). +;; - remove_head / remove_tail: unlink and return the first / last +;; node, or null if empty; these give you queue and stack behaviour +;; (RemHead LVO -258, RemTail LVO -264). +;; - find_name(list, name): linear search over Name strings, returns +;; matching node or null; requires full Nodes (FindName LVO -276). +;; +;; Concurrency warning: none of these routines arbitrate access to +;; the list. If tasks or interrupts share a list you must serialize +;; access yourself (Forbid/Permit, Disable/Enable, or semaphores). +;; +;; Allocator agnostic: the routines never allocate or free memory +;; themselves, they only link the `pointer` values you pass in. Nodes +;; and headers can come from static `[]` variables, `memory()` slabs, +;; or any arena/bump allocator such as `arena_alloc(sizeof(MyNode))` +;; as `^^MyNode` or `exec.AllocMem` on amiga. Just ensure the +;; allocation is suitably aligned (long-aligned on m68k). +;; +;; Custom nodes: you can define your own node struct for use with the +;; exec/lists routines and with `for node in mylist` loops. The only +;; requirement is that the link pointers are the first fields at offset +;; 0 (Succ at 0, Pred at 4 on 32-bit amiga). Minimal operations only +;; need Succ/Pred; enqueue() and find_name() require the full +;; Type/Pri/Name layout of exec.Node / lists.FullNode. Define the list +;; header with your node type so `for`-iteration infers the correct +;; type. Example: +;; +;; main { +;; struct MyNode { +;; ^^MyNode Succ ; must be first (offset 0) +;; ^^MyNode Pred ; must be second (offset 4) +;; ubyte Type ; include for FullNode compatibility if needed +;; byte Pri +;; str Name +;; ubyte value ; your payload follows +;; } +;; struct MyList { +;; ^^MyNode Head +;; pointer Tail +;; ^^MyNode TailPred +;; } +;; sub start() { +;; ^^MyList mylist = [] ; zero-initialized header +;; ^^MyNode n1 = [0, 0, 0, 0, 0, 11] ; Succ, Pred, Type, Pri, Name, value +;; ^^MyNode n2 = [0, 0, 0, 0, 0, 22] +;; exec.NewList(mylist as ^^exec.List) ; or lists.init(mylist as pointer) +;; lists.add_tail(mylist as pointer, n1 as pointer) +;; lists.add_tail(mylist as pointer, n2 as pointer) +;; ; or directly: exec.AddTail(mylist as pointer, n1 as pointer) +;; } +;; } + +%import exec + +lists { + %option merge, ignore_unused + + alias Node = exec.MinNode + alias List = exec.MinList + alias FullNode = exec.Node + + inline sub init(pointer listptr) { + exec.NewList(listptr as ^^exec.List) + } + + inline sub is_empty(pointer listptr) -> bool { + ^^List lst = listptr as ^^List + return lst.TailPred == (&lst.Head as ^^Node) + } + + inline sub add_head(pointer listptr, pointer node) { + exec.AddHead(listptr, node) + } + + inline sub add_tail(pointer listptr, pointer node) { + exec.AddTail(listptr, node) + } + + inline sub insert(pointer listptr, pointer node, pointer pred) { + exec.Insert(listptr, node, pred) + } + + inline sub remove(pointer node) { + exec.Remove(node) + } + + inline sub remove_head(pointer listptr) -> pointer { + return exec.RemHead(listptr) + } + + inline sub remove_tail(pointer listptr) -> pointer { + return exec.RemTail(listptr) + } + + inline sub enqueue(pointer listptr, pointer node) { + exec.Enqueue(listptr, node) + } + + inline sub find_name(pointer listptr, str name) -> pointer { + return exec.FindName(listptr, name) + } +} diff --git a/compiler/res/prog8lib/shared_amiga_ptplayer.p8 b/compiler/res/prog8lib/shared_amiga_ptplayer.p8 new file mode 100644 index 000000000..ee425db8e --- /dev/null +++ b/compiler/res/prog8lib/shared_amiga_ptplayer.p8 @@ -0,0 +1,4179 @@ +;************************************************** +;* ----- Protracker V2.3B Playroutine ----- * +;************************************************** +; +; Version 6.4 +; Written by Frank Wille in 2013, 2016-2024. +; +; I, the copyright holder of this work, hereby release it into the +; public domain. This applies worldwide. + + +ptplayer { + + %option merge + asmsub install() -> bool @D0 { + ; -- install playback interrupt handler routine + %asm {{ + jmp _mt_install + }} + } + + asmsub remove() { + ; -- remove playback interrupt handler routine + %asm {{ + jmp _mt_remove + }} + } + + asmsub init(pointer moduledata @A0) { + ; -- initialize a loaded protracker module for playback. Module must be loaded into CHIP ram. + %asm {{ + lea $dff000,a6 + sub.l a1,a1 ;; assume sample data is always inside the module + clr.l d0 ;; start at beginning + bsr _mt_init + ;; reset note-trigger detection state + lea vu_prevstarts(pc),a0 + movem.l d1-d3,-(sp) + moveq #0,d1 + move.l d1,(a0) + move.l d1,4(a0) + move.l d1,8(a0) + move.l d1,12(a0) + movem.l (sp)+,d1-d3 + rts + }} + } + + asmsub enable() { + ; -- enable module playback + %asm {{ + move.b #1,_mt_Enable + rts + }} + } + + asmsub disable() { + ; -- disable module playback + %asm {{ + clr.b _mt_Enable + rts + }} + } + + asmsub end() { + ; -- disable all sound playbacks + %asm {{ + lea $dff000,a6 + jmp _mt_end + }} + } + + asmsub songname() -> pointer @A0 { + ; -- returns a pointer to the 20-byte song name of the current module (NULL if no module was initialized) + %asm {{ + lea mt_data(pc),a0 + move.l mt_mod(a0),a0 + rts + }} + } + + asmsub numpatterns() -> ubyte @D0 { + ; -- returns the number of patterns of the current module (highest arrangement entry + 1) + %asm {{ + moveq #0,d0 + lea mt_data(pc),a0 + tst.l mt_mod(a0) + beq .done + move.l mt_mod(a0),a1 + lea MTMOD_ARRANGEMENT(a1),a1 ; song arrangement list + moveq #127,d1 + moveq #0,d0 ; highest pattern number + .1: cmp.b (a1),d0 + bhs .2 + move.b (a1),d0 + .2: addq.l #1,a1 + dbf d1,.1 + addq.b #1,d0 ; number of patterns = highest + 1 + .done: + rts + }} + } + + asmsub currentpos() -> ubyte @D0, ubyte @D1, ubyte @D2 { + ; -- returns the current song position (index into the arrangement list), + ; the pattern number currently being played, + ; and the current row within that pattern (0-63) + %asm {{ + moveq #0,d0 + moveq #0,d1 + moveq #0,d2 + lea mt_data(pc),a0 + tst.l mt_mod(a0) + beq .done + move.b mt_SongPos(a0),d0 ; song position + move.l mt_mod(a0),a1 + lea MTMOD_ARRANGEMENT(a1),a1 ; song arrangement list + move.b (a1,d0.w),d1 ; current pattern number (like get_new_note does) + move.w mt_PatternPos(a0),d2 + lsr.w #4,d2 ; PatternPos is a byte offset, 16 bytes per row + .done: + rts + }} + } + + asmsub volumes() -> ubyte @D0, ubyte @D1, ubyte @D2, ubyte @D3 { + ; -- returns the current volumes of the music channels (each byte is 0-64) + %asm {{ + lea mt_data(pc),a0 + moveq #0,d0 + move.b mt_chan1+n_volume+1(a0),d0 ; low byte of volume word (big-endian) + moveq #0,d1 + move.b mt_chan2+n_volume+1(a0),d1 + moveq #0,d2 + move.b mt_chan3+n_volume+1(a0),d2 + moveq #0,d3 + move.b mt_chan4+n_volume+1(a0),d3 + rts + }} + } + + asmsub notestrike() clobbers (D4) -> bool @D0, bool @D1, bool @D2, bool @D3 { + ; -- returns true for each channel on which a new instrument was triggered + ; -- since the previous call of this routine (poll at least once per row, ~50 Hz) + %asm {{ + lea mt_data(pc),a1 + lea vu_prevstarts(pc),a0 + moveq #0,d0 + moveq #0,d1 + moveq #0,d2 + moveq #0,d3 + + move.l mt_chan1+n_start(a1),d4 + cmp.l (a0)+,d4 + beq .2 + move.l d4,-(a0) + tst.l d4 + beq .2 + moveq #1,d0 + .2: move.l mt_chan2+n_start(a1),d4 + cmp.l (a0)+,d4 + beq .3 + move.l d4,-(a0) + tst.l d4 + beq .3 + moveq #1,d1 + .3: move.l mt_chan3+n_start(a1),d4 + cmp.l (a0)+,d4 + beq .4 + move.l d4,-(a0) + tst.l d4 + beq .4 + moveq #1,d2 + .4: move.l mt_chan4+n_start(a1),d4 + cmp.l (a0),d4 + beq .done + move.l d4,(a0) + tst.l d4 + beq .done + moveq #1,d3 + .done: + rts + }} + } + + + %asm {{ + +;************************************************** +;* ----- Protracker V2.3B Playroutine ----- * +;************************************************** +; +; Version 6.4 +; Written by Frank Wille in 2013, 2016-2024. +; +; I, the copyright holder of this work, hereby release it into the +; public domain. This applies worldwide. +; +; The default version (single section, local base register) should +; work with most assemblers. Tested are: Devpac, vasm, PhxAss, +; Barfly-Asm, SNMA, AsmOne, AsmPro. +; +; The small data model can be enabled by defining the symbol SDATA. In +; this case all functions expect a4 to be initialized with the small +; data base register. Interrupt functions restore a4 from _LinkerDB. +; Small data may work with vasm and PhxAss only. +; +; Exported functions and variables: +; (CUSTOM is the custom-chip register set base address $dff000.) +; +; _mt_install(a6=CUSTOM, a0=VectorBase, d0=PALflag.b) [OSCOMPAT=0] +; Install a CIA-B interrupt for calling mt_music or mt_sfxonly. +; The music module is replayed via mt_music when _mt_Enable is non-zero. +; Otherwise the interrupt handler calls mt_sfxonly to play sound +; effects only. VectorBase is 0 for 68000, otherwise set it to the CPU's +; VBR register. A non-zero PALflag selects PAL-clock for the CIA timers +; (NTSC otherwise). +; +; ok(d0) = _mt_install() [OSCOMPAT=1] +; Register CIA-B interrupts with AmigaOS for calling mt_music or +; mt_sfxonly. Allocate all Paula audio channels via audio.device. +; The music module is replayed via mt_music when _mt_Enable is non-zero. +; Otherwise the interrupt handler calls mt_sfxonly to play sound +; effects only. +; Returns true (1) on success, false (0) otherwise. You must not call +; _mt_remove(), when _mt_install() failed! +; +; _mt_remove(a6=CUSTOM) [OSCOMPAT=0] +; Remove the CIA-B music interrupt, restore the previous handler and +; reset the CIA timer registers to their original values. +; +; _mt_remove() [OSCOMPAT=1] +; Unregister the CIA-B interrupts handlers and deallocate all +; audio channels. +; +; _mt_init(a6=CUSTOM, a0=TrackerModule, a1=Samples|NULL, d0=InitialSongPos.b) +; Initialize a new module. +; Reset speed to 6, tempo to 125 and start at the given song position. +; Master volume is at 64 (maximum). +; When a1 is NULL the samples are assumed to be stored after the patterns. +; +; _mt_end(a6=CUSTOM) +; Stop playing current module and sound effects. +; +; _mt_soundfx(a6=CUSTOM, a0=SamplePointer, +; d0=SampleLength.w, d1=SamplePeriod.w, d2=SampleVolume.w) +; Request playing of an external sound effect on the most unused channel. +; This function is for compatibility with the old API only. +; You may prefer _mt_playfx instead. MINIMAL=0 only. +; +; channelStatus(d0) = _mt_playfx(a6=CUSTOM, a0=SfxStructurePointer) +; Request playing of a prioritized external sound effect, either on a +; fixed channel or on the most unused one. +; Structure layout of SfxStructure: +; void *sfx_ptr (pointer to sample start in Chip RAM, even address) +; WORD sfx_len (sample length in words) +; WORD sfx_per (hardware replay period for sample) +; WORD sfx_vol (volume 0..64, is unaffected by the song's master volume) +; BYTE sfx_cha (0..3 selected replay channel, -1 selects best channel) +; BYTE sfx_pri (priority, must be in the range 1..127) +; When multiple samples are assigned to the same channel the lower +; priority sample will be replaced. When priorities are the same, then +; the older sample is replaced. +; The chosen channel is blocked for music until the effect has +; completely been replayed. +; Returns a pointer to a channel-status structure when the sample +; is scheduled for playing, and NULL when the request was ignored. +; MINIMAL=0 only. +; +; _mt_loopfx(a6=CUSTOM, a0=SfxStructurePointer) +; Request playing of a looped sound effect on a fixed channel, which +; will be blocked for music until the effect is stopped (_mt_stopfx). +; It uses the same sfx-structure as _mt_playfx, but the priority is +; ignored. A looped sound effect has always highest priority and will +; replace a previous effect on the same channel. No automatic channel +; selection possible! +; Also make sure the sample starts with a zero-word, which is used +; for idling when the effect is stopped. This word is included in the +; total length calculation, but excluded when actually playing the loop. +; MINIMAL=0 only. +; +; _mt_stopfx(a6=CUSTOM, d0=Channel.b) [MINIMAL=0] +; Immediately stop a currently playing sound effect on a channel (0..3) +; and make it available for music, or other effects, again. This is the +; only way to stop a looped sound effect (_mt_loopfx) besides stopping +; replay completely (_mt_end). +; +; _mt_musicmask(a6=CUSTOM, d0=ChannelMask.b) [MINIMAL=0] +; Bits set in the ChannelMask define which specific channels are reserved +; for music only. Set bit 0 for channel 0, ..., bit 3 for channel 3. +; When calling _mt_soundfx or _mt_playfx with automatic channel selection +; (sfx_cha=-1) then these masked channels will never be picked. +; The mask defaults to 0. +; +; _mt_mastervol(a6=CUSTOM, d0=MasterVolume.w) [MINIMAL=0] +; Set a master volume from 0 to 64 for all music channels. +; Note that the master volume does not affect the volume of external +; sound effects (which is desired). +; +; _mt_samplevol(d0=SampleNumber.w, d1=Volume.b) [MINIMAL=0] +; Redefine a sample's volume. May also be done while the song is playing. +; Warning: Does not check arguments for valid range! You must have done +; _mt_init before calling this function! +; The new volume is persistent. Even when the song is restarted. +; +; _mt_channelmask(a6=CUSTOM, d0=ChannelMask.b) [MINIMAL=0] +; Bits cleared in the ChannelMask define which specific channels are muted +; for music replay. Clear bit 0 for channel 0, ..., bit 3 for channel 3. +; Additionally a cleared bit prevents any access to the sample pointers +; of this channel. +; The mask defaults to all channels unmuted (bits set) and is reset to +; this state on _mt_init and _mt_end. +; +; _mt_music(a6=CUSTOM) +; The replayer routine. Can be called from your own VBlank interrupt +; handler when VBLANK_MUSIC is set. Is otherwise called automatically +; by Timer-A interrupts after _mt_install. +; +; _mt_dmaon() [NO_TIMERS=1] +; MUST be called ca. 550 ticks after calling _mt_music. Enables Audio +; DMA to play a new note. +; +; _mt_setrep() [NO_TIMERS=1] +; MUST be called ca. 550 ticks after calling _mt_dmaon. Sets the +; repetition pointers and lengths for looped samples. +; +; Byte Variables: +; +; _mt_Enable [VBLANK_MUSIC=0] +; Set this byte to non-zero to play music, zero to pause playing. +; Note that you can still play sound effects, while music is stopped. +; It is set to 0 by _mt_install. +; +; _mt_E8Trigger +; This byte reflects the value of the last E8 command. +; It is reset to 0 after _mt_init. +; +; _mt_MusicChannels [MINIMAL=0] +; This byte defines the number of channels which should be dedicated +; for playing music. So sound effects will never use more +; than 4 - _mt_MusicChannels channels at once. Defaults to 0. +; + +; Set this if you want to build a version which uses AmigaOS to +; register interrupts and reserve audio channels. + ifnd OSCOMPAT +OSCOMPAT equ 1 + endc + +; Optionally you can build a minimal version, which includes only +; the basic player. No sound effects insertion, no master volume, no +; sample volume, etc. Define the symbol MINIMAL=1 for it. + ifnd MINIMAL +MINIMAL equ 1 + endc + +; You may disable sawtooth and rectangle vibratos/tremolos here, which +; will be replaced by sine-waves. They are rarely used and disabling +; them will free a lot of memory for the tables. + ifnd ENABLE_SAWRECT +ENABLE_SAWRECT equ 1 + endc + +; Set this if you can guarantee that the word at $0 is cleared, and if +; you want to use it for idle-looping of samples. + ifnd NULL_IS_CLEARED +NULL_IS_CLEARED equ 0 + endc + +; Setting NO_TIMERS disables the use of both CIA-B timers completely, which +; means that the player doesn't depend on level-6 EXTER interrupts anymore. +; NO_TIMERS=1 automatically includes VBLANK_MUSIC=1 (see below). +; With NO_TIMERS set, your main program has to call all music subroutines +; itself. The typical procedure in a VERTB-based main loop would be: +; 1. call _mt_music +; 2. wait at least 550 ticks, then call _mt_dmaon +; 3. wait at least 550 ticks again, then call _mt_setrep +; The last two steps could for example be performed by Copper interrupts. + ifnd NO_TIMERS +NO_TIMERS equ 0 + else + ifne NO_TIMERS + ifd VBLANK_MUSIC + ifeq VBLANK_MUSIC + fail "NO_TIMERS=1 requires VBLANK_MUSIC=1" + endc + endc ; VBLANK_MUSIC + endc ; NO_TIMERS=1 + endc ; NO_TIMERS + +; This disables only initialization of CIA Timer-A interrupts for music +; replay, which means you cannot set the tempo with the F-command +; anymore and you have to call _mt_music yourself out of your own +; VBlank interrupt handler. Also sound effects will no longer work, +; when no music is playing (_mt_Enable=0). + ifnd VBLANK_MUSIC +VBLANK_MUSIC equ NO_TIMERS + endc + +; Delay in CIA-ticks, which guarantees that at least one Audio-DMA +; took place, even with the lowest periods. +; 496 should be the correct value. But there are some A1200 which +; need at least 550. +DMADELAY equ 576 ; was 496 + + +; exec.library (OSCOMPAT) +_LVOAllocSignal equ -330 +_LVOFreeSignal equ -336 +_LVOOpenDevice equ -444 +_LVOCloseDevice equ -450 +_LVOOpenResource equ -498 + +; cia.resource (OSCOMPAT) +_LVOAddICRVector equ -6 +_LVORemICRVector equ -12 +_LVOAbleICR equ -18 +CIAICRB_TA equ 0 +CIAICRB_TB equ 1 + + +; Custom chip registers +CUSTOM equ $dff000 +INTREQR equ $01e +INTENAR equ $01c +DMACON equ $096 +INTENA equ $09a +INTREQ equ $09c +AUD0LC equ $0a0 +AUD0LEN equ $0a4 +AUD0VOL equ $0a8 +AUD1LC equ $0b0 +AUD1LEN equ $0b4 +AUD1VOL equ $0b8 +AUD2LC equ $0c0 +AUD2LEN equ $0c4 +AUD2VOL equ $0c8 +AUD3LC equ $0d0 +AUD3LEN equ $0d4 +AUD3VOL equ $0d8 + +; Audio channel registers +AUDLC equ 0 +AUDLEN equ 4 +AUDPER equ 6 +AUDVOL equ 8 + +; CIA registers +CIAA equ $bfe001 +CIAB equ $bfd000 +CIAPRA equ $000 +CIATALO equ $400 +CIATAHI equ $500 +CIATBLO equ $600 +CIATBHI equ $700 +CIAICR equ $d00 +CIACRA equ $e00 +CIACRB equ $f00 + +; Protracker module layout +MTMOD_SONGNAME equ 0 ; 20 bytes song title +MTMOD_SAMPLEINFO equ 20 ; 31*30 bytes sample info table +MTMOD_SONGLEN equ 950 ; song length in positions +MTMOD_ARRANGEMENT equ 952 ; 128 bytes song arrangement list +MTMOD_PATTERNS equ 1084 ; start of pattern data + + +; Sound effects structure, passed into _mt_playfx + rsreset +sfx_ptr rs.l 1 +sfx_len rs.w 1 +sfx_per rs.w 1 +sfx_vol rs.w 1 +sfx_cha rs.b 1 +sfx_pri rs.b 1 +sfx_sizeof rs.b 0 + + +; Channel Status + rsreset +n_note rs.w 1 +n_cmd rs.b 1 +n_cmdlo rs.b 1 +n_index rs.b 1 +n_sfxpri rs.b 1 +n_reserved1 rs.b 2 +n_start rs.l 1 +n_loopstart rs.l 1 +n_length rs.w 1 +n_replen rs.w 1 +n_period rs.w 1 +n_volume rs.w 1 +n_pertab rs.l 1 +n_dmabit rs.w 1 +n_noteoff rs.w 1 +n_toneportspeed rs.w 1 +n_wantedperiod rs.w 1 +n_pattpos rs.w 1 +n_funk rs.w 1 +n_wavestart rs.l 1 +n_reallength rs.w 1 +n_intbit rs.w 1 +n_sfxptr rs.l 1 +n_sfxlen rs.w 1 +n_sfxper rs.w 1 +n_sfxvol rs.w 1 +n_looped rs.b 1 +n_minusft rs.b 1 +n_vibratoamp rs.b 1 +n_vibratospd rs.b 1 +n_vibratopos rs.b 1 +n_vibratoctrl rs.b 1 +n_tremoloamp rs.b 1 +n_tremolospd rs.b 1 +n_tremolopos rs.b 1 +n_tremoloctrl rs.b 1 +n_gliss rs.b 1 +n_sampleoffset rs.b 1 +n_loopcount rs.b 1 +n_funkoffset rs.b 1 +n_retrigcount rs.b 1 + ifeq MINIMAL +n_freecnt rs.b 1 +n_musiconly rs.b 1 +n_enable rs.b 1 + else +n_reserved2 rs.b 3 + endc +n_sizeof rs.b 0 + + +DISABLE macro + ifeq NO_TIMERS + move.w #$4000,INTENA(a6) + endc + endm + +ENABLE macro + ifeq NO_TIMERS + move.w #$c000,INTENA(a6) + endc + endm + + + ifd SDATA + xref _LinkerDB ; small data base from linker + near a4 + code + endc + + + + ifne OSCOMPAT +;--------------------------------------------------------------------------- + xdef _mt_install +_mt_install: +; Register a CIA-B interrupt with AmigaOS for calling mt_music. +; Reserve all audio channels for our use. +; -> d0.l = status (1 for success, 0 for error) + + move.l a6,-(sp) + + ifnd SDATA + move.l a4,-(sp) + lea mt_data(pc),a4 + endc + + ; open audio.device and allocate all four audio channels + move.l 4.w,a6 + moveq #-1,d0 + jsr _LVOAllocSignal(a6) + lea mt_ioport+20(pc),a0 + move.b d0,-5(a0) ; MP_SIGBIT + bmi .fail + move.l a0,8(a0) ; NewList MP_MSGLIST + addq.l #4,a0 + clr.l (a0) + move.l a0,-(a0) + move.l 276(a6),-(a0) ; MP_SIGTASK = ThisTask + lea mt_audio_name(pc),a0 + lea mt_ioaudio(pc),a1 + moveq #0,d0 + moveq #0,d1 + jsr _LVOOpenDevice(a6) + tst.b d0 + bne .no_device + + ifeq NO_TIMERS + ; attempt to allocate CIA-B timers A and B + lea mt_ciab_name(pc),a1 + jsr _LVOOpenResource(a6) + tst.l d0 + beq .no_rsrc + + move.l d0,a6 + + clr.b mt_Enable(a4) + lea TB_toggle(pc),a0 + clr.b (a0) + + ifeq VBLANK_MUSIC + moveq #CIAICRB_TA,d0 + lea mt_extern_timer_a_is(pc),a1 + jsr _LVOAddICRVector(a6) + tst.l d0 + bne .no_timer_a + endc ; !VBLANK_MUSIC + + moveq #CIAICRB_TB,d0 + lea mt_extern_timer_b_is(pc),a1 + jsr _LVOAddICRVector(a6) + tst.l d0 + bne .no_timer_b + + ; TimerA and TimerB interrupt disable + ifne VBLANK_MUSIC + moveq #$2,d0 ; TimerB only for VBLANK_MUSIC + else + moveq #$3,d0 + endc + jsr _LVOAbleICR(a6) + + lea CIAB,a0 + + ; Stop Timer B + moveq #0,d0 + move.b d0,CIACRB(a0) + + ifeq VBLANK_MUSIC + ; Stop Timer A + move.b d0,CIACRA(a0) + + ; determine if 02 clock for timers is based on PAL or NTSC + move.l 4.w,a1 + cmp.b #50,531(a1) ; PowerSupplyFrequency + beq .1 + move.l #1789773,d0 ; NTSC + bra .2 +.1: move.l #1773447,d0 ; PAL +.2: move.l d0,mt_timerval(a4) + + ; load TimerA in continuous mode for the default tempo of 125 + divu #125,d0 + move.b d0,CIATALO(a0) + lsr.w #8,d0 + move.b d0,CIATAHI(a0) + move.b #$11,CIACRA(a0) ; load timer, start continuous + endc ; !VBLANK_MUSIC + + ; load TimerB with DMADELAY ticks for setting DMA and repeat + move.b #DMADELAY&255,CIATBLO(a0) + move.b #DMADELAY>>8,CIATBHI(a0) + + ; TimerA and TimerB interrupt enable + ifne VBLANK_MUSIC + move.w #$82,d0 ; TimerB only for VBLANK_MUSIC + else + move.w #$83,d0 + endc + jsr _LVOAbleICR(a6) + + endc ; !NO_TIMERS + + ; reset the player + pea .popout(pc) + ifnd SDATA + move.l a4,-(sp) + endc + lea CUSTOM,a6 + bra mt_reset + + ifeq NO_TIMERS +.no_timer_b: + ifeq VBLANK_MUSIC + moveq #CIAICRB_TA,d0 + lea mt_extern_timer_a_is(pc),a1 + jsr _LVORemICRVector(a6) +.no_timer_a: + endc ; !VBLANK_MUSIC + endc ; !NO_TIMERS + + move.l 4.w,a6 +.no_rsrc: + lea mt_ioaudio(pc),a1 + jsr _LVOCloseDevice(a6) +.no_device: + moveq #0,d0 + move.b mt_ioport+15(pc),d0 + jsr _LVOFreeSignal(a6) +.fail: + moveq #0,d0 ; Indicate failure + bra .out +.popout: + moveq #1,d0 ; Indicate success +.out: + ifnd SDATA + move.l (sp)+,a4 + endc + move.l (sp)+,a6 + rts + + +mt_ioport: + dc.l 0,0 + dc.b 4,0 ; MT_MSGPORT + dc.l 0 + dc.b 0,-1 ; PA_SIGNAL + dc.l 0 +.head: dc.l .tail +.tail: dc.l 0 + dc.l .head + +mt_ioaudio: + dc.l 0,0 + dc.b 7,127 ; NT_REPLYMSG, ADALLOC_MAXPREC + dc.l 0,mt_ioport + dc.w .end-mt_ioaudio + dc.l 0,0 + dc.w $20 ; ADCMD_ALLOCATE + dc.b $40,0 ; ADIOF_NOWAIT + dc.w 0 ; ioa_AllocKey + dc.l mt_ch_alloc ; ioa_Data + dc.l 1 ; ioa_Length + dc.w 0,0,0 + ds.b 20 ; ioa_WriteMsg +.end: + + ifeq NO_TIMERS + ifeq VBLANK_MUSIC +mt_extern_timer_a_is: + dc.l 0,0 + dc.b 2 ; NT_INTERRUPT + dc.b 0 ; priority + dc.l mt_timer_int_name + dc.l 0 + dc.l mt_cia_timer_a_code + endc ; !VBLANK_MUSIC + +mt_extern_timer_b_is: + dc.l 0,0 + dc.b 2 ; NT_INTERRUPT + dc.b 0 ; priority + dc.l mt_timer_int_name + dc.l 0 + dc.l mt_cia_timer_b_code + +mt_ciab_name: + dc.b "ciab.resource",0 +mt_timer_int_name: + dc.b "ptplayer timer",0 + endc ; !NO_TIMERS + + even +mt_audio_name: + dc.b "audio.device",0 +mt_ch_alloc: + dc.b %1111 ; allocate all four channels + even + + +;--------------------------------------------------------------------------- + xdef _mt_remove +_mt_remove: +; Unregister our CIA-B interrupt with AmigaOS. Free all audio channels. + + move.l a6,-(sp) + + ifeq NO_TIMERS + move.l 4.w,a6 + lea mt_ciab_name(pc),a1 + jsr _LVOOpenResource(a6) + tst.l d0 + beq .nociares + + move.l d0,a6 + + ; TimerA and TimerB interrupt disable + ifne VBLANK_MUSIC + moveq #$02,d0 ; TimerB only for VBLANK_MUSIC + else + moveq #$03,d0 + endc + jsr _LVOAbleICR(a6) + + moveq #CIAICRB_TB,d0 + lea mt_extern_timer_b_is(pc),a1 + jsr _LVORemICRVector(a6) + + ifeq VBLANK_MUSIC + moveq #CIAICRB_TA,d0 + lea mt_extern_timer_a_is(pc),a1 + jsr _LVORemICRVector(a6) + endc ; !VBLANK_MUSIC +.nociares: + endc ; !NO_TIMERS + + ; close audio.device, free channels + move.l 4.w,a6 + lea mt_ioaudio(pc),a1 + jsr _LVOCloseDevice(a6) + moveq #0,d0 + move.b mt_ioport+15(pc),d0 + jsr _LVOFreeSignal(a6) + + move.l (sp)+,a6 + rts + + + ifeq NO_TIMERS + ifeq VBLANK_MUSIC +;--------------------------------------------------------------------------- +mt_cia_timer_a_code: +; TimerA interrupt calls mt_music at a selectable tempo (Fxx command), +; which defaults to 50 times per second. + + movem.l d2-d7/a2-a6,-(sp) + lea CUSTOM,a6 + ifd SDATA + lea _LinkerDB,a4 + else + lea mt_data(pc),a4 + endc + + ; do music when enabled + tst.b mt_Enable(a4) + ifeq MINIMAL + beq .2 + else + beq .1 + endc + + bsr mt_music ; music with sfx inserted +.1: movem.l (sp)+,d2-d7/a2-a6 + rts + + ifeq MINIMAL +.2: bsr mt_sfxonly ; no music, only sfx + movem.l (sp)+,d2-d7/a2-a6 + rts + endc + endc ; !VBLANK_MUSIC + + +;--------------------------------------------------------------------------- +mt_cia_timer_b_code: +; Handle one-shot TimerB interrupt. +; TB_toggle-technique suggested by Ross/EAB. + + lea TB_toggle(pc),a0 + not.b (a0) + lea CUSTOM+INTREQ,a0 + beq mt_TimerBsetrep + + ; restart timer for repeat, enable audio DMA after DMADELAY ticks + move.b #$19,CIAB+CIACRB + move.w mt_dmaon(pc),DMACON-INTREQ(a0) + rts + +TB_toggle: + dc.b 0 + even + + +mt_TimerBsetrep: +; Oneshot TimerB interrupt to set repeat samples after another DMADELAY ticks. + + move.l a4,-(sp) + + ifd SDATA + lea _LinkerDB,a4 + else + lea mt_data(pc),a4 + endc + + ; clear possible audio interrupt flags + moveq #0,d0 + or.b mt_dmaon+1(pc),d0 + lsl.w #7,d0 + move.w d0,(a0) + + ; set repeat sample pointers and lengths + ifne MINIMAL + move.l mt_chan1+n_loopstart(a4),AUD0LC-INTREQ(a0) + move.w mt_chan1+n_replen(a4),AUD0LEN-INTREQ(a0) + move.l mt_chan2+n_loopstart(a4),AUD1LC-INTREQ(a0) + move.w mt_chan2+n_replen(a4),AUD1LEN-INTREQ(a0) + move.l mt_chan3+n_loopstart(a4),AUD2LC-INTREQ(a0) + move.w mt_chan3+n_replen(a4),AUD2LEN-INTREQ(a0) + move.l mt_chan4+n_loopstart(a4),AUD3LC-INTREQ(a0) + move.w mt_chan4+n_replen(a4),AUD3LEN-INTREQ(a0) + + else ; !MINIMAL + tst.b mt_chan1+n_enable(a4) + beq .1 + move.l mt_chan1+n_loopstart(a4),AUD0LC-INTREQ(a0) + move.w mt_chan1+n_replen(a4),AUD0LEN-INTREQ(a0) +.1: tst.b mt_chan2+n_enable(a4) + beq .2 + move.l mt_chan2+n_loopstart(a4),AUD1LC-INTREQ(a0) + move.w mt_chan2+n_replen(a4),AUD1LEN-INTREQ(a0) +.2: tst.b mt_chan3+n_enable(a4) + beq .3 + move.l mt_chan3+n_loopstart(a4),AUD2LC-INTREQ(a0) + move.w mt_chan3+n_replen(a4),AUD2LEN-INTREQ(a0) +.3: tst.b mt_chan4+n_enable(a4) + beq .4 + move.l mt_chan4+n_loopstart(a4),AUD3LC-INTREQ(a0) + move.w mt_chan4+n_replen(a4),AUD3LEN-INTREQ(a0) +.4: + endc + + move.l (sp)+,a4 + rts + endc ; !NO_TIMERS + + + else !OSCOMPAT +;--------------------------------------------------------------------------- + xdef _mt_install + xdef _mt_install_cia +_mt_install: +_mt_install_cia: +; Install a CIA-B interrupt for calling mt_music. +; a6 = CUSTOM +; a0 = VectorBase +; d0 = PALflag.b (0 is NTSC) + + ifnd SDATA + move.l a4,-(sp) + lea mt_data(pc),a4 + endc + + clr.b mt_Enable(a4) + + ifeq NO_TIMERS + ; remember level 6 vector and interrupt enable + lea $78(a0),a0 + move.l a0,mt_Lev6Int(a4) + move.w #$2000,d1 + and.w INTENAR(a6),d1 + or.w #$8000,d1 + move.w d1,mt_Lev6Ena(a4) + + ; disable level 6 EXTER interrupts, set player interrupt vector + move.w #$2000,INTENA(a6) + move.l (a0),mt_oldLev6(a4) + lea mt_TimerAInt(pc),a1 + move.l a1,(a0) + + ; reset TimerB toggle + lea TB_toggle(pc),a0 + clr.b (a0) + + ; disable CIA-B interrupts, stop and save all timers + lea CIAB,a0 + moveq #0,d1 + move.b #$7f,CIAICR(a0) + move.b d1,CIACRA(a0) + move.b d1,CIACRB(a0) + lea mt_oldtimers(a4),a1 + move.b CIATALO(a0),(a1)+ + move.b CIATAHI(a0),(a1)+ + move.b CIATBLO(a0),(a1)+ + move.b CIATBHI(a0),(a1) + + ifeq VBLANK_MUSIC + ; determine if 02 clock for timers is based on PAL or NTSC + tst.b d0 + bne .1 + move.l #1789773,d0 ; NTSC + bra .2 +.1: move.l #1773447,d0 ; PAL +.2: move.l d0,mt_timerval(a4) + + ; load TimerA in continuous mode for the default tempo of 125 + divu #125,d0 + move.b d0,CIATALO(a0) + lsr.w #8,d0 + move.b d0,CIATAHI(a0) + move.b #$11,CIACRA(a0) ; load timer, start continuous + endc ; !VBLANK_MUSIC + + ; load TimerB with DMADELAY ticks for setting DMA and repeat + move.b #DMADELAY&255,CIATBLO(a0) + move.b #DMADELAY>>8,CIATBHI(a0) + + ; Ack. pending interrupts, TimerA and TimerB interrupt enable + tst.b CIAICR(a0) + move.w #$2000,INTREQ(a6) + ifne VBLANK_MUSIC + move.b #$82,CIAICR(a0) ; TimerB only for VBLANK_MUSIC + else + move.b #$83,CIAICR(a0) + endc + + ; enable level 6 interrupts + move.w #$a000,INTENA(a6) + endc ; !NO_TIMERS + + bra mt_reset + + +;--------------------------------------------------------------------------- + xdef _mt_remove_cia + xdef _mt_remove +_mt_remove_cia: +_mt_remove: +; Remove CIA-B music interrupt and restore the old vector. +; a6 = CUSTOM + + ifeq NO_TIMERS + ifnd SDATA + move.l a4,-(sp) + lea mt_data(pc),a4 + endc + + ; disable level 6 and CIA-B interrupts + lea CIAB,a0 + move.w #$2000,d0 + move.b #$7f,CIAICR(a0) + move.w d0,INTENA(a6) + tst.b CIAICR(a0) + move.w d0,INTREQ(a6) + + ; restore old timer values + lea mt_oldtimers(a4),a1 + move.b (a1)+,CIATALO(a0) + move.b (a1)+,CIATAHI(a0) + move.b (a1)+,CIATBLO(a0) + move.b (a1),CIATBHI(a0) + move.b #$10,CIACRA(a0) + move.b #$10,CIACRB(a0) + + ; restore original level 6 interrupt vector + move.l mt_Lev6Int(a4),a1 + move.l mt_oldLev6(a4),(a1) + + ; reenable CIA-B ALRM interrupt, which was set by AmigaOS + move.b #$84,CIAICR(a0) + + ; reenable previous level 6 interrupt + move.w mt_Lev6Ena(a4),INTENA(a6) + + ifnd SDATA + move.l (sp)+,a4 + endc + endc ; !NO_TIMERS + rts + + + ifeq NO_TIMERS +;--------------------------------------------------------------------------- +mt_TimerAInt: +; TimerA interrupt calls mt_music at a selectable tempo (Fxx command), +; which defaults to 50 times per second. + + ; check for TB interrupt and clear CIAB interrupt flags + btst #1,CIAB+CIAICR + bne mt_TimerBInt + + ifne VBLANK_MUSIC + move.w #$2000,CUSTOM+INTREQ ; ack interrupt and leave + nop + rte + + else + ; Now it should be a TA interrupt. + ; Other level 6 interrupt sources have to be handled elsewhere. + movem.l d0-d7/a0-a6,-(sp) + lea CUSTOM,a6 + ifd SDATA + lea _LinkerDB,a4 + else + lea mt_data(pc),a4 + endc + + ; clear EXTER interrupt flag + move.w #$2000,INTREQ(a6) + + ; do music when enabled + tst.b mt_Enable(a4) + ifeq MINIMAL + beq .2 + else + beq .1 + endc + + bsr mt_music ; music with sfx inserted +.1: movem.l (sp)+,d0-d7/a0-a6 + nop + rte + + ifeq MINIMAL +.2: bsr mt_sfxonly ; no music, only sfx + movem.l (sp)+,d0-d7/a0-a6 + nop + rte + endc + endc ; !VBLANK_MUSIC + + +;--------------------------------------------------------------------------- +mt_TimerBInt: +; Handle one-shot TimerB interrupt. +; TB_toggle-technique suggested by Ross/EAB. + + move.l a0,-(sp) + lea TB_toggle(pc),a0 + not.b (a0) + lea CUSTOM+INTREQ,a0 + beq mt_TimerBsetrep + + ; restart timer for repeat, enable audio DMA after DMADELAY ticks + move.w #$2000,(a0) ; clear EXTER interrupt flag + move.b #$19,CIAB+CIACRB + move.w mt_dmaon(pc),DMACON-INTREQ(a0) + + move.l (sp)+,a0 + nop + rte + + +mt_TimerBsetrep: +; Oneshot TimerB interrupt to set repeat samples after another DMADELAY ticks. + + ; clear EXTER and possible audio interrupt flags + move.l a4,-(sp) + move.l d0,a4 + moveq #$2000>>7,d0 ; EXTER-flag + or.b mt_dmaon+1(pc),d0 + lsl.w #7,d0 + move.w d0,(a0) + move.l a4,d0 + + ifd SDATA + lea _LinkerDB,a4 + else + lea mt_data(pc),a4 + endc + + ; set repeat sample pointers and lengths + ifne MINIMAL + move.l mt_chan1+n_loopstart(a4),AUD0LC-INTREQ(a0) + move.w mt_chan1+n_replen(a4),AUD0LEN-INTREQ(a0) + move.l mt_chan2+n_loopstart(a4),AUD1LC-INTREQ(a0) + move.w mt_chan2+n_replen(a4),AUD1LEN-INTREQ(a0) + move.l mt_chan3+n_loopstart(a4),AUD2LC-INTREQ(a0) + move.w mt_chan3+n_replen(a4),AUD2LEN-INTREQ(a0) + move.l mt_chan4+n_loopstart(a4),AUD3LC-INTREQ(a0) + move.w mt_chan4+n_replen(a4),AUD3LEN-INTREQ(a0) + + else ; !MINIMAL + tst.b mt_chan1+n_enable(a4) + beq .1 + move.l mt_chan1+n_loopstart(a4),AUD0LC-INTREQ(a0) + move.w mt_chan1+n_replen(a4),AUD0LEN-INTREQ(a0) +.1: tst.b mt_chan2+n_enable(a4) + beq .2 + move.l mt_chan2+n_loopstart(a4),AUD1LC-INTREQ(a0) + move.w mt_chan2+n_replen(a4),AUD1LEN-INTREQ(a0) +.2: tst.b mt_chan3+n_enable(a4) + beq .3 + move.l mt_chan3+n_loopstart(a4),AUD2LC-INTREQ(a0) + move.w mt_chan3+n_replen(a4),AUD2LEN-INTREQ(a0) +.3: tst.b mt_chan4+n_enable(a4) + beq .4 + move.l mt_chan4+n_loopstart(a4),AUD3LC-INTREQ(a0) + move.w mt_chan4+n_replen(a4),AUD3LEN-INTREQ(a0) +.4: + endc + + move.l (sp)+,a4 + move.l (sp)+,a0 + nop + rte + +TB_toggle: + dc.b 0 + even + endc ; !NO_TIMERS + endc ; !OSCOMPAT + + + ifne NO_TIMERS +;--------------------------------------------------------------------------- + + xdef _mt_dmaon +_mt_dmaon: +; Enable audio DMA after some delay. +; Called by main program, for example out of a copper-interrupt. + + move.w mt_dmaon(pc),CUSTOM+DMACON + rts + + + xdef _mt_setrep +_mt_setrep: +; Set repeat sample pointers and lengths. +; Called by main program, for example out of a copper-interrupt. + + movem.l a0/a4,-(sp) + + ; reset audio interrupt flags + lea CUSTOM+INTREQ,a0 + move.l d0,a4 + move.w mt_dmaon(pc),d0 + lsl.w #7,d0 + move.w d0,(a0) + move.l a4,d0 + + ifd SDATA + lea _LinkerDB,a4 + else + lea mt_data(pc),a4 + endc + + ; set repeat sample pointers and lengths + ifne MINIMAL + move.l mt_chan1+n_loopstart(a4),AUD0LC-INTREQ(a0) + move.w mt_chan1+n_replen(a4),AUD0LEN-INTREQ(a0) + move.l mt_chan2+n_loopstart(a4),AUD1LC-INTREQ(a0) + move.w mt_chan2+n_replen(a4),AUD1LEN-INTREQ(a0) + move.l mt_chan3+n_loopstart(a4),AUD2LC-INTREQ(a0) + move.w mt_chan3+n_replen(a4),AUD2LEN-INTREQ(a0) + move.l mt_chan4+n_loopstart(a4),AUD3LC-INTREQ(a0) + move.w mt_chan4+n_replen(a4),AUD3LEN-INTREQ(a0) + + else ; !MINIMAL + tst.b mt_chan1+n_enable(a4) + beq .1 + move.l mt_chan1+n_loopstart(a4),AUD0LC-INTREQ(a0) + move.w mt_chan1+n_replen(a4),AUD0LEN-INTREQ(a0) +.1: tst.b mt_chan2+n_enable(a4) + beq .2 + move.l mt_chan2+n_loopstart(a4),AUD1LC-INTREQ(a0) + move.w mt_chan2+n_replen(a4),AUD1LEN-INTREQ(a0) +.2: tst.b mt_chan3+n_enable(a4) + beq .3 + move.l mt_chan3+n_loopstart(a4),AUD2LC-INTREQ(a0) + move.w mt_chan3+n_replen(a4),AUD2LEN-INTREQ(a0) +.3: tst.b mt_chan4+n_enable(a4) + beq .4 + move.l mt_chan4+n_loopstart(a4),AUD3LC-INTREQ(a0) + move.w mt_chan4+n_replen(a4),AUD3LEN-INTREQ(a0) +.4: + endc + + movem.l (sp)+,a0/a4 + rts + endc ; NO_TIMERS + + even +mt_dmaon: + dc.w $8000 + + +;--------------------------------------------------------------------------- + xdef _mt_init +_mt_init: +; Initialize new module. +; Reset speed to 6, tempo to 125 and start at given song position. +; Master volume is at 64 (maximum). +; a6 = CUSTOM +; a0 = module pointer +; a1 = sample pointer (NULL means samples are stored within the module) +; d0 = initial song position + + ifnd SDATA + move.l a4,-(sp) + lea mt_data(pc),a4 + endc + + move.l a0,mt_mod(a4) + movem.l d2/a2,-(sp) + + ; set initial song position + cmp.b 950(a0),d0 + blo .1 + moveq #0,d0 +.1: move.b d0,mt_SongPos(a4) + + move.l a1,d0 ; sample data location is given? + bne .4 + + ; get number of highest pattern + lea 952(a0),a1 ; song arrangement list + moveq #127,d0 + moveq #0,d2 +.2: move.b (a1)+,d1 + cmp.b d2,d1 + bls .3 + move.b d1,d2 +.3: dbf d0,.2 + addq.b #1,d2 ; number of patterns + + ; now we can calculate the base address of the sample data + moveq #10,d0 + asl.l d0,d2 + lea (a0,d2.l),a1 + add.w #1084,a1 + + ; save start address of each sample and do some fixes for broken mods +.4: lea mt_SampleStarts(a4),a2 + moveq #1,d2 + moveq #31-1,d0 +.5: move.l a1,(a2)+ + moveq #0,d1 + move.w 42(a0),d1 + cmp.w d2,d1 ; length 0 and 1 define unused samples + bls .6 + add.l d1,d1 + add.l d1,a1 + bra .7 +.6: clr.w 42(a0) ; length 1 means zero -> no sample +.7: lea 30(a0),a0 + dbf d0,.5 + + movem.l (sp)+,d2/a2 + + ifeq VBLANK_MUSIC + ; reset CIA timer A to default (125) + move.l mt_timerval(a4),d0 + divu #125,d0 + move.b d0,CIAB+CIATALO + lsr.w #8,d0 + move.b d0,CIAB+CIATAHI + endc + +mt_reset: +; a4 must be initialized with base register + + ; reset speed and counters + move.b #6,mt_Speed(a4) + clr.b mt_Counter(a4) + clr.w mt_PatternPos(a4) + clr.b mt_PattDelTime(a4) + clr.b mt_PattDelTime2(a4) + clr.w mt_PBreakPos(a4) + clr.b mt_PBreakFlag(a4) + clr.b mt_PosJumpFlag(a4) + + ; disable the filter + or.b #2,CIAA+CIAPRA + + ifeq MINIMAL + ; set master volume to 64 + lea MasterVolTab64(pc),a0 + move.l a0,mt_MasterVolTab(a4) + endc + + ; set channel index + clr.b mt_chan1+n_index(a4) + move.b #1,mt_chan2+n_index(a4) + move.b #2,mt_chan3+n_index(a4) + move.b #3,mt_chan4+n_index(a4) + + ; initialize channel DMA and interrupt bits + move.w #$0001,mt_chan1+n_dmabit(a4) + move.w #$0002,mt_chan2+n_dmabit(a4) + move.w #$0004,mt_chan3+n_dmabit(a4) + move.w #$0008,mt_chan4+n_dmabit(a4) + move.w #$0080,mt_chan1+n_intbit(a4) + move.w #$0100,mt_chan2+n_intbit(a4) + move.w #$0200,mt_chan3+n_intbit(a4) + move.w #$0400,mt_chan4+n_intbit(a4) + + clr.b mt_E8Trigger(a4) + ifeq MINIMAL + clr.b mt_SongEnd(a4) + clr.b mt_SilCntValid(a4) + endc + + ifnd SDATA + move.l (sp)+,a4 + endc + + +;--------------------------------------------------------------------------- + xdef _mt_end +_mt_end: +; Stop playing current module. +; a6 = CUSTOM + + DISABLE + ifd SDATA + clr.b mt_Enable(a4) + lea mt_chan1(a4),a0 + bsr resetch + lea mt_chan2(a4),a0 + bsr resetch + lea mt_chan3(a4),a0 + bsr resetch + lea mt_chan4(a4),a0 + bsr resetch + else + lea mt_data(pc),a1 + clr.b mt_Enable(a1) + lea mt_chan1(a1),a0 + bsr resetch + lea mt_chan2(a1),a0 + bsr resetch + lea mt_chan3(a1),a0 + bsr resetch + lea mt_chan4(a1),a0 + bsr resetch + endc + moveq #0,d0 + move.w d0,AUD0VOL(a6) + move.w d0,AUD1VOL(a6) + move.w d0,AUD2VOL(a6) + move.w d0,AUD3VOL(a6) + move.w #$000f,DMACON(a6) + ENABLE + rts + + +resetch: +; a0 = channel status +; All registers are preserved! + + move.w #320,n_period(a0) ; make sure period is not illegal + clr.w n_volume(a0) + clr.w n_sfxlen(a0) + clr.w n_funk(a0) + clr.b n_sfxpri(a0) + clr.b n_looped(a0) + clr.b n_gliss(a0) + ifeq MINIMAL + clr.b n_musiconly(a0) + st n_enable(a0) + endc + rts + + + ifeq MINIMAL +;--------------------------------------------------------------------------- + xdef _mt_soundfx +_mt_soundfx: +; Request playing of an external sound effect on the most unused channel. +; This function is for compatibility with the old API only! +; You should call _mt_playfx instead! +; a6 = CUSTOM +; a0 = sample pointer +; d0.w = sample length in words +; d1.w = sample period +; d2.w = sample volume + + lea -sfx_sizeof(sp),sp + move.l a0,sfx_ptr(sp) + movem.w d0-d2,sfx_len(sp) + move.w #$ff01,sfx_cha(sp) ; any channel, priority=1 + move.l sp,a0 + bsr _mt_playfx + lea sfx_sizeof(sp),sp + rts + + +;--------------------------------------------------------------------------- + xdef _mt_playfx +_mt_playfx: +; Request playing of a prioritized external sound effect, either on a +; fixed channel or on the most unused one. +; A negative channel specification means to use the best one. +; The priority is unsigned and should be greater than zero. +; This channel will be blocked for music until the effect has finished. +; a6 = CUSTOM +; a0 = sfx-structure pointer with the following layout: +; 0: ptr, 4: len.w, 6: period.w, 8: vol.w, 10: channel.b, 11: priority.b +; -> d0 = pointer to channel status or NULL when sample was ignored + + ifd SDATA + movem.l d2-d7/a0-a3/a5,-(sp) + else + movem.l d2-d7/a0-a5,-(sp) + lea mt_data(pc),a4 + endc + + DISABLE + moveq #0,d0 + move.b sfx_cha(a0),d0 + bpl channelsfx ; use fixed channel for effect + + ; Did we already calculate the n_freecnt values for all channels? + tst.b mt_SilCntValid(a4) + bne freecnt_valid + + ; Look at the next 8 pattern steps to find the longest sequence + ; of silence (no new note or instrument). + moveq #8,d2 + move.l #$fffff000,d3 ; mask to ignore effects + + ; reset freecnts for all channels + moveq #0,d0 + move.b d0,mt_chan1+n_freecnt(a4) + move.b d0,mt_chan2+n_freecnt(a4) + move.b d0,mt_chan3+n_freecnt(a4) + move.b d0,mt_chan4+n_freecnt(a4) + moveq #-1,d4 + moveq #-1,d5 + moveq #-1,d6 + moveq #-1,d7 + + ; get pattern pointer + move.l mt_mod(a4),a3 ; a3 mod pointer + lea 952(a3),a5 ; a5 song arrangement list + move.w mt_PatternPos(a4),d1 + move.b mt_SongPos(a4),d0 +.1: move.b (a5,d0.w),d0 + swap d0 + lea 1084(a3),a1 + lsr.l #6,d0 + add.l d0,a1 + lea 1024(a1),a2 ; a2 end of pattern + add.w d1,a1 ; a1 current pattern pos + +.2: moveq #0,d0 + + move.l (a1)+,d1 + and.l d3,d1 + seq d1 + and.b d1,d4 + sub.b d4,mt_chan1+n_freecnt(a4) + add.b d4,d0 + + move.l (a1)+,d1 + and.l d3,d1 + seq d1 + and.b d1,d5 + sub.b d5,mt_chan2+n_freecnt(a4) + add.b d5,d0 + + move.l (a1)+,d1 + and.l d3,d1 + seq d1 + and.b d1,d6 + sub.b d6,mt_chan3+n_freecnt(a4) + add.b d6,d0 + + move.l (a1)+,d1 + and.l d3,d1 + seq d1 + and.b d1,d7 + sub.b d7,mt_chan4+n_freecnt(a4) + add.b d7,d0 + + ; break the loop when no channel has any more free pattern steps + beq .7 + + ; otherwise break after 8 pattern steps + subq.w #1,d2 + beq .7 + + ; End of pattern reached? Then load next pattern pointer. + cmp.l a2,a1 + blo .2 + moveq #0,d1 + moveq #1,d0 + add.b mt_SongPos(a4),d0 + and.w #$007f,d0 + cmp.b 950(a3),d0 ; end of song reached? + blo .1 + moveq #0,d0 + bra .1 + +.7: st mt_SilCntValid(a4) + +freecnt_valid: + sub.l a2,a2 + move.b sfx_pri(a0),d2 + + ; Determine which channels are already allocated for sound + ; effects and check if the limit was reached. In this case only + ; replace sound effect channels by higher priority. + moveq #3,d0 + sub.b mt_MusicChannels(a4),d0 + move.b mt_chan1+n_sfxpri(a4),d4 + or.b mt_chan1+n_musiconly(a4),d4 + sne d1 + add.b d1,d0 + move.b mt_chan2+n_sfxpri(a4),d5 + or.b mt_chan2+n_musiconly(a4),d5 + sne d1 + add.b d1,d0 + move.b mt_chan3+n_sfxpri(a4),d6 + or.b mt_chan3+n_musiconly(a4),d6 + sne d1 + add.b d1,d0 + move.b mt_chan4+n_sfxpri(a4),d7 + or.b mt_chan4+n_musiconly(a4),d7 + sne d1 + add.b d1,d0 + bmi .overwrite ; all channels reserved/playing effects + + ; We will prefer a music channel which had an audio interrupt, + ; because that means the last instrument sample has been played + ; completely, and the channel is now in an idle loop. + ; Also exclude channels which have set a repeat loop. + ; Try not to break them! + moveq #0,d3 + tst.b mt_chan1+n_looped(a4) + bne .1 + or.w #$0080,d3 +.1: tst.b mt_chan2+n_looped(a4) + bne .2 + or.w #$0100,d3 +.2: tst.b mt_chan3+n_looped(a4) + bne .3 + or.w #$0200,d3 +.3: tst.b mt_chan4+n_looped(a4) + bne .4 + or.w #$0400,d3 +.4: move.w INTREQR(a6),d1 + and.w d3,d1 + bne .6 + + ; All channels are busy. Then break the non-looped ones first... + move.w d3,d1 + bne .6 + + ; ..except there are none. Then it doesn't matter. :| + move.w #$0780,d1 + + ; first look for the best unused channel +.6: moveq #0,d3 + btst #7,d1 + seq d0 + or.b d4,d0 + bne .7 + lea mt_chan1+n_freecnt(a4),a1 + cmp.b (a1),d3 + bhi .7 + move.l a1,a2 + move.b (a1),d3 +.7: btst #8,d1 + seq d0 + or.b d5,d0 + bne .8 + lea mt_chan2+n_freecnt(a4),a1 + cmp.b (a1),d3 + bhi .8 + move.l a1,a2 + move.b (a1),d3 +.8: btst #9,d1 + seq d0 + or.b d6,d0 + bne .9 + lea mt_chan3+n_freecnt(a4),a1 + cmp.b (a1),d3 + bhi .9 + move.l a1,a2 + move.b (a1),d3 +.9: btst #10,d1 + seq d0 + or.b d7,d0 + bne .10 + lea mt_chan4+n_freecnt(a4),a1 + cmp.b (a1),d3 + bhi .10 + move.l a1,a2 + bra found_sfx_ch + +.10: move.l a2,d3 + bne found_sfx_ch + +.overwrite: + ; finally try to overwrite a sound effect with lower/equal priority + moveq #0,d3 + tst.b d4 + beq .11 + cmp.b d4,d2 + blo .11 + lea mt_chan1+n_freecnt(a4),a2 + move.b (a2),d3 +.11: tst.b d5 + beq .12 + cmp.b d5,d2 + blo .12 + lea mt_chan2+n_freecnt(a4),a1 + cmp.b (a1),d3 + bhi .12 + move.l a1,a2 + move.b (a1),d3 +.12: tst.b d6 + beq .13 + cmp.b d6,d2 + blo .13 + lea mt_chan3+n_freecnt(a4),a1 + cmp.b (a1),d3 + bhi .13 + move.l a1,a2 + move.b (a1),d3 +.13: tst.b d7 + beq .14 + cmp.b d7,d2 + blo .14 + lea mt_chan4+n_freecnt(a4),a1 + cmp.b (a1),d3 + bhi .14 + move.l a1,a2 + +.14: move.l a2,d3 + beq exit_playfx ; ignore new sfx due to low priority + +found_sfx_ch: + lea -n_freecnt(a2),a2 + bra set_sfx + +channelsfx: +; a0 = sfx structure +; d0 = fixed channel for new sound effect + add.w d0,d0 + lea mt_chan1(a4),a2 + add.w channel_offsets(pc,d0.w),a2 + + ; priority high enough to replace a present effect on this channel? + move.b sfx_pri(a0),d2 + cmp.b n_sfxpri(a2),d2 + bhs set_sfx + sub.l a2,a2 + bra exit_playfx + +set_sfx: +; activate the sound effect on this channel +; a0 = sfx structure +; d2 = sfx priority +; a2 = channel status + move.l (a0)+,n_sfxptr(a2) ; sfx_ptr + move.w (a0)+,n_sfxlen(a2) ; sfx_len + move.w (a0)+,n_sfxper(a2) ; sfx_per + move.w (a0),n_sfxvol(a2) ; sfx_vol + move.b d2,n_sfxpri(a2) + +exit_playfx: + ENABLE + move.l a2,d0 ; ptr to selected channel or NULL + + ifd SDATA + movem.l (sp)+,d2-d7/a0-a3/a5 + else + movem.l (sp)+,d2-d7/a0-a5 + endc + rts + +channel_offsets: + dc.w 0*n_sizeof,1*n_sizeof,2*n_sizeof,3*n_sizeof + + +;--------------------------------------------------------------------------- + xdef _mt_loopfx +_mt_loopfx: +; Request playing of a looped sound effect on a fixed channel, which +; will be blocked for music until the effect is stopped (_mt_stopfx). +; It uses the same sfx-structure as _mt_playfx, but the priority is +; ignored. A looped sound effect has always highest priority and will +; replace a previous effect on the same channel. No automatic channel +; selection possible! +; Also make sure the sample starts with a zero-word, which is used +; for idling when the effect is stopped. This word is included in the +; total length calculation, but excluded when actually playing the loop. +; a6 = CUSTOM +; a0 = sfx-structure pointer with the following layout: +; 0: ptr, 4: len.w, 6: period.w, 8: vol.w, 10: channel.b + + ifnd SDATA + lea mt_data+mt_chan1(pc),a1 + else + lea mt_chan1(a4),a1 + endc + + moveq #3,d0 + and.b sfx_cha(a0),d0 + add.w d0,d0 + add.w channel_offsets(pc,d0.w),a1 + + DISABLE + move.l (a0)+,n_sfxptr(a1) ; sfx_ptr + move.w (a0)+,n_sfxlen(a1) ; sfx_len + move.w (a0)+,n_sfxper(a1) ; sfx_per + move.w (a0),n_sfxvol(a1) ; sfx_vol + st n_sfxpri(a1) ; sfx_pri -1 enables looped mode + ENABLE + rts + + +;--------------------------------------------------------------------------- + xdef _mt_stopfx +_mt_stopfx: +; Immediately stop a currently playing sound effect on a channel. +; a6 = CUSTOM +; d0.b = channel (0..3) + + ifnd SDATA + lea mt_data+mt_chan1(pc),a0 + else + lea mt_chan1(a4),a0 + endc + + and.w #3,d0 + add.w d0,d0 + add.w channel_offsets(pc,d0.w),a0 + + DISABLE + tst.b n_sfxpri(a0) + beq .1 ; no sfx playing anyway + moveq #1,d0 + move.b d0,n_sfxpri(a0) + move.w d0,n_sfxlen(a0) ; idle loop + move.w #108,n_sfxper(a0) ; enter idle as quickly as possible + clr.w n_sfxvol(a0) ; and cut volume + ifne NULL_IS_CLEARED + clr.b n_looped(a0) + clr.l n_sfxptr(a0) ; use $0 for idle-looping + else + tst.b n_looped(a0) + beq .1 + clr.b n_looped(a0) + subq.l #2,n_sfxptr(a0) ; idle loop at sample-start - 2 + endc +.1: ENABLE + + rts + + +;--------------------------------------------------------------------------- + xdef _mt_musicmask +_mt_musicmask: +; Set bits in the mask define which specific channels are reserved +; for music only. +; a6 = CUSTOM +; d0.b = channel-mask (bit 0 for channel 0, ..., bit 3 for channel 3) + + ifnd SDATA + move.l a4,-(sp) + lea mt_data(pc),a4 + endc + + DISABLE + + lsl.b #5,d0 + scs mt_chan4+n_musiconly(a4) + add.b d0,d0 + scs mt_chan3+n_musiconly(a4) + add.b d0,d0 + scs mt_chan2+n_musiconly(a4) + add.b d0,d0 + scs mt_chan1+n_musiconly(a4) + + ENABLE + + ifnd SDATA + move.l (sp)+,a4 + endc + rts + + +;--------------------------------------------------------------------------- + xdef _mt_mastervol +_mt_mastervol: +; Set a master volume from 0 to 64 for all music channels. +; Note that the master volume does not affect the volume of external +; sound effects (which is desired). +; a6 = CUSTOM +; d0.w = master volume + + ifnd SDATA + move.l a4,-(sp) + lea mt_data(pc),a4 + endc + + ; stingray, since each volume table has a size of 65 bytes + ; we simply multiply (optimised of course) by 65 to get the + ; offset to the correct table + lea MasterVolTab0(pc),a0 + add.w d0,a0 + lsl.w #6,d0 + add.w d0,a0 + + ; set new table and adapt all channel volumes immediately + DISABLE + move.l a0,mt_MasterVolTab(a4) + bsr set_all_volumes + ENABLE + + ifnd SDATA + move.l (sp)+,a4 + endc + rts + + +;--------------------------------------------------------------------------- + xdef _mt_channelmask +_mt_channelmask: +; Define which music channels are muted. Doesn't affect sound effects. +; a6 = CUSTOM +; d0.b = channel-mask (bit 0 for channel 0, ..., bit 3 for channel 3) + + ifnd SDATA + move.l a4,-(sp) + lea mt_data(pc),a4 + endc + + DISABLE + + lsl.b #5,d0 + scs mt_chan4+n_enable(a4) + add.b d0,d0 + scs mt_chan3+n_enable(a4) + add.b d0,d0 + scs mt_chan2+n_enable(a4) + add.b d0,d0 + scs mt_chan1+n_enable(a4) + move.l mt_MasterVolTab(a4),a0 + bsr set_all_volumes + + ENABLE + + ifnd SDATA + move.l (sp)+,a4 + endc + rts + + +;--------------------------------------------------------------------------- +set_all_volumes: +; a0 = Master volume table + + tst.b mt_chan1+n_sfxpri(a4) + bne .1 + move.w mt_chan1+n_volume(a4),d0 + move.b (a0,d0.w),d0 + and.b mt_chan1+n_enable(a4),d0 + move.w d0,AUD0VOL(a6) + ifd VOL0_UNLOOPS + bne .1 + clr.b mt_chan1+n_looped(a4) + endc +.1: tst.b mt_chan2+n_sfxpri(a4) + bne .2 + move.w mt_chan2+n_volume(a4),d0 + move.b (a0,d0.w),d0 + and.b mt_chan2+n_enable(a4),d0 + move.w d0,AUD1VOL(a6) + ifd VOL0_UNLOOPS + bne .2 + clr.b mt_chan2+n_looped(a4) + endc +.2: tst.b mt_chan3+n_sfxpri(a4) + bne .3 + move.w mt_chan3+n_volume(a4),d0 + move.b (a0,d0.w),d0 + and.b mt_chan3+n_enable(a4),d0 + move.w d0,AUD2VOL(a6) + ifd VOL0_UNLOOPS + bne .3 + clr.b mt_chan3+n_looped(a4) + endc +.3: tst.b mt_chan4+n_sfxpri(a4) + bne .4 + move.w mt_chan4+n_volume(a4),d0 + move.b (a0,d0.w),d0 + and.b mt_chan4+n_enable(a4),d0 + move.w d0,AUD3VOL(a6) + ifd VOL0_UNLOOPS + bne .4 + clr.b mt_chan4+n_looped(a4) + endc +.4: rts + + +;--------------------------------------------------------------------------- + xdef _mt_samplevol +_mt_samplevol: +; Redefine a sample's volume. May also be done while the song is playing. +; Warning: Does not check arguments for valid range! You must have done +; _mt_init before calling this function! +; The new volume is persistent. Even when the song is restarted. +; d0.w = sample number (0-31) +; d1.b = volume (0-64) + + ifd SDATA + move.l mt_mod(a4),a0 + else + move.l mt_data+mt_mod(pc),a0 + endc + + swap d1 + move.w d0,d1 + add.w d1,d1 + lsl.w #5,d0 + sub.w d1,d0 ; table index: sample number * 30 + swap d1 + move.b d1,12+3(a0,d0.w) ; set sample's volume + rts + endc ; !MINIMAL + + +;--------------------------------------------------------------------------- + xdef _mt_music +_mt_music: +; Used when called by external interrupt handler. +; Saves/restores all registers and sets up A4 when needed. +; a6 = CUSTOM + + ifd SDATA + movem.l d2-d7/a2-a3/a5,-(sp) + bsr mt_music + movem.l (sp)+,d2-d7/a2-a3/a5 + else ; !SDATA + movem.l d2-d7/a2-a5,-(sp) + lea mt_data(pc),a4 + bsr mt_music + movem.l (sp)+,d2-d7/a2-a5 + endc + rts + +mt_music: +; Called from interrupt. +; Play next position when Counter equals Speed. +; Effects are always handled. +; a6 = CUSTOM + + moveq #0,d7 ; d7 is always zero + + lea mt_dmaon+1(pc),a0 + move.b d7,(a0) + + addq.b #1,mt_Counter(a4) + + move.b mt_Counter(a4),d0 + cmp.b mt_Speed(a4),d0 + blo no_new_note + + ; handle a new note + move.b d7,mt_Counter(a4) + tst.b mt_PattDelTime2(a4) + beq get_new_note + + ; we have a pattern delay, check effects then step + lea AUD0LC(a6),a5 + lea mt_chan1(a4),a2 + bsr mt_checkfx + lea AUD1LC(a6),a5 + lea mt_chan2(a4),a2 + bsr mt_checkfx + lea AUD2LC(a6),a5 + lea mt_chan3(a4),a2 + bsr mt_checkfx + lea AUD3LC(a6),a5 + lea mt_chan4(a4),a2 + bsr mt_checkfx + bra settb_step + +no_new_note: + ; no new note, just check effects, don't step to next position + lea AUD0LC(a6),a5 + lea mt_chan1(a4),a2 + bsr mt_checkfx + lea AUD1LC(a6),a5 + lea mt_chan2(a4),a2 + bsr mt_checkfx + lea AUD2LC(a6),a5 + lea mt_chan3(a4),a2 + bsr mt_checkfx + lea AUD3LC(a6),a5 + lea mt_chan4(a4),a2 + bsr mt_checkfx + + ifeq NO_TIMERS + ; set one-shot TimerB interrupt for enabling DMA, when needed + move.b mt_dmaon+1(pc),d0 + beq same_pattern + move.b #$19,CIAB+CIACRB ; load/start timer B, one-shot + endc + bra same_pattern + +get_new_note: + ; determine pointer to current pattern line + move.l mt_mod(a4),a0 + lea 12(a0),a3 ; sample info table + lea 1084(a0),a1 ; pattern data + lea 952(a0),a0 + moveq #0,d0 + move.b mt_SongPos(a4),d0 + move.b (a0,d0.w),d0 ; current pattern number + swap d0 + lsr.l #6,d0 + add.l d0,a1 ; pattern base + add.w mt_PatternPos(a4),a1 ; a1 pattern line + + ; play new note for each channel, apply some effects + lea AUD0LC(a6),a5 + lea mt_chan1(a4),a2 + bsr mt_playvoice + lea AUD1LC(a6),a5 + lea mt_chan2(a4),a2 + bsr mt_playvoice + lea AUD2LC(a6),a5 + lea mt_chan3(a4),a2 + bsr mt_playvoice + lea AUD3LC(a6),a5 + lea mt_chan4(a4),a2 + bsr mt_playvoice + +settb_step: + ifeq NO_TIMERS + ; set one-shot TimerB interrupt for enabling DMA, when needed + move.b mt_dmaon+1(pc),d0 + beq pattern_step + move.b #$19,CIAB+CIACRB ; load/start timer B, one-shot + endc + +pattern_step: + ; next pattern line, handle delay and break + ifeq MINIMAL + clr.b mt_SilCntValid(a4) ; recalculate silence counters + endc + moveq #16,d2 ; offset to next pattern line + + move.b mt_PattDelTime2(a4),d1 + move.b mt_PattDelTime(a4),d0 + beq .1 + move.b d0,d1 + move.b d7,mt_PattDelTime(a4) +.1: tst.b d1 + beq .3 + subq.b #1,d1 + beq .2 + moveq #0,d2 ; do not advance to next line +.2: move.b d1,mt_PattDelTime2(a4) + +.3: add.w mt_PatternPos(a4),d2 ; d2 PatternPos + + ; check for break + bclr d7,mt_PBreakFlag(a4) + beq .4 + move.w mt_PBreakPos(a4),d2 + move.w d7,mt_PBreakPos(a4) + + ; check whether end of pattern is reached +.4: move.w d2,mt_PatternPos(a4) + cmp.w #1024,d2 + blo same_pattern + +song_step: + move.w mt_PBreakPos(a4),mt_PatternPos(a4) + move.w d7,mt_PBreakPos(a4) + move.b d7,mt_PosJumpFlag(a4) + + ; next position in song + moveq #1,d0 + add.b mt_SongPos(a4),d0 + and.w #$007f,d0 + move.l mt_mod(a4),a0 + cmp.b 950(a0),d0 ; end of song reached? + blo .1 + moveq #0,d0 ; restart the song from the beginning + ifeq MINIMAL + addq.b #1,mt_SongEnd(a4) + bne .2 + clr.b mt_Enable(a4) ; stop the song when mt_SongEnd was -1 +.2: and.b #$7f,mt_SongEnd(a4) + endc +.1: move.b d0,mt_SongPos(a4) + +same_pattern: + tst.b mt_PosJumpFlag(a4) + bne song_step + + rts + + + ifeq MINIMAL +;--------------------------------------------------------------------------- +mt_sfxonly: +; Called from interrupt. +; Plays sound effects on free channels. +; a6 = CUSTOM + + moveq #0,d7 ; d7 is always zero + + lea mt_dmaon+1(pc),a0 + move.b d7,(a0) + + lea AUD0LC(a6),a5 + lea mt_chan1(a4),a2 + bsr chan_sfx_only + lea AUD1LC(a6),a5 + lea mt_chan2(a4),a2 + bsr chan_sfx_only + lea AUD2LC(a6),a5 + lea mt_chan3(a4),a2 + bsr chan_sfx_only + lea AUD3LC(a6),a5 + lea mt_chan4(a4),a2 + bsr chan_sfx_only + + ifeq NO_TIMERS + move.b mt_dmaon+1(pc),d0 + beq .1 + move.b #$19,CIAB+CIACRB ; load/start timer B, one-shot + endc + +.1: rts + + +chan_sfx_only: +; Check for new sound samples. Check if previous ones are finished. +; a2 = channel data +; a5 = audio registers + + tst.b n_sfxpri(a2) + beq .1 + + move.w n_sfxlen(a2),d0 + bne start_sfx + tst.b n_looped(a2) + bne .1 + + move.w n_intbit(a2),d0 + and.w INTREQR(a6),d0 + beq .1 + move.w n_dmabit(a2),d0 + and.w mt_dmaon(pc),d0 + bne .1 + + ; last sound effect sample has played, so unblock this channel again + move.b d7,n_sfxpri(a2) + +.1: rts + + +;--------------------------------------------------------------------------- +start_sfx: +; d0 = sfx_len in words +; a2 = channel data +; a5 = audio registers + + ; play new sound effect on this channel + move.w n_dmabit(a2),d1 + move.w d1,DMACON(a6) + + move.l n_sfxptr(a2),a0 + tst.b n_sfxpri(a2) + bpl .1 + + ; looped sound effect + st n_looped(a2) + addq.l #2,a0 ; skip first word, used for idling + subq.w #1,d0 + move.l a0,AUDLC(a5) + move.w d0,AUDLEN(a5) + bra .2 + + ; normal sound effect +.1: move.b d7,n_looped(a2) + move.l a0,AUDLC(a5) + move.w d0,AUDLEN(a5) + moveq #1,d0 ; idles after playing once + ifne NULL_IS_CLEARED + sub.l a0,a0 + endc + + ; save repeat and period for TimerB interrupt +.2: move.l a0,n_loopstart(a2) + move.w d0,n_replen(a2) + move.w n_sfxper(a2),d0 + move.w d0,AUDPER(a5) + move.w d0,n_period(a2) + move.w n_sfxvol(a2),AUDVOL(a5) + + move.w d7,n_sfxlen(a2) ; don't call start_sfx again + + lea mt_dmaon(pc),a0 + or.w d1,(a0) ; DMA-channel to enable on TimerB + rts + endc ; !MINIMAL + + +;--------------------------------------------------------------------------- +mt_checkfx: +; a2 = channel data +; a5 = audio registers + + ifeq MINIMAL + tst.b n_sfxpri(a2) + beq .3 + + move.w n_sfxlen(a2),d0 + beq .2 + bsr start_sfx + + ; channel is blocked, only check some E-commands +.1: move.w #$0fff,d4 + and.w n_cmd(a2),d4 + move.w d4,d0 + clr.b d0 + cmp.w #$0e00,d0 + bne mt_nop + and.w #$00ff,d4 + bra blocked_e_cmds + +.2: tst.b n_looped(a2) + bne .1 + move.w n_intbit(a2),d0 + and.w INTREQR(a6),d0 + beq .1 + move.w n_dmabit(a2),d0 + and.w mt_dmaon(pc),d0 + bne .1 + + ; sound effect sample has played, so unblock this channel again + move.b d7,n_sfxpri(a2) + endc ; !MINIMAL + + ; do channel effects between notes +.3: move.w n_funk(a2),d0 + beq .4 + bsr mt_updatefunk + +.4: move.w #$0fff,d4 + and.w n_cmd(a2),d4 + beq mt_pernop + and.w #$00ff,d4 + + moveq #$0f,d0 + and.b n_cmd(a2),d0 + add.w d0,d0 + move.w fx_tab(pc,d0.w),d0 + jmp fx_tab(pc,d0.w) + +fx_tab: + dc.w mt_arpeggio-fx_tab ; $0 + dc.w mt_portaup-fx_tab + dc.w mt_portadown-fx_tab + dc.w mt_toneporta-fx_tab + dc.w mt_vibrato-fx_tab ; $4 + dc.w mt_tonevolslide-fx_tab + dc.w mt_vibrvolslide-fx_tab + dc.w mt_tremolo-fx_tab + dc.w mt_nop-fx_tab ; $8 + dc.w mt_nop-fx_tab + dc.w mt_volumeslide-fx_tab + dc.w mt_nop-fx_tab + dc.w mt_nop-fx_tab ; $C + dc.w mt_nop-fx_tab + dc.w mt_e_cmds-fx_tab + dc.w mt_nop-fx_tab + + +mt_pernop: +; just set the current period + + move.w n_period(a2),AUDPER(a5) +mt_nop: + rts + + +;--------------------------------------------------------------------------- +mt_playvoice: +; a1 = pattern ptr +; a2 = channel data +; a3 = sample info table +; a5 = audio registers + + move.l (a1)+,d6 ; d6 current note/cmd words + + ifeq MINIMAL + ; channel blocked by external sound effect? + tst.b n_sfxpri(a2) + beq .2 + + move.w n_sfxlen(a2),d0 + beq .1 + bsr start_sfx + bra moreblockedfx + + ; do only some limited commands, while sound effect is in progress +.1: tst.b n_looped(a2) + bne moreblockedfx + move.w n_intbit(a2),d0 + and.w INTREQR(a6),d0 + beq moreblockedfx + move.w n_dmabit(a2),d0 + and.w mt_dmaon(pc),d0 + bne moreblockedfx + + ; sound effect sample has played, so unblock this channel again + move.b d7,n_sfxpri(a2) + endc ; !MINIMAL + +.2: tst.l (a2) ; n_note/cmd: any note or cmd set? + bne .3 + move.w n_period(a2),AUDPER(a5) +.3: move.l d6,(a2) + + moveq #15,d5 + and.b n_cmd(a2),d5 + add.w d5,d5 ; d5 cmd*2 + + moveq #0,d4 + move.b d6,d4 ; d4 cmd argument (in MSW) + swap d4 + move.w #$0ff0,d4 + and.w d6,d4 ; d4 for checking E-cmd (in LSW) + + swap d6 + move.l d6,d0 ; S...S... + clr.b d0 + rol.w #4,d0 + rol.l #4,d0 ; ....00SS + + and.w #$0fff,d6 ; d6 note + + ; get sample start address + add.w d0,d0 ; sample number * 2 + beq set_regs + move.w mult30tab(pc,d0.w),d1 ; d1 sample info table offset + lea mt_SampleStarts(a4),a0 + add.w d0,d0 + move.l -4(a0,d0.w),d2 + + ; read length, volume and repeat from sample info table + lea (a3,d1.w),a0 + move.w (a0)+,d0 ; length + bne .4 + + ifne NULL_IS_CLEARED + moveq #0,d2 ; use $0 for empty samples + else + ; use the first two bytes from the first sample for empty samples + move.l mt_SampleStarts(a4),d2 + endc + addq.w #1,d0 + +.4: move.l d2,n_start(a2) + move.w d0,n_reallength(a2) + + ; determine period table from fine-tune parameter + moveq #0,d3 + move.b (a0)+,d3 + add.w d3,d3 + move.l a0,d1 + lea mt_PerFineTune(pc),a0 + add.w (a0,d3.w),a0 + move.l a0,n_pertab(a2) + move.l d1,a0 + cmp.w #2*8,d3 + shs n_minusft(a2) + + moveq #0,d1 + move.b (a0)+,d1 ; volume + move.w d1,n_volume(a2) + move.w (a0)+,d3 ; repeat offset + beq no_offset + + ; set repeat + add.l d3,d2 + add.l d3,d2 + move.w (a0),d0 + move.w d0,n_replen(a2) + exg d0,d3 ; n_replen to d3 + add.w d3,d0 + bra set_len_start + +mult30tab: + dc.w 0*30,1*30,2*30,3*30,4*30,5*30,6*30,7*30 + dc.w 8*30,9*30,10*30,11*30,12*30,13*30,14*30,15*30 + dc.w 16*30,17*30,18*30,19*30,20*30,21*30,22*30,23*30 + dc.w 24*30,25*30,26*30,27*30,28*30,29*30,30*30,31*30 + +no_offset: + move.w (a0),d3 + ifne NULL_IS_CLEARED + cmp.w #1,d3 + beq .1 + bhi set_replen + else + bne set_replen + endc + ; repeat length zero means idle-looping + addq.w #1,d3 +.1: moveq #0,d2 ; expect two zero bytes at $0 +set_replen: + move.w d3,n_replen(a2) +set_len_start: + move.w d0,n_length(a2) + move.l d2,n_loopstart(a2) + move.l d2,n_wavestart(a2) + + ifeq MINIMAL + move.l mt_MasterVolTab(a4),a0 + move.b (a0,d1.w),d1 + and.b n_enable(a2),d1 + endc + move.w d1,AUDVOL(a5) + + ; remember if sample is looped + ; @@@ FIXME: also need to check if n_loopstart equals n_start + subq.w #1,d3 + sne n_looped(a2) + +set_regs: +; d4 = cmd argument | masked E-cmd +; d5 = cmd*2 +; d6 = cmd.w | note.w + + move.w d4,d3 ; d3 masked E-cmd + swap d4 ; d4 cmd argument into LSW + + tst.w d6 + beq checkmorefx ; no new note + + cmp.w #$0e50,d3 + beq set_finetune + + move.w prefx_tab(pc,d5.w),d0 + jmp prefx_tab(pc,d0.w) + +prefx_tab: + dc.w set_period-prefx_tab,set_period-prefx_tab,set_period-prefx_tab + dc.w set_toneporta-prefx_tab ; $3 + dc.w set_period-prefx_tab + dc.w set_toneporta-prefx_tab ; $5 + dc.w set_period-prefx_tab,set_period-prefx_tab,set_period-prefx_tab + dc.w set_sampleoffset-prefx_tab ; $9 + dc.w set_period-prefx_tab,set_period-prefx_tab,set_period-prefx_tab + dc.w set_period-prefx_tab,set_period-prefx_tab,set_period-prefx_tab + + +mt_sampleoffset: +; cmd 9 x y (xy = offset in 256 bytes) +; d4 = xy + + moveq #0,d0 + move.b d4,d0 + bne .1 + move.b n_sampleoffset(a2),d0 + bra .2 +.1: move.b d0,n_sampleoffset(a2) + +.2: lsl.w #7,d0 + cmp.w n_length(a2),d0 + bhs .3 + sub.w d0,n_length(a2) + add.w d0,d0 + add.l d0,n_start(a2) + rts + +.3: move.w #1,n_length(a2) + rts + + +set_sampleoffset: + bsr mt_sampleoffset + bra set_period + +set_finetune: + lea mt_PerFineTune(pc),a0 + moveq #$0f,d0 + and.b d4,d0 + add.w d0,d0 + add.w (a0,d0.w),a0 + move.l a0,n_pertab(a2) + cmp.w #2*8,d0 + shs n_minusft(a2) + +set_period: +; find nearest period for a note value, then apply finetuning +; d3 = masked E-cmd +; d4 = cmd argument +; d5 = cmd*2 +; d6 = note.w + + lea mt_PeriodTable(pc),a0 + moveq #36-1,d0 + moveq #-2,d1 +.1: addq.w #2,d1 ; table offset + cmp.w (a0)+,d6 + dbhs d0,.1 + + ; apply finetuning, set period and note-offset + move.l n_pertab(a2),a0 + move.w (a0,d1.w),d2 + move.w d2,n_period(a2) + move.w d1,n_noteoff(a2) + + ; check for notedelay + cmp.w #$0ed0,d3 ; notedelay + beq checkmorefx + + ; disable DMA + move.w n_dmabit(a2),d0 + move.w d0,DMACON(a6) + + btst #2,n_vibratoctrl(a2) + bne .2 + move.b d7,n_vibratopos(a2) + +.2: btst #2,n_tremoloctrl(a2) + bne .3 + move.b d7,n_tremolopos(a2) + +.3: move.l n_start(a2),AUDLC(a5) + move.w n_length(a2),AUDLEN(a5) + move.w d2,AUDPER(a5) + lea mt_dmaon(pc),a0 + or.w d0,(a0) + +checkmorefx: +; d4 = cmd argument +; d5 = cmd*2 +; d6 = note.w + + move.w n_funk(a2),d0 + beq .1 + bsr mt_updatefunk + +.1: move.w morefx_tab(pc,d5.w),d0 + jmp morefx_tab(pc,d0.w) + +morefx_tab: + dc.w mt_pernop-morefx_tab,mt_pernop-morefx_tab,mt_pernop-morefx_tab + dc.w mt_pernop-morefx_tab,mt_pernop-morefx_tab,mt_pernop-morefx_tab + dc.w mt_pernop-morefx_tab,mt_pernop-morefx_tab,mt_pernop-morefx_tab + dc.w mt_sampleoffset-morefx_tab ; $9 + dc.w mt_pernop-morefx_tab + dc.w mt_posjump-morefx_tab ; $B + dc.w mt_volchange-morefx_tab + dc.w mt_patternbrk-morefx_tab ; $D + dc.w mt_e_cmds-morefx_tab + dc.w mt_setspeed-morefx_tab + + +set_toneporta: + move.l n_pertab(a2),a0 ; tuned period table + + ; find first period which is less or equal the note in d6 + moveq #36-1,d0 + moveq #-2,d1 +.1: addq.w #2,d1 + cmp.w (a0)+,d6 + dbhs d0,.1 + + tst.b n_minusft(a2) ; negative fine tune? + beq .2 + tst.w d1 + beq .2 + subq.l #2,a0 ; then take previous period + subq.w #2,d1 + +.2: move.w d1,n_noteoff(a2) ; note offset in period table + move.w n_period(a2),d2 + move.w -(a0),d1 + cmp.w d1,d2 + bne .3 + moveq #0,d1 +.3: move.w d1,n_wantedperiod(a2) + + move.w n_funk(a2),d0 + beq .4 + bsr mt_updatefunk + +.4: move.w d2,AUDPER(a5) + rts + + + ifeq MINIMAL +moreblockedfx: +; d6 = note.w | cmd.w + + moveq #0,d4 + move.b d6,d4 ; cmd argument + and.w #$0f00,d6 + lsr.w #7,d6 + move.w blmorefx_tab(pc,d6.w),d0 + jmp blmorefx_tab(pc,d0.w) + +blmorefx_tab: + dc.w mt_nop-blmorefx_tab,mt_nop-blmorefx_tab + dc.w mt_nop-blmorefx_tab,mt_nop-blmorefx_tab + dc.w mt_nop-blmorefx_tab,mt_nop-blmorefx_tab + dc.w mt_nop-blmorefx_tab,mt_nop-blmorefx_tab + dc.w mt_nop-blmorefx_tab,mt_nop-blmorefx_tab + dc.w mt_nop-blmorefx_tab + dc.w mt_posjump-blmorefx_tab ; $B + dc.w mt_nop-blmorefx_tab + dc.w mt_patternbrk-blmorefx_tab ; $D + dc.w blocked_e_cmds-blmorefx_tab + dc.w mt_setspeed-blmorefx_tab ; $F + endc ; !MINIMAL + + +mt_arpeggio: +; cmd 0 x y (x = first arpeggio offset, y = second arpeggio offset) +; d4 = xy + + moveq #0,d0 + move.b mt_Counter(a4),d0 + move.b arptab(pc,d0.w),d0 + beq mt_pernop ; step 0, just use normal period + bmi .1 + + ; step 1, arpeggio by left nibble + lsr.b #4,d4 + bra .2 + + ; step 2, arpeggio by right nibble +.1: and.w #$000f,d4 + + ; offset current note +.2: add.w d4,d4 + add.w n_noteoff(a2),d4 + cmp.w #2*36,d4 + bhs .4 + + ; set period with arpeggio offset from note table + move.l n_pertab(a2),a0 + move.w (a0,d4.w),AUDPER(a5) +.4: rts + +arptab: + dc.b 0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0 + dc.b 1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1 + + +mt_fineportaup: +; cmd E 1 x (subtract x from period) +; d0 = x + + tst.b mt_Counter(a4) + beq do_porta_up + rts + + +mt_portaup: +; cmd 1 x x (subtract xx from period) +; d4 = xx + + move.w d4,d0 + +do_porta_up: + move.w n_period(a2),d1 + sub.w d0,d1 + cmp.w #113,d1 + bge .1 + moveq #113,d1 +.1: move.w d1,n_period(a2) + move.w d1,AUDPER(a5) + rts + + +mt_fineportadn: +; cmd E 2 x (add x to period) +; d0 = x + + tst.b mt_Counter(a4) + beq do_porta_down + rts + + +mt_portadown: +; cmd 2 x x (add xx to period) +; d4 = xx + + move.w d4,d0 + +do_porta_down: + move.w n_period(a2),d1 + add.w d0,d1 + cmp.w #856,d1 + bls .1 + move.w #856,d1 +.1: move.w d1,n_period(a2) + move.w d1,AUDPER(a5) + rts + + +mt_toneporta: +; cmd 3 x y (xy = tone portamento speed) +; d4 = xy + + tst.b d4 + beq mt_toneporta_nc + move.w d4,n_toneportspeed(a2) + move.b d7,n_cmdlo(a2) + +mt_toneporta_nc: + move.w n_wantedperiod(a2),d1 + beq .6 + + move.w n_toneportspeed(a2),d0 + move.w n_period(a2),d2 + cmp.w d1,d2 + blo .2 + + ; tone porta up + sub.w d0,d2 + cmp.w d1,d2 + bgt .3 + move.w d1,d2 + move.w d7,n_wantedperiod(a2) + bra .3 + + ; tone porta down +.2: add.w d0,d2 + cmp.w d1,d2 + blt .3 + move.w d1,d2 + move.w d7,n_wantedperiod(a2) + +.3: move.w d2,n_period(a2) + + tst.b n_gliss(a2) + beq .5 + + ; glissando: find nearest note for new period + move.l n_pertab(a2),a0 + moveq #36-1,d0 + moveq #-2,d1 +.4: addq.w #2,d1 + cmp.w (a0)+,d2 + dbhs d0,.4 + + move.w d1,n_noteoff(a2) ; @@@ needed? + move.w -(a0),d2 + +.5: move.w d2,AUDPER(a5) +.6 rts + + +mt_vibrato: +; cmd 4 x y (x = speed, y = amplitude) +; d4 = xy + + moveq #$0f,d2 + and.b d4,d2 + beq .1 + move.b d2,n_vibratoamp(a2) + bra .2 +.1: move.b n_vibratoamp(a2),d2 + +.2: lsr.b #4,d4 + beq .3 + move.b d4,n_vibratospd(a2) + bra mt_vibrato_nc +.3: move.b n_vibratospd(a2),d4 + +mt_vibrato_nc: + ; calculate vibrato table offset: 64 * amplitude + (pos & 63) + lsl.w #6,d2 + moveq #63,d0 + and.b n_vibratopos(a2),d0 + add.w d0,d2 + + ifne ENABLE_SAWRECT + ; select vibrato waveform + moveq #3,d1 + and.b n_vibratoctrl(a2),d1 + beq .6 + subq.b #1,d1 + beq .5 + + ; ctrl 2 & 3 select a rectangle vibrato + lea mt_VibratoRectTable(pc),a0 + bra .9 + + ; ctrl 1 selects a sawtooth vibrato +.5: lea mt_VibratoSawTable(pc),a0 + bra .9 + endc ; ENABLE_SAWRECT + + ; ctrl 0 selects a sine vibrato +.6: lea mt_VibratoSineTable(pc),a0 + + ; add vibrato-offset to period +.9: move.b (a0,d2.w),d0 + ext.w d0 + add.w n_period(a2),d0 + move.w d0,AUDPER(a5) + + ; increase vibratopos by speed + add.b d4,n_vibratopos(a2) + rts + + +mt_tonevolslide: +; cmd 5 x y (x = volume-up, y = volume-down) +; d4 = xy + + pea mt_volumeslide(pc) + bra mt_toneporta_nc + + +mt_vibrvolslide: +; cmd 6 x y (x = volume-up, y = volume-down) +; d4 = xy + + move.w d4,d3 + move.b n_vibratoamp(a2),d2 + move.b n_vibratospd(a2),d4 + bsr mt_vibrato_nc + + move.w d3,d4 + bra mt_volumeslide + + +mt_tremolo: +; cmd 7 x y (x = speed, y = amplitude) +; d4 = xy + + moveq #$0f,d2 + and.b d4,d2 + beq .1 + move.b d2,n_tremoloamp(a2) + bra .2 +.1: move.b n_tremoloamp(a2),d2 + +.2: lsr.b #4,d4 + beq .3 + move.b d4,n_tremolospd(a2) + bra .4 +.3: move.b n_tremolospd(a2),d4 + + ; calculate tremolo table offset: 64 * amplitude + (pos & 63) +.4: lsl.w #6,d2 + moveq #63,d0 + and.b n_tremolopos(a2),d0 + add.w d0,d2 + + ifne ENABLE_SAWRECT + ; select tremolo waveform + moveq #3,d1 + and.b n_tremoloctrl(a2),d1 + beq .6 + subq.b #1,d1 + beq .5 + + ; ctrl 2 & 3 select a rectangle tremolo + lea mt_VibratoRectTable(pc),a0 + bra .9 + + ; ctrl 1 selects a sawtooth tremolo +.5: lea mt_VibratoSawTable(pc),a0 + bra .9 + endc ; ENABLE_SAWRECT + + ; ctrl 0 selects a sine tremolo +.6: lea mt_VibratoSineTable(pc),a0 + + ; add tremolo-offset to volume +.9: move.w n_volume(a2),d0 + add.b (a0,d2.w),d0 + bpl .10 + moveq #0,d0 +.10: cmp.w #64,d0 + bls .11 + moveq #64,d0 +.11: move.w n_period(a2),AUDPER(a5) + ifeq MINIMAL + move.l mt_MasterVolTab(a4),a0 + move.b (a0,d0.w),d0 + and.b n_enable(a2),d0 + endc + move.w d0,AUDVOL(a5) + ifd VOL0_UNLOOPS + bne .12 + move.b d7,n_looped(a2) + endc + + ; increase tremolopos by speed +.12: add.b d4,n_tremolopos(a2) + rts + + +mt_volumeslide: +; cmd A x y (x = volume-up, y = volume-down) +; d4 = xy + + move.w n_volume(a2),d0 + moveq #$0f,d1 + and.b d4,d1 + lsr.b #4,d4 + beq vol_slide_down + + ; slide up, until 64 + add.b d4,d0 +vol_slide_up: + cmp.b #64,d0 + bls set_pervol + moveq #64,d0 + bra set_pervol + + ; slide down, until 0 +vol_slide_down: + sub.b d1,d0 + bpl set_pervol + moveq #0,d0 + +set_pervol: + move.w n_period(a2),AUDPER(a5) +set_vol: + move.w d0,n_volume(a2) + ifeq MINIMAL + move.l mt_MasterVolTab(a4),a0 + move.b (a0,d0.w),d0 + and.b n_enable(a2),d0 + endc + move.w d0,AUDVOL(a5) + ifd VOL0_UNLOOPS + bne .1 + move.b d7,n_looped(a2) + endc +.1: rts + + +mt_posjump: +; cmd B x y (xy = new song position) +; d4 = xy + + move.b d4,d0 + subq.b #1,d0 + move.b d0,mt_SongPos(a4) + +jump_pos0: + move.w d7,mt_PBreakPos(a4) + st mt_PosJumpFlag(a4) + rts + + +mt_volchange: +; cmd C x y (xy = new volume) +; d4 = xy + + move.w d4,d0 + cmp.w #64,d0 + bls set_vol + moveq #64,d0 + bra set_vol + + +mt_patternbrk: +; cmd D x y (xy = break pos in decimal) +; d4 = xy + + moveq #$0f,d0 + and.w d4,d0 + move.w d4,d1 + lsr.w #4,d1 + add.b mult10tab(pc,d1.w),d0 + cmp.b #63,d0 + bhi jump_pos0 + + lsl.w #4,d0 + move.w d0,mt_PBreakPos(a4) + st mt_PosJumpFlag(a4) + rts + +mult10tab: + dc.b 0,10,20,30,40,50,60,70,80,90,0,0,0,0,0,0 + + +mt_setspeed: +; cmd F x y (xy<$20 new speed, xy>=$20 new tempo) +; d4 = xy + + ifeq VBLANK_MUSIC + cmp.b #$20,d4 + bhs .1 + endc + + move.b d4,mt_Speed(a4) + beq _mt_end + rts + + ifeq VBLANK_MUSIC + ; set tempo (CIA only) +.1: and.w #$00ff,d4 + move.l mt_timerval(a4),d0 + divu d4,d0 + move.b d0,CIAB+CIATALO + lsr.w #8,d0 + move.b d0,CIAB+CIATAHI + rts + endc + + +mt_e_cmds: +; cmd E x y (x=command, y=argument) +; d4 = xy + + moveq #$0f,d0 + and.w d4,d0 ; pass E-cmd argument in d0 + + move.w d4,d1 + lsr.w #4,d1 + add.w d1,d1 + move.w ecmd_tab(pc,d1.w),d1 + jmp ecmd_tab(pc,d1.w) + +ecmd_tab: + dc.w mt_filter-ecmd_tab + dc.w mt_fineportaup-ecmd_tab + dc.w mt_fineportadn-ecmd_tab + dc.w mt_glissctrl-ecmd_tab + dc.w mt_vibratoctrl-ecmd_tab + dc.w mt_finetune-ecmd_tab + dc.w mt_jumploop-ecmd_tab + dc.w mt_tremoctrl-ecmd_tab + dc.w mt_e8-ecmd_tab + dc.w mt_retrignote-ecmd_tab + dc.w mt_volfineup-ecmd_tab + dc.w mt_volfinedn-ecmd_tab + dc.w mt_notecut-ecmd_tab + dc.w mt_notedelay-ecmd_tab + dc.w mt_patterndelay-ecmd_tab + dc.w mt_funk-ecmd_tab + + +blocked_e_cmds: +; cmd E x y (x=command, y=argument) +; d4 = xy + + moveq #$0f,d0 + and.w d4,d0 ; pass E-cmd argument in d0 + + move.w d4,d1 + lsr.w #4,d1 + add.w d1,d1 + move.w blecmd_tab(pc,d1.w),d1 + jmp blecmd_tab(pc,d1.w) + +blecmd_tab: + dc.w mt_filter-blecmd_tab + dc.w mt_rts-blecmd_tab + dc.w mt_rts-blecmd_tab + dc.w mt_glissctrl-blecmd_tab + dc.w mt_vibratoctrl-blecmd_tab + dc.w mt_finetune-blecmd_tab + dc.w mt_jumploop-blecmd_tab + dc.w mt_tremoctrl-blecmd_tab + dc.w mt_e8-blecmd_tab + dc.w mt_rts-blecmd_tab + dc.w mt_rts-blecmd_tab + dc.w mt_rts-blecmd_tab + dc.w mt_rts-blecmd_tab + dc.w mt_rts-blecmd_tab + dc.w mt_patterndelay-blecmd_tab + dc.w mt_rts-blecmd_tab + + +mt_filter: +; cmd E 0 x (x=1 disable, x=0 enable) +; d0 = x + + lsr.b #1,d0 + bcs .1 + bclr #1,CIAA+CIAPRA + rts +.1: bset #1,CIAA+CIAPRA +mt_rts: + rts + + +mt_glissctrl: +; cmd E 3 x (x gliss) +; d0 = x + + move.b d0,n_gliss(a2) + rts + + +mt_vibratoctrl: +; cmd E 4 x (x = vibrato) +; d0 = x + + move.b d0,n_vibratoctrl(a2) + rts + + +mt_finetune: +; cmd E 5 x (x = finetune) +; d0 = x + + lea mt_PerFineTune(pc),a0 + add.w d0,d0 + add.w (a0,d0.w),a0 + move.l a0,n_pertab(a2) + cmp.w #2*8,d0 + shs n_minusft(a2) + rts + + +mt_jumploop: +; cmd E 6 x (x=0 loop start, else loop count) +; d0 = x + + tst.b mt_Counter(a4) + bne .4 + +.1: tst.b d0 + beq .3 ; set start + + ; otherwise we are at the end of the loop + subq.b #1,n_loopcount(a2) + beq .4 ; loop finished + bpl .2 + + ; initialize loop counter + move.b d0,n_loopcount(a2) + + ; jump back to start of loop +.2: move.w n_pattpos(a2),mt_PBreakPos(a4) + st mt_PBreakFlag(a4) + rts + + ; remember start of loop position +.3: move.w mt_PatternPos(a4),n_pattpos(a2) +.4: rts + + +mt_tremoctrl: +; cmd E 7 x (x = tremolo) +; d0 = x + + move.b d0,n_tremoloctrl(a2) + rts + + +mt_e8: +; cmd E 8 x (x = trigger value) +; d0 = x + + move.b d0,mt_E8Trigger(a4) + rts + + +mt_retrignote: +; cmd E 9 x (x = retrigger count) +; d0 = x + + tst.b d0 + beq .1 + + ; set new retrigger count when Counter=0 + tst.b mt_Counter(a4) + bne .2 + move.b d0,n_retrigcount(a2) + + ; avoid double retrigger, when Counter=0 and a note was set + move.w #$0fff,d2 + and.w (a2),d2 + beq do_retrigger +.1: rts + + ; check if retrigger count is reached +.2: subq.b #1,n_retrigcount(a2) + bne .1 + move.b d0,n_retrigcount(a2) ; reset + +do_retrigger: + ; DMA off, set sample pointer and length + move.w n_dmabit(a2),d0 + move.w d0,DMACON(a6) + move.l n_start(a2),AUDLC(a5) + move.w n_length(a2),AUDLEN(a5) + lea mt_dmaon(pc),a0 + or.w d0,(a0) + rts + + +mt_volfineup: +; cmd E A x (x = volume add) +; d0 = x + + tst.b mt_Counter(a4) + beq .1 + rts + +.1: add.w n_volume(a2),d0 + bra vol_slide_up + + +mt_volfinedn: +; cmd E B x (x = volume sub) +; d0 = x + + tst.b mt_Counter(a4) + beq .1 + rts + +.1: move.b d0,d1 + move.w n_volume(a2),d0 + bra vol_slide_down + + +mt_notecut: +; cmd E C x (x = counter to cut at) +; d0 = x + + cmp.b mt_Counter(a4),d0 + bne .1 + move.w d7,n_volume(a2) + move.w d7,AUDVOL(a5) + ifd VOL0_UNLOOPS + move.b d7,n_looped(a2) + endc +.1: rts + + +mt_notedelay: +; cmd E D x (x = counter to retrigger at) +; d0 = x + + cmp.b mt_Counter(a4),d0 + bne .1 + tst.w (a2) ; trigger note when given + bne .2 +.1: rts +.2: move.w n_period(a2),AUDPER(a5) + bra do_retrigger + + +mt_patterndelay: +; cmd E E x (x = delay count) +; d0 = x + + tst.b mt_Counter(a4) + bne .1 + tst.b mt_PattDelTime2(a4) + bne .1 + addq.b #1,d0 + move.b d0,mt_PattDelTime(a4) +.1: rts + + +mt_funk: +; cmd E F x (x = funk speed) +; d0 = x + + tst.b mt_Counter(a4) + bne .1 + move.w d0,n_funk(a2) + bne mt_updatefunk +.1: rts + +mt_updatefunk: +; d0 = funk speed + + move.b mt_FunkTable(pc,d0.w),d0 + add.b d0,n_funkoffset(a2) + bpl .2 + move.b d7,n_funkoffset(a2) + + move.l n_loopstart(a2),d0 + moveq #0,d1 + move.w n_replen(a2),d1 + add.l d1,d1 + add.l d0,d1 + move.l n_wavestart(a2),a0 + addq.l #1,a0 + cmp.l d1,a0 + blo .1 + move.l d0,a0 +.1: move.l a0,n_wavestart(a2) + not.b (a0) + +.2: rts + + +mt_FunkTable: + dc.b 0,5,6,7,8,10,11,13,16,19,22,26,32,43,64,128 + +mt_VibratoSineTable: + dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.b 0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1 + dc.b 1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0 + dc.b 0,0,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 + dc.b -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0 + dc.b 0,0,0,1,1,1,2,2,2,3,3,3,3,3,3,3 + dc.b 3,3,3,3,3,3,3,3,2,2,2,1,1,1,0,0 + dc.b 0,0,0,-1,-1,-1,-2,-2,-2,-3,-3,-3,-3,-3,-3,-3 + dc.b -3,-3,-3,-3,-3,-3,-3,-3,-2,-2,-2,-1,-1,-1,0,0 + dc.b 0,0,1,1,2,2,3,3,4,4,4,5,5,5,5,5 + dc.b 5,5,5,5,5,5,4,4,4,3,3,2,2,1,1,0 + dc.b 0,0,-1,-1,-2,-2,-3,-3,-4,-4,-4,-5,-5,-5,-5,-5 + dc.b -5,-5,-5,-5,-5,-5,-4,-4,-4,-3,-3,-2,-2,-1,-1,0 + dc.b 0,0,1,2,3,3,4,5,5,6,6,7,7,7,7,7 + dc.b 7,7,7,7,7,7,6,6,5,5,4,3,3,2,1,0 + dc.b 0,0,-1,-2,-3,-3,-4,-5,-5,-6,-6,-7,-7,-7,-7,-7 + dc.b -7,-7,-7,-7,-7,-7,-6,-6,-5,-5,-4,-3,-3,-2,-1,0 + dc.b 0,0,1,2,3,4,5,6,7,7,8,8,9,9,9,9 + dc.b 9,9,9,9,9,8,8,7,7,6,5,4,3,2,1,0 + dc.b 0,0,-1,-2,-3,-4,-5,-6,-7,-7,-8,-8,-9,-9,-9,-9 + dc.b -9,-9,-9,-9,-9,-8,-8,-7,-7,-6,-5,-4,-3,-2,-1,0 + dc.b 0,1,2,3,4,5,6,7,8,9,9,10,11,11,11,11 + dc.b 11,11,11,11,11,10,9,9,8,7,6,5,4,3,2,1 + dc.b 0,-1,-2,-3,-4,-5,-6,-7,-8,-9,-9,-10,-11,-11,-11,-11 + dc.b -11,-11,-11,-11,-11,-10,-9,-9,-8,-7,-6,-5,-4,-3,-2,-1 + dc.b 0,1,2,4,5,6,7,8,9,10,11,12,12,13,13,13 + dc.b 13,13,13,13,12,12,11,10,9,8,7,6,5,4,2,1 + dc.b 0,-1,-2,-4,-5,-6,-7,-8,-9,-10,-11,-12,-12,-13,-13,-13 + dc.b -13,-13,-13,-13,-12,-12,-11,-10,-9,-8,-7,-6,-5,-4,-2,-1 + dc.b 0,1,3,4,6,7,8,10,11,12,13,14,14,15,15,15 + dc.b 15,15,15,15,14,14,13,12,11,10,8,7,6,4,3,1 + dc.b 0,-1,-3,-4,-6,-7,-8,-10,-11,-12,-13,-14,-14,-15,-15,-15 + dc.b -15,-15,-15,-15,-14,-14,-13,-12,-11,-10,-8,-7,-6,-4,-3,-1 + dc.b 0,1,3,5,6,8,9,11,12,13,14,15,16,17,17,17 + dc.b 17,17,17,17,16,15,14,13,12,11,9,8,6,5,3,1 + dc.b 0,-1,-3,-5,-6,-8,-9,-11,-12,-13,-14,-15,-16,-17,-17,-17 + dc.b -17,-17,-17,-17,-16,-15,-14,-13,-12,-11,-9,-8,-6,-5,-3,-1 + dc.b 0,1,3,5,7,9,11,12,14,15,16,17,18,19,19,19 + dc.b 19,19,19,19,18,17,16,15,14,12,11,9,7,5,3,1 + dc.b 0,-1,-3,-5,-7,-9,-11,-12,-14,-15,-16,-17,-18,-19,-19,-19 + dc.b -19,-19,-19,-19,-18,-17,-16,-15,-14,-12,-11,-9,-7,-5,-3,-1 + dc.b 0,2,4,6,8,10,12,13,15,16,18,19,20,20,21,21 + dc.b 21,21,21,20,20,19,18,16,15,13,12,10,8,6,4,2 + dc.b 0,-2,-4,-6,-8,-10,-12,-13,-15,-16,-18,-19,-20,-20,-21,-21 + dc.b -21,-21,-21,-20,-20,-19,-18,-16,-15,-13,-12,-10,-8,-6,-4,-2 + dc.b 0,2,4,6,9,11,13,15,16,18,19,21,22,22,23,23 + dc.b 23,23,23,22,22,21,19,18,16,15,13,11,9,6,4,2 + dc.b 0,-2,-4,-6,-9,-11,-13,-15,-16,-18,-19,-21,-22,-22,-23,-23 + dc.b -23,-23,-23,-22,-22,-21,-19,-18,-16,-15,-13,-11,-9,-6,-4,-2 + dc.b 0,2,4,7,9,12,14,16,18,20,21,22,23,24,25,25 + dc.b 25,25,25,24,23,22,21,20,18,16,14,12,9,7,4,2 + dc.b 0,-2,-4,-7,-9,-12,-14,-16,-18,-20,-21,-22,-23,-24,-25,-25 + dc.b -25,-25,-25,-24,-23,-22,-21,-20,-18,-16,-14,-12,-9,-7,-4,-2 + dc.b 0,2,5,8,10,13,15,17,19,21,23,24,25,26,27,27 + dc.b 27,27,27,26,25,24,23,21,19,17,15,13,10,8,5,2 + dc.b 0,-2,-5,-8,-10,-13,-15,-17,-19,-21,-23,-24,-25,-26,-27,-27 + dc.b -27,-27,-27,-26,-25,-24,-23,-21,-19,-17,-15,-13,-10,-8,-5,-2 + dc.b 0,2,5,8,11,14,16,18,21,23,24,26,27,28,29,29 + dc.b 29,29,29,28,27,26,24,23,21,18,16,14,11,8,5,2 + dc.b 0,-2,-5,-8,-11,-14,-16,-18,-21,-23,-24,-26,-27,-28,-29,-29 + dc.b -29,-29,-29,-28,-27,-26,-24,-23,-21,-18,-16,-14,-11,-8,-5,-2 + + ifne ENABLE_SAWRECT +mt_VibratoSawTable: + dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.b 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + dc.b -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 + dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.b 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1 + dc.b 2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3 + dc.b -3,-3,-3,-3,-3,-3,-3,-3,-2,-2,-2,-2,-2,-2,-2,-2 + dc.b -1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0 + dc.b 0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,2 + dc.b 3,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5 + dc.b -5,-5,-5,-5,-5,-5,-4,-4,-4,-4,-4,-3,-3,-3,-3,-3 + dc.b -2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,0,0,0,0,0 + dc.b 0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3 + dc.b 4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,7 + dc.b -7,-7,-7,-7,-6,-6,-6,-6,-5,-5,-5,-5,-4,-4,-4,-4 + dc.b -3,-3,-3,-3,-2,-2,-2,-2,-1,-1,-1,-1,0,0,0,0 + dc.b 0,0,0,0,1,1,1,2,2,2,3,3,3,4,4,4 + dc.b 5,5,5,5,6,6,6,7,7,7,8,8,8,9,9,9 + dc.b -9,-9,-9,-9,-8,-8,-8,-7,-7,-7,-6,-6,-6,-5,-5,-5 + dc.b -4,-4,-4,-4,-3,-3,-3,-2,-2,-2,-1,-1,-1,0,0,0 + dc.b 0,0,0,1,1,1,2,2,3,3,3,4,4,4,5,5 + dc.b 6,6,6,7,7,7,8,8,9,9,9,10,10,10,11,11 + dc.b -11,-11,-11,-10,-10,-10,-9,-9,-8,-8,-8,-7,-7,-7,-6,-6 + dc.b -5,-5,-5,-4,-4,-4,-3,-3,-2,-2,-2,-1,-1,-1,0,0 + dc.b 0,0,0,1,1,2,2,3,3,3,4,4,5,5,6,6 + dc.b 7,7,7,8,8,9,9,10,10,10,11,11,12,12,13,13 + dc.b -13,-13,-13,-12,-12,-11,-11,-10,-10,-10,-9,-9,-8,-8,-7,-7 + dc.b -6,-6,-6,-5,-5,-4,-4,-3,-3,-3,-2,-2,-1,-1,0,0 + dc.b 0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7 + dc.b 8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15 + dc.b -15,-15,-14,-14,-13,-13,-12,-12,-11,-11,-10,-10,-9,-9,-8,-8 + dc.b -7,-7,-6,-6,-5,-5,-4,-4,-3,-3,-2,-2,-1,-1,0,0 + dc.b 0,0,1,1,2,2,3,3,4,5,5,6,6,7,7,8 + dc.b 9,9,10,10,11,11,12,12,13,14,14,15,15,16,16,17 + dc.b -17,-17,-16,-16,-15,-15,-14,-13,-13,-12,-12,-11,-11,-10,-10,-9 + dc.b -8,-8,-7,-7,-6,-6,-5,-4,-4,-3,-3,-2,-2,-1,-1,0 + dc.b 0,0,1,1,2,3,3,4,5,5,6,6,7,8,8,9 + dc.b 10,10,11,11,12,13,13,14,15,15,16,16,17,18,18,19 + dc.b -19,-19,-18,-18,-17,-16,-16,-15,-14,-14,-13,-13,-12,-11,-11,-10 + dc.b -9,-9,-8,-8,-7,-6,-6,-5,-4,-4,-3,-3,-2,-1,-1,0 + dc.b 0,0,1,2,2,3,4,4,5,6,6,7,8,8,9,10 + dc.b 11,11,12,13,13,14,15,15,16,17,17,18,19,19,20,21 + dc.b -21,-21,-20,-19,-19,-18,-17,-17,-16,-15,-15,-14,-13,-12,-12,-11 + dc.b -10,-10,-9,-8,-8,-7,-6,-6,-5,-4,-4,-3,-2,-1,-1,0 + dc.b 0,0,1,2,3,3,4,5,6,6,7,8,9,9,10,11 + dc.b 12,12,13,14,15,15,16,17,18,18,19,20,21,21,22,23 + dc.b -23,-23,-22,-21,-20,-20,-19,-18,-17,-17,-16,-15,-14,-14,-13,-12 + dc.b -11,-11,-10,-9,-8,-8,-7,-6,-5,-5,-4,-3,-2,-2,-1,0 + dc.b 0,0,1,2,3,4,4,5,6,7,8,8,9,10,11,12 + dc.b 13,13,14,15,16,17,17,18,19,20,21,21,22,23,24,25 + dc.b -25,-25,-24,-23,-22,-21,-21,-20,-19,-18,-17,-16,-16,-15,-14,-13 + dc.b -12,-12,-11,-10,-9,-8,-8,-7,-6,-5,-4,-3,-3,-2,-1,0 + dc.b 0,0,1,2,3,4,5,6,7,7,8,9,10,11,12,13 + dc.b 14,14,15,16,17,18,19,20,21,21,22,23,24,25,26,27 + dc.b -27,-27,-26,-25,-24,-23,-22,-21,-20,-20,-19,-18,-17,-16,-15,-14 + dc.b -13,-13,-12,-11,-10,-9,-8,-7,-6,-6,-5,-4,-3,-2,-1,0 + dc.b 0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14 + dc.b 15,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29 + dc.b -29,-28,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17,-16,-15 + dc.b -14,-13,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0 + +mt_VibratoRectTable: + dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.b 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + dc.b 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + dc.b -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 + dc.b -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 + dc.b 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 + dc.b 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 + dc.b -3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3 + dc.b -3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3 + dc.b 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5 + dc.b 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5 + dc.b -5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5 + dc.b -5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5 + dc.b 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7 + dc.b 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7 + dc.b -7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7 + dc.b -7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7 + dc.b 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9 + dc.b 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9 + dc.b -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9 + dc.b -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9 + dc.b 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11 + dc.b 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11 + dc.b -11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11 + dc.b -11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11 + dc.b 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13 + dc.b 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13 + dc.b -13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13 + dc.b -13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13 + dc.b 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15 + dc.b 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15 + dc.b -15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15 + dc.b -15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15 + dc.b 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17 + dc.b 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17 + dc.b -17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17 + dc.b -17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17 + dc.b 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19 + dc.b 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19 + dc.b -19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19 + dc.b -19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19,-19 + dc.b 21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21 + dc.b 21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21 + dc.b -21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21 + dc.b -21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21 + dc.b 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23 + dc.b 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23 + dc.b -23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23 + dc.b -23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23,-23 + dc.b 25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25 + dc.b 25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25 + dc.b -25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 + dc.b -25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 + dc.b 27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27 + dc.b 27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27 + dc.b -27,-27,-27,-27,-27,-27,-27,-27,-27,-27,-27,-27,-27,-27,-27,-27 + dc.b -27,-27,-27,-27,-27,-27,-27,-27,-27,-27,-27,-27,-27,-27,-27,-27 + dc.b 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29 + dc.b 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29 + dc.b -29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29 + dc.b -29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29 + endc ; ENABLE_SAWRECT + + +mt_PerFineTune: + dc.w mt_Tuning0-mt_PerFineTune,mt_Tuning1-mt_PerFineTune + dc.w mt_Tuning2-mt_PerFineTune,mt_Tuning3-mt_PerFineTune + dc.w mt_Tuning4-mt_PerFineTune,mt_Tuning5-mt_PerFineTune + dc.w mt_Tuning6-mt_PerFineTune,mt_Tuning7-mt_PerFineTune + dc.w mt_TuningM8-mt_PerFineTune,mt_TuningM7-mt_PerFineTune + dc.w mt_TuningM6-mt_PerFineTune,mt_TuningM5-mt_PerFineTune + dc.w mt_TuningM4-mt_PerFineTune,mt_TuningM3-mt_PerFineTune + dc.w mt_TuningM2-mt_PerFineTune,mt_TuningM1-mt_PerFineTune + +mt_PeriodTable: +mt_Tuning0: ; Tuning 0, Normal c-1 - b3 + dc.w 856,808,762,720,678,640,604,570,538,508,480,453 + dc.w 428,404,381,360,339,320,302,285,269,254,240,226 + dc.w 214,202,190,180,170,160,151,143,135,127,120,113 +mt_Tuning1: + dc.w 850,802,757,715,674,637,601,567,535,505,477,450 + dc.w 425,401,379,357,337,318,300,284,268,253,239,225 + dc.w 213,201,189,179,169,159,150,142,134,126,119,113 +mt_Tuning2: + dc.w 844,796,752,709,670,632,597,563,532,502,474,447 + dc.w 422,398,376,355,335,316,298,282,266,251,237,224 + dc.w 211,199,188,177,167,158,149,141,133,125,118,112 +mt_Tuning3: + dc.w 838,791,746,704,665,628,592,559,528,498,470,444 + dc.w 419,395,373,352,332,314,296,280,264,249,235,222 + dc.w 209,198,187,176,166,157,148,140,132,125,118,111 +mt_Tuning4: + dc.w 832,785,741,699,660,623,588,555,524,495,467,441 + dc.w 416,392,370,350,330,312,294,278,262,247,233,220 + dc.w 208,196,185,175,165,156,147,139,131,124,117,110 +mt_Tuning5: + dc.w 826,779,736,694,655,619,584,551,520,491,463,437 + dc.w 413,390,368,347,328,309,292,276,260,245,232,219 + dc.w 206,195,184,174,164,155,146,138,130,123,116,109 +mt_Tuning6: + dc.w 820,774,730,689,651,614,580,547,516,487,460,434 + dc.w 410,387,365,345,325,307,290,274,258,244,230,217 + dc.w 205,193,183,172,163,154,145,137,129,122,115,109 +mt_Tuning7: + dc.w 814,768,725,684,646,610,575,543,513,484,457,431 + dc.w 407,384,363,342,323,305,288,272,256,242,228,216 + dc.w 204,192,181,171,161,152,144,136,128,121,114,108 +mt_TuningM8: + dc.w 907,856,808,762,720,678,640,604,570,538,508,480 + dc.w 453,428,404,381,360,339,320,302,285,269,254,240 + dc.w 226,214,202,190,180,170,160,151,143,135,127,120 +mt_TuningM7: + dc.w 900,850,802,757,715,675,636,601,567,535,505,477 + dc.w 450,425,401,379,357,337,318,300,284,268,253,238 + dc.w 225,212,200,189,179,169,159,150,142,134,126,119 +mt_TuningM6: + dc.w 894,844,796,752,709,670,632,597,563,532,502,474 + dc.w 447,422,398,376,355,335,316,298,282,266,251,237 + dc.w 223,211,199,188,177,167,158,149,141,133,125,118 +mt_TuningM5: + dc.w 887,838,791,746,704,665,628,592,559,528,498,470 + dc.w 444,419,395,373,352,332,314,296,280,264,249,235 + dc.w 222,209,198,187,176,166,157,148,140,132,125,118 +mt_TuningM4: + dc.w 881,832,785,741,699,660,623,588,555,524,494,467 + dc.w 441,416,392,370,350,330,312,294,278,262,247,233 + dc.w 220,208,196,185,175,165,156,147,139,131,123,117 +mt_TuningM3: + dc.w 875,826,779,736,694,655,619,584,551,520,491,463 + dc.w 437,413,390,368,347,328,309,292,276,260,245,232 + dc.w 219,206,195,184,174,164,155,146,138,130,123,116 +mt_TuningM2: + dc.w 868,820,774,730,689,651,614,580,547,516,487,460 + dc.w 434,410,387,365,345,325,307,290,274,258,244,230 + dc.w 217,205,193,183,172,163,154,145,137,129,122,115 +mt_TuningM1: + dc.w 862,814,768,725,684,646,610,575,543,513,484,457 + dc.w 431,407,384,363,342,323,305,288,272,256,242,228 + dc.w 216,203,192,181,171,161,152,144,136,128,121,114 + + ifeq MINIMAL +MasterVolTab0: + dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.b 0 +MasterVolTab1: + dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.b 1 +MasterVolTab2: + dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.b 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + dc.b 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + dc.b 2 +MasterVolTab3: + dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.b 0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1 + dc.b 1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2 + dc.b 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 + dc.b 3 +MasterVolTab4: + dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.b 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + dc.b 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 + dc.b 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 + dc.b 4 +MasterVolTab5: + dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1 + dc.b 1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2 + dc.b 2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3 + dc.b 3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4 + dc.b 5 +MasterVolTab6: + dc.b 0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1 + dc.b 1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2 + dc.b 3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4 + dc.b 4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5 + dc.b 6 +MasterVolTab7: + dc.b 0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1 + dc.b 1,1,1,2,2,2,2,2,2,2,2,2,3,3,3,3 + dc.b 3,3,3,3,3,4,4,4,4,4,4,4,4,4,5,5 + dc.b 5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6 + dc.b 7 +MasterVolTab8: + dc.b 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1 + dc.b 2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3 + dc.b 4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5 + dc.b 6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7 + dc.b 8 +MasterVolTab9: + dc.b 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,2 + dc.b 2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4 + dc.b 4,4,4,4,5,5,5,5,5,5,5,6,6,6,6,6 + dc.b 6,6,7,7,7,7,7,7,7,8,8,8,8,8,8,8 + dc.b 9 +MasterVolTab10: + dc.b 0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2 + dc.b 2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4 + dc.b 5,5,5,5,5,5,5,6,6,6,6,6,6,7,7,7 + dc.b 7,7,7,7,8,8,8,8,8,8,9,9,9,9,9,9 + dc.b 10 +MasterVolTab11: + dc.b 0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2 + dc.b 2,2,3,3,3,3,3,3,4,4,4,4,4,4,5,5 + dc.b 5,5,5,6,6,6,6,6,6,7,7,7,7,7,7,8 + dc.b 8,8,8,8,8,9,9,9,9,9,9,10,10,10,10,10 + dc.b 11 +MasterVolTab12: + dc.b 0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,2 + dc.b 3,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5 + dc.b 6,6,6,6,6,6,7,7,7,7,7,8,8,8,8,8 + dc.b 9,9,9,9,9,9,10,10,10,10,10,11,11,11,11,11 + dc.b 12 +MasterVolTab13: + dc.b 0,0,0,0,0,1,1,1,1,1,2,2,2,2,2,3 + dc.b 3,3,3,3,4,4,4,4,4,5,5,5,5,5,6,6 + dc.b 6,6,6,7,7,7,7,7,8,8,8,8,8,9,9,9 + dc.b 9,9,10,10,10,10,10,11,11,11,11,11,12,12,12,12 + dc.b 13 +MasterVolTab14: + dc.b 0,0,0,0,0,1,1,1,1,1,2,2,2,2,3,3 + dc.b 3,3,3,4,4,4,4,5,5,5,5,5,6,6,6,6 + dc.b 7,7,7,7,7,8,8,8,8,8,9,9,9,9,10,10 + dc.b 10,10,10,11,11,11,11,12,12,12,12,12,13,13,13,13 + dc.b 14 +MasterVolTab15: + dc.b 0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3 + dc.b 3,3,4,4,4,4,5,5,5,5,6,6,6,6,7,7 + dc.b 7,7,7,8,8,8,8,9,9,9,9,10,10,10,10,11 + dc.b 11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,14 + dc.b 15 +MasterVolTab16: + dc.b 0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3 + dc.b 4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,7 + dc.b 8,8,8,8,9,9,9,9,10,10,10,10,11,11,11,11 + dc.b 12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15 + dc.b 16 +MasterVolTab17: + dc.b 0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3 + dc.b 4,4,4,5,5,5,5,6,6,6,6,7,7,7,7,8 + dc.b 8,8,9,9,9,9,10,10,10,10,11,11,11,11,12,12 + dc.b 12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16 + dc.b 17 +MasterVolTab18: + dc.b 0,0,0,0,1,1,1,1,2,2,2,3,3,3,3,4 + dc.b 4,4,5,5,5,5,6,6,6,7,7,7,7,8,8,8 + dc.b 9,9,9,9,10,10,10,10,11,11,11,12,12,12,12,13 + dc.b 13,13,14,14,14,14,15,15,15,16,16,16,16,17,17,17 + dc.b 18 +MasterVolTab19: + dc.b 0,0,0,0,1,1,1,2,2,2,2,3,3,3,4,4 + dc.b 4,5,5,5,5,6,6,6,7,7,7,8,8,8,8,9 + dc.b 9,9,10,10,10,10,11,11,11,12,12,12,13,13,13,13 + dc.b 14,14,14,15,15,15,16,16,16,16,17,17,17,18,18,18 + dc.b 19 +MasterVolTab20: + dc.b 0,0,0,0,1,1,1,2,2,2,3,3,3,4,4,4 + dc.b 5,5,5,5,6,6,6,7,7,7,8,8,8,9,9,9 + dc.b 10,10,10,10,11,11,11,12,12,12,13,13,13,14,14,14 + dc.b 15,15,15,15,16,16,16,17,17,17,18,18,18,19,19,19 + dc.b 20 +MasterVolTab21: + dc.b 0,0,0,0,1,1,1,2,2,2,3,3,3,4,4,4 + dc.b 5,5,5,6,6,6,7,7,7,8,8,8,9,9,9,10 + dc.b 10,10,11,11,11,12,12,12,13,13,13,14,14,14,15,15 + dc.b 15,16,16,16,17,17,17,18,18,18,19,19,19,20,20,20 + dc.b 21 +MasterVolTab22: + dc.b 0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,5 + dc.b 5,5,6,6,6,7,7,7,8,8,8,9,9,9,10,10 + dc.b 11,11,11,12,12,12,13,13,13,14,14,14,15,15,15,16 + dc.b 16,16,17,17,17,18,18,18,19,19,19,20,20,20,21,21 + dc.b 22 +MasterVolTab23: + dc.b 0,0,0,1,1,1,2,2,2,3,3,3,4,4,5,5 + dc.b 5,6,6,6,7,7,7,8,8,8,9,9,10,10,10,11 + dc.b 11,11,12,12,12,13,13,14,14,14,15,15,15,16,16,16 + dc.b 17,17,17,18,18,19,19,19,20,20,20,21,21,21,22,22 + dc.b 23 +MasterVolTab24: + dc.b 0,0,0,1,1,1,2,2,3,3,3,4,4,4,5,5 + dc.b 6,6,6,7,7,7,8,8,9,9,9,10,10,10,11,11 + dc.b 12,12,12,13,13,13,14,14,15,15,15,16,16,16,17,17 + dc.b 18,18,18,19,19,19,20,20,21,21,21,22,22,22,23,23 + dc.b 24 +MasterVolTab25: + dc.b 0,0,0,1,1,1,2,2,3,3,3,4,4,5,5,5 + dc.b 6,6,7,7,7,8,8,8,9,9,10,10,10,11,11,12 + dc.b 12,12,13,13,14,14,14,15,15,16,16,16,17,17,17,18 + dc.b 18,19,19,19,20,20,21,21,21,22,22,23,23,23,24,24 + dc.b 25 +MasterVolTab26: + dc.b 0,0,0,1,1,2,2,2,3,3,4,4,4,5,5,6 + dc.b 6,6,7,7,8,8,8,9,9,10,10,10,11,11,12,12 + dc.b 13,13,13,14,14,15,15,15,16,16,17,17,17,18,18,19 + dc.b 19,19,20,20,21,21,21,22,22,23,23,23,24,24,25,25 + dc.b 26 +MasterVolTab27: + dc.b 0,0,0,1,1,2,2,2,3,3,4,4,5,5,5,6 + dc.b 6,7,7,8,8,8,9,9,10,10,10,11,11,12,12,13 + dc.b 13,13,14,14,15,15,16,16,16,17,17,18,18,18,19,19 + dc.b 20,20,21,21,21,22,22,23,23,24,24,24,25,25,26,26 + dc.b 27 +MasterVolTab28: + dc.b 0,0,0,1,1,2,2,3,3,3,4,4,5,5,6,6 + dc.b 7,7,7,8,8,9,9,10,10,10,11,11,12,12,13,13 + dc.b 14,14,14,15,15,16,16,17,17,17,18,18,19,19,20,20 + dc.b 21,21,21,22,22,23,23,24,24,24,25,25,26,26,27,27 + dc.b 28 +MasterVolTab29: + dc.b 0,0,0,1,1,2,2,3,3,4,4,4,5,5,6,6 + dc.b 7,7,8,8,9,9,9,10,10,11,11,12,12,13,13,14 + dc.b 14,14,15,15,16,16,17,17,18,18,19,19,19,20,20,21 + dc.b 21,22,22,23,23,24,24,24,25,25,26,26,27,27,28,28 + dc.b 29 +MasterVolTab30: + dc.b 0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7 + dc.b 7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14 + dc.b 15,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22 + dc.b 22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29 + dc.b 30 +MasterVolTab31: + dc.b 0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7 + dc.b 7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15 + dc.b 15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,22 + dc.b 23,23,24,24,25,25,26,26,27,27,28,28,29,29,30,30 + dc.b 31 +MasterVolTab32: + dc.b 0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7 + dc.b 8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15 + dc.b 16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23 + dc.b 24,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31 + dc.b 32 +MasterVolTab33: + dc.b 0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7 + dc.b 8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15 + dc.b 16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24 + dc.b 24,25,25,26,26,27,27,28,28,29,29,30,30,31,31,32 + dc.b 33 +MasterVolTab34: + dc.b 0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7 + dc.b 8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16 + dc.b 17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24 + dc.b 25,26,26,27,27,28,28,29,29,30,30,31,31,32,32,33 + dc.b 34 +MasterVolTab35: + dc.b 0,0,1,1,2,2,3,3,4,4,5,6,6,7,7,8 + dc.b 8,9,9,10,10,11,12,12,13,13,14,14,15,15,16,16 + dc.b 17,18,18,19,19,20,20,21,21,22,22,23,24,24,25,25 + dc.b 26,26,27,27,28,28,29,30,30,31,31,32,32,33,33,34 + dc.b 35 +MasterVolTab36: + dc.b 0,0,1,1,2,2,3,3,4,5,5,6,6,7,7,8 + dc.b 9,9,10,10,11,11,12,12,13,14,14,15,15,16,16,17 + dc.b 18,18,19,19,20,20,21,21,22,23,23,24,24,25,25,26 + dc.b 27,27,28,28,29,29,30,30,31,32,32,33,33,34,34,35 + dc.b 36 +MasterVolTab37: + dc.b 0,0,1,1,2,2,3,4,4,5,5,6,6,7,8,8 + dc.b 9,9,10,10,11,12,12,13,13,14,15,15,16,16,17,17 + dc.b 18,19,19,20,20,21,21,22,23,23,24,24,25,26,26,27 + dc.b 27,28,28,29,30,30,31,31,32,32,33,34,34,35,35,36 + dc.b 37 +MasterVolTab38: + dc.b 0,0,1,1,2,2,3,4,4,5,5,6,7,7,8,8 + dc.b 9,10,10,11,11,12,13,13,14,14,15,16,16,17,17,18 + dc.b 19,19,20,20,21,21,22,23,23,24,24,25,26,26,27,27 + dc.b 28,29,29,30,30,31,32,32,33,33,34,35,35,36,36,37 + dc.b 38 +MasterVolTab39: + dc.b 0,0,1,1,2,3,3,4,4,5,6,6,7,7,8,9 + dc.b 9,10,10,11,12,12,13,14,14,15,15,16,17,17,18,18 + dc.b 19,20,20,21,21,22,23,23,24,24,25,26,26,27,28,28 + dc.b 29,29,30,31,31,32,32,33,34,34,35,35,36,37,37,38 + dc.b 39 +MasterVolTab40: + dc.b 0,0,1,1,2,3,3,4,5,5,6,6,7,8,8,9 + dc.b 10,10,11,11,12,13,13,14,15,15,16,16,17,18,18,19 + dc.b 20,20,21,21,22,23,23,24,25,25,26,26,27,28,28,29 + dc.b 30,30,31,31,32,33,33,34,35,35,36,36,37,38,38,39 + dc.b 40 +MasterVolTab41: + dc.b 0,0,1,1,2,3,3,4,5,5,6,7,7,8,8,9 + dc.b 10,10,11,12,12,13,14,14,15,16,16,17,17,18,19,19 + dc.b 20,21,21,22,23,23,24,24,25,26,26,27,28,28,29,30 + dc.b 30,31,32,32,33,33,34,35,35,36,37,37,38,39,39,40 + dc.b 41 +MasterVolTab42: + dc.b 0,0,1,1,2,3,3,4,5,5,6,7,7,8,9,9 + dc.b 10,11,11,12,13,13,14,15,15,16,17,17,18,19,19,20 + dc.b 21,21,22,22,23,24,24,25,26,26,27,28,28,29,30,30 + dc.b 31,32,32,33,34,34,35,36,36,37,38,38,39,40,40,41 + dc.b 42 +MasterVolTab43: + dc.b 0,0,1,2,2,3,4,4,5,6,6,7,8,8,9,10 + dc.b 10,11,12,12,13,14,14,15,16,16,17,18,18,19,20,20 + dc.b 21,22,22,23,24,24,25,26,26,27,28,28,29,30,30,31 + dc.b 32,32,33,34,34,35,36,36,37,38,38,39,40,40,41,42 + dc.b 43 +MasterVolTab44: + dc.b 0,0,1,2,2,3,4,4,5,6,6,7,8,8,9,10 + dc.b 11,11,12,13,13,14,15,15,16,17,17,18,19,19,20,21 + dc.b 22,22,23,24,24,25,26,26,27,28,28,29,30,30,31,32 + dc.b 33,33,34,35,35,36,37,37,38,39,39,40,41,41,42,43 + dc.b 44 +MasterVolTab45: + dc.b 0,0,1,2,2,3,4,4,5,6,7,7,8,9,9,10 + dc.b 11,11,12,13,14,14,15,16,16,17,18,18,19,20,21,21 + dc.b 22,23,23,24,25,26,26,27,28,28,29,30,30,31,32,33 + dc.b 33,34,35,35,36,37,37,38,39,40,40,41,42,42,43,44 + dc.b 45 +MasterVolTab46: + dc.b 0,0,1,2,2,3,4,5,5,6,7,7,8,9,10,10 + dc.b 11,12,12,13,14,15,15,16,17,17,18,19,20,20,21,22 + dc.b 23,23,24,25,25,26,27,28,28,29,30,30,31,32,33,33 + dc.b 34,35,35,36,37,38,38,39,40,40,41,42,43,43,44,45 + dc.b 46 +MasterVolTab47: + dc.b 0,0,1,2,2,3,4,5,5,6,7,8,8,9,10,11 + dc.b 11,12,13,13,14,15,16,16,17,18,19,19,20,21,22,22 + dc.b 23,24,24,25,26,27,27,28,29,30,30,31,32,33,33,34 + dc.b 35,35,36,37,38,38,39,40,41,41,42,43,44,44,45,46 + dc.b 47 +MasterVolTab48: + dc.b 0,0,1,2,3,3,4,5,6,6,7,8,9,9,10,11 + dc.b 12,12,13,14,15,15,16,17,18,18,19,20,21,21,22,23 + dc.b 24,24,25,26,27,27,28,29,30,30,31,32,33,33,34,35 + dc.b 36,36,37,38,39,39,40,41,42,42,43,44,45,45,46,47 + dc.b 48 +MasterVolTab49: + dc.b 0,0,1,2,3,3,4,5,6,6,7,8,9,9,10,11 + dc.b 12,13,13,14,15,16,16,17,18,19,19,20,21,22,22,23 + dc.b 24,25,26,26,27,28,29,29,30,31,32,32,33,34,35,35 + dc.b 36,37,38,39,39,40,41,42,42,43,44,45,45,46,47,48 + dc.b 49 +MasterVolTab50: + dc.b 0,0,1,2,3,3,4,5,6,7,7,8,9,10,10,11 + dc.b 12,13,14,14,15,16,17,17,18,19,20,21,21,22,23,24 + dc.b 25,25,26,27,28,28,29,30,31,32,32,33,34,35,35,36 + dc.b 37,38,39,39,40,41,42,42,43,44,45,46,46,47,48,49 + dc.b 50 +MasterVolTab51: + dc.b 0,0,1,2,3,3,4,5,6,7,7,8,9,10,11,11 + dc.b 12,13,14,15,15,16,17,18,19,19,20,21,22,23,23,24 + dc.b 25,26,27,27,28,29,30,31,31,32,33,34,35,35,36,37 + dc.b 38,39,39,40,41,42,43,43,44,45,46,47,47,48,49,50 + dc.b 51 +MasterVolTab52: + dc.b 0,0,1,2,3,4,4,5,6,7,8,8,9,10,11,12 + dc.b 13,13,14,15,16,17,17,18,19,20,21,21,22,23,24,25 + dc.b 26,26,27,28,29,30,30,31,32,33,34,34,35,36,37,38 + dc.b 39,39,40,41,42,43,43,44,45,46,47,47,48,49,50,51 + dc.b 52 +MasterVolTab53: + dc.b 0,0,1,2,3,4,4,5,6,7,8,9,9,10,11,12 + dc.b 13,14,14,15,16,17,18,19,19,20,21,22,23,24,24,25 + dc.b 26,27,28,28,29,30,31,32,33,33,34,35,36,37,38,38 + dc.b 39,40,41,42,43,43,44,45,46,47,48,48,49,50,51,52 + dc.b 53 +MasterVolTab54: + dc.b 0,0,1,2,3,4,5,5,6,7,8,9,10,10,11,12 + dc.b 13,14,15,16,16,17,18,19,20,21,21,22,23,24,25,26 + dc.b 27,27,28,29,30,31,32,32,33,34,35,36,37,37,38,39 + dc.b 40,41,42,43,43,44,45,46,47,48,48,49,50,51,52,53 + dc.b 54 +MasterVolTab55: + dc.b 0,0,1,2,3,4,5,6,6,7,8,9,10,11,12,12 + dc.b 13,14,15,16,17,18,18,19,20,21,22,23,24,24,25,26 + dc.b 27,28,29,30,30,31,32,33,34,35,36,36,37,38,39,40 + dc.b 41,42,42,43,44,45,46,47,48,48,49,50,51,52,53,54 + dc.b 55 +MasterVolTab56: + dc.b 0,0,1,2,3,4,5,6,7,7,8,9,10,11,12,13 + dc.b 14,14,15,16,17,18,19,20,21,21,22,23,24,25,26,27 + dc.b 28,28,29,30,31,32,33,34,35,35,36,37,38,39,40,41 + dc.b 42,42,43,44,45,46,47,48,49,49,50,51,52,53,54,55 + dc.b 56 +MasterVolTab57: + dc.b 0,0,1,2,3,4,5,6,7,8,8,9,10,11,12,13 + dc.b 14,15,16,16,17,18,19,20,21,22,23,24,24,25,26,27 + dc.b 28,29,30,31,32,32,33,34,35,36,37,38,39,40,40,41 + dc.b 42,43,44,45,46,47,48,48,49,50,51,52,53,54,55,56 + dc.b 57 +MasterVolTab58: + dc.b 0,0,1,2,3,4,5,6,7,8,9,9,10,11,12,13 + dc.b 14,15,16,17,18,19,19,20,21,22,23,24,25,26,27,28 + dc.b 29,29,30,31,32,33,34,35,36,37,38,38,39,40,41,42 + dc.b 43,44,45,46,47,48,48,49,50,51,52,53,54,55,56,57 + dc.b 58 +MasterVolTab59: + dc.b 0,0,1,2,3,4,5,6,7,8,9,10,11,11,12,13 + dc.b 14,15,16,17,18,19,20,21,22,23,23,24,25,26,27,28 + dc.b 29,30,31,32,33,34,35,35,36,37,38,39,40,41,42,43 + dc.b 44,45,46,47,47,48,49,50,51,52,53,54,55,56,57,58 + dc.b 59 +MasterVolTab60: + dc.b 0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14 + dc.b 15,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29 + dc.b 30,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44 + dc.b 45,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59 + dc.b 60 +MasterVolTab61: + dc.b 0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14 + dc.b 15,16,17,18,19,20,20,21,22,23,24,25,26,27,28,29 + dc.b 30,31,32,33,34,35,36,37,38,39,40,40,41,42,43,44 + dc.b 45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60 + dc.b 61 +MasterVolTab62: + dc.b 0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14 + dc.b 15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 + dc.b 31,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45 + dc.b 46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61 + dc.b 62 +MasterVolTab63: + dc.b 0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14 + dc.b 15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 + dc.b 31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46 + dc.b 47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62 + dc.b 63 +MasterVolTab64: + dc.b 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 + dc.b 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 + dc.b 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47 + dc.b 48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63 + dc.b 64 + even + endc ; !MINIMAL + + + ifd SDATA + + section __MERGED,bss + +mt_chan1: + ds.b n_sizeof +mt_chan2: + ds.b n_sizeof +mt_chan3: + ds.b n_sizeof +mt_chan4: + ds.b n_sizeof + +mt_SampleStarts: + ds.l 31 + +mt_mod: + ds.l 1 +mt_oldLev6: + ds.l 1 +mt_timerval: + ds.l 1 +mt_oldtimers: + ds.b 4 +mt_Lev6Int: + ds.l 1 +mt_Lev6Ena: + ds.w 1 +mt_PatternPos: + ds.w 1 +mt_PBreakPos: + ds.w 1 +mt_PosJumpFlag: + ds.b 1 +mt_PBreakFlag: + ds.b 1 +mt_Speed: + ds.b 1 +mt_Counter: + ds.b 1 +mt_SongPos: + ds.b 1 +mt_PattDelTime: + ds.b 1 +mt_PattDelTime2: + ds.b 1 + + ifeq MINIMAL +mt_SilCntValid: + ds.b 1 +mt_MasterVolTab: + ds.l 1 + endc + + xdef _mt_Enable +_mt_Enable: +mt_Enable: + ds.b 1 + + xdef _mt_E8Trigger +_mt_E8Trigger: +mt_E8Trigger: + ds.b 1 + + ifeq MINIMAL + xdef _mt_MusicChannels +_mt_MusicChannels: +mt_MusicChannels: + ds.b 1 + + xdef _mt_SongEnd +_mt_SongEnd: +mt_SongEnd: + ds.b 1 + endc ; !MINIMAL + + else ; !SDATA : single section with local base register + + rsreset +mt_chan1 rs.b n_sizeof +mt_chan2 rs.b n_sizeof +mt_chan3 rs.b n_sizeof +mt_chan4 rs.b n_sizeof +mt_SampleStarts rs.l 31 +mt_mod rs.l 1 +mt_oldLev6 rs.l 1 +mt_timerval rs.l 1 +mt_oldtimers rs.b 4 +mt_Lev6Int rs.l 1 +mt_Lev6Ena rs.w 1 +mt_PatternPos rs.w 1 +mt_PBreakPos rs.w 1 +mt_PosJumpFlag rs.b 1 +mt_PBreakFlag rs.b 1 +mt_Speed rs.b 1 +mt_Counter rs.b 1 +mt_SongPos rs.b 1 +mt_PattDelTime rs.b 1 +mt_PattDelTime2 rs.b 1 + ifeq MINIMAL +mt_SilCntValid rs.b 1 +mt_MasterVolTab rs.l 1 + endc +mt_Enable rs.b 1 ; exported as _mt_Enable +mt_E8Trigger rs.b 1 ; exported as _mt_E8Trigger +mt_MusicChannels rs.b 1 ; exported as _mt_MusicChannels +mt_SongEnd rs.b 1 ; exported as _mt_SongEnd + +mt_data: + ds.b mt_Enable + xdef _mt_Enable +_mt_Enable: + ds.b 1 + xdef _mt_E8Trigger +_mt_E8Trigger: + ds.b 1 + ifeq MINIMAL + xdef _mt_MusicChannels +_mt_MusicChannels: + ds.b 1 + xdef _mt_SongEnd +_mt_SongEnd: + ds.b 1 + endc ; !MINIMAL + + endc ; SDATA/!SDATA + +; --- note-trigger detection state (used by the notestrike accessor) --- + even +vu_prevstarts: + ds.l 4 + + }} + +} diff --git a/compiler/res/prog8lib/shared_amiga_sorting.p8 b/compiler/res/prog8lib/shared_amiga_sorting.p8 new file mode 100644 index 000000000..29aba2b3a --- /dev/null +++ b/compiler/res/prog8lib/shared_amiga_sorting.p8 @@ -0,0 +1 @@ +; TODO diff --git a/compiler/res/prog8lib/shared_amiga_utility.p8 b/compiler/res/prog8lib/shared_amiga_utility.p8 new file mode 100644 index 000000000..53800925c --- /dev/null +++ b/compiler/res/prog8lib/shared_amiga_utility.p8 @@ -0,0 +1,109 @@ +;; Auto-generated from utility_lib.sfd and utility_lib.i +;; Library base: _UtilityBase in prog8: sys.UtilityBase +;; Bank: 9 +;; Functions: 43 + +%import exec + +utility { + %option merge, no_symbol_prefixing + extsub @bank 9 -30 = FindTagItem(long tagVal @D0, pointer tagList @A0) -> ^^TagItem @D0 + extsub @bank 9 -36 = GetTagData(long tagValue @D0, long defaultVal @D1, pointer tagList @A0) -> long @D0 + extsub @bank 9 -42 = PackBoolTags(long initialFlags @D0, pointer tagList @A0, pointer boolMap @A1) -> long @D0 + extsub @bank 9 -48 = NextTagItem(pointer tagListPtr @A0) -> ^^TagItem @D0 + extsub @bank 9 -54 = FilterTagChanges(pointer changeList @A0, pointer originalList @A1, long apply @D0) + extsub @bank 9 -60 = MapTags(pointer tagList @A0, pointer mapList @A1, long mapType @D0) + extsub @bank 9 -66 = AllocateTagItems(long numTags @D0) -> ^^TagItem @D0 + extsub @bank 9 -72 = CloneTagItems(pointer tagList @A0) -> ^^TagItem @D0 + extsub @bank 9 -78 = FreeTagItems(pointer tagList @A0) + extsub @bank 9 -84 = RefreshTagItemClones(pointer clone @A0, pointer original @A1) + extsub @bank 9 -90 = TagInArray(long tagValue @D0, pointer tagArray @A0) -> bool @D0 + extsub @bank 9 -96 = FilterTagItems(pointer tagList @A0, pointer filterArray @A1, long logic @D0) -> long @D0 + extsub @bank 9 -102 = CallHookPkt(^^Hook hook @A0, pointer object @A2, pointer paramPacket @A1) -> long @D0 + extsub @bank 9 -120 = Amiga2Date(long seconds @D0, ^^ClockData result @A0) + extsub @bank 9 -126 = Date2Amiga(^^ClockData date @A0) -> long @D0 + extsub @bank 9 -132 = CheckDate(^^ClockData date @A0) -> long @D0 + extsub @bank 9 -138 = SMult32(long arg1 @D0, long arg2 @D1) -> long @D0 + extsub @bank 9 -144 = UMult32(long arg1 @D0, long arg2 @D1) -> long @D0 + extsub @bank 9 -150 = SDivMod32(long dividend @D0, long divisor @D1) -> long @D0 + extsub @bank 9 -156 = UDivMod32(long dividend @D0, long divisor @D1) -> long @D0 + extsub @bank 9 -162 = Stricmp(str string1 @A0, str string2 @A1) -> long @D0 + extsub @bank 9 -168 = Strnicmp(str string1 @A0, str string2 @A1, long length @D0) -> long @D0 + extsub @bank 9 -174 = ToUpper(ubyte character @D0) -> ubyte @D0 + extsub @bank 9 -180 = ToLower(ubyte character @D0) -> ubyte @D0 + extsub @bank 9 -186 = ApplyTagChanges(pointer list @A0, pointer changeList @A1) + extsub @bank 9 -198 = SMult64(long arg1 @D0, long arg2 @D1) -> long @D0 + extsub @bank 9 -204 = UMult64(long arg1 @D0, long arg2 @D1) -> long @D0 + extsub @bank 9 -210 = PackStructureTags(pointer pack @A0, pointer packTable @A1, pointer tagList @A2) -> long @D0 + extsub @bank 9 -216 = UnpackStructureTags(pointer pack @A0, pointer packTable @A1, pointer tagList @A2) -> long @D0 + extsub @bank 9 -222 = AddNamedObject(pointer nameSpace @A0, pointer object @A1) -> bool @D0 + extsub @bank 9 -228 = AllocNamedObjectA(str name @A0, pointer tagList @A1) -> pointer @D0 + extsub @bank 9 -234 = AttemptRemNamedObject(pointer object @A0) -> long @D0 + extsub @bank 9 -240 = FindNamedObject(pointer nameSpace @A0, str name @A1, pointer lastObject @A2) -> pointer @D0 + extsub @bank 9 -246 = FreeNamedObject(pointer object @A0) + extsub @bank 9 -252 = NamedObjectName(pointer object @A0) -> str @D0 + extsub @bank 9 -258 = ReleaseNamedObject(pointer object @A0) + extsub @bank 9 -264 = RemNamedObject(pointer object @A0, ^^exec.Message message @A1) + extsub @bank 9 -270 = GetUniqueID() -> long @D0 + extsub @bank 9 -312 = VSNPrintf(str buffer @A0, long bufsize @D0, str fmt @A1, pointer data @A2) -> long @D0 + extsub @bank 9 -438 = Strncpy(str dst @A1, str src @A0, long size @D0) -> str @D0 + extsub @bank 9 -444 = Strncat(str dst @A1, str src @A0, long size @D0) -> str @D0 + extsub @bank 9 -450 = SDivMod64(long hi @D1, long lo @D0, long divisor @D2) -> long @D0 + extsub @bank 9 -456 = UDivMod64(long hi @D1, long lo @D0, long divisor @D2) -> long @D0 + + ; ---- struct definitions ---- + + struct ClockData { ; total size: 14 + uword Sec ; 0 + uword Min ; 2 + uword Hour ; 4 + uword Mday ; 6 + uword Month ; 8 + uword Year ; 10 + uword Wday ; 12 + } + + struct Hook { ; total size: 20 + ^^exec.MinNode Succ ; 0 + ^^exec.MinNode Pred ; 4 + pointer Entry ; 8 + pointer SubEntry ; 12 + pointer Data ; 16 + } + + struct TagItem { ; total size: 8 + long Tag ; 0 + long Data ; 4 + } + + ; ---- constants ---- + const ubyte UTILITY_NAME_I = $0001 + const uword ANO_NameSpace = $0fa0 + const uword ANO_UserSpace = $0fa1 + const uword ANO_Priority = $0fa2 + const uword ANO_Flags = $0fa3 + const ubyte NSB_NODUPS = 0 + const ubyte NSF_NODUPS = $0001 + const ubyte NSB_CASE = 1 + const ubyte NSF_CASE = $0002 + const ubyte UTILITY_PACK_I = $0001 + const ubyte PSTB_SIGNED = 31 + const long PSTF_SIGNED = $80000000 + const ubyte PSTB_UNPACK = 30 + const long PSTF_UNPACK = $40000000 + const ubyte PSTB_PACK = 29 + const long PSTF_PACK = $20000000 + const ubyte PSTB_EXISTS = 26 + const long PSTF_EXISTS = $04000000 + const ubyte TAG_DONE = $0000 + const ubyte TAG_END = $0000 + const ubyte TAG_IGNORE = $0001 + const ubyte TAG_MORE = $0002 + const ubyte TAG_SKIP = $0003 + const long TAG_USER = $80000000 + const ubyte TAGFILTER_AND = $0000 + const ubyte TAGFILTER_NOT = $0001 + const ubyte MAP_REMOVE_NOT_FOUND = $0000 + const ubyte MAP_KEEP_NOT_FOUND = $0001 +} +;; End of auto-generated utility_lib.sfd diff --git a/compiler/src/prog8/CompilerMain.kt b/compiler/src/prog8/CompilerMain.kt index ed53cc1ca..7e31eaeda 100644 --- a/compiler/src/prog8/CompilerMain.kt +++ b/compiler/src/prog8/CompilerMain.kt @@ -199,7 +199,7 @@ private fun compileMain(args: Array): Boolean { System.err.println("Invalid -varsaddress value: $varsAddressStr") return false } - val maxCliAddress = if(compilationTarget in setOf(Amiga500Target.NAME, Qemu68kTarget.NAME, VMTarget.NAME)) 0xFFFFFFFFu else 0xFFFFu + val maxCliAddress = if(compilationTarget in setOf(Amiga500Target.NAME, Amiga1200Target.NAME, Qemu68kTarget.NAME, VMTarget.NAME)) 0xFFFFFFFFu else 0xFFFFu if(varsAddress!=null && varsAddress > maxCliAddress) { System.err.println("vars address must be valid integer 0..${maxCliAddress.toHex()}") return false @@ -214,7 +214,7 @@ private fun compileMain(args: Array): Boolean { return false } - if(compilationTarget in setOf(Amiga500Target.NAME, Qemu68kTarget.NAME)) { + if(compilationTarget in setOf(Amiga500Target.NAME, Amiga1200Target.NAME, Qemu68kTarget.NAME)) { if(varsGolden || varsHighBank!=null || varsAddress!=null) { System.err.println("The -varsgolden/-varshigh/-varsaddress options are not available on the m68k target") return false diff --git a/compiler/src/prog8/compiler/Compiler.kt b/compiler/src/prog8/compiler/Compiler.kt index 9b75c7b3c..35d7a180c 100644 --- a/compiler/src/prog8/compiler/Compiler.kt +++ b/compiler/src/prog8/compiler/Compiler.kt @@ -775,6 +775,7 @@ private fun createAssemblyAndAssemble(program: PtProgram, } compilerOptions.compTarget.name == Qemu68kTarget.NAME -> prog8.codegen.m68k.M68kCodeGenerator(retainSSAforIR) compilerOptions.compTarget.name == Amiga500Target.NAME -> prog8.codegen.m68k.M68kCodeGenerator(retainSSAforIR) + compilerOptions.compTarget.name == Amiga1200Target.NAME -> prog8.codegen.m68k.M68kCodeGenerator(retainSSAforIR) compilerOptions.compTarget.name == VMTarget.NAME -> VmCodeGen(retainSSAforIR, irCallIds) else -> throw NotImplementedError("no code generator for cpu ${compilerOptions.compTarget.cpu}") } diff --git a/compiler/src/prog8/compiler/astprocessing/AstChecker.kt b/compiler/src/prog8/compiler/astprocessing/AstChecker.kt index aa5ed0efe..0f81ff608 100644 --- a/compiler/src/prog8/compiler/astprocessing/AstChecker.kt +++ b/compiler/src/prog8/compiler/astprocessing/AstChecker.kt @@ -5,10 +5,7 @@ import prog8.ast.expressions.* import prog8.ast.statements.* import prog8.ast.walk.IAstVisitor import prog8.code.core.* -import prog8.code.target.Amiga500Target -import prog8.code.target.C128Target -import prog8.code.target.Cx16Target -import prog8.code.target.VMTarget +import prog8.code.target.* import prog8.compiler.builtinFunctionReturnTypes import java.io.CharConversionException import java.io.File @@ -1496,8 +1493,8 @@ internal class AstChecker(private val program: Program, } if(directive.args.any { it.string=="verafxmuls" } && options.compTarget.name != Cx16Target.NAME) err("verafx option is only valid on cx16 target") - if(directive.args.any { it.string=="amiga_chipram" } && options.compTarget.name != Amiga500Target.NAME) - err("amiga_chipram option is only valid on amiga500 target") + if(directive.args.any { it.string=="amiga_chipram" } && options.compTarget.name != Amiga500Target.NAME && options.compTarget.name != Amiga1200Target.NAME) + err("amiga_chipram option is only valid on amiga targets") } "%encoding" -> { if(directive.parent !is Module) diff --git a/compiler/src/prog8/compiler/astprocessing/M68kAstChecker.kt b/compiler/src/prog8/compiler/astprocessing/M68kAstChecker.kt index bdf3951ee..b61c02ebb 100644 --- a/compiler/src/prog8/compiler/astprocessing/M68kAstChecker.kt +++ b/compiler/src/prog8/compiler/astprocessing/M68kAstChecker.kt @@ -56,8 +56,9 @@ internal class M68kAstChecker(private val errors: IErrorReporter, private val ta } "%output" -> { val arg = directive.args.singleOrNull()?.string?.uppercase() - if (arg != null && arg != "RAW" && arg != "ELF") { - errors.err("output types other than 'raw' and 'elf' are not available on the m68k target", directive.position) + val allowed = target.defaultOutputType.name + if (arg != null && arg != allowed) { + errors.err("output type '$arg' is not available on the ${target.name} target; only '${allowed.lowercase()}' is (which is also the default)", directive.position) } } "%option" -> { diff --git a/compiler/test/TestAmigaChipramOption.kt b/compiler/test/TestAmigaChipramOption.kt index 94fc40073..cf7fca718 100644 --- a/compiler/test/TestAmigaChipramOption.kt +++ b/compiler/test/TestAmigaChipramOption.kt @@ -5,6 +5,7 @@ import io.kotest.engine.spec.tempdir import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldNotBe import io.kotest.matchers.string.shouldContain +import prog8.code.target.Amiga1200Target import prog8.code.target.Amiga500Target import prog8.code.target.C64Target import prog8.code.target.Qemu68kTarget @@ -136,7 +137,7 @@ main { val errors = ErrorReporterForTests(keepMessagesAfterReporting = true) compileText(C64Target(), optimize = false, src, outputDir, writeAssembly = false, errors = errors) shouldBe null errors.errors.size shouldBe 1 - errors.errors[0] shouldContain "amiga_chipram option is only valid on amiga500 target" + errors.errors[0] shouldContain "amiga_chipram option is only valid on amiga targets" } test("amiga_chipram option on qemu68k target is rejected") { @@ -158,6 +159,33 @@ main { val errors = ErrorReporterForTests(keepMessagesAfterReporting = true) compileText(Qemu68kTarget(), optimize = false, src, outputDir, writeAssembly = false, errors = errors) shouldBe null errors.errors.size shouldBe 1 - errors.errors[0] shouldContain "amiga_chipram option is only valid on amiga500 target" + errors.errors[0] shouldContain "amiga_chipram option is only valid on amiga targets" + } + + test("amiga_chipram option on amiga1200 target is accepted") { + val src = """ +chipper { + %option amiga_chipram + + ubyte @shared init_var = 42 + ubyte @shared uninit_var + long @shared slab_ptr = memory("chiper_slab", 16, 4) + + sub chipram_sub() { + init_var++ + } +} + +main { + sub start() { + chipper.chipram_sub() + } +} +""" + val result = compileText(Amiga1200Target(), optimize = false, src, outputDir, writeAssembly = false) + result shouldNotBe null + val blocks = result!!.compilerAst.allBlocks.toList() + val chipramBlock = blocks.singleOrNull { "amiga_chipram" in it.options() } + chipramBlock shouldNotBe null } }) diff --git a/docs/Makefile b/docs/Makefile index 56977cb89..79373e418 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -24,6 +24,7 @@ symboldumps: prog8c -daemon -target virtual import-all-virtual.p8 -dumpsymbols > source/_static/symboldumps/skeletons-virtual.txt prog8c -daemon -target qemu68k import-all-qemu68k.p8 -dumpsymbols > source/_static/symboldumps/skeletons-qemu68k.txt prog8c -daemon -target amiga500 import-all-amiga500.p8 -dumpsymbols > source/_static/symboldumps/skeletons-amiga500.txt + prog8c -daemon -target amiga1200 import-all-amiga1200.p8 -dumpsymbols > source/_static/symboldumps/skeletons-amiga1200.txt # Catch-all target: route all unknown targets to Sphinx using the new diff --git a/docs/import-all-amiga1200.p8 b/docs/import-all-amiga1200.p8 new file mode 100644 index 000000000..5bf5cd909 --- /dev/null +++ b/docs/import-all-amiga1200.p8 @@ -0,0 +1,30 @@ +; all library modules for the amiga1200 compiler target + +%import arexx +%import buffers +%import blitter +%import copper +%import iffparse +%import icon +%import compression +%import coroutines +%import custom +%import conv +%import floats +%import lists +%import lineclip +%import math +%import prog8_lib +%import sorting +%import strings +%import syslib +%import textio +%import wavfile +%import exec +%import dos +%import graphics +%import intuition +%import utility +%import timer +%import audio +%import ptplayer diff --git a/docs/source/_static/symboldumps/skeletons-amiga1200.txt b/docs/source/_static/symboldumps/skeletons-amiga1200.txt new file mode 100644 index 000000000..4284aa705 --- /dev/null +++ b/docs/source/_static/symboldumps/skeletons-amiga1200.txt @@ -0,0 +1,4762 @@ + +Prog8 compiler v14.0-SNAPSHOT by Irmen de Jong (irmen@razorvine.net) +Prerelease version from git commit 10af5243 in branch master +This software is licensed under the GNU GPL 3.0, see https://www.gnu.org/licenses/gpl.html + +Compiling program import-all-amiga1200.p8 +Compiler target: amiga1200 + + +BUILTIN FUNCTIONS +----------------- +abs (ubyte|byte|uword|word|long|float value) -> undefined +call (pointer address) -> uword +callfar (ubyte bank, pointer address, uword arg) -> uword +callfar2 (ubyte bank, pointer address, ubyte argA, ubyte argX, ubyte argY, bool argC) -> uword +clamp (byte value, byte minimum, byte maximum) -> undefined +cmp (ubyte|byte|uword|word|long value1, ubyte|byte|uword|word|long|float value2) +divmod (ubyte|uword dividend, ubyte|uword divisor) -> undefined, undefined +len (str|array|array_splitw|array_pointer values) -> uword +lmh (long value) -> ubyte, ubyte, ubyte +lsb (uword|word|long value) -> ubyte +lsw (uword|word|long value) -> uword +max (byte val1, byte val2) -> undefined +memory (str name, uword size, uword alignment) -> pointer +min (byte val1, byte val2) -> undefined +mklong (ubyte msb, ubyte b2, ubyte b1, ubyte lsb) -> long +mklong2 (uword msw, uword lsw) -> long +mkword (ubyte msb, ubyte lsb) -> uword +msb (uword|word|long value) -> ubyte +msw (uword|word|long value) -> uword +offsetof (ubyte field) -> ubyte +peek (uword|long|pointer address) -> ubyte +peekbool (uword|long|pointer address) -> bool +peekf (uword|long|pointer address) -> float +peekl (uword|long|pointer address) -> long +peekp (pointer|uword|long address) -> pointer +peekw (uword|long|pointer address) -> uword +poke (uword|long|pointer address, ubyte|byte value) +pokebool (uword|long|pointer address, bool value) +pokebowl (uword|long|pointer address, bool value) +pokef (uword|long|pointer address, float value) +pokel (uword|long|pointer address, long value) +pokemon (uword|long|pointer address, ubyte value) -> ubyte +pokep (pointer|uword|long address, pointer value) +pokew (uword|long|pointer address, uword|word value) +pop () -> ubyte +popf () -> float +popl () -> long +popp () -> pointer +popw () -> uword +push (ubyte|byte|bool value) +pushf (float value) +pushl (long value) +pushp (pointer value) +pushw (uword|word|pointer value) +rol (ubyte|uword|long item) +rol2 (ubyte|uword|long item) +ror (ubyte|uword|long item) +ror2 (ubyte|uword|long item) +rrestore () +rsave () +setlsb (word|uword|long variable, byte|ubyte value) +setmsb (word|uword|long variable, byte|ubyte value) +sgn (ubyte|byte|uword|word|long|float value) -> byte +sizeof (ubyte|byte|uword|word|long|float|bool|str|array|array_splitw|pointer|array_pointer|undefined object) -> ubyte +sqrt (ubyte|byte|uword|word|long|float value) -> undefined + + +LIBRARY MODULE NAME: arexx +-------------------------- + +arexx { + struct RexxMsg + const uword ACTION_QUEUE + const uword ACTION_STACK + const ubyte CTB_ALPHA + const ubyte CTB_DIGIT + const ubyte CTB_LOWER + const ubyte CTB_REXXOPR + const ubyte CTB_REXXSPC + const ubyte CTB_REXXSYM + const ubyte CTB_SPACE + const ubyte CTB_UPPER + const ubyte CTF_ALPHA + const ubyte CTF_DIGIT + const ubyte CTF_LOWER + const ubyte CTF_REXXOPR + const ubyte CTF_REXXSPC + const ubyte CTF_REXXSYM + const ubyte CTF_SPACE + const ubyte CTF_UPPER + const ubyte DT_DEV + const ubyte DT_DIR + const ubyte DT_VOL + const ubyte ERR10_001 + const ubyte ERR10_002 + const ubyte ERR10_003 + const ubyte ERR10_005 + const ubyte ERR10_006 + const ubyte ERR10_008 + const ubyte ERR10_009 + const ubyte ERR10_010 + const ubyte ERR10_011 + const ubyte ERR10_012 + const ubyte ERR10_013 + const ubyte ERR10_014 + const ubyte ERR10_015 + const ubyte ERR10_016 + const ubyte ERR10_017 + const ubyte ERR10_018 + const ubyte ERR10_019 + const ubyte ERR10_020 + const ubyte ERR10_021 + const ubyte ERR10_022 + const ubyte ERR10_023 + const ubyte ERR10_024 + const ubyte ERR10_025 + const ubyte ERR10_026 + const ubyte ERR10_027 + const ubyte ERR10_028 + const ubyte ERR10_029 + const ubyte ERR10_030 + const ubyte ERR10_031 + const ubyte ERR10_032 + const ubyte ERR10_033 + const ubyte ERR10_034 + const ubyte ERR10_035 + const ubyte ERR10_036 + const ubyte ERR10_037 + const ubyte ERR10_039 + const ubyte ERR10_040 + const ubyte ERR10_041 + const ubyte ERR10_042 + const ubyte ERR10_043 + const ubyte ERR10_044 + const ubyte ERR10_045 + const ubyte ERR10_046 + const ubyte ERR10_047 + const ubyte ERR10_048 + const ubyte ERRC_MSG + const ubyte GLOBALSZ + const ubyte KEEPNUM + const ubyte KEEPSTR + const ubyte MAXRMARG + const long MEMCLEAR + const long MEMMASK + const ubyte MEMQUANT + const ubyte MEMQUICK + const ubyte NSB_BINARY + const ubyte NSB_EXT + const ubyte NSB_FLOAT + const ubyte NSB_KEEP + const ubyte NSB_NOTNUM + const ubyte NSB_NUMBER + const ubyte NSB_SOURCE + const ubyte NSB_STRING + const ubyte NSF_ALPHA + const ubyte NSF_BINARY + const ubyte NSF_DPNUM + const ubyte NSF_EXT + const ubyte NSF_FLOAT + const ubyte NSF_INTNUM + const ubyte NSF_KEEP + const ubyte NSF_NOTNUM + const ubyte NSF_NUMBER + const ubyte NSF_OWNED + const ubyte NSF_SOURCE + const ubyte NSF_STRING + const ubyte NUMLISTS + const ubyte RC_ERROR + const long RC_FAIL + const ubyte RC_FATAL + const ubyte RC_OK + const ubyte RC_WARN + const ubyte RLFB_CLOSE + const ubyte RLFB_HALT + const ubyte RLFB_STOP + const ubyte RLFB_SUSP + const ubyte RLFB_TRACE + const ubyte RLFMASK + const ubyte RRT_ANY + const ubyte RRT_CLIP + const ubyte RRT_FILE + const ubyte RRT_HOST + const ubyte RRT_LIB + const ubyte RRT_PORT + const ubyte RTFB_CLOSE + const ubyte RTFB_HALT + const ubyte RTFB_SUSP + const ubyte RTFB_TCUSE + const ubyte RTFB_TRACE + const ubyte RTFB_WAIT + const long RXADDCON + const long RXADDFH + const long RXADDLIB + const long RXARGMASK + const ubyte RXBUFFSZ + const long RXCLOSE + const long RXCODEMASK + const long RXCOMM + const ubyte RXFB_NOIO + const ubyte RXFB_NONRET + const ubyte RXFB_RESULT + const ubyte RXFB_SCRIPT + const ubyte RXFB_STRING + const ubyte RXFB_TOKEN + const ubyte RXFF_NONRET + const ubyte RXFF_RESULT + const ubyte RXFF_SCRIPT + const ubyte RXFF_STRING + const ubyte RXFF_TOKEN + const long RXFUNC + const ubyte RXIO_APPEND + const long RXIO_BEGIN + const ubyte RXIO_CURR + const ubyte RXIO_END + const long RXIO_EXIST + const ubyte RXIO_READ + const ubyte RXIO_STRF + const ubyte RXIO_WRITE + const long RXQUERY + const long RXREMCON + const long RXREMLIB + const uword RXSCHUNK + const ubyte RXSNEST + const uword RXSSTACK + const ubyte RXSTPRI + const long RXTCCLS + const long RXTCOPN + ClearRexxMsg (^^arexx.RexxMsg msgptr @A0, long count @D0)@bank 29 = -$9c + CreateArgstring (str string @A0, long length @D0) -> long @D0@bank 29 = -$7e + CreateRexxHostPort (str basename @A0) -> ^^exec.MsgPort @D0@bank 29 = -$01e0 + CreateRexxMsg (^^exec.MsgPort port @A0, str extension @A1, str host @D0) -> ^^arexx.RexxMsg @D0@bank 29 = -$90 + DeleteArgstring (long argstring @A0)@bank 29 = -$84 + DeleteRexxHostPort (^^exec.MsgPort port @A0)@bank 29 = -$01e6 + DeleteRexxMsg (^^arexx.RexxMsg packet @A0)@bank 29 = -$96 + FillRexxMsg (^^arexx.RexxMsg msgptr @A0, long count @D0, long mask @D1) -> bool @D0@bank 29 = -$a2 + FreeRexxMsg (^^arexx.RexxMsg msgptr @A0)@bank 29 = -$01fe + GetRexxBufferFromMsg (str var @A0, ^^arexx.RexxMsg msgptr @A2, str buffer @A1, long buffer_size @D0) -> long @D0@bank 29 = -$0204 + GetRexxVarFromMsg (str var @A0, ^^arexx.RexxMsg msgptr @A2, str value @A1) -> long @D0@bank 29 = -$01ec + IsRexxMsg (^^arexx.RexxMsg msgptr @A0) -> bool @D0@bank 29 = -$a8 + LaunchRexxScript (str script @A0, ^^exec.MsgPort replyport @A1, str extension @A2, long input @D1, long output @D2) -> ^^arexx.RexxMsg @D0@bank 29 = -$01f8 + LengthArgstring (long argstring @A0) -> long @D0@bank 29 = -$8a + LockRexxBase (long resource @D0)@bank 29 = -$01c2 + SetRexxVarFromMsg (str var @A0, ^^arexx.RexxMsg msgptr @A2, str value @A1) -> long @D0@bank 29 = -$01f2 + UnlockRexxBase (long resource @D0)@bank 29 = -$01c8 + closelib () + openlib () -> bool +} + + +LIBRARY MODULE NAME: audio +-------------------------- + +audio { + struct IOAudio + const byte ADALLOC_MAXPREC + const byte ADALLOC_MINPREC + const uword ADCMD_ALLOCATE + const uword ADCMD_FINISH + const uword ADCMD_FREE + const uword ADCMD_LOCK + const uword ADCMD_PERVOL + const uword ADCMD_SETPREC + const uword ADCMD_WAITCYCLE + const uword ADHARD_CHANNELS + const ubyte ADIOB_NOWAIT + const ubyte ADIOB_PERVOL + const ubyte ADIOB_SYNCCYCLE + const ubyte ADIOB_WRITEMESSAGE + const byte ADIOERR_ALLOCFAILED + const byte ADIOERR_CHANNELSTOLEN + const byte ADIOERR_NOALLOCATION + const ubyte ADIOF_NOWAIT + const ubyte ADIOF_PERVOL + const ubyte ADIOF_SYNCCYCLE + const ubyte ADIOF_WRITEMESSAGE + ^^audio.IOAudio AudioIO0 + ^^audio.IOAudio AudioIO1 + ^^audio.IOAudio AudioIO2 + ^^audio.IOAudio AudioIO3 + clock () clobbers (A6) -> long @D0 + closedevice () + closedown () + get_io (ubyte channel) -> ^^audio.IOAudio + init () -> bool + is_playing (ubyte channel) -> bool + opendevice (long channelPrefs, ubyte prefsLen, byte precedence) -> bool + period (uword samplerate) -> uword + play (ubyte channel, ^^byte samples, long num_samples, uword sample_rate, ubyte volume, uword cycles) + sample_rate (uword per) -> uword + set_freqvol (ubyte channel, uword samplerate, ubyte volume) + stop (ubyte channel) + stop_all () + wait_all () + wait_channel (ubyte channel) +} + + +LIBRARY MODULE NAME: blitter +---------------------------- + +blitter { + const uword MINTERM_A_ONLY + const uword MINTERM_A_XOR_C + const uword MINTERM_B_ONLY + const uword MINTERM_MASKED + clear_plane (long dst @A0, uword width_words @D0, uword height @D1) clobbers (D0,D1,A0) + copy_rect (long src @A0, long dst @A1, uword width_words @D0, uword height @D1, uword src_mod @D2, uword dst_mod @D3, uword minterm @D4, ubyte descending @D5) clobbers (D0,D1,D2,D3,D4,D5,A0,A1) + fill_plane (long dst @A0, uword width_words @D0, uword height @D1, uword pattern @D2) clobbers (D0,D1,D2,A0) + fill_rect (long dst @A0, uword width_words @D0, uword height @D1, uword pattern @D2, uword modulo @D3) clobbers (D0,D1,D2,D3,A0) + line_draw (uword x1 @D0, uword y1 @D1, uword x2 @D2, uword y2 @D3, uword screen_mod @D4, long screen_ptr @A1) clobbers (D0,D1,D2,D3,D5,D6,A0,A1) + line_init (uword mask @D0, uword pixel @D1, uword pattern @D2, uword screen_mod @D4) clobbers (D0,D1,D2,D4,A0,A1) + masked_blit (long src @A0, long mask @A1, long dst @A2, uword width_words @D0, uword height @D1, uword src_mod @D2, uword mask_mod @D3, uword dst_mod @D4) clobbers (D0,D1,D2,D3,D4,A0,A1,A2) + set_blitpri (bool hasprio @D0) clobbers (D0) + wait () +} + + +LIBRARY MODULE NAME: buffers +---------------------------- + +smallringbuffer { + ubyte[] buffer + ubyte fill + ubyte head + ubyte tail + free () -> ubyte + get () -> ubyte + getw () -> uword + init () + isempty () -> bool + isfull () -> bool + put (ubyte value) + putw (uword value) + size () -> ubyte +} + +smallstack { + ubyte[] buffer + ubyte sp + free () -> ubyte + init () + isempty () -> bool + isfull () -> bool + pop_b () -> ubyte + pop_w () -> uword + push_b (ubyte value) + push_w (uword value) + size () -> ubyte +} + +stack { + uword buffer_ptr + uword sp + free () -> uword + init () + isempty () -> bool + isfull () -> bool + pop_b () -> ubyte + pop_w () -> uword + push_b (ubyte value) + push_w (uword value) + size () -> uword +} + +ringbuffer { + uword buffer_ptr + uword fill + uword head + uword tail + free () -> uword + get () -> ubyte + getw () -> uword + inc_head () + inc_tail () + init () + isempty () -> bool + isfull () -> bool + put (ubyte value) + putw (uword value) + size () -> uword +} + + +LIBRARY MODULE NAME: compression +-------------------------------- + +compression { + decode_rle (^^ubyte compressed @A0, ^^ubyte target @A1, uword maxsize @D0) clobbers (D0,D1,D2,A1) -> ^^ubyte @A0 + unZX0 (long compressed @A0, long output @A1) +} + + +LIBRARY MODULE NAME: conv +------------------------- + +conv { + str string_out + any2uword (str string) -> uword, ubyte + bin2uword (str string) -> uword + hex2long (str string) -> long + hex2uword (str string) -> uword + str2byte (str string) -> byte + str2long (str string) -> long + str2ubyte (str string) -> ubyte + str2uword (str string) -> uword + str2word (str string) -> word + str_b (byte value) -> str + str_l (long value) -> str + str_ub (ubyte value) -> str + str_ub0 (ubyte value) -> str + str_ubbin (ubyte value) -> str + str_ubhex (ubyte value) -> str + str_ulhex (long value) -> str + str_uw (uword value) -> str + str_uw0 (uword value) -> str + str_uwbin (uword value) -> str + str_uwhex (uword value) -> str + str_w (word value) -> str +} + + +LIBRARY MODULE NAME: copper +--------------------------- + +copper { + long @shared _copper_pos + append_raster_colors (ubyte vpos_start, ^^uword colors, ubyte num_lines) + end () clobbers (A0) + get_pos () -> long @A0 + init (long list_ptr @A0) clobbers (A0) + move (uword reg_addr @D0, uword value @D1) clobbers (D0,D1,A0) + skip (ubyte vpos @D0, ubyte hpos @D1, uword compare_mask @D2) clobbers (D0,D1,D2,A0) + start (long list_ptr @A0) clobbers (A0) + wait (ubyte vpos @D0, ubyte hpos @D1, uword compare_mask @D2) clobbers (D0,D1,D2,A0) +} + + +LIBRARY MODULE NAME: coroutines +------------------------------- + +coroutines { + const ubyte MAX_TASKS + ubyte active_task + long supervisor + long[] tasklist + long[] userdatas + add (long taskaddress, long userdata) -> ubyte + current () -> ubyte + kill (ubyte taskid) + killall () + run (long supervisor_routine) + termination () + yield () -> long +} + + +LIBRARY MODULE NAME: custom +--------------------------- + +custom { + const uword ABC + const uword ABNC + &uword ADKCON + &uword ADKCONR + const uword ADKF_FAST + const uword ADKF_MFMPREC + const uword ADKF_MSBSYNC + const uword ADKF_PRECOMP0 + const uword ADKF_PRECOMP1 + const uword ADKF_SETCLR + const uword ADKF_UARTBRK + const uword ADKF_USE0P1 + const uword ADKF_USE0V1 + const uword ADKF_USE1P2 + const uword ADKF_USE1V2 + const uword ADKF_USE2P3 + const uword ADKF_USE2V3 + const uword ADKF_USE3PN + const uword ADKF_USE3VN + const uword ADKF_WORDSYNC + const uword ANBC + const uword ANBNC + &uword AUD0DAT + &uword AUD0LEN + &uword AUD0PER + &long AUD0PT + &uword AUD0PTH + &uword AUD0PTL + &uword AUD0VOL + &uword AUD1DAT + &uword AUD1LEN + &uword AUD1PER + &long AUD1PT + &uword AUD1PTH + &uword AUD1PTL + &uword AUD1VOL + &uword AUD2DAT + &uword AUD2LEN + &uword AUD2PER + &long AUD2PT + &uword AUD2PTH + &uword AUD2PTL + &uword AUD2VOL + &uword AUD3DAT + &uword AUD3LEN + &uword AUD3PER + &long AUD3PT + &uword AUD3PTH + &uword AUD3PTL + &uword AUD3VOL + const uword BC0F_DEST + const uword BC0F_SRCA + const uword BC0F_SRCB + const uword BC0F_SRCC + const uword BC1F_AUL + const uword BC1F_DESC + const uword BC1F_FILL_CARRYIN + const uword BC1F_FILL_OR + const uword BC1F_FILL_XOR + const uword BC1F_LINEMODE + const uword BC1F_ONEDOT + const uword BC1F_OVFLAG + const uword BC1F_SIGNFLAG + const uword BC1F_SUD + const uword BC1F_SUL + &uword BEAMCON0 + &uword BLTADAT + &uword BLTAFWM + &uword BLTALWM + &uword BLTAMOD + &long BLTAPT + &uword BLTAPTH + &uword BLTAPTL + &uword BLTBDAT + &uword BLTBMOD + &long BLTBPT + &uword BLTBPTH + &uword BLTBPTL + &uword BLTCDAT + &uword BLTCMOD + &uword BLTCON0 + &uword BLTCON0L + &uword BLTCON1 + &long BLTCPT + &uword BLTCPTH + &uword BLTCPTL + &uword BLTDDAT + &uword BLTDMOD + &long BLTDPT + &uword BLTDPTH + &uword BLTDPTL + &uword BLTSIZE + &uword BLTSIZH + &uword BLTSIZV + &uword BPL1DAT + &uword BPL1MOD + &long BPL1PT + &uword BPL1PTH + &uword BPL1PTL + &uword BPL2DAT + &uword BPL2MOD + &long BPL2PT + &uword BPL2PTH + &uword BPL2PTL + &uword BPL3DAT + &long BPL3PT + &uword BPL3PTH + &uword BPL3PTL + &uword BPL4DAT + &long BPL4PT + &uword BPL4PTH + &uword BPL4PTL + &uword BPL5DAT + &long BPL5PT + &uword BPL5PTH + &uword BPL5PTL + &uword BPL6DAT + &long BPL6PT + &uword BPL6PTH + &uword BPL6PTL + &uword BPL7DAT + &long BPL7PT + &uword BPL7PTH + &uword BPL7PTL + &uword BPL8DAT + &long BPL8PT + &uword BPL8PTH + &uword BPL8PTL + &uword BPLCON0 + &uword BPLCON1 + &uword BPLCON2 + &uword BPLCON3 + &uword BPLCON4 + &uword BPLHSTOP + &uword BPLHSTRT + &ubyte CIAA_CRA + &ubyte CIAA_CRB + &ubyte CIAA_DDRA + &ubyte CIAA_DDRB + &ubyte CIAA_ICR + &ubyte CIAA_PRA + &ubyte CIAA_PRB + &ubyte CIAA_SDR + &ubyte CIAA_TAHI + &ubyte CIAA_TALO + &ubyte CIAA_TBHI + &ubyte CIAA_TBLO + &ubyte CIAA_TODHI + &ubyte CIAA_TODLOW + &ubyte CIAA_TODMID + &ubyte CIAB_CRA + &ubyte CIAB_CRB + &ubyte CIAB_DDRA + &ubyte CIAB_DDRB + &ubyte CIAB_ICR + &ubyte CIAB_PRA + &ubyte CIAB_PRB + &ubyte CIAB_SDR + &ubyte CIAB_TAHI + &ubyte CIAB_TALO + &ubyte CIAB_TBHI + &ubyte CIAB_TBLO + &ubyte CIAB_TODHI + &ubyte CIAB_TODLOW + &ubyte CIAB_TODMID + &uword CLXCON + &uword CLXDAT + &uword COLOR00 + &uword COLOR01 + &uword COLOR02 + &uword COLOR03 + &uword COLOR04 + &uword COLOR05 + &uword COLOR06 + &uword COLOR07 + &uword COLOR08 + &uword COLOR09 + &uword COLOR10 + &uword COLOR11 + &uword COLOR12 + &uword COLOR13 + &uword COLOR14 + &uword COLOR15 + &uword COLOR16 + &uword COLOR17 + &uword COLOR18 + &uword COLOR19 + &uword COLOR20 + &uword COLOR21 + &uword COLOR22 + &uword COLOR23 + &uword COLOR24 + &uword COLOR25 + &uword COLOR26 + &uword COLOR27 + &uword COLOR28 + &uword COLOR29 + &uword COLOR30 + &uword COLOR31 + &long COP1LC + &uword COP1LCH + &uword COP1LCL + &long COP2LC + &uword COP2LCH + &uword COP2LCL + &uword COPCON + &uword COPINS + &uword COPJMP1 + &uword COPJMP2 + &uword DDFSTOP + &uword DDFSTRT + &uword DENISEID + &uword DIWHIGH + &uword DIWSTOP + &uword DIWSTRT + &uword DMACON + &uword DMACONR + const uword DMAF_ALL + const uword DMAF_AUD0 + const uword DMAF_AUD1 + const uword DMAF_AUD2 + const uword DMAF_AUD3 + const uword DMAF_AUDIO + const uword DMAF_BLITHOG + const uword DMAF_BLITTER + const uword DMAF_BLTDONE + const uword DMAF_BLTNZERO + const uword DMAF_COPPER + const uword DMAF_DISK + const uword DMAF_MASTER + const uword DMAF_RASTER + const uword DMAF_SETCLR + const uword DMAF_SPRITE + &uword DSKBYTR + &uword DSKDAT + &uword DSKDATR + &uword DSKLEN + &long DSKPT + &uword DSKPTH + &uword DSKPTL + &uword DSKSYNC + &uword FMODE + &uword HBSTOP + &uword HBSTRT + &uword HHPOSR + &uword HHPOSW + &uword HSSTOP + &uword HSSTRT + &uword HTOTAL + &uword INTENA + &uword INTENAR + const uword INTF_AUD0 + const uword INTF_AUD1 + const uword INTF_AUD2 + const uword INTF_AUD3 + const uword INTF_BLIT + const uword INTF_COPER + const uword INTF_DSKBLK + const uword INTF_DSKSYNC + const uword INTF_EXTER + const uword INTF_INTEN + const uword INTF_PORTS + const uword INTF_RBF + const uword INTF_SETCLR + const uword INTF_SOFTINT + const uword INTF_TBE + const uword INTF_VERTB + &uword INTREQ + &uword INTREQR + &uword JOY0DAT + &uword JOY1DAT + &uword JOYTEST + const uword MINTERM_AND + const uword MINTERM_CLEAR + const uword MINTERM_COPY + const uword MINTERM_NOP + const uword MINTERM_NOT + const uword MINTERM_OR + const uword MINTERM_XOR + const uword NABC + const uword NABNC + const uword NANBC + const uword NANBNC + &uword POT0DAT + &uword POT1DAT + &uword POTGO + &uword POTGOR + &uword REFPTR + &uword SERDAT + &uword SERDATR + &uword SERPER + &uword SPR0CTL + &uword SPR0DATA + &uword SPR0DATB + &uword SPR0POS + &long SPR0PT + &uword SPR0PTH + &uword SPR0PTL + &uword SPR1CTL + &uword SPR1DATA + &uword SPR1DATB + &uword SPR1POS + &long SPR1PT + &uword SPR1PTH + &uword SPR1PTL + &uword SPR2CTL + &uword SPR2DATA + &uword SPR2DATB + &uword SPR2POS + &long SPR2PT + &uword SPR2PTH + &uword SPR2PTL + &uword SPR3CTL + &uword SPR3DATA + &uword SPR3DATB + &uword SPR3POS + &long SPR3PT + &uword SPR3PTH + &uword SPR3PTL + &uword SPR4CTL + &uword SPR4DATA + &uword SPR4DATB + &uword SPR4POS + &long SPR4PT + &uword SPR4PTH + &uword SPR4PTL + &uword SPR5CTL + &uword SPR5DATA + &uword SPR5DATB + &uword SPR5POS + &long SPR5PT + &uword SPR5PTH + &uword SPR5PTL + &uword SPR6CTL + &uword SPR6DATA + &uword SPR6DATB + &uword SPR6POS + &long SPR6PT + &uword SPR6PTH + &uword SPR6PTL + &uword SPR7CTL + &uword SPR7DATA + &uword SPR7DATB + &uword SPR7POS + &long SPR7PT + &uword SPR7PTH + &uword SPR7PTL + &uword SPRHDAT + &uword SPRHSTOP + &uword SPRHSTRT + &uword STREQU + &uword STRHOR + &uword STRLONG + &uword STRVBL + &uword VBSTOP + &uword VBSTRT + &uword VHPOSR + &uword VHPOSW + &uword VPOSR + &uword VPOSW + &uword VSSTOP + &uword VSSTRT + &uword VTOTAL + long @shared cpuVBR + bool @shared isPAL + filter_off () + filter_on () + grab_system () + left_button () -> bool + middle_button () -> bool + restore_system () + right_button () -> bool + set_aga_color (ubyte color_index @D0, long rgb24 @D1) clobbers (D0,D1,D2,D3,D4,A0) + set_aga_color_nibbles (ubyte color_index @D0, uword rgb_high_nibbles @D1, uword rgb_low_nibbles @D2) clobbers (D0,D1,D2,D3,A0) + waitvsync () +} + + +LIBRARY MODULE NAME: dos +------------------------ + +dos { + struct DateStampStruct + struct DosPacket + struct ErrorString + struct ExAllControl + struct ExAllData + struct FileHandle + struct FileInfoBlock + struct FileLock + struct InfoData + struct Process + struct StandardPacket + const uword ABORT_BUSY + const uword ABORT_DISK_ERROR + const long ACCESS_READ + const long ACCESS_WRITE + const uword ACTION_ADD_NOTIFY + const uword ACTION_CHANGE_MODE + const uword ACTION_CHANGE_SIGNAL + const ubyte ACTION_COPY_DIR + const uword ACTION_COPY_DIR_FH + const ubyte ACTION_CREATE_DIR + const ubyte ACTION_CURRENT_VOLUME + const ubyte ACTION_DELETE_OBJECT + const ubyte ACTION_DIE + const ubyte ACTION_DISK_CHANGE + const ubyte ACTION_DISK_INFO + const ubyte ACTION_DISK_TYPE + const uword ACTION_END + const ubyte ACTION_EVENT + const uword ACTION_EXAMINE_ALL + const uword ACTION_EXAMINE_ALL_END + const uword ACTION_EXAMINE_FH + const ubyte ACTION_EXAMINE_NEXT + const ubyte ACTION_EXAMINE_OBJECT + const uword ACTION_FH_FROM_LOCK + const uword ACTION_FINDINPUT + const uword ACTION_FINDOUTPUT + const uword ACTION_FINDUPDATE + const ubyte ACTION_FLUSH + const uword ACTION_FORMAT + const ubyte ACTION_FREE_LOCK + const uword ACTION_FREE_RECORD + const ubyte ACTION_GET_BLOCK + const ubyte ACTION_INFO + const ubyte ACTION_INHIBIT + const uword ACTION_IS_FILESYSTEM + const ubyte ACTION_LOCATE_OBJECT + const uword ACTION_LOCK_RECORD + const uword ACTION_MAKE_LINK + const ubyte ACTION_MORE_CACHE + const ubyte ACTION_NIL + const ubyte ACTION_PARENT + const uword ACTION_PARENT_FH + const ubyte ACTION_READ + const uword ACTION_READ_LINK + const uword ACTION_READ_RETURN + const uword ACTION_REMOVE_NOTIFY + const ubyte ACTION_RENAME_DISK + const ubyte ACTION_RENAME_OBJECT + const ubyte ACTION_SAME_LOCK + const uword ACTION_SCREEN_MODE + const uword ACTION_SEEK + const uword ACTION_SERIALIZE_DISK + const ubyte ACTION_SET_COMMENT + const ubyte ACTION_SET_DATE + const uword ACTION_SET_FILE_SIZE + const ubyte ACTION_SET_MAP + const uword ACTION_SET_OWNER + const ubyte ACTION_SET_PROTECT + const ubyte ACTION_STARTUP + const ubyte ACTION_TIMER + const uword ACTION_UNDISK_INFO + const ubyte ACTION_WAIT_CHAR + const ubyte ACTION_WRITE + const uword ACTION_WRITE_PROTECT + const uword ACTION_WRITE_RETURN + const long ADO_CommFileLen + const long ADO_CommNameLen + const long ADO_DirLen + const long ADO_Dummy + const long ADO_FH_Mode + const long ADO_PromptLen + const ubyte APB_DIDDIR + const ubyte APB_DODIR + const ubyte APB_DODOT + const ubyte APB_DOWILD + const ubyte APB_DirChanged + const ubyte APB_FollowHLinks + const ubyte APB_ITSWILD + const ubyte APB_NOMEMERR + const ubyte APF_DIDDIR + const ubyte APF_DODIR + const ubyte APF_DODOT + const ubyte APF_DOWILD + const ubyte APF_DirChanged + const ubyte APF_FollowHLinks + const ubyte APF_ITSWILD + const ubyte APF_NOMEMERR + const ubyte BITSPERBYTE + const ubyte BITSPERLONG + const ubyte BUF_FULL + const ubyte BUF_LINE + const ubyte BUF_NONE + const ubyte BYTESPERLONG + const ubyte CHANGE_FH + const ubyte CHANGE_LOCK + const long CMD_DISABLED + const long CMD_INTERNAL + const long CMD_SYSTEM + const ubyte COMPLEX_BIT + const ubyte DDB_AllBit + const ubyte DDB_Completed + const ubyte DDB_ExaminedBit + const ubyte DDB_PatternBit + const ubyte DDB_SINGLE + const ubyte DDF_AllBit + const ubyte DDF_Completed + const ubyte DDF_ExaminedBit + const ubyte DDF_PatternBit + const ubyte DDF_SINGLE + const ubyte DE_BAUD + const ubyte DE_BLKSPERTRACK + const ubyte DE_BOOTBLOCKS + const ubyte DE_BOOTPRI + const ubyte DE_BUFMEMTYPE + const ubyte DE_CONTROL + const ubyte DE_DOSTYPE + const ubyte DE_INTERLEAVE + const ubyte DE_LOWCYL + const ubyte DE_MASK + const ubyte DE_MAXTRANSFER + const ubyte DE_MEMBUFTYPE + const ubyte DE_NUMBUFFERS + const ubyte DE_NUMHEADS + const ubyte DE_PREFAC + const ubyte DE_RESERVEDBLKS + const ubyte DE_SECORG + const ubyte DE_SECSPERBLK + const ubyte DE_SIZEBLOCK + const ubyte DE_TABLESIZE + const ubyte DE_UPPERCYL + const ubyte DLT_DEVICE + const ubyte DLT_DIRECTORY + const ubyte DLT_LATE + const ubyte DLT_NONBINDING + const long DLT_PRIVATE + const ubyte DLT_VOLUME + const ubyte DOSFALSE + const long DOSTRUE + const ubyte DOS_CLI + const ubyte DOS_EXALLCONTROL + const ubyte DOS_FIB + const ubyte DOS_FILEHANDLE + const ubyte DOS_RDARGS + const ubyte DOS_STDIO_I + const ubyte DOS_STDPKT + const ubyte DTB_FUTURE + const ubyte DTB_SUBST + const ubyte DTF_FUTURE + const ubyte DTF_SUBST + const ubyte DVPB_ASSIGN + const ubyte DVPB_UNLOCK + const ubyte DVPF_ASSIGN + const ubyte DVPF_UNLOCK + const ubyte ED_COMMENT + const ubyte ED_DATE + const ubyte ED_NAME + const ubyte ED_OWNER + const ubyte ED_PROTECTION + const ubyte ED_SIZE + const ubyte ED_TYPE + const long ENDSTREAMCH + const ubyte ENVB_DISABLENSD + const ubyte ENVB_SCSIDIRECT + const ubyte ENVB_SUPERFLOPPY + const long ENVF_DISABLENSD + const long ENVF_SCSIDIRECT + const long ENVF_SUPERFLOPPY + const ubyte ERROR_ACTION_NOT_KNOWN + const ubyte ERROR_BAD_HUNK + const ubyte ERROR_BAD_NUMBER + const ubyte ERROR_BAD_STREAM_NAME + const ubyte ERROR_BAD_TEMPLATE + const uword ERROR_BREAK + const uword ERROR_BUFFER_OVERFLOW + const ubyte ERROR_COMMENT_TOO_BIG + const ubyte ERROR_DELETE_PROTECTED + const ubyte ERROR_DEVICE_NOT_MOUNTED + const ubyte ERROR_DIRECTORY_NOT_EMPTY + const ubyte ERROR_DIR_NOT_FOUND + const ubyte ERROR_DISK_FULL + const ubyte ERROR_DISK_NOT_VALIDATED + const ubyte ERROR_DISK_WRITE_PROTECTED + const ubyte ERROR_FILE_NOT_OBJECT + const ubyte ERROR_INVALID_COMPONENT_NAME + const ubyte ERROR_INVALID_LOCK + const ubyte ERROR_INVALID_RESIDENT_LIBRARY + const ubyte ERROR_IS_SOFT_LINK + const ubyte ERROR_KEY_NEEDS_ARG + const ubyte ERROR_LINE_TOO_LONG + const ubyte ERROR_LOCK_COLLISION + const ubyte ERROR_LOCK_TIMEOUT + const ubyte ERROR_NOT_A_DOS_DISK + const uword ERROR_NOT_EXECUTABLE + const ubyte ERROR_NOT_IMPLEMENTED + const ubyte ERROR_NO_DEFAULT_DIR + const ubyte ERROR_NO_DISK + const ubyte ERROR_NO_FREE_STORE + const ubyte ERROR_NO_MORE_ENTRIES + const ubyte ERROR_OBJECT_EXISTS + const ubyte ERROR_OBJECT_IN_USE + const ubyte ERROR_OBJECT_LINKED + const ubyte ERROR_OBJECT_NOT_FOUND + const ubyte ERROR_OBJECT_TOO_LARGE + const ubyte ERROR_OBJECT_WRONG_TYPE + const ubyte ERROR_READ_PROTECTED + const ubyte ERROR_RECORD_NOT_LOCKED + const ubyte ERROR_RENAME_ACROSS_DEVICES + const ubyte ERROR_REQUIRED_ARG_MISSING + const ubyte ERROR_SEEK_ERROR + const ubyte ERROR_TASK_TABLE_FULL + const ubyte ERROR_TOO_MANY_ARGS + const ubyte ERROR_TOO_MANY_LEVELS + const ubyte ERROR_UNLOCK_ERROR + const ubyte ERROR_UNMATCHED_QUOTES + const ubyte ERROR_WRITE_PROTECTED + const ubyte EXAMINE_BIT + const long EXCLUSIVE_LOCK + const ubyte EXT_ABS + const ubyte EXT_ABSCOMMON + const ubyte EXT_ABSREF16 + const ubyte EXT_ABSREF32 + const ubyte EXT_ABSREF8 + const ubyte EXT_COMMON + const ubyte EXT_COMMONDEF + const ubyte EXT_DEF + const ubyte EXT_DEXT16 + const ubyte EXT_DEXT32 + const ubyte EXT_DEXT8 + const ubyte EXT_REF16 + const ubyte EXT_REF32 + const ubyte EXT_REF8 + const ubyte EXT_RELCOMMON + const ubyte EXT_RELREF16 + const ubyte EXT_RELREF32 + const ubyte EXT_RELREF8 + const ubyte EXT_RES + const ubyte EXT_SYMB + const ubyte FAULT_MAX + const ubyte FIBB_ARCHIVE + const ubyte FIBB_DELETE + const ubyte FIBB_EXECUTE + const ubyte FIBB_GRP_DELETE + const ubyte FIBB_GRP_EXECUTE + const ubyte FIBB_GRP_READ + const ubyte FIBB_GRP_WRITE + const ubyte FIBB_HOLD + const ubyte FIBB_OTR_DELETE + const ubyte FIBB_OTR_EXECUTE + const ubyte FIBB_OTR_READ + const ubyte FIBB_OTR_WRITE + const ubyte FIBB_PURE + const ubyte FIBB_READ + const ubyte FIBB_SCRIPT + const ubyte FIBB_WRITE + const ubyte FIBF_ARCHIVE + const ubyte FIBF_DELETE + const ubyte FIBF_EXECUTE + const uword FIBF_GRP_DELETE + const uword FIBF_GRP_EXECUTE + const uword FIBF_GRP_READ + const uword FIBF_GRP_WRITE + const ubyte FIBF_HOLD + const uword FIBF_OTR_DELETE + const uword FIBF_OTR_EXECUTE + const uword FIBF_OTR_READ + const uword FIBF_OTR_WRITE + const ubyte FIBF_PURE + const ubyte FIBF_READ + const ubyte FIBF_SCRIPT + const ubyte FIBF_WRITE + const ubyte FORMAT_CDN + const ubyte FORMAT_DEF + const ubyte FORMAT_DOS + const ubyte FORMAT_INT + const ubyte FORMAT_MAX + const ubyte FORMAT_USA + const ubyte GVB_BINARY_VAR + const ubyte GVB_DONT_NULL_TERM + const ubyte GVB_GLOBAL_ONLY + const ubyte GVB_LOCAL_ONLY + const ubyte GVB_SAVE_VAR + const uword GVF_BINARY_VAR + const uword GVF_DONT_NULL_TERM + const uword GVF_GLOBAL_ONLY + const uword GVF_LOCAL_ONLY + const uword GVF_SAVE_VAR + const ubyte HUNKB_ADVISORY + const ubyte HUNKB_CHIP + const ubyte HUNKB_FAST + const long HUNKF_ADVISORY + const long HUNKF_CHIP + const long HUNKF_FAST + const uword HUNK_ABSRELOC16 + const uword HUNK_ABSRELOC32 + const uword HUNK_BREAK + const uword HUNK_BSS + const uword HUNK_CODE + const uword HUNK_DATA + const uword HUNK_DEBUG + const uword HUNK_DREL16 + const uword HUNK_DREL32 + const uword HUNK_DREL8 + const uword HUNK_END + const uword HUNK_EXT + const uword HUNK_HEADER + const uword HUNK_INDEX + const uword HUNK_LIB + const uword HUNK_NAME + const uword HUNK_OVERLAY + const uword HUNK_RELOC16 + const uword HUNK_RELOC32 + const uword HUNK_RELOC32SHORT + const uword HUNK_RELOC8 + const uword HUNK_RELRELOC16 + const uword HUNK_RELRELOC32 + const uword HUNK_RELRELOC8 + const uword HUNK_SYMBOL + const uword HUNK_UNIT + const ubyte ID_COMPLONG_FFS_DISK + const ubyte ID_DOS_DISK + const ubyte ID_FASTDIR_DOS_DISK + const ubyte ID_FASTDIR_FFS_DISK + const ubyte ID_FFS_DISK + const ubyte ID_INTER_DOS_DISK + const ubyte ID_INTER_FFS_DISK + const ubyte ID_KICKSTART_DISK + const ubyte ID_LONG_DOS_DISK + const ubyte ID_LONG_FFS_DISK + const ubyte ID_MSDOS_DISK + const ubyte ID_NOT_REALLY_DOS + const long ID_NO_DISK_PRESENT + const ubyte ID_UNREADABLE_DISK + const ubyte ID_VALIDATED + const ubyte ID_VALIDATING + const ubyte ID_WRITE_PROTECTED + const long ITEM_EQUAL + const long ITEM_ERROR + const ubyte ITEM_NOTHING + const ubyte ITEM_QUOTED + const ubyte ITEM_UNQUOTED + const ubyte LDB_ASSIGNS + const ubyte LDB_DELETE + const ubyte LDB_DEVICES + const ubyte LDB_ENTRY + const ubyte LDB_READ + const ubyte LDB_VOLUMES + const ubyte LDB_WRITE + const ubyte LDF_ALL + const ubyte LDF_ASSIGNS + const ubyte LDF_DELETE + const ubyte LDF_DEVICES + const ubyte LDF_ENTRY + const ubyte LDF_READ + const ubyte LDF_VOLUMES + const ubyte LDF_WRITE + const ubyte LEN_DATSTRING + const ubyte LINK_HARD + const ubyte LINK_SOFT + const long LOCK_DIFFERENT + const ubyte LOCK_SAME + const ubyte LOCK_SAME_HANDLER + const ubyte LOCK_SAME_VOLUME + const ubyte LVB_IGNORE + const ubyte LVF_IGNORE + const ubyte LV_ALIAS + const ubyte LV_VAR + const long MAXINT + const ubyte MAX_MULTIARGS + const ubyte MAX_TEMPLATE_ITEMS + const long MININT + const uword MODE_NEWFILE + const uword MODE_OLDFILE + const uword MODE_READWRITE + const long NOTIFY_CLASS + const uword NOTIFY_CODE + const long NP_Arguments + const long NP_Cli + const long NP_CloseError + const long NP_CloseInput + const long NP_CloseOutput + const long NP_CommandName + const long NP_ConsoleTask + const long NP_CopyVars + const long NP_CurrentDir + const long NP_Dummy + const long NP_Entry + const long NP_Error + const long NP_ExitCode + const long NP_ExitData + const long NP_FreeSeglist + const long NP_HomeDir + const long NP_Input + const long NP_Name + const long NP_NotifyOnDeath + const long NP_Output + const long NP_Path + const long NP_Priority + const long NP_Seglist + const long NP_StackSize + const long NP_Synchronous + const long NP_WindowPtr + const ubyte NRB_MAGIC + const ubyte NRB_NOTIFY_INITIAL + const ubyte NRB_SEND_MESSAGE + const ubyte NRB_SEND_SIGNAL + const ubyte NRB_WAIT_REPLY + const long NRF_MAGIC + const ubyte NRF_NOTIFY_INITIAL + const ubyte NRF_SEND_MESSAGE + const ubyte NRF_SEND_SIGNAL + const ubyte NRF_WAIT_REPLY + const long NR_HANDLER_FLAGS + const long OFFSET_BEGINING + const long OFFSET_BEGINNING + const ubyte OFFSET_CURRENT + const ubyte OFFSET_END + const ubyte PRB_CLOSEERROR + const ubyte PRB_CLOSEINPUT + const ubyte PRB_CLOSEOUTPUT + const ubyte PRB_FREEARGS + const ubyte PRB_FREECLI + const ubyte PRB_FREECURRDIR + const ubyte PRB_FREESEGLIST + const ubyte PRF_CLOSEERROR + const ubyte PRF_CLOSEINPUT + const ubyte PRF_CLOSEOUTPUT + const ubyte PRF_FREEARGS + const ubyte PRF_FREECLI + const ubyte PRF_FREECURRDIR + const ubyte PRF_FREESEGLIST + const ubyte P_ANY + const ubyte P_CLASS + const ubyte P_NOT + const ubyte P_NOTCLASS + const ubyte P_NOTEND + const ubyte P_OREND + const ubyte P_ORNEXT + const ubyte P_ORSTART + const ubyte P_REPBEG + const ubyte P_REPEND + const ubyte P_SINGLE + const ubyte P_STOP + const ubyte RDAB_NOALLOC + const ubyte RDAB_NOPROMPT + const ubyte RDAB_STDIN + const ubyte RDAF_NOALLOC + const ubyte RDAF_NOPROMPT + const ubyte RDAF_STDIN + const ubyte REC_EXCLUSIVE + const ubyte REC_EXCLUSIVE_IMMED + const ubyte REC_SHARED + const ubyte REC_SHARED_IMMED + const ubyte REPORT_INSERT + const ubyte REPORT_LOCK + const ubyte REPORT_STREAM + const ubyte REPORT_TASK + const ubyte REPORT_VOLUME + const ubyte RETURN_ERROR + const ubyte RETURN_FAIL + const ubyte RETURN_OK + const ubyte RETURN_WARN + const ubyte RNB_PRIVATE1 + const ubyte RNB_WILDSTAR + const ubyte RNF_PRIVATE1 + const long RNF_WILDSTAR + const long RUN_EXECUTE + const long RUN_SYSTEM + const long RUN_SYSTEM_ASYNCH + const long SHARED_LOCK + const long SHELL_ADDH_LINE + const long SHELL_DUMMY + const long SHELL_FGETS_FULL + const ubyte SIGBREAKB_CTRL_C + const ubyte SIGBREAKB_CTRL_D + const ubyte SIGBREAKB_CTRL_E + const ubyte SIGBREAKB_CTRL_F + const uword SIGBREAKF_CTRL_C + const uword SIGBREAKF_CTRL_D + const uword SIGBREAKF_CTRL_E + const uword SIGBREAKF_CTRL_F + const long ST_FILE + const ubyte ST_LINKDIR + const long ST_LINKFILE + const long ST_PIPEFILE + const ubyte ST_ROOT + const ubyte ST_SOFTLINK + const ubyte ST_USERDIR + const long SYS_Asynch + const long SYS_CmdStream + const long SYS_CustomShell + const long SYS_Dummy + const long SYS_Error + const long SYS_ExecuteInputStream + const long SYS_Input + const long SYS_Output + const long SYS_UserShell + const ubyte TICKS_PER_SECOND + const ubyte reserve + const ubyte vsize + AbortPkt (^^exec.MsgPort port @D1, ^^dos.DosPacket pkt @D2)@bank 2 = -$0108 + AddBuffers (str name @D1, long number @D2) -> long @D0@bank 2 = -$02dc + AddDosEntry (long dlist @D1) -> long @D0@bank 2 = -$02a6 + AddPart (str dirname @D1, str filename @D2, long size @D3) -> bool @D0@bank 2 = -$0372 + AddSegment (str name @D1, long seg @D2, long system @D3) -> long @D0@bank 2 = -$0306 + AllocDosObject (long k_type @D1, long tags @D2) -> long @D0@bank 2 = -$e4 + AssignAdd (str name @D1, long lock @D2) -> bool @D0@bank 2 = -$0276 + AssignLate (str name @D1, str path @D2) -> bool @D0@bank 2 = -$026a + AssignLock (str name @D1, long lock @D2) -> long @D0@bank 2 = -$0264 + AssignPath (str name @D1, str path @D2) -> bool @D0@bank 2 = -$0270 + AttemptLockDosList (long flags @D1) -> long @D0@bank 2 = -$029a + ChangeMode (long k_type @D1, long fh @D2, long newmode @D3) -> long @D0@bank 2 = -$01c2 + CheckSignal (long mask @D1) -> long @D0@bank 2 = -$0318 + Cli () -> long @D0@bank 2 = -$01ec + CliInitNewcli (^^dos.DosPacket dp @A0) -> long @D0@bank 2 = -$03a2 + CliInitRun (^^dos.DosPacket dp @A0) -> long @D0@bank 2 = -$03a8 + Close (long file @D1) -> long @D0@bank 2 = -$24 + CompareDates (^^dos.DateStampStruct date1 @D1, ^^dos.DateStampStruct date2 @D2) -> long @D0@bank 2 = -$02e2 + CreateDir (str name @D1) -> long @D0@bank 2 = -$78 + CreateNewProc (long tags @D1) -> ^^dos.Process @D0@bank 2 = -$01f2 + CreateProc (str name @D1, long pri @D2, long segList @D3, long stackSize @D4) -> ^^exec.MsgPort @D0@bank 2 = -$8a + CurrentDir (long lock @D1) -> long @D0@bank 2 = -$7e + DateStamp (^^dos.DateStampStruct date @D1) -> ^^dos.DateStampStruct @D0@bank 2 = -$c0 + DateToStr (long datetime @D1) -> long @D0@bank 2 = -$02e8 + Delay (long timeout @D1)@bank 2 = -$c6 + DeleteFile (str name @D1) -> long @D0@bank 2 = -$48 + DeleteVar (str name @D1, long flags @D2) -> long @D0@bank 2 = -$0390 + DeviceProc (str name @D1) -> ^^exec.MsgPort @D0@bank 2 = -$ae + DoPkt (^^exec.MsgPort port @D1, long action @D2, long arg1 @D3, long arg2 @D4, long arg3 @D5, long arg4 @D6, long arg5 @D7) -> long @D0@bank 2 = -$f0 + DoShellMethodTagList (long method @D0, long tags @A0) -> long @D0@bank 2 = -$0480 + DupLock (long lock @D1) -> long @D0@bank 2 = -$60 + DupLockFromFH (long fh @D1) -> long @D0@bank 2 = -$0174 + EndNotify (long notify @D1)@bank 2 = -$037e + ErrorOutput () -> long @D0@bank 2 = -$046e + ErrorReport (long code @D1, long k_type @D2, long arg1 @D3, ^^exec.MsgPort device @D4) -> long @D0@bank 2 = -$01e0 + ExAll (long lock @D1, ^^dos.ExAllData buffer @D2, long size @D3, long data @D4, ^^dos.ExAllControl control @D5) -> long @D0@bank 2 = -$01b0 + ExAllEnd (long lock @D1, ^^dos.ExAllData buffer @D2, long size @D3, long data @D4, ^^dos.ExAllControl control @D5)@bank 2 = -$03de + ExNext (long lock @D1, ^^dos.FileInfoBlock fileInfoBlock @D2) -> long @D0@bank 2 = -$6c + Examine (long lock @D1, ^^dos.FileInfoBlock fileInfoBlock @D2) -> long @D0@bank 2 = -$66 + ExamineFH (long fh @D1, ^^dos.FileInfoBlock fib @D2) -> bool @D0@bank 2 = -$0186 + Execute (str string @D1, long file @D2, long file2 @D3) -> long @D0@bank 2 = -$de + Exit (long returnCode @D1)@bank 2 = -$90 + FGetC (long fh @D1) -> long @D0@bank 2 = -$0132 + FGets (long fh @D1, str buf @D2, long buflen @D3) -> str @D0@bank 2 = -$0150 + FPutC (long fh @D1, long ch @D2) -> long @D0@bank 2 = -$0138 + FPuts (long fh @D1, str k_str @D2) -> long @D0@bank 2 = -$0156 + FRead (long fh @D1, long block @D2, long blocklen @D3, long number @D4) -> long @D0@bank 2 = -$0144 + FWrite (long fh @D1, long block @D2, long blocklen @D3, long number @D4) -> long @D0@bank 2 = -$014a + Fault (long code @D1, str header @D2, str buffer @D3, long len @D4) -> bool @D0@bank 2 = -$01d4 + FilePart (str path @D1) -> str @D0@bank 2 = -$0366 + FindArg (str keyword @D1, str arg_template @D2) -> long @D0@bank 2 = -$0324 + FindCliProc (long num @D1) -> ^^dos.Process @D0@bank 2 = -$0222 + FindDosEntry (long dlist @D1, str name @D2, long flags @D3) -> long @D0@bank 2 = -$02ac + FindSegment (str name @D1, long seg @D2, long system @D3) -> long @D0@bank 2 = -$030c + FindVar (str name @D1, long k_type @D2) -> long @D0@bank 2 = -$0396 + Flush (long fh @D1) -> long @D0@bank 2 = -$0168 + Format (str filesystem @D1, str volumename @D2, long dostype @D3) -> bool @D0@bank 2 = -$02ca + FreeArgs (long args @D1)@bank 2 = -$035a + FreeDeviceProc (long dp @D1)@bank 2 = -$0288 + FreeDosEntry (long dlist @D1)@bank 2 = -$02be + FreeDosObject (long k_type @D1, long ptr @D2)@bank 2 = -$ea + GetArgStr () -> str @D0@bank 2 = -$0216 + GetConsoleTask () -> ^^exec.MsgPort @D0@bank 2 = -$01fe + GetCurrentDir () -> long @D0@bank 2 = -$0402 + GetCurrentDirName (str buf @D1, long len @D2) -> bool @D0@bank 2 = -$0234 + GetDeviceProc (str name @D1, long dp @D2) -> long @D0@bank 2 = -$0282 + GetFileSysTask () -> ^^exec.MsgPort @D0@bank 2 = -$020a + GetProgramDir () -> long @D0@bank 2 = -$0258 + GetProgramName (str buf @D1, long len @D2) -> bool @D0@bank 2 = -$0240 + GetPrompt (str buf @D1, long len @D2) -> bool @D0@bank 2 = -$024c + GetVar (str name @D1, str buffer @D2, long size @D3, long flags @D4) -> long @D0@bank 2 = -$038a + Info (long lock @D1, ^^dos.InfoData parameterBlock @D2) -> long @D0@bank 2 = -$72 + Inhibit (str name @D1, long onoff @D2) -> long @D0@bank 2 = -$02d6 + Input () -> long @D0@bank 2 = -$36 + InternalLoadSeg (long fh @D0, long table @A0, long funcarray @A1, long stack @A2) -> long @D0@bank 2 = -$02f4 + InternalUnLoadSeg (long seglist @D1, long freefunc @A1) -> bool @D0@bank 2 = -$02fa + IoErr () -> long @D0@bank 2 = -$84 + IsFileSystem (str name @D1) -> bool @D0@bank 2 = -$02c4 + IsInteractive (long file @D1) -> long @D0@bank 2 = -$d8 + LoadSeg (str name @D1) -> long @D0@bank 2 = -$96 + Lock (str name @D1, long k_type @D2) -> long @D0@bank 2 = -$54 + LockDosList (long flags @D1) -> long @D0@bank 2 = -$028e + LockRecord (long fh @D1, long offset @D2, long length @D3, long mode @D4, long timeout @D5) -> bool @D0@bank 2 = -$010e + LockRecords (long recArray @D1, long timeout @D2) -> bool @D0@bank 2 = -$0114 + MakeDosEntry (str name @D1, long k_type @D2) -> long @D0@bank 2 = -$02b8 + MakeLink (str name @D1, long dest @D2, long soft @D3) -> long @D0@bank 2 = -$01bc + MatchEnd (long anchor @D1)@bank 2 = -$0342 + MatchFirst (str pat @D1, long anchor @D2) -> long @D0@bank 2 = -$0336 + MatchNext (long anchor @D1) -> long @D0@bank 2 = -$033c + MatchPattern (long patbuf @D1, str k_str @D2) -> bool @D0@bank 2 = -$034e + MatchPatternNoCase (long patbuf @D1, str k_str @D2) -> bool @D0@bank 2 = -$03cc + MaxCli () -> long @D0@bank 2 = -$0228 + NameFromFH (long fh @D1, str buffer @D2, long len @D3) -> long @D0@bank 2 = -$0198 + NameFromLock (long lock @D1, str buffer @D2, long len @D3) -> long @D0@bank 2 = -$0192 + NewLoadSeg (str file @D1, long tags @D2) -> long @D0@bank 2 = -$0300 + NextDosEntry (long dlist @D1, long flags @D2) -> long @D0@bank 2 = -$02b2 + Open (str name @D1, long accessMode @D2) -> long @D0@bank 2 = -$1e + OpenFromLock (long lock @D1) -> long @D0@bank 2 = -$017a + Output () -> long @D0@bank 2 = -$3c + ParentDir (long lock @D1) -> long @D0@bank 2 = -$d2 + ParentOfFH (long fh @D1) -> long @D0@bank 2 = -$0180 + ParsePattern (str pat @D1, long patbuf @D2, long patbuflen @D3) -> long @D0@bank 2 = -$0348 + ParsePatternNoCase (str pat @D1, long patbuf @D2, long patbuflen @D3) -> long @D0@bank 2 = -$03c6 + PathPart (str path @D1) -> str @D0@bank 2 = -$036c + PrintFault (long code @D1, str header @D2) -> bool @D0@bank 2 = -$01da + PutErrStr (str k_str @D1) -> long @D0@bank 2 = -$0468 + PutStr (str k_str @D1) -> long @D0@bank 2 = -$03b4 + Read (long file @D1, long buffer @D2, long length @D3) -> long @D0@bank 2 = -$2a + ReadArgs (str arg_template @D1, long array @D2, long args @D3) -> long @D0@bank 2 = -$031e + ReadItem (str name @D1, long maxchars @D2, long cSource @D3) -> long @D0@bank 2 = -$032a + ReadLink (^^exec.MsgPort port @D1, long lock @D2, str path @D3, str buffer @D4, long size @D5) -> long @D0@bank 2 = -$01b6 + Relabel (str drive @D1, str newname @D2) -> long @D0@bank 2 = -$02d0 + RemAssignList (str name @D1, long lock @D2) -> long @D0@bank 2 = -$027c + RemDosEntry (long dlist @D1) -> bool @D0@bank 2 = -$02a0 + RemSegment (long seg @D1) -> long @D0@bank 2 = -$0312 + Rename (str oldName @D1, str newName @D2) -> long @D0@bank 2 = -$4e + ReplyPkt (^^dos.DosPacket dp @D1, long res1 @D2, long res2 @D3)@bank 2 = -$0102 + RunCommand (long seg @D1, long stack @D2, str paramptr @D3, long paramlen @D4) -> long @D0@bank 2 = -$01f8 + SameDevice (long lock1 @D1, long lock2 @D2) -> bool @D0@bank 2 = -$03d8 + SameLock (long lock1 @D1, long lock2 @D2) -> long @D0@bank 2 = -$01a4 + ScanStackToken (long seg @D1, long defaultstack @D2) -> long @D0@bank 2 = -$0486 + Seek (long file @D1, long position @D2, long offset @D3) -> long @D0@bank 2 = -$42 + SelectError (long fh @D1) -> long @D0@bank 2 = -$0474 + SelectInput (long fh @D1) -> long @D0@bank 2 = -$0126 + SelectOutput (long fh @D1) -> long @D0@bank 2 = -$012c + SendPkt (^^dos.DosPacket dp @D1, ^^exec.MsgPort port @D2, ^^exec.MsgPort replyport @D3)@bank 2 = -$f6 + SetArgStr (str string @D1) -> str @D0@bank 2 = -$021c + SetComment (str name @D1, str comment @D2) -> long @D0@bank 2 = -$b4 + SetConsoleTask (^^exec.MsgPort task @D1) -> ^^exec.MsgPort @D0@bank 2 = -$0204 + SetCurrentDirName (str name @D1) -> bool @D0@bank 2 = -$022e + SetFileDate (str name @D1, ^^dos.DateStampStruct date @D2) -> long @D0@bank 2 = -$018c + SetFileSize (long fh @D1, long pos @D2, long mode @D3) -> long @D0@bank 2 = -$01c8 + SetFileSysTask (^^exec.MsgPort task @D1) -> ^^exec.MsgPort @D0@bank 2 = -$0210 + SetIoErr (long result @D1) -> long @D0@bank 2 = -$01ce + SetMode (long fh @D1, long mode @D2) -> long @D0@bank 2 = -$01aa + SetOwner (str name @D1, long owner_info @D2) -> bool @D0@bank 2 = -$03e4 + SetProgramDir (long lock @D1) -> long @D0@bank 2 = -$0252 + SetProgramName (str name @D1) -> bool @D0@bank 2 = -$023a + SetPrompt (str name @D1) -> bool @D0@bank 2 = -$0246 + SetProtection (str name @D1, long protect @D2) -> long @D0@bank 2 = -$ba + SetVBuf (long fh @D1, str buff @D2, long k_type @D3, long size @D4) -> long @D0@bank 2 = -$016e + SetVar (str name @D1, str buffer @D2, long size @D3, long flags @D4) -> bool @D0@bank 2 = -$0384 + SplitName (str name @D1, ubyte separator @D2, str buf @D3, word oldpos @D4, long size @D5) -> word @D0@bank 2 = -$019e + StartNotify (long notify @D1) -> bool @D0@bank 2 = -$0378 + StrToDate (long datetime @D1) -> long @D0@bank 2 = -$02ee + StrToLong (str string @D1, long value @D2) -> long @D0@bank 2 = -$0330 + SystemTagList (str command @D1, long tags @D2) -> long @D0@bank 2 = -$025e + UnGetC (long fh @D1, long character @D2) -> long @D0@bank 2 = -$013e + UnLoadSeg (long seglist @D1)@bank 2 = -$9c + UnLock (long lock @D1)@bank 2 = -$5a + UnLockDosList (long flags @D1)@bank 2 = -$0294 + UnLockRecord (long fh @D1, long offset @D2, long length @D3) -> bool @D0@bank 2 = -$011a + UnLockRecords (long recArray @D1) -> bool @D0@bank 2 = -$0120 + VFPrintf (long fh @D1, str format @D2, long argarray @D3) -> long @D0@bank 2 = -$0162 + VFWritef (long fh @D1, str format @D2, long argarray @D3)@bank 2 = -$015c + VPrintf (str format @D1, long argarray @D2) -> long @D0@bank 2 = -$03ba + VolumeRequestHook (str vol @D1) -> long @D0@bank 2 = -$03f6 + WaitForChar (long file @D1, long timeout @D2) -> long @D0@bank 2 = -$cc + WaitPkt () -> ^^dos.DosPacket @D0@bank 2 = -$fc + Write (long file @D1, long buffer @D2, long length @D3) -> long @D0@bank 2 = -$30 + WriteChars (str buf @D1, long buflen @D2) -> long @D0@bank 2 = -$03ae +} + + +LIBRARY MODULE NAME: exec +------------------------- + +exec { + struct IORequest + struct IOStdReq + struct Interrupt + struct Library + struct List + struct Message + struct MinList + struct MinNode + struct MsgPort + struct Node + struct Task + const long ACPU_AddressErr + const long ACPU_AutoVec1 + const long ACPU_AutoVec2 + const long ACPU_AutoVec3 + const long ACPU_AutoVec4 + const long ACPU_AutoVec5 + const long ACPU_AutoVec6 + const long ACPU_AutoVec7 + const long ACPU_BusErr + const long ACPU_CHK + const long ACPU_DivZero + const long ACPU_Format + const long ACPU_InstErr + const long ACPU_LineA + const long ACPU_LineF + const long ACPU_PrivErr + const long ACPU_Spurious + const long ACPU_TRAPV + const long ACPU_Trace + const ubyte AFB_68010 + const ubyte AFB_68020 + const ubyte AFB_68030 + const ubyte AFB_68040 + const ubyte AFB_68060 + const ubyte AFB_68881 + const ubyte AFB_68882 + const ubyte AFB_FPGA + const ubyte AFB_FPU40 + const ubyte AFB_PRIVATE + const ubyte AFF_68010 + const ubyte AFF_68020 + const ubyte AFF_68030 + const ubyte AFF_68040 + const ubyte AFF_68060 + const ubyte AFF_68881 + const ubyte AFF_68882 + const uword AFF_FPGA + const ubyte AFF_FPU40 + const uword AFF_PRIVATE + const long AG_BadParm + const long AG_CloseDev + const long AG_CloseLib + const long AG_IOError + const long AG_MakeLib + const long AG_NoMemory + const long AG_NoSignal + const long AG_OpenDev + const long AG_OpenLib + const long AG_OpenRes + const long AG_ProcCreate + const long AN_AVLNotImpl + const long AN_AddSWGadget + const long AN_AsyncPkt + const long AN_AudioDev + const long AN_BadChkSum + const long AN_BadExpansionFree + const long AN_BadFreeAddr + const long AN_BadGadget + const long AN_BadInitFunc + const long AN_BadMessage + const long AN_BadOverlay + const long AN_BadQuickInt + const long AN_BadSegList + const long AN_BadSemaphore + const long AN_BadState + const long AN_BaseChkSum + const long AN_BitMap + const long AN_BltBitMap + const long AN_BogusExcpt + const long AN_BootError + const long AN_BootStrap + const long AN_CIARsrc + const long AN_CLIObsolete + const long AN_ConsoleDev + const long AN_CreatePort + const long AN_DOSLib + const long AN_DRHasDisk + const long AN_DRIntNoAct + const long AN_DeadIntui + const long AN_DiskBlkSeq + const long AN_DiskCopy + const long AN_DiskError + const long AN_DiskRsrc + const long AN_DiskfontLib + const long AN_EndTask + const long AN_ExcptVect + const long AN_ExecLib + const long AN_ExpansionLib + const long AN_FileReclosed + const long AN_FreeTwice + const long AN_FreeVec + const long AN_GadTools + const long AN_GadgetType + const long AN_GamePortDev + const long AN_GfxFreeError + const long AN_GfxNewError + const long AN_GfxNoLCM + const long AN_GfxNoMem + const long AN_GfxNoMemMspc + const long AN_GraphicsLib + const long AN_IOAfterClose + const long AN_IOUsedTwice + const long AN_ISemOrder + const long AN_IconLib + const long AN_InitAPtr + const long AN_IntrMem + const long AN_Intuition + const long AN_ItemAlloc + const long AN_ItemBoxTop + const long AN_KeyFree + const long AN_KeyRange + const long AN_KeyboardDev + const long AN_LayersLib + const long AN_LayersNoMem + const long AN_LibChkSum + const long AN_LongFrame + const long AN_MakeVPort + const long AN_MathLib + const long AN_MemCorrupt + const long AN_MemoryInsane + const long AN_MiscRsrc + const long AN_NoConsole + const long AN_NoFonts + const long AN_NoISem + const long AN_NoWindow + const long AN_ObsoleteFont + const long AN_OpenScreen + const long AN_OpenScrnRast + const long AN_OpenWindow + const long AN_PlaneAlloc + const long AN_QPktFail + const long AN_RAMLib + const long AN_RegionMemory + const long AN_SemCorrupt + const long AN_ShortFrame + const long AN_StackProbe + const long AN_StartMem + const long AN_SubAlloc + const long AN_SysScrnType + const long AN_TDCalibSeek + const long AN_TDDelay + const long AN_TMBadReq + const long AN_TMBadSupply + const long AN_TextTmpRas + const long AN_TimerDev + const long AN_TrackDiskDev + const long AN_TreeNotImpl + const long AN_Unknown + const long AN_UtilityLib + const long AN_WBBadIOMsg + const long AN_WBBadStartupMsg1 + const long AN_WBBadStartupMsg2 + const long AN_WBReLayoutToolMenu + const long AN_WeirdEcho + const long AN_Workbench + const long AO_AudioDev + const long AO_BootStrap + const long AO_CIARsrc + const long AO_ConsoleDev + const long AO_DOSLib + const long AO_DiskCopy + const long AO_DiskRsrc + const long AO_DiskfontLib + const long AO_ExecLib + const long AO_ExpansionLib + const long AO_GadTools + const long AO_GamePortDev + const long AO_GraphicsLib + const long AO_IconLib + const long AO_Intuition + const long AO_KeyMapLib + const long AO_KeyboardDev + const long AO_LayersLib + const long AO_MathLib + const long AO_MiscRsrc + const long AO_RAMLib + const long AO_TimerDev + const long AO_TrackDiskDev + const long AO_Unknown + const long AO_UtilityLib + const long AO_Workbench + const long AT_DeadEnd + const long AT_Recovery + const ubyte BELL + const ubyte BS + const ubyte CACRB_ClearD + const ubyte CACRB_ClearI + const ubyte CACRB_CopyBack + const ubyte CACRB_DBE + const ubyte CACRB_EnableD + const ubyte CACRB_EnableE + const ubyte CACRB_EnableI + const ubyte CACRB_FreezeD + const ubyte CACRB_FreezeI + const ubyte CACRB_IBE + const ubyte CACRB_WriteAllocate + const uword CACRF_ClearD + const ubyte CACRF_ClearI + const long CACRF_CopyBack + const uword CACRF_DBE + const uword CACRF_EnableD + const long CACRF_EnableE + const ubyte CACRF_EnableI + const uword CACRF_FreezeD + const ubyte CACRF_FreezeI + const ubyte CACRF_IBE + const uword CACRF_WriteAllocate + const uword CMD_CLEAR + const uword CMD_FLUSH + const uword CMD_INVALID + const uword CMD_NONSTD + const uword CMD_READ + const uword CMD_RESET + const uword CMD_START + const uword CMD_STOP + const uword CMD_UPDATE + const uword CMD_WRITE + const ubyte CR + const ubyte DEL + const ubyte DMAB_Continue + const ubyte DMAB_NoModify + const ubyte DMAB_ReadFromRAM + const ubyte DMAF_Continue + const ubyte DMAF_NoModify + const ubyte DMAF_ReadFromRAM + const ubyte EOS + const long ERR_OPENDEVICE + const ubyte INCLUDE_VERSION + const ubyte INTB_NMI + const uword INTF_NMI + const ubyte IOB_QUICK + const long IOERR_ABORTED + const long IOERR_BADADDRESS + const long IOERR_BADLENGTH + const long IOERR_NOCMD + const long IOERR_OPENFAIL + const long IOERR_SELFTEST + const long IOERR_UNITBUSY + const ubyte IOF_QUICK + const ubyte LF + const ubyte LIBB_CHANGED + const ubyte LIBB_DELEXP + const ubyte LIBB_EXP0CNT + const ubyte LIBB_SUMMING + const ubyte LIBB_SUMUSED + const ubyte LIBF_CHANGED + const ubyte LIBF_DELEXP + const ubyte LIBF_EXP0CNT + const ubyte LIBF_SUMMING + const ubyte LIBF_SUMUSED + const ubyte LIBRARY_MINIMUM + const ubyte LIB_RESERVED + const ubyte LIB_VECTSIZE + const ubyte MEMB_24BITDMA + const ubyte MEMB_CHIP + const ubyte MEMB_CLEAR + const ubyte MEMB_FAST + const ubyte MEMB_KICK + const ubyte MEMB_LARGEST + const ubyte MEMB_LOCAL + const ubyte MEMB_NO_EXPUNGE + const ubyte MEMB_PUBLIC + const ubyte MEMB_REVERSE + const ubyte MEMB_TOTAL + const uword MEMF_24BITDMA + const ubyte MEMF_ANY + const ubyte MEMF_CHIP + const long MEMF_CLEAR + const ubyte MEMF_FAST + const uword MEMF_KICK + const long MEMF_LARGEST + const uword MEMF_LOCAL + const long MEMF_NO_EXPUNGE + const ubyte MEMF_PUBLIC + const long MEMF_REVERSE + const long MEMF_TOTAL + const ubyte MEMHB_RECYCLE + const ubyte MEMHF_RECYCLE + const long MEM_ALL_DONE + const ubyte MEM_BLOCKMASK + const ubyte MEM_BLOCKSIZE + const ubyte MEM_DID_NOTHING + const ubyte MEM_TRY_AGAIN + const ubyte NL + const ubyte NT_BOOTNODE + const ubyte NT_DEATHMESSAGE + const ubyte NT_DEVICE + const ubyte NT_EXTENDED + const ubyte NT_FONT + const ubyte NT_FREEMSG + const ubyte NT_GRAPHICS + const ubyte NT_INTERRUPT + const ubyte NT_KICKMEM + const ubyte NT_LIBRARY + const ubyte NT_MEMORY + const ubyte NT_MESSAGE + const ubyte NT_MSGPORT + const ubyte NT_PROCESS + const ubyte NT_REPLYMSG + const ubyte NT_RESOURCE + const ubyte NT_SEMAPHORE + const ubyte NT_SIGNALSEM + const ubyte NT_SOFTINT + const ubyte NT_TASK + const ubyte NT_UNKNOWN + const ubyte NT_USER + const ubyte PA_IGNORE + const ubyte PA_SIGNAL + const ubyte PA_SOFTINT + const ubyte PF_ACTION + const ubyte RTB_AFTERDOS + const ubyte RTB_AUTOINIT + const ubyte RTB_COLDSTART + const ubyte RTB_SINGLETASK + const uword RTC_MATCHWORD + const ubyte RTF_AFTERDOS + const ubyte RTF_AUTOINIT + const ubyte RTF_COLDSTART + const ubyte RTF_SINGLETASK + const ubyte RTW_COLDSTART + const ubyte RTW_NEVER + const ubyte SB_SAR + const ubyte SB_SINT + const ubyte SB_TQE + const uword SF_SAR + const uword SF_SINT + const uword SF_TQE + const ubyte SIGB_ABORT + const ubyte SIGB_BLIT + const ubyte SIGB_CHILD + const ubyte SIGB_DOS + const ubyte SIGB_INTUITION + const ubyte SIGB_NET + const ubyte SIGB_SINGLE + const ubyte SIGF_ABORT + const ubyte SIGF_BLIT + const ubyte SIGF_CHILD + const uword SIGF_DOS + const ubyte SIGF_INTUITION + const ubyte SIGF_NET + const ubyte SIGF_SINGLE + const ubyte SIH_PRIMASK + const ubyte SIH_QUEUES + const uword SYS_SIGALLOC + const uword SYS_TRAPALLOC + const ubyte TB_ETASK + const ubyte TB_EXCEPT + const ubyte TB_LAUNCH + const ubyte TB_PROCTIME + const ubyte TB_STACKCHK + const ubyte TB_SWITCH + const ubyte TF_ETASK + const ubyte TF_EXCEPT + const ubyte TF_LAUNCH + const ubyte TF_PROCTIME + const ubyte TF_STACKCHK + const ubyte TF_SWITCH + const ubyte TS_ADDED + const ubyte TS_EXCEPT + const ubyte TS_INVALID + const ubyte TS_READY + const ubyte TS_REMOVED + const ubyte TS_RUN + const ubyte TS_WAIT + const ubyte UNITB_ACTIVE + const ubyte UNITB_INTASK + const ubyte UNITF_ACTIVE + const ubyte UNITF_INTASK + AbortIO (long ioRequest @A1)@bank 1 = -$01e0 + AddDevice (long device @A1)@bank 1 = -$01b0 + AddHead (^^exec.List list @A0, ^^exec.Node node @A1)@bank 1 = -$f0 + AddIntServer (long intNumber @D0, ^^exec.Interrupt interrupt @A1)@bank 1 = -$a8 + AddLibrary (^^exec.Library library @A1)@bank 1 = -$018c + AddMemHandler (^^exec.Interrupt memhand @A1)@bank 1 = -$0306 + AddMemList (long size @D0, long attributes @D1, long pri @D2, long base @A0, str name @A1)@bank 1 = -$026a + AddPort (^^exec.MsgPort port @A1)@bank 1 = -$0162 + AddResource (long resource @A1)@bank 1 = -$01e6 + AddSemaphore (long sigSem @A1)@bank 1 = -$0258 + AddTail (^^exec.List list @A0, ^^exec.Node node @A1)@bank 1 = -$f6 + AddTask (^^exec.Task task @A1, long initPC @A2, long finalPC @A3) -> long @D0@bank 1 = -$011a + Alert (long alertNum @D7)@bank 1 = -$6c + AllocAbs (long byteSize @D0, long location @A1) -> long @D0@bank 1 = -$cc + AllocEntry (long entry @A0) -> long @D0@bank 1 = -$de + AllocMem (long byteSize @D0, long requirements @D1) -> long @D0@bank 1 = -$c6 + AllocPooled (long poolHeader @A0, long memSize @D0) -> long @D0@bank 1 = -$02c4 + AllocSignal (byte signalNum @D0) -> byte @D0@bank 1 = -$014a + AllocTrap (long trapNum @D0) -> long @D0@bank 1 = -$0156 + AllocVec (long byteSize @D0, long requirements @D1) -> long @D0@bank 1 = -$02ac + Allocate (long freeList @A0, long byteSize @D0) -> long @D0@bank 1 = -$ba + AttemptSemaphore (long sigSem @A0) -> long @D0@bank 1 = -$0240 + AttemptSemaphoreShared (long sigSem @A0) -> long @D0@bank 1 = -$02d0 + AvailMem (long requirements @D1) -> long @D0@bank 1 = -$d8 + CacheClearE (long address @A0, long length @D0, long caches @D1)@bank 1 = -$0282 + CacheClearU ()@bank 1 = -$027c + CacheControl (long cacheBits @D0, long cacheMask @D1) -> long @D0@bank 1 = -$0288 + CachePostDMA (long address @A0, long length @A1, long flags @D0)@bank 1 = -$0300 + CachePreDMA (long address @A0, long length @A1, long flags @D0) -> long @D0@bank 1 = -$02fa + Cause (^^exec.Interrupt interrupt @A1)@bank 1 = -$b4 + CheckIO (long ioRequest @A1) -> long @D0@bank 1 = -$01d4 + CloseDevice (long ioRequest @A1)@bank 1 = -$01c2 + CloseLibrary (^^exec.Library library @A1)@bank 1 = -$019e + ColdReboot ()@bank 1 = -$02d6 + CopyMem (long source @A0, long dest @A1, long size @D0)@bank 1 = -$0270 + CopyMemQuick (long source @A0, long dest @A1, long size @D0)@bank 1 = -$0276 + CreateIORequest (^^exec.MsgPort port @A0, long size @D0) -> long @D0@bank 1 = -$028e + CreateMsgPort () -> ^^exec.MsgPort @D0@bank 1 = -$029a + CreatePool (long requirements @D0, long puddleSize @D1, long threshSize @D2) -> long @D0@bank 1 = -$02b8 + Deallocate (long freeList @A0, long memoryBlock @A1, long byteSize @D0)@bank 1 = -$c0 + Debug (long flags @D0)@bank 1 = -$72 + DeleteIORequest (long iorequest @A0)@bank 1 = -$0294 + DeleteMsgPort (^^exec.MsgPort port @A0)@bank 1 = -$02a0 + DeletePool (long poolHeader @A0)@bank 1 = -$02be + Disable ()@bank 1 = -$78 + DoIO (long ioRequest @A1) -> byte @D0@bank 1 = -$01c8 + Enable ()@bank 1 = -$7e + Enqueue (^^exec.List list @A0, ^^exec.Node node @A1)@bank 1 = -$010e + FindName (^^exec.List list @A0, str name @A1) -> ^^exec.Node @D0@bank 1 = -$0114 + FindPort (str name @A1) -> ^^exec.MsgPort @D0@bank 1 = -$0186 + FindResident (str name @A1) -> long @D0@bank 1 = -$60 + FindSemaphore (str name @A1) -> long @D0@bank 1 = -$0252 + FindTask (str name @A1) -> ^^exec.Task @D0@bank 1 = -$0126 + Forbid ()@bank 1 = -$84 + FreeEntry (long entry @A0)@bank 1 = -$e4 + FreeMem (long memoryBlock @A1, long byteSize @D0)@bank 1 = -$d2 + FreePooled (long poolHeader @A0, long k_memory @A1, long memSize @D0)@bank 1 = -$02ca + FreeSignal (byte signalNum @D0)@bank 1 = -$0150 + FreeTrap (long trapNum @D0)@bank 1 = -$015c + FreeVec (long memoryBlock @A1)@bank 1 = -$02b2 + GetCC () -> long @D0@bank 1 = -$0210 + GetMsg (^^exec.MsgPort port @A0) -> ^^exec.Message @D0@bank 1 = -$0174 + InitCode (long startClass @D0, long version @D1)@bank 1 = -$48 + InitResident (long resident @A1, long segList @D1) -> long @D0@bank 1 = -$66 + InitSemaphore (long sigSem @A0)@bank 1 = -$022e + InitStruct (long initTable @A1, long k_memory @A2, long size @D0)@bank 1 = -$4e + Insert (^^exec.List list @A0, ^^exec.Node node @A1, ^^exec.Node pred @A2)@bank 1 = -$ea + MakeFunctions (long target @A0, long functionArray @A1, long funcDispBase @A2)@bank 1 = -$5a + MakeLibrary (long funcInit @A0, long structInit @A1, long libInit @A2, long dataSize @D0, long segList @D1) -> ^^exec.Library @D0@bank 1 = -$54 + NewList (^^exec.List list @A0) + NewMinList (^^exec.MinList minlist @A0)@bank 1 = -$033c + ObtainQuickVector (long interruptCode @A0) -> long @D0@bank 1 = -$0312 + ObtainSemaphore (long sigSem @A0)@bank 1 = -$0234 + ObtainSemaphoreList (^^exec.List sigSem @A0)@bank 1 = -$0246 + ObtainSemaphoreShared (long sigSem @A0)@bank 1 = -$02a6 + OldOpenLibrary (str libName @A1) -> ^^exec.Library @D0@bank 1 = -$0198 + OpenDevice (str devName @A0, long unit @D0, long ioRequest @A1, long flags @D1) -> byte @D0@bank 1 = -$01bc + OpenLibrary (str libName @A1, long version @D0) -> ^^exec.Library @D0@bank 1 = -$0228 + OpenResource (str resName @A1) -> long @D0@bank 1 = -$01f2 + Permit ()@bank 1 = -$8a + Procure (long sigSem @A0, long bidMsg @A1) -> long @D0@bank 1 = -$021c + PutMsg (^^exec.MsgPort port @A0, ^^exec.Message message @A1)@bank 1 = -$016e + RawDoFmt (str formatString @A0, long dataStream @A1, long putChProc @A2, long putChData @A3) -> long @D0@bank 1 = -$020a + ReleaseSemaphore (long sigSem @A0)@bank 1 = -$023a + ReleaseSemaphoreList (^^exec.List sigSem @A0)@bank 1 = -$024c + RemDevice (long device @A1)@bank 1 = -$01b6 + RemHead (^^exec.List list @A0) -> ^^exec.Node @D0@bank 1 = -$0102 + RemIntServer (long intNumber @D0, ^^exec.Interrupt interrupt @A1)@bank 1 = -$ae + RemLibrary (^^exec.Library library @A1)@bank 1 = -$0192 + RemMemHandler (^^exec.Interrupt memhand @A1)@bank 1 = -$030c + RemPort (^^exec.MsgPort port @A1)@bank 1 = -$0168 + RemResource (long resource @A1)@bank 1 = -$01ec + RemSemaphore (long sigSem @A1)@bank 1 = -$025e + RemTail (^^exec.List list @A0) -> ^^exec.Node @D0@bank 1 = -$0108 + RemTask (^^exec.Task task @A1)@bank 1 = -$0120 + Remove (^^exec.Node node @A1)@bank 1 = -$fc + ReplyMsg (^^exec.Message message @A1)@bank 1 = -$017a + SendIO (long ioRequest @A1)@bank 1 = -$01ce + SetExcept (long newSignals @D0, long signalSet @D1) -> long @D0@bank 1 = -$0138 + SetFunction (^^exec.Library library @A1, long funcOffset @A0, long newFunction @D0) -> long @D0@bank 1 = -$01a4 + SetIntVector (long intNumber @D0, ^^exec.Interrupt interrupt @A1) -> ^^exec.Interrupt @D0@bank 1 = -$a2 + SetSR (long newSR @D0, long mask @D1) -> long @D0@bank 1 = -$90 + SetSignal (long newSignals @D0, long signalSet @D1) -> long @D0@bank 1 = -$0132 + SetTaskPri (^^exec.Task task @A1, long priority @D0) -> byte @D0@bank 1 = -$012c + Signal (^^exec.Task task @A1, long signalSet @D0)@bank 1 = -$0144 + StackSwap (long newStack @A0)@bank 1 = -$02dc + SumKickData () -> long @D0@bank 1 = -$0264 + SumLibrary (^^exec.Library library @A1)@bank 1 = -$01aa + SuperState () -> long @D0@bank 1 = -$96 + Supervisor (long userFunction @A5) -> long @D0@bank 1 = -$1e + TypeOfMem (long address @A1) -> long @D0@bank 1 = -$0216 + UserState (long sysStack @D0)@bank 1 = -$9c + Vacate (long sigSem @A0, long bidMsg @A1)@bank 1 = -$0222 + Wait (long signalSet @D0) -> long @D0@bank 1 = -$013e + WaitIO (long ioRequest @A1) -> byte @D0@bank 1 = -$01da + WaitPort (^^exec.MsgPort port @A0) -> ^^exec.Message @D0@bank 1 = -$0180 +} + + +LIBRARY MODULE NAME: floats +--------------------------- + +floats { + const float E + const float EPSILON + const float PI + const float TWOPI + const float π + atan (float value @FP0) -> float @FP0 + atan2 (float y, float x) -> float + ceil (float value @FP0) -> float @FP0 + clampf (float value, float minimum, float maximum) -> float + cos (float angle @FP0) -> float @FP0 + cot (float value) -> float + csc (float value) -> float + deg (float angle) -> float + floor (float value @FP0) -> float @FP0 + interpolate (float v, float inputMin, float inputMax, float outputMin, float outputMax) -> float + lerp (float v0, float v1, float t) -> float + lerp_fast (float v0, float v1, float t) -> float + ln (float value @FP0) -> float @FP0 + log2 (float value @FP0) -> float @FP0 + maxf (float f1, float f2) -> float + minf (float f1, float f2) -> float + mod (float value, float divisor) -> float + normalize (float value) -> float + parse (str value @A0) -> float @FP0 + pow (float value @FP0, float power @FP1) -> float @FP0 + print (float value @FP0) + rad (float angle) -> float + rnd () -> float @FP0 + rndseed (float seed @FP0) + round (float value @FP0) -> float @FP0 + secant (float value) -> float + sin (float angle @FP0) -> float @FP0 + tan (float value @FP0) -> float @FP0 + tostr (float value @FP0) -> str @A0 +} + + +LIBRARY MODULE NAME: graphics +----------------------------- + +graphics { + struct AreaInfo + struct BitMap + struct ClipRect + struct ColorMap + struct Layer + struct RastPort + struct TextAttr + struct TextExtent + struct TextFont + struct TmpRas + struct View + const long A2024FIFTEENHERTZ_KEY + const long A2024TENHERTZ_KEY + const long A2024_MONITOR_ID + const ubyte AGNUS + const ubyte ANFRACSIZE + const uword ANIMHALF + const ubyte AVOID_FLICKER + const ubyte BANDWIDTH_1X + const ubyte BANDWIDTH_2XDBL + const ubyte BANDWIDTH_2XNML + const ubyte BANDWIDTH_4X + const ubyte BB_BDRAWN + const ubyte BB_BOBISCOMP + const ubyte BB_BOBNIX + const ubyte BB_BOBSAWAY + const ubyte BB_BWAITING + const ubyte BB_OUTSTEP + const ubyte BB_SAVEBOB + const ubyte BB_SAVEPRESERVE + const uword BF_BDRAWN + const ubyte BF_BOBISCOMP + const uword BF_BOBNIX + const uword BF_BOBSAWAY + const uword BF_BWAITING + const uword BF_OUTSTEP + const ubyte BF_SAVEBOB + const uword BF_SAVEPRESERVE + const long BIDTAG_BlueBits + const long BIDTAG_DIPFMustHave + const long BIDTAG_DIPFMustNotHave + const long BIDTAG_Depth + const long BIDTAG_DesiredHeight + const long BIDTAG_DesiredWidth + const long BIDTAG_GfxPrivate + const long BIDTAG_GreenBits + const long BIDTAG_MonitorID + const long BIDTAG_NominalHeight + const long BIDTAG_NominalWidth + const long BIDTAG_RedBits + const long BIDTAG_SourceID + const long BIDTAG_ViewPort + const ubyte BITCLR + const uword BITSET + const ubyte BLITMSG_FAULT + const ubyte BLITMSG_FAULTn + const long BMATags_Alignment + const long BMATags_BitmapColors + const long BMATags_BitmapColors32 + const long BMATags_BitmapInvisible + const long BMATags_Clear + const long BMATags_ConstantBytesPerRow + const long BMATags_Depth + const long BMATags_DisplayID + const long BMATags_Displayable + const long BMATags_Friend + const long BMATags_ModeHeight + const long BMATags_ModeWidth + const long BMATags_NoMemory + const long BMATags_NoSprite + const long BMATags_PixelFormat + const long BMATags_Private1 + const long BMATags_Private2 + const long BMATags_Private3 + const long BMATags_Private4 + const long BMATags_Private5 + const long BMATags_Private6 + const long BMATags_Private7 + const long BMATags_RenderFunc + const long BMATags_SaveFunc + const long BMATags_UserData + const long BMATags_UserPrivate + const ubyte BMA_DEPTH + const ubyte BMA_FLAGS + const ubyte BMA_HEIGHT + const ubyte BMA_WIDTH + const ubyte BMB_CLEAR + const ubyte BMB_DISPLAYABLE + const ubyte BMB_FRIENDISTAG + const ubyte BMB_HIJACKED + const ubyte BMB_INTERLEAVED + const ubyte BMB_INVALID + const ubyte BMB_MINPLANES + const ubyte BMB_RTGCHECK + const ubyte BMB_RTGTAGS + const ubyte BMB_STANDARD + const uword BMF_CHECKMASK + const uword BMF_CHECKVALUE + const ubyte BMF_CLEAR + const ubyte BMF_DISPLAYABLE + const uword BMF_FRIENDISTAG + const ubyte BMF_HIJACKED + const ubyte BMF_INTERLEAVED + const uword BMF_INVALID + const ubyte BMF_MINPLANES + const uword BMF_RTGCHECK + const uword BMF_RTGTAGS + const ubyte BMF_STANDARD + const ubyte BORDER_BLANKING + const ubyte BORDER_NOTRANSPARENCY + const ubyte BORDER_SPRITES + const uword BUSERFLAGS + const ubyte BUS_16 + const ubyte BUS_32 + const ubyte CMAB_DUALPF_DISABLE + const ubyte CMAB_FULLPALETTE + const ubyte CMAB_NO_COLOR_LOAD + const ubyte CMAB_NO_INTERMED_UPDATE + const ubyte CMAF_DUALPF_DISABLE + const ubyte CMAF_FULLPALETTE + const ubyte CMAF_NO_COLOR_LOAD + const ubyte CMAF_NO_INTERMED_UPDATE + const ubyte CMB_BRDNTRAN + const ubyte CMB_BRDRBLNK + const ubyte CMB_BRDRSPRT + const ubyte CMB_CMTRANS + const ubyte CMB_CPTRANS + const ubyte CMF_BRDNTRAN + const ubyte CMF_BRDRBLNK + const ubyte CMF_BRDRSPRT + const ubyte CMF_CMTRANS + const ubyte CMF_CPTRANS + const ubyte COLORMAP_TRANSPARENCY + const ubyte COLORMAP_TYPE_V1_2 + const ubyte COLORMAP_TYPE_V1_4 + const ubyte COLORMAP_TYPE_V36 + const ubyte COLORMAP_TYPE_V39 + const uword COLORON + const ubyte COLORPLANE_TRANSPARENCY + const ubyte COPPER_MOVE + const ubyte COPPER_WAIT + const ubyte CPRNXTBUF + const uword CPR_NT_LOF + const uword CPR_NT_SHT + const uword CPR_NT_SYS + const ubyte CR_NEEDS_NO_CONCEALED_RASTERS + const ubyte CR_NEEDS_NO_LAYERBLIT_DAMAGE + const ubyte CTB_MAPCOLOR + const ubyte CTF_MAPCOLOR + const uword CT_ANTIALIAS + const uword CT_COLORFONT + const uword CT_GREYFONT + const long DBLNTSCEXTRALORESDPF2FF_KEY + const long DBLNTSCEXTRALORESDPF2LACE_KEY + const long DBLNTSCEXTRALORESDPF2_KEY + const long DBLNTSCEXTRALORESDPFFF_KEY + const long DBLNTSCEXTRALORESDPFLACE_KEY + const long DBLNTSCEXTRALORESDPF_KEY + const long DBLNTSCEXTRALORESEHBFF_KEY + const long DBLNTSCEXTRALORESEHBLACE_KEY + const long DBLNTSCEXTRALORESEHB_KEY + const long DBLNTSCEXTRALORESFF_KEY + const long DBLNTSCEXTRALORESHAMFF_KEY + const long DBLNTSCEXTRALORESHAMLACE_KEY + const long DBLNTSCEXTRALORESHAM_KEY + const long DBLNTSCEXTRALORESLACE_KEY + const long DBLNTSCEXTRALORES_KEY + const long DBLNTSCHIRESDPF2FF_KEY + const long DBLNTSCHIRESDPF2LACE_KEY + const long DBLNTSCHIRESDPF2_KEY + const long DBLNTSCHIRESDPFFF_KEY + const long DBLNTSCHIRESDPFLACE_KEY + const long DBLNTSCHIRESDPF_KEY + const long DBLNTSCHIRESEHBFF_KEY + const long DBLNTSCHIRESEHBLACE_KEY + const long DBLNTSCHIRESEHB_KEY + const long DBLNTSCHIRESFF_KEY + const long DBLNTSCHIRESHAMFF_KEY + const long DBLNTSCHIRESHAMLACE_KEY + const long DBLNTSCHIRESHAM_KEY + const long DBLNTSCHIRESLACE_KEY + const long DBLNTSCHIRES_KEY + const long DBLNTSCLORESDPF2FF_KEY + const long DBLNTSCLORESDPF2LACE_KEY + const long DBLNTSCLORESDPF2_KEY + const long DBLNTSCLORESDPFFF_KEY + const long DBLNTSCLORESDPFLACE_KEY + const long DBLNTSCLORESDPF_KEY + const long DBLNTSCLORESEHBFF_KEY + const long DBLNTSCLORESEHBLACE_KEY + const long DBLNTSCLORESEHB_KEY + const long DBLNTSCLORESFF_KEY + const long DBLNTSCLORESHAMFF_KEY + const long DBLNTSCLORESHAMLACE_KEY + const long DBLNTSCLORESHAM_KEY + const long DBLNTSCLORESLACE_KEY + const long DBLNTSCLORES_KEY + const long DBLNTSC_MONITOR_ID + const long DBLPALEXTRALORESDPF2FF_KEY + const long DBLPALEXTRALORESDPF2LACE_KEY + const long DBLPALEXTRALORESDPF2_KEY + const long DBLPALEXTRALORESDPFFF_KEY + const long DBLPALEXTRALORESDPFLACE_KEY + const long DBLPALEXTRALORESDPF_KEY + const long DBLPALEXTRALORESEHBFF_KEY + const long DBLPALEXTRALORESEHBLACE_KEY + const long DBLPALEXTRALORESEHB_KEY + const long DBLPALEXTRALORESFF_KEY + const long DBLPALEXTRALORESHAMFF_KEY + const long DBLPALEXTRALORESHAMLACE_KEY + const long DBLPALEXTRALORESHAM_KEY + const long DBLPALEXTRALORESLACE_KEY + const long DBLPALEXTRALORES_KEY + const long DBLPALHIRESDPF2LACE_KEY + const long DBLPALHIRESDPF2_KEY + const long DBLPALHIRESDPFLACE_KEY + const long DBLPALHIRESDPF_KEY + const long DBLPALHIRESEHBFF_KEY + const long DBLPALHIRESEHBLACE_KEY + const long DBLPALHIRESEHB_KEY + const long DBLPALHIRESFF_KEY + const long DBLPALHIRESHAMFF_KEY + const long DBLPALHIRESHAMLACE_KEY + const long DBLPALHIRESHAM_KEY + const long DBLPALHIRESLACE_KEY + const long DBLPALHIRES_KEY + const long DBLPALLORESDPF2LACE_KEY + const long DBLPALLORESDPF2_KEY + const long DBLPALLORESDPFLACE_KEY + const long DBLPALLORESDPF_KEY + const long DBLPALLORESEHBFF_KEY + const long DBLPALLORESEHBLACE_KEY + const long DBLPALLORESEHB_KEY + const long DBLPALLORESFF_KEY + const long DBLPALLORESHAMFF_KEY + const long DBLPALLORESHAMLACE_KEY + const long DBLPALLORESHAM_KEY + const long DBLPALLORESLACE_KEY + const long DBLPALLORES_KEY + const long DBLPAL_MONITOR_ID + const uword DBLPF + const ubyte DBL_CAS + const long DEFAULT_MONITOR_ID + const ubyte DENISE + const ubyte DFTCH_MASK + const long DIPF_IS_AA + const long DIPF_IS_BEAMSYNC + const long DIPF_IS_DBUFFER + const long DIPF_IS_DRAGGABLE + const long DIPF_IS_DUALPF + const long DIPF_IS_ECS + const long DIPF_IS_EXTRAHALFBRITE + const long DIPF_IS_FOREIGN + const long DIPF_IS_GENLOCK + const long DIPF_IS_HAM + const long DIPF_IS_LACE + const long DIPF_IS_PAL + const long DIPF_IS_PANELLED + const long DIPF_IS_PF2PRI + const long DIPF_IS_PROGBEAM + const long DIPF_IS_SCANDBL + const long DIPF_IS_SPRITES + const long DIPF_IS_SPRITES_ATT + const long DIPF_IS_SPRITES_BORDER + const long DIPF_IS_SPRITES_CHNG_BASE + const long DIPF_IS_SPRITES_CHNG_PRI + const long DIPF_IS_SPRITES_CHNG_RES + const long DIPF_IS_WB + const ubyte DISPLAYNAMELEN + const ubyte DIW_HORIZ_POS + const uword DIW_VRTCL_POS + const ubyte DIW_VRTCL_POS_SHIFT + const uword DI_AVAIL_NOCHIPS + const uword DI_AVAIL_NOMONITOR + const uword DI_AVAIL_NOTWITHGENLOCK + const long DTAG_DIMS + const long DTAG_DISP + const long DTAG_MNTR + const long DTAG_NAME + const long DTAG_VEC + const long EURO36_MONITOR_ID + const long EURO72EHBLACE_KEY + const long EURO72EHB_KEY + const long EURO72EXTRAHALFBRITELACE_KEY + const long EURO72EXTRAHALFBRITE_KEY + const long EURO72EXTRALORESDBL_KEY + const long EURO72EXTRALORESDPF2_KEY + const long EURO72EXTRALORESDPF_KEY + const long EURO72EXTRALORESEHBDBL_KEY + const long EURO72EXTRALORESEHBLACE_KEY + const long EURO72EXTRALORESEHB_KEY + const long EURO72EXTRALORESHAMDBL_KEY + const long EURO72EXTRALORESHAMLACE_KEY + const long EURO72EXTRALORESHAM_KEY + const long EURO72EXTRALORESLACEDPF2_KEY + const long EURO72EXTRALORESLACEDPF_KEY + const long EURO72EXTRALORESLACE_KEY + const long EURO72EXTRALORES_KEY + const long EURO72HAMLACE_KEY + const long EURO72HAM_KEY + const long EURO72LORESDBL_KEY + const long EURO72LORESDPF2_KEY + const long EURO72LORESDPF_KEY + const long EURO72LORESEHBDBL_KEY + const long EURO72LORESEHBLACE_KEY + const long EURO72LORESEHB_KEY + const long EURO72LORESHAMDBL_KEY + const long EURO72LORESHAMLACE_KEY + const long EURO72LORESHAM_KEY + const long EURO72LORESLACEDPF2_KEY + const long EURO72LORESLACEDPF_KEY + const long EURO72LORESLACE_KEY + const long EURO72LORES_KEY + const long EURO72PRODUCTDBL_KEY + const long EURO72PRODUCTDPF2_KEY + const long EURO72PRODUCTDPF_KEY + const long EURO72PRODUCTEHBDBL_KEY + const long EURO72PRODUCTHAMDBL_KEY + const long EURO72PRODUCTHAMLACE_KEY + const long EURO72PRODUCTHAM_KEY + const long EURO72PRODUCTLACEDPF2_KEY + const long EURO72PRODUCTLACEDPF_KEY + const long EURO72PRODUCTLACE_KEY + const long EURO72PRODUCT_KEY + const long EURO72_MONITOR_ID + const ubyte EXACT_LINE + const uword EXTEND_VSTRUCT + const long EXTRAHALFBRITELACE_KEY + const long EXTRAHALFBRITE_KEY + const ubyte FPB_DESIGNED + const ubyte FPB_DISKFONT + const ubyte FPB_PROPORTIONAL + const ubyte FPB_REMOVED + const ubyte FPB_REVPATH + const ubyte FPB_ROMFONT + const ubyte FPB_TALLDOT + const ubyte FPB_WIDEDOT + const ubyte FPF_DESIGNED + const ubyte FPF_DISKFONT + const ubyte FPF_PROPORTIONAL + const ubyte FPF_REMOVED + const ubyte FPF_REVPATH + const ubyte FPF_ROMFONT + const ubyte FPF_TALLDOT + const ubyte FPF_WIDEDOT + const ubyte FRST_DOT + const ubyte FRST_DOTn + const ubyte FSB_BOLD + const ubyte FSB_COLORFONT + const ubyte FSB_EXTENDED + const ubyte FSB_ITALIC + const ubyte FSB_TAGGED + const ubyte FSB_UNDERLINED + const ubyte FSF_BOLD + const ubyte FSF_COLORFONT + const ubyte FSF_EXTENDED + const ubyte FSF_ITALIC + const ubyte FSF_TAGGED + const ubyte FSF_UNDERLINED + const ubyte FS_NORMAL + const ubyte GBFLAGSB_LASTBLIT + const ubyte GBFLAGSB_TIMER + const ubyte GBFLAGSF_LASTBLIT + const ubyte GBFLAGSF_TIMER + const ubyte GENLOC + const uword GENLOCK_AUDIO + const ubyte GENLOCK_VIDEO + const ubyte GENLOCn + const ubyte GFXB_AA_ALICE + const ubyte GFXB_AA_LISA + const ubyte GFXB_AA_MLISA + const ubyte GFXB_BIG_BLITS + const ubyte GFXB_HR_AGNUS + const ubyte GFXB_HR_DENISE + const ubyte GFXF_AA_ALICE + const ubyte GFXF_AA_LISA + const ubyte GFXF_AA_MLISA + const ubyte GFXF_BIG_BLITS + const ubyte GFXF_HR_AGNUS + const ubyte GFXF_HR_DENISE + const ubyte GRAPHICS_GFXNODES_I + const long GSTAG_ATTACHED + const long GSTAG_SCANDOUBLED + const long GSTAG_SOFTSPRITE + const long GSTAG_SPRITE_NUM + const ubyte HALF_LINE + const long HAMLACE_KEY + const long HAM_KEY + const long HIRESDPF2_KEY + const long HIRESDPF_KEY + const long HIRESEHBLACE_KEY + const long HIRESEHB_KEY + const long HIRESHAMLACE_KEY + const long HIRESHAMSDBL_KEY + const long HIRESHAM_KEY + const long HIRESLACEDPF2_KEY + const long HIRESLACEDPF_KEY + const long HIRESLACE_KEY + const long HIRES_KEY + const uword HOLDNMODIFY + const ubyte IGNORE_MCOMPAT + const ubyte INTERLACE + const ubyte ISGRTRX + const ubyte ISGRTRY + const ubyte ISLESSX + const ubyte ISLESSY + const ubyte LAYERBACKDROP + const uword LAYERHIDDEN + const uword LAYERIREFRESH + const uword LAYERIREFRESH2 + const ubyte LAYERREFRESH + const uword LAYERSAVEBACK + const ubyte LAYERSIMPLE + const ubyte LAYERSMART + const ubyte LAYERSUPER + const ubyte LAYERS_BACKFILL + const ubyte LAYERS_NOBACKFILL + const ubyte LAYERUPDATING + const ubyte LAYER_BACKMOST + const uword LAYER_CLIPRECTS_LOST + const ubyte LAYER_FRONTMOST + const long LORESDPF2_KEY + const long LORESDPF_KEY + const long LORESEHBSDBL_KEY + const long LORESHAMSDBL_KEY + const long LORESLACEDPF2_KEY + const long LORESLACEDPF_KEY + const long LORESLACE_KEY + const long LORESSDBL_KEY + const long LORES_KEY + const ubyte LPEN_SWAP_FRAMES + const ubyte LPEN_SWAP_FRAMESn + const uword MAXFONTMATCHWEIGHT + const ubyte MCOMPAT_MIXED + const long MCOMPAT_NOBODY + const ubyte MCOMPAT_SELF + const ubyte MCOP_NOP + const ubyte MCOP_NO_MEM + const ubyte MCOP_OK + const uword MODE_640 + const long MONITOR_ID_MASK + const ubyte MONITOR_SPEC_TYPE + const ubyte MSB_DOUBLE_SPRITES + const ubyte MSB_REQUEST_A2024 + const ubyte MSB_REQUEST_NTSC + const ubyte MSB_REQUEST_PAL + const ubyte MSB_REQUEST_SPECIAL + const ubyte MSF_DOUBLE_SPRITES + const ubyte MSF_REQUEST_A2024 + const ubyte MSF_REQUEST_NTSC + const ubyte MSF_REQUEST_PAL + const ubyte MSF_REQUEST_SPECIAL + const uword MUST_FLAGS + const ubyte MVP_NO_DISPLAY + const ubyte MVP_NO_DSPINS + const ubyte MVP_NO_MEM + const ubyte MVP_NO_VPE + const ubyte MVP_OFF_BOTTOM + const ubyte MVP_OK + const ubyte NEWLAYERINFO_CALLED + const ubyte NEWLOCKS + const ubyte NML_CAS + const ubyte NTSC + const long NTSC_MONITOR_ID + const ubyte NTSCn + const long OBP_FailIfBad + const long OBP_Precision + const ubyte ONE_DOT + const ubyte ONE_DOTn + const ubyte OWNBLITTERn + const ubyte PAL + const long PAL_MONITOR_ID + const ubyte PALn + const ubyte PENB_EXCLUSIVE + const ubyte PENB_NO_SETCOLOR + const ubyte PENF_EXCLUSIVE + const ubyte PENF_NO_SETCOLOR + const ubyte PEN_EXCLUSIVE + const ubyte PEN_NO_SETCOLOR + const ubyte PF2PRI + const ubyte PFA_FINE_SCROLL + const ubyte PFB_FINE_SCROLL_SHIFT + const ubyte PF_FINE_SCROLL_MASK + const ubyte PLNCNTMSK + const ubyte PLNCNTSHFT + const long PRECISION_EXACT + const ubyte PRECISION_GUI + const ubyte PRECISION_ICON + const ubyte PRECISION_IMAGE + const ubyte PRESERVE_COLORS + const long PROTO_MONITOR_ID + const ubyte QBOWNER + const ubyte QBOWNERn + const ubyte REALLY_PAL + const ubyte REALLY_PALn + const uword RINGTRIGGER + const ubyte RPB_AREAOUTLINE + const ubyte RPB_DBUFFER + const ubyte RPB_FRST_DOT + const ubyte RPB_NOCROSSFILL + const ubyte RPB_ONE_DOT + const ubyte RPB_TXSCALE + const ubyte RPF_AREAOUTLINE + const ubyte RPF_DBUFFER + const ubyte RPF_FRST_DOT + const ubyte RPF_NOCROSSFILL + const ubyte RPF_ONE_DOT + const ubyte RPF_TXSCALE + const long RPTAG_APen + const long RPTAG_BPen + const long RPTAG_DrMd + const long RPTAG_DrawBounds + const long RPTAG_Font + const long RPTAG_MaxPen + const long RPTAG_OutLinePen + const long RPTAG_OutlinePen + const long RPTAG_WriteMask + const ubyte RP_COMPLEMENT + const ubyte RP_INVERSVID + const ubyte RP_JAM1 + const ubyte RP_JAM2 + const ubyte SETCHIPREV_A + const ubyte SETCHIPREV_AA + const long SETCHIPREV_BEST + const ubyte SETCHIPREV_ECS + const ubyte SPECIAL_MONITOR_TYPE + const long SPRITEA_Attached + const long SPRITEA_OldDataFormat + const long SPRITEA_OutputHeight + const long SPRITEA_Width + const long SPRITEA_XReplication + const long SPRITEA_YReplication + const ubyte SPRITERESN_140NS + const ubyte SPRITERESN_35NS + const ubyte SPRITERESN_70NS + const long SPRITERESN_DEFAULT + const ubyte SPRITERESN_ECS + const ubyte SS_GRAPHICS + const ubyte STANDARD_VIEW_X + const ubyte STANDARD_VIEW_Y + const long SUPER72HIRESDBL_KEY + const long SUPER72HIRESEHBDBL_KEY + const long SUPER72HIRESHAMDBL_KEY + const long SUPER72LORESDBL_KEY + const long SUPER72LORESEHBDBL_KEY + const long SUPER72LORESHAMDBL_KEY + const long SUPER72SUPERDBL_KEY + const long SUPER72SUPEREHBDBL_KEY + const long SUPER72SUPERHAMDBL_KEY + const long SUPER72_MONITOR_ID + const long SUPERDPF2_KEY + const long SUPERDPF_KEY + const long SUPEREHBLACE_KEY + const long SUPEREHB_KEY + const long SUPERHAMLACE_KEY + const long SUPERHAM_KEY + const long SUPERLACEDPF2_KEY + const long SUPERLACEDPF_KEY + const long SUPERLACE_KEY + const long SUPER_KEY + const uword SUSERFLAGS + const long TA_DeviceDPI + const ubyte TE0B_NOREMFONT + const ubyte TE0F_NOREMFONT + const ubyte TODA_SAFE + const ubyte TODA_SAFEn + const ubyte USER_COPPER_CLIP + const long VC_DUALPF_Disable + const long VC_DUALPF_Disable_Query + const long VC_IntermediateCLUpdate + const long VC_IntermediateCLUpdate_Query + const long VC_NoColorPaletteLoad + const long VC_NoColorPaletteLoad_Query + const long VGAEHBLACE_KEY + const long VGAEHB_KEY + const long VGAEXTRAHALFBRITELACE_KEY + const long VGAEXTRAHALFBRITE_KEY + const long VGAEXTRALORESDPF2_KEY + const long VGAEXTRALORESDPF_KEY + const long VGAEXTRALORESEHBLACE_KEY + const long VGAEXTRALORESEHB_KEY + const long VGAEXTRALORESHAMLACE_KEY + const long VGAEXTRALORESHAM_KEY + const long VGAEXTRALORESLACEDPF2_KEY + const long VGAEXTRALORESLACEDPF_KEY + const long VGAEXTRALORESLACE_KEY + const long VGAEXTRALORES_KEY + const long VGAHAMLACE_KEY + const long VGAHAM_KEY + const long VGALORESDPF2_KEY + const long VGALORESDPF_KEY + const long VGALORESEHBLACE_KEY + const long VGALORESEHB_KEY + const long VGALORESHAMLACE_KEY + const long VGALORESHAM_KEY + const long VGALORESLACEDPF2_KEY + const long VGALORESLACEDPF_KEY + const long VGALORESLACE_KEY + const long VGALORES_KEY + const long VGAPRODUCTDPF2_KEY + const long VGAPRODUCTDPF_KEY + const long VGAPRODUCTHAMLACE_KEY + const long VGAPRODUCTHAM_KEY + const long VGAPRODUCTLACEDPF2_KEY + const long VGAPRODUCTLACEDPF_KEY + const long VGAPRODUCTLACE_KEY + const long VGAPRODUCT_KEY + const long VGA_MONITOR_ID + const ubyte VIDEOCONTROL_BATCH + const ubyte VIEWPORT_EXTRA_TYPE + const ubyte VIEW_EXTRA_TYPE + const ubyte VPB_A2024 + const ubyte VPB_TENHZ + const ubyte VPF_A2024 + const ubyte VPF_TENHZ + const uword VPOSRLOF + const ubyte VPXB_FREE_ME + const ubyte VPXB_STRADDLES_256 + const ubyte VPXB_STRADDLES_512 + const ubyte VPXB_VP_LAST + const ubyte VPXF_FREE_ME + const ubyte VPXF_STRADDLES_256 + const ubyte VPXF_STRADDLES_512 + const ubyte VPXF_VP_LAST + const ubyte VSB_BACKSAVED + const ubyte VSB_BOBUPDATE + const ubyte VSB_GELGONE + const ubyte VSB_MUSTDRAW + const ubyte VSB_OVERLAY + const ubyte VSB_SAVEBACK + const ubyte VSB_VSOVERFLOW + const ubyte VSB_VSPRITE + const uword VSF_BACKSAVED + const uword VSF_BOBUPDATE + const uword VSF_GELGONE + const ubyte VSF_MUSTDRAW + const ubyte VSF_OVERLAY + const ubyte VSF_SAVEBACK + const uword VSF_VSOVERFLOW + const ubyte VSF_VSPRITE + const long VTAG_ATTACH_CM_GET + const long VTAG_ATTACH_CM_SET + const long VTAG_BATCH_CM_CLR + const long VTAG_BATCH_CM_GET + const long VTAG_BATCH_CM_SET + const long VTAG_BATCH_ITEMS_ADD + const long VTAG_BATCH_ITEMS_GET + const long VTAG_BATCH_ITEMS_SET + const long VTAG_BITPLANEKEY_CLR + const long VTAG_BITPLANEKEY_GET + const long VTAG_BITPLANEKEY_SET + const long VTAG_BORDERBLANK_CLR + const long VTAG_BORDERBLANK_GET + const long VTAG_BORDERBLANK_SET + const long VTAG_BORDERNOTRANS_CLR + const long VTAG_BORDERNOTRANS_GET + const long VTAG_BORDERNOTRANS_SET + const long VTAG_BORDERSPRITE_CLR + const long VTAG_BORDERSPRITE_GET + const long VTAG_BORDERSPRITE_SET + const long VTAG_CHROMAKEY_CLR + const long VTAG_CHROMAKEY_GET + const long VTAG_CHROMAKEY_SET + const long VTAG_CHROMA_PEN_CLR + const long VTAG_CHROMA_PEN_GET + const long VTAG_CHROMA_PEN_SET + const long VTAG_CHROMA_PLANE_GET + const long VTAG_CHROMA_PLANE_SET + const long VTAG_COERCE_DISP_GET + const long VTAG_COERCE_DISP_SET + const long VTAG_DEFSPRITERESN_GET + const long VTAG_DEFSPRITERESN_SET + const long VTAG_END_CM + const long VTAG_FULLPALETTE_CLR + const long VTAG_FULLPALETTE_GET + const long VTAG_FULLPALETTE_SET + const long VTAG_IMMEDIATE + const long VTAG_NEXTBUF_CM + const long VTAG_NORMAL_DISP_GET + const long VTAG_NORMAL_DISP_SET + const long VTAG_PF1_BASE_GET + const long VTAG_PF1_BASE_SET + const long VTAG_PF1_TO_SPRITEPRI_GET + const long VTAG_PF1_TO_SPRITEPRI_SET + const long VTAG_PF2_BASE_GET + const long VTAG_PF2_BASE_SET + const long VTAG_PF2_TO_SPRITEPRI_GET + const long VTAG_PF2_TO_SPRITEPRI_SET + const long VTAG_SPEVEN_BASE_GET + const long VTAG_SPEVEN_BASE_SET + const long VTAG_SPODD_BASE_GET + const long VTAG_SPODD_BASE_SET + const long VTAG_SPRITERESN_GET + const long VTAG_SPRITERESN_SET + const long VTAG_USERCLIP_CLR + const long VTAG_USERCLIP_GET + const long VTAG_USERCLIP_SET + const long VTAG_VIEWPORTEXTRA_GET + const long VTAG_VIEWPORTEXTRA_SET + const long VTAG_VPMODEID_CLR + const long VTAG_VPMODEID_GET + const long VTAG_VPMODEID_SET + const ubyte V_DOUBLESCAN + const uword V_DUALPF + const uword V_EXTENDED_MODE + const ubyte V_EXTRA_HALFBRITE + const uword V_HAM + const uword V_HIRES + const ubyte V_LACE + const ubyte V_PFBA + const uword V_SPRITES + const ubyte V_SUPERHIRES + const uword V_VP_HIDE + AddAnimOb (long anOb @A0, long anKey @A1, ^^graphics.RastPort rp @A2)@bank 3 = -$9c + AddBob (long bob @A0, ^^graphics.RastPort rp @A1)@bank 3 = -$60 + AddFont (^^graphics.TextFont textFont @A1)@bank 3 = -$01e0 + AddVSprite (long vSprite @A0, ^^graphics.RastPort rp @A1)@bank 3 = -$66 + AllocBitMap (long sizex @D0, long sizey @D1, long depth @D2, long flags @D3, ^^graphics.BitMap friend_bitmap @A0) -> ^^graphics.BitMap @D0@bank 3 = -$0396 + AllocDBufInfo (long vp @A0) -> long @D0@bank 3 = -$03c6 + AllocRaster (uword width @D0, uword height @D1) -> long @D0@bank 3 = -$01ec + AllocSpriteDataA (^^graphics.BitMap bm @A2, long tags @A1) -> long @D0@bank 3 = -$03fc + AndRectRegion (long region @A0, long rectangle @A1)@bank 3 = -$01f8 + AndRegionRegion (long srcRegion @A0, long destRegion @A1) -> bool @D0@bank 3 = -$0270 + Animate (long anKey @A0, ^^graphics.RastPort rp @A1)@bank 3 = -$a2 + AreaDraw (^^graphics.RastPort rp @A1, word x @D0, word y @D1) -> long @D0@bank 3 = -$0102 + AreaEllipse (^^graphics.RastPort rp @A1, word xCenter @D0, word yCenter @D1, word a @D2, word b @D3) -> long @D0@bank 3 = -$ba + AreaEnd (^^graphics.RastPort rp @A1) -> long @D0@bank 3 = -$0108 + AreaMove (^^graphics.RastPort rp @A1, word x @D0, word y @D1) -> long @D0@bank 3 = -$fc + AskFont (^^graphics.RastPort rp @A1, ^^graphics.TextAttr textAttr @A0)@bank 3 = -$01da + AskSoftStyle (^^graphics.RastPort rp @A1) -> long @D0@bank 3 = -$54 + AttachPalExtra (^^graphics.ColorMap cm @A0, long vp @A1) -> long @D0@bank 3 = -$0342 + AttemptLockLayerRom (^^graphics.Layer layer @A5) -> bool @D0@bank 3 = -$028e + BestModeIDA (long tags @A0) -> long @D0@bank 3 = -$041a + BitMapScale (long bitScaleArgs @A0)@bank 3 = -$02a6 + BltBitMap (^^graphics.BitMap srcBitMap @A0, word xSrc @D0, word ySrc @D1, ^^graphics.BitMap destBitMap @A1, word xDest @D2, word yDest @D3, word xSize @D4, word ySize @D5, ubyte minterm @D6, ubyte mask @D7, long tempA @A2) -> long @D0@bank 3 = -$1e + BltBitMapRastPort (^^graphics.BitMap srcBitMap @A0, word xSrc @D0, word ySrc @D1, ^^graphics.RastPort destRP @A1, word xDest @D2, word yDest @D3, word xSize @D4, word ySize @D5, ubyte minterm @D6)@bank 3 = -$025e + BltClear (long memBlock @A1, long byteCount @D0, long flags @D1)@bank 3 = -$012c + BltMaskBitMapRastPort (^^graphics.BitMap srcBitMap @A0, word xSrc @D0, word ySrc @D1, ^^graphics.RastPort destRP @A1, word xDest @D2, word yDest @D3, word xSize @D4, word ySize @D5, ubyte minterm @D6, long bltMask @A2)@bank 3 = -$027c + BltPattern (^^graphics.RastPort rp @A1, long mask @A0, word xMin @D0, word yMin @D1, word xMax @D2, word yMax @D3, uword maskBPR @D4)@bank 3 = -$0138 + BltTemplate (long source @A0, word xSrc @D0, word srcMod @D1, ^^graphics.RastPort destRP @A1, word xDest @D2, word yDest @D3, word xSize @D4, word ySize @D5)@bank 3 = -$24 + CBump (long copList @A1)@bank 3 = -$016e + CMove (long copList @A1, long destination @D0, word data @D1) -> long @D0@bank 3 = -$0174 + CWait (long copList @A1, word v @D0, word h @D1) -> long @D0@bank 3 = -$017a + CalcIVG (^^graphics.View v @A0, long vp @A1) -> uword @D0@bank 3 = -$033c + ChangeExtSpriteA (long vp @A0, long oldsprite @A1, long newsprite @A2, long tags @A3) -> long @D0@bank 3 = -$0402 + ChangeSprite (long vp @A0, long sprite @A1, long newData @A2)@bank 3 = -$01a4 + ChangeVPBitMap (long vp @A0, ^^graphics.BitMap bm @A1, long db @A2)@bank 3 = -$03ae + ClearEOL (^^graphics.RastPort rp @A1)@bank 3 = -$2a + ClearRectRegion (long region @A0, long rectangle @A1) -> bool @D0@bank 3 = -$020a + ClearRegion (long region @A0)@bank 3 = -$0210 + ClearScreen (^^graphics.RastPort rp @A1)@bank 3 = -$30 + ClipBlit (^^graphics.RastPort srcRP @A0, word xSrc @D0, word ySrc @D1, ^^graphics.RastPort destRP @A1, word xDest @D2, word yDest @D3, word xSize @D4, word ySize @D5, ubyte minterm @D6)@bank 3 = -$0228 + CloseFont (^^graphics.TextFont textFont @A1)@bank 3 = -$4e + CloseMonitor (long monitorSpec @A0) -> bool @D0@bank 3 = -$02d0 + CoerceMode (long vp @A0, long monitorid @D0, long flags @D1) -> long @D0@bank 3 = -$03a8 + CopySBitMap (^^graphics.Layer layer @A0)@bank 3 = -$01c2 + DisownBlitter ()@bank 3 = -$01ce + DisposeRegion (long region @A0)@bank 3 = -$0216 + DoCollision (^^graphics.RastPort rp @A1)@bank 3 = -$6c + Draw (^^graphics.RastPort rp @A1, word x @D0, word y @D1)@bank 3 = -$f6 + DrawEllipse (^^graphics.RastPort rp @A1, word xCenter @D0, word yCenter @D1, word a @D2, word b @D3)@bank 3 = -$b4 + DrawGList (^^graphics.RastPort rp @A1, long vp @A0)@bank 3 = -$72 + EraseRect (^^graphics.RastPort rp @A1, word xMin @D0, word yMin @D1, word xMax @D2, word yMax @D3)@bank 3 = -$032a + ExtendFont (^^graphics.TextFont font @A0, long fontTags @A1) -> long @D0@bank 3 = -$0330 + FindColor (^^graphics.ColorMap cm @A3, long r @D1, long g @D2, long b @D3, long maxcolor @D4) -> long @D0@bank 3 = -$03f0 + FindDisplayInfo (long displayID @D0) -> long @D0@bank 3 = -$02d6 + Flood (^^graphics.RastPort rp @A1, long mode @D2, word x @D0, word y @D1) -> bool @D0@bank 3 = -$014a + FontExtent (^^graphics.TextFont font @A0, long fontExtent @A1)@bank 3 = -$02fa + FreeBitMap (^^graphics.BitMap bm @A0)@bank 3 = -$039c + FreeColorMap (^^graphics.ColorMap colorMap @A0)@bank 3 = -$0240 + FreeCopList (long copList @A0)@bank 3 = -$0222 + FreeCprList (long cprList @A0)@bank 3 = -$0234 + FreeDBufInfo (long dbi @A1)@bank 3 = -$03cc + FreeGBuffers (long anOb @A0, ^^graphics.RastPort rp @A1, bool flag @D0)@bank 3 = -$0258 + FreeRaster (long p @A0, uword width @D0, uword height @D1)@bank 3 = -$01f2 + FreeSprite (word num @D0)@bank 3 = -$019e + FreeSpriteData (long sp @A2)@bank 3 = -$0408 + FreeVPortCopLists (long vp @A0)@bank 3 = -$021c + GetAPen (^^graphics.RastPort rp @A0) -> long @D0@bank 3 = -$035a + GetBPen (^^graphics.RastPort rp @A0) -> long @D0@bank 3 = -$0360 + GetBitMapAttr (^^graphics.BitMap bm @A0, long attrnum @D1) -> long @D0@bank 3 = -$03c0 + GetColorMap (long entries @D0) -> ^^graphics.ColorMap @D0@bank 3 = -$023a + GetDisplayInfoData (long handle @A0, long buf @A1, long size @D0, long tagID @D1, long displayID @D2) -> long @D0@bank 3 = -$02f4 + GetDrMd (^^graphics.RastPort rp @A0) -> long @D0@bank 3 = -$0366 + GetExtSpriteA (long ss @A2, long tags @A1) -> long @D0@bank 3 = -$03a2 + GetGBuffers (long anOb @A0, ^^graphics.RastPort rp @A1, bool flag @D0) -> bool @D0@bank 3 = -$a8 + GetOutlinePen (^^graphics.RastPort rp @A0) -> long @D0@bank 3 = -$036c + GetRGB32 (^^graphics.ColorMap cm @A0, long firstcolor @D0, long ncolors @D1, long table @A1)@bank 3 = -$0384 + GetRGB4 (^^graphics.ColorMap colorMap @A0, long entry @D0) -> long @D0@bank 3 = -$0246 + GetRPAttrsA (^^graphics.RastPort rp @A0, long tags @A1)@bank 3 = -$0414 + GetSprite (long sprite @A0, word num @D0) -> word @D0@bank 3 = -$0198 + GetVPModeID (long vp @A0) -> long @D0@bank 3 = -$0318 + GfxAssociate (long associateNode @A0, long gfxNodePtr @A1)@bank 3 = -$02a0 + GfxFree (long gfxNodePtr @A0)@bank 3 = -$029a + GfxLookUp (long associateNode @A0) -> long @D0@bank 3 = -$02be + GfxNew (long gfxNodeType @D0) -> long @D0@bank 3 = -$0294 + InitArea (^^graphics.AreaInfo areaInfo @A0, long vectorBuffer @A1, word maxVectors @D0)@bank 3 = -$011a + InitBitMap (^^graphics.BitMap bitMap @A0, byte depth @D0, word width @D1, word height @D2)@bank 3 = -$0186 + InitGMasks (long anOb @A0)@bank 3 = -$ae + InitGels (long head @A0, long tail @A1, long gelsInfo @A2)@bank 3 = -$78 + InitMasks (long vSprite @A0)@bank 3 = -$7e + InitRastPort (^^graphics.RastPort rp @A1)@bank 3 = -$c6 + InitTmpRas (^^graphics.TmpRas tmpRas @A0, long buffer @A1, long size @D0) -> ^^graphics.TmpRas @D0@bank 3 = -$01d4 + InitVPort (long vp @A0)@bank 3 = -$cc + InitView (^^graphics.View view @A1)@bank 3 = -$0168 + LoadRGB32 (long vp @A0, long table @A1)@bank 3 = -$0372 + LoadRGB4 (long vp @A0, long colors @A1, word count @D0)@bank 3 = -$c0 + LoadView (^^graphics.View view @A1)@bank 3 = -$de + LockLayerRom (^^graphics.Layer layer @A5)@bank 3 = -$01b0 + MakeVPort (^^graphics.View view @A0, long vp @A1) -> long @D0@bank 3 = -$d8 + ModeNotAvailable (long modeID @D0) -> long @D0@bank 3 = -$031e + Move (^^graphics.RastPort rp @A1, word x @D0, word y @D1)@bank 3 = -$f0 + MoveSprite (long vp @A0, long sprite @A1, word x @D0, word y @D1)@bank 3 = -$01aa + MrgCop (^^graphics.View view @A1) -> long @D0@bank 3 = -$d2 + NewRegion () -> long @D0@bank 3 = -$0204 + NextDisplayInfo (long displayID @D0) -> long @D0@bank 3 = -$02dc + ObtainBestPenA (^^graphics.ColorMap cm @A0, long r @D1, long g @D2, long b @D3, long tags @A1) -> long @D0@bank 3 = -$0348 + ObtainPen (^^graphics.ColorMap cm @A0, long n @D0, long r @D1, long g @D2, long b @D3, long f @D4) -> long @D0@bank 3 = -$03ba + OpenFont (^^graphics.TextAttr textAttr @A0) -> ^^graphics.TextFont @D0@bank 3 = -$48 + OpenMonitor (str monitorName @A1, long displayID @D0) -> long @D0@bank 3 = -$02ca + OrRectRegion (long region @A0, long rectangle @A1) -> bool @D0@bank 3 = -$01fe + OrRegionRegion (long srcRegion @A0, long destRegion @A1) -> bool @D0@bank 3 = -$0264 + OwnBlitter ()@bank 3 = -$01c8 + PolyDraw (^^graphics.RastPort rp @A1, word count @D0, long polyTable @A0)@bank 3 = -$0150 + QBSBlit (long blit @A1)@bank 3 = -$0126 + QBlit (long blit @A1)@bank 3 = -$0114 + ReadPixel (^^graphics.RastPort rp @A1, word x @D0, word y @D1) -> long @D0@bank 3 = -$013e + ReadPixelArray8 (^^graphics.RastPort rp @A0, uword xstart @D0, uword ystart @D1, uword xstop @D2, uword ystop @D3, long array @A2, ^^graphics.RastPort temprp @A1) -> long @D0@bank 3 = -$030c + ReadPixelLine8 (^^graphics.RastPort rp @A0, uword xstart @D0, uword ystart @D1, uword width @D2, long array @A2, ^^graphics.RastPort tempRP @A1) -> long @D0@bank 3 = -$0300 + RectFill (^^graphics.RastPort rp @A1, word xMin @D0, word yMin @D1, word xMax @D2, word yMax @D3)@bank 3 = -$0132 + ReleasePen (^^graphics.ColorMap cm @A0, long n @D0)@bank 3 = -$03b4 + RemFont (^^graphics.TextFont textFont @A1)@bank 3 = -$01e6 + RemIBob (long bob @A0, ^^graphics.RastPort rp @A1, long vp @A2)@bank 3 = -$84 + RemVSprite (long vSprite @A0)@bank 3 = -$8a + ScalerDiv (uword factor @D0, uword numerator @D1, uword denominator @D2) -> uword @D0@bank 3 = -$02ac + ScrollRaster (^^graphics.RastPort rp @A1, word dx @D0, word dy @D1, word xMin @D2, word yMin @D3, word xMax @D4, word yMax @D5)@bank 3 = -$018c + ScrollRasterBF (^^graphics.RastPort rp @A1, word dx @D0, word dy @D1, word xMin @D2, word yMin @D3, word xMax @D4, word yMax @D5)@bank 3 = -$03ea + ScrollVPort (long vp @A0)@bank 3 = -$024c + SetABPenDrMd (^^graphics.RastPort rp @A1, long apen @D0, long bpen @D1, long drawmode @D2)@bank 3 = -$037e + SetAPen (^^graphics.RastPort rp @A1, ubyte pen @D0)@bank 3 = -$0156 + SetBPen (^^graphics.RastPort rp @A1, ubyte pen @D0)@bank 3 = -$015c + SetChipRev (long want @D0) -> long @D0@bank 3 = -$0378 + SetCollision (long num @D0, long routine @A0, long gelsInfo @A1)@bank 3 = -$90 + SetDrMd (^^graphics.RastPort rp @A1, ubyte drawMode @D0)@bank 3 = -$0162 + SetFont (^^graphics.RastPort rp @A1, ^^graphics.TextFont textFont @A0) -> long @D0@bank 3 = -$42 + SetMaxPen (^^graphics.RastPort rp @A0, long maxpen @D0)@bank 3 = -$03de + SetOutlinePen (^^graphics.RastPort rp @A0, long pen @D0) -> long @D0@bank 3 = -$03d2 + SetRGB32 (long vp @A0, long n @D0, long r @D1, long g @D2, long b @D3)@bank 3 = -$0354 + SetRGB32CM (^^graphics.ColorMap cm @A0, long n @D0, long r @D1, long g @D2, long b @D3)@bank 3 = -$03e4 + SetRGB4 (long vp @A0, word index @D0, ubyte red @D1, ubyte green @D2, ubyte blue @D3)@bank 3 = -$0120 + SetRGB4CM (^^graphics.ColorMap colorMap @A0, word index @D0, ubyte red @D1, ubyte green @D2, ubyte blue @D3)@bank 3 = -$0276 + SetRPAttrsA (^^graphics.RastPort rp @A0, long tags @A1)@bank 3 = -$040e + SetRast (^^graphics.RastPort rp @A1, ubyte pen @D0)@bank 3 = -$ea + SetSoftStyle (^^graphics.RastPort rp @A1, long style @D0, long enable @D1) -> long @D0@bank 3 = -$5a + SetWriteMask (^^graphics.RastPort rp @A0, long msk @D0) -> long @D0@bank 3 = -$03d8 + SortGList (^^graphics.RastPort rp @A1)@bank 3 = -$96 + StripFont (^^graphics.TextFont font @A0)@bank 3 = -$0336 + SyncSBitMap (^^graphics.Layer layer @A0)@bank 3 = -$01bc + Text (^^graphics.RastPort rp @A1, str string @A0, uword count @D0) -> long @D0@bank 3 = -$3c + TextExtent (^^graphics.RastPort rp @A1, str string @A0, word count @D0, long textExtent @A2) -> word @D0@bank 3 = -$02b2 + TextFit (^^graphics.RastPort rp @A1, str string @A0, uword strLen @D0, long textExtent @A2, long constrainingExtent @A3, word strDirection @D1, uword constrainingBitWidth @D2, uword constrainingBitHeight @D3) -> long @D0@bank 3 = -$02b8 + TextLength (^^graphics.RastPort rp @A1, str string @A0, uword count @D0) -> word @D0@bank 3 = -$36 + UCopperListInit (long uCopList @A0, word n @D0) -> long @D0@bank 3 = -$0252 + UnlockLayerRom (^^graphics.Layer layer @A5)@bank 3 = -$01b6 + VBeamPos () -> long @D0@bank 3 = -$0180 + VideoControl (^^graphics.ColorMap colorMap @A0, long tagarray @A1) -> bool @D0@bank 3 = -$02c4 + WaitBOVP (long vp @A0)@bank 3 = -$0192 + WaitBlit ()@bank 3 = -$e4 + WaitTOF ()@bank 3 = -$010e + WeighTAMatch (^^graphics.TextAttr reqTextAttr @A0, ^^graphics.TextAttr targetTextAttr @A1, long targetTags @A2) -> word @D0@bank 3 = -$0324 + WriteChunkyPixels (^^graphics.RastPort rp @A0, uword xstart @D0, uword ystart @D1, uword xstop @D2, uword ystop @D3, long array @A2, long bytesperrow @D4)@bank 3 = -$0420 + WritePixel (^^graphics.RastPort rp @A1, word x @D0, word y @D1) -> long @D0@bank 3 = -$0144 + WritePixelArray8 (^^graphics.RastPort rp @A0, uword xstart @D0, uword ystart @D1, uword xstop @D2, uword ystop @D3, long array @A2, ^^graphics.RastPort temprp @A1) -> long @D0@bank 3 = -$0312 + WritePixelLine8 (^^graphics.RastPort rp @A0, uword xstart @D0, uword ystart @D1, uword width @D2, long array @A2, ^^graphics.RastPort tempRP @A1) -> long @D0@bank 3 = -$0306 + XorRectRegion (long region @A0, long rectangle @A1) -> bool @D0@bank 3 = -$022e + XorRegionRegion (long srcRegion @A0, long destRegion @A1) -> bool @D0@bank 3 = -$026a +} + + +LIBRARY MODULE NAME: icon +------------------------- + +icon { + struct DiskObject + const ubyte ADZMACTION_Enter + const ubyte ADZMACTION_Leave + const ubyte AMCLASSICON_Copy + const ubyte AMCLASSICON_Delete + const ubyte AMCLASSICON_EjectDisk + const ubyte AMCLASSICON_EmptyTrash + const ubyte AMCLASSICON_FormatDisk + const ubyte AMCLASSICON_Information + const ubyte AMCLASSICON_LeaveOut + const ubyte AMCLASSICON_Open + const ubyte AMCLASSICON_PutAway + const ubyte AMCLASSICON_Rename + const ubyte AMCLASSICON_Selected + const ubyte AMCLASSICON_Snapshot + const ubyte AMCLASSICON_UnSnapshot + const ubyte AMCLASSICON_Unselected + const ubyte AMTYPE_APPICON + const ubyte AMTYPE_APPMENUITEM + const ubyte AMTYPE_APPWINDOW + const ubyte AMTYPE_APPWINDOWZONE + const ubyte AM_VERSION + const ubyte CPACTION_Begin + const ubyte CPACTION_Copy + const ubyte CPACTION_End + const uword DDFLAGS_SHOWALL + const uword DDFLAGS_SHOWDEFAULT + const uword DDFLAGS_SHOWICONS + const uword DDFLAGS_SHOWMASK + const uword DDFLAGS_SORTASC + const uword DDFLAGS_SORTDEFAULT + const uword DDFLAGS_SORTDESC + const uword DDFLAGS_SORTMASK + const ubyte DDVM_BYDATE + const ubyte DDVM_BYDEFAULT + const ubyte DDVM_BYICON + const ubyte DDVM_BYNAME + const ubyte DDVM_BYSIZE + const ubyte DDVM_BYTYPE + const ubyte DLACTION_BeginDiscard + const ubyte DLACTION_BeginEmptyTrash + const ubyte DLACTION_DeleteContents + const ubyte DLACTION_DeleteObject + const ubyte DLACTION_End + const uword GADGBACKFILL + const uword GFLG_GADGBACKFILL + const ubyte ISMACTION_Ignore + const ubyte ISMACTION_Select + const ubyte ISMACTION_Stop + const ubyte ISMACTION_Unselect + const long NO_ICON_POSITION + const ubyte SCHMSTATE_Cleanup + const ubyte SCHMSTATE_Setup + const ubyte SCHMSTATE_TryCleanup + const ubyte TIACTION_Execute + const ubyte TIACTION_NewDrawer + const ubyte TIACTION_RelabelVolume + const ubyte TIACTION_Rename + const ubyte UPDATEWB_ObjectAdded + const ubyte UPDATEWB_ObjectRemoved + const ubyte WBAPPICON + const long WBAPPICONA_NotifySelectState + const long WBAPPICONA_PropagatePosition + const long WBAPPICONA_RenderHook + const long WBAPPICONA_SupportsCopy + const long WBAPPICONA_SupportsDelete + const long WBAPPICONA_SupportsEjectDisk + const long WBAPPICONA_SupportsEmptyTrash + const long WBAPPICONA_SupportsFormatDisk + const long WBAPPICONA_SupportsInformation + const long WBAPPICONA_SupportsLeaveOut + const long WBAPPICONA_SupportsOpen + const long WBAPPICONA_SupportsPutAway + const long WBAPPICONA_SupportsRename + const long WBAPPICONA_SupportsSnapshot + const long WBAPPICONA_SupportsUnSnapshot + const long WBAPPMENUA_CommandKeyString + const long WBAPPMENUA_GetKey + const long WBAPPMENUA_GetTitleKey + const long WBAPPMENUA_UseKey + const long WBA_Dummy + const long WBCTRLA_AddHiddenDeviceName + const long WBCTRLA_AddSetupCleanupHook + const long WBCTRLA_DuplicateSearchPath + const long WBCTRLA_FreeHiddenDeviceList + const long WBCTRLA_FreeOpenDrawerList + const long WBCTRLA_FreeProgramList + const long WBCTRLA_FreeSearchPath + const long WBCTRLA_FreeSelectedIconList + const long WBCTRLA_GetCopyHook + const long WBCTRLA_GetDefaultStackSize + const long WBCTRLA_GetDeleteHook + const long WBCTRLA_GetDiskInfoHook + const long WBCTRLA_GetGlobalFlags + const long WBCTRLA_GetHiddenDeviceList + const long WBCTRLA_GetOpenDrawerList + const long WBCTRLA_GetProgramList + const long WBCTRLA_GetSelectedIconList + const long WBCTRLA_GetTextInputHook + const long WBCTRLA_GetTypeRestartTime + const long WBCTRLA_IsOpen + const long WBCTRLA_RedrawAppIcon + const long WBCTRLA_RemSetupCleanupHook + const long WBCTRLA_RemoveHiddenDeviceName + const long WBCTRLA_SetCopyHook + const long WBCTRLA_SetDefaultStackSize + const long WBCTRLA_SetDeleteHook + const long WBCTRLA_SetDiskInfoHook + const long WBCTRLA_SetGlobalFlags + const long WBCTRLA_SetTextInputHook + const long WBCTRLA_SetTypeRestartTime + const ubyte WBDEVICE + const ubyte WBDISK + const ubyte WBDRAWER + const long WBDZA_Box + const long WBDZA_Height + const long WBDZA_Hook + const long WBDZA_Left + const long WBDZA_RelBottom + const long WBDZA_RelHeight + const long WBDZA_RelRight + const long WBDZA_RelWidth + const long WBDZA_Top + const long WBDZA_Width + const long WBF_BOUNDTEXTVIEW + const long WBF_DRAWERPOSFREE + const long WBF_DRAWERPOSHEAD + const long WBF_DRAWERPOSMASK + const long WBF_DRAWERPOSTAIL + const long WBF_OLDDATESFIRST + const ubyte WBGARBAGE + const ubyte WBKICK + const long WBOBJA_DrawerFlags + const long WBOBJA_DrawerModes + const long WBOBJA_DrawerPath + const long WBOBJA_DrawerPathSize + const long WBOBJA_FullPath + const long WBOBJA_FullPathSize + const long WBOBJA_Height + const long WBOBJA_IsFake + const long WBOBJA_IsLink + const long WBOBJA_Left + const long WBOBJA_Name + const long WBOBJA_NameSize + const long WBOBJA_State + const long WBOBJA_Top + const long WBOBJA_Type + const long WBOBJA_Width + const long WBOPENA_ArgLock + const long WBOPENA_ArgName + const long WBOPENA_Show + const long WBOPENA_ViewBy + const ubyte WBO_DRAWER + const ubyte WBO_ICON + const ubyte WBO_NONE + const ubyte WBPROJECT + const ubyte WBTOOL + const uword WB_DISKMAGIC + const ubyte WB_DISKREVISION + const ubyte WB_DISKREVISIONMASK + const ubyte WB_DISKVERSION + const ubyte WORKBENCH_WORKBENCH_I + AddFreeList (long freelist @A0, long mem @A1, long size @A2) -> bool @D0@bank 11 = -$48 + BumpRevision (str newname @A0, str oldname @A1) -> str @D0@bank 11 = -$6c + BumpRevisionLength (str newname @A0, str oldname @A1, long maxLength @D0) -> str @D0@bank 11 = -$cc + ChangeToSelectedIconColor (long cr @A0)@bank 11 = -$c6 + DeleteDiskObject (str name @A0) -> bool @D0@bank 11 = -$8a + DrawIconStateA (^^graphics.RastPort rp @A0, ^^icon.DiskObject icon @A1, str label @A2, long leftOffset @D0, long topOffset @D1, long state @D2, long tags @A3)@bank 11 = -$a2 + DupDiskObjectA (^^icon.DiskObject diskObject @A0, long tags @A1) -> ^^icon.DiskObject @D0@bank 11 = -$96 + FindToolType (str toolTypeArray @A0, str typeName @A1) -> long @D0@bank 11 = -$60 + FreeAlloc (long free @A0, long len @A1, long k_type @A2) -> long @D0@bank 11 = -$72 + FreeDiskObject (^^icon.DiskObject diskobj @A0)@bank 11 = -$5a + FreeFree (long fl @A0, long address @A1)@bank 11 = -$90 + FreeFreeList (long freelist @A0)@bank 11 = -$36 + GetDefDiskObject (long k_type @D0) -> ^^icon.DiskObject @D0@bank 11 = -$78 + GetDiskObject (str name @A0) -> ^^icon.DiskObject @D0@bank 11 = -$4e + GetDiskObjectNew (str name @A0) -> ^^icon.DiskObject @D0@bank 11 = -$84 + GetIconRectangleA (^^graphics.RastPort rp @A0, ^^icon.DiskObject icon @A1, str label @A2, long rect @A3, long tags @A4) -> bool @D0@bank 11 = -$a8 + GetIconTagList (str name @A0, long tags @A1) -> ^^icon.DiskObject @D0@bank 11 = -$b4 + IconControlA (^^icon.DiskObject icon @A0, long tags @A1) -> long @D0@bank 11 = -$9c + LayoutIconA (^^icon.DiskObject icon @A0, ^^intuition.Screen screen @A1, long tags @A2) -> bool @D0@bank 11 = -$c0 + MatchToolValue (str typeString @A0, str value @A1) -> bool @D0@bank 11 = -$66 + NewDiskObject (long k_type @D0) -> ^^icon.DiskObject @D0@bank 11 = -$ae + PutDefDiskObject (^^icon.DiskObject diskObject @A0) -> bool @D0@bank 11 = -$7e + PutDiskObject (str name @A0, ^^icon.DiskObject diskobj @A1) -> bool @D0@bank 11 = -$54 + PutIconTagList (str name @A0, ^^icon.DiskObject icon @A1, long tags @A2) -> bool @D0@bank 11 = -$ba +} + + +LIBRARY MODULE NAME: iffparse +----------------------------- + +iffparse { + struct CollectionItem + struct ContextNode + struct IFFHandle + struct IFFStreamCmd + struct StoredProperty + const long ID_CAT + const long ID_FORM + const long ID_LIST + const long ID_NULL + const long ID_PROP + const ubyte IFFCMD_CLEANUP + const ubyte IFFCMD_ENTRY + const ubyte IFFCMD_EXIT + const ubyte IFFCMD_INIT + const ubyte IFFCMD_PURGELCI + const ubyte IFFCMD_READ + const ubyte IFFCMD_SEEK + const ubyte IFFCMD_WRITE + const long IFFERR_EOC + const long IFFERR_EOF + const long IFFERR_MANGLED + const long IFFERR_NOHOOK + const long IFFERR_NOMEM + const long IFFERR_NOSCOPE + const long IFFERR_NOTIFF + const long IFFERR_READ + const long IFFERR_SEEK + const long IFFERR_SYNTAX + const long IFFERR_WRITE + const ubyte IFFF_FSEEK + const ubyte IFFF_READ + const long IFFF_RESERVED + const ubyte IFFF_RSEEK + const ubyte IFFF_RWBITS + const ubyte IFFF_WRITE + const long IFFLCI_COLLECTION + const long IFFLCI_ENTRYHANDLER + const long IFFLCI_EXITHANDLER + const long IFFLCI_PROP + const ubyte IFFPARSE_RAWSTEP + const ubyte IFFPARSE_SCAN + const ubyte IFFPARSE_STEP + const ubyte IFFSCC_CLEANUP + const ubyte IFFSCC_INIT + const ubyte IFFSCC_READ + const ubyte IFFSCC_SEEK + const ubyte IFFSCC_WRITE + const long IFFSIZE_UNKNOWN + const ubyte IFFSLI_PROP + const ubyte IFFSLI_ROOT + const ubyte IFFSLI_TOP + const long IFF_RETURN2CLIENT + AllocIFF () -> ^^iffparse.IFFHandle @D0@bank 14 = -$1e + AllocLocalItem (long k_type @D0, long id @D1, long ident @D2, long dataSize @D3) -> long @D0@bank 14 = -$ba + CloseClipboard (long clipHandle @A0)@bank 14 = -$fc + CloseIFF (^^iffparse.IFFHandle iff @A0)@bank 14 = -$30 + CollectionChunk (^^iffparse.IFFHandle iff @A0, long k_type @D0, long id @D1) -> long @D0@bank 14 = -$8a + CollectionChunks (^^iffparse.IFFHandle iff @A0, long propArray @A1, long numPairs @D0) -> long @D0@bank 14 = -$90 + CurrentChunk (^^iffparse.IFFHandle iff @A0) -> ^^iffparse.ContextNode @D0@bank 14 = -$ae + EntryHandler (^^iffparse.IFFHandle iff @A0, long k_type @D0, long id @D1, long position @D2, ^^utility.Hook handler @A1, long object @A2) -> long @D0@bank 14 = -$66 + ExitHandler (^^iffparse.IFFHandle iff @A0, long k_type @D0, long id @D1, long position @D2, ^^utility.Hook handler @A1, long object @A2) -> long @D0@bank 14 = -$6c + FindCollection (^^iffparse.IFFHandle iff @A0, long k_type @D0, long id @D1) -> ^^iffparse.CollectionItem @D0@bank 14 = -$a2 + FindLocalItem (^^iffparse.IFFHandle iff @A0, long k_type @D0, long id @D1, long ident @D2) -> long @D0@bank 14 = -$d2 + FindProp (^^iffparse.IFFHandle iff @A0, long k_type @D0, long id @D1) -> ^^iffparse.StoredProperty @D0@bank 14 = -$9c + FindPropContext (^^iffparse.IFFHandle iff @A0) -> ^^iffparse.ContextNode @D0@bank 14 = -$a8 + FreeIFF (^^iffparse.IFFHandle iff @A0)@bank 14 = -$36 + FreeLocalItem (long localItem @A0)@bank 14 = -$cc + GoodID (long id @D0) -> long @D0@bank 14 = -$0102 + GoodType (long k_type @D0) -> long @D0@bank 14 = -$0108 + IDtoStr (long id @D0, str buf @A0) -> str @D0@bank 14 = -$010e + InitIFF (^^iffparse.IFFHandle iff @A0, long flags @D0, ^^utility.Hook streamHook @A1)@bank 14 = -$e4 + InitIFFasClip (^^iffparse.IFFHandle iff @A0)@bank 14 = -$f0 + InitIFFasDOS (^^iffparse.IFFHandle iff @A0)@bank 14 = -$ea + LocalItemData (long localItem @A0) -> long @D0@bank 14 = -$c0 + OpenClipboard (long unitNumber @D0) -> long @D0@bank 14 = -$f6 + OpenIFF (^^iffparse.IFFHandle iff @A0, long rwMode @D0) -> long @D0@bank 14 = -$24 + ParentChunk (^^iffparse.ContextNode contextNode @A0) -> ^^iffparse.ContextNode @D0@bank 14 = -$b4 + ParseIFF (^^iffparse.IFFHandle iff @A0, long control @D0) -> long @D0@bank 14 = -$2a + PopChunk (^^iffparse.IFFHandle iff @A0) -> long @D0@bank 14 = -$5a + PropChunk (^^iffparse.IFFHandle iff @A0, long k_type @D0, long id @D1) -> long @D0@bank 14 = -$72 + PropChunks (^^iffparse.IFFHandle iff @A0, long propArray @A1, long numPairs @D0) -> long @D0@bank 14 = -$78 + PushChunk (^^iffparse.IFFHandle iff @A0, long k_type @D0, long id @D1, long size @D2) -> long @D0@bank 14 = -$54 + ReadChunkBytes (^^iffparse.IFFHandle iff @A0, long buf @A1, long numBytes @D0) -> long @D0@bank 14 = -$3c + ReadChunkRecords (^^iffparse.IFFHandle iff @A0, long buf @A1, long bytesPerRecord @D0, long numRecords @D1) -> long @D0@bank 14 = -$48 + SetLocalItemPurge (long localItem @A0, ^^utility.Hook purgeHook @A1)@bank 14 = -$c6 + StopChunk (^^iffparse.IFFHandle iff @A0, long k_type @D0, long id @D1) -> long @D0@bank 14 = -$7e + StopChunks (^^iffparse.IFFHandle iff @A0, long propArray @A1, long numPairs @D0) -> long @D0@bank 14 = -$84 + StopOnExit (^^iffparse.IFFHandle iff @A0, long k_type @D0, long id @D1) -> long @D0@bank 14 = -$96 + StoreItemInContext (^^iffparse.IFFHandle iff @A0, long localItem @A1, ^^iffparse.ContextNode contextNode @A2)@bank 14 = -$de + StoreLocalItem (^^iffparse.IFFHandle iff @A0, long localItem @A1, long position @D0) -> long @D0@bank 14 = -$d8 + WriteChunkBytes (^^iffparse.IFFHandle iff @A0, long buf @A1, long numBytes @D0) -> long @D0@bank 14 = -$42 + WriteChunkRecords (^^iffparse.IFFHandle iff @A0, long buf @A1, long bytesPerRecord @D0, long numRecords @D1) -> long @D0@bank 14 = -$4e + closelib () + openlib () -> bool +} + + +LIBRARY MODULE NAME: intuition +------------------------------ + +intuition { + struct Border + struct ColorSpec + struct DrawInfo + struct EasyStruct + struct ExtGadget + struct ExtIntuiMessage + struct Gadget + struct IBox + struct Image + struct IntuiMessage + struct IntuiText + struct Menu + struct MenuItem + struct NewScreen + struct NewWindow + struct Requester + struct Screen + struct Window + const uword ABSOLUTE_DIMENSIONS + const uword ACTIVATE + const uword ACTIVEGADGET + const long ACTIVEWINDOW + const long ALERT_TYPE + const ubyte ALPHA_P_101 + const uword ALTKEYMAP + const ubyte ALTLEFT + const ubyte ALTRIGHT + const ubyte AMIGAKEY + const ubyte AMIGAKEYS + const ubyte AMIGALEFT + const ubyte AMIGARIGHT + const uword ANTI_ALIAS + const ubyte ASPECT_HORIZ + const ubyte ASPECT_VERT + const ubyte AUTOBACKPEN + const ubyte AUTOFRONTPEN + const ubyte AUTOITEXTFONT + const uword AUTOKNOB + const ubyte AUTOLEFTEDGE + const ubyte AUTONEXTTEXT + const uword AUTOSCROLL + const ubyte AUTOTOPEDGE + const uword BACKDROP + const ubyte BAUD_110 + const ubyte BAUD_1200 + const ubyte BAUD_19200 + const ubyte BAUD_2400 + const ubyte BAUD_300 + const ubyte BAUD_4800 + const ubyte BAUD_9600 + const ubyte BAUD_MIDI + const uword BEEPING + const uword BOOLEXTEND + const ubyte BOOLGADGET + const uword BOOLMASK + const uword BORDERLESS + const uword BORDERSNIFF + const ubyte BOTTOMBORDER + const uword BOUNDED_DIMENSIONS + const ubyte BROTHER_15XL + const ubyte CBM_MPS1000 + const uword CENTER_IMAGE + const long CHANGEWINDOW + const uword CHECKED + const ubyte CHECKIMAGE + const uword CHECKIT + const ubyte CHECKWIDTH + const ubyte CLB_INLIST + const long CLF_INLIST + const ubyte CLOSE + const ubyte CLOSEIMAGE + const uword CLOSEWINDOW + const uword COMMSEQ + const ubyte COMMWIDTH + const uword CORRECT_BLUE + const uword CORRECT_GREEN + const uword CORRECT_RED + const ubyte CORRECT_RGB_MASK + const ubyte CURSORDOWN + const ubyte CURSORLEFT + const ubyte CURSORRIGHT + const ubyte CURSORUP + const ubyte CUSTOM + const uword CUSTOMBITMAP + const ubyte CUSTOMGADGET + const long CUSTOMIMAGEDEPTH + const uword CUSTOMSCREEN + const ubyte CUSTOM_NAME + const uword CWCODE_DEPTH + const uword CWCODE_HIDE + const uword CWCODE_MOVESIZE + const uword CWCODE_SHOW + const long DEADEND_ALERT + const ubyte DEFAULTMOUSEQUEUE + const uword DEFERREFRESH + const long DELTAMOVE + const ubyte DEPTHIMAGE + const ubyte DEVNAME_SIZE + const ubyte DIAB_630 + const ubyte DIAB_ADV_D25 + const ubyte DIAB_C_150 + const ubyte DIMENSIONS_MASK + const uword DISKINSERTED + const long DISKREMOVED + const uword DITHERING_MASK + const ubyte DOWNIMAGE + const ubyte DRAFT + const ubyte DRIB_NEWLOOK + const long DRIF_NEWLOOK + const ubyte DRI_VERSION + const uword EIGHT_LPI + const uword ELITE + const ubyte ENDGADGET + const uword EO_BADFORMAT + const uword EO_BIGCHANGE + const uword EO_CLEAR + const uword EO_DELBACKWARD + const uword EO_DELFORWARD + const uword EO_ENTER + const uword EO_INSERTCHAR + const uword EO_MOVECURSOR + const uword EO_NOOP + const uword EO_REPLACECHAR + const uword EO_RESET + const uword EO_SPECIAL + const uword EO_UNDO + const ubyte EPSON + const ubyte EPSON_JX_80 + const ubyte EURO_A0 + const ubyte EURO_A1 + const ubyte EURO_A2 + const ubyte EURO_A3 + const ubyte EURO_A4 + const ubyte EURO_A5 + const ubyte EURO_A6 + const ubyte EURO_A7 + const ubyte EURO_A8 + const ubyte FANFOLD + const ubyte FILENAME_SIZE + const uword FINE + const uword FLOYD_DITHERING + const ubyte FOLLOWMOUSE + const ubyte FRAMEB_MINIMAL + const ubyte FRAMEB_SPECIFY + const ubyte FRAMEF_MINIMAL + const ubyte FRAMEF_SPECIFY + const ubyte FRAME_BUTTON + const ubyte FRAME_CONTEXT + const ubyte FRAME_DEFAULT + const ubyte FRAME_DISPLAY + const ubyte FRAME_ICONDROPBOX + const ubyte FRAME_PROPBORDER + const ubyte FRAME_PROPKNOB + const ubyte FRAME_RIDGE + const uword FREEHORIZ + const uword FREEVERT + const uword GACT_ACTIVEGADGET + const uword GACT_ALTKEYMAP + const uword GACT_BOOLEXTEND + const uword GACT_BORDERSNIFF + const uword GACT_BOTTOMBORDER + const uword GACT_ENDGADGET + const uword GACT_FOLLOWMOUSE + const uword GACT_IMMEDIATE + const uword GACT_LEFTBORDER + const uword GACT_LONGINT + const uword GACT_RELVERIFY + const uword GACT_RIGHTBORDER + const uword GACT_STRINGCENTER + const uword GACT_STRINGEXTEND + const uword GACT_STRINGLEFT + const uword GACT_STRINGRIGHT + const uword GACT_TOGGLESELECT + const uword GACT_TOPBORDER + const uword GADGDISABLED + const ubyte GADGET0002 + const ubyte GADGETDOWN + const uword GADGETTYPE + const ubyte GADGETUP + const ubyte GADGHBOX + const ubyte GADGHCOMP + const ubyte GADGHIGHBITS + const ubyte GADGHIMAGE + const ubyte GADGHNONE + const ubyte GADGIMAGE + const ubyte GADGIMMEDIATE + const long GA_ActivateKey + const long GA_BORDER + const long GA_BOTTOMBORDER + const long GA_BackFill + const long GA_Border + const long GA_BottomBorder + const long GA_Bounds + const long GA_DISABLED + const long GA_DRAWINFO + const long GA_Disabled + const long GA_DrawInfo + const long GA_Dummy + const long GA_ENDGADGET + const long GA_EndGadget + const long GA_FOLLOWMOUSE + const long GA_FollowMouse + const long GA_GZZGADGET + const long GA_GZZGadget + const long GA_GadgetHelp + const long GA_GadgetHelpText + const long GA_HEIGHT + const long GA_HIGHLIGHT + const long GA_Height + const long GA_Highlight + const long GA_ID + const long GA_IMAGE + const long GA_IMMEDIATE + const long GA_INTUITEXT + const long GA_Image + const long GA_Immediate + const long GA_IntuiText + const long GA_LABELIMAGE + const long GA_LEFT + const long GA_LEFTBORDER + const long GA_LabelImage + const long GA_Left + const long GA_LeftBorder + const long GA_NEXT + const long GA_Next + const long GA_PREVIOUS + const long GA_Previous + const long GA_RELBOTTOM + const long GA_RELHEIGHT + const long GA_RELRIGHT + const long GA_RELVERIFY + const long GA_RELWIDTH + const long GA_RIGHTBORDER + const long GA_ReadOnly + const long GA_RelBottom + const long GA_RelHeight + const long GA_RelRight + const long GA_RelSpecial + const long GA_RelVerify + const long GA_RelWidth + const long GA_RightBorder + const long GA_SELECTED + const long GA_SELECTRENDER + const long GA_SPECIALINFO + const long GA_SYSGADGET + const long GA_SYSGTYPE + const long GA_SelectRender + const long GA_Selected + const long GA_SpecialInfo + const long GA_SysGType + const long GA_SysGadget + const long GA_TEXT + const long GA_TOGGLESELECT + const long GA_TOP + const long GA_TOPBORDER + const long GA_TabCycle + const long GA_Text + const long GA_TextAttr + const long GA_ToggleSelect + const long GA_Top + const long GA_TopBorder + const long GA_USERDATA + const long GA_Underscore + const long GA_UserData + const long GA_UserInput + const long GA_WIDTH + const long GA_Width + const ubyte GDOMAIN_MAXIMUM + const ubyte GDOMAIN_MINIMUM + const ubyte GDOMAIN_NOMINAL + const uword GFLG_DISABLED + const uword GFLG_EXTENDED + const uword GFLG_GADGHBOX + const uword GFLG_GADGHCOMP + const uword GFLG_GADGHIGHBITS + const uword GFLG_GADGHIMAGE + const uword GFLG_GADGHNONE + const uword GFLG_GADGIMAGE + const uword GFLG_IMAGEDISABLE + const uword GFLG_LABELIMAGE + const uword GFLG_LABELITEXT + const uword GFLG_LABELMASK + const uword GFLG_LABELSTRING + const uword GFLG_RELBOTTOM + const uword GFLG_RELHEIGHT + const uword GFLG_RELRIGHT + const uword GFLG_RELSPECIAL + const uword GFLG_RELWIDTH + const uword GFLG_SELECTED + const uword GFLG_STRINGEXTEND + const uword GFLG_TABCYCLE + const uword GIMMEZEROZERO + const long GMORE_BOOPSIGADGET + const long GMORE_BOUNDS + const long GMORE_FREEIMAGE + const long GMORE_GADGETHELP + const long GMORE_HIDDEN + const long GMORE_PARENTHIDDEN + const long GMORE_SCROLLRASTER + const ubyte GMRB_NEXTACTIVE + const ubyte GMRB_NOREUSE + const ubyte GMRB_PREVACTIVE + const ubyte GMRB_REUSE + const ubyte GMRB_VERIFY + const uword GMRF_NEXTACTIVE + const uword GMRF_NOREUSE + const uword GMRF_PREVACTIVE + const uword GMRF_REUSE + const uword GMRF_VERIFY + const long GMR_GADGETHIT + const long GMR_HELPCODE + const long GMR_HELPHIT + const uword GMR_KEYACTIVE + const uword GMR_KEYVERIFY + const uword GMR_MEACTIVE + const uword GMR_NEXTACTIVE + const long GMR_NOHELPHIT + const uword GMR_NOREUSE + const uword GMR_PREVACTIVE + const uword GMR_REUSE + const uword GMR_VERIFY + const ubyte GM_DOMAIN + const ubyte GM_GOACTIVE + const ubyte GM_GOINACTIVE + const ubyte GM_HANDLEINPUT + const ubyte GM_HELPTEST + const ubyte GM_HITTEST + const ubyte GM_KEYGOACTIVE + const ubyte GM_KEYGOINACTIVE + const ubyte GM_KEYTEST + const ubyte GM_LAYOUT + const ubyte GM_RENDER + const ubyte GREDRAW_REDRAW + const ubyte GREDRAW_TOGGLE + const ubyte GREDRAW_UPDATE + const ubyte GRELBOTTOM + const ubyte GRELHEIGHT + const ubyte GRELRIGHT + const ubyte GRELWIDTH + const uword GREY_SCALE2 + const ubyte GTYPEMASK + const uword GTYP_BOOLGADGET + const uword GTYP_CLOSE + const uword GTYP_CUSTOMGADGET + const uword GTYP_GADGET0002 + const uword GTYP_GADGETTYPE + const uword GTYP_GTYPEMASK + const uword GTYP_GZZGADGET + const uword GTYP_ICONIFY + const uword GTYP_PROPGADGET + const uword GTYP_REQGADGET + const uword GTYP_SCRGADGET + const uword GTYP_SDEPTH + const long GTYP_SDOWNBACK + const uword GTYP_SDRAGGING + const uword GTYP_SIZING + const uword GTYP_STRGADGET + const uword GTYP_SUNUSED + const long GTYP_SUPFRONT + const uword GTYP_SYSGADGET + const uword GTYP_SYSTYPEMASK + const uword GTYP_WDEPTH + const long GTYP_WDOWNBACK + const uword GTYP_WDRAGGING + const long GTYP_WUPFRONT + const uword GTYP_WZOOM + const uword GZZGADGET + const uword HALFTONE_DITHERING + const long HASZOOM + const ubyte HC_GADGETHELP + const uword HIGHBOX + const uword HIGHCOMP + const uword HIGHFLAGS + const uword HIGHIMAGE + const uword HIGHITEM + const uword HIGHNONE + const ubyte HP_LASERJET + const ubyte HP_LASERJET_PLUS + const long IA_APATSIZE + const long IA_APATTERN + const long IA_APatSize + const long IA_APattern + const long IA_ActivateKey + const long IA_BGPEN + const long IA_BGPen + const long IA_DATA + const long IA_DOUBLEEMBOSS + const long IA_Data + const long IA_DoubleEmboss + const long IA_EDGESONLY + const long IA_EdgesOnly + const long IA_EraseBackground + const long IA_FGPEN + const long IA_FGPen + const long IA_FONT + const long IA_Font + const long IA_FrameType + const long IA_HEIGHT + const long IA_HIGHLIGHTPEN + const long IA_Height + const long IA_HighlightPen + const long IA_LEFT + const long IA_LINEWIDTH + const long IA_Label + const long IA_LabelPen + const long IA_Left + const long IA_LineWidth + const long IA_MODE + const long IA_Mode + const long IA_OUTLINE + const long IA_Orientation + const long IA_Outline + const long IA_PENS + const long IA_Pens + const long IA_Precision + const long IA_RECESSED + const long IA_RESOLUTION + const long IA_Recessed + const long IA_Resolution + const long IA_SHADOWPEN + const long IA_Scalable + const long IA_Screen + const long IA_ShadowPen + const long IA_SupportsDisable + const long IA_TOP + const long IA_Top + const long IA_Underscore + const long IA_WIDTH + const long IA_Width + const long ICA_Dummy + const long ICA_MAP + const long ICA_TARGET + const uword ICM_CHECKLOOP + const uword ICM_CLEARLOOP + const uword ICM_SETLOOP + const ubyte ICONIFYIMAGE + const long ICSPECIAL_CODE + const long ICTARGET_IDCMP + const long IDCMPUPDATE + const long IDCMP_ACTIVEWINDOW + const long IDCMP_CHANGEWINDOW + const long IDCMP_CLOSEWINDOW + const long IDCMP_DELTAMOVE + const long IDCMP_DISKINSERTED + const long IDCMP_DISKREMOVED + const long IDCMP_GADGETDOWN + const long IDCMP_GADGETHELP + const long IDCMP_GADGETUP + const long IDCMP_IDCMPUPDATE + const long IDCMP_INACTIVEWINDOW + const long IDCMP_INTUITICKS + const long IDCMP_LONELYMESSAGE + const long IDCMP_MENUHELP + const long IDCMP_MENUPICK + const long IDCMP_MENUVERIFY + const long IDCMP_MOUSEBUTTONS + const long IDCMP_MOUSEMOVE + const long IDCMP_NEWPREFS + const long IDCMP_NEWSIZE + const long IDCMP_RAWKEY + const long IDCMP_REFRESHWINDOW + const long IDCMP_REQCLEAR + const long IDCMP_REQSET + const long IDCMP_REQVERIFY + const long IDCMP_SIZEVERIFY + const long IDCMP_VANILLAKEY + const long IDCMP_WBENCHMESSAGE + const ubyte IDOMAIN_MAXIMUM + const ubyte IDOMAIN_MINIMUM + const ubyte IDOMAIN_NOMINAL + const ubyte IDS_BUSY + const ubyte IDS_DISABLED + const ubyte IDS_INACTIVEDISABLED + const ubyte IDS_INACTIVENORMAL + const ubyte IDS_INACTIVESELECTED + const ubyte IDS_INDETERMINANT + const ubyte IDS_INDETERMINATE + const ubyte IDS_NORMAL + const ubyte IDS_SELECTED + const ubyte IDS_SELECTEDDISABLED + const uword IECLASS_ACTIVEWINDOW + const uword IECLASS_CHANGEWINDOW + const uword IECLASS_CLOSEWINDOW + const uword IECLASS_DISKINSERTED + const uword IECLASS_DISKREMOVED + const uword IECLASS_EVENT + const uword IECLASS_GADGETDOWN + const uword IECLASS_GADGETUP + const uword IECLASS_INACTIVEWINDOW + const uword IECLASS_MAX + const uword IECLASS_MENUHELP + const uword IECLASS_MENULIST + const uword IECLASS_NEWPOINTERPOS + const uword IECLASS_NEWPREFS + const uword IECLASS_NULL + const uword IECLASS_POINTERPOS + const uword IECLASS_RAWKEY + const uword IECLASS_RAWMOUSE + const uword IECLASS_REFRESHWINDOW + const uword IECLASS_REQUESTER + const uword IECLASS_SIZEWINDOW + const uword IECLASS_TIMER + const uword IECODEB_UP_PREFIX + const uword IECODE_ASCII_DEL + const uword IECODE_ASCII_FIRST + const uword IECODE_ASCII_LAST + const uword IECODE_C0_FIRST + const uword IECODE_C0_LAST + const uword IECODE_C1_FIRST + const uword IECODE_C1_LAST + const uword IECODE_COMM_CODE_FIRST + const uword IECODE_COMM_CODE_LAST + const uword IECODE_KEY_CODE_FIRST + const uword IECODE_KEY_CODE_LAST + const uword IECODE_LATIN1_FIRST + const uword IECODE_LATIN1_LAST + const uword IECODE_LBUTTON + const uword IECODE_MBUTTON + const uword IECODE_NEWACTIVE + const uword IECODE_NEWSIZE + const uword IECODE_NOBUTTON + const uword IECODE_RBUTTON + const uword IECODE_REFRESH + const uword IECODE_REQCLEAR + const uword IECODE_REQSET + const uword IECODE_UP_PREFIX + const uword IEQUALIFIERB_CAPSLOCK + const uword IEQUALIFIERB_CONTROL + const uword IEQUALIFIERB_INTERRUPT + const uword IEQUALIFIERB_LALT + const uword IEQUALIFIERB_LCOMMAND + const uword IEQUALIFIERB_LEFTBUTTON + const uword IEQUALIFIERB_LSHIFT + const uword IEQUALIFIERB_MIDBUTTON + const uword IEQUALIFIERB_MULTIBROADCAST + const uword IEQUALIFIERB_NUMERICPAD + const uword IEQUALIFIERB_RALT + const uword IEQUALIFIERB_RBUTTON + const uword IEQUALIFIERB_RCOMMAND + const uword IEQUALIFIERB_RELATIVEMOUSE + const uword IEQUALIFIERB_REPEAT + const uword IEQUALIFIERB_RSHIFT + const uword IEQUALIFIER_CAPSLOCK + const uword IEQUALIFIER_CONTROL + const uword IEQUALIFIER_INTERRUPT + const uword IEQUALIFIER_LALT + const uword IEQUALIFIER_LCOMMAND + const uword IEQUALIFIER_LEFTBUTTON + const uword IEQUALIFIER_LSHIFT + const uword IEQUALIFIER_MIDBUTTON + const uword IEQUALIFIER_MULTIBROADCAST + const uword IEQUALIFIER_NUMERICPAD + const uword IEQUALIFIER_RALT + const uword IEQUALIFIER_RBUTTON + const uword IEQUALIFIER_RCOMMAND + const uword IEQUALIFIER_RELATIVEMOUSE + const uword IEQUALIFIER_REPEAT + const uword IEQUALIFIER_RSHIFT + const uword IESUBCLASS_COMPATIBLE + const uword IESUBCLASS_NEWTABLET + const uword IESUBCLASS_PIXEL + const uword IESUBCLASS_TABLET + const uword IGNORE_DIMENSIONS + const long IMAGE_ATTRIBUTES + const ubyte IMAGE_NEGATIVE + const ubyte IMAGE_POSITIVE + const uword IM_DOMAINFRAME + const uword IM_DRAW + const uword IM_DRAWFRAME + const uword IM_ERASE + const uword IM_ERASEFRAME + const uword IM_FRAMEBOX + const uword IM_HITFRAME + const uword IM_HITTEST + const uword IM_MOVE + const long INACTIVEWINDOW + const uword INREQUEST + const uword INTEGER_SCALING + const long INTUITICKS + const uword ISDRAWN + const uword ITEMENABLED + const uword ITEMTEXT + const ubyte KEYCODE_B + const ubyte KEYCODE_GREATER + const ubyte KEYCODE_LESS + const ubyte KEYCODE_M + const ubyte KEYCODE_N + const ubyte KEYCODE_Q + const ubyte KEYCODE_V + const ubyte KEYCODE_X + const ubyte KEYCODE_Z + const uword KNOBHIT + const ubyte KNOBHMIN + const ubyte KNOBVMIN + const uword LABELIMAGE + const ubyte LABELITEXT + const uword LABELMASK + const uword LABELSTRING + const ubyte LACEWB + const long LAYOUTA_ChildMaxHeight + const long LAYOUTA_ChildMaxWidth + const long LAYOUTA_Dummy + const long LAYOUTA_LAYOUTOBJ + const long LAYOUTA_LayoutObj + const long LAYOUTA_ORIENTATION + const long LAYOUTA_Orientation + const long LAYOUTA_SPACING + const long LAYOUTA_Spacing + const ubyte LEFTBORDER + const ubyte LEFTIMAGE + const uword LETTER + const long LONELYMESSAGE + const uword LONGINT + const ubyte LORIENT_HORIZ + const ubyte LORIENT_NONE + const ubyte LORIENT_VERT + const ubyte LOWCHECKWIDTH + const ubyte LOWCOMMWIDTH + const uword MAXBODY + const uword MAXPOT + const ubyte MAXPUBSCREENNAME + const uword MENUCANCEL + const ubyte MENUCHECK + const uword MENUDOWN + const uword MENUENABLED + const long MENUHELP + const uword MENUHOT + const ubyte MENUMX + const uword MENUNULL + const uword MENUPICK + const uword MENUSTATE + const ubyte MENUSUB + const uword MENUTOGGLE + const uword MENUTOGGLED + const uword MENUUP + const uword MENUVERIFY + const uword MENUWAITING + const uword MIDDLEDOWN + const uword MIDDLEUP + const uword MIDRAWN + const ubyte MOUSEBUTTONS + const ubyte MOUSEMOVE + const uword MOUSE_ACCEL + const uword MULTIPLY_DIMENSIONS + const ubyte MXIMAGE + const uword NEWPREFS + const ubyte NEWSIZE + const long NOCAREREFRESH + const uword NOISYREQ + const uword NOITEM + const uword NOMENU + const uword NOREQBACKFILL + const uword NOSUB + const uword NS_EXTENDED + const long NW_EXTENDED + const ubyte N_TRACTOR + const uword OKABORT + const ubyte OKCANCEL + const ubyte OKIMATE_20 + const ubyte OKOK + const uword OM_ADDMEMBER + const uword OM_ADDTAIL + const uword OM_DISPOSE + const uword OM_GET + const uword OM_NEW + const uword OM_NOTIFY + const uword OM_REMMEMBER + const uword OM_REMOVE + const uword OM_SET + const uword OM_UPDATE + const ubyte OPUB_INTERIM + const ubyte OPUF_INTERIM + const uword ORDERED_DITHERING + const ubyte OSCAN_MAX + const ubyte OSCAN_STANDARD + const ubyte OSCAN_TEXT + const ubyte OSCAN_VIDEO + const ubyte OSERR_ATTACHFAIL + const ubyte OSERR_NOCHIPMEM + const ubyte OSERR_NOCHIPS + const ubyte OSERR_NOMEM + const ubyte OSERR_NOMONITOR + const ubyte OSERR_NOTAVAILABLE + const ubyte OSERR_PUBNOTUNIQUE + const ubyte OSERR_TOODEEP + const ubyte OSERR_UNKNOWNMODE + const ubyte OTHER_REFRESH + const ubyte PARALLEL_PRINTER + const uword PENSHARED + const uword PEN_C0 + const uword PEN_C1 + const uword PEN_C2 + const uword PEN_C3 + const long PGA_BORDERLESS + const long PGA_Borderless + const long PGA_Dummy + const long PGA_FREEDOM + const long PGA_Freedom + const long PGA_HORIZBODY + const long PGA_HORIZPOT + const long PGA_HorizBody + const long PGA_HorizPot + const long PGA_KnobImage + const long PGA_NewLook + const long PGA_TOP + const long PGA_TOTAL + const long PGA_Top + const long PGA_Total + const long PGA_VERTBODY + const long PGA_VERTPOT + const long PGA_VISIBLE + const long PGA_VertBody + const long PGA_VertPot + const long PGA_Visible + const ubyte PICA + const uword PIXEL_DIMENSIONS + const long POINTERA_BitMap + const long POINTERA_Dummy + const long POINTERA_WordWidth + const long POINTERA_XOffset + const long POINTERA_XResolution + const long POINTERA_YOffset + const long POINTERA_YResolution + const ubyte POINTERXRESN_140NS + const ubyte POINTERXRESN_35NS + const ubyte POINTERXRESN_70NS + const ubyte POINTERXRESN_DEFAULT + const ubyte POINTERXRESN_HIRES + const ubyte POINTERXRESN_LORES + const ubyte POINTERXRESN_SCREENRES + const ubyte POINTERYRESN_DEFAULT + const ubyte POINTERYRESN_HIGH + const ubyte POINTERYRESN_HIGHASPECT + const ubyte POINTERYRESN_SCREENRES + const ubyte POINTERYRESN_SCREENRESASPECT + const uword POINTREL + const uword POPPUBSCREEN + const uword PREDRAWN + const uword PROPBORDERLESS + const ubyte PROPGADGET + const uword PROPNEWLOOK + const uword PSNF_PRIVATE + const uword PUBLICSCREEN + const ubyte QUME_LP_20 + const uword RAWKEY + const long RECOVERY_ALERT + const ubyte REFRESHBITS + const ubyte REFRESHWINDOW + const ubyte RELVERIFY + const uword REPORTMOUSE + const uword REQACTIVE + const uword REQCLEAR + const uword REQGADGET + const uword REQOFFWINDOW + const ubyte REQSET + const uword REQVERIFY + const ubyte RIGHTBORDER + const ubyte RIGHTIMAGE + const long RMBTRAP + const long SA_AutoScroll + const long SA_BackChild + const long SA_BackFill + const long SA_Behind + const long SA_BitMap + const long SA_BlockPen + const long SA_ColorMapEntries + const long SA_Colors + const long SA_Colors32 + const long SA_DClip + const long SA_Depth + const long SA_DetailPen + const long SA_DisplayID + const long SA_Draggable + const long SA_ErrorCode + const long SA_Exclusive + const long SA_Font + const long SA_FrontChild + const long SA_FullPalette + const long SA_Height + const long SA_Interleaved + const long SA_Left + const long SA_LikeWorkbench + const long SA_MinimizeISG + const long SA_Obsolete1 + const long SA_OffScreenDragging + const long SA_Overscan + const long SA_Parent + const long SA_Pens + const long SA_PubName + const long SA_PubSig + const long SA_PubTask + const long SA_Quiet + const long SA_Reserved + const long SA_SharePens + const long SA_ShowTitle + const long SA_SysFont + const long SA_Title + const long SA_Top + const long SA_Type + const long SA_VideoControl + const long SA_Width + const ubyte SBUFSIZE_BITS + const ubyte SBUF_1024 + const ubyte SBUF_16000 + const ubyte SBUF_2048 + const ubyte SBUF_4096 + const ubyte SBUF_512 + const ubyte SBUF_8000 + const ubyte SB_COPY_BITMAP + const ubyte SB_SCREEN_BITMAP + const uword SCREENBEHIND + const uword SCREENHIRES + const uword SCREENQUIET + const uword SCREENTYPE + const uword SCREEN_DRAG + const uword SCRGADGET + const ubyte SDEPTHIMAGE + const ubyte SDEPTH_CHILDONLY + const ubyte SDEPTH_INFAMILY + const ubyte SDEPTH_TOBACK + const ubyte SDEPTH_TOFRONT + const ubyte SDOWNBACK + const ubyte SDRAGGING + const uword SELECTDOWN + const ubyte SELECTED + const uword SELECTUP + const ubyte SERIAL_PRINTER + const ubyte SGAB_BEEP + const ubyte SGAB_END + const ubyte SGAB_NEXTACTIVE + const ubyte SGAB_PREVACTIVE + const ubyte SGAB_REDISPLAY + const ubyte SGAB_REUSE + const ubyte SGAB_USE + const ubyte SGAF_BEEP + const ubyte SGAF_END + const ubyte SGAF_NEXTACTIVE + const ubyte SGAF_PREVACTIVE + const ubyte SGAF_REDISPLAY + const ubyte SGAF_REUSE + const ubyte SGAF_USE + const ubyte SGA_BEEP + const ubyte SGA_END + const ubyte SGA_NEXTACTIVE + const ubyte SGA_PREVACTIVE + const ubyte SGA_REDISPLAY + const ubyte SGA_REUSE + const ubyte SGA_USE + const ubyte SGH_CLICK + const ubyte SGH_KEY + const ubyte SGMB_EXITHELP + const ubyte SGMB_FIXEDFIELD + const ubyte SGMB_NOFILTER + const ubyte SGMB_REPLACE + const ubyte SGMF_EXITHELP + const ubyte SGMF_FIXEDFIELD + const ubyte SGMF_NOFILTER + const ubyte SGMF_REPLACE + const long SGM_EXITHELP + const long SGM_FIXEDFIELD + const long SGM_NOFILTER + const ubyte SGM_REPLACE + const ubyte SG_DEFAULTMAXCHARS + const ubyte SHADE_BW + const ubyte SHADE_COLOR + const ubyte SHADE_GREYSCALE + const uword SHANGHAI + const ubyte SHIFTKEYIMAGE + const uword SHOWTITLE + const ubyte SHSHAKE_BITS + const ubyte SHSHAKE_NONE + const ubyte SHSHAKE_RTS + const ubyte SHSHAKE_XON + const uword SIMPLEREQ + const ubyte SIMPLE_REFRESH + const ubyte SINGLE + const ubyte SIX_LPI + const ubyte SIZEBBOTTOM + const ubyte SIZEBRIGHT + const ubyte SIZEIMAGE + const ubyte SIZEVERIFY + const ubyte SIZING + const uword SMARTKNOBIMAGE + const ubyte SMART_REFRESH + const ubyte SPARITY_BITS + const ubyte SPARITY_EVEN + const ubyte SPARITY_MARK + const ubyte SPARITY_NONE + const ubyte SPARITY_ODD + const ubyte SPARITY_SPACE + const ubyte SPOS_ABSOLUTE + const ubyte SPOS_FORCEDRAG + const ubyte SPOS_MAKEVISIBLE + const ubyte SPOS_RELATIVE + const ubyte SREAD_BITS + const ubyte SSTOP_BITS + const long STDSCREENHEIGHT + const long STDSCREENWIDTH + const ubyte STRGADGET + const long STRINGA_ActivePens + const long STRINGA_AltKeyMap + const long STRINGA_Buffer + const long STRINGA_BufferPos + const long STRINGA_DispPos + const long STRINGA_Dummy + const long STRINGA_EditHook + const long STRINGA_EditModes + const long STRINGA_ExitHelp + const long STRINGA_FixedFieldMode + const long STRINGA_Font + const long STRINGA_Justification + const long STRINGA_LongVal + const long STRINGA_MaxChars + const long STRINGA_NoFilterMode + const long STRINGA_Pens + const long STRINGA_ReplaceMode + const long STRINGA_TextVal + const long STRINGA_UndoBuffer + const long STRINGA_WorkBuffer + const uword STRINGCENTER + const uword STRINGEXTEND + const ubyte STRINGLEFT + const uword STRINGRIGHT + const ubyte SUPER_BITMAP + const long SUPER_UNUSED + const ubyte SUPFRONT + const ubyte SWRITE_BITS + const uword SYSGADGET + const long SYSIA_Depth + const long SYSIA_DrawInfo + const long SYSIA_Pens + const long SYSIA_ReferenceFont + const long SYSIA_Size + const long SYSIA_Which + const ubyte SYSISIZE_HIRES + const ubyte SYSISIZE_LOWRES + const ubyte SYSISIZE_MEDRES + const uword SYSREQUEST + const long TABLETA_AngleX + const long TABLETA_AngleY + const long TABLETA_AngleZ + const long TABLETA_ButtonBits + const long TABLETA_Dummy + const long TABLETA_InProximity + const long TABLETA_Pressure + const long TABLETA_RangeZ + const long TABLETA_ResolutionX + const long TABLETA_ResolutionY + const long TABLETA_TabletZ + const uword TOGGLESELECT + const ubyte TOPAZ_EIGHTY + const ubyte TOPAZ_SIXTY + const ubyte TOPBORDER + const ubyte UPIMAGE + const uword USEREQIMAGE + const ubyte US_LEGAL + const ubyte US_LETTER + const long VANILLAKEY + const long VISITOR + const long WA_Activate + const long WA_AmigaKey + const long WA_AutoAdjust + const long WA_BackFill + const long WA_Backdrop + const long WA_BlockPen + const long WA_Borderless + const long WA_BusyPointer + const long WA_Checkmark + const long WA_CloseGadget + const long WA_Colors + const long WA_CustomScreen + const long WA_DepthGadget + const long WA_DetailPen + const long WA_DragBar + const long WA_Flags + const long WA_Gadgets + const long WA_GimmeZeroZero + const long WA_Height + const long WA_HelpGroup + const long WA_HelpGroupWindow + const long WA_Hidden + const long WA_IDCMP + const long WA_IconifyGadget + const long WA_InnerHeight + const long WA_InnerWidth + const long WA_Left + const long WA_MaxHeight + const long WA_MaxWidth + const long WA_MenuHelp + const long WA_MinHeight + const long WA_MinWidth + const long WA_MouseQueue + const long WA_NewLookMenus + const long WA_NoCareRefresh + const long WA_NotifyDepth + const long WA_Obsolete + const long WA_Pointer + const long WA_PointerDelay + const long WA_PointerType + const long WA_PubScreen + const long WA_PubScreenFallBack + const long WA_PubScreenName + const long WA_RMBTrap + const long WA_ReportMouse + const long WA_RptQueue + const long WA_ScreenTitle + const long WA_SimpleRefresh + const long WA_SizeBBottom + const long WA_SizeBRight + const long WA_SizeGadget + const long WA_SmartRefresh + const long WA_SuperBitMap + const long WA_TabletMessages + const long WA_Title + const long WA_Top + const long WA_WBenchWindow + const long WA_Width + const long WA_WindowName + const long WA_Zoom + const uword WBENCHCLOSE + const long WBENCHMESSAGE + const uword WBENCHOPEN + const uword WBENCHSCREEN + const long WBENCHWINDOW + const ubyte WDOWNBACK + const ubyte WDRAGGING + const uword WFLG_ACTIVATE + const uword WFLG_BACKDROP + const uword WFLG_BORDERLESS + const uword WFLG_CLOSEGADGET + const uword WFLG_DEPTHGADGET + const uword WFLG_DRAGBAR + const uword WFLG_GIMMEZEROZERO + const long WFLG_HASICONIFY + const long WFLG_HASZOOM + const uword WFLG_INREQUEST + const uword WFLG_MENUSTATE + const long WFLG_NEWLOOKMENUS + const long WFLG_NOCAREREFRESH + const long WFLG_NW_EXTENDED + const uword WFLG_OTHER_REFRESH + const uword WFLG_REFRESHBITS + const uword WFLG_REPORTMOUSE + const long WFLG_RMBTRAP + const uword WFLG_SIMPLE_REFRESH + const uword WFLG_SIZEBBOTTOM + const uword WFLG_SIZEBRIGHT + const uword WFLG_SIZEGADGET + const uword WFLG_SMART_REFRESH + const uword WFLG_SUPER_BITMAP + const long WFLG_VISITOR + const long WFLG_WBENCHWINDOW + const uword WFLG_WINDOWACTIVE + const long WFLG_WINDOWREFRESH + const long WFLG_WINDOWTICKED + const long WFLG_ZOOMED + const uword WINDOWACTIVE + const ubyte WINDOWCLOSE + const ubyte WINDOWDEPTH + const ubyte WINDOWDRAG + const long WINDOWREFRESH + const ubyte WINDOWSIZING + const long WINDOWTICKED + const ubyte WINDOW_BACKMOST + const ubyte WINDOW_FRONTMOST + const ubyte WUPFRONT + const ubyte W_TRACTOR + const long ZOOMED + const ubyte ZOOMIMAGE + ActivateGadget (^^intuition.Gadget gadgets @A0, ^^intuition.Window window @A1, ^^intuition.Requester requester @A2) -> bool @D0@bank 4 = -$01ce + ActivateWindow (^^intuition.Window window @A0)@bank 4 = -$01c2 + AddClass (long classPtr @A0)@bank 4 = -$02ac + AddGList (^^intuition.Window window @A0, ^^intuition.Gadget gadget @A1, uword position @D0, word numGad @D1, ^^intuition.Requester requester @A2) -> uword @D0@bank 4 = -$01b6 + AddGadget (^^intuition.Window window @A0, ^^intuition.Gadget gadget @A1, uword position @D0) -> uword @D0@bank 4 = -$2a + AllocRemember (long rememberKey @A0, long size @D0, long flags @D1) -> long @D0@bank 4 = -$018c + AllocScreenBuffer (^^intuition.Screen sc @A0, ^^graphics.BitMap bm @A1, long flags @D0) -> long @D0@bank 4 = -$0300 + AlohaWorkbench (long wbport @A0)@bank 4 = -$0192 + AutoRequest (^^intuition.Window window @A0, ^^intuition.IntuiText body @A1, ^^intuition.IntuiText posText @A2, ^^intuition.IntuiText negText @A3, long pFlag @D0, long nFlag @D1, uword width @D2, uword height @D3) -> bool @D0@bank 4 = -$015c + BeginRefresh (^^intuition.Window window @A0)@bank 4 = -$0162 + BuildEasyRequestArgs (^^intuition.Window window @A0, ^^intuition.EasyStruct easyStruct @A1, long idcmp @D0, long args @A3) -> ^^intuition.Window @D0@bank 4 = -$0252 + BuildSysRequest (^^intuition.Window window @A0, ^^intuition.IntuiText body @A1, ^^intuition.IntuiText posText @A2, ^^intuition.IntuiText negText @A3, long flags @D0, uword width @D1, uword height @D2) -> ^^intuition.Window @D0@bank 4 = -$0168 + ChangeScreenBuffer (^^intuition.Screen sc @A0, long sb @A1) -> long @D0@bank 4 = -$030c + ChangeWindowBox (^^intuition.Window window @A0, word left @D0, word top @D1, word width @D2, word height @D3)@bank 4 = -$01e6 + ClearDMRequest (^^intuition.Window window @A0) -> bool @D0@bank 4 = -$30 + ClearMenuStrip (^^intuition.Window window @A0)@bank 4 = -$36 + ClearPointer (^^intuition.Window window @A0)@bank 4 = -$3c + CloseScreen (^^intuition.Screen screen @A0) -> bool @D0@bank 4 = -$42 + CloseWindow (^^intuition.Window window @A0)@bank 4 = -$48 + CloseWorkBench () -> long @D0@bank 4 = -$4e + CurrentTime (long seconds @A0, long micros @A1)@bank 4 = -$54 + DisplayAlert (long alertNumber @D0, str string @A0, uword height @D1) -> bool @D0@bank 4 = -$5a + DisplayBeep (^^intuition.Screen screen @A0)@bank 4 = -$60 + DisposeObject (long object @A0)@bank 4 = -$0282 + DoGadgetMethodA (^^intuition.Gadget gad @A0, ^^intuition.Window win @A1, ^^intuition.Requester req @A2, long message @A3) -> long @D0@bank 4 = -$032a + DoubleClick (long sSeconds @D0, long sMicros @D1, long cSeconds @D2, long cMicros @D3) -> bool @D0@bank 4 = -$66 + DrawBorder (^^graphics.RastPort rp @A0, ^^intuition.Border border @A1, word leftOffset @D0, word topOffset @D1)@bank 4 = -$6c + DrawImage (^^graphics.RastPort rp @A0, ^^intuition.Image image @A1, word leftOffset @D0, word topOffset @D1)@bank 4 = -$72 + DrawImageState (^^graphics.RastPort rp @A0, ^^intuition.Image image @A1, word leftOffset @D0, word topOffset @D1, long state @D2, ^^intuition.DrawInfo drawInfo @A2)@bank 4 = -$026a + EasyRequestArgs (^^intuition.Window window @A0, ^^intuition.EasyStruct easyStruct @A1, long idcmpPtr @A2, long args @A3) -> long @D0@bank 4 = -$024c + EndRefresh (^^intuition.Window window @A0, long complete @D0)@bank 4 = -$016e + EndRequest (^^intuition.Requester requester @A0, ^^intuition.Window window @A1)@bank 4 = -$78 + EraseImage (^^graphics.RastPort rp @A0, ^^intuition.Image image @A1, word leftOffset @D0, word topOffset @D1)@bank 4 = -$0276 + FreeClass (long classPtr @A0) -> bool @D0@bank 4 = -$02ca + FreeRemember (long rememberKey @A0, bool reallyForget @D0)@bank 4 = -$0198 + FreeScreenBuffer (^^intuition.Screen sc @A0, long sb @A1)@bank 4 = -$0306 + FreeScreenDrawInfo (^^intuition.Screen screen @A0, ^^intuition.DrawInfo drawInfo @A1)@bank 4 = -$02b8 + FreeSysRequest (^^intuition.Window window @A0)@bank 4 = -$0174 + GadgetMouse (^^intuition.Gadget gadget @A0, long gInfo @A1, long mousePoint @A2)@bank 4 = -$023a + GetAttr (long attrID @D0, long object @A0, long storagePtr @A1) -> long @D0@bank 4 = -$028e + GetDefPrefs (long preferences @A0, word size @D0) -> long @D0@bank 4 = -$7e + GetDefaultPubScreen (str nameBuffer @A0)@bank 4 = -$0246 + GetPrefs (long preferences @A0, word size @D0) -> long @D0@bank 4 = -$84 + GetScreenBitMap (^^intuition.Screen screen @A0) -> ^^graphics.BitMap @A1 + GetScreenData (long buffer @A0, uword size @D0, uword k_type @D1, ^^intuition.Screen screen @A1) -> long @D0@bank 4 = -$01aa + GetScreenDrawInfo (^^intuition.Screen screen @A0) -> ^^intuition.DrawInfo @D0@bank 4 = -$02b2 + GetScreenRastPort (^^intuition.Screen screen @A0) -> ^^graphics.RastPort @A1 + GetScreenViewPort (^^intuition.Screen screen @A0) -> long @A1 + HelpControl (^^intuition.Window win @A0, long flags @D0)@bank 4 = -$033c + HideWindow (^^intuition.Window window @A0) -> bool @D0@bank 4 = -$0348 + InitRequester (^^intuition.Requester requester @A0)@bank 4 = -$8a + IntuiTextLength (^^intuition.IntuiText iText @A0) -> long @D0@bank 4 = -$014a + Intuition (long iEvent @A0)@bank 4 = -$24 + IntuitionControlA (long object @A0, long taglist @A1) -> long @D0@bank 4 = -$04bc + ItemAddress (^^intuition.Menu menuStrip @A0, uword menuNumber @D0) -> ^^intuition.MenuItem @D0@bank 4 = -$90 + LendMenus (^^intuition.Window fromwindow @A0, ^^intuition.Window towindow @A1)@bank 4 = -$0324 + LockIBase (long dontknow @D0) -> long @D0@bank 4 = -$019e + LockPubScreen (str name @A0) -> ^^intuition.Screen @D0@bank 4 = -$01fe + LockPubScreenList () -> ^^exec.List @D0@bank 4 = -$020a + MakeClass (str classID @A0, str superClassID @A1, long superClassPtr @A2, uword instanceSize @D0, long flags @D1) -> long @D0@bank 4 = -$02a6 + MakeScreen (^^intuition.Screen screen @A0) -> long @D0@bank 4 = -$017a + ModifyIDCMP (^^intuition.Window window @A0, long flags @D0) -> bool @D0@bank 4 = -$96 + ModifyProp (^^intuition.Gadget gadget @A0, ^^intuition.Window window @A1, ^^intuition.Requester requester @A2, uword flags @D0, uword horizPot @D1, uword vertPot @D2, uword horizBody @D3, uword vertBody @D4)@bank 4 = -$9c + MoveScreen (^^intuition.Screen screen @A0, word dx @D0, word dy @D1)@bank 4 = -$a2 + MoveWindow (^^intuition.Window window @A0, word dx @D0, word dy @D1)@bank 4 = -$a8 + MoveWindowInFrontOf (^^intuition.Window window @A0, ^^intuition.Window behindWindow @A1)@bank 4 = -$01e0 + NewModifyProp (^^intuition.Gadget gadget @A0, ^^intuition.Window window @A1, ^^intuition.Requester requester @A2, uword flags @D0, uword horizPot @D1, uword vertPot @D2, uword horizBody @D3, uword vertBody @D4, word numGad @D5)@bank 4 = -$01d4 + NewObjectA (long classPtr @A0, str classID @A1, long tagList @A2) -> long @D0@bank 4 = -$027c + NextObject (long objectPtrPtr @A0) -> long @D0@bank 4 = -$029a + NextPubScreen (^^intuition.Screen screen @A0, str namebuf @A1) -> str @D0@bank 4 = -$0216 + ObtainGIRPort (long gInfo @A0) -> ^^graphics.RastPort @D0@bank 4 = -$022e + OffGadget (^^intuition.Gadget gadget @A0, ^^intuition.Window window @A1, ^^intuition.Requester requester @A2)@bank 4 = -$ae + OffMenu (^^intuition.Window window @A0, uword menuNumber @D0)@bank 4 = -$b4 + OnGadget (^^intuition.Gadget gadget @A0, ^^intuition.Window window @A1, ^^intuition.Requester requester @A2)@bank 4 = -$ba + OnMenu (^^intuition.Window window @A0, uword menuNumber @D0)@bank 4 = -$c0 + OpenIntuition ()@bank 4 = -$1e + OpenScreen (^^intuition.NewScreen newScreen @A0) -> ^^intuition.Screen @D0@bank 4 = -$c6 + OpenScreenTagList (^^intuition.NewScreen newScreen @A0, long tagList @A1) -> ^^intuition.Screen @D0@bank 4 = -$0264 + OpenWindow (^^intuition.NewWindow newWindow @A0) -> ^^intuition.Window @D0@bank 4 = -$cc + OpenWindowTagList (^^intuition.NewWindow newWindow @A0, long tagList @A1) -> ^^intuition.Window @D0@bank 4 = -$025e + OpenWorkBench () -> long @D0@bank 4 = -$d2 + PointInImage (long point @D0, ^^intuition.Image image @A0) -> bool @D0@bank 4 = -$0270 + PrintIText (^^graphics.RastPort rp @A0, ^^intuition.IntuiText iText @A1, word left @D0, word top @D1)@bank 4 = -$d8 + PubScreenStatus (^^intuition.Screen screen @A0, uword statusFlags @D0) -> uword @D0@bank 4 = -$0228 + QueryOverscan (long displayID @A0, long rect @A1, word oScanType @D0) -> long @D0@bank 4 = -$01da + RefreshGList (^^intuition.Gadget gadgets @A0, ^^intuition.Window window @A1, ^^intuition.Requester requester @A2, word numGad @D0)@bank 4 = -$01b0 + RefreshGadgets (^^intuition.Gadget gadgets @A0, ^^intuition.Window window @A1, ^^intuition.Requester requester @A2)@bank 4 = -$de + RefreshWindowFrame (^^intuition.Window window @A0)@bank 4 = -$01c8 + ReleaseGIRPort (^^graphics.RastPort rp @A0)@bank 4 = -$0234 + RemakeDisplay () -> long @D0@bank 4 = -$0180 + RemoveClass (long classPtr @A0)@bank 4 = -$02c4 + RemoveGList (^^intuition.Window remPtr @A0, ^^intuition.Gadget gadget @A1, word numGad @D0) -> uword @D0@bank 4 = -$01bc + RemoveGadget (^^intuition.Window window @A0, ^^intuition.Gadget gadget @A1) -> uword @D0@bank 4 = -$e4 + ReportMouse (bool flag @D0, ^^intuition.Window window @A0)@bank 4 = -$ea + Request (^^intuition.Requester requester @A0, ^^intuition.Window window @A1) -> bool @D0@bank 4 = -$f0 + ResetMenuStrip (^^intuition.Window window @A0, ^^intuition.Menu menu @A1) -> bool @D0@bank 4 = -$02be + RethinkDisplay () -> long @D0@bank 4 = -$0186 + ScreenDepth (^^intuition.Screen screen @A0, long flags @D0, long reserved @A1)@bank 4 = -$0312 + ScreenPosition (^^intuition.Screen screen @A0, long flags @D0, long x1 @D1, long y1 @D2, long x2 @D3, long y2 @D4)@bank 4 = -$0318 + ScreenToBack (^^intuition.Screen screen @A0)@bank 4 = -$f6 + ScreenToFront (^^intuition.Screen screen @A0)@bank 4 = -$fc + ScrollWindowRaster (^^intuition.Window win @A1, word dx @D0, word dy @D1, word xMin @D2, word yMin @D3, word xMax @D4, word yMax @D5)@bank 4 = -$031e + SetAttrsA (long object @A0, long tagList @A1) -> long @D0@bank 4 = -$0288 + SetDMRequest (^^intuition.Window window @A0, ^^intuition.Requester requester @A1) -> bool @D0@bank 4 = -$0102 + SetDefaultPubScreen (str name @A0)@bank 4 = -$021c + SetEditHook (^^utility.Hook hook @A0) -> ^^utility.Hook @D0@bank 4 = -$01ec + SetGadgetAttrsA (^^intuition.Gadget gadget @A0, ^^intuition.Window window @A1, ^^intuition.Requester requester @A2, long tagList @A3) -> long @D0@bank 4 = -$0294 + SetMenuStrip (^^intuition.Window window @A0, ^^intuition.Menu menu @A1) -> bool @D0@bank 4 = -$0108 + SetMouseQueue (^^intuition.Window window @A0, uword queueLength @D0) -> long @D0@bank 4 = -$01f2 + SetPointer (^^intuition.Window window @A0, long k_pointer @A1, word height @D0, word width @D1, word xOffset @D2, word yOffset @D3)@bank 4 = -$010e + SetPrefs (long preferences @A0, long size @D0, bool inform @D1) -> long @D0@bank 4 = -$0144 + SetPubScreenModes (uword modes @D0) -> uword @D0@bank 4 = -$0222 + SetWindowPointerA (^^intuition.Window win @A0, long taglist @A1)@bank 4 = -$0330 + SetWindowTitles (^^intuition.Window window @A0, str windowTitle @A1, str screenTitle @A2)@bank 4 = -$0114 + ShowTitle (^^intuition.Screen screen @A0, bool showIt @D0)@bank 4 = -$011a + ShowWindow (^^intuition.Window window @A0, ^^intuition.Window other @A1) -> bool @D0@bank 4 = -$0342 + SizeWindow (^^intuition.Window window @A0, word dx @D0, word dy @D1)@bank 4 = -$0120 + SysReqHandler (^^intuition.Window window @A0, long idcmpPtr @A1, bool waitInput @D0) -> long @D0@bank 4 = -$0258 + TimedDisplayAlert (long alertNumber @D0, str string @A0, uword height @D1, long time @A1) -> bool @D0@bank 4 = -$0336 + UnlockIBase (long ibLock @A0)@bank 4 = -$01a4 + UnlockPubScreen (str name @A0, ^^intuition.Screen screen @A1)@bank 4 = -$0204 + UnlockPubScreenList ()@bank 4 = -$0210 + ViewAddress () -> ^^graphics.View @D0@bank 4 = -$0126 + ViewPortAddress (^^intuition.Window window @A0) -> long @D0@bank 4 = -$012c + WBenchToBack () -> bool @D0@bank 4 = -$0150 + WBenchToFront () -> bool @D0@bank 4 = -$0156 + WindowLimits (^^intuition.Window window @A0, long widthMin @D0, long heightMin @D1, long widthMax @D2, long heightMax @D3) -> bool @D0@bank 4 = -$013e + WindowToBack (^^intuition.Window window @A0)@bank 4 = -$0132 + WindowToFront (^^intuition.Window window @A0)@bank 4 = -$0138 + ZipWindow (^^intuition.Window window @A0)@bank 4 = -$01f8 +} + + +LIBRARY MODULE NAME: lineclip +----------------------------- + +lineclip { + clip (word x1, word y1, word x2, word y2) -> bool, word, word, word, word + inside (word x, word y) -> bool + set_cliprect (word x1, word y1, word x2, word y2) +} + + +LIBRARY MODULE NAME: lists +-------------------------- + +lists { + FullNode alias for: exec.Node + List alias for: exec.MinList + Node alias for: exec.MinNode + add_head (long listptr, long node) + add_tail (long listptr, long node) + enqueue (long listptr, long node) + find_name (long listptr, str name) -> long + init (long listptr) + insert (long listptr, long node, long pred) + is_empty (long listptr) -> bool + remove (long node) + remove_head (long listptr) -> long + remove_tail (long listptr) -> long +} + + +LIBRARY MODULE NAME: math +------------------------- + +math { + ubyte a1 + ubyte b1 + ubyte c1 + ubyte x1 + cos8 (ubyte angle) -> byte + cos8u (ubyte angle) -> ubyte + cosr8 (ubyte radians) -> byte + cosr8u (ubyte radians) -> ubyte + randrange (ubyte n) -> ubyte + randrangew (uword n) -> uword + rnd () -> ubyte + rndseed (uword seed1, uword seed2) + rndw () -> uword + sin8 (ubyte angle) -> byte + sin8u (ubyte angle) -> ubyte + sinr8 (ubyte radians) -> byte + sinr8u (ubyte radians) -> ubyte +} + + +LIBRARY MODULE NAME: ptplayer +----------------------------- + +ptplayer { + currentpos () -> ubyte @D0, ubyte @D1, ubyte @D2 + disable () + enable () + end () + init (long moduledata @A0) + install () -> bool @D0 + notestrike () clobbers (D4) -> bool @D0, bool @D1, bool @D2, bool @D3 + numpatterns () -> ubyte @D0 + remove () + songname () -> long @A0 + volumes () -> ubyte @D0, ubyte @D1, ubyte @D2, ubyte @D3 +} + + +LIBRARY MODULE NAME: strings +---------------------------- + +strings { + compare (str st1 @D0, str st2 @D1) -> byte @D0 + copy (str source @D0, str target @D1) -> ubyte @D0 + hash (str string @D0) -> ubyte @D0 + isdigit (ubyte char) -> bool + isxdigit (ubyte char) -> bool + length (str string @A0) -> ubyte @D0 + lowerchar (ubyte char) -> ubyte + lowerchar_iso alias for: strings.lowerchar + ncopy (str source @D0, str target @D1, ubyte maxlength @D2) -> ubyte @D0 + upperchar (ubyte char) -> ubyte + upperchar_iso alias for: strings.upperchar +} + + +LIBRARY MODULE NAME: syslib +--------------------------- + +sys { + long @shared DOSBase + long @shared GfxBase + long @shared IFFParseBase + long @shared IconBase + long @shared IntuitionBase + const byte MAX_BYTE + const long MAX_LONG + const ubyte MAX_UBYTE + const uword MAX_UWORD + const word MAX_WORD + const byte MIN_BYTE + const long MIN_LONG + const ubyte MIN_UBYTE + const uword MIN_UWORD + const word MIN_WORD + long @shared RexxSysBase + const ubyte SIZEOF_BOOL + const ubyte SIZEOF_BYTE + const ubyte SIZEOF_FLOAT + const ubyte SIZEOF_LONG + const ubyte SIZEOF_POINTER + const ubyte SIZEOF_UBYTE + const ubyte SIZEOF_UWORD + const ubyte SIZEOF_WORD + long @shared TimerBase + long @shared UtilityBase + ^^ubyte @shared arguments + const ubyte target + clear_carry () + cpuAtLeast68020 () clobbers (D0,A6) -> bool @Pz + exec_version () -> uword @D0 + exit (ubyte returnvalue) + memclear (long mem @D0, uword numbytes @D1) + memcopy (long source @A0, long tgt @A1, long count @D0) + memset (long mem @D0, uword numbytes @D1, ubyte value @D2) + memsetl (long mem @D0, uword numlongs @D1, long value @D2) + memsetw (long mem @D0, uword numwords @D1, uword value @D2) + progend () -> long @A0 + progstart () -> long @A0 + reset_system () + set_carry () + wait (long jiffies @D1) + waitvsync () +} + + +LIBRARY MODULE NAME: textio +--------------------------- + +txt { + bell () + bold () + chrout (ubyte char @D0) clobbers (D0,D1,D2,D3,A0,A6) + clear_screen () + cls () + color (ubyte txtcol) + cursor_off () + cursor_on () + dim () + flush () + height () -> ubyte + home () + input_chars (str buffer) -> ubyte + iso () + italic () + lowercase () + nl () + normal () + plot (ubyte col, ubyte row) + print (str text @A0) clobbers (D0,D1,D2,D3,A0,A6) + print_b (byte value) + print_bool (bool value) + print_f alias for: floats.print + print_l (long value) + print_ub (ubyte value) + print_ub0 (ubyte value) + print_ubbin (ubyte value, bool prefix) + print_ubhex (ubyte value, bool prefix) + print_ulhex (long value, bool prefix) + print_uw (uword value) + print_uw0 (uword value) + print_uwbin (uword value, bool prefix) + print_uwhex (uword value, bool prefix) + print_w (word value) + rvs () + setchr (ubyte col, ubyte row, ubyte char) + size () -> ubyte, ubyte + spc () + tab () + underline () + width () -> ubyte +} + + +LIBRARY MODULE NAME: timer +-------------------------- + +timer { + struct EClockVal + struct TimeRequest + struct TimeVal + const uword TR_ADDREQUEST + const uword TR_GETSYSTIME + const uword TR_SETSYSTIME + ^^timer.TimeRequest @shared TimerIO + const ubyte UNIT::ECLOCK + const ubyte UNIT::MICROHZ + const ubyte UNIT::VBLANK + const ubyte UNIT::WAITECLOCK + const ubyte UNIT::WAITUNTIL + AddTime (^^timer.TimeVal dest @A0, ^^timer.TimeVal src @A1)@bank 18 = -$2a + CmpTime (^^timer.TimeVal dest @A0, ^^timer.TimeVal src @A1) -> long @D0@bank 18 = -$36 + GetSysTime (^^timer.TimeVal dest @A0)@bank 18 = -$42 + ReadEClock (^^timer.EClockVal dest @A0) -> long @D0@bank 18 = -$3c + SubTime (^^timer.TimeVal dest @A0, ^^timer.TimeVal src @A1)@bank 18 = -$30 + closedevice () + getsystime () -> long, long + opendevice () -> bool + setsystime (long secs, long micro) +} + + +LIBRARY MODULE NAME: utility +---------------------------- + +utility { + struct ClockData + struct Hook + struct TagItem + const uword ANO_Flags + const uword ANO_NameSpace + const uword ANO_Priority + const uword ANO_UserSpace + const ubyte MAP_KEEP_NOT_FOUND + const ubyte MAP_REMOVE_NOT_FOUND + const ubyte NSB_CASE + const ubyte NSB_NODUPS + const ubyte NSF_CASE + const ubyte NSF_NODUPS + const ubyte PSTB_EXISTS + const ubyte PSTB_PACK + const ubyte PSTB_SIGNED + const ubyte PSTB_UNPACK + const long PSTF_EXISTS + const long PSTF_PACK + const long PSTF_SIGNED + const long PSTF_UNPACK + const ubyte TAGFILTER_AND + const ubyte TAGFILTER_NOT + const ubyte TAG_DONE + const ubyte TAG_END + const ubyte TAG_IGNORE + const ubyte TAG_MORE + const ubyte TAG_SKIP + const long TAG_USER + const ubyte UTILITY_NAME_I + const ubyte UTILITY_PACK_I + AddNamedObject (long nameSpace @A0, long object @A1) -> bool @D0@bank 9 = -$de + AllocNamedObjectA (str name @A0, long tagList @A1) -> long @D0@bank 9 = -$e4 + AllocateTagItems (long numTags @D0) -> ^^utility.TagItem @D0@bank 9 = -$42 + Amiga2Date (long seconds @D0, ^^utility.ClockData result @A0)@bank 9 = -$78 + ApplyTagChanges (long list @A0, long changeList @A1)@bank 9 = -$ba + AttemptRemNamedObject (long object @A0) -> long @D0@bank 9 = -$ea + CallHookPkt (^^utility.Hook hook @A0, long object @A2, long paramPacket @A1) -> long @D0@bank 9 = -$66 + CheckDate (^^utility.ClockData date @A0) -> long @D0@bank 9 = -$84 + CloneTagItems (long tagList @A0) -> ^^utility.TagItem @D0@bank 9 = -$48 + Date2Amiga (^^utility.ClockData date @A0) -> long @D0@bank 9 = -$7e + FilterTagChanges (long changeList @A0, long originalList @A1, long apply @D0)@bank 9 = -$36 + FilterTagItems (long tagList @A0, long filterArray @A1, long logic @D0) -> long @D0@bank 9 = -$60 + FindNamedObject (long nameSpace @A0, str name @A1, long lastObject @A2) -> long @D0@bank 9 = -$f0 + FindTagItem (long tagVal @D0, long tagList @A0) -> ^^utility.TagItem @D0@bank 9 = -$1e + FreeNamedObject (long object @A0)@bank 9 = -$f6 + FreeTagItems (long tagList @A0)@bank 9 = -$4e + GetTagData (long tagValue @D0, long defaultVal @D1, long tagList @A0) -> long @D0@bank 9 = -$24 + GetUniqueID () -> long @D0@bank 9 = -$010e + MapTags (long tagList @A0, long mapList @A1, long mapType @D0)@bank 9 = -$3c + NamedObjectName (long object @A0) -> str @D0@bank 9 = -$fc + NextTagItem (long tagListPtr @A0) -> ^^utility.TagItem @D0@bank 9 = -$30 + PackBoolTags (long initialFlags @D0, long tagList @A0, long boolMap @A1) -> long @D0@bank 9 = -$2a + PackStructureTags (long pack @A0, long packTable @A1, long tagList @A2) -> long @D0@bank 9 = -$d2 + RefreshTagItemClones (long clone @A0, long original @A1)@bank 9 = -$54 + ReleaseNamedObject (long object @A0)@bank 9 = -$0102 + RemNamedObject (long object @A0, ^^exec.Message message @A1)@bank 9 = -$0108 + SDivMod32 (long dividend @D0, long divisor @D1) -> long @D0@bank 9 = -$96 + SDivMod64 (long hi @D1, long lo @D0, long divisor @D2) -> long @D0@bank 9 = -$01c2 + SMult32 (long arg1 @D0, long arg2 @D1) -> long @D0@bank 9 = -$8a + SMult64 (long arg1 @D0, long arg2 @D1) -> long @D0@bank 9 = -$c6 + Stricmp (str string1 @A0, str string2 @A1) -> long @D0@bank 9 = -$a2 + Strncat (str dst @A1, str src @A0, long size @D0) -> str @D0@bank 9 = -$01bc + Strncpy (str dst @A1, str src @A0, long size @D0) -> str @D0@bank 9 = -$01b6 + Strnicmp (str string1 @A0, str string2 @A1, long length @D0) -> long @D0@bank 9 = -$a8 + TagInArray (long tagValue @D0, long tagArray @A0) -> bool @D0@bank 9 = -$5a + ToLower (ubyte character @D0) -> ubyte @D0@bank 9 = -$b4 + ToUpper (ubyte character @D0) -> ubyte @D0@bank 9 = -$ae + UDivMod32 (long dividend @D0, long divisor @D1) -> long @D0@bank 9 = -$9c + UDivMod64 (long hi @D1, long lo @D0, long divisor @D2) -> long @D0@bank 9 = -$01c8 + UMult32 (long arg1 @D0, long arg2 @D1) -> long @D0@bank 9 = -$90 + UMult64 (long arg1 @D0, long arg2 @D1) -> long @D0@bank 9 = -$cc + UnpackStructureTags (long pack @A0, long packTable @A1, long tagList @A2) -> long @D0@bank 9 = -$d8 + VSNPrintf (str buffer @A0, long bufsize @D0, str fmt @A1, long data @A2) -> long @D0@bank 9 = -$0138 +} + + +LIBRARY MODULE NAME: wavfile +---------------------------- + +wavfile { + const ubyte Format::ADPCM + const ubyte Format::ALAW + const ubyte Format::DVI_ADPCM + const ubyte Format::IEEE_FLOAT + const ubyte Format::MULAW + const ubyte Format::PCM + ubyte bits_per_sample + uword block_align + uword data_offset + long data_size + ubyte nchannels + uword sample_rate + ubyte wavefmt + parse_header (^^ubyte wav_data) -> bool +} + + diff --git a/docs/source/_static/symboldumps/skeletons-amiga500.txt b/docs/source/_static/symboldumps/skeletons-amiga500.txt index 7eaa3428a..aeeef910c 100644 --- a/docs/source/_static/symboldumps/skeletons-amiga500.txt +++ b/docs/source/_static/symboldumps/skeletons-amiga500.txt @@ -4760,4 +4760,3 @@ wavfile { parse_header (^^ubyte wav_data) -> bool } - diff --git a/docs/source/_static/symboldumps/skeletons-c128.txt b/docs/source/_static/symboldumps/skeletons-c128.txt index 3444e79b6..f0436d5f3 100644 --- a/docs/source/_static/symboldumps/skeletons-c128.txt +++ b/docs/source/_static/symboldumps/skeletons-c128.txt @@ -996,4 +996,3 @@ wavfile { parse_header (^^ubyte wav_data) -> bool } - diff --git a/docs/source/_static/symboldumps/skeletons-c64.txt b/docs/source/_static/symboldumps/skeletons-c64.txt index 4810ff3f6..cea018a36 100644 --- a/docs/source/_static/symboldumps/skeletons-c64.txt +++ b/docs/source/_static/symboldumps/skeletons-c64.txt @@ -1103,4 +1103,3 @@ wavfile { parse_header (^^ubyte wav_data) -> bool } - diff --git a/docs/source/_static/symboldumps/skeletons-cx16.txt b/docs/source/_static/symboldumps/skeletons-cx16.txt index 44d2e2660..fd93cf5ad 100644 --- a/docs/source/_static/symboldumps/skeletons-cx16.txt +++ b/docs/source/_static/symboldumps/skeletons-cx16.txt @@ -1676,4 +1676,3 @@ wavfile { parse_header (^^ubyte wav_data) -> bool } - diff --git a/docs/source/_static/symboldumps/skeletons-pet32.txt b/docs/source/_static/symboldumps/skeletons-pet32.txt index 6c743b198..ae5e47067 100644 --- a/docs/source/_static/symboldumps/skeletons-pet32.txt +++ b/docs/source/_static/symboldumps/skeletons-pet32.txt @@ -941,4 +941,3 @@ wavfile { parse_header (^^ubyte wav_data) -> bool } - diff --git a/docs/source/_static/symboldumps/skeletons-qemu68k.txt b/docs/source/_static/symboldumps/skeletons-qemu68k.txt index 9882bad7e..0bdc87682 100644 --- a/docs/source/_static/symboldumps/skeletons-qemu68k.txt +++ b/docs/source/_static/symboldumps/skeletons-qemu68k.txt @@ -502,4 +502,3 @@ wavfile { parse_header (^^ubyte wav_data) -> bool } - diff --git a/docs/source/_static/symboldumps/skeletons-virtual.txt b/docs/source/_static/symboldumps/skeletons-virtual.txt index b1766f3e4..f0b4ffa70 100644 --- a/docs/source/_static/symboldumps/skeletons-virtual.txt +++ b/docs/source/_static/symboldumps/skeletons-virtual.txt @@ -721,4 +721,3 @@ wavfile { parse_header (^^ubyte wav_data) -> bool } - diff --git a/docs/source/targetsystem.rst b/docs/source/targetsystem.rst index 9c6f4dc9d..34091aff5 100644 --- a/docs/source/targetsystem.rst +++ b/docs/source/targetsystem.rst @@ -17,8 +17,9 @@ Currently these machines can be selected as a compilation target (via the ``-tar - 'cx16': the `Commander X16 `_ - 'c128': the Commodore 128 - 'pet32': the Commodore PET 4032 -- 'qemu68k': Qemu M68k simulator (experimental) - 'amiga500': Amiga 500 (experimental) +- 'amiga1200': Amiga 1200 (experimental, 68020 CPU with optional FPU) +- 'qemu68k': Qemu M68k simulator (experimental) - 'virtual': a builtin virtual machine (32-bit pointers, 16 MB memory) - custom targets via a separate configuration file (see :ref:`customizable_target`) @@ -90,7 +91,7 @@ Pointer size The size of a pointer (memory address) depends on the target's CPU architecture: - **6502-family targets** (c64, cx16, c128, pet32): **2 bytes** (16-bit address space, 64 KB) -- **m68k targets** (amiga500, qemu68k): **4 bytes** (32-bit address space, 16 MB) +- **m68k targets** (amiga500, amiga1200, qemu68k): **4 bytes** (32-bit address space, 16 MB) - **virtual target**: **4 bytes** (32-bit address space, 16 MB) The ``pointer`` type keyword automatically takes the correct size for the target, diff --git a/examples/test.p8 b/examples/test.p8 index 0008760c6..364ac5c15 100644 --- a/examples/test.p8 +++ b/examples/test.p8 @@ -1,17 +1,86 @@ -%import textio -%zeropage basicsafe - main { - struct Enemy { - ubyte xpos, ypos - uword health - bool elite + sub start() { + uword @shared sharedvar = 42 + sharedvar = func(sharedvar + 99) + func(4444) } - sub start() { - Enemy[4] enemies ; 4 Enemy instances in a contiguous block, initialized to zero - enemies[2] = enemies[3] - sys.memcopy(&enemies[3], &enemies[2], sizeof(Enemy)) + sub func(uword value) -> uword { + value += 7 + return value*8 } } + +/* + +The above code for the amiga500 target currently compiles to: + + +p8b_main.p8s_start: + bsr run_global_inits + ; storeim.w #$2a,p8b_main.p8s_start.p8v_sharedvar + move.w #42,p8b_main.p8s_start.p8v_sharedvar + ; loadm.w r1,p8b_main.p8s_start.p8v_sharedvar + move.w p8b_main.p8s_start.p8v_sharedvar,p8_regfile+0 + ; add.w r1,#$63 + add.w #99,p8_regfile+0 + ; call p8b_main.p8s_func(p8v_value=r1.w):r2.w + move.w p8_regfile+0,p8b_main.p8s_func.p8v_value + bsr p8b_main.p8s_func + move.w d0,p8_regfile+2 + ; load.w r3,#$115c + move.w #4444,p8_regfile+4 + ; call p8b_main.p8s_func(p8v_value=r3.w):r4.w + move.w p8_regfile+4,p8b_main.p8s_func.p8v_value + bsr p8b_main.p8s_func + move.w d0,p8_regfile+6 + ; addr.w r2,r4 + add.w d0,p8_regfile+2 + ; storem.w r2,p8b_main.p8s_start.p8v_sharedvar + move.w p8_regfile+2,p8b_main.p8s_start.p8v_sharedvar + ; return + rts +; End of subroutine: p8b_main.p8s_start + +p8b_main.p8s_func: + ; addim.w #7,p8b_main.p8s_func.p8v_value + addq.w #7,p8b_main.p8s_func.p8v_value + ; loadm.w r5,p8b_main.p8s_func.p8v_value + move.w p8b_main.p8s_func.p8v_value,p8_regfile+8 + ; lsli.w r5,#3 + move.w p8_regfile+8,d0 + lsl.w #3,d0 + move.w d0,p8_regfile+8 + ; returnr.w r5 + rts +; End of subroutine: p8b_main.p8s_func + + + +After the production register allocation, can we expect it to become something like: + +p8b_main.p8s_start: + bsr run_global_inits + move.w #42,p8b_main.p8s_start.p8v_sharedvar + move.w p8b_main.p8s_start.p8v_sharedvar,d0 + add.w #99,d0 + move.w d0,p8b_main.p8s_func.p8v_value + bsr p8b_main.p8s_func + move.w d0,d1 ; or maybe move.w d0,-(sp) + move.w #4444,p8b_main.p8s_func.p8v_value + bsr p8b_main.p8s_func + add.w d0,d1 + move.w d1,p8b_main.p8s_start.p8v_sharedvar + rts +; End of subroutine: p8b_main.p8s_start + +p8b_main.p8s_func: + addq.w #7,p8b_main.p8s_func.p8v_value + move.w p8b_main.p8s_func.p8v_value,d0 + lsl.w #3,d0 + rts ; directly return value that is already in d0 +; End of subroutine: p8b_main.p8s_func + + + +*/