mirror of
https://github.com/marketideas/qasm.git
synced 2026-10-24 07:02:20 +00:00
Add qlink, the disk tools, and a bootable ProDOS 8 image.
Move the assembler to src/qasm. qlink links OMF 1.0 and 2.0 from a script. makeBin flattens a load file, qomf dumps OMF, and qpro builds ProDOS volumes. APW and MPW assemble through the ORCA front end. Relocatable modules emit OMF objects. Listings stay off unless -l is set. make boot assembles the GS/OS 6.0.1 ProDOS 8 kernel and BASIC.SYSTEM into an 800K volume. BASIC.SYSTEM accepts ls and pfx, and its splash reports PRODOS BASIC 2.0, copyright 1983-2026. IIGS.601.SRC is the source and the BASIC.SYSTEM oracle that image is built from.
This commit is contained in:
1 parent
d034a1570a
commit
dfcaae62dd
1469 files changed
+11833
-172
No files matched your search
@@ -3,6 +3,7 @@
|
||||
/merlin
|
||||
/test_merlin
|
||||
/build/
|
||||
/bin/
|
||||
/CMakeCache.txt
|
||||
/CMakeFiles/
|
||||
/cmake_install.cmake
|
||||
@@ -13,6 +14,11 @@
|
||||
*.obj
|
||||
*.exe
|
||||
*.pcode
|
||||
*.omf
|
||||
*.lib
|
||||
*.L
|
||||
.DS_Store
|
||||
/tmp/
|
||||
__pycache__/
|
||||
*.pyc
|
||||
__MACOSX/
|
||||
+313
-19
@@ -1,4 +1,10 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type: Debug or Release" FORCE)
|
||||
endif()
|
||||
if(NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release)$")
|
||||
message(FATAL_ERROR "CMAKE_BUILD_TYPE must be Debug or Release")
|
||||
endif()
|
||||
project(qasm LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
@@ -6,60 +12,214 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
||||
add_compile_options(-Wall -Wextra -O2 -g)
|
||||
add_compile_options(-Wall -Wextra)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g" CACHE STRING "Debug compile flags" FORCE)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG" CACHE STRING "Release compile flags" FORCE)
|
||||
endif()
|
||||
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
# major.minor.patch for each program. The build number is not set here.
|
||||
# Debug and release each add one per build, stored in bin/.<name>.<config>.build.
|
||||
set(QASM_VERSION_MAJOR 0)
|
||||
set(QASM_VERSION_MINOR 1)
|
||||
set(QASM_VERSION_PATCH 0)
|
||||
set(QLINK_VERSION_MAJOR 0)
|
||||
set(QLINK_VERSION_MINOR 1)
|
||||
set(QLINK_VERSION_PATCH 0)
|
||||
set(MAKEBIN_VERSION_MAJOR 0)
|
||||
set(MAKEBIN_VERSION_MINOR 1)
|
||||
set(MAKEBIN_VERSION_PATCH 0)
|
||||
set(QOMF_VERSION_MAJOR 0)
|
||||
set(QOMF_VERSION_MINOR 1)
|
||||
set(QOMF_VERSION_PATCH 0)
|
||||
set(QPRO_VERSION_MAJOR 0)
|
||||
set(QPRO_VERSION_MINOR 1)
|
||||
set(QPRO_VERSION_PATCH 0)
|
||||
|
||||
set(BIN_DIR ${CMAKE_SOURCE_DIR}/bin)
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(VERSION_CONFIG debug)
|
||||
set(BIN_OUT ${BIN_DIR}/debug)
|
||||
else()
|
||||
set(VERSION_CONFIG release)
|
||||
set(BIN_OUT ${BIN_DIR})
|
||||
endif()
|
||||
|
||||
# Write <name>_version.cpp and a trigger file. The trigger is removed after
|
||||
# the link, so the next build of this program and configuration increments.
|
||||
function(add_version_source target name major minor patch)
|
||||
set(cpp ${CMAKE_BINARY_DIR}/generated/${name}_version.cpp)
|
||||
set(trigger ${CMAKE_BINARY_DIR}/generated/${name}_version.trigger)
|
||||
add_custom_command(
|
||||
OUTPUT ${cpp} ${trigger}
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DNAME=${name}
|
||||
-DMAJOR=${major}
|
||||
-DMINOR=${minor}
|
||||
-DPATCH=${patch}
|
||||
-DCONFIG=${VERSION_CONFIG}
|
||||
-DCOUNTER=${BIN_DIR}/.${name}.${VERSION_CONFIG}.build
|
||||
-DOUT=${cpp}
|
||||
-DTRIGGER=${trigger}
|
||||
-P ${CMAKE_SOURCE_DIR}/cmake/bump_build.cmake
|
||||
DEPENDS ${CMAKE_SOURCE_DIR}/cmake/bump_build.cmake
|
||||
COMMENT "Increment ${name} ${VERSION_CONFIG} build number"
|
||||
VERBATIM
|
||||
)
|
||||
target_sources(${target} PRIVATE ${cpp})
|
||||
set_source_files_properties(${cpp} PROPERTIES GENERATED TRUE)
|
||||
set(${name}_VERSION_TRIGGER ${trigger} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Copy the linked executable into the untracked bin/ directory.
|
||||
# Release lands in bin/. Debug lands in bin/debug/.
|
||||
function(copy_to_bin target)
|
||||
cmake_parse_arguments(ARG "" "TRIGGER" "" ${ARGN})
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${BIN_OUT}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${target}> ${BIN_OUT}/$<TARGET_FILE_NAME:${target}>
|
||||
VERBATIM
|
||||
)
|
||||
if(ARG_TRIGGER)
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E rm -f ${ARG_TRIGGER}
|
||||
VERBATIM
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
set(QASM_LIB_SOURCES
|
||||
src/util.cpp
|
||||
src/parse.cpp
|
||||
src/expr.cpp
|
||||
src/opcode.cpp
|
||||
src/assemble.cpp
|
||||
src/compile.cpp
|
||||
src/front_merlin.cpp
|
||||
src/front_orca.cpp
|
||||
src/front_lisa.cpp
|
||||
src/front_ca65.cpp
|
||||
src/qasm/util.cpp
|
||||
src/qasm/parse.cpp
|
||||
src/qasm/expr.cpp
|
||||
src/qasm/opcode.cpp
|
||||
src/qasm/assemble.cpp
|
||||
src/qasm/compile.cpp
|
||||
src/qasm/front_merlin.cpp
|
||||
src/qasm/front_orca.cpp
|
||||
src/qasm/front_lisa.cpp
|
||||
src/qasm/front_ca65.cpp
|
||||
src/omf/omf.cpp
|
||||
)
|
||||
|
||||
add_library(qasm_lib STATIC ${QASM_LIB_SOURCES})
|
||||
target_include_directories(qasm_lib PUBLIC src)
|
||||
target_include_directories(qasm_lib PUBLIC src/qasm PRIVATE src/omf)
|
||||
target_link_libraries(qasm_lib PUBLIC Threads::Threads)
|
||||
|
||||
add_executable(qasm src/main.cpp)
|
||||
add_executable(qasm src/qasm/main.cpp)
|
||||
target_link_libraries(qasm PRIVATE qasm_lib)
|
||||
add_version_source(qasm qasm ${QASM_VERSION_MAJOR} ${QASM_VERSION_MINOR} ${QASM_VERSION_PATCH})
|
||||
copy_to_bin(qasm TRIGGER ${qasm_VERSION_TRIGGER})
|
||||
|
||||
add_executable(qlink src/qlink/qlink.cpp src/qlink/link.cpp src/omf/omf.cpp)
|
||||
target_include_directories(qlink PRIVATE src/qlink src/omf)
|
||||
add_version_source(qlink qlink ${QLINK_VERSION_MAJOR} ${QLINK_VERSION_MINOR} ${QLINK_VERSION_PATCH})
|
||||
copy_to_bin(qlink TRIGGER ${qlink_VERSION_TRIGGER})
|
||||
|
||||
add_executable(test_qasm test/test_qasm.cpp)
|
||||
target_link_libraries(test_qasm PRIVATE qasm_lib)
|
||||
copy_to_bin(test_qasm)
|
||||
|
||||
add_executable(test_qlink test/test_qlink.cpp src/qlink/link.cpp src/omf/omf.cpp)
|
||||
target_include_directories(test_qlink PRIVATE src/qlink src/omf)
|
||||
copy_to_bin(test_qlink)
|
||||
|
||||
add_executable(makeBin src/makebin/main.cpp src/makebin/makebin.cpp src/omf/omf.cpp)
|
||||
target_include_directories(makeBin PRIVATE src/makebin src/omf)
|
||||
add_version_source(makeBin makeBin ${MAKEBIN_VERSION_MAJOR} ${MAKEBIN_VERSION_MINOR} ${MAKEBIN_VERSION_PATCH})
|
||||
copy_to_bin(makeBin TRIGGER ${makeBin_VERSION_TRIGGER})
|
||||
|
||||
add_executable(test_makebin test/test_makebin.cpp src/makebin/makebin.cpp src/qlink/link.cpp src/omf/omf.cpp)
|
||||
target_include_directories(test_makebin PRIVATE src/makebin src/qlink src/omf)
|
||||
copy_to_bin(test_makebin)
|
||||
|
||||
add_executable(qomf src/qomf/main.cpp src/qomf/qomf.cpp)
|
||||
target_include_directories(qomf PRIVATE src/qomf)
|
||||
add_version_source(qomf qomf ${QOMF_VERSION_MAJOR} ${QOMF_VERSION_MINOR} ${QOMF_VERSION_PATCH})
|
||||
copy_to_bin(qomf TRIGGER ${qomf_VERSION_TRIGGER})
|
||||
|
||||
add_executable(test_qomf test/test_qomf.cpp src/qomf/qomf.cpp src/qlink/link.cpp src/omf/omf.cpp)
|
||||
target_include_directories(test_qomf PRIVATE src/qomf src/qlink src/omf)
|
||||
copy_to_bin(test_qomf)
|
||||
|
||||
add_executable(qpro src/qpro/main.cpp src/qpro/qpro.cpp)
|
||||
target_include_directories(qpro PRIVATE src/qpro)
|
||||
add_version_source(qpro qpro ${QPRO_VERSION_MAJOR} ${QPRO_VERSION_MINOR} ${QPRO_VERSION_PATCH})
|
||||
copy_to_bin(qpro TRIGGER ${qpro_VERSION_TRIGGER})
|
||||
|
||||
add_executable(test_qpro test/test_qpro.cpp src/qpro/qpro.cpp)
|
||||
target_include_directories(test_qpro PRIVATE src/qpro)
|
||||
copy_to_bin(test_qpro)
|
||||
|
||||
# Unit tests and the assembler open PUT/USE paths from the repository root.
|
||||
set(QASM_ROOT ${CMAKE_SOURCE_DIR})
|
||||
|
||||
# One program, five syntaxes. The objects are compared after assembly.
|
||||
# One program, six syntaxes. The objects are compared after assembly.
|
||||
set(COVERAGE_SOURCES
|
||||
test/fixtures/coverage-merlin.s
|
||||
test/fixtures/coverage-merlin32.s
|
||||
test/fixtures/coverage-orca.s
|
||||
test/fixtures/coverage-apw.s
|
||||
test/fixtures/coverage-lisa.s
|
||||
test/fixtures/coverage-ca65.s
|
||||
)
|
||||
|
||||
# Two relocatable sections. CODE calls and addresses DATA, and DATA calls
|
||||
# and addresses CODE. Each syntax assembles to the same bytes.
|
||||
set(REL_CODE_SOURCES
|
||||
test/fixtures/rel-code-merlin.s
|
||||
test/fixtures/rel-code-merlin32.s
|
||||
test/fixtures/rel-code-orca.s
|
||||
test/fixtures/rel-code-apw.s
|
||||
test/fixtures/rel-code-lisa.s
|
||||
test/fixtures/rel-code-ca65.s
|
||||
)
|
||||
set(REL_DATA_SOURCES
|
||||
test/fixtures/rel-data-merlin.s
|
||||
test/fixtures/rel-data-merlin32.s
|
||||
test/fixtures/rel-data-orca.s
|
||||
test/fixtures/rel-data-apw.s
|
||||
test/fixtures/rel-data-lisa.s
|
||||
test/fixtures/rel-data-ca65.s
|
||||
)
|
||||
|
||||
set(COVERAGE_COMPARE
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files
|
||||
test/fixtures/coverage-merlin.bin test/fixtures/coverage-merlin32.bin
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files
|
||||
test/fixtures/coverage-merlin.bin test/fixtures/coverage-orca.bin
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files
|
||||
test/fixtures/coverage-merlin.bin test/fixtures/coverage-apw.bin
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files
|
||||
test/fixtures/coverage-merlin.bin test/fixtures/coverage-lisa.bin
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files
|
||||
test/fixtures/coverage-merlin.bin test/fixtures/coverage-ca65.bin
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files
|
||||
test/fixtures/rel-code-merlin.bin test/fixtures/rel-code-merlin32.bin
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files
|
||||
test/fixtures/rel-code-merlin.bin test/fixtures/rel-code-orca.bin
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files
|
||||
test/fixtures/rel-code-merlin.bin test/fixtures/rel-code-apw.bin
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files
|
||||
test/fixtures/rel-code-merlin.bin test/fixtures/rel-code-lisa.bin
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files
|
||||
test/fixtures/rel-code-merlin.bin test/fixtures/rel-code-ca65.bin
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files
|
||||
test/fixtures/rel-data-merlin.bin test/fixtures/rel-data-merlin32.bin
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files
|
||||
test/fixtures/rel-data-merlin.bin test/fixtures/rel-data-orca.bin
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files
|
||||
test/fixtures/rel-data-merlin.bin test/fixtures/rel-data-apw.bin
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files
|
||||
test/fixtures/rel-data-merlin.bin test/fixtures/rel-data-lisa.bin
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files
|
||||
test/fixtures/rel-data-merlin.bin test/fixtures/rel-data-ca65.bin
|
||||
)
|
||||
|
||||
add_custom_target(fixtures
|
||||
COMMAND $<TARGET_FILE:qasm> ${COVERAGE_SOURCES}
|
||||
COMMAND $<TARGET_FILE:qasm> ${COVERAGE_SOURCES} ${REL_CODE_SOURCES} ${REL_DATA_SOURCES}
|
||||
${COVERAGE_COMPARE}
|
||||
DEPENDS qasm
|
||||
WORKING_DIRECTORY ${QASM_ROOT}
|
||||
@@ -70,12 +230,16 @@ add_custom_target(fixtures
|
||||
add_custom_target(test
|
||||
COMMAND $<TARGET_FILE:test_qasm>
|
||||
COMMAND $<TARGET_FILE:qasm> test/fixtures/hello.s test/test.s
|
||||
COMMAND $<TARGET_FILE:qasm> ${COVERAGE_SOURCES}
|
||||
COMMAND $<TARGET_FILE:qasm> ${COVERAGE_SOURCES} ${REL_CODE_SOURCES} ${REL_DATA_SOURCES}
|
||||
${COVERAGE_COMPARE}
|
||||
DEPENDS qasm test_qasm
|
||||
COMMAND $<TARGET_FILE:test_qlink>
|
||||
COMMAND ${CMAKE_COMMAND} -E env MAKEBIN=$<TARGET_FILE:makeBin> $<TARGET_FILE:test_makebin>
|
||||
COMMAND ${CMAKE_COMMAND} -E env QOMF=$<TARGET_FILE:qomf> $<TARGET_FILE:test_qomf>
|
||||
COMMAND ${CMAKE_COMMAND} -E env QPRO=$<TARGET_FILE:qpro> $<TARGET_FILE:test_qpro>
|
||||
DEPENDS qasm test_qasm test_qlink test_makebin test_qomf test_qpro qlink makeBin qomf qpro
|
||||
WORKING_DIRECTORY ${QASM_ROOT}
|
||||
USES_TERMINAL
|
||||
COMMENT "Run unit tests, sample assembly, and coverage fixtures"
|
||||
COMMENT "Run unit tests, sample assembly, coverage fixtures, and the linker"
|
||||
)
|
||||
|
||||
set(QASM_CLEAN_FILES
|
||||
@@ -86,12 +250,142 @@ set(QASM_CLEAN_FILES
|
||||
${QASM_ROOT}/test/test.lst
|
||||
${QASM_ROOT}/test/test.pcode
|
||||
)
|
||||
foreach(src ${COVERAGE_SOURCES})
|
||||
foreach(src ${COVERAGE_SOURCES} ${REL_CODE_SOURCES} ${REL_DATA_SOURCES})
|
||||
string(REGEX REPLACE "\\.s$" "" stem "${src}")
|
||||
list(APPEND QASM_CLEAN_FILES
|
||||
${QASM_ROOT}/${stem}.bin
|
||||
${QASM_ROOT}/${stem}.lst
|
||||
${QASM_ROOT}/${stem}.pcode
|
||||
${QASM_ROOT}/${stem}.o
|
||||
)
|
||||
endforeach()
|
||||
foreach(out apple.omf apple-orca.omf apple-ca65.omf apple-apw.omf prog.omf
|
||||
proglib.omf gap.omf merged.omf runtime.lib bad.omf)
|
||||
list(APPEND QASM_CLEAN_FILES ${QASM_ROOT}/test/fixtures/${out})
|
||||
endforeach()
|
||||
# ProDOS 8 disk that boots BASIC.SYSTEM. Not part of `all` or `test`.
|
||||
# Intermediates stay in build/boot. The image and the two SYS files land in bin/.
|
||||
# `make boot` deletes those and builds the boot.2mg target.
|
||||
set(BOOT_DIR ${QASM_ROOT}/build/boot)
|
||||
set(BOOT_BIN ${QASM_ROOT}/bin)
|
||||
set(P8_MLI ${QASM_ROOT}/IIGS.601.SRC/GS.OS/P8/MliSrc.aii)
|
||||
set(P8_RAM ${QASM_ROOT}/IIGS.601.SRC/GS.OS/P8/P8.Drivers/Ram.n)
|
||||
set(P8_CLOCK ${QASM_ROOT}/IIGS.601.SRC/GS.OS/P8/P8.Drivers/CClock.n)
|
||||
set(BS_DIR ${QASM_ROOT}/IIGS.601.SRC/BASIC.SYSTEM)
|
||||
set(BOOT_PACK ${QASM_ROOT}/boot/pack.py)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${BOOT_DIR}/mli.lst ${BOOT_DIR}/mli.bin
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${BOOT_DIR}
|
||||
COMMAND $<TARGET_FILE:qasm> --syntax apw -I ${QASM_ROOT}/boot/inc
|
||||
-l ${BOOT_DIR}/mli.lst -o ${BOOT_DIR}/mli.bin ${P8_MLI}
|
||||
DEPENDS qasm ${P8_MLI}
|
||||
${QASM_ROOT}/boot/inc/e16.memory ${QASM_ROOT}/boot/inc/M16.UTIL
|
||||
WORKING_DIRECTORY ${QASM_ROOT}
|
||||
COMMENT "Assemble the ProDOS 8 kernel"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${BOOT_DIR}/ram.lst ${BOOT_DIR}/ram.bin
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${BOOT_DIR}
|
||||
COMMAND $<TARGET_FILE:qasm> --syntax apw
|
||||
-l ${BOOT_DIR}/ram.lst -o ${BOOT_DIR}/ram.bin ${P8_RAM}
|
||||
DEPENDS qasm ${P8_RAM}
|
||||
WORKING_DIRECTORY ${QASM_ROOT}
|
||||
COMMENT "Assemble the ProDOS 8 RAM driver"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${BOOT_DIR}/clock.lst ${BOOT_DIR}/clock.bin
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${BOOT_DIR}
|
||||
COMMAND $<TARGET_FILE:qasm> --syntax apw
|
||||
-l ${BOOT_DIR}/clock.lst -o ${BOOT_DIR}/clock.bin ${P8_CLOCK}
|
||||
DEPENDS qasm ${P8_CLOCK}
|
||||
WORKING_DIRECTORY ${QASM_ROOT}
|
||||
COMMENT "Assemble the ProDOS 8 GS clock driver"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${BOOT_BIN}/PRODOS
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${BOOT_BIN}
|
||||
COMMAND python3 ${BOOT_PACK} prodos ${BOOT_BIN}/PRODOS
|
||||
${BOOT_DIR}/mli.lst ${BOOT_DIR}/ram.lst ${BOOT_DIR}/clock.lst
|
||||
DEPENDS ${BOOT_PACK} ${BOOT_DIR}/mli.lst ${BOOT_DIR}/ram.lst ${BOOT_DIR}/clock.lst
|
||||
WORKING_DIRECTORY ${QASM_ROOT}
|
||||
COMMENT "Pack PRODOS"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${BOOT_DIR}/basic.s
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${BOOT_DIR}
|
||||
COMMAND python3 ${BOOT_PACK} join-basic -o ${BOOT_DIR}/basic.s
|
||||
${BS_DIR}/LOADER ${BS_DIR}/MAIN ${BS_DIR}/GLOBALS
|
||||
DEPENDS ${BOOT_PACK} ${BS_DIR}/LOADER ${BS_DIR}/MAIN ${BS_DIR}/GLOBALS
|
||||
WORKING_DIRECTORY ${QASM_ROOT}
|
||||
COMMENT "Join BASIC.SYSTEM"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${BOOT_DIR}/basic.lst ${BOOT_DIR}/basic.bin
|
||||
COMMAND $<TARGET_FILE:qasm> --syntax apw -I ${BS_DIR}
|
||||
-l ${BOOT_DIR}/basic.lst -o ${BOOT_DIR}/basic.bin ${BOOT_DIR}/basic.s
|
||||
DEPENDS qasm ${BOOT_DIR}/basic.s ${BS_DIR}/EQUATES
|
||||
WORKING_DIRECTORY ${QASM_ROOT}
|
||||
COMMENT "Assemble BASIC.SYSTEM"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${BOOT_BIN}/BASIC.SYSTEM
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${BOOT_BIN}
|
||||
COMMAND python3 ${BOOT_PACK} basic ${BOOT_BIN}/BASIC.SYSTEM ${BOOT_DIR}/basic.lst
|
||||
--oracle ${BS_DIR}/BASIC.SYSTEM
|
||||
DEPENDS ${BOOT_PACK} ${BOOT_DIR}/basic.lst ${BS_DIR}/BASIC.SYSTEM
|
||||
WORKING_DIRECTORY ${QASM_ROOT}
|
||||
COMMENT "Pack BASIC.SYSTEM"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${BOOT_DIR}/p8boot.lst ${BOOT_DIR}/p8boot.bin
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${BOOT_DIR}
|
||||
COMMAND $<TARGET_FILE:qasm> --syntax merlin
|
||||
-l ${BOOT_DIR}/p8boot.lst -o ${BOOT_DIR}/p8boot.bin
|
||||
${QASM_ROOT}/boot/p8boot.s
|
||||
DEPENDS qasm ${QASM_ROOT}/boot/p8boot.s
|
||||
WORKING_DIRECTORY ${QASM_ROOT}
|
||||
COMMENT "Assemble the ProDOS 8 boot block"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${BOOT_BIN}/boot.2mg
|
||||
COMMAND ${CMAKE_COMMAND} -E rm -f ${BOOT_DIR}/image.2mg ${BOOT_BIN}/boot.2mg
|
||||
COMMAND $<TARGET_FILE:qpro> create ${BOOT_DIR}/image.2mg -name BASIC -size 800k
|
||||
COMMAND $<TARGET_FILE:qpro> boot ${BOOT_DIR}/image.2mg ${BOOT_DIR}/p8boot.bin
|
||||
COMMAND $<TARGET_FILE:qpro> add ${BOOT_DIR}/image.2mg PRODOS ${BOOT_BIN}/PRODOS -t FF -a 0000
|
||||
COMMAND $<TARGET_FILE:qpro> add ${BOOT_DIR}/image.2mg BASIC.SYSTEM ${BOOT_BIN}/BASIC.SYSTEM -t FF -a 2000
|
||||
COMMAND python3 ${BOOT_PACK} check ${BOOT_DIR}/image.2mg
|
||||
${BOOT_BIN}/PRODOS ${BOOT_BIN}/BASIC.SYSTEM
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${BOOT_DIR}/image.2mg ${BOOT_BIN}/boot.2mg
|
||||
DEPENDS qpro ${BOOT_PACK} ${BOOT_BIN}/PRODOS ${BOOT_BIN}/BASIC.SYSTEM ${BOOT_DIR}/p8boot.bin
|
||||
WORKING_DIRECTORY ${QASM_ROOT}
|
||||
COMMENT "Build boot.2mg"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
add_custom_target(prodos DEPENDS ${BOOT_BIN}/PRODOS)
|
||||
add_custom_target(basic.system DEPENDS ${BOOT_BIN}/BASIC.SYSTEM)
|
||||
add_custom_target(boot.2mg DEPENDS ${BOOT_BIN}/boot.2mg)
|
||||
|
||||
list(APPEND QASM_CLEAN_FILES
|
||||
${BOOT_BIN}/PRODOS
|
||||
${BOOT_BIN}/BASIC.SYSTEM
|
||||
${BOOT_BIN}/boot.2mg
|
||||
)
|
||||
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES ${QASM_CLEAN_FILES})
|
||||
@@ -0,0 +1 @@
|
||||
tmlpascal initintfdata.pii␍asmiigs initintfdata.pii.aii␍tmlpascal InitIntfProc.pii␍asmiigs InitIntfProc.pii.aii␍tmlpascal InitIntfPDOS.pii␍asmiigs InitIntfPDOS.pii.aii␍tmlpascal ListMgr.pii␍asmiigs ListMgr.pii.aii␍tmlpascal Globals.pii␍asmiigs Globals.pii.aii␍tmlpascal Utils.pii␍asmiigs Utils.pii.aii␍tmlpascal Guts.pii␍asmiigs Guts.pii.aii␍tmlpascal Dialog.pii␍asmiigs Dialog.pii.aii␍tmlpascal Menu.pii␍asmiigs Menu.pii.aii␍tmlpascal Event.pii␍asmiigs Event.pii.aii␍tmlpascal Init.pii␍asmiigs Init.pii.aii␍asmiigs OS.aii␍asmiigs Data.aii␍␍␍linkiigs -l -s >map ś␍ -lseg Darryl:$1000 ś␍ Init.pii.aii.obj ś␍ Utils.pii.aii.obj ś␍ Guts.pii.aii.obj ś␍ Dialog.pii.aii.obj ś␍ Menu.pii.aii.obj ś␍ Event.pii.aii.obj ś␍ OS.aii.obj ś␍ Globals.pii.aii.obj ś␍ Data.aii.obj ś␍ "{PIIGSLibrary}PIIGSRuntime.obj" ś␍ -lib "{PIIGSLibrary}PIIGSRuntime.obj" ś␍ -at $db03 ś␍ -o ADV.DISK.UTIL␍␍␍### Copy file to a IIGS disk␍DuplicateIIGS -y -mac ADV.DISK.UTIL :␍␍
|
||||
@@ -0,0 +1 @@
|
||||
=========================== CHANGES FOR 1.1D2 ==========================␍␍¥ Changed version # to 1.1d5
|
||||
@@ -0,0 +1 @@
|
||||
;################################################################
;# #
;# File: Data.Asm from IIGS Disk Initializer #
;# #
;#--------------------------------------------------------------#
;# #
;# Description: This file has all the global data used by #
;# the IIGS disk initializer #
;# #
;#--------------------------------------------------------------#
;# #
;# Author: Darryl Lovato #
;# #
;#--------------------------------------------------------------#
;# #
;# Copyright: 1987,1988 by Apple Computer Inc. #
;# All rights reserved. #
;# #
;#--------------------------------------------------------------#
;# #
;# Modification History: #
;# #
;# Who When The Change #
;# --- ------ ------------------------------------- #
;# SR 12/7/87 Created v.1 - erase & init only #
;# DGL 1/29/88 Rewrote everything - cut size in half! #
;# DGL 5/9/88 Finished Adding Partition Support #
;# and other features... far too many to #
;# list here... #
;# DGL 6/1/88 Alpha! #
;# DGL 6/13/88 Alpha 2 #
;# DGL 6/24/88 Alpha 3 #
;# DGL 7/1/88 Beta 1 #
;# DGL 7/13/88 Beta 2 #
;# DGL 7/20/88 Beta 3 #
;# DGL 7/27/88 Beta 4 #
;# DGL 8/1/88 Beta 5 #
;# DGL 8/8/88 Beta 6 #
;# DGL 8/15/88 Final! #
;# #
;################################################################
STRING ASIS
;BLANKS OFF
BLANKS ON
MACHINE M65816
LONGA on
LONGI on
;################################################################
;# Imported addresses #
;################################################################
IMPORT AboutItem2,AboutItem3,AboutItem5,AboutItem6
IMPORT AboutItem7,AboutItem8,AboutItem9,DOS,DiskItem1
IMPORT DiskItem2,DiskItem3,InfoAvail,InfoDevName
IMPORT InfoFileSys,InfoItem1,InfoItem10,InfoItem11
IMPORT InfoItem12,InfoItem2,InfoItem3,InfoItem4
IMPORT InfoItem5,InfoItem6,InfoItem7,InfoItem8
IMPORT InfoItem9,InfoParts,InfoUsed,InfoVolume
IMPORT InitItem10,InitItem11,InitItem2,Item3Str
IMPORT L,PartDel,PartInit,PartItem2,PartItem3,PartItem4
IMPORT PartItem6,PartItem7,PartItem8,PartItem9,PartNew
IMPORT ScrollAction,ScrollCTbl,WarningCancel,WarningItem1
IMPORT WarningItem2,WarningOK,emptystr,miscstr,miscstr1
EXPORT Data
Data PROC
;################################################################
;# string macro #
;################################################################
MACRO
str &string
lclc &sset
&sset SETC &SETTING('STRING')
STRING PASCAL
dc.B &string
STRING &sset
MEND
;################################################################
;# version macro #
;################################################################
MACRO
&lab Version
lclc &sset
&sset SETC &SETTING('STRING')
STRING ASIS
&lab DC.B '1.2' ;maintain version string here and in "adu.rii"
STRING &sset
MEND
;################################################################
;# Table for getting the File System ID String #
;################################################################
EXPORT FileSysStrTbl
FileSysStrTbl
DC.L FS1
DC.L FS2
DC.L FS3
DC.L FS4
DC.L FS5
DC.L FS6
DC.L FS7
DC.L FS8
DC.L FS9
DC.L FSA
DC.L FSB
DC.L FSC
EXPORT unknownptr
unknownptr
DC.L unknown
FS1 str 'ProDOS'
FS2 str 'DOS 3.3'
FS3 str 'DOS 3.1, 3.2'
FS4 str 'Apple II Pascal'
FS5 str 'Macintosh MFS'
FS6 str 'HFS'
FS7 str 'LISA'
FS8 str 'Apple CP/M'
FS9 str 'Character FST'
FSA str 'MS/DOS'
FSB str 'High Sierra'
FSC str 'Apple File Server'
unknown str 'Unknown File System'
EXPORT drvrProcessor
drvrProcessor ; Table of pointer to processor ID strings for
; drver partition entries in partition map
dc.l drvrStr1
dc.l drvrStr2
dc.l drvrStr3
dc.l drvrStr4
STRING PASCAL
drvrStr1 dc.b '68000'
drvrStr2 dc.b '68XXX'
drvrStr3 dc.b '68XXX'
drvrStr4 dc.b '65XXX'
STRING ASIS
EXPORT OpenPBlk
OpenPBlk ; Param block to open files
dc.w $000C ;pcount through eof
ds.w 1 ;ref num
ds.l 1 ;path pointer
dc.w $0001 ;req access = read-only
dc.w $0000 ;res num = data fork
ds.w 1 ;return access
ds.w 1 ;returned filetype
ds.l 1 ;returned auxtype
ds.w 1 ;returned storage type
ds.b 8 ;create time/date
ds.b 8 ;mod time/date
dc.l $00000000 ;option list ptr
ds.l 1 ;eof
EXPORT drvrPath
drvrPath ;expected path of generic boot driver file
dc.w @end-@start
@start
dc.b '*:SYSTEM:DRIVERS:GenericMacSCSI'
@end
EXPORT ReadPBlk
ReadPBlk ; Param block to read from file
dc.w $0004 ;pcount through transfer count
ds.w 1 ;ref num
ds.l 1 ;data buffer
ds.l 1 ;req count
ds.l 1 ;transfer count
EXPORT ClosePBlk
ClosePBlk ; Param block to close file
dc.w $0001 ;pcount
ds.w 1 ;ref num
;################################################################
;# INFO Dialog Template #
;################################################################
EXPORT InfoDITL
InfoDITL
DC.W 30,110,142,530 ; rect
DC.W $FF ; visible
DC.L $1002 ;Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{################################################################}
{# #}
{# File: Dialog.Pas from IIGS Disk Initializer #}
{# #}
{#--------------------------------------------------------------#}
{# #}
{# Description: This file has all the routines that handle #}
{# the creation, functionality and disposal of #}
{# the dialogs used in the program. #}
{# #}
{#--------------------------------------------------------------#}
{# #}
{# Author: Darryl Lovato #}
{# #}
{#--------------------------------------------------------------#}
{# #}
{# Copyright: 1987,1988 by Apple Computer Inc. #}
{# All rights reserved. #}
{# #}
{#--------------------------------------------------------------#}
{# #}
{# Modification History: #}
{# #}
{# Who When The Change #}
{# --- ------ ------------------------------------- #}
{# SR 12/7/87 Created v.1 - erase & init only #}
{# DGL 1/29/88 Rewrote everything - cut size in half! #}
{# DGL 5/9/88 Finished Adding Partition Support #}
{# and other features... far too many to #}
{# list here... #}
{# DGL 5/12/88 Added Zero and Info operations #}
{# DGL 5/20/88 Released pre-alpha version to testers #}
{# DGL 6/1/88 Alpha! #}
{# DGL 6/13/88 Alpha 2 #}
{# DGL 6/24/88 Alpha 3 #}
{# DGL 7/1/88 Beta 1 #}
{# DGL 7/13/88 Beta 2 #}
{# DGL 7/20/88 Beta 3 #}
{# DGL 7/27/88 Beta 4 #}
{# DGL 8/1/88 Beta 5 #}
{# DGL 8/8/88 Beta 6 #}
{# DGL 8/15/88 Final! #}
{# #}
{################################################################}
{ these options turn long addressing on, and turn error checking off}
{ in addition, they set the pascal comments in assembler on.}
{$LongGLobals-}
{$ToolErrorChk-}
{$ToolErrorChk+}
{$A+}
unit Dialog;
interface
uses
InitIntfData,
InitIntfProc,
InitIntfPDOS,
ListMgr,
Globals,
Utils,
Guts;
procedure DoAboutItem; {About item in apple menu}
procedure ShowInit; {Init Dialog}
procedure SetActivePartition(thePart : integer);
procedure ProcessInit; { handle control hit in main Dlog }
procedure NextDrive;
implementation
procedure DrawAlloChart(totalRedraw : boolean); FORWARD;
PROCEDURE MainWindUpdt; FORWARD;
{################################################################}
{# filter to be called for dlogs with 1 item lists #}
{################################################################}
function myDlogFilter(theDlog : grafportptr; var someEvent : wmTaskRec;
var itemhit : integer) : integer;
const
isfalse = 0;
istrue = $FFFF;
EnterChar = 3;
Tab = 9;
CRChar = 13;
Escape = 27;
LArrow = 21;
RArrow = 8;
Rubout = 127;
var
temp : integer;
theControl : ControlHandle;
{ temp1,temp2 : Longint; }
test1 : boolean;
ch : char;
{ lowerflag : boolean; }
tempPt : Point;
BEGIN
PHB; { added 3/91 by Monte }
phk; {make sure data bank is set correctly}
plb;
myDlogFilter := 0;
with someEvent do
begin
if wmWhat = 1 then { mouse-down }
begin
temp := findcontrol(theControl,wmwhere.h,wmwhere.v,theDlog);
GlobalToLocal(wmwhere);
test1 := PtInRect(wmwhere, listRect1);
LocalToGlobal(wmwhere);
if test1 then
begin
myDlogFilter := $F;
itemhit := 100;
end;
if theControl <> SizeBar then {its not our scroll bar, not the lists!}
if (temp in [5..8, 129]) or test1 then
begin
RestoreRefCons;
temp := TrackControl(wmwhere.h,wmwhere.v, Pointer(-1), theControl);
ZeroRefCons;
wmwhat := 0; {can you say kludge?}
end;
{make cr's look like cr's!}
end
else if (wmWhat = 3) or (wmWhat = 5) then { keydown, autokey}
{ Key filter stuff eliminated 3/31/91 by Monte Benaresh }
{ b/c we now have an init/erase dialog in the OS which enforced }
{ name syntax and this filter is used in situations where the }
{ ProDOS name restrictions do not apply. }
BEGIN
if char(loword(bitand(wmMessage,$FF))) = char($D) then { cr!}
begin
itemhit := 1; {default button}
myDlogFilter := 1; {True}
if theDlog = partDlog then
begin
temp := currPart;
SetActivePartition(-2);
currPart := temp;
end
else
BlinkButton(GetControlItem(theDlog,1));
end
else
begin
ch := char(bitand(loword(wmMessage), $FF));
(* lowerflag := (ord(ch) >= ord('a')) and (ord(ch) <= ord('z'));
if (bitand(wmModifiers,OptionKey+ControlKey) = 0) and
(lowerflag or
(ch = '.') or
(ch = char(EnterChar)) or
(ch = char(Tab)) or
(ch = char(Escape)) or
(ch = char(RArrow)) or
(ch = char(LArrow)) or
Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{################################################################}
{# #}
{# File: Event.Pas from IIGS Disk Initializer #}
{# #}
{#--------------------------------------------------------------#}
{# #}
{# Description: This file has all the routines that handle #}
{# the events in the IIGS Disk Initializer. #}
{# #}
{#--------------------------------------------------------------#}
{# #}
{# Author: Darryl Lovato #}
{# #}
{#--------------------------------------------------------------#}
{# #}
{# Copyright: 1987,1988 by Apple Computer Inc. #}
{# All rights reserved. #}
{# #}
{#--------------------------------------------------------------#}
{# #}
{# Modification History: #}
{# #}
{# Who When The Change #}
{# --- ------ ------------------------------------- #}
{# SR 12/7/87 Created v.1 - erase & init only #}
{# DGL 1/29/88 Rewrote everything - cut size in half! #}
{# DGL 5/9/88 Finished Adding Partition Support #}
{# and other features... far too many to #}
{# list here... #}
{# DGL 5/12/88 Added Zero and Info operations #}
{# DGL 5/20/88 Released pre-alpha version to testers #}
{# DGL 6/1/88 Alpha! #}
{# DGL 6/13/88 Alpha 2 #}
{# DGL 6/24/88 Alpha 3 #}
{# DGL 7/1/88 Beta 1 #}
{# DGL 7/13/88 Beta 2 #}
{# DGL 7/20/88 Beta 3 #}
{# DGL 7/27/88 Beta 4 #}
{# DGL 8/1/88 Beta 5 #}
{# DGL 8/8/88 Beta 6 #}
{# DGL 8/15/88 Final! #}
{# #}
{################################################################}
{$LongGLobals-}
{$ToolErrorChk-}
{$A+}
unit Event;
interface
uses
InitIntfData,
InitIntfProc,
InitIntfPdos,
ListMgr,
Globals,
Utils,
Guts,
Dialog,
Menu;
procedure MainEvent; {Main event handling loop which repeats until Quit}
implementation
{################################################################}
{# main event loop, heres where the action is! #}
{################################################################}
PROCEDURE MainEvent;
VAR
temp : boolean;
lastDA : boolean;
taskCode : INTEGER;
{ nowTick : LONGINT; }
hdiResult : LONGINT;
hdiFlags, hdiDev : INTEGER;
tempErr : INTEGER;
clickPoint : Point;
BEGIN
Event.wmTaskMask := $1FFFFF; {Allow TaskMaster to do everything}
Done := false; {Done flag will be set by Quit item}
repeat
taskCode := TaskMaster(-1,Event);
if taskCode = winMenuBar then DoMenu;
IF taskCode = wInControl THEN ProcessInit; { handle ctl hitÉ }
{Éin main Dlog }
IF taskCode = wInContent THEN
BEGIN { check for click in icon rectangle }
clickPoint := Event.wmWhere;
SetPort(InitDlogPtr); { just in case }
GlobalToLocal(clickPoint);
IF PtInRect(clickPoint, mainIconRect) THEN
SetLongText(@dispVolumeStr); { show volume name }
END;
temp := IsDa(FrontWindow); { dim the edit menu if its a DA on top!}
if temp <> lastDA then
begin
lastDA := temp;
if temp then
SetmenuFlag($FF7F, 900)
else
SetmenuFlag($0080, 900);
DrawmenuBar;
end;
{ scan for disk inserts/ejects }
hdiResult := HandleDiskInsert(hdiScan + hdiEjects, 0);
hdiFlags := Longword(hdiResult).HiWord;
hdiDev := Longword(hdiResult).LoWord;
IF (hdiDev = deviceNum) AND (hdiDev <> 0) THEN { is it our current device? }
BEGIN { must have been ejected, so move on to next online device }
MakeCursor(watch);
{repeat }
NextDrive; {Skip over nonexistent Disk II device and empty 3.5 drives}
{until noDevices or (not (toolErr in [noDevice,noDiskInDrive])); }
MakeCursor(arrow);
END
ELSE
BEGIN { activity in some other device }
IF (hdiDev <> 0) AND (BitAND(hdiFlags, $0001) = 0)
{ was it an insert? } THEN
BEGIN
MakeCursor(watch);
deviceNum := hdiResult-1; { this will cause NextDrive toÉ }
NextDrive; {Émove to the inserted device }
MakeCursor(arrow);
END;
END;
(*
nowTick := GetTick;
IF nowTick - lastPoll > 40 THEN { has it been this many ticksÉ }
{Ésince last device poll? }
BEGIN
lastPoll := nowTick; { reset time of last poll }
IF deviceNum <> 0 THEN { if we have a device online, check for eject }
BEGIN
with statusBlk do
begin
pCount := 5;
devNumber := deviceNum;
statCode := 0;
StatList := @StatResult;
RequestCount := 6;
end;
tempErr := GSOSStatus;
IF (tempErr = 0) AND
(BitAND(StatResult.general, $0011) = $0001)
THEN { offline switched? }
BEGIN
MakeCursor(watch);
{ repeat }
NextDrive; {Skip over nonexistent Disk II device and empty 3.5 drives}
{ until noDevices or (not (toolErr in [noDevice,noDiskInDrive]));
Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{################################################################}
{# #}
{# File: Globals.Pas from IIGS Disk Initializer #}
{# #}
{#--------------------------------------------------------------#}
{# #}
{# Description: This file has all the global vars and const's #}
{# that is used by the IIGS Disk Initializer #}
{# #}
{#--------------------------------------------------------------#}
{# #}
{# Authors: Darryl Lovato #}
{# #}
{#--------------------------------------------------------------#}
{# #}
{# Copyright: 1987,1988 by Apple Computer Inc. #}
{# All rights reserved. #}
{# #}
{#--------------------------------------------------------------#}
{# #}
{# Modification History: #}
{# #}
{# Who When The Change #}
{# --- ------ ------------------------------------- #}
{# SR 12/7/87 Created v.1 - erase & init only #}
{# DGL 1/29/88 Rewrote everything - cut size in half! #}
{# DGL 5/9/88 Finished Adding Partition Support #}
{# and other features... far too many to #}
{# list here... #}
{# DGL 5/12/88 Added Zero and Info operations #}
{# DGL 5/20/88 Released pre-alpha version to testers #}
{# DGL 6/1/88 Alpha! #}
{# DGL 6/13/88 Alpha 2 #}
{# DGL 6/24/88 Alpha 3 #}
{# DGL 7/1/88 Beta 1 #}
{# DGL 7/13/88 Beta 2 #}
{# DGL 7/20/88 Beta 3 #}
{# DGL 7/27/88 Beta 4 #}
{# DGL 8/1/88 Beta 5 #}
{# DGL 8/8/88 Beta 6 #}
{# DGL 8/15/88 Final! #}
{# #}
{################################################################}
{$LongGLobals-}
{$ToolErrorChk-}
{$A+}
unit Globals;
interface
uses
InitIntfData, {HodgePodge Apple IIGS Toolbox Interface Units}
InitIntfProc,
InitIntfPDOS,
ListMgr;
{################################################################}
{# global constants follow #}
{################################################################}
CONST
arrow = 0; { cursor constants}
watch = 1;
ScreenMode = $80; {640 mode}
MaxX = 640; {Max X clamp (should correspond to ScreenMode}
MaxScan = 160; {Max size of scan line}
AppleMenuID = 300;
AboutItem = 301;
FileMenuID = 400;
InitItem = 401;
QuitItem = 409;
{Error Codes returned from VOLUME call}
IOError = 39; {$27}
NoDevice = 40;
OtherOS = 82; {$52}
NoDiskInDrive = 47; {$2F}
NoError = 0;
{ constants added by Monte Benaresh for driver partition support }
pMapSizeBlks = 64; { # of blocks for partition map }
drvrSizeBlks = 32; { # of blocks for each driver partition }
sysPartCount = 5; { 1 partition map and 4 driver partitions }
rSCSIDrvr = $4D61;
rSCSIDescDrvr = $5E72;
{ new constants to support real modeless main window }
mainDlog = $1001;
MEraseBut = $0002;
MTitleTxt = $0003;
MDiskBut = $0005;
MStatTxt = $0008;
MPartBut = $0009;
MCancelBut = $000A;
MInitBut = $000B;
MZeroBut = $000C;
MInfoBut = $000D;
rWindParam1 = $800E; { Parameters for NewWindow2 call }
{ dialog ref cons for easy ID in event filter routine for content update }
InfoRef = $1002;
DiskNameRef = $1003;
InitRef = $1004;
AboutRef = $1005;
PartRef = $1006;
{################################################################}
{# global types follow #}
{################################################################}
TYPE
Longword = RECORD
LoWord : INTEGER;
HiWord : INTEGER;
END;
Part = record
partSize : longint; {size in 1024 of blocks (half-megs) }
partName : string[31];
end;
PartitionRec = record
PartCount : integer;
PartsInfo : array[1..1] of Part;
end;
PartitionPtr = ^PartitionRec;
PartitionHdl = ^PartitionPtr;
myBlock = record
pCount : integer;
devNumber : integer;
devname : StringPtr;
characteristics : integer;
totalBlocks : longint;
slotNum : integer;
unitNum : integer;
version : integer;
devID : integer;
end;
infoListRec = record
devName : string[32];
devNum : integer;
end;
NameArrayTbl = array[1..1] of stringPtr;
BigIcons = packed array[0..329] of char;
LongPtr = ^Longint;
IntPtr = ^INTEGER;
str32 = string[31];
PartHdl = ^PartPtr;
PartPtr = ^PartRec;
PartRec = packed record
pmSig : Integer; { signiature word - always $504D}
pmSigPad : Integer; { reserved for future use}
pmMapBlkCount : Longint; { number of blocks in map}
pmPyPartStart : Longint; { first physical block of partition}
pmPartBlkCount : Longint;{ number of blocks in partition}
pmPartName : str32; { partition name}
pmPartType : str32; { partition type}
pmLgDataStart : Longint; { first logical block of boot code}
pmDataCnt : Longint; { number of blocks in data area}
pmPartStatus : Longint; { partition status information}
pmLgBootSLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
{################################################################}
{# #}
{# File: Guts.Pas from IIGS Disk Initializer #}
{# #}
{#--------------------------------------------------------------#}
{# #}
{# Description: This file has all the routines make up #}
{# the guts of the program, these routines #}
{# do the partitioning and zeroing. #}
{# #}
{#--------------------------------------------------------------#}
{# #}
{# Author: Darryl Lovato #}
{# #}
{#--------------------------------------------------------------#}
{# #}
{# Copyright: 1987,1988 by Apple Computer Inc. #}
{# All rights reserved. #}
{# #}
{#--------------------------------------------------------------#}
{# #}
{# Modification History: #}
{# #}
{# Who When The Change #}
{# --- ------ ------------------------------------- #}
{# SR 12/7/87 Created v.1 - erase & init only #}
{# DGL 1/29/88 Rewrote everything - cut size in half! #}
{# DGL 5/9/88 Finished Adding Partition Support #}
{# and other features... far too many to #}
{# list here... #}
{# DGL 5/12/88 Added Zero and Info operations #}
{# DGL 5/20/88 Released pre-alpha version to testers #}
{# DGL 6/1/88 Alpha! #}
{# DGL 6/13/88 Alpha 2 #}
{# DGL 6/24/88 Alpha 3 #}
{# DGL 7/1/88 Beta 1 #}
{# DGL 7/13/88 Beta 2 #}
{# DGL 7/20/88 Beta 3 #}
{# DGL 7/27/88 Beta 4 #}
{# DGL 8/1/88 Beta 5 #}
{# DGL 8/8/88 Beta 6 #}
{# DGL 8/15/88 Final! #}
{# #}
{################################################################}
{ these options turn long addressing on, and turn error checking off}
{ in addition, they set the pascal comments in assembler on.}
{$LongGLobals-}
{$ToolErrorChk-}
{$ToolErrorChk+}
{$A+}
unit Guts;
interface
uses
InitIntfData,
InitIntfProc,
InitIntfPDOS,
ListMgr,
Globals,
Utils;
function CallGetNumParts(dNum : integer) : integer;
function GetParts(dNum : integer; PartAddr : PartitionPtr) : integer;
procedure DoDeviceZero(dNum : Integer; only8Blocks : boolean);
function SetParts(dNum : integer; partAddr : PartitionPtr) : integer;
PROCEDURE ClearBuf(addr : LONGINT; count : LONGINT; value : INTEGER); EXTERNAL;
{ added by Monte }
implementation
{################################################################}
{# return the number of partitions on a scsi device! #}
{################################################################}
{ we don't count the partition map itself}
FUNCTION CallGetNumParts(dNum : integer) : integer;
VAR
returnMe : integer;
myName : str255;
BEGIN
with infoblk do
begin
pCount := 11;
devNumber := dNum;
devname := @myname;
end;
{DINFO call}
returnme := GSOSInfo;
if infoblk.headLink <> 0 then
dNum := infoblk.headLink;
with statusblk do
begin
pCount := 5;
devNumber := dNum;
statCode := 4; {get partition map}
statlist := @dummyBlk;
requestcount := 512;
end;
with dummyblk do
begin
pmSig := $1234;
pmMapBlkCount := $1234;
end;
returnme := GSOSStatus;
if dummyBlk.pmSig <> $4D50 then { note backward ordering of bytes}
returnMe := 1
else
begin
returnMe := LoWord(SwapLong(dummyBlk.pmMapBlkCount) - 1);
if returnMe < 1 then
returnMe := 1;
end;
CallGetNumParts := returnMe;
END;
{########################################################}
{# read the partition map on a SCSI device #}
{########################################################}
FUNCTION GetParts(dNum : integer; PartAddr : PartitionPtr) : integer;
VAR
i, partInd : integer;
thePMapHdl : partStructhdl;
myname : string[32];
label 1;
BEGIN
GetParts := noError;
{dNum MUST BE THE HEAD OF THE LIST!!!!!}
with infoBlk do
begin
pCount := 11;
devNumber := dNum;
devname := @myname;
end;
{DINFO call}
i := GSOSInfo;
with infoblk do
if headLink <> 0 then
dNum := headLink;
with ReadCapBlk do
begin
xero := 0;
twofive := $0025;
result := @realsize;
end;
with statusblk do
begin
pCount := 5;
devNumber := dNum;
statCode := $8025; {read capacity}
statlist := @ReadCapBlk;
requestcount := 8;
end;
if GSOSStatus <> 0 then { we dont know how big this drive is, so return error}
begin
GetParts := -1; { error}
goto 1;
end;
{swap the result in realsize because its returned in mac format!}
{ Matt G. said I should also add one}
realsize.numBlks := swaplong(realsize.numBlks) + 1;
realSize.blkSize := swaplong(realsize.blkSize);
diskblocksize := realsize.numBlks;
with statusblk do
begin
pCount := 5;
devNumber := dNum;
statCode := 4; {get partition maLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
{################################################################}␍{# #}␍{# File: Init.Pas from IIGS Disk Initializer #}␍{# #}␍{#--------------------------------------------------------------#}␍{# #}␍{# Description: This file is the main file for the IIGS disk #}␍{# initializer. #}␍{# #}␍{#--------------------------------------------------------------#}␍{# #}␍{# Authors: Darryl Lovato #}␍{# #}␍{#--------------------------------------------------------------#}␍{# #}␍{# Copyright: 1987,1988 by Apple Computer Inc. #}␍{# All rights reserved. #}␍{# #}␍{#--------------------------------------------------------------#}␍{# #}␍{# Modification History: #}␍{# #}␍{# Who When The Change #}␍{# --- ------ ------------------------------------- #}␍{# SR 12/7/87 Created v.1 - erase & init only #}␍{# DGL 1/29/88 Rewrote everything - cut size in half! #}␍{# DGL 5/9/88 Finished Adding Partition Support #}␍{# and other features... far too many to #}␍{# list here... #}␍{# DGL 5/12/88 Added Zero and Info operations #}␍{# DGL 5/20/88 Released pre-alpha version to testers #}␍{# DGL 6/1/88 Alpha! #}␍{# DGL 6/13/88 Alpha 2 #}␍{# DGL 6/24/88 Alpha 3 #}␍{# DGL 7/1/88 Beta 1 #}␍{# DGL 7/13/88 Beta 2 #}␍{# DGL 7/20/88 Beta 3 #}␍{# DGL 7/27/88 Beta 4 #}␍{# DGL 8/1/88 Beta 5 #}␍{# DGL 8/8/88 Beta 6 #}␍{# DGL 8/15/88 Final! #}␍{# #}␍{################################################################}␍␍{$LongGLobals-}␍{$ToolErrorChk-}␍{$A+}␍program Init;␍␍uses␍ InitIntfData,␍ InitIntfProc,␍ InitIntfPdos,␍ ListMgr,␍ Globals,␍ Utils,␍ Guts,␍ Dialog,␍ Menu,␍ Event;␍␍␍{################################################################}␍{# startup tools here, return false if we failed #}␍{################################################################}␍␍function StartUpTools : boolean;␍␍VAR␍ theVerPBLK : myVersionBlock;␍␍begin␍{ first check OS version }␍ theVerPBLK.pcount := 1;␍ IF (CallGSOS(@theVerPBLK, $202A) <> 0) OR { if error, must be bad version }␍ (BITAND(theVerPBLK.version, $7FFF) < $0400) { want GS/OS 4.0 (SD 6.0) or later }␍ THEN BEGIN␍ StartUpTools := FALSE; { can't run!! }␍ EXIT(StartUpTools);␍ END;␍␍ listControl1 := nil;␍ partDlog := nil;␍ TLStartUp; {Init Tool Locator }␍ MyMemoryID := MMStartUp;{Init Memory Manager}␍ ␍ GlobalParts := PartitionHdl(NewHandle(2 + sizeof(part),MyMemoryID,attrBank+attrPage,nil));␍␍ InitPtr := StevesStartupTools(myMemoryID,0,@ToolRec);␍ startuptools := (NOT istoolerror);␍ CurrCursor := -1; {init global}␍ SetCtlParamPtr(@subStrArray); { register runtime strings with Control Mgr }␍ MakeCursor(arrow); {Init watch cursor}␍end; {of StartUpTools}␍␍␍{################################################################}␍{# Here's the main event! #}␍{################################################################}␍␍begin {of MAIN program Init}␍ if StartUpTools then␍ begin { Initialize IIGS Tools }␍ SetUpMenus; { Set up menus }␍ MakeCursor(arrow);{ put this up for a while}␍ ShowInit; { display main window } { added 3/6/91 by Monte Benaresh }␍␍ { suppress detection of initial device inserts }␍ tempGLong := HandleDiskInsert(hdiUpdate, 0); { update all devices }␍ MainEvent; { Use application }␍ end␍ ELSE␍ BEGIN { tell user we can't run }␍ tempGLong := TLTextMountVolume(@badStart1Str, @badStart2Str, @badStart1But,␍ @badStart2But);␍ END;␍␍ SANEShutDown; { need this due to compiler bug }␍ StevesShutDownTools(0,initPtr); { Shut down IIGS Tools }␍end.␍
|
||||
@@ -0,0 +1 @@
|
||||
UNIT InitINTFDATA;
CONST
{ Modifier Flags }
Btn1State = 64;
Btn0State = 128;
AppleKey = 256;
ShiftKey = 512;
CapsLock = 1024;
OptionKey = 2048;
ControlKey = 4096;
KeyPad = 8192;
attrBank = $0001;
attrAddr = $0002;
attrPage = $0004;
attrNoSpec = $0008;
attrNoCross = $0010;
attrFixed = $4000;
attrLocked = $8000;
Ok = 1;
Cancel = 2;
ButtonItem = 10;
StatText = 15;
EditLine = 17;
IconItem = 18;
LongStatText = 16;
longStatText2 = 22;
ItemDisable = $8000;
srcCopy = $0000;
ActiveFlag = 1;
ActivateEvt = 8;
wInGoAway = 22;
wInMenuBar = 17;
wInSpecial = 25;
wInControl = $0021;
wInContent = $0013;
atItemListLength = 7;
{ constants for new HandleDiskInsert call }
hdiScan = $8000; { flag bits }
hdiPrompt = $4000;
hdiUpdate = $2000;
hdiEjects = $1000;
hdiNow = $0800;
TYPE
SignedByte = -128..127; {1 byte}
Byte = 0..255; {2 bytes}
Ptr = ^SignedByte; {4 bytes}
Handle = ^Ptr; {4 bytes}
ProcPtr = Ptr; {4 bytes}
Fixed = longint; {4 bytes}
Str255 = String [255]; {Pascal or C string}
StringPtr = ^Str255; {4 bytes}
StringHandle = ^StringPtr; {4 bytes}
CStringPtr = Ptr; {4 bytes}
CStringHandle = Handle; {4 bytes}
SCB = Integer; { Bits Meaning
0-3 ColorTable
4 Reserved
5 Fill, 0=off, 1=on
6 Interrupt, 0=off, 1=on
7 ColorMode, 0=320, 1=640 }
ToolTable = packed record
NumTools : integer;
Tools : array [1..30] of record
TSNum : integer;
MinVersion : integer;
end;
end;
VHSelect = (v,h);
PointPtr = ^Point;
Point = packed record
case integer of
0: (v : integer;
h : integer);
1: (vh : array [VHSelect] of integer);
end;
RectPtr = ^Rect;
Rect = packed record
case integer of
0: (v1 : integer;
h1 : integer;
v2 : integer;
h2 : integer);
1: (vh1 : Point;
vh2 : Point);
end;
ColorValue = integer; {Bits: 0000RRRRGGGGBBBB}
ColorTablePtr = ^ColorTable;
ColorTable = array [0..15] of ColorValue;
AnSCBByte = Byte; {Scanline control byte}
LocInfo = packed record
portSCB : AnSCBByte;
liReserved : Byte;
ptrToPixImage : Ptr;
lwidth : integer;
boundsRect : Rect;
end;
RgnHndl = ^RgnPtr;
RgnPtr = ^Region;
Region = packed record
rgnSize : integer;
rngBBox : Rect;
{Reserve storage for more data here if not rectangular}
end;
Pattern = array [0..15] of integer;
Mask = array [0..3] of integer;
QDProcsPtr = ^QDProcs;
QDProcs = packed record
stdText : ProcPtr;
stdLine : ProcPtr;
stdRect : ProcPtr;
stdRRect : ProcPtr;
stdOval : ProcPtr;
stdArc : ProcPtr;
stdPoly : ProcPtr;
stdRgn : ProcPtr;
stdPixels : ProcPtr;
stdComment : ProcPtr;
stdTxMeas : ProcPtr;
stdTxBnds : ProcPtr;
stdGetPic : ProcPtr;
stdPutPic : ProcPtr;
end;
LocInfoRec =
packed record
PortSCB: SCB;
PixelImage: Ptr;
Width: Integer;
BoundsRect: Rect;
end;
GrafPortPtr = ^GrafPort;
GrafPort = packed record
portInfo : LocInfo;
portRect : Rect;
clipRgn : RgnHndl;
visRgn : RgnHndl;
bkPat : Pattern;
pnLoc : Point;
pnSize : Point;
pnMode Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{$A+}␍␍UNIT InitINTFPDOS;␍␍INTERFACE {Def's below are public and represent the C-like ProDOS/16 interface}␍␍USES InitINTFDATA;␍␍TYPE␍␍P16ParamBlk = packed record␍ case integer of␍ {Used by Create, SetFileInfo and GetFileInfo:}␍ 0: (pathname1 : StringPtr;␍ access : integer;␍ fileType : integer;␍ auxType : longint;␍ storageType : integer;␍ createDate : integer;␍ createTime : integer;␍ modDate : integer;␍ modTime : integer;␍ blocksUsed : longint);␍ {Used by Destroy:}␍ 1: (deletepathname : StringPtr);␍ {For the following file access calls:}␍ 2: (refNum : integer;␍ case integer of␍ {Used by Open:}␍ 0: (pathname2 : StringPtr;␍ ioBuffer : Handle);␍ {Used by Read, Write:}␍ 1: (dataBuffer : Ptr;␍ requestCount : longint;␍ transferCount : longint);␍ {Used by Close, Flush:}␍ 2: (); );␍ {Used by GetPathName, GetBootVol:}␍ 3: (pathName : StringPtr);␍ end;␍␍FileRec = packed record␍ pathname : Ptr;␍ fAccess : integer;␍ fileType : integer;␍ auxType : longint;␍ storageType : integer;␍ createDate : integer;␍ createTime : integer;␍ modDate : integer;␍ modTime : integer;␍ blocksUsed : longint;␍ end;␍␍PathNameRec = packed record␍ pathname : Ptr;␍ newPathname : Ptr;␍ end;␍␍FUNCTION D_INFO (deviceNum : integer;␍ var resultName : str255):integer; EXTERNAL;␍FUNCTION VOLUME (var deviceName, VolumeName : Str255):integer; EXTERNAL;␍␍function GSOSStatus : integer; external;␍function GSOSControl : integer; external;␍function GSOSInfo : integer; external;␍function GSOSWrite : integer; external;␍function GSOSErase : integer; external;␍function GSOSFormat : integer; external;␍␍{ added 2/91 by Monte Benaresh: }␍FUNCTION CallGSOS(pblkPtr : Ptr; callNum : INTEGER) : INTEGER; EXTERNAL;␍FUNCTION DrvrCksum(drvrPtr : Ptr; drvrSize : INTEGER) : LONGINT; EXTERNAL;␍␍{Do this so we can access these routines in the TML Pascal library file:}␍PROCEDURE P16GetFileInfo (var p: P16ParamBlk); ProDOS 6;␍PROCEDURE P16GetBootVol (var p: P16ParamBlk); ProDOS 40;␍␍IMPLEMENTATION {Everything below is private to this unit}␍␍END.␍
|
||||
@@ -0,0 +1 @@
|
||||
UNIT InitINTFPROC;
USES InitINTFDATA;
PROCEDURE SpecialRect(theRect : Rect; frame, fill : integer); Tool 18,12;
FUNCTION GetWKind
(TheWindow: GrafPortPtr): Integer; Tool 14,43;
PROCEDURE DrawCString
(Str: CStringPtr); Tool 4,166;
PROCEDURE ReadAsciiTime
(Buffer: Ptr); Tool 3,15;
FUNCTION LongintToString(l : longint) : string; External;
PROCEDURE CompactMem; Tool 2,31;
FUNCTION MaxBlock: LongInt; Tool 2,28;
FUNCTION KeyPressed: Boolean; External;
FUNCTION EventAvail
(EventMask: Integer;
VAR Event: WmTaskRec): Boolean; Tool 6,11;
FUNCTION TickCount: LongInt; Tool 6,16;
FUNCTION Button
(ButtonNum: Integer): Boolean; Tool 6,13;
FUNCTION OpenNDA
(IDNum: Integer): Integer; Tool 5,21;
PROCEDURE FixAppleMenu
(MenuNum: Integer); Tool 5,30;
PROCEDURE CloseAllNDAs; Tool 5,29;
FUNCTION SystemEdit
(EditType: Integer): Boolean; Tool 5,24;
PROCEDURE InvertRect
(R: Rect); Tool 4,86;
PROCEDURE SetCtlParams
(Param2: Integer;
Param1: Integer;
TheControl: ControlHandle); Tool 16,27;
FUNCTION GetCtlParams
(TheControl: ControlHandle): LongInt; Tool 16,28;
FUNCTION TrackControl
(StartX: Integer;
StartY: Integer;
ActionProc: ProcPtr;
TheControl: ControlHandle): Integer; Tool 16,21;
PROCEDURE LocalToGlobal
(VAR Pt: Point); Tool 4,132;
PROCEDURE GlobalToLocal
(VAR Pt: Point); Tool 4,133;
FUNCTION PtInRect
(VAR Pt: Point; { To force passing address }
R: Rect): Boolean; Tool 4,79;
FUNCTION FindControl
(VAR FoundCtrl: ControlHandle;
XPoint: Integer;
YPoint: Integer;
TheWindow: GrafPortPtr): Integer; Tool 16,19;
PROCEDURE DisposeControl
(TheControl: ControlHandle); Tool 16,10;
PROCEDURE SetCtlRefCon
(NewRefCon: LongInt;
TheControl: ControlHandle); Tool 16,34;
FUNCTION GetCtlRefCon
(TheControl: ControlHandle): LongInt; Tool 16,35;
PROCEDURE SetHandleSize
(NewSize: LongInt;
H: Handle); Tool 2,25;
PROCEDURE InsetRect
(VAR R: Rect;
DH: Integer;
DV: Integer); Tool 4,76;
PROCEDURE ClipRect
(R: Rect); Tool 4,38;
PROCEDURE DrawControls
(TheWindow: GrafPortPtr); Tool 16,16;
PROCEDURE DrawOneCtl
(TheControl: ControlHandle); Tool 16,37;
PROCEDURE SetCtlValue
(CurValue: Integer;
TheControl: ControlHandle); Tool 16,25;
PROCEDURE FillRect
(R: Rect;
Pat: Pattern); Tool 4,87;
PROCEDURE EraseRect
(R: Rect); Tool 4,85;
PROCEDURE SetCtlTitle
(Title: Str255;
TheControl: ControlHandle); Tool 16,12;
PROCEDURE SelIText
(TheDialog: GrafPortPtr;
ItemID: Integer;
StartSel: Integer;
EndSel: Integer); Tool 21,33;
PROCEDURE GetDItemBox
(TheDialog: GrafPortPtr;
ItemID: Integer
VAR ItemBox: Rect); Tool 21,40;
PROCEDURE SetDItemBox
(TheDialog: GrafPortPtr;
ItemID: Integer
ItemBox: Rect); Tool 21,41;
PROCEDURE GetNewDItem
(TheDialog: GrafPortPtr;
ItemTemplate: Ptr); Tool 21,51;
PROCEDURE Move
(DH,DV: Integer); Tool 4,59;
PROCEDURE SetDItemValue
(ItemValue: Integer;
TheDialog: GrafPortPtr;
ItemID: Integer); Tool 21,47;
FUNCTION GetControlItem
(TheDialog: GrafPortPtr;
ItemID: Integer): ControlHandle; Tool 21,30;
PROCEDURE SetPenSize
(Width: Integer;
Height: Integer); Tool 4,44;
PROCEDURE GetPenSize
(thePoint : PointPtr); Tool 4,45;
FUNCTION GetDItemValue
(TheDialog: GrafPortPtr;
ItemID: Integer): Integer; Tool 21,46;
PRLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
UNIT ListMgr; { Interfaces for Resource Manager added }␍ { by Monte Benaresh -- February 16, 1991 }␍␍USES InitIntfData, {Apple IIGS Toolbox Interface Units}␍ InitIntfProc,␍ InitIntfPDOS;␍␍(* ** Types for List Manager ** *)␍␍TYPE ListMemP = ^ListMemRec;␍␍ ListRecP = ^ListRec;␍ ListRec =␍ record␍ ListRec: Rect;␍ ListSize: Integer;␍ ListView: Integer;␍ ListType: Integer;␍ ListStart: Integer;␍ ListCtl: ControlHandle;␍ ListDraw: ProcPtr;␍ ListMemHeight: Integer;␍ ListMemSize: Integer;␍ ListPointer: ListMemP;␍ ListRefCon: LongInt;␍ ListScrollClr: ColorTablePtr;␍ end;␍␍ ListMemRec =␍ record␍ memPtr: Ptr;␍ memFlag: Integer;␍ end;␍␍␍(* ** Routines for List Manager ** *)␍␍PROCEDURE ListStartUp; Tool 28,2;␍PROCEDURE ListShutDown; Tool 28,3;␍FUNCTION ListVersion: Integer; Tool 28,4;␍PROCEDURE ListReset; Tool 28,5;␍FUNCTION ListStatus: Integer; Tool 28,6;␍FUNCTION CreateList␍ (TheWindow: GrafPortPtr;␍ TheList: ListRecP): ControlHandle; Tool 28,9;␍FUNCTION NextMember␍ (TheMem: ListMemP;␍ TheList: ListRecP): ListMemP; Tool 28,11;␍FUNCTION ResetMember␍ (TheList: ListRecP): ListMemP; Tool 28,15;␍PROCEDURE DrawMember␍ (TheMem: ListMemP;␍ TheList: ListRecP); Tool 28,12;␍PROCEDURE SelectMember␍ (TheMem: ListMemP;␍ TheList: ListRecP); Tool 28,13;␍PROCEDURE SortList␍ (SortProc: ProcPtr;␍ TheList: ListRecP); Tool 28,10;␍FUNCTION GetListDefProc: ProcPtr; Tool 28,14;␍PROCEDURE NewList␍ (TheMem: ListMemP;␍ TheList: ListRecP); Tool 28,16;␍␍(* ** Routines for List Manager ** added 2/16/91 by Monte *)␍␍PROCEDURE DetatchResource␍ (ResType : INTEGER;␍ ResID : LONGINT); TOOL 30,24;␍␍FUNCTION GetResourceSize␍ (ResType : INTEGER;␍ ResID : LONGINT): LONGINT; TOOL 30,29;␍␍FUNCTION LoadResource␍ (ResType : INTEGER;␍ ResID : LONGINT): Handle; TOOL 30,14;␍␍␍FUNCTION OpenResourceFile␍ (reqAccess : INTEGER; mapPtr : Ptr;␍ pathPtr : Ptr): INTEGER; TOOL 30,10;␍␍PROCEDURE CloseResourceFile␍ (fileID : INTEGER); TOOL 30,11;␍␍␍end.␍
|
||||
@@ -0,0 +1 @@
|
||||
{################################################################}␍{# #}␍{# File: Menu.Pas from IIGS Disk Initializer #}␍{# #}␍{#--------------------------------------------------------------#}␍{# #}␍{# Description: This file has all the routines that handle #}␍{# the creation, functionality and disposal of #}␍{# the menus used in the program. #}␍{# #}␍{#--------------------------------------------------------------#}␍{# #}␍{# Author: Darryl Lovato #}␍{# #}␍{#--------------------------------------------------------------#}␍{# #}␍{# Copyright: 1987,1988 by Apple Computer Inc. #}␍{# All rights reserved. #}␍{# #}␍{#--------------------------------------------------------------#}␍{# #}␍{# Modification History: #}␍{# #}␍{# Who When The Change #}␍{# --- ------ ------------------------------------- #}␍{# SR 12/7/87 Created v.1 - erase & init only #}␍{# DGL 1/29/88 Rewrote everything - cut size in half! #}␍{# DGL 5/9/88 Finished Adding Partition Support #}␍{# and other features... far too many to #}␍{# list here... #}␍{# DGL 5/12/88 Added Zero and Info operations #}␍{# DGL 5/20/88 Released pre-alpha version to testers #}␍{# DGL 6/1/88 Alpha! #}␍{# DGL 6/13/88 Alpha 2 #}␍{# DGL 6/24/88 Alpha 3 #}␍{# DGL 7/1/88 Beta 1 #}␍{# DGL 7/13/88 Beta 2 #}␍{# DGL 7/20/88 Beta 3 #}␍{# DGL 7/27/88 Beta 4 #}␍{# DGL 8/1/88 Beta 5 #}␍{# DGL 8/8/88 Beta 6 #}␍{# DGL 8/15/88 Final! #}␍{# #}␍{################################################################}␍␍{$LongGLobals-}␍{$ToolErrorChk-}␍{$A+}␍unit Menu;␍␍interface␍␍uses␍ InitIntfData,␍ InitIntfProc,␍ InitIntfPdos,␍ ListMgr,␍ Globals,␍ Utils,␍ Guts,␍ Dialog;␍␍procedure DoMenu; {Execute a menu item}␍procedure SetUpMenus; {Install menus and redraw menu bar}␍␍implementation␍␍{################################################################}␍{# handle menu selections here #}␍{################################################################}␍␍procedure DoMenu;␍var␍ item : integer;␍ bool : boolean;␍begin {of DoMenu}␍ item := LoWord(Event.wmTaskData);␍ case item of␍ AboutItem : DoAboutItem;␍ InitItem : ShowInit;␍ QuitItem : Done := true;␍ 950,951,952,953,954 :␍ bool := SystemEdit(item - 949);␍ end;␍ HiliteMenu(false,HiWord(Event.wmTaskData));␍end; {of DoMenu}␍␍{################################################################}␍{# create menu's here #}␍{################################################################}␍␍procedure SetUpMenus;␍var␍ Height : integer;␍begin {of SetUpMenus}␍ SetMTitleStart(10); {Set Starting position of menu}␍ AddMenu(@EditMenuStr);{Edit Menu}␍ AddMenu(@FileMenuStr);{File Menu}␍ AddMenu(@AppleMenuStr);{Apple Menu}␍ FixAppleMenu(0);␍ Height := FixMenuBar; {Set sizes of menus}␍ DrawMenuBar; {...and draw the menu bar!}␍ HiliteMenu(false, FileMenuID);{Initially disabled}␍end; {of SetUpMenus}␍␍end.␍
|
||||
@@ -0,0 +1 @@
|
||||
;################################################################
;# #
;# File: OS.Asm from IIGS Disk Initializer #
;# #
;#--------------------------------------------------------------#
;# #
;# Description: This file has all the glue which calls the #
;# prodos routines that do the initializing #
;# #
;#--------------------------------------------------------------#
;# #
;# Author: Darryl Lovato #
;# #
;#--------------------------------------------------------------#
;# #
;# Copyright: 1987,1988 by Apple Computer Inc. #
;# All rights reserved. #
;# #
;#--------------------------------------------------------------#
;# #
;# Modification History: #
;# #
;# Who When The Change #
;# --- ------ ------------------------------------- #
;# SR 12/7/87 Created v.1 - erase & init only #
;# DGL 1/29/88 Rewrote everything - cut size in half! #
;# DGL 5/9/88 Finished Adding Partition Support #
;# and other features... far too many to #
;# list here... #
;# DGL 6/1/88 Alpha! #
;# DGL 6/13/88 Alpha 2 #
;# DGL 6/24/88 Alpha 3 #
;# DGL 7/1/88 Beta 1 #
;# DGL 7/13/88 Beta 2 #
;# DGL 7/20/88 Beta 3 #
;# DGL 7/27/88 Beta 4 #
;# DGL 8/1/88 Beta 5 #
;# DGL 8/8/88 Beta 6 #
;# DGL 8/15/88 Final! #
;# #
;################################################################
STRING ASIS
BLANKS OFF
MACHINE M65816
LONGA on
LONGI on
;------------------------------------------
;
; Equates from procedure
;
;------------------------------------------
ProDOS equ $E100A8
D_Info_Call equ $202C ;Call number for "D_Info"
Volume_Call equ $2008 ;Call number for "Volume"
;-----------------------------------------------
;
; Imported addresses
;
;-----------------------------------------------
IMPORT ctlblk
IMPORT formatblk
IMPORT infoblk
IMPORT returnControl
IMPORT returnErase
IMPORT returnFormat
IMPORT returnInfo
IMPORT returnStatus
IMPORT returnWrite
IMPORT statusblk
IMPORT writeblk
;-----------------------------------------------
;
; Forward addresses and entries
;
;-----------------------------------------------
ENTRY d_info_list
ENTRY device_name
ENTRY volume_list
ENTRY volume_name
;################################################################
;# misc data for the below calls #
;################################################################
volume_list PROC EXPORT
dc.w 5 ;pcount through fileSysID
DC.L device_name ;pointer to the device name
DC.L volume_name ;pointer to the result volume name
EXPORT total_blks
total_blks
DC.L 0000 ;total blocks on the volume
EXPORT free_blks
free_blks
DC.L 0000 ;free blocks on the volume
EXPORT file_system_id
file_system_id
DC.W 0000 ;file system. $0001 = ProDOS
EXPORT d_info_list
d_info_list
dc.w 2 ;pcount through devName
EXPORT dev_num
dev_num
DC.W 00 ;device number. $0001 to -n-
DC.L dev_name_inbuf ;pointer to device name buffer
dev_name_inbuf
dc.w 32+2+2 ;size for result buffer
EXPORT device_name
device_name
ds.w 1 ;length word
DS.B 32 ;room for a large name
EXPORT volume_name
volume_name
dc.w 36+2 ;size for result buffer
DS.B 36 ;save room for a volume name
EXPORT error_code
error_code
DC.W 00 ;save error code from the call
ENDP
;################################################################
;# function GSOSFormat : integer; #
;################################################################
GSOSFormat PROC EXPORT
LONGA ON
LONGI ON ; entry code
phd
tsc
sec
sbc #$00F8
tcd
clc
adc #$00E4
tcs
jsl $E100A8
DC.W $2024
DC.L formatblk
bcs returnFormat
lda #$0
returnFormat
sta $FE ; return error
tdc ; exit code
clc
adc #$00F8
tcs
pld
rtl
ENDP
;################################################################
;# function GSOSErase : integer; #
;################################################################
GSOSErase PROC EXPORT
LONGA ON
LONGI ON ; entry code
phd
tsc
sec
sbc #$00F8
tcd
clc
adc #$00E4
tcs
jsl $E100A8
DC.W $2025
DC.L formatblk
bcs returnErase
lda #$0
returnErase
sta $FE ; return error
tdc ; exit code
clc
adc #$00F8
tcs
pld
rtl
ENDP
;################################################################
;# function GSOSStatus : integer; #
;################################################################
GSOSStatus PROC EXPORT
LONGA ON
LONGI ON ; entry code
phd
tsc
sec
sbc #$00F8
tcd
clc
adc #$00E4
tcs
jsl $E100A8
DC.W $202D
DC.L statusblk
bcs returnStatus
lda #$0
returnStatus
sta $FE ; return error
tdc ; exit code
clc
adc #$00F8
tcs
pld
rtl
ENDP
;################################################################
;# function GSOSInfo : integer; #
;################################################################
GSOSInfo PROC EXPORT
LOLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
{################################################################}
{# #}
{# File: Utils.Pas from IIGS Disk Initializer #}
{# #}
{#--------------------------------------------------------------#}
{# #}
{# Description: This file has all the routines that are #}
{# general purpose - utilities. #}
{# #}
{#--------------------------------------------------------------#}
{# #}
{# Author: Darryl Lovato #}
{# #}
{#--------------------------------------------------------------#}
{# #}
{# Copyright: 1987,1988 by Apple Computer Inc. #}
{# All rights reserved. #}
{# #}
{#--------------------------------------------------------------#}
{# #}
{# Modification History: #}
{# #}
{# Who When The Change #}
{# --- ------ ------------------------------------- #}
{# SR 12/7/87 Created v.1 - erase & init only #}
{# DGL 1/29/88 Rewrote everything - cut size in half! #}
{# DGL 5/9/88 Finished Adding Partition Support #}
{# and other features... far too many to #}
{# list here... #}
{# DGL 5/12/88 Added Zero and Info operations #}
{# DGL 5/20/88 Released pre-alpha version to testers #}
{# DGL 6/1/88 Alpha! #}
{# DGL 6/13/88 Alpha 2 #}
{# DGL 6/24/88 Alpha 3 #}
{# DGL 7/1/88 Beta 1 #}
{# DGL 7/13/88 Beta 2 #}
{# DGL 7/20/88 Beta 3 #}
{# DGL 7/27/88 Beta 4 #}
{# DGL 8/1/88 Beta 5 #}
{# DGL 8/8/88 Beta 6 #}
{# DGL 8/15/88 Final! #}
{# #}
{################################################################}
{ these options turn long addressing off, and turn error checking off}
{ in addition, they set the pascal comments in assembler on.}
{$LongGlobals-}
{$ToolErrorChk-}
{$A+}
unit Utils;
interface
uses
InitIntfData,
InitIntfProc,
InitIntfPDOS,
ListMgr,
Globals;
procedure DoAlert(static prompt, prompt2 : str255);
procedure MakeCursor(newCurs : integer);
procedure MakeGSOSStr(s : str255; var gs : GSOSString);
FUNCTION GSToP(GSString: GSStrPtr) : STR255;
function UpperString(s : str255) : str255;
procedure SetLongText(theStringPtr:StringPtr);
FUNCTION RealSwapInt(aInt : INTEGER) : INTEGER; { added 2/91 by Monte }
function SwapLong(aLong : Longint) : longint;
function AryToStr(data : Ptr; max : integer) : str255;
function StrToAry32(theStr : str255) : str32;
procedure ZeroRefCons;
procedure RestoreRefCons;
procedure SaveAndZeroRefCons;
PROCEDURE ShowNoMem;
procedure PlotIconola(icon : Ptr; where : Point; smallicon : boolean);
function GetVolIcon : ptr;
function IsDA(theWind : GrafPortPtr) : boolean;
function Real2Long(value : real) : longint;
function Real2Int(value : real) : integer;
procedure TurnOn(ctl : ControlHandle);
procedure TurnOff(ctl : ControlHandle);
procedure BlinkButton(ctl : ControlHandle);
procedure AddMenu(s : Ptr);
PROCEDURE SetVolName(VolStr : STR255); { added 8/4/91 by Monte }
FUNCTION CheckOpenFiles(devNumber : INTEGER) : BOOLEAN; { added 8/17/91 by Monte }
procedure PHK; inline $4B;
procedure PLB; inline $AB;
PROCEDURE PHB; inline $8B; { added 3/91 by Monte }
PROCEDURE break; inline $00;
PROCEDURE brksig; inline $24;
implementation
FUNCTION CheckOpenFiles(devNumber : INTEGER) : BOOLEAN; { added 8/17/91 by Monte }
VAR
tempGS : GSOSResultBuf;
BEGIN
WITH infoBlk DO
BEGIN
pCount := 11;
devNumber := devNumber;
devname := @tempGS;
END;
tempGS.bufsize := 35; { set size of result buf }
toolErr := GSOSInfo; { get device name }
WITH volBlk DO
BEGIN
pCount := 7; { include new characteristics word }
devName := @tempGS.gstring;
volName := NIL;
END;
toolErr := CallGSOS(@volBlk, $2008); { issue VOLUME call }
IF (toolErr <> 0) OR (BITAND(volBlk.characteristics, $0010) = 0)
THEN CheckOpenFiles := FALSE { if error or clear flag, no file open }
ELSE CheckOpenFiles := TRUE;
END;
PROCEDURE SetVolName(VolStr : STR255); { added 8/4/91 by Monte }
BEGIN
currVolumeStr := VolStr; { set global p-string }
dispVolumeStr := currVolumeStr;
IF (dispVolumeStr[1] = '/') OR (dispVolumeStr[1] = ':') THEN
delete(dispVolumeStr,1,1); {Get rid of '/'}
dispVolumeStr := CONCAT('The disk name is ', dispVolumeStr);
END;
{################################################################}
{# add a menu to the menu bar #}
{################################################################}
procedure AddMenu(s : Ptr);
begin
InsertMenu(NewMenu(s),0);
end;
{################################################################}
{# Convert a real to a long #}
{################################################################}
function Real2Long(value : real) : longint;
begin
Real2Long := trunc(round(value));
end;
{################################################################}
{# Convert a real to a integer #}
{################################################################}
function Real2Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
/*--------------------------------------------------------------*/
/* resources for Advanced Disk Utility by Monte Benaresh */
/* */
/* created February 16, 1991 */
/*--------------------------------------------------------------*/
#include "Typesiigs.r"
#define rSCSIDrvr $4D61 /* unusual value for uniqueness */
#define rSCSIDescDrvr $5E72 /* unusual value for uniqueness */
#define versionString "1.2" /* maintain version here and in "Data.aii" */
resource rVersion(1, $0000) {
{
$1, /* major version in BCD */
$2, /* minor version in BCD */
$0, /* bug version */
release,
$00, /* # */
},
verUS,
"Advanced Disk Utility",
"Copyright 1988-92, Apple Computer, Inc."
};
resource rComment(1, $0000) {
"Advanced Disk Utility by Darryl Lovato."
"\$0d"
"\$0d"
"Updated by Monte Benaresh."
"\$0d"
"\$0d"
"Quality assured by Brenda Knudson, Margarita Sang, "
"Llew Roberts, Steve Wesolowski, and Anil Gursahani."
};
/* */
/* Equates for window flags */
/* */
#define wtitleAsRes $0200
#define wcolorAsRes $0800
#define wctlAsRes $0009
/* */
/* Defines for windows/controls */
/* */
#define mainDlog $1001
#define MEraseBut $0002
#define MTitleTxt $0003
#define MDiskBut $0005
#define MStatTxt $0008
#define MPartBut $0009
#define MCancelBut $000A
#define MInitBut $000B
#define MZeroBut $000C
#define MInfoBut $000D
/* */
/* Custom resource types */
/* */
type rSCSIDescDrvr { /* Descriptors associated with rSCSIDrvr resource
with same ID. These are needed for the
driver's partition map entry. */
/* ### numbers get compiled into Mac byte order ###
### because that's how they appear in the ###
### partition map entry ### */
reversebytes{longint;}; /* pmLgBootStart */
reversebytes{longint;}; /* pmBootSize */
reversebytes{longint;}; /* pmBootLoad */
reversebytes{longint;}; /* pmBootLoad2 */
reversebytes{longint;}; /* pmBootEntry */
reversebytes{longint;}; /* pmBootEntry2 */
/* reversebytes{longint;}; */ /* pmBootCksum */
wide array[128] {
byte;
}; /* 128 bytes of boot-specific
arguments */
};
type rSCSIDrvr { /* binary image of SCSI boot driver */
wide array {
byte;
};
};
/* */
/* Resource declarations */
/* */
/* The SCSI driver resource must be an even # of blocks in length! */
read rSCSIDrvr (0x00000001,preload, nonpurgeable) "mac.driver";
resource rSCSIDescDrvr (0x00000001,preload, nonpurgeable) {
/* these values get compiled into Mac byte order */
{ 0x00000000}, /* pmLgBootStart */
{ 0x000017E2}, /* pmBootSize */
{ 0x00000000}, /* pmBootLoad */
{ 0x00000000}, /* pmBootLoad2 */
{ 0x00000000}, /* pmBootEntry */
{ 0x00000000}, /* pmBootEntry2 */
/*{ 0x000063EE} */ /* pmBootCksum */
{ /* boot-specific arguments */
/* These are set according to the values for any Apple- */
/* provided drive, from the file "hardDrives.h" for */
/* HDSC Partition. */
0x00, 0x01, 0x06, 0x00, /* drvr signature */
0x00, 0x00, 0x00, 0x01, /* pollbyte */
0x00, 0x00, 0x00, 0x02, /* TIB type */
0x00, 0x07, /* blind bits */
0x00, 0x00, /* shutdown stop */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
};
/* New resources for main dialog */
resource rWindParam1 (mainDlog) {
fTitle + fVis, /* frame bits */
MTitleTxt, /* title ID */
0, /* ref con */
{0,0,0,0}, /* zoom rect */
0, /* color table ID */
{0,0}, /* origin */
{0,0}, /* data size */
{0,0}, /* max height/width */
{0,0}, /* scroll amount, hor/ver */
{0,0}, /* page amount */
0, /* info ref con */
0, /* info height */
{50,133,154,508}, /* window position */
infront, /* wPlane */
mainDlog, /* controls ref */
wColorAsRes + wTitleAsRes + wCtlAsRes /* descriptor */
};
/* controls for main dialog */
resource rControlList (mainDlog) {
{
MEraseBut,
/* MTitleTxt, */
MDiskBut,
MStatTxt,
MPartBut,
MCancelBut,
MInitBut,
MZeroBut,
MInfoBut
};
};
resource rControlTemplate (MEraseBut) {
MEraseBut, Line truncated
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
Objects = ś␍ Globals.pii.aii.obj ś␍ Utils.pii.aii.obj ś␍ Guts.pii.aii.obj ś␍ Dialog.pii.aii.obj ś␍ Menu.pii.aii.obj ś␍ Event.pii.aii.obj ś␍ Init.pii.aii.obj ś␍ Data.aii.obj ś␍ OS.aii.obj␍␍Interfaces = InitIntfData.usym ś␍ InitIntfProc.usym ś␍ InitIntfPDOS.usym ś␍ ListMgr.USym␍␍␍ADV.DISK.UTIL Ä {Interfaces} {Objects} ś␍ adu.o adu.res␍ duplicate -y adu.o ADV.DISK.UTIL # don't use -d to preserve filetype␍ duplicate adu.res -r -y ADV.DISK.UTIL␍ if {dup} # test whether we should duplicateiigs␍ duplicateiigs -m -y ADV.DISK.UTIL Adv.Disk.Util␍ end␍␍#␍# Resource fork added 2/17/91 by Monte␍#␍␍adu.res Ä adu.rii ś␍ mac.driver ś␍ {riigsincludes}TypesIIGS.r␍ reziigs adu.rii -o adu.res␍␍adu.o Ä {Interfaces} {Objects}␍ linkiigs -l -s > map ś␍ -lseg Mickey:$1000 ś␍ Init.pii.aii.obj ś␍ Utils.pii.aii.obj ś␍ Guts.pii.aii.obj ś␍ Dialog.pii.aii.obj ś␍ Menu.pii.aii.obj ś␍ Event.pii.aii.obj ś␍ OS.aii.obj ś␍ Globals.pii.aii.obj ś␍ Data.aii.obj ś␍ "{PIIGSLibrary}PIIGSRuntime.obj" ś␍ -lib "{PIIGSLibrary}PIIGSRuntime.obj" ś␍ -at $0000DB03 ś␍ -o adu.o␍␍#␍# Rules modified 2/8/91 by Monte Benaresh␍#␍␍.usym Ä .pii␍ tmlpas {default}.pii␍␍.aii.obj Ä .aii␍ asmiigs {default}.aii␍␍.pii.aii Ä .pii␍ TMLPascal {default}.pii␍␍# dependencies among interfaces␍␍InitIntfProc.usym Ä InitIntfProc.pii ś␍ InitIntfData.usym␍ tmlpas InitIntfProc.pii␍␍InitIntfPDOS.usym Ä InitIntfPDOS.pii ś␍ InitIntfData.usym␍ tmlpas InitIntfPDOS.pii␍␍ListMgr.usym Ä ListMgr.pii ś␍ InitIntfData.usym ś␍ InitIntfProc.usym ś␍ InitIntfPDOS.usym␍ tmlpas ListMgr.pii␍␍Globals.pii.obj Ä Globals.pii {Interfaces}␍utils.pii.obj Ä utils.pii {Interfaces}␍guts.pii.obj Ä guts.pii {Interfaces}␍dialog.pii.obj Ä dialog.pii {Interfaces}␍menu.pii.obj Ä menu.pii {Interfaces}␍event.pii.obj Ä event.pii {Interfaces}␍init.pii.obj Ä init.pii {Interfaces}␍␍#␍# Rules added 2/8/91 by Monte Benaresh␍#␍# These were always necessary for correctness.␍#␍␍Globals.pii.aii Ä Globals.pii {Interfaces}␍␍Utils.pii.aii Ä Utils.pii {Interfaces} ś␍ Globals.pii.aii.obj␍␍Guts.pii.aii Ä Guts.pii {Interfaces} ś␍ Globals.pii.aii.obj ś␍ Utils.pii.aii.obj␍␍Dialog.pii.aii Ä Dialog.pii {Interfaces} ś␍ Globals.pii.aii.obj ś␍ Utils.pii.aii.obj ś␍ Guts.pii.aii.obj␍␍Menu.pii.aii Ä Menu.pii {Interfaces} ś␍ Globals.pii.aii.obj ś␍ Utils.pii.aii.obj ś␍ Guts.pii.aii.obj ś␍ Dialog.pii.aii.obj␍␍Event.pii.aii Ä Event.pii {Interfaces} ś␍ Globals.pii.aii.obj ś␍ Utils.pii.aii.obj ś␍ Guts.pii.aii.obj ś␍ Dialog.pii.aii.obj ś␍ Menu.pii.aii.obj␍␍Init.pii.aii Ä Init.pii {Interfaces} ś␍ Globals.pii.aii.obj ś␍ Utils.pii.aii.obj ś␍ Guts.pii.aii.obj ś␍ Dialog.pii.aii.obj ś␍ Menu.pii.aii.obj ś␍ Event.pii.aii.obj␍
|
||||
Whitespace-only changes.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
REM DISK VERSION 1/21/79 CRK
REM Converted to IIGS July, 1991 by Greg Branche
REM *************************
REM * *
REM * A P P L E B O W L *
REM * *
REM *************************
REM ****** WRITTEN BY ******
REM * *
REM * CHARLIE KELLNER *
REM * *
REM * AND ERIC LARSON *
REM * *
REM ******* NOV. 1978 *******
REM
REM THIS PROGRAM IS A HIGH
REM RESOLUTION 3-D GRAPHIC
REM SIMULATION OF BOWLING.
REM *************************
REM * *
REM * NOTES *
REM * *
REM *************************
REM <<< VARIABLE USAGE >>>
REM A$ : ALPHA STRING INPUT
REM COLR : HIRES COLOR VALUE
REM DX : RELEASE POINT STEP
REM E : SCORE TAB VALUE
REM F : FRAME COUNTER
REM G : GUTTER FLAG
REM H : NUMBER OF PINS HIT
REM H1 : FIRST BALL SCORE
REM I : FOR/NEXT COUNTER
REM J : FOR/NEXT COUNTER
REM K : PIN MATRIX INDEX
REM L : LANE NUMBER
REM N : GAME NUMBER
REM N$ : PLAYER'S NAME
REM OP0 : OLD PDL(0) VALUE
REM OP1 : OLD PDL(1) VALUE
REM PIN : PIN MATRIX
REM ROT : HIRES ROTATION
REM S : BALL SPEED
REM SCALE : HIRES SCALE FACTOR
REM SET : LANE CYCLE FLAG
REM SHAPE : HIRES SHAPE NUMBER
REM SP : SPARE FLAG
REM ST : STRIKE FLAG
REM SV : STRIKE SAVE FLAG
REM T : TOTAL SCORE
REM X : PIN COLUMN COUNTER
REM X0 : HIRES X-COORDINATE
REM X1 : BALL X-INCREMENT
REM X2 : PIN X-POSITION
REM X3 : BALL X-POSITION
REM XP : BALL RELEASE POINT
REM Y : PIN ROW COUNTER
REM Y0 : HIRES Y-COORDINATE
REM Z : PIN TABLE ENTRY
REM THESE ARE THE NORMAL USAGES
REM OF THE INDICATED VARIABLES;
REM HOWEVER, SOME VARIABLES ARE
REM USED IN SEVERAL ROUTINES TO
REM CONSERVE MEMORY ALLOCATION.
REM ***************************
REM * *
REM * NOTE: FOR COMPLETE USER *
REM * INSTRUCTIONS IN PRINTED *
REM * FORMAT, SIMPLY RUN THIS *
REM * PROGRAM. (TEXT FOLLOWS) *
REM * *
REM ***************************
REM Shape table MUST be named ShapeTbl in assembly source.
REM Programmer's Aid library accesses it by name.
REM Programmer's Aid Library variables
X0 = 0
Y0 = 0
COLR = 0
SHAPE = 0
ROT = 0
SCALE = 1
COLLSN = 0
REM Program variables
I = 0
J = 0
X = 0
Y = 0
Z = 0
DIM PIN(38),SET(2),A$(255),N$(20)
TEXT
CALL Home
GOSUB "Title"
GOSUB "InitTextScreen"
CALL CursorOff
VTAB 2: TAB 31: PRINT "A P P L E B O W L"
TAB 31: PRINT "- - - - - - - - -"
PRINT
TAB 21: PRINT "< By Charlie Kellner and Eric Larson >"
TAB 21: PRINT "< Apple IIGS Version by Greg Branche >"
PRINT
TAB 17: PRINT "Copyright (C) 1978, 1992 Apple Computer Inc."
TAB 15: PRINT "Portions Copyright (C) 1991 The Byte Works, Inc."
PRINT:PRINT
TAB 18: PRINT "Apple Bowl is a copyrighted software product"
TAB 15: PRINT "and as such may not be duplicated or transmitted."
PRINT:PRINT
TAB 19: PRINT "Copyright infringement may result in civil"
TAB 14: PRINT "damages whether or not a profit motive is involved."
VTAB 23: TAB 23
PRINT "Press the space bar to continue...";: CALL ClearStrobe
"WaitKey_2"
GOSUB "WaitForKey"
CALL Keyboard
IF Key # 32 THEN "WaitKey_2"
GOSUB "InitTextScreen"
REM " 1 2 3 4 5 6 7
REM "01234567890123456789012345678901234567890123456789012345678901234567890123456789
VTAB 2: TAB 31: PRINT "A P P L E B O W L"
VTAB 9
PRINT " The Apple Bowl is a 3-D, Hi-Resolution graphic simulation of a bowling alley."
PRINT " The computed motion of the ball & pins is derived from the laws of physics."
PRINT " All conditions normally encountered in bowling, such as the direction, speed,"
PRINT " spin, and weight of the ball and pins are included with the ball's position"
PRINT " to realistically determine the correct fall of the pins, and resulting score."
PRINT " The ball can be thrown from any point across the width of the bowling alley."
PRINT " Its direction, speed and spin are set at the moment of release by the mouse"
PRINT " and two keys on the keyboard - the Apple and Option keys."
VTAB 23: TAB 21: PRINT "Need instructions? (Hit 'Y' or 'N')...";
"WaitKey_3"
GOSUB "WaitForKey"
CALL Keyboard
IF Key = ASC("N") OR Key = ASC("n") THEN "Begin_Game"
IF Key # ASC("Y") AND Key # ASC("y") THEN "WaitKey_3"
GOSUB "InitTextScreen"
VTAB 1: TAB 29: PRINT "I N S T R U C T I O N S": PRINT
REM " 1 2 3 4 5 6 7
REM "01234567890123456789012345678901234567890123456789012345678901234567890123456789
PRINT " Three lanes are shown on your screen. Notice that you are (appropriately) on"
PRINT " lane ][. Occasionally you may notice activity on lanes I and ]I[: Don't let"
PRINT " this concern you; they're on different teams, and won't affect your score."
PRINT " When it's your turn to bowl, the Apple will displayLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
#include "TypesIIGS.r"␍␍resource rVersion (1) {␍ { 2,0,0,development,1 },␍ verUS,␍ "Apple Bowl IIGS",␍ "Copyright (c) 1991, Apple Computer, Inc."␍};␍␍resource rIcon (1) {␍ 0, // icon type = monochrome␍ 16, // height of icon␍ 16, // width of icon␍ $"FFFFFFFFFFFFFFFF"␍ $"FFC00FFFFFFC00FF"␍ $"FF0FC0FFFFF0FC0F"␍ $"FC0FF0FFFFC0FF0F"␍ $"FF0FC0FFFFF0FC0F"␍ $"FFC00FFFFFFC00FF"␍ $"FFC00FFFFFFC00FF"␍ $"FC0FC0C000C0FC0F"␍ $"F0FFC000000FFFC0"␍ $"C0FF00000000FFF0"␍ $"C0FF00000000FFF0"␍ $"C0FF00000000FFF0"␍ $"F0FFC000000FFFC0"␍ $"FC0FC0000000FC0F"␍ $"FFC00FC000FC00FF"␍ $"FFFFFFFFFFFFFFFF",␍ ␍ $"00FFF000000FFF00"␍ $"0FFFFF0000FFFFF0"␍ $"0FFFFF0000FFFFFF"␍ $"0FFFFF0000FFFFFF"␍ $"00FFFF00000FFFF0"␍ $"00FFF000000FFFF0"␍ $"0FFFFFFFFFFFFF00"␍ $"FFFFFFFFFFFFFFF0"␍ $"FFFFFFFFFFFFFFFF"␍ $"FFFFFFFFFFFFFFFF"␍ $"FFFFFFFFFFFFFFFF"␍ $"FFFFFFFFFFFFFFFF"␍ $"FFFFFFFFFFFFFFFF"␍ $"0FFFFFFFFFFFFFFF"␍ $"00FFFFFFFFFFFFF0"␍ $"000FF0FFFF0FFF00"␍};␍␍resource rBundle(1) {␍ 1, // rIcon id #␍ 1, // rBundle id #␍ { } // document array (no documents supported)␍};␍
|
||||
@@ -0,0 +1 @@
|
||||
;
; ReadButtons - Read game control buttons and place the values into variables
;
ReadButtons PROC EXPORT
IMPORT Button0, Button1
lda >$E0C061 ;read game control buttons ($C061 & $C062)
sep #$20
sta >Button0 ;store so the values can be read by BASIC
xba
sta >Button1
rep #$20
rtl
ENDP
;
; ClearHiRes - sets lores display mode
;
ClearHiRes PROC EXPORT
sep #$20
sta >$E0C056
rep #$20
rtl
ENDP
;
; SetHiRes - sets hires display mode (POKE -16297,0)
;
SetHiRes PROC EXPORT
sep #$20
sta >$E0C057
rep #$20
rtl
ENDP
;
; ClearText - turns off text mode (graphics on)
;
ClearText PROC EXPORT
sep #$20
sta >$E0C050
rep #$20
rtl
ENDP
;
; SetText - accesses soft switch to turn text display on
;
SetText PROC EXPORT
sep #$20
lda >$E0C051
rep #$20
rtl
ENDP
;
; ClearMixed - turns off mixed mode
;
ClearMixed PROC EXPORT
sep #$20
sta >$E0C052
rep #$20
rtl
ENDP
;
; SetMixed - turns on mixed mode
;
SetMixed PROC EXPORT
sep #$20
sta >$E0C053
rep #$20
rtl
ENDP
;
; CursorOff - sends Ctrl-F to output device to turn cursor off
;
CursorOff PROC EXPORT
IMPORT ~ChOut
lda #$0006
bra do_write
;
; CursorOn - Sends Ctrl-E to output device to turn cursor on
;
EXPORT CursorOn
CursorOn
lda #$0005
do_write
jsr ~ChOut ; use library routine
rtl
ENDP
;
; WriteLastSpace - stores a space character in the lower right corner of the screen
;
WriteLastSpace PROC EXPORT
sep #$20
longa off
lda #' '
sta >$0007F7
rep #$20
longa on
rtl
ENDP
;
; GetSysSpeed - retrieves current system speed and stores into BASIC variable
;
GetSysSpeed PROC EXPORT
IMPORT SysSpeed
sep #$20
longa off
lda >$E0C036 ;read CYA register
asl a ;shift speed bit into carry
rep #$20 ;back to 16-bit mode
longa on
lda #0 ;clear accumulator
rol a ;shift carry into bit 0 of accumulator
sta >SysSpeed ;store into BASIC variable
rtl
ENDP
;
; SetSysSpeed - resets current system speed
;
SetSysSpeed PROC EXPORT
Import SysSpeed
sep #$20 ;8-bit mode
longa off
lda >$E0C036 ;read the CYA register
asl a ;shift speed bit off
xba ;hide in high byte
lda >SysSpeed ;read the BASIC variable
lsr a ;shift bit into carry
xba ;retrieve CYA settings
ror a ;rotate speed bit in
sta >$E0C036 ;store back into CYA register
rep #$20
longa on
rtl
ENDP
;
; SetMousePosition - initializes mouse values
; Note: assumes mouse max clamp = 255
;
SetMousePosition PROC EXPORT
pea 128 ;set to midpoint of range
pea 128
ldx #$1E03 ;PosMouse
jsl $E10000
rtl
ENDP
TranslateZ PROC EXPORT
IMPORT Z, PinTable
lda Z ;get value of Basic's Z variable
clc
adc #4 ;calculate correct offset
tax
lda PinTable,x ;get the value there
sta Z ;store back into Basic's variable
rtl
ENDP
ShapeTbl RECORD Export
DC.W $0007 ;# of shapes in table
DC.W PinImage-ShapeTbl ;Offset to Shape_1
DC.W Arrow-ShapeTbl ;Offset to Shape_2
DC.W Dot-ShapeTbl ;Offset to Shape_3
DC.W Logo-ShapeTbl ;Offset to Shape_4
DC.W Apple-ShapeTbl ;Offset to Shape_5
DC.W I_Image-ShapeTbl ;Offset to Shape_6
DC.W Ball-ShapeTbl ;Offset to Shape_7
PinImage DC.B $92,$3A,$27,$27,$3C,$24,$24,$25 ;shape 1
DC.B $2C,$24,$25,$24,$3C,$24,$25,$2D
DC.B $2E,$36,$37,$36,$2E,$36,$35,$2E
DC.B $36,$36,$37,$3E,$3E,$3C,$27,$27
DC.B $3C,$24,$25,$2C,$24,$25,$24,$24
DC.B $24,$17,$0D,$16,$92,$32,$2E,$36
DC.B $35,$3E,$36,$3F,$3C,$24,$67,$64
DC.B $B4,$35,$2E,$17,$E6,$24,$04,$00
Arrow DC.B $35,$35,$35,$35,$0C,$2C,$2C,$2C ;shape 2
DC.B $1F,$3F,$3F,$15,$35,$0C,$04,$00
Dot DC.B $27,$2D,$36,$3F,$27,$64,$2D,$15 ;shape 3
DC.B $36,$1E,$3F,$04,$00
Logo DC.B $0C,$0D,$0D,$15,$F6,$17,$36,$0E ;shape 4
DC.B $15,$F6,$1E,$1F,$DC,$9F,$1F,$1C
DC.B $1C,$E4,$24,$24,$64,$0C,$0D,$0D
DC.B $0C,$64,$0C,$4C,$36,$1E,$17,$07
DC.B $00
Apple DC.B $E7,$1C,$64,$0C,$2D,$35,$36,$36 ;shape 5
DC.B $4D,$12,$24,$24,$24,$2C,$2D,$15
DC.B $15,$F6,$1E,$6F,$49,$91,$24,$24
DC.B $24,$2C,$2D,$15,$15,$F6,$1E,$6F
DC.B $49,$21,$24,$24,$24,$96,$52,$49
DC.B $09,$0C,$0C,$3C,$3F,$17,$17,$76
DC.B $0E,$2D,$2D,$00
I_Image DC.B $6D,$FD,$24,$24,$24,$3C,$6F,$29 ;shape 6
DC.B $05,$00
Ball DC.B $35,$35,$2D,$2E,$2D,$2D,$2C,$25 ;shape 7
DC.B $25,$25,$3F,$3E,$3E,$37,$27,$37
DC.B $27,$3F,$3C,$3C,$27,$2D,$35,$35
DC.B $25,$35,$25,$35,$25,$25,$3F,$3F
DC.B $3F,$3C,$3F,$67,$2D,$2D,$2E,$24
DC.B $35,$2E,$24,$35,$2E,$35,$2D,$3C
DC.B $3C,$27,$E5,$3B,$3F,$37,$3F,$67
DC.B $31,$00
ENDR
PinTable Record
DC.B $0F,$00
DC.B $03,$00
DC.B $01,$00
z_base DC.B $01,$00
DC.B $01,$00
DC.B $01,$00
DC.B $01,$00
DC.B $0E,$00
DC.B $06,$00
DC.B $02,$00
DC.B $02,$00
DC.B $02,$00
DC.B $02,$00
DC.B $03,$00
DC.B $0C,$00
DC.B $04,$00
DC.B $04,$00
DC.B $04,$00
DC.B $04,$00
DC.B $06,$00
DC.B $07,$00
DC.B $08,$00
DC.B $08,$00
DC.B $08,$00
DC.B $08,$00
DC.B $08,$00
DC.B $0C,$00
DC.B $0F,$00
DC.B $38,$00
DC.B $16,$00
DC.BLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
{---------------------------------------------------------------}␍{ }␍{ BASIC 1.0 }␍{ }␍{ A native code integer BASIC compiler for the Apple IIGS. }␍{ }␍{ By Mike Westerfield }␍{ }␍{ Copyright 1991 }␍{ By the Byte Works, Inc. }␍{ }␍{---------------------------------------------------------------}␍␍PROGRAM BASIC_Compiler(output);␍␍USES Types, BASICCom, Scanner, Parser;␍␍BEGIN {BASIC_Compiler}␍ InitCommon; {initialize the globals area}␍ InitScanner; {initialize the scanner}␍ InitParser; {initialize the parser}␍␍ Compile; {compile the program}␍␍ ShutDownScanner; {shut down the scanner}␍END. {BASIC_Compiler}␍
|
||||
@@ -0,0 +1 @@
|
||||
{---------------------------------------------------------------}
{ }
{ BASIC Common }
{ }
{ This module contains global variables, constants, types, }
{ and subroutines used throughout the compiler. }
{ }
{ Copyright 1991 }
{ By the Byte Works, Inc. }
{ }
{---------------------------------------------------------------}
{ }
{ Global subroutines: }
{ }
{ InitCommon - Initialize the globals area }
{ }
{---------------------------------------------------------------}
UNIT BASICCom;
INTERFACE
USES
CursorCtl,
Types;
CONST
nameLength = 100; {max length of a variable name}
stringLength = 255; {max length of a string constant}
m_adc_abs = $6D; {machine code instructions}
m_adc_imm = $69;
m_adc_s = $63;
m_and_imm = $29;
m_and_s = $23;
m_asl = $0A;
m_beq = $F0;
m_bge = $B0;
m_bmi = $30;
m_bne = $D0;
m_bpl = $10;
m_clc = $18;
m_cop = $02;
m_dec_a = $3A;
m_dec_abs = $CE;
m_eor_imm = $49;
m_inc_a = $1A;
m_inc_abs = $EE;
m_lda_imm = $A9;
m_ora_s = $03;
m_jml = $5C;
m_jmp = $4C;
m_jsl = $22;
m_jsr = $20;
m_lda_abs = $AD;
m_lda_absx = $BD;
m_lda_indl = $A7;
m_lda_dir = $A5;
m_ldx_abs = $AE;
m_ldx_dir = $A6;
m_sbc_dir = $E5;
m_sta_abs = $8D;
m_sta_absx = $9D;
m_sta_dir = $85;
m_sta_longx = $9F;
m_sta_s = $83;
m_pea = $F4;
m_pha = $48;
m_pla = $68;
m_plx = $FA;
m_ply = $7A;
m_rep = $C2;
m_rts = $60;
m_sec = $38;
m_sep = $E2;
m_tax = $AA;
d_bgn = $0101;
d_end = $0102;
d_lab = $0103;
d_str = $0104;
d_lnm = $0105;
d_brk = $0106;
d_ago = $0107;
d_sub = $0108;
d_exi = $0109;
d_fil = $010A;
TYPE
bytePtr = ^byte; {pointer to a single byte}
long = RECORD {used to convert longint to integer}
CASE boolean OF
true:
(l: longint);
false:
(lsw, msw: integer);
END;
{tokens}
{------}
nameType = string[nameLength]; {symbol name}
namePtr = ^nameType; {symbol name pointer}
stringType = string[stringLength]; {string constant}
tokens = (eofsy, eolnsy, {special symbols}
{constants and identifiers}
ident, intconst, stringconst,
{operators}
colon, comma, semicolon, lparen, rparen, eq, lt, gt, le, ge, ne, plus, minus, mult, divd, exp,
{reserved words}
abssy, andsy, ascsy, atsy, callsy, colorsy, dimsy, endsy, forsy, gosubsy, gotosy, grsy, hgrsy, hlinsy, ifsy,
inputsy, lensy, letsy, modsy, nextsy, notsy, orsy, pdlsy, plotsy, popsy, printsy, remsy, returnsy, rndsy, scrnsy,
sgnsy, stepsy, tabsy, textsy, text80sy, thensy, tosy, vlinsy, vtabsy);
tokenset = SET OF tokens; {set of tokens}
tokenType = RECORD {information about a token}
CASE kind: tokens OF
ident: (name: nameType);
intconst: (ival: integer);
stringconst: (str: stringType);
eofsy, eolnsy, colon, comma, semicolon,
lparen, rparen, eq, lt, gt, le, ge, ne,
plus, minus, mult, divd, exp, abssy,
andsy, ascsy, atsy, callsy, colorsy,
dimsy, endsy, forsy, gosubsy, gotosy,
grsy, hgrsy, hlinsy, ifsy, inputsy, lensy,
letsy, modsy, nextsy, notsy, orsy, pdlsy,
plotsy, popsy, printsy, remsy, returnsy,
rndsy, scrnsy, sgnsy, stepsy, tabsy,
textsy, text80sy, thensy, tosy,
vlinsy, vtabsy: ()
END;
{symbols}
{-------}
expressionTypes = (int, str); {types of expressions}
symbolPtr = ^symbolType; {pointer to a symbol table entry}
symbolType = RECORD {symbol table entry}
left, right: symbolPtr; {tree links}
name: nameType; {symbol name}
kind: expressionTypes; {type of the symbol}
size: integer; {array size (1 if not an array)}
newSymbol: boolean; {was this symbol just created?}
END;
VAR
{command line flags}
{------------------}
keep: boolean; {keep the output file?}
listSource: boolean; {create a source listing?}
listSymbols: boolean; {list symbols and code?}
quiet: boolean; {show progress info?}
showOffsets: boolean; {show object code offsets}
{error tracking and reporting}
{----------------------------}
msg: string; {terminal error message}
maxErrorLevel: integer; {max error level}
numErrors: integer; {number of errors found}
{scanner}
{-------}
keepFile: stringType; {output file name}
lineNumber: integer; {current line number}
token: tokenType; {current token}
sourceFile: stringType; {input file name}
lineType: (step, breakpoint, autogo); {debugger step type for the line}
{symbols}
{-------}
symbolTable: symbolPtr; {symbols in the program}
{return codes}
{------------}
retCode: (RC_Normal, RC_ParLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
****************************************************************
*
* BASICLib - Run-time library for the integer BASIC compiler.
*
* by Mike Westerfield
* May 1990
*
* Copyright 1990
* Byte Works, Inc.
*
****************************************************************
*
* Libraries 1.0.1, November 1991, Mike Westerfield
*
* 1. ~InputStr now pushes the length of the string on the
* stack, rather than 0.
*
****************************************************************
*
INCLUDE 'basiclib.macros'
****************************************************************
*
* BasicCommon - common data area
*
****************************************************************
*
BasicCommon RECORD
;
; Common variables for line input
;
cnt DS.B 2 ;chars left in line (see ~Input, ~EndInput)
disp DS.B 2 ;disp in line
inputLine dc.b 255 ;input line
dc.b 0
ds.b 255
DC.W 0 ;buffer for null terminating the line
;
; Common variables for text output
;
ch DS.B 2 ;output column number
chMask DS.B 2 ;40 column screen mask (for inverse)
col80 DC.W 1 ;1 -> 80 column output; 0 -> 40 column ouput
color DS.B 2 ;lowres graphics color
column DS.B 2 ;column number; tracked by output routines
cv DS.B 2 ;output line number
screenSize DC.W 81 ;screen width + 1
top DS.B 2 ;top line of text display
lineDisp DC.W $400,$480,$500,$580,$600,$680,$700,$780
DC.W $428,$4A8,$528,$5A8,$628,$6A8,$728,$7A8
DC.W $450,$4D0,$550,$5D0,$650,$6D0,$750,$7D0
;
; Misc global variables
;
QDHandle DS.B 4 ;handle for QD memory
userID DS.B 2 ;memory manager user ID
ENDR
****************************************************************
*
* Clear - Clear the 40 column text screen
*
* Inputs:
* top - top line to clear
* A - value to store in screen space
*
****************************************************************
*
~Clear PROC
with BasicCommon
phb ;use local addressing
phk
plb
sta screen ;save the screen value
lda top ;get the initial index into lineDisp
asl A
sta index
lb1 ldx index ;branch if at end of screen
cpx #48
bge lb3
lda lineDisp,X ;get line address
inx ;update index
inx
stx index
tax ;set initial line index
ldy #20 ;we will store 20 words
lda screen ;get the value to store
lb2 sta >0,X ;fill the line
inx
inx
dey
bne lb2
bra lb1 ;next line
lb3 plb
rts
index DS.B 2 ;index into lineDisp
screen DS.B 2 ;screen value
ENDP
****************************************************************
*
* Write40 - write a character to the 40 column screen
*
* Inputs:
* A - character to write
*
****************************************************************
*
~Write40 PROC
with BasicCommon
;
; Check for special characters
;
and #$007F
cmp #30
jge wr1
cmp #7 ;Bell
bne sp1
_SysBeep
rts
sp1 cmp #10 ;linefeed
bne sp2
Newline inc cv
lda cv
cmp #24
blt sp1a
lda #23
sta cv
jsr Scroll
sp1a rts
sp2 cmp #11 ;clear to end of screen
bne sp3
jsr ClearEOL
ph2 top
lda cv
inc cv
cmp #24
bge sp2a
sta top
lda #$A0A0
jsr ~Clear
sp2a pla
sta top
rts
sp3 cmp #12 ;home
bne sp4
stz ch
lda top
sta cv
lda #$A0A0
jsr ~Clear
rts
sp4 cmp #13 ;move to column 0
bne sp5
Return stz ch
rts
sp5 cmp #14 ;normal
bne sp6
lda #$00FF
sta chMask
rts
sp6 cmp #15 ;inverse
bne sp7
lda #$7F
sta chMask
rts
sp7 cmp #8 ;move left
bne sp8
dec ch
bpl sp7a
inc ch
sp7a rts
sp8 cmp #29 ;clear to end of line
bne sp9
ClearEOL ldy ch
lda cv
asl A
tax
lda lineDisp,X
adc ch
tax
shortm
lda #$A0
sp8a cpy #40
bge sp8b
sta >0,X
inx
iny
bra sp8a
sp8b longm
rts
sp9 cmp #28 ;move forward
bne wr1
Forward inc ch ;update ch
lda ch ;if ch = 40 then
cmp #40
blt sp9a
jsr Return ;new line
jsr Newline
sp9a rts
;
; Do a normal character write
;
wr1 pha ;save the character
lda cv ;write to the 40 column screen
asl A ;get the character address
tax
lda lineDisp,X
adc ch
tax
pla ;convert to screen character
shortm
ora #$80
and chMask
cmp #'@'
blt wr2
cmp #'_'+1
bge wr2
and #$3F
wr2 sta >0,X ;write the character
longm
jsr Forward ;update ch
rts
;
; Scroll subroutine
;
Scroll lda top ;line = top
sta line
sc1 lda line ;while line < 23 do
cmp #23
bge sc3
asl A ;get line disps
tax
lda lineDisp+2,X
tay
lda lineDisp,X
tax
lda #20 ;move one line of characters
sta loop
phb
pea 0
plb
plb
sc2 lda |0,Y
sta |0,X
inx
inx
iny
iny
lda >loop
dec A
sta >loop
bne sc2
plb
inc line ;++line
bra sc1 ;endwhile
sc3 ldx lineDisp+23*2 ;clear the bottom line
lda #$A0A0
ldy #20
sc4 sta >0,X
inx
inx
dey
bne sc4
rts
line DS.B 2 ;line number
loop DS.B 2 ;column loop counter
ENDP
****************************************************************
*
* BASICStartup - set up the run-time environLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
****************************************************************************************************
MACRO
inc4 &a1
inc &a1
bne @a
inc &a1+2
@a
MEND
****************************************************************************************************
MACRO
PH2 &addr,®
IF &addr[1:1]='#' AND &SETTING('LONGA')='ON' THEN
pea |&addr[2:255]
ELSE
IF &addr'' THEN
IF ®'' THEN
lda &addr,®
ELSE
lda &addr
ENDIF
ENDIF
pha
ENDIF
MEND
****************************************************************************************************
MACRO
PH4 &addr,&offset
IF &addr[1:1]='#' THEN
pea &addr[2:255]>>16
pea |&addr[2:255]
ELSEIF &addr[1:1]='[' THEN
ldy #&offset+2
ph2 &addr,y
ldy #&offset
ph2 &addr,y
ELSEIF &offset='s' THEN
ph2 &addr+2,s
ph2 &addr+2,s
ELSEIF &offset='' THEN
ph2 &addr+2
ph2 &addr
ELSE
ph2 &addr+2,&offset
ph2 &addr,&offset
ENDIF
MEND
****************************************************************************************************
MACRO
SUB2 &a1,&a2,&a3
IF &a1'' THEN
lda &a1
ENDIF
sec
sbc &a2
IF &a3'' THEN
sta &a3
ENDIF
MEND
****************************************************************************************************
MACRO
PL4 &addr1,&addr2
IF &addr1='' THEN
IF &addr2'' THEN
AERROR 'Illegal 2nd parameter'
ENDIF
PL2
PL2
ELSEIF &addr2='' THEN
PL2 &addr1
PL2 &addr1+2
ELSEIF &addr1[1:1]='[' THEN
ldy #&addr2
PL2 &addr1,y
ldy #&addr2+2
PL2 &addr1,y
ELSE
PL2 &addr1
sta &addr2
PL2 &addr1+2
sta &addr2+2
ENDIF
MEND
****************************************************************************************************
MACRO
BLE &BP
BLT &BP
BEQ &BP
MEND
****************************************************************************************************
MACRO
longm
rep #%00100000
longa on
MEND
MACRO
longx
rep #%00010000
longi on
MEND
MACRO
longmx
rep #%00110000
longa on
longi on
MEND
****************************************************************************************************
MACRO
shortmx
sep #%00110000
longa off
longi off
MEND
MACRO
shortm
sep #%00100000
longa off
MEND
MACRO
shortx
sep #%00010000
longi off
MEND
****************************************************************************************************
MACRO
JGE &BP
BLT @1
BRL &BP
@1
MEND
****************************************************************************************************
MACRO
PL2 &addr,®
pla
IF &addr'' THEN
IF ®'' THEN
sta &addr,®
ELSE
sta &addr
ENDIF
ELSEIF ®'' THEN
AERROR 'Illegal 2nd parameter'
ENDIF
MEND
****************************************************************************************************
MACRO
_SYSBEEP
LDX #$2C03
JSL $E10000
MEND
MACRO
_ClampMouse
ldx #$1C03
jsl $E10000
MEND
MACRO
_WRITECHAR
LDX #$180C
JSL $E10000
MEND
MACRO
QUIT &DCB
JSL $E100A8
DC.w $29
DC.l &DCB
MEND
MACRO
_INT2DEC
LDX #$260B
JSL $E10000
MEND
MACRO
_Multiply
ldx #$090B
jsl $E10000
MEND
MACRO
_SDivide
ldx #$0A0B
jsl $E10000
MEND
MACRO
_NewHandle
ldx #$0902
jsl $E10000
MEND
MACRO
_QDStartUp
ldx #$0204
jsl $E10000
MEND
MACRO
_QDShutDown
ldx #$0304
jsl $E10000
MEND
MACRO
_LineTo
ldx #$3C04
jsl $E10000
MEND
MACRO
_MoveTo
ldx #$3A04
jsl $E10000
MEND
MACRO
_SetSolidPenPat
ldx #$3704
jsl $E10000
MEND
MACRO
_ReadMouse
ldx #$1703
jsl $E10000
MEND
MACRO
_GetPixel
ldx #$8804
jsl $E10000
MEND
MACRO
_EMStatus
ldx #$0606
jsl $E10000
MEND
MACRO
_InitMouse
ldx #$1803
jsl $E10000
MEND
MACRO
_LONGDIVIDE
LDX #$0D0B
JSL $E10000
MEND
MACRO
_LONGMUL
LDX #$0C0B
JSL $E10000
MEND
MACRO
_READTIMEHEX
LDX #$0D03
JSL $E10000
MEND
****************************************************************************************************
macro
subroutine &parms,&work
lclc &macWork
&macWork setc &work
IF &work'' GOTO .a
&macWork setc '0'
.a
gbla &totallen
gbla &worklen
&worklen seta &s2i(&macWork)
&totallen seta 0
IF &parms='' GOTO .e
lclc &length
lclc &p
lcla &i
&i seta &NBR(&parms)
.b
&p setc &parms[&i]
&length setc &SubStr(&p,2,1)
IF &length=':' GOTO .c
&length setc &SubStr(&p,1,2)
&p setc &SubStr(&p,4,&len(&p)-3)
GOTO .d
.c
&length setc &SubStr(&p,1,1)
&p setc &SubStr(&p,3,&len(&p)-2)
.d
&p equ &totallen+3+&macWork
&totallen seta &totallen+&s2i(&length)
&i seta &i-1
IF &i GOTO .b
.e
tsc
sec
sbc #&macWork
tcs
inc a
phd
tcd
mend
****************************************************************************************************
macro
return &r
gbla &totallen
gbla &worklen
lclc &length
lclc &rr
&rr setc &r
IF &r'' GOTO .a
&rr setc '0'
&length setc '0'
GOTO .h
.a
&length setc &SubStr(&rr,2,1)
IF Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{---------------------------------------------------------------}
{ }
{ Code Generator }
{ }
{ The code generator creates the obj file, writing the }
{ approproate machine code instructions based on the }
{ intermediate code calls from the parser. }
{ }
{ Copyright 1991 }
{ By the Byte Works, Inc. }
{ }
{---------------------------------------------------------------}
{ }
{ Global subroutines: }
{ }
{ Gen0 - Generate an implied operand instruction }
{ Gen0Name - Generate an instruction with a named label }
{ Gen0NameShift - Generate an instruction with a named label, }
{ shifted by 16 bits }
{ Gen0Label - Generate an instruction with a numbered label }
{ Gen0Relative - Generate an instruction with an offset to a }
{ numbered label }
{ Gen0String - Generate an instruction with a string constant }
{ operand }
{ Gen1 - Generate a two byte constant operand instruction }
{ Gen1Byte - Generate a one byte constant operand instruction }
{ Gen1Name - Generate an instruction with a named label and }
{ offset }
{ GetLabel - Allocale a new numbered label }
{ GenDebugSymbols - Generate the debugger symbol table }
{ GenStrings - Generate string constants }
{ GenSymbols - Generate space for variables in the symbol }
{ table }
{ }
{---------------------------------------------------------------}
UNIT CodeGen;
INTERFACE
USES Memory, { for NewHandle }
Types,
BASICCom,
Scanner;
{---------------------------------------------------------------}
PROCEDURE Gen0(op: integer);
{ Generate an implied operand instruction }
{ }
{ Parameters: }
{ op - instruction to generate }
PROCEDURE Gen0Name(op: integer; name: namePtr);
{ Generate an instruction with a named label }
{ }
{ Parameters: }
{ op - instruction to generate }
{ name - pointer to the named operand }
PROCEDURE Gen0NameShift(op: integer; name: namePtr);
{ Generate an instruction with a named label shifted by 16 bits }
{ }
{ Parameters: }
{ op - instruction to generate }
{ name - pointer to the named operand }
PROCEDURE Gen0Label(op, lab: integer);
{ Generate an instruction with a numbered label }
{ }
{ Parameters: }
{ op - instruction to generate }
{ label - label number }
PROCEDURE Gen0Relative(op, lab: integer);
{ Generate an instruction with an offset to a numbered label }
{ }
{ Parameters: }
{ op - instruction to generate }
{ label - label number }
PROCEDURE Gen0String(op: integer; str: stringPtr);
{ Generate an instruction with a string constant operand }
{ }
{ Parameters: }
{ op - instruction to generate }
{ str - pointer to the string constant }
PROCEDURE Gen1(op, opnd: integer);
{ Generate a two byte constant operand instruction }
{ }
{ Parameters: }
{ op - instruction to generate }
{ opnd - operand }
{ }
{ Note: This procedure is declared as extern in Scanner.Pas. }
{ If the name or parameter list changes, be sure and }
{ make a corresponding change there. }
PROCEDURE Gen1Byte(op, opnd: integer);
{ Generate a one byte constant operand instruction }
{ }
{ Parameters: }
{ op - instruction to generate }
{ opnd - operand }
PROCEDURE Gen1Name(op: integer; name: namePtr; opnd: integer);
{ Generate an instruction with a named label and offset }
{ }
{ Parameters: }
{ op - instruction to generate }
{ name - pointer to the named operand }
{ opnd - numeric offset }
FUNCTION GetLabel: integer;
{ Allocale a new numbered label }
PROCEDURE GenDebugSymbols;
{ Generate the debugger symbol table }
PROCEDURE GenStrings;
{ Generate string constants }
PROCEDURE GenSymbols;
{ Generate space for variables in the symbol table }
{- Private declarations ----------------------------------------}
IMPLEMENTATION
CONST
{object segment info}
{-------------------}
csize = $BF; {size of the constant buffer}
segmentSize = maxint; {max size of a segment}
CODEkind = $0000; {segment kind = CODE}
DATAkind = $0001; {segment kind = DATA}
{labels}
{------}
labelSize = 1000; {max # of local labels}
{strings}
{-------}
ssize = 4000; {length of the constant string buffer}
TYPE
{object segment info}
{-------------------}
segmentType = ARRAY [0..segmentSize] OF byte; {segment buffer type}
segmentPtr = ^segmentType; {pointer to Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
# File: IntBasic.make␍# Target: IntBasic IntBasicLib␍# Sources: Basic.p BasicCom.p CodeGen.p Parser.p Scanner.p BasicLib.aii␍␍␍OBJECTS = :obj:Basic.p.o ¶␍ :obj:Parser.p.o ¶␍ :obj:Scanner.p.o ¶␍ :obj:CodeGen.p.o ¶␍ :obj:BasicCom.p.o␍␍All ÄÄ IntBasicIIGS IntBasicLib␍␍IntBasic ÄÄ IntBasicIIGS IntBasicLib␍␍IntBasicIIGS ÄÄ {OBJECTS}␍ Link -d -c 'MPS ' -t MPST -sym on -mf ¶␍ {OBJECTS} ¶␍ "{Libraries}"Stubs.o ¶␍ "{Libraries}"Runtime.o ¶␍ "{Libraries}"Interface.o ¶␍ "{PLibraries}"PasLib.o ¶␍ "{Libraries}"ToolLibs.o ¶␍ -o IntBasicIIGS␍␍:Obj: Ä :␍␍.p.o Ä .p␍ Pascal -sym on {default}.p -o :obj:␍␍:Obj:Basic.p.o Ä :Obj:Parser.p.o :Obj:Scanner.p.o :Obj:BasicCom.p.o␍:Obj:CodeGen.p.o Ä :Obj:Scanner.p.o :Obj:BasicCom.p.o␍:Obj:Parser.p.o Ä :Obj:CodeGen.p.o :Obj:Scanner.p.o :Obj:BasicCom.p.o␍:Obj:Scanner.p.o Ä :Obj:BasicCom.p.o␍␍IntBasicLib ÄÄ BasicLib.aii BasicLib.macros␍ AsmIIGS BasicLib.aii -o :obj:BasicLib.obj␍ Delete -i IntBasicLib␍ MakeLibIIGS -l IntBasicLib -r :obj:BasicLib.obj␍
|
||||
@@ -0,0 +1 @@
|
||||
{---------------------------------------------------------------}
{ }
{ Parser }
{ }
{ The scanner is responsible for checking the syntax of the }
{ program. In the process, it calls the symbol table }
{ subroutines. The symmantics are built into the parser; the }
{ symmantic subroutines call the code generator. }
{ }
{ Copyright 1991 }
{ By the Byte Works, Inc. }
{ }
{---------------------------------------------------------------}
{ }
{ Global subroutines: }
{ }
{ Compile - Compile the program }
{ InitParser - Initialize the parser }
{ }
{---------------------------------------------------------------}
UNIT Parser;
INTERFACE
USES Types, BASICCom, Scanner, CodeGen;
PROCEDURE Compile;
{ Compile the program }
PROCEDURE InitParser;
{ Initialize the parser }
{- Private declarations ----------------------------------------}
IMPLEMENTATION
CONST
maxFor = 16; {max # of nested for statements}
{direct page map}
{---------------}
tempDP = 0; {temp work area}
index = 2; {index for lvalue}
wptr = 4; {work pointer}
TYPE
{labels}
{------}
labPtr = ^labRecord; {ptr to a label record}
labRecord = RECORD {label record}
next: labPtr; {next record}
slineNumber: integer; {line number for this label}
labelNumber: integer; {label number for this line}
defined: boolean; {is the label defined?}
END;
{call statement permanent name list}
{----------------------------------}
callListPtr = ^callListRecord; {ptr to a call list record}
callListRecord = RECORD {call list record}
next: callListPtr; {next record}
name: nameType; {subroutine name}
END;
{private library label definitions}
{---------------------------------}
pvtSubID = (
id_AssignString,
id_Basic,
id_BasicShutdown,
id_BasicStartup,
id_Cmp_EQ,
id_Cmp_GE,
id_Cmp_GT,
id_Cmp_LE,
id_Cmp_LT,
id_Cmp_NE,
id_Cmp_Str_EQ,
id_Cmp_Str_NE,
id_Color,
id_DivD,
id_End,
id_EndInput,
id_Exp,
id_GR,
id_HGR,
id_HLin,
id_Input,
id_InputStr,
id_IntAbs,
id_IntSgn,
id_Logical,
id_Mod,
id_Mult,
id_PartialString,
id_Pdl,
id_Plot,
id_PrintEOL,
id_PrintInt,
id_PrintString,
id_PrintTab,
id_Prompt,
id_Rnd,
id_Scrn,
id_StringLength,
id_Tab,
id_Text80,
id_Text,
id_VLin,
id_VTab
);
VAR
callList: callListPtr; {call statement permanent name list}
expressionKind: expressionTypes; {type of the last expression}
endFound: boolean; {has an END statement been seen?}
forStuff: ARRAY [1..maxFor] OF
RECORD {for loop information}
symbol: symbolPtr; {loop variable}
termSymbol: symbolPtr; {terminating value variable}
stepSymbol: symbolPtr; {step value variable}
step: integer; {step size}
stepexpr: boolean; {TRUE = step defined as expression}
top: integer; {top of loop variable}
exit: integer; {exit loop variable}
END;
termSymCount: integer; {used to generate unique FOR loop}
stepSymCount: integer; {terminating and step variables }
slineNumber: - 1..maxint; {current BASIC source line number}
numFor: 0..maxFor; {number of active for statements}
{lvalues}
{-------}
id: tokenType; {identifier}
indexed: boolean; {is the value indexed?}
lkind: expressionTypes; {lvalue expression kind}
{labels}
{------}
labList: labPtr; {list of labels/line numbers}
symlabel: integer; {symbol table subroutine label}
pvtSubs: array[id_AssignString..id_VTab] of String[15];
{- General Use Subroutines -------------------------------------}
PROCEDURE InitParser;
{ Initialize the parser }
BEGIN {InitParser}
slineNumber := - 1; {no line numbers found, yet}
numFor := 0; {no active for loops}
endFound := false; {no END statement seen yet}
termSymCount := 1; {start variable names at 1}
stepSymCount := 1;
labList := NIL; {no labels in the label list}
callList := NIL; {no subroutine names called, yet}
{ fill the array with the library names }
pvtSubs[id_BasicShutdown] := '~BASICSHUTDOWN';
pvtSubs[id_BasicStartup] := '~BASICSTARTUP';
pvtSubs[id_Basic] := 'BASIC';
pvtSubs[id_Text80] := '~TEXT80';
pvtSubs[id_Text] := '~TEXT';
pvtSubs[id_HGR] := '~HGR';
pvtSubs[id_GR] := '~GR';
pvtSubs[id_End] := '~END';
pvtSubs[id_VTab] := '~VTAB';
pvtSubs[id_VLin] := '~VLIN';
pvtSubs[id_Tab] := '~TAB';
pvtSubs[id_PrintEOL] := '~PRINTEOL';
pvtSubs[id_PrintString] := '~PRINTSTRING';
pvtSubs[id_PrintInt] := '~PRINTINT';
pvtSubs[id_PrintTab] := '~PRINTTAB';
pvtSubs[id_Plot] := '~PLOT';
pvtSubs[id_Cmp_GE] := '~CMP_GE';
pvtSubs[id_EndInput] := '~ENDINPUT';
pvtSubs[id_InputStr] := '~INPUTSTR';
pvtSubs[id_Input] := '~INPUT';
pvtSubs[iLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
{---------------------------------------------------------------}
{ }
{ Scanner }
{ }
{ The scanner is responsible for reading and converting the }
{ source file into a series of tokens the compiler }
{ understands. This scanner is also the interface between }
{ the compiler and the ORCA shell. }
{ }
{ Copyright 1991 }
{ By the Byte Works, Inc. }
{ }
{---------------------------------------------------------------}
{ }
{ Global subroutines: }
{ }
{ FlagError - Flag an error }
{ InitScanner - Initialize the scanner }
{ NextCh - Read the next character from the source file }
{ NextToken - Read the next token from the source file }
{ ShutDownScanner - Shut down the scanner }
{ TermError - Handle a terminal error }
{ }
{---------------------------------------------------------------}
UNIT Scanner;
INTERFACE
USES
OSUtils, { for FInfo record }
Files, { for HSetFileInfo }
Memory, { for NewPtr, DisposPtr }
CursorCtl, { for the spinning cursor }
Signal, { to handle command-period }
PasLibIntf, { for standard I/O, etc. }
IntEnv, { for argV and argC }
Types,
BASICCom;
{---------------------------------------------------------------}
CONST
{special character codes}
{-----------------------}
ch_eoln = 13; {end of line}
ch_eof = 0; {end of file}
VAR
ch: char; {current character}
{---------------------------------------------------------------}
PROCEDURE InitScanner;
{ Initialize the file input module }
PROCEDURE FlagError(errNum: integer);
{ Flag an error }
{ }
{ Parameters: }
{ errNum - error number }
PROCEDURE NextCh;
{ Read the next character from the source file }
{ }
{ Variables: }
{ ch - character read from the file }
{ cp - pointer to the next character }
{ fileLength - number of characters left in the file }
PROCEDURE NextToken;
{ Read the next token from the source file }
{ }
{ Variables: }
{ ch - current character }
{ token - token read }
PROCEDURE ShutDownScanner;
{ Shut down the file input module }
PROCEDURE TermError(err: integer);
{ Handle a terminal error }
{ }
{ Parameters: }
{ err - terminal error number }
{- Private declarations ----------------------------------------}
IMPLEMENTATION
CONST
minCh = 0; {range of characters}
maxCh = 127;
maxErrors = 6; {max errors on one source line}
version = '1.1';
{tokens}
{------}
tokenLength = 8; {length of a token string}
TYPE
{character types}
chType = (chLetter, chNumber, chQuote, chIllegal, chcolon, chComma, chSemicolon, chLParen, chRParen, chEq, chLt, chGt,
chPound, chPlus, chMinus, chMult, chDivd, chExp, chSpace, chDollar, chEof, chEoln);
tokenString = string[8]; {token string}
VAR
{error tracking and reporting}
{----------------------------}
numErr: integer; {number of errors found on this line}
errors: ARRAY [1..maxErrors] OF {array of errors on the current line}
RECORD
err: integer; {error number}
pos: integer; {position in source line}
lineNumber: integer; {source line number}
END;
{lexical variables}
{-----------------}
chTypes: ARRAY [char] OF chType; {character types array}
{source file variables}
{---------------------}
cp: StringPtr; {pointer to the next char in the file}
srcBuf: bytePtr; {pointer to beginning of source file}
cpos: integer; {column number for ch}
tpos: integer; {cpos at start of last token}
tlineNumber: integer; {lineNumber at start of last token}
fileLength: longint; {number of characters left in the file}
lineStart: bytePtr; {cp at start of current line}
{tokens}
{------}
tokenNames: ARRAY [abssy..vtabsy] OF tokenString; {names of the tokens}
tokenIndex: ARRAY ['A'..'['] OF tokens; {start index for each letter}
{- Subroutines -------------------------------------------------}
{*----------------------------------*
| Stop - terminate execution |
*----------------------------------*}
PROCEDURE Stop(msg: Str255);
BEGIN {Stop}
IF Length(msg) > 0 THEN
BEGIN
PLFlush (Output);
WriteLn(Diagnostic);
WriteLn(Diagnostic, msg);
END;
IF interrupted THEN IEexit(-9);
{ don't worry about closing the files we opened. The Shell
will do so if appropriate.}
IEexit(Ord(retCode)); {exit, returning the appropriate status code}
END; {Stop}
{*--------------------------------------*
| Intr - Process external interrupt |
| this routine is passed to IEsigset |
*--------------------------------------*}
Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
Pascal -sym on BasicCom.p -o :obj:
Pascal -sym on Scanner.p -o :obj:
Pascal -sym on CodeGen.p -o :obj:
Pascal -sym on Parser.p -o :obj:
Pascal -sym on Basic.p -o :obj:
Link -d -c 'MPS ' -t MPST -sym on -mf ¶
:obj:Basic.p.o :obj:Parser.p.o :obj:Scanner.p.o :obj:CodeGen.p.o :obj:BasicCom.p.o ¶
"{Libraries}"Stubs.o ¶
"{Libraries}"Runtime.o ¶
"{Libraries}"Interface.o ¶
"{PLibraries}"PasLib.o ¶
"{Libraries}"ToolLibs.o ¶
-o IntBasicIIGS
|
||||
@@ -0,0 +1 @@
|
||||
# define object files necessary to build the compiler
Sources = :compiler:Basic.p ¶
:compiler:Parser.p ¶
:compiler:Scanner.p ¶
:compiler:CodeGen.p ¶
:compiler:BasicCom.p
all ÄÄ Apple.Bowl Read.Me
Apple.Bowl ÄÄ Bowl.r
RezIIGS Bowl.r -o Apple.Bowl
Apple.Bowl ÄÄ Bowl.obj BowlBin.obj ProgAid.lib :Compiler:IntBasicLib
LinkIIGS -w2 -t S16 -l >Bowl.map ¶
Bowl.obj ¶
BowlBin.obj ¶
-lib :compiler:IntBasicLib ¶
-lib ProgAid.lib ¶
-o Apple.Bowl
Read.Me ÄÄ Read.Me.txt Read.Me.r
Duplicate -d -y Read.Me.txt Read.Me
RezIIGS Read.Me.r -o Read.Me -t $70505445 -c pdos
BowlBin.obj Ä BowlBin.aii
AsmIIGS BowlBin.aii -o BowlBin.obj
Bowl.obj Ä Bowl.bas :Compiler:IntBasicIIGS
:Compiler:IntBasicIIGS Bowl.bas -o Bowl.obj
ProgAid.lib Ä ProgAid.obj
Delete -i ProgAid.lib
MakeLibIIGS -l ProgAid.lib -r ProgAid.obj
ProgAid.obj Ä ProgAid.aii
AsmIIGS ProgAid.aii -o ProgAid.obj
:Compiler:IntBasicIIGS Ä {Sources}
directory :Compiler:
make IntBasicIIGS >makeout
makeout
delete makeout
directory ::
:Compiler:IntBasicLib Ä :Compiler:BasicLib.aii :Compiler:BasicLib.macros
directory :Compiler:
AsmIIGS BasicLib.aii -o :obj:BasicLib.obj
Delete -i IntBasicLib
MakeLibIIGS -l IntBasicLib -r :obj:BasicLib.obj
directory ::
|
||||
@@ -0,0 +1 @@
|
||||
**************************
* *
* Apple-][ Hi-Resolution *
* Graphics Subroutines *
* *
* By Woz 9/13/77 *
* *
* All Rights Reserved *
* *
* Converted to IIGS by *
* Greg Branche 7/25/91 *
* *
**************************
;-----------------------------------------------
;
; Imported addresses
;
;-----------------------------------------------
IMPORT COLR
IMPORT ROT
IMPORT SCALE
IMPORT SHAPE
IMPORT ShapeTbl
IMPORT X0
IMPORT Y0
IMPORT collsn
;-----------------------------------------------
;
; Forward addresses and entries
;
;-----------------------------------------------
ENTRY bdrawx
ENTRY cshft2
ENTRY getx0
ENTRY gety0
ENTRY hdraw
ENTRY hlin
ENTRY hplot1
ENTRY hposn
ENTRY hposn3
ENTRY hxdraw
ENTRY pcolr
* Hi-Res Equates
; Direct page usage
sTblPtr equ $00 ;pointer to shape table
hColor1 equ $02 ;running color mask
CountH equ $04
HBasL equ $06 ;base address for current hi-res line
HBasH equ HBasl+1
HMask equ $0A
DXL equ $0C ;Delta-X for HLin, Shape
DXH equ $0D
ShapeX equ $0E ;shape temp
DY equ $10 ;Delty-Y for HLin, Shape
QDRnt equ $12 ;ROT Quandrant (Shape)
EL equ $14 ;error for HLin
EH equ $15
; soft switch locations
HiRes equ $E0C057 ;switch to hi-res video
MixSet equ $E0C053 ;select text/graphics mix
TxtClr equ $E0C050 ;select graphics mode
*
* Data area
*
HPag RECORD Export
DS.B 2
ENDR
Vars RECORD
X0L DS.B 1
X0H DS.B 1
My_Y0 DS.B 2
HColor DS.B 2
Hndx DS.B 2
my_scale DS.B 2
my_dp DS.B 2
UserID DS.B 2
msktbl DC.B $81 ;leftmost bit of byte
DC.B $82,$84,$88
DC.B $90,$a0
DC.B $c0 ;rightmost bit of byte
eq1c DC.B $1c
cos DC.B $ff,$fe,$fa,$f4,$ec,$e1,$d4,$c5,$b4
DC.B $a1,$8d,$78,$61,$49,$31,$18,$ff
ENDR
* basic_entry - used to set up environment when called from Basic
basic_entry PROC
with Vars
plx ;retrieve return address
phb ;save DBR
phk ;set to our bank
plb
phd ;save caller's direct page
lda my_dp ;set to our direct page
tcd
phx ;put return address back on stack
sep #$30 ;shift into 8-bit mode
rts
ENDP
* basic_exit - used to restore environment and return to Basic
basic_exit PROC
rep #$30 ;back to 16-bit mode
pld ;restore caller's direct page
plb ;and DBR
rtl ;then back to caller
ENDP
*
* High Resolution Graphics Inits
*
* entry points from Apple ][ basic
INIT PROC EXPORT
with Vars
longa on
longi on
phb ;save caller's DBR
phk ;set to my variables
plb
pha ;space for returned UserID
ldx #$0202 ;MMStartUp
jsl $E10000
pla ;retrieve UserID
sta UserID
pha ;space for handle
pha
pea 0
pea 32 ;need 32 bytes for direct page
pha ;UserID still in accumulator
pea %1100000000010001 ;attributes
pea 0 ;bank 0
pea 0
ldx #$0902 ;NewHandle
jsl $E10000
plx ;retrieve handle
pla
bcc have_handle ;no errors
die
brk 0 ;else just die
have_handle
phb ;save DBR
pha ;put high word of handle on stack
plb ;reset DBR
lda |0,x ;deref handle
plb ;restore DBR
plb
sta my_dp ;save for use later
phd ;save caller's direct page
tcd ;and use mine
pha ;space for handle
pha
pea 0
pea $4000 ;size of hi-res pages
lda UserID
pha ;UserID
pea %1100000000010111 ;attributes
pea $E0 ;bank $E0
pea $2000 ;hires buffers at $2000-$5FFF
ldx #$0902 ;NewHandle
jsl $E10000
plx ;retrieve handle
pla
bcs die ;die if we can't get the memory
lda #$20 ;Init for $2000-3fff
sta HPag ;hi-res screen memory
sep #$20
longa off
lda >hires ;set hires display mode
lda >mixset ;with text at bottom
lda >txtclr ;set graphics display mode
lda #$E0 ;set bank byte of base pointer
sta hbasl+2
rep #$20
longa on
pld ;restore caller's direct page temporarily
plb ;restore caller's DBR
EXPORT CLEAR
CLEAR
jsr basic_entry ;set up environment
longa off
longi off
lda #$0
Bkgnd0
sta hcolor1 ;set for black background
lda hpag ;init hi-res screen mem
sta sTblPtr+1 ;for current page, normally
ldy #$0
sty sTblPtr ;$2000-3fff or $4000-5fff
pea $E0E0 ;set DBR to graphics memory
plb
plb ;set to video memory bank
bkgnd1 lda hcolor1
sta (sTblPtr),y
jsr cshft2 ;(sTblPtr) will specify
iny ;32 separate pages
bne bkgnd1 ;throughout the init
inc sTblPtr+1
lda sTblPtr+1
and #$1f ;test for done
bne bkgnd1
jmp basic_exit ;return to caller
EXPORT BKGND
BKGND
jsr basic_entry ;set up environment
jsr pcolr ;background call
bra bkgnd0
ENDP
POSN PROC EXPORT
with Vars
jsr basic_entry ;set up environment
jsr local_posn ;call the real routine
jmp basic_exit ;then return
Entry local_posn
local_posn
jsr pcolr ;posn call, colr from basic
sta hcolor
jsr gety0 ;y0 from basic
pha
jsr getx0 ;x0 from basic
pla
jsr hposn
rts
ENDP
HPLOT PROC EXPORT
jsr basic_entLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
/* Resource fork definition for Apple Bowl's Read.Me file
This file is produced by DeRezzing the real Read.Me's resource fork. This is
done because Projector doesn't know how to deal with a IIGS resource fork on
a file. Therefore, the Read.Me file (produced on a IIGS) must be broken
apart into separate data and resource forks so that the files can be checked
into Projector.
If this file ever needs to be rebuilt, you should delete the 'data' blocks
below, and then execute the following line:
DeRezIIGS Read.Me >>Read.Me.r
*/
#define rStyleBlock $8012 // copied from TypesIIGS.r
data 0x7001 (0x1) {
$"AD00 7C02 1A00 0200 0000 0000 0FFF 0FFF" /* .|............. */
};
data rStyleBlock (0x1, purgeable3) {
$"0000 1400 0000 0000 0000 5902 0000 0000" /* ..........Y..... */
$"0000 0000 0000 0100 4000 4800 0000 FEFF" /* ........@.H..... */
$"0008 0000 FFFF 0000 0000 FEFF 0408 0000" /* ................ */
$"FFFF 0000 0000 0300 0008 0000 FFFF 0000" /* ................ */
$"0000 0300 0408 0000 FFFF 0000 0000 1400" /* ................ */
$"0008 0000 FFFF 0000 0000 1400 0408 0000" /* ................ */
$"FFFF 0000 0000 0100 0000 010D 0000 0000" /* ...........Â.... */
$"0000" /* .. */
};
|
||||
@@ -0,0 +1 @@
|
||||
"APPLE BOWL Enjoy this realistic simulation of a bowling alley. You have
complete control of the ball; APPLE keeps the score. (Order Nos.
A2T0015 - tape, A2D0018 - disk)"
- from "Apple" magazine, volume 1, number 3, circa 1979.
Apple Bowl was originally written and released in 1979. It was written using a language called Integer BASIC, which was written by Woz (Steve Wozniak, creator of the Apple ][) when he built the original Apple 1. When the Apple ][ was created, Integer BASIC was included in every machine.
Integer BASIC is a version of the BASIC programming language that deals only with fixed-point numbers (hence the name "Integer"). It was built into every Apple ][ sold until the Apple ][+ came along (the ][+ had AppleSoft built-in, just like your IIGS). Having a programming language built into your computer allows you to program the computer yourself, which means that you can tell the computer what YOU want it to do, instead of using off-the-shelf software which tells the computer what somebody ELSE thought that it should be doing. Of course, when the Apple ][ was introduced, there wasn't very much off-the-shelf software. This meant that many owners explored programming on their own, using the built-in language Integer BASIC.
One of the results of this "homebrew" programming was Apple Bowl. It was a game that simulated a bowling alley, using the Apple's hi resolution graphics, and giving the user complete control over speed and "english" of the ball and the release point within the lane. The program was written to compute the actual movement of the ball based on the physics of ball and pin movement. The program also automatically kept score for the player.
Fast-forward to 1991. The Byte Works (a company that produces software development tools) released a product called the Integer BASIC Compiler for the Apple IIGS. This product allowed a programmer to write programs using Integer BASIC, and then translate those programs into applications that could be executed on an Apple IIGS. One of the several Apple ][ fanatics within the Apple ][ software group at Apple Computer saw the possibilities of the compiler, and decided to update Apple Bowl.
The Apple Bowl that accompanies this Read.Me file is the result of about a month's worth of after-hours work. It started with the original Apple Bowl program, which was modified slightly to get it working with the compiler. The result is an Apple IIGS game that combines the best of the old with the best of the new. Instructions are included within the game itself.
To install Apple Bowl to another disk, you can either use the Installer program, or you can simply drag the Apple.Bowl icon from this disk to your disk using the Finder. You may also want to drag the AppleBowl.Icon file from the Icons folder to the Icons folder on your disk. (Please note that the Installer does not do this.) To run the program, simply Open the icon from within the Finder (just as you would for any other IIGS application).
This version of Apple Bowl was produced as a labor of love for the Apple ][. It certainly doesn't meet the standards of today's games, but it can be a lot of fun and maintains a link with the Apple ]['s long history. My only hope is that you receive some enjoyment from it.
Greg Branche
January, 1992
|
||||
@@ -0,0 +1 @@
|
||||
Set Echo 1
RezIIGS Bowl.r -o Apple.Bowl
directory :Compiler:
make IntBasicIIGS >makeout
makeout
delete makeout
directory ::
:Compiler:IntBasicIIGS Bowl.bas -o Bowl.obj
AsmIIGS BowlBin.aii -o BowlBin.obj
AsmIIGS ProgAid.aii -o ProgAid.obj
Delete -i ProgAid.lib
MakeLibIIGS -l ProgAid.lib -r ProgAid.obj
directory :Compiler:
AsmIIGS BasicLib.aii -o :obj:BasicLib.obj
Delete -i IntBasicLib
MakeLibIIGS -l IntBasicLib -r :obj:BasicLib.obj
directory ::
LinkIIGS -w2 -t S16 -l >Bowl.map ¶
Bowl.obj ¶
BowlBin.obj ¶
-lib :compiler:IntBasicLib ¶
-lib ProgAid.lib ¶
-o Apple.Bowl
Duplicate -d -y Read.Me.txt Read.Me
RezIIGS Read.Me.r -o Read.Me -t $70505445 -c pdos
|
||||
@@ -0,0 +1 @@
|
||||
#
# Build.All
# 15 May 89
#
# This Script builds all the AUG files for the 6.0 disk:
#
# ADU
# Installer
# Finder
# Control Panel and CDevs
# VideoMix stuff
# CDRemote
# GSCalcNDA
# EasyAccess stuff
#
# 2/1/90 Mensch
# Add Closeview stuff...
#
# 11/05/90 Branche
# Add GSCalcNDA stuff...
#
##################################################################
directory ADU
BuildProgram {Parameters} ADV.DISK.UTIL
directory ::Finder
BuildProgram {Parameters} Finder
directory :EasyMount:
BuildProgram {Parameters} EasyMount
directory :::Installer
BuildProgram {Parameters} Installer
BuildProgram {Parameters} Installer.Dev
directory ::ctlpanel
BuildEverything {Parameters}
directory ::CDRemote
BuildProgram {Parameters} CDRemote
directory ::GSCalcNDA
BuildProgram {Parameters} GSCalc.NDA
directory ::VideoMix:VideoMix.NDA
BuildProgram {Parameters} VideoMix.NDA
directory ::VideoMix.INIT
BuildProgram {Parameters} AppleIIVOC.INIT
directory :::CloseView
BuildProgram {Parameters} CloseView
directory ::VideoKeyboard
BuildProgram {Parameters} VideoKeyboard
directory ::MediaCtl
BuildEverthing {parameters}
directory ::EasyAccess
BuildProgram {parameters} EasyAccess
directory ::Apple.Bowl
Echo "# `Date -t` --- This is actually building AppleBowl"
BuildProgram {parameters} all
directory ::
|
||||
@@ -0,0 +1 @@
|
||||
PRINT NOHDR
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* File: CDRemote.aii *
* *
* Module for CD-Remote (A New Desk Accessory) *
* *
* Author: Don Brady *
* *
* Build File: CDRemote.make *
* *
* Copyright © APPLE Computer, Inc. 1987,1988 *
* All Rights Reserved. *
* *
* Modification History: *
* Version 1.0 *
* 01/18/88 Released A1 today *
* 02/11/88 Released A2 today *
* 02/17/88 Converted to MAX (from APW) today *
* 03/21/88 Release A4 today *
* 04/01/88 Release B1 today *
* 04/13/88 Release B2 (informal) today *
* 04/15/88 Release B3 today *
* 04/17/88 Release B4 (informal) today *
* 04/18/88 Final Release of 1.0 today *
* *
* Version 1.1 *
* 07/26/88 DJB - Added CDBusy flag *
* 09/01/88 DJB - Added call to _FlashMenuBar for key presses *
* *
* Version 1.2 *
* 12/02/88 DJB - Changes made for Matt's new CD Driver *
* 04/13/89 DJB - Changed from HeartBeatTask to RunQueueTask *
* *
* Version 1.3 - Maintenance by Cary Farrier *
* 11/01/90 CAF - Fixed Bug 60966 in DoAudioR,L. *
* *
* Version 1.3d2 - Maintenance by Dave Lyons *
* 23-Jan-91 - Made window create invisible so I can set the *
* background pattern to black before it draws the *
* first time. *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
PRINT OFF
INCLUDE 'Draw.equ'
INCLUDE 'CDRemote.equ'
INCLUDE 'all.macros'
PRINT ON
*===============================================*
* The standard NDA Header *
*===============================================*
NDAHeader PROC
IMPORT (NDAOpen,NDAClose,NDAAction,NDAInit):CODE
STRING ASIS
DC.L NDAOpen
DC.L NDAClose
DC.L NDAAction
DC.L NDAInit
DC.W 60 ;period (60 ticks = 1 sec)
DC.W $014E ;event mask
DC.B '--CD Remote\H**' ;menu text
DC.B 13
DC.B 'ver 1.3/' ;...for load file dumps
DC.B '© Copyright Apple Computer, Inc.1987-92'
STRING PASCAL
ENDP
*===============================================*
* Data for NDA *
*===============================================*
CDData RECORD
ENTRY ABMode:DATA
EXPORT CDAFrame:DATA
EXPORT CDAMin:DATA
EXPORT CDASec:DATA
EXPORT CDATime:DATA
ENTRY CDAudio:DATA
ENTRY CDButton:DATA
EXPORT CDCurTrk:DATA
EXPORT CDIndex:DATA
ENTRY DidAlert:DATA
ENTRY CDError:DATA
EXPORT CDFrame:DATA
ENTRY CDFrameA:DATA
EXPORT CDFrameB:DATA
ENTRY CDMaxTrk:DATA
EXPORT CDMin:DATA
ENTRY CDMinA:DATA
EXPORT CDMinB:DATA
EXPORT CDMinTrk:DATA
ENTRY CDMode:DATA
ENTRY CDPMode:DATA
ENTRY CDRepeat:DATA
ENTRY CDScan:DATA
EXPORT CDSec:DATA
ENTRY CDSecA:DATA
EXPORT CDSecB:DATA
EXPORT CDTrack:DATA
EXPORT CDTrkCnt:DATA
ENTRY CDWait:DATA
ENTRY CDWinPtr:DATA
ENTRY CDWinRec:DATA
ENTRY Modifier:DATA
ENTRY Point:DATA
ENTRY TimeMode:DATA
ENTRY WinPtr2:DATA
ENTRY EndRec:DATA
ENTRY EndRec2:DATA
ENTRY WinRec2:DATA
ENTRY WaitCur:DATA
ENTRY ItemString:DATA
ENTRY ErrString1:DATA
ENTRY ErrString2:DATA
ENTRY ErrString3:DATA
ENTRY ErrString4:DATA
ENTRY EndString1:DATA
ENTRY EndString2:DATA
ENTRY EndString3:DATA
ENTRY EndString4:DATA
ENTRY ErrStrPtr:DATA
ENTRY ErrStrRect:DATA
ENTRY OldWinPtr:DATA
ENTRY AlertTemplate:DATA
ENTRY WindowRect:DATA
ENTRY WindowRect2:DATA
* ENTRY ErrorCode:DATA
* ENTRY SenseKey:DATA
* ENTRY SenseCode:DATA
* ENTRY CDAlert:DATA
ENTRY MaxIndex:DATA
ENTRY CurIndex:DATA
ENTRY TrackMap:DATA
ENTRY CDTask:DATA
ENTRY CDDataDisc:DATA
ENTRY CDBusy:DATA
ENTRY TaskInQueue:DATA
; ENTRY NullTask:DATA
ENTRY AudioWait:DATA
;--------------- FLAGS ----------------
CDError DC.W $8000 ;0 = ok, else error
CDPMode DC.W 0 ;$01=shuffle, $02=AB-repeat
CDMode DC.W 0 ;0=stop,1=play,2=pause,3=no disc
CDRepeat DC.W 0 ;0 = off, 1 = on
DidAlert DC.W 0 ; 0: did error alert, 0 = not yet
CDAudio DC.W $C000 ;bit 15=left, bit 14=right
CDWait DC.W 0 ;timer
CDScan DC.W 0 ;0 = off, 1 = on
ABMode DC.W 0
TimeMode DC.W 0 ;0 = elapsed, 1 = remaining
Modifier DC.W 0 ;Event record modifier flags
WaitCur DC.W 0 ;1 = wait cursor on, 0 = off
CDTask DC.W 0 ;0 = no task, 0 is a task
CDDataDisc DC.W 0 ;0 = not data, 0 is only data
CDBusy DC.W 0 ; 0: CD-Remote is busy
TaskInQueue DC.W 0 ; 0: my task is in the queue
;NullTask DC.W 0 ; 0: means don't do task anymore
AudioWait DC.W 0 ; 0: if we are waiting for play completion
;---------- Current settings ----------
Point DC.L 0 ;mouse coordinates (y,x)
CDTrack DC.W 0
CDIndex DC.W 0
CDTrkCnt DC.W 0 ;integer number of tracks
CDMinTrk DC.W 0
CDMaxTrk DC.W 0
CDCurTrk DC.W 0 ;track from Q-sub channel
CDMin DC.W 0 ;time (track relative)
CDSec DC.W 0
CDFrame DC.W 0
CDAMin DC.W 0 ;time (absolute)
CDASec DC.W 0
CDAFrame DC.W 0
CDButton DC.W 0 ;button pushed
CDMinA DC.W 0 ;AB starting point
CDSecA DC.W 0
CDFrameA DC.W 0
CDMinB DC.W 0 ;AB ending point
CDSecB DC.W 0
CDFrameB DC.W 0
CDATime DS.B 200 ;(2*100) absolute time tLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * *
* File: CDRemote.equ *
* *
* Equates for CD-Remote (A New Desk Accessory) *
* *
* Author: Don Brady *
* *
* Build File: CDRemote.make *
* *
* Copyright © APPLE Computer, Inc. 1987,1988 *
* All Rights Reserved. *
* *
* * * * * * * * * * * * * * * * * * * * * * * * *
bStop equ 0 ;button IDs (CDButton)
bPLay equ 1
bPause equ 2
bEject equ 3
bSkipR equ 4
bSkipF equ 5
bScanR equ 6
bScanF equ 7
bAudioL equ 8
bAudioR equ 9
bRepeat equ 10
bAB equ 11
bShuffle equ 12
bTime equ 13
mdStop equ 0 ;current modes (CDMode)
mdPLay equ 1
mdPause equ 2
mdNoDisc equ 3
mdNoDrive equ 4
mdNoAudio equ 5
actWait equ 9 ;for control action timer
mShuffle equ $01 ;CD mode constants (CDPMode)
mABRept equ $02
abOff equ 0 ;AB repeat modes (ABMode)
abSetA equ 1
abSetB equ 2
abOn equ 4
w1Y equ 187-dvW1 ;window offsets
w1X equ 50
w2Y equ 50
w2X equ (640-dhW2)/2
w2X_320 equ (320-dhW2_320)/2
aDY equ 64
aDX equ 300
aDX_320 equ 270
aY equ 50
aX equ (640-aDX)/2
aX_320 equ (320-aDX_320)/2
aStrX equ 80
aStrX_320 equ 65
errNoRUBY equ $8000 ;init error codes
errNoRevC equ $4000
errNoSCSI equ $2000
errNotP16 equ $1000
keyModReg equ $E0C025
openAppleKey equ $80
audioPLay equ $00 ;Audio status results
audioPause equ $01
audioMute equ $02
audioComplete equ $03
audioError equ $04
audioVoid equ $05
true equ $FFFF
false equ $0000
|
||||
@@ -0,0 +1 @@
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * *
* File: GSOSDRIVER.aii *
* *
* GSOS Driver to AppleCD SCª (RUBY) drive *
* Module for CD-Remote (A New Desk Accessory) *
* *
* Author: Don Brady *
* *
* Build File: CDRemote.make *
* *
* Copyright © APPLE Computer, Inc. 1987-89 *
* All rights reserved. *
* *
* Modification History: *
* Version 1.1 *
* 07/26/88 DJB - Created today *
* * * * * * * * * * * * * * * * * * * * * * * * *
;...............................................................
;
; Set Memory & registers to 16 bits
;...............................................................
MACRO
SetLong
rep #%00110000
longa on
longi on
MEND
;...............................................................
;
; Set Memory & registers to 8 bits
;...............................................................
MACRO
SetShort
sep #%00110000
longa off
longi off
MEND
;-----------------------------------------------
;
; Imported data address (from CDRemote.aii)
;
;-----------------------------------------------
IMPORT CDAFrame
IMPORT CDAMin
IMPORT CDASec
IMPORT CDATime
IMPORT CDCurTrk
IMPORT CDData
IMPORT CDFrame
IMPORT CDMaxTrk
IMPORT CDMin
IMPORT CDMinTrk
IMPORT CDSec
IMPORT CDTrkCnt
include 'all.macros'
*===============================================*
* GS/OS Constants *
*===============================================*
GSOSEntry equ $E100A8
D_INFO equ $202C
D_STATUS equ $202D
D_CONTROL equ $202E
dcRemove equ $0004
dsOnline equ $0010
devCDROM equ $0007
pauseBit equ $10 ; changed to $10 DJB 12/02/88
stopBit equ $10
scanForward equ $00
;scanReverse equ $40
scanReverse equ $10 ; changed to $10 CAF 12/07/90
tocType0 equ $00
tocType1 equ $40
tocType2 equ $80
addrBlock equ $00
addrTime equ $40
addrTrack equ $80
dataTrack equ $8000
*===============================================*
* Device Driver Control Codes *
*===============================================*
ccEject equ $0002
ccRezeroUnit equ $8001
ccAudioSearch equ $80C8
ccAudioPlay equ $80C9
ccAudioPause equ $80CA
ccAudioStop equ $80CB
ccAudioStatus equ $80CC
ccAudioScan equ $80CD
ccReadTOC equ $80C1
ccReadQSub equ $80C2
ccReadHeader equ $80C3
*===============================================*
* Data for SmartPort Driver *
*===============================================*
SPData PROC
ENTRY DeviceNumber
DeviceNumber DC.W 0
ENTRY IsOnLine
IsOnLine DC.W 0 ;boolean flag
ENTRY Params
Params DC.W 0 ;parameter block for Version
ENTRY AudioBuffer
AudioBuffer DS.B 4*99 ;Audio I/O buffer
ENTRY PlayMode
PlayMode DC.W 9 ;default = stereo
ENTRY AControl
AControl DC.W 0
ENTRY ATrack
ATrack DC.W 0
ENTRY AIndex
AIndex DC.W 0
ENTRY AMin
AMin DC.W 0 ;not used ????
ENTRY ASec
ASec DC.W 0
ENTRY AFrame
AFrame DC.W 0
ENTRY dstat_params
dstat_params DC.W 5 ;pcount
ENTRY dstat_devnum
dstat_devnum DC.W 0 ;device number
ENTRY dstat_code
dstat_code DC.W 0 ;control code
ENTRY dstat_list
dstat_list DC.L dstat_data ;status list
ENTRY dstat_rcount
dstat_rcount DC.L 6 ;request count
ENTRY dstat_tcount
dstat_tcount DC.L 0 ;transfer count
ENTRY dstat_data
dstat_data DS.B 8
ENTRY dctrl_params
dctrl_params DC.W 5 ;pcount
ENTRY dctrl_devnum
dctrl_devnum DC.W 0 ;device number
ENTRY dctrl_code
dctrl_code DC.W 0 ;control code
ENTRY dctrl_list
dctrl_list DC.L ControlList ;control list ptr.
ENTRY dctrl_rcount
dctrl_rcount DC.L 0 ;request count
ENTRY dctrl_tcount
dctrl_tcount DC.L 0 ;transfer count
ENTRY ControlList
ControlList DC.W 0 ;this is always zero!
ENTRY CommandData
CommandData DS.B 12 ;command data
ENTRY AudioBufPtr
AudioBufPtr DC.L AudioBuffer ;data buffer ptr.
ENTRY part2_rcount
part2_rcount DC.L 0 ;transfer count for part 2
ENTRY dinfo_params
dinfo_params DC.W 8 ;pcount
ENTRY dinfo_devnum
dinfo_devnum DC.W 0 ;device number
ENTRY dinfo_devname
dinfo_devname DC.L DevNameBuf ;device name ptr
ENTRY dinfo_devchar
dinfo_devchar DC.W 0 ;device characteristics
DC.L 0 ;total blocks
DC.W 0 ;slot number
DC.W 0 ;unit number
DC.W 0 ;version
ENTRY dinfo_devid
dinfo_devid DC.W 0 ;device id
DevNameBuf DC.W 36 ;class 1 output string
DevName DS.B 34
ENDP
*===============================================*
* Initialize Driver *
* - make sure GS/OS is active *
* - look for SCSI Card Rev C *
* - look for a AppleCD SC (RUBY) drive *
* - check if device is online *
* *
* INPUT: none *
* *
* OUTPUT: ErrorCode (A-Reg) *
* $0000 = okay *
* $8000 = no RUBY drive *
* $4000 = no SCSI Rev C *
* $2000 = no SCSI card *
* $1000 = not GS/OS *
*===============================================*
EXPORT SPInit
EXPORT SPInit2
SPInit PROC
_GET_VERSION Params
lda Params
and #$7F00
cmp #$0200 ;is it GS/OS (2.0 or greater)?
bcs SPInit2
lda #$1000
bra exit
ENTRY SPInit2 ;for the "backdoor"
SPInit2
ldx Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
# File: CDRemote.make
# Target: CD.Remote
# Sources: cdplay.aii draw.aii gsosdriver.aii
# Created: Thursday, February 18, 1988 8:08:42 AM
#
# This will build the CDRemote project
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
cdremote.obj Ä cdremote.equ draw.equ cdremote.aii
AsmIIGS cdremote.aii -o cdremote.obj
draw.obj Ä draw.equ draw.aii
AsmIIGS draw.aii -o draw.obj
gsosdriver.obj Ä gsosdriver.aii
AsmIIGS gsosdriver.aii -o gsosdriver.obj
CDRemote Ä cdremote.obj draw.obj gsosdriver.obj
LinkIIGS cdremote.obj draw.obj gsosdriver.obj -o CDRemote
SetFile -t 'B8 ' CDRemote
|
||||
@@ -0,0 +1 @@
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * *
* File: Draw.aii *
* *
* A Module for CD-Remote (A New Desk Accessory) *
* *
* Date: 8/27/87 (created) *
* Author: Don Brady *
* *
* Build File: CDRemote.make *
* *
* Copyright APPLE Computer, Inc. 1987,1988 *
* *
* Modification History: *
* Version 1.0 *
* 01/18/88 Released A1 today *
* 02/11/88 Released A2 today *
* 02/17/88 Converted to MAX (from APW) today *
* 03/21/88 Release A4 today *
* 04/01/88 Release B1 today *
* 04/13/88 Release B2 (informal) today *
* 04/15/88 Release B3 today *
* 04/17/88 Release B4 (informal) today *
* 04/18/88 Final Release today *
* 23-Jan-91 Dave Lyons *
* Changed version to 1.3d2, copyright *
* to include 91. *
* *
* * * * * * * * * * * * * * * * * * * * * * * * *
include 'Draw.equ'
include 'all.macros'
*===============================================*
* Data for Draw Routines *
*===============================================*
DrawData PROC
ENTRY DisplayMode
ENTRY RectTbl1
ENTRY RectTbl2
ENTRY RectTbl3
ENTRY Rect320Tbl1
ENTRY Rect320Tbl2
ENTRY Rect320Tbl3
ENTRY WinRect
ENTRY DispRect
ENTRY DSRect
ENTRY WinRect320
ENTRY DispRect320
ENTRY DSRect320
ENTRY IconRect
ENTRY IconRect320
ENTRY AStrPtr
ENTRY StrPoint
ENTRY GrayPattern
ENTRY GrayPattern320
ENTRY Pattern2
ENTRY PictC
ENTRY PictB0
ENTRY PictB1
ENTRY PictB2
ENTRY PictB3
ENTRY PictB4
ENTRY PictB5
ENTRY PictB6
ENTRY PictB7
ENTRY PictB8a
ENTRY PictB8b
ENTRY PictB9a
ENTRY PictB9b
ENTRY PictB10a
ENTRY PictB10b
ENTRY PictB11a
ENTRY PictB11b
ENTRY PictB11c
ENTRY PictB11d
ENTRY PictB12a
ENTRY PictB12b
ENTRY PictB13
ENTRY PictApple
ENTRY PictApple_320
ENTRY PictAbout
ENTRY PictIcon
ENTRY PictMapL
ENTRY PictMapS
ENTRY PictMapT
ENTRY PictMapT_320
ENTRY PictMapB
ENTRY AudLPtr
ENTRY AudRPtr
ENTRY RepPtr
ENTRY ABPtr
ENTRY RndPtr
ENTRY LocInfoL
ENTRY PictPtrL
ENTRY PictRectL
ENTRY LocInfoS
ENTRY PictPtrS
ENTRY PictRectS
ENTRY LocInfoB
ENTRY PictPtrB
ENTRY PictRectB
ENTRY LocInfoT
ENTRY PictByteT
ENTRY PictPtrT
ENTRY PictRectT
ENTRY LocInfoC
ENTRY PictRectC
ENTRY LocInfoI
ENTRY PictRectI
ENTRY LocInfoA
ENTRY PictPtrA
ENTRY PictRectA
ENTRY PictPoint
ENTRY PictMode
EXPORT RectTblPtr
EXPORT IconRectPtr
DisplayMode DC.W $0080 ;$80 = 640, $00 = 320
BRect0 DC.W v1,h1,v1+dvB,h1+dhB ;Stop
BRect1 DC.W v1,h2,v1+dvB,h2+dhB ;Play
BRect2 DC.W v1,h3,v1+dvB,h3+dhB ;Pause
BRect3 DC.W v1,h4,v1+dvB,h4+dhB ;Eject
BRect4 DC.W v3,h1,v3+dvB,h1+dhB ;Skip Rev
BRect5 DC.W v3,h2,v3+dvB,h2+dhB ;Skip Fwd
BRect6 DC.W v3,h3,v3+dvB,h3+dhB ;Scan Rev
BRect7 DC.W v3,h4,v3+dvB,h4+dhB ;Scan Fwd
BRect8 DC.W v4,h1,v4+dvB,h1+dhB ;Audio Right
BRect9 DC.W v4,h2,v4+dvB,h2+dhB ;Audio Left
BRect10 DC.W v4,h3,v4+dvB,h3+dhB ;Repeat
BRect11 DC.W v4,h4,v4+dvB,h4+dhB ;AB Repeat
BRect12 DC.W v5,h1,v5+dvB,h1+dhB ;Shuffle
BRect13 DC.W v5,h2,v5+dvB,h2+dhB ;Time
IRect0 DC.W v1+1,h1+2,v1+1+dvB,h1+2+dhB ;Stop
IRect1 DC.W v1+1,h2+2,v1+1+dvB,h2+2+dhB ;Play
IRect2 DC.W v1+1,h3+2,v1+1+dvB,h3+2+dhB ;Pause
IRect3 DC.W v1+1,h4+2,v1+1+dvB,h4+2+dhB ;Eject
IRect4 DC.W v3+1,h1+2,v3+1+dvB,h1+2+dhB ;Skip Rev
IRect5 DC.W v3+1,h2+2,v3+1+dvB,h2+2+dhB ;Skip Fwd
IRect6 DC.W v3+1,h3+2,v3+1+dvB,h3+2+dhB ;Scan Rev
IRect7 DC.W v3+1,h4+2,v3+1+dvB,h4+2+dhB ;Scan Fwd
IRect8 DC.W v4+1,h1+2,v4+1+dvB,h1+2+dhB ;Audio Right
IRect9 DC.W v4+1,h2+2,v4+1+dvB,h2+2+dhB ;Audio Left
IRect10 DC.W v4+1,h3+2,v4+1+dvB,h3+2+dhB ;Repeat
IRect11 DC.W v4+1,h4+2,v4+1+dvB,h4+2+dhB ;AB Repeat
IRect12 DC.W v5+1,h1+2,v5+1+dvB,h1+2+dhB ;Shuffle
IRect13 DC.W v5+1,h2+2,v5+1+dvB,h2+2+dhB ;Time
SRect0 DC.W v1A,h1A,v1A+dvB,h1A+dhB ;Stop
SRect1 DC.W v1A,h2A,v1A+dvB,h2A+dhB ;Play
SRect2 DC.W v1A,h3A,v1A+dvB,h3A+dhB ;Pause
SRect3 DC.W v1A,h4A,v1A+dvB,h4A+dhB ;Eject
SRect4 DC.W v3A,h1A,v3A+dvB,h1A+dhB ;Skip Rev
SRect5 DC.W v3A,h2A,v3A+dvB,h2A+dhB ;Skip Fwd
SRect6 DC.W v3A,h3A,v3A+dvB,h3A+dhB ;Scan Rev
SRect7 DC.W v3A,h4A,v3A+dvB,h4A+dhB ;Scan Fwd
SRect8 DC.W v4A,h1A,v4A+dvB,h1A+dhB ;Audio Right
SRect9 DC.W v4A,h2A,v4A+dvB,h2A+dhB ;Audio Left
SRect10 DC.W v4A,h3A,v4A+dvB,h3A+dhB ;Repeat
SRect11 DC.W v4A,h4A,v4A+dvB,h4A+dhB ;AB Repeat
SRect12 DC.W v5A,h1A,v5A+dvB,h1A+dhB ;Shuffle
SRect13 DC.W v5A,h2A,v5A+dvB,h2A+dhB ;Time
RectTbl1 DC.L BRect0 ;stop
DC.L BRect1 ;play
DC.L BRect2 ;pause
DC.L BRect3 ;eject
DC.L BRect4 ;skip L
DC.L BRect5 ;skip R
DC.L BRect6 ;scan L
DC.L BRect7 ;scan R
DC.L BRect8 ;audio L
DC.L BRect9 ;audio R
DC.L BRect10 ;repeat
DC.L BRect11 ;AB
DC.L BRect12 ;shuffle
DC.L BRect13 ;time
RectTbl2 DC.L SRect0 ;stop
DC.L SRect1 ;play
DC.L SRect2 ;pause
DC.L SRect3 ;eject
DC.L SRect4 ;skip L
DC.L SRect5 ;skip R
DC.L SRect6 ;scan L
DC.L SRect7 ;scan R
DC.L SRect8 ;audio L
DC.L SRect9 ;audio R
DC.L SRect10 ;repeat
DC.L SRectLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * *
* File: Draw.equ (equates for Draw.aii) *
* *
* For CD-Remote (A New Desk Accessory) *
* *
* Author: Don Brady *
* *
* Build File: CDRemote.make *
* *
* Copyright © APPLE Computer, Inc. 1987,1988 *
* All Rights Reserved. *
* *
* * * * * * * * * * * * * * * * * * * * * * * * *
nButton equ 14 ;number of buttons
nText equ 19 ;number of text images
nStrings equ 4 ;number of strings
colorWin equ 0 ;window color (black)
colorTxt equ 3 ;text color (white)
colorOut equ 3 ;outline color (white)
colorTxt320 equ 15 ;text color (white 320)
colorOut320 equ 15 ;outline color (white 320)
dhB equ 40 ;width of buttons
dvB equ 11 ;height of butons
dhS equ 14 ;hort space
dvS equ 12 ;vert space
dhD equ 4*dhB+3*dhS+4 ;width of display
dvD equ 23 ;height of display
h1 equ 10 ;horizontal offsets
h2 equ h1+dhB+dhS
h3 equ h2+dhB+dhS
h4 equ h3+dhB+dhS
h1A equ h1+4
h2A equ h2+4
h3A equ h3+4
h4A equ h4+4
v1 equ 10 ;vertical offsets
v2 equ v1+dvB+5
v3 equ v2+dvD+dvS-2
v4 equ v3+dvB+dvS
v5 equ v4+dvB+dvS
v6 equ v5+dvB+2
v1A equ v1+2
v2A equ v2+2
v3A equ v3+2
v4A equ v4+2
v5A equ v5+2
dhO equ 13 ;width of button oval
dvO equ 5 ;height of button oval
dhPL equ 18 ;width of large picture
dvPL equ 17 ;height of large picture
dhPS equ 12 ;width of small picture
dvPS equ 11 ;height of small picture
dhL equ 20 ;width of label
dvL equ 7 ;height of label
dhI equ 84 ;width of disc icon
dvI equ 24 ;height of disc icon
dhR equ 26 ;width of Remote picture
dvR equ 20 ;height of Remote picture
dhA equ 16 ;width of Apple picture
dvA equ 8 ;height of Apple picture
dhN equ 15 ;width of number
dvN equ 11 ;height of number
dhC equ 2 ;width of colon
dvC equ 11 ;height of colon
dhT equ 56 ;width of text picture
dvT equ 5 ;height of text picture
dhW1 equ h1*2+dhD ;width of NDA window
dvW1 equ v6+dvI+4 ;height of NDA window
dhW2 equ 300 ;width of About window
dhW2_320 equ 265 ;width of About window
dvW2 equ 80 ;height of About window
h5 equ dhW1-2*h1-4*dhN-3
h6 equ dhW1-h1-dhI+2
pictX1L equ 2*h1 ;picture coordinates
pictX2L equ pictX1L+6+dhPL
pictY1L equ v2+3
pictY2L equ v2+3
pictCX equ h5+2*dhN ;picture coordinates
pictCY equ v2+9
tw0 equ 30/2 ;text string widths
tw1 equ 30/2
tw2 equ 37/2
tw3 equ 36/2
tw4 equ 38/2
tw5 equ 30/2
tw6 equ 34/2
tw7 equ 42/2
tw8 equ 49/2
tw9 equ 27/2
penMode equ 0
|
||||
@@ -0,0 +1 @@
|
||||
**************************************************************
* NOTE--This file is no longer used. See the makefile. --DAL
**************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * *
* File: SPDRIVER.aii *
* *
* SmartPort Driver to AppleCD SCª (RUBY) drive *
* Module for CD-Remote (A New Desk Accessory) *
* *
* Date: 8/27/87 (created) *
* Author: Don Brady *
* *
* Build File: CDRemote.make *
* *
* Copyright © APPLE Computer, Inc. 1987,1988 *
* *
* Modification History: *
* Version 1.0 *
* 01/18/88 Released A1 today *
* 02/11/88 Released A2 today *
* 02/17/88 Converted to MAX (from APW) today *
* 03/21/88 Release A4 today *
* 04/01/88 Release B1 today *
* 04/13/88 Release B2 (informal) today *
* 04/15/88 Release B3 today *
* 04/17/88 Release B4 (informal) today *
* 04/18/88 Final Release today *
* * * * * * * * * * * * * * * * * * * * * * * * *
;...............................................................
;
; Set Memory & A register to 8 bits
;...............................................................
MACRO
shortm
sep #%00100000
longa off
MEND
;...............................................................
;
; Set Memory & A register to 16 bits
;...............................................................
MACRO
longm
rep #%00100000
longa on
MEND
;...............................................................
;
; Set Memory & registers to 16 bits
;...............................................................
MACRO
SetLong
rep #%00110000
longa on
longi on
MEND
;...............................................................
;
; Set Memory & registers to 8 bits
;...............................................................
MACRO
SetShort
sep #%00110000
longa off
longi off
MEND
;-----------------------------------------------
;
; Imported data address (from CDRemote.aii)
;
;-----------------------------------------------
IMPORT CDAFrame
IMPORT CDAMin
IMPORT CDASec
IMPORT CDATime
IMPORT CDCurTrk
IMPORT CDData
IMPORT CDFrame
IMPORT CDMaxTrk
IMPORT CDMin
IMPORT CDMinTrk
IMPORT CDSec
IMPORT CDTrkCnt
include 'all.macros'
*===============================================*
* Data for SmartPort Driver *
*===============================================*
SPData PROC
ENTRY SPBuffer
ENTRY SPCode
ENTRY SPCount
ENTRY AudioBuffer
ENTRY InitError
ENTRY SPList
ENTRY Units
ENTRY Slot
ENTRY IsOnLine
ENTRY SPUnit
ENTRY Params
ENTRY SPBuffPtr
ENTRY PlayMode
ENTRY AControl
ENTRY ATrack
ENTRY AIndex
ENTRY AMin
ENTRY ASec
ENTRY AFrame
ENTRY SPErrStr
ENTRY EndStr
ENTRY SenseKey
ENTRY SenseCode
ENTRY ErrorCode
ENTRY ControlCode
ENTRY EntryAddr
IsOnLine DC.W 0 ;boolean flag
InitError DC.W 0 ;0 = okay, else error
Slot DC.W 0 ;SCSI card slot
Units DC.W 0 ;how many units
Params DC.W 0 ;parameter block for Version
SPBuffer DS.B 32 ;SP I/O buffer
AudioBuffer DS.B 4*99 ;Audio I/O buffer
SPList ;SP parameter list
SPCount DS.B 1 ;parameter count
SPUnit DS.B 1 ;unit number
SPBuffPtr DC.L SPBuffer ;buffer ptr
SPCode DS.B 10 ;other stuff
PlayMode dc.w 9 ;default = stereo
AControl dc.w 0
ATrack dc.w 0
AIndex dc.w 0
AMin dc.w 0 ;not used ????
ASec dc.w 0
AFrame dc.w 0
STRING ASIS
SPErrStr DC.B EndStr-SPErrStr-1
DC.B 'SmartPort error - $'
ErrorCode DC.B 'XX'
DC.B $0D
DC.B 'Control Code - $'
ControlCode DC.B 'XX'
DC.B $0D
DC.B 'Sense key/code - $'
SenseKey DC.B 'XX, $'
SenseCode DC.B 'XX'
DC.B $0D
DC.B 'SP Dispatch - $'
EntryAddr DC.B 'XXXXXX'
EndStr
ENDP
*===============================================*
* Initialize SmartPort *
* - make sure Prodos is ver. 1.0 (ie not 2.0) *
* - look for SCSI Card Rev C *
* - look for a AppleCD SC (RUBY) drive *
* - set dispatch address *
* - check if device is online *
* *
* INPUT: none *
* *
* OUTPUT: ErrorCode (A-Reg) *
* $0000 = okay *
* $8000 = no RUBY drive *
* $4000 = no SCSI Rev C *
* $2000 = no SCSI card *
* $1000 = not ProDos16 1.0 *
*===============================================*
EXPORT SPInit
EXPORT SPInit2
SPInit PROC
IMPORT GetSCSI
IMPORT GetCDROM
IMPORT SPCall
; _GET_VERSION Params
; lda Params
; and #$7F00
; cmp #$0100 ;is it ProDos 16 1.0 ?
; beq SPInit2
; lda #$1000
; sta InitError
; bra exit
ENTRY SPInit2 ;for the "backdoor"
SPInit2
lda #$2000 ;no SCSI card yet
sta InitError
ldx #7 ;start in slot 7
loop jsr GetSCSI
bcc next
jsr GetCDROM
bcs found
next dex
bne loop
lda InitError
bne exit
lda #$8000 ;no RUBY drive
bra exit
found
stx Slot ;SCSI slot
lda #$00 ;Status Code
sta SPCode
lda #^SPBuffer
sta SPBuffPtr+2
lda #SPBuffer
sta SPBuffPtr
lda #$40 ;command
ldx #$03 ;param count
jsr SPCall ;do status call
cmp #0
bne offline
lda SPBuffer
and #$0010 ;look at online bit
bne oLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
*===============================================*
* *
* File: CloseViewII.equ *
* Project: Close View GS *
* Author: Don J. Brady *
* *
* Copyright © Apple Computer, Inc. 1989,1990 *
* All rights reserved. *
*-----------------------------------------------*
* Modification History: *
* *
* 12/05/89 DJB File created today *
* *
*===============================================*
;--- change flag bits:
cfOnOff equ $80 ; change on/off state
cfMagnify equ $40 ; change magnification state
cfPowerUp equ $20 ; change power - up
cfPowerDown equ $10 ; change power - down
cfInvert equ $08 ; change invert state
;--- Hardware equates:
VirtualScreen equ $012000
RealScreen equ $E12000
SCBData equ $E19D00
ColorTableData equ $E19E00
EMXPos equ $E100E9 ; global X position
EMYPos equ $E100EB ; global Y position
TickCnt equ $E100DC ; global tick count
SHADOW equ $E1C035 ; hardware shadow register (byte)
NEWVIDEO equ $E1C029 ; hardware video register (byte)
VGCINT equ $E1C023 ; hardware VGC interrupt register (byte)
KBD equ $E1C000
KBDSTRB equ $E1C010
KEYMODREG equ $E1C025
SPEAKER equ $E1C030 ; hardware speaker
;--- BRAM Equates:
cvBRAM equ $5B
cvPowerMask equ %00001111 ; bits 0-3 (power)
cvUseKeys equ %00010000 ; bit 4
cvMagnify equ %00100000 ; bit 6
cvInvert equ %01000000 ; bit 6
cvEnabled equ %10000000 ; bit 7
cvBRAMDefaults equ cvUseKeys+2 ; 2x, disabled, magnify off, use keys, invert off
;--- Records:
Rect RECORD 0 ; QuickDrawII rectangle record
;-----------------------------------------------
top ds.W 1
left ds.W 1
bottom ds.W 1
right ds.W 1
;-----------------------------------------------
ENDR
Point RECORD 0 ; QuickDrawII point record
;-----------------------------------------------
v ds.W 1
h ds.W 1
;-----------------------------------------------
ENDR
LocInfo RECORD 0 ; QuickDrawII LocInfo record
;-----------------------------------------------
portSCB ds.W 1
ptrToPiximage ds.L 1
width ds.W 1
boundsRect ds Rect
;-----------------------------------------------
ENDR
Event RECORD 0 ; Event Manager Event
;-----------------------------------------------
what ds.W 1
message ds.L 1
when ds.L 1
where ds Point
modifiers ds.W 1
;-----------------------------------------------
ENDR
WMTask RECORD 0 ; Task Master Record
;-----------------------------------------------
wmEvent ds Event
wmTaskData ds.L 1
wmTaskMask ds.L 1
wmLastClickTick ds.L 1
wmClickCount ds.W 1
wmTaskData2 ds.L 1
wmTaskData3 ds.L 1
wmTaskData4 ds.L 1
wmLastClickPt ds Point
;-----------------------------------------------
ENDR
WindParamList RECORD 0 ; Window Manager ParamList
;-----------------------------------------------
paramLength ds.W 1
wFrameBits ds.W 1
wTitle ds.L 1
wRefCon ds.L 1
wZoom ds Rect
wColor ds.L 1
wYOrigin ds.W 1
wXOrigin ds.W 1
wDataH ds.W 1
wDataW ds.W 1
wMaxH ds.W 1
wMaxW ds.W 1
wScrollVer ds.W 1
wScrollHor ds.W 1
wPageVer ds.W 1
wPageHor ds.W 1
wInfoRefCon ds.L 1
wInfoHeight ds.W 1
wFrameDefProc ds.L 1
wInfoDefProc ds.L 1
wContDefProc ds.L 1
wPosition ds Rect
wPlane ds.L 1
wStorage ds.L 1
;-----------------------------------------------
ENDR
CVStatusRec RECORD 0 ; CloseView status record
;-----------------------------------------------
enabled ds.W 1 ; boolean
invert ds.W 1 ; boolean
magnify ds.W 1 ; boolean
usekeys ds.W 1 ; boolean
power ds.W 1 ; word {2,3,4,6,8,12}
noScreen ds.W 1 ; boolean
wasOn ds.W 1 ; boolean
;-----------------------------------------------
ENDR
CursorInfo RECORD 0 ; Cursor information record
;-----------------------------------------------
location ds Point ; cursor's current location
height ds.W 1 ; cursor's height (in lines)
width ds.W 1 ; cursor's width (in bytes)
hotSpot ds Point ; cursor's hotspot
;-----------------------------------------------
ENDR
;--- GS/OS system equates:
neReserved equ $0001 ; notification queue events
neGSOStoP8 equ $0002
neP8toGSOS equ $0004
neDiskInsert equ $0008
neDiskEject equ $0010
neShutDown equ $0020
neVolChange equ $0040
MACRO
&lab _AddNotifyProc
&lab pea $2034
jsl $E100B0
MEND
true equ $FFFF
false equ 0
|
||||
@@ -0,0 +1 @@
|
||||
#===============================================#
# File: CloseView.make #
# Project: CloseView GS #
# Author: Don J. Brady #
# #
# Copyright © Apple Computer, Inc. 1989-1991 #
# All rights reserved. #
# #
#===============================================#
PROJECT = CloseView
INIT_CODE = Core.obj ¶
Patches.obj ¶
Data.obj
NDA_CODE = NDA.obj
AOPTIONS =
LOPTIONS = -t $B6
{PROJECT} ÄÄ {PROJECT}.make {INIT_CODE} {NDA_CODE}
LinkIIGS {LOPTIONS} ¶
-lseg INIT {INIT_CODE} ¶
-lseg NDA {NDA_CODE} ¶
-o {PROJECT}
# generic rule to build object files from source files.
.obj Ä .aii
AsmIIGS {AOPTIONS} -o {Default}.obj {Default}.aii
|
||||
@@ -0,0 +1 @@
|
||||
*===============================================*
* *
* File: CloseViewII.equ *
* Project: Close View GS *
* Author: Don J. Brady *
* *
* Copyright © Apple Computer, Inc. 1989,1990 *
* All rights reserved. *
*-----------------------------------------------*
* Modification History: *
* *
* 12/05/89 DJB File created today *
* *
*===============================================*
;--- change flag bits:
cfOnOff equ $80 ; change on/off state
cfMagnify equ $40 ; change magnification state
cfPowerUp equ $20 ; change power - up
cfPowerDown equ $10 ; change power - down
cfInvert equ $08 ; change invert state
VirtualScreen equ $012000
RealScreen equ $E12000
SCBData equ $E19D00
EMXPos equ $E100E9 ; global X position
EMYPos equ $E100EB ; global Y position
TickCnt equ $E100DC ; global tick count
SHADOW equ $E1C035 ; hardware shadow register (byte)
NEWVIDEO equ $E1C029 ; hardware video register (byte)
VGCINT equ $E1C023 ; hardware VGC interrupt register (byte)
;--- Records:
Rect RECORD 0 ; QuickDrawII rectangle record
;-----------------------------------------------
top ds.W 1
left ds.W 1
bottom ds.W 1
right ds.W 1
;-----------------------------------------------
ENDR
Point RECORD 0 ; QuickDrawII point record
;-----------------------------------------------
v ds.W 1
h ds.W 1
;-----------------------------------------------
ENDR
|
||||
@@ -0,0 +1 @@
|
||||
*===============================================*
* *
* File: Core.aii *
* Project: Close view for the IIGS *
* Author: Don J. Brady *
* Build file: CloseViewII.Make *
* *
* Copyright © Apple Computer, Inc. 1989-1991 *
* All rights reserved. *
*-----------------------------------------------*
* Modification History: *
* 11/29/89 DJB - File created today *
* *
*===============================================*
* Major Routines: *
* *
* StartInit *
* CoreStartUp *
* CoreShutDown *
* Refresh *
* CoreRefresh *
*===============================================*
IF (&TYPE('DEBUG') = 'UNDEFINED') THEN
DEBUG EQU 0
ENDIF
PRINT NOPAGE
PRINT NOGEN
PRINT OFF
INCLUDE 'M16.Memory' ; toolbox macros
INCLUDE 'M16.Quickdraw'
INCLUDE 'M16.Desk'
INCLUDE 'M16.MiscTool'
INCLUDE 'M16.IntMath'
INCLUDE 'CloseView.equ'
PRINT ON
STRING ASIS
sizeOfTable equ 256*16
maxPower equ 12
minPower equ 2
maxScreenY equ 199
maxScreenX equ 639
maxScreenX_320 equ 319
framePixels equ 5
maxWidth equ 32
*===============================================*
* *
* Install our patches *
* *
*===============================================*
StartInit PROC
LONGA ON
LONGI ON
IMPORT InstallPatches
IMPORT GetROMVersion
IMPORT AddShutdownTask
IMPORT MyUserID
IMPORT ROMVersion
IMPORT NDAHeader ; in NDA segment
phb ; use local addressing
phk
plb
sep #$20 ; go into 8-bit mode
lda >KEYMODREG
rep #$20 ; go into 16-bit mode
and #$0040 ; if option key down
bne @exit ; don't install this init
;--- get a userID for memory allocations:
pha ; space for userID (word)
_MMStartUp
pla
sta MyUserID ; used for memory allocations
;--- find out what system we're on:
jsr GetROMVersion
sta ROMVersion
;--- install permanent system patches:
jsr InstallPatches
;--- install NDA header:
pha ; space for handle
pha
pea NDAHeader>>16
pea NDAHeader
_FindHandle
_InstallNDA
;--- install a GS/OS shutdown task:
jsr AddShutdownTask
@exit
plb
rtl
ENDP
*===============================================*
* Initialize our Core data *
* This routine is called at QD Startup time. *
* *
* IN: none *
* *
* OUT: none *
*===============================================*
CoreStartUp PROC EXPORT
LONGA ON
LONGI ON
IMPORT CVStat:CVStatusRec ; global data
IMPORT NextMouse:Point
IMPORT NewCursor:CursorInfo
IMPORT OldCursor:CursorInfo
IMPORT NewPower ; external routines
IMPORT EnableCV
IMPORT DisableCV
IMPORT SetShadowing
IMPORT GetCVDefaults
IMPORT GetScreenWidth
IMPORT BoxVBLTask
pea BoxVBLTask>>16
pea BoxVBLTask
_SetHeartBeat ; install our vbl task
jsr GetCVDefaults ; get defaults from BRAM
stz NextMouse.v ; cursor starts at 0,0
stz NextMouse.h
stz NewCursor.location.v
stz NewCursor.location.h
stz OldCursor.location.v
stz OldCursor.location.h
lda #0
sta >EMYPos
sta >EMXPos
jsr GetScreenWidth
jsr NewPower ; create default tables, etc
lda CVStat.wasOn ; was it on before?
bne turnOn ; yes, so start with it on
lda #1
jsr SetShadowing ; turn screen shadowing on
bra done
turnOn
jsl EnableCV
done
rts
ENDP
*===============================================*
* This routine is called at QD Shutdown time. *
* *
* IN: none *
* *
* OUT: none *
*===============================================*
CoreShutDown PROC EXPORT
LONGA ON
LONGI ON
IMPORT CVStat:CVStatusRec ; global data
IMPORT RestoreSCBs ; external routines
IMPORT SetShadowing
IMPORT SetCVDefaults
IMPORT BoxVBLTask
IMPORT EraseFrameBox2
IMPORT UpdateScreen
_HideCursor
pea BoxVBLTask>>16
pea BoxVBLTask
_DelHeartBeat ; remove our vbl task
lda CVStat.enabled ; if enabled AND magnify then...
beq else
lda CVStat.magnify
beq eraseBox
jsr UpdateScreen ; redraw one last time (without cursor)
jsr RestoreSCBs
bra done
eraseBox
jsr EraseFrameBox2 ; get rid of box
else
lda #0
jsr SetShadowing ; else turn screen shadowing off
done
jsr SetCVDefaults ; save user settings to BRAM
stz CVStat.enabled
rts
ENDP
*===============================================*
* Refresh CloseView (screen & data) *
* *
* This is the heart of CloseView. This routine *
* is constantly called at event time (through *
* our event manager patches). *
* *
* IN: none *
* *
* OUT: none *
* *
*===============================================*
Refresh PROC EXPORT
LONGA ON
LONGI ON
IMPORT CoreRefresh
IMPORT LastTicks
IMPORT DirtyMouse
IMPORT DirtyScreen
IMPORT CVStat:CVStatusRec
IMPORT Refreshing
phb
phk
plb
tsc ; check if we have enough stack space
cmp #$0200
bcc exit
php ; check if interrupts are off
php
pla
and #%00000100
bne exit ; exit if interrupts are off!
sep #$20
lLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
*===============================================*
* *
* File: Data.aii *
* Project: Close view for the IIGS *
* Author: Don J. Brady *
* Build file: CloseViewII.Make *
* *
* Copyright © Apple Computer, Inc. 1989-1991 *
* All rights reserved. *
*-----------------------------------------------*
* Modification History: *
* 12/06/89 DJB - File created today *
* *
*===============================================*
PRINT NOPAGE
PRINT NOGEN
PRINT OFF
STRING ASIS
INCLUDE 'CloseView.equ'
PRINT ON
*===============================================*
* Global data used by CloseViewII *
*===============================================*
GlobalData PROC
EXPORT Overlap
Overlap dc.W 200/2/5,640/2/5,200-(200/2/5),640-(640/2/5)
EXPORT DirtyScreen
DirtyScreen dc.W 0
EXPORT DirtyMouse
DirtyMouse dc.W 0
EXPORT CursorOff
CursorOff dc.W 0
EXPORT NextMouse
NextMouse dc.W 0,0
EXPORT BigRect
BigRect dc.W 0,0,99,319
EXPORT LastBigRect
LastBigRect dc.W 0,0,99,319
EXPORT MaxPt
MaxPt dc.W 200/2,640/2
EXPORT MinPt
MinPt dc.W 200/2/2,640/2/2
EXPORT MyUserID
MyUserID dc.W 0
EXPORT ScreenHandle
ScreenHandle dc.L 0
EXPORT Temp
Temp ds.B 10
EXPORT Counter ; generic counter
Counter ds.W 1
EXPORT Flag ; generic flag
Flag ds.W 1
EXPORT Change
Change dc.W 0
EXPORT ScreenHeight
ScreenHeight dc.W 200
EXPORT ScreenWidth
ScreenWidth dc.W 640
EXPORT HClip
HClip dc.W 0
EXPORT LastTicks
LastTicks dc.L 0
EXPORT IBarHeight
IBarHeight dc.W 0,0
EXPORT IBarPt
IBarPt dc.W 0,0
EXPORT myWinList
myWinList
dc.W endWinList-myWinList ; record size
dc.W 0 ; frame bits
dc.L @fake ; ptr to title
@fake dc.L 0 ; refCon
dc.W 0,0,0,0 ; zoomed rect
dc.L 0 ; color table ptr
dc.W 0,0 ; origin vert, horz
dc.W 0,0 ; data area hight,width
dc.W 0,0 ; max content height, width
dc.W 0,0 ; pixels to scroll vert, horz
dc.W 0,0 ; pixels to page vert, horz
dc.L 0 ; info bar string
dc.W 0 ; info bar height
dc.L 0 ; def proc ptr
dc.L 0 ; draw info bar routine
dc.L 0 ; draw content routine
dc.W 0,0,0,0 ; window position
dc.L -1 ; window plane
dc.L 0 ; memory pointer
endWinList
;--- boolean flags:
EXPORT NeedToPost
NeedToPost dc.W 0
EXPORT Refreshing
Refreshing dc.W 0
EXPORT TaskInQueue
TaskInQueue dc.W 0
EXPORT KeyBoardPatched
KeyBoardPatched dc.W 0
EXPORT CloseViewWasOn
CloseViewWasOn dc.W 0 ; false is the default
EXPORT TableSwitch
TableSwitch dc.W 0
EXPORT ChangeSCBs
ChangeSCBs dc.W 0
EXPORT ChangeCursor
ChangeCursor dc.W 0
EXPORT IBarOn
IBarOn dc.W 0
EXPORT IBarFound
IBarFound dc.W 0
EXPORT TrackingIBar
TrackingIBar dc.W 0
EXPORT HadToLoadFM
HadToLoadFM dc.W 0
EXPORT ModeSwitch
ModeSwitch dc.W 0
;--- vectors to real routines:
EXPORT RealUnDrawCursor
RealUnDrawCursor dc.L 0
EXPORT RealDrawCursor
RealDrawCursor dc.L 0
EXPORT RealShieldCursor
RealShieldCursor dc.L 0
EXPORT QDStartUpVec
EXPORT QDStartUpAddr
QDStartUpVec dc.B $5C ; jml $bbAAAA
QDStartUpAddr dc.L 0
EXPORT QDShutDownVec
EXPORT QDShutDownAddr
QDShutDownVec dc.B $5C ; jml $bbAAAA
QDShutDownAddr dc.L 0
EXPORT ClearScreenVec
EXPORT ClearScreenAddr
ClearScreenVec dc.B $5C ; jml $bbAAAA
ClearScreenAddr dc.L 0
EXPORT SetSCBVec
EXPORT SetSCBAddr
SetSCBVec dc.B $5C ; jml $bbAAAA
SetSCBAddr dc.L 0
EXPORT GetSCBVec
EXPORT GetSCBAddr
GetSCBVec dc.B $5C ; jml $bbAAAA
GetSCBAddr dc.L 0
EXPORT SetAllSCBsVec
EXPORT SetAllSCBsAddr
SetAllSCBsVec dc.B $5C ; jml $bbAAAA
SetAllSCBsAddr dc.L 0
EXPORT SetColorEntryVec
EXPORT SetColorEntryAddr
SetColorEntryVec dc.B $5C ; jml $bbAAAA
SetColorEntryAddr dc.L 0
EXPORT GetColorEntryVec
EXPORT GetColorEntryAddr
GetColorEntryVec dc.B $5C ; jml $bbAAAA
GetColorEntryAddr dc.L 0
EXPORT SetColorTableVec
EXPORT SetColorTableAddr
SetColorTableVec dc.B $5C ; jml $bbAAAA
SetColorTableAddr dc.L 0
EXPORT GetColorTableVec
EXPORT GetColorTableAddr
GetColorTableVec dc.B $5C ; jml $bbAAAA
GetColorTableAddr dc.L 0
EXPORT InitPortVec
EXPORT InitPortAddr
InitPortVec dc.B $5C ; jml $bbAAAA
InitPortAddr dc.L 0
EXPORT OpenPortVec
EXPORT OpenPortAddr
OpenPortVec dc.B $5C ; jml $bbAAAA
OpenPortAddr dc.L 0
EXPORT InvertRectVec
EXPORT InvertRectAddr
InvertRectVec dc.B $5C ; jml $bbAAAA
InvertRectAddr dc.L 0
EXPORT SetCursorVec
EXPORT SetCursorAddr
SetCursorVec dc.B $5C ; jml $bbAAAA
SetCursorAddr dc.L 0
EXPORT EMStartUpVec
EXPORT EMStartUpAddr
EMStartUpVec dc.B $5C ; jml $bbAAAA
EMStartUpAddr dc.L 0
EXPORT GetNextEventVec
EXPORT GetNextEventAddr
GetNextEventVec dc.B $5C ; jml $bbAAAA
GetNextEventAddr dc.L 0
EXPORT EventAvailVec
EXPORT EventAvailAddr
EventAvailVec dc.B $5C ; jml $bbAAAA
EventAvailAddr dc.L 0
EXPORT GetOSEventVec
EXPORT GetOSEventAddr
GetOSEventVec dc.B $5C ; jml $bbAAAA
GetOSEventAddr dc.L 0
EXPORT OLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
*===============================================*
* *
* File: NDA.aii *
* Project: Close view for the IIGS *
* Author: Don J. Brady *
* Build file: CloseViewII.Make *
* *
* Copyright © Apple Computer, Inc. 1990-1991 *
* All rights reserved. *
*-----------------------------------------------*
* Modification History: *
* 01/02/90 DJB - File created today *
* 9-Feb-92 DAL - fixed copyright date *
* *
*===============================================*
PRINT NOPAGE
PRINT NOGEN
PRINT OFF
INCLUDE 'M16.QuickDraw' ; toolbox macros
INCLUDE 'M16.Window'
INCLUDE 'M16.Control'
INCLUDE 'M16.Event'
INCLUDE 'M16.LineEdit'
INCLUDE 'M16.MiscTool'
INCLUDE 'E16.Window' ; toolbox equates
INCLUDE 'E16.Control'
INCLUDE 'E16.Event'
INCLUDE 'CloseView.equ'
PRINT ON
;--- window offsets:
wHeight equ 71
wWidth equ 316
wTop equ 31
wRight equ 16
wRight320 equ 2
wBottom equ wTop+wHeight
wLeft equ wRight+wWidth
hHeight equ 114
hWidth equ 310
hTop equ (200-hHeight)/3
hLeft equ (640-hWidth)/2
hBottom equ hTop+hHeight
hRight equ hLeft+hWidth
hWidth320 equ hWidth-8
hLeft320 equ (320-hWidth320)/2
hRight320 equ hLeft320+hWidth320
mx equ 10 ; horizontal margin
cx equ wWidth/2-2 ; center line
iHeight equ 25
iWidth equ 56
iconWidth equ 14 ; byte width of icon
PicWidth equ 4 ; byte width of pictures
magY1 equ 10
magX1 equ cx+32
iconY1 equ 1
iconX1 equ 60
onY1 equ 4
onX1 equ mx
offY1 equ onY1+11
offX1 equ mx
blackY1 equ offY1+15
blackX1 equ mx
whiteY1 equ blackY1+11
whiteX1 equ mx
pOnY1 equ magY1+4
pOnX1 equ cx+mx
pOffY1 equ pOnY1+11
pOffX1 equ cx+mx
powerY1 equ offY1+2
powerX1 equ wWidth-80
keyY1 equ pOffY1+15
keyX1 equ cx+mx
helpY1 equ wHeight-16
helpX1 equ wWidth-72
;--- control id numbers:
idOnRadio equ 1
idOffRadio equ 2
idBlackRadio equ 3
idWhiteRadio equ 4
idKeyCheckBox equ 5
idPowerPopUp equ 6
idMagOnRadio equ 7
idMagOffRadio equ 8
idHelpButton equ 9
*===============================================*
* *
* Standard NDA Header *
* *
*===============================================*
NDAHeader PROC EXPORT
LONGA ON
LONGI ON
STRING ASIS
IMPORT NDAOpen
IMPORT NDAClose
IMPORT NDAAction
IMPORT NDAInit
EXPORT menuID
EXPORT menuStr
dc.L NDAOpen
dc.L NDAClose
dc.L NDAAction
dc.L NDAInit
dc.W 1 ; period (60 ticks = 1 sec)
dc.W $016E ; event mask
menuStr dc.B '--CLOSE VIEW\BH' ; menu text
menuID dc.B '**' ; menu id
dc.B 13,13
ENDP
*===============================================*
* *
*===============================================*
NDAData PROC
STRING PASCAL
;--- string data ---
ENTRY strCopyright
strCopyright dc.B 'Apple Computer, Inc. 1990-92' ; note: © symbol is a pict
ENTRY strVersion
strVersion dc.B 'v1.0 '
ENTRY strMagnify
strMagnify dc.B 'Magnification:'
strNDATitle dc.B ' CloseViewª '
strNull dc.B 0
strOn dc.B 'On'
strOff dc.B 'Off'
strBlackOnWhite dc.B 'Black On White'
strWhiteOnBlack dc.B 'White On Black'
strUseKey dc.B 'Key Equivalents'
strHelp dc.B 'Help'
STRING ASIS
ENTRY strHelpText1
ENTRY EndHelpText1
strHelpText1
dc.B 'CloseView allows you to magnify the',13
dc.B 'contents of the desktop screen. It can',13
dc.B 'be controlled using this Desk Accessory',13
dc.B 'or just by using the following keyboard',13
dc.B 'equivalents.'
EndHelpText1
ENTRY strHelpText2
ENTRY EndHelpText2
strHelpText2
dc.B 17,'-option-O',13
dc.B 17,'-option-X',13
dc.B 17,'-option-',13
dc.B 17,'-option-',13
dc.B 17,'-option-I',13
EndHelpText2
ENTRY strHelpText3
ENTRY EndHelpText3
strHelpText3
dc.B 'Turn CloseView On/Off',13
dc.B 'Turn Magnification On/Off',13
dc.B 'Increase Magnification',13
dc.B 'Decrease Magnification',13
dc.B 'Invert the Display',13
EndHelpText3
;--- window data ---
ENTRY NDAWinPtr
NDAWinPtr dc.L 0
ENTRY HelpWinPtr
HelpWinPtr dc.L 0
stripes dc.W $0000,$0F00,$020F,$F0F0,$00F0
ENTRY WinParams
WinParams
dc.W @endParams-WinParams ; data length
dc.W 0 ; frame bits
dc.L strNDATitle ; title ptr
dc.L 0 ; RefCon
dc.W 0,0,0,0 ; full size
dc.L stripes ; color table ptr
dc.W 0 ; vertical org
dc.W 0 ; horizontal org
dc.W 0 ; data area height
dc.W 0 ; data area width
dc.W 0 ; max cont height
dc.W 0 ; max cont width
dc.W 0 ; vert scroll pixels
dc.W 0 ; hort scroll pixels
dc.W 0 ; vert page pixels
dc.W 0 ; hort page pixels
dc.L 0 ; info bar text ptr
dc.W 0 ; info bar height
dc.L 0 ; DefProc
dc.L 0 ; draw info bar routine
dc.L 0 ; draw content routine
dc.W 0,0,0,0 ; window position
dc.L $FFFFFFFF ; window plane
dc.L 0 ; 0 = allocate win record
@endParams
;--- data for controls ---
ret equ 13
ENTRY cOn ; current control settings
cOn dc.W 0
ENTRY cOff
cOff dc.W 1
ENTRY cBlack
cBlack dc.W 1
ENTRY cWhite
cWhite dc.W 0
ENTRY cPower
cPower dc.W 2
ENTRY cMagOn
cLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
************************************************************************************
*
* File: Patches.aii
* Project: Close View GS
* Author: Don J. Brady
*
* Copyright © Apple Computer, Inc. 1989-1992
* All rights reserved.
*
************************************************************************************
*
* Modification History:
*
* 12/05/89 DJB File created today
* 26-Aug-91 DAL Support smooth-launch (fiddled with patches for QDStartUp
* and ClearScreen)
* 3-Feb-92 DAL ClearScreen patch checks whether QD is active, and becomes
* transparent if not.
* 4-Feb-92 DAL QDStartUp patch checks if we are being called from AWGS
* 1.1v2; if so, we disable ourselves. Not compatible.
* 9-Feb-92 DAL QDShutDown removes Run Queue; search for date for others.
*
************************************************************************************
IF (&TYPE('DEBUG') = 'UNDEFINED') THEN
DEBUG EQU 0
ENDIF
PRINT NOPAGE
PRINT NOGEN
PRINT OFF
INCLUDE 'M16.Memory' ; toolbox macros
INCLUDE 'M16.Locator'
INCLUDE 'M16.MiscTool'
INCLUDE 'M16.Quickdraw'
INCLUDE 'M16.Event'
INCLUDE 'M16.Control'
INCLUDE 'M16.Window'
INCLUDE 'M16.Menu'
INCLUDE 'M16.LineEdit'
INCLUDE 'M16.Scheduler'
INCLUDE 'M16.TextEdit'
INCLUDE 'M16.Font'
INCLUDE 'M16.Desk'
INCLUDE 'E16.QuickDraw' ; toolbox equates
INCLUDE 'E16.Event'
INCLUDE 'E16.Window'
INCLUDE 'CloseView.equ'
PRINT ON
;--- toolbox references:
QDToolSet equ $04
QDStartUp equ $0204 ; QD routines that we patch
QDShutDown equ $0304
ClearScreen equ $1504
SetSCB equ $1204
GetSCB equ $1304
SetAllSCBs equ $1404
InitPort equ $1904
OpenPort equ $1804
HideCursor equ $9004
InvertRect equ $5604
SetCursor equ $8E04
SetColorEntry equ $1004
GetColorEntry equ $1104
SetColorTable equ $0E04
GetColorTable equ $0F04
ShieldCursor equ $E01E98 ; QD vectors that we patch
DrawCursor equ $E01FCC
UnDrawCursor equ $E01FD0
ROM1DrawCursor equ $FE40C3 ; ROM offsets (ick)
ROM3DrawCursor equ $FE53A7
ROM1UnDrawCursor equ $FE41D8
ROM3UnDrawCursor equ $FE54CA
EMToolSet equ $06
EMStartUp equ $0206 ; EM routines that we patch
GetNextEvent equ $0A06
EventAvail equ $0B06
GetOSEvent equ $1606
OSEventAvail equ $1706
GetMouse equ $0C06
Button equ $0D06
StillDown equ $0E06
WaitMouseUp equ $0F06
;--- standard bottleneck procedures:
StdText equ $E01E04
StdLine equ $E01E08
StdRect equ $E01E0C
StdRRect equ $E01E10
StdOval equ $E01E14
StdArc equ $E01E18
StdPoly equ $E01E1C
StdRgn equ $E01E20
StdPixels equ $E01E24
StdComment equ $E01E28
StdTxMeas equ $E01E2C
StdTxBnds equ $E01E30
StdGetPic equ $E01E34
StdPutPic equ $E01E38
scLnIntHnd equ $0A
kybdIntHnd equ $0F
crsrUpdtHnd equ $18
IDROUTINE equ $FE1F ; firmware id routine
*===============================================*
* *
* _QDStartUp Patch Routine *
* *
*===============================================*
MyQDStartUp PROC
LONGA ON
LONGI ON
IMPORT CoreStartUp ; external routines
IMPORT ClearRealScreen
IMPORT PatchCursor
IMPORT Beep
IMPORT PatchFinder
IMPORT MySystemTask
IMPORT GetCVDefaults
IMPORT CVStat:CVStatusRec ; global data
IMPORT ScreenHandle
IMPORT QDStartUpVec
IMPORT MyUserID
IMPORT NeedToPost
IMPORT QDGlobals
aSave SET 1 ; my stack offsets
dSave SET aSave+2
bSave SET dSave+2
rtlAddr2 SET bSave+1 ; input parameter stack offsets
rtlAddr1 SET rtlAddr2+3
userID SET rtlAddr1+3
maxWidth SET userID+2
masterSCB SET maxWidth+2
dPageAddr SET masterSCB+2
paramSize SET 4*2
phb ; save registers
phd
pha
phk ; allow access to globals
plb
tsc ; make a stack frame
tcd
stz CVStat.noScreen ; assume we'll get screen
*** added 4-Feb-92 DAL -- check for incompatible applications!
lda 4+5,s
tax
lda 6+5,s
and #$00ff
jsr CheckAppCompatibility ;in: AX=caller's address, out=clc/sec
bcs @notCompatible
*** end 4-Feb-92
pha ; space for handle (long)
pha
pea 0 ; size of screen: $8000 (long)
pea $8000
lda MyUserID
pha ; user id (word)
pea %0100000000000011 ; attributes: fixed, fixed address and bank
pea VirtualScreen>>16 ; screen address (long)
pea |VirtualScreen
_NewHandle
pla ; save the handle
plx
sta ScreenHandle
stx ScreenHandle+2
bcc ok
;--- add task to alert user and disable menu:
@notCompatible
inc CVStat.noScreen ; no CloseView under current application!
jsr GetCVDefaults ; get defaults from BRAM
lda CVStat.wasOn
sta NeedToPost
pea MySystemTask>>16
pea MySystemTask
_AddToRunQ
ok
lda <dPageAddr
sta QDGlobals
;;; lda <masterSCB
;;; and #$7FFF ; clr UseShadowing bit
;;; sta <masterSCB
*** optimized 4-Feb-92 DAL
lda #$8000
trb <masterSCB
*** end 4-Feb-92
;--- call QDStartUp:
pei <dPageAddr
pei <masterSCB
pei <maxWidth
pei <userID
sep #$20 ; pass callers rtl addr (3 bytes)
lda <rtlAddr1+2
pha
rep #$20
pei <rtlAddr1
lda <aSave ; restore a-reg (WAP)
jsl QDStartUpVec
sta <aSave ; save erLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
CloseView GS 1.0
Please ship this program so people can use it!
Release 1.0f2 Ñ April 29, 1991
-------------------------------------------------------------
Bug Fixes:
¥ BRC# 68609: Fixed a bug in the auto centering code so that CloseView
won't overflow the screen.
¥ BRC# 65723: Special cased the cursor width for 12x so bigger cursors
don't cause the view to move back and forth.
Other Changes:
¥ When CloseView shutsdown it will erase the cursor and framebox in case
the QuickDraw screen is left up by the Finder.
|
||||
Whitespace-only changes.
@@ -0,0 +1 @@
|
||||
;======================================================================
;
; AppleShare CDEV 2.0 -- The Real Thing
; by Mark Day
;
;
; This Control Panel allows the user to log on to a file server and
; mount volumes from the server.
;
; This version REQUIRES system 6.0 and AppleTalk Phase 2 drivers
; because it uses new calls (such as 6.0's case-insensitive compare
; and the GetZoneList2 call).
;
; Modification History:
;
; == Version 0.01 ==
; 23-Jul-91 MSD Written from scratch in assembly language!
;
; == Version 2.0d2 ==
; 26-Aug-91 MSD Fixed to use FILogin2 so that the server and
; zone names will be set correctly. Fixed the
; main window and volume list so that a double-
; click in a list will make the OK button blink.
;
; == Version 2.0d3 ==
; 27-Aug-91 MSD Started removing all BRK instructions and make
; the code do something intelligent (like try
; to put up an error message). Testing for
; AppleTalk and allocating memory now happen
; at RectCDEV time so I can use a smaller
; rectangle if there was an error. CreateCDEV
; message added; it creates a different list
; of controls if there was an error.
; 28-Aug-91 MSD Removed RectCDEV and CreateCDEV messages. Re-
; activated MachineCDEV and moved checking there.
; Added code to SelectVol to handle errors from
; mounting a volume.
; == Version 2.0d4 ==
; 06-Sep-91 MSD Starting to add auto-logon functionality.
; 14-Sep-91 MSD It now successfully reads the AppleShare.Prep
; file, logs on to the servers, and mounts the
; volumes. It puts up dialogs for passwords as
; needed (if it wasn't saved, or if the saved one
; was incorrect).
; 15-Sep-91 MSD Clicking on the "Quit" button from the volume
; list dialog no longer saves your password and
; will not update the AppleShare.Prep file. BTW,
; the button title has been changed to "Cancel".
;
; == Version 2.0d5 ==
; 20-Sep-91 MSD Turned off debugging symbols by default. Made
; AddVolPass and GetVolPass functional.
; 26-Sep-91 MSD ¥ StartLookup now displays an error if it gets
; an NBP busy error.
; ¥ Passwords in the message center are now
; stored scrambled (not plain text).
; ¥ RunCDEV now checks to see if there are no
; zones. If so, it checks again (in case they
; become available).
;
; == Version 2.0d7 ==
; 16-Oct-91 MSD ¥ In CloseCDEV, the user name is written before
; disposing my memory (so if a dialog comes up, the
; list controls will continue to draw properly).
; ¥ If you hit the zone control (including TAB),
; it only updates the server list if the zone
; actually changed.
; ¥ The user name is written to the ATINIT file
; only if it has actually changed.
;
; == Version 2.0d10 ==
; 8-Nov-91 MSD ¥ After volumes are mounted, call GetUserPath
; to force FIUserPrefix to be set.
; 11-Nov-91 MSD ¥ Fix bug with no volumes returned. It was
; returning an error when it should just display
; an empty list.
;
;======================================================================
;
; Begin 6.0.1
;
; 4-Mar-93 DAL ¥ For 6.0.1d14, adding AFP 2.1 support (we use
; AFP 2.1 instead of 2.0 if it's available).
;
; 25-Mar-93 DAL ¥ For 6.0.1d15, added range check on tracking
; checkboxes next to items in the volume list.
; If there were fewer than 4 volumes listed, we
; we tracking phantom checkboxes before.
; ¥ Removed the "inc hasAFP21" with "if 0 then".
; Support is needed elsewhere in the system before
; we enable this, so it's turned off for 6.0.1.
;
;======================================================================
print push,off
include 'E16.Types'
include 'E16.Resources'
include 'M16.Util'
include 'M16.MiscTool'
include 'E16.Memory'
include 'M16.Memory'
include 'M16.QuickDraw'
include 'E16.Window'
include 'M16.Window'
include 'E16.Control'
include 'M16.Control'
include 'E16.List'
include 'M16.List'
include 'M16.LineEdit'
include 'E16.Event'
include 'M16.Event'
include 'M16.IntMath'
include 'M16.Debug'
include 'E16.Locator'
include 'M16.Locator'
include 'M16.GSOS'
print pop
include 'AppleShareEqu.aii'
;======================================================================
;
; EnterCDEV
;
; This is the main entry point for the CDEV. It receives the various
; messages passed by the Control Panel itself.
;
; I will allocate a small stack frame for local variables and set up
; the direct page register to get to them. Each routine is called with
; a JSR and the result will be pre-set to 0. On return, the stack will
; be cleaned up and control will return to the caller.
;
; On entry, the stack contains:
; Long Result space
; Word Message (call number)
; Long Data1 (generally the cdev's grafport)
; Long Data2 (unused)
; 3 byte Return address
;
;======================================================================
;
; This is what our direct page will look like to called routines
;
dp record 1
locals ds.b localSize ; just for now
savedD dsLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
/**********************************************************************
/*
/* AppleShare.r
/*
/* This is the RezIIGS source for the AppleShare Control Panel
/* (the assembly language version).
/*
/* 26-Aug-91 MSD Version 2.0d2. Changed the "Connect as..."
/* string so there is a newline before the server
/* name (like the old CDEV). Key equivalents for
/* Cancel/Quit buttons are now Esc (the event hooks
/* translate Command-period to Esc).
/*
/* 26-Aug-91 MSD Version 2.0d3. Turn off fCtlCanBeTarget bit for
/* the volume list since there are no other
/* targettable controls, so why draw a focus frame?
/* Turn off wantMachine so I can display my own
/* error message. Turn on wantRect and wantCreate.
/* 27-Aug-91 MSD Turned off wantRect and wantCreate. Turned on
/* wantMachine. Removed extra control lists.
/*
/* 06-Sep-91 MSD Version 2.0d4. Added a new alert for servers
/* or volumes whose passwords haven't been stored
/* in the message center (i.e. not mounted by
/* the AppleShare Control Panel).
/* 15-Sep-91 MSD In the volume list dialog, changed the "Quit"
/* button to "Cancel".
/* 20-Sep-91 MSD Version 2.0d5. Changed to the yellow-folder
/* icon used by Finder and EasyMount.
/* 27-Sep-91 MSD Added an error message for when NBP is busy.
/* 10-Oct-91 MSD Version 2.0d6. Fixed the "webbed hand" appear-
/* ance of the icon where there is a white space
/* between the thumb and fingers (noticeable when
/* booting and icon is displayed on desktop).
/* 3-Nov-91 DAL Fixed spelling of "unkown" in unknown-error msg.
/* 7-Nov-91 MSD Version 2.0d10. Made the main window wider since
/* it now has its own window (as of System 6). Fixed
/* coordinates for OK button to be width-independent.
/* 2-Dec-91 MSD Version 2.0d11. Changed the user name line edit
/* to 31 characters.
/* 7-Feb-92 MSD Changed version to 2.0 final for 6.0d70 (GM).
/*
/**********************************************************************/
/*
/* Begin 6.0.1
/*
/* 2-Apr-92 DAL 2.1d1 for 6.0.1. Forces arrow cursor when closing
/* Connect As window.
/*
/* 4-Mar-93 DAL 2.1d14 for 6.0.1d14. Added AFP2.1 stuff.
/*
/* 25-Mar-93 DAL 2.1d15 for 6.0.1d15. Removed AFP2.1, fix checkboxes.
/*
/* 1-Apr-93 SS 2.1 (release) for 6.0.1d16.
/*
/**********************************************************************/
#include "TypesIIGS.r"
#define wantEdit $0800
/**********************************************************************
Definitions for flags used in keyboard equivalents
/**********************************************************************/
#define keyPad $2000
#define controlKey $1000
#define optionKey $0800
#define capsLock $0400
#define shiftKey $0200
#define appleKey $0100
#define escChar "\$1B"
/**********************************************************************
The CDEV code and flags
/**********************************************************************/
read rCDEVCode (1,Convert) "AppleShare.code";
resource rCDEVFlags (1) {
wantBoot+wantMachine+wantInit+wantClose+wantEvents
+wantHit+wantRun+wantEdit,
1, /* enabled */
2, /* version 2 */
1, /* ROM 1 or later */
0, /* reserved */
{0,0,172,280}, /* display rectangle */
"AppleShare", /* CDEV name (title) */
"Mark Day", /* Author's name */
"v2.1"; /* version number */
};
/**********************************************************************
Control List for about box
/**********************************************************************/
#define aboutText 1
resource rControlList (2) {
{aboutText};
};
resource rControlTemplate (aboutText) {
aboutText,
{38,5,138,280}, /* from DirectConnect */
statTextControl { {
ctlVisible,
fCtlProcNotPtr+refIsResource,
0, /* refcon */
aboutText /* ID of text */
} };
};
resource rTextForLETextBox2 (aboutText) {
"The AppleShare Control Panel allows you to connect "
"to an AppleShare File Server that supports AFP 2.0, "
"and mount volumes from that server. In addition, volumes "
"can be mounted automatically at system startup.";
};
/**********************************************************************
The controls from the main CDEV window
/**********************************************************************/
#define ServerString 11
#define ServerList 12
#define ServerOKButton 13
#define ZoneString 14
#define ZoneList 15
#define UserString 16
#define UserLE 17
#define LeftEdge 10
#define RightEdge 270
#define CenterHoriz ((LeftEdge+RightEdge)/2)
#define fInsideScroll 4
#define fSingleSelect 2
#define fCStrings 1
resource rControlList (1) { {
UserString,UserLE,
ZoneString,ZoneList,
ServerString,ServerList,ServerOKButton
} };
resource rControlTemplate (ServerString) {
ServerString,
{6,LeftEdge,16,RightEdge},
statTextControl { {
CtlInactive+fBlastText,
fCtlProcNotPtr+refIsResource,
0, /* refcon */
ServerString /* text ID */
} };
};
resource rTextForLETextBox2 (ServerString) {
"Select a file sLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
checkWidth equ 35 ; number of pixels to leave for checkbox
checkSize equ 25 ; actual size of check box
checkOffset equ 5 ; move checkbox right this many pixels
textOffset equ 10 ; move text right this many pixels
localSize equ 16 ; size of local vars inside all messages
MaxZones equ 255
ZoneBufSize equ MaxZones*33 ; zone list buffer
ZoneMemSize equ MaxZones*5 ; zone member records
MaxServers equ 255
ReplyEntSize equ 33+10+33 ; object + "AFPServer" + zone
SrvrBufSize equ MaxServers*ReplyEntSize ; server lookup buffer
SrvrMemSize equ MaxServers*5 ; server member records
MaxVols equ 50
VolBufSize equ MaxVols*33+5 ; room for FPGetSrvrParms reply
VolMemSize equ MaxVols*6
memChecked equ $8000 ; in second byte of memFlag for volume lists
memNever equ $0020 ; never select this item
MaxMessage equ 12 ; highest CDEV message number
;
; Control IDs for the main CDEV window
;
ServerString equ 11
ServerList equ 12
ServerOKButton equ 13
ZoneString equ 14
ZoneList equ 15
UserString equ 16
UserLE equ 17
;
; IDs for the "Connect as..." window
;
; Note: all buttons have IDs greater or equal to rConnButtons
; and all other controls have IDs that are less.
;
rConnDlg equ 20
rDlg1First equ 21 ; first ID of dialog 1
rGuest equ 21
rRegistered equ 22
rConnButtons equ 23 ; first button ID
rCCancel equ 23
rCOK equ 24
rCSetPass equ 25
rDlg1Last equ 25 ; last ID I care about
rConnString equ 26 ; "Connect to _server_ as:"
rNameStr equ 27
rNameLE equ 28
rPassStr equ 29
rPassLE equ 30
rScrambled equ 31 ; the "(Scrambled)" string
rClearText equ 32 ; the "(Clear text)" string
rAlreadyConn equ 33 ; "Already connected to..."
rNameStatText equ 34 ; user name as static text (*1)
;
; Resource and control IDs for the volume list window
;
idVolList equ 1 ; control ID
idNameOnly equ 2
idNameAndPass equ 3
idVQuit equ 4
idVOK equ 5
idVolMax equ 5 ; max control ID I care about
rVolDlg equ 40 ; resource ID
rSelStr equ 41
rVolList equ 42
rCheckedStr equ 43
rNameOnly equ 44
rNameAndPass equ 45
rVQuit equ 46
rVOK equ 47
;
; Resource and control IDs for the volume password window
;
idVPOK equ 1 ; the OK button
idVPCancel equ 2 ; the Cancel button
idVPText1 equ 3 ; "Enter a volume name..."
idVPText2 equ 4 ; "Password:"
idVPLE equ 5 ; the line edit box
rVPDialog equ 60
;
; Resource and control IDs for the set password window
;
rSetPassDlg equ 80
idSetPassCancel equ 1 ; Cancel button
idSetPassOK equ 2 ; OK button
idSetPassOld equ 3 ; old password line edit
idSetPassNew equ 4 ; new password line edit
idSPOldStat equ 5 ; old password as static text
;
; Resource IDs for AlertWindow messages
;
rBadAFPVers equ 100
rBadUAM equ 101
rTooManySess equ 102 ; PFI's tables are full
rServerBusy equ 103 ; too many people logged on
rNoResponse equ 104
rBadPassword equ 105
rBadUserName equ 106
rShuttingDown equ 107
rNBPBusy equ 108 ; NBP busy error
rUnknownErr equ 199
rATInitWriteErr equ 200
rConfirmPass equ 300 ; please confirm new password
rPassNoMatch equ 301 ; confirmation password didn't match
rOldPassBad equ 302 ; old password didn't work
rCantChangePass equ 303 ; couldn't change password (AccessDenied)
rNoAppleTalk equ 400
rOutOfMemory equ 401
rTooManyVols equ 500
rVolMiscErr equ 501
;
; AFP command numbers, etc.
;
FPLogin equ 18
FPLoginCont equ 19
FPGetUserInfo equ 37+$100 ; has ThisUser bit set
FPMapUserID equ $15+$100
FPGetSrvrParms equ 16
FPChangePass equ 36
FILogContErr equ $0A04 ; PFI's login continue error
FIAccessErr equ $0A07 ; PFI's access denied
FITooManyVols equ $0A08
FIUserNotAuth equ $0A15 ; bad password
FIParamErr equ $0A16 ; bad user name or password expired
FIWasMounted equ $0A11 ; volume was already mounted
SPTooManyCalls equ $0702
NBPBusy equ $0408 ; NBP too many processes
;
; Constants for using the Message Center
;
SrvrPassMsg equ $0044 ; message number for server passwords
VolPassMsg equ $0046 ; message number for volume passwords
;======================================================================
;
; Parameter block definitions
;
;======================================================================
GetFSTInfoRec record 0
pCount ds.w 1
fstNum ds.w 1
fileSysID ds.w 1
fstName ds.l 1 ; result buffer for FST name
version ds.w 1
attributes ds.w 1
blockSize ds.w 1
maxVolSize ds.l 1
maxFileSize ds.l 1
endr
GetUserPathRec record 0
pCount ds.w 1
fstID ds.w 1
cmd ds.w 1
prefixPtr ds.l 1
endr
CreateGSRec record 0
pcount ds.w 1
path ds.l 1
access ds.w 1
type ds.w 1
auxtype ds.l 1
endr
OpenGSRec record 0
pcount ds.w 1
refnum ds.w 1
path ds.l 1
reqAccess ds.w 1
endr
GetEOFGSRec record 0
pcount ds.w 1
refnum ds.w 1
eof ds.l 1
endr
SetMarkGSRec record 0
pcount ds.w 1
refnum ds.w 1
base ds.w 1
displacement ds.l 1
endr
ReadGSRec record 0
pcount ds.w 1
refnum ds.w 1
buffer ds.l 1
reqCount ds.l 1
transCount ds.l 1
endr
CloseGSRec record 0
pcount ds.w 1
refnum ds.w 1
endr
ATGetInfoRec record 0
async ds.b 1
command ds.b 1
reLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
;======================================================================
;
; AutoLogon.aii
;
; This file contains the routines used when mounting volumes at boot
; time. It does call some common routines in the main CDEV code, but
; the routines here are only needed at boot time.
;
; 20-Sep-91 MSD No longer starts up Font Manager or List Manager at
; boot time since these tools are never used. Does a
; HideMenuBar after initializing the tools so we don't
; have to stare at an empty menu bar. Changed NBP lookup
; to retry 12 times, every 1/4 second; this means you
; wait only 3 seconds instead of 11 for each server that
; can't be found. Removed definition of DebugSymbols.
;
; 4-Oct-91 MSD Must set up the MyID variable at boot time because the
; routines that use the Message Center use it. Also make
; sure to allocate messageHandle.
;
; 29-Oct-91 MSD Now starts up the List Manager at boot time so that it
; can use _CompareStrings.
;
; 07-Jan-92 MSD When setting up the entity name for the lookup, it now
; copies the zone name into LookupZone so TryLogin will
; set the zone properly (the zone field was showing as
; empty as returned by FIListSessions2 and in the Finder's
; GetInfo Where card).
;
;======================================================================
print push,off
include 'M16.GSOS'
include 'M16.Debug'
include 'M16.IntMath'
include 'E16.Types'
include 'M16.Memory'
include 'M16.Util'
include 'E16.Locator'
include 'M16.Locator'
include 'M16.Control'
include 'M16.QuickDraw'
include 'M16.Menu'
include 'AppleShareEQU.aii'
print pop
;======================================================================
;
; AutoLogon
;
; This is the main routine called by the BootCDEV message to make
; volumes get mounted at system startup time. It reads in the data
; from the AppleShare.Prep file and then loops through the server and
; volume lists, mounting as it goes.
;
;======================================================================
AutoLogon procname export
import OpenGS:OpenGSRec
import ReadGS:ReadGSRec
import CloseGS:CloseGSRec
import SetMarkGS:SetMarkGSRec
import serverInfo:ServerInfoRec
import volInfo:VolumeInfoRec
import FILogin:FILogin2Rec
import FILogout:FILogoutRec
import BuildPrepPath,BootConnectAs,subText
import FindTheServer,CopyUserName,CopyPassword
import GetStatus,hasAFP20,hasGuest,hasClearText,hasScrambled
import TryLogin,selectedUAM,userName,volsMounted
import StartTools,StopTools,CopyVolPassword,MountAVol
import mountFlag,AskForVolPass,serverCount
import AddSrvrPass,AddVolPass
import messageHandle,myID,NewHandle
;
; Get my Memory Manager user ID
;
pha ; space for result
_MMStartup
pla
ora #$0100 ; use auxID of 1 for my memory
sta myID
;
; Allocate handle for Message Center data
;
lda #8 ; just enough for count word
jsr NewHandle
bcs @err ; don't bother trying
sty messageHandle
stx messageHandle+2
;
; Set up pointers to server and volume names
;
lda #<serverInfo.serverName
sta subText ; point *0 to server name
lda #^serverInfo.serverName
sta subText+2
lda #<volInfo.volName
sta subText+8 ; point *2 to volume name
lda #^volInfo.volName
sta subText+10
jsr BuildPrepPath ; make the pathname to the file
lda #1 ; want read-only access
sta OpenGS.reqAccess
_OpenGS OpenGS
bcc isopen
jsr StopTools ; used only for _DisposeAll
@err rts ; error, so just exit
isopen
lda OpenGS.refnum ; copy file's refnum
sta ReadGS.refnum
sta CloseGS.refnum
sta SetMarkGS.refnum
;
; First, read count of servers
;
lda #<serverCount
sta ReadGS.buffer
lda #^serverCount
sta ReadGS.buffer+2
lda #2 ; just a word
sta ReadGS.reqCount
_ReadGS ReadGS
bcs ToCloseExit ; error, just close the file
lda serverCount ; any servers in the list?
bne ServerLoop ; yes, so loop through them
ToCloseExit brl CloseExit ; just close and exit now
;
; For each server in the list, read its info record
;
ServerLoop
stz volsMounted ; no volumes mounted yet
lda #<serverInfo
sta ReadGS.buffer
lda #^serverInfo
sta ReadGS.buffer+2
lda #ServerInfoRec.sizeof
sta ReadGS.reqCount
_ReadGS ReadGS
bcs ToCloseExit
; lda serverInfo.volCount
; beq NextServer ; no volumes, so do next server
;----------
; Now log on to the file server. If we get a bad name or password,
; then we put up the "Connect as..." dialog.
;----------
jsr FindTheServer ; try to find the server
bcs ToSkipVolumes ; not found, go to next server
jsr GetStatus ; see what server supports
bcs ToSkipVolumes ; no response, go to next server
lda hasAFP20 ; does it support AFP 2.0?
beq ToSkipVolumes ; no, so next server
;
; If saved to log on as guest, and server doesn't support guest,
; then skip it. Otherwise, set selectedUAM and go log on.
;
jsr CopyUserName ; set up userName variable
jsr CopyPassword ; set up serverPassword variable
lda userName
Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
**************************************************
*
*
* des - data encryption standard.
*
*
* written by 07-03-86
* david su
*
* modified : 01-27-87 06:00 (tde)
* 5-29-87: Converted source to MacToGS (rbh)
*
* (c) 1987 paramis corporation
* (c) 1987 Apple Computer Inc
* all rights reserved
*
* Rick Hoiberg 5/29/87
*
* modified : 08-23-88 (srk)
* converted to MPW IIGS (MAX) assembler
*
* 10-Aug-91 MSD: Changed to make it easier to call from full native
* mode on a 65816. Improved documentation of calling convention.
* The calling convention is described below:
*
* On entry,
* Called by JSL
* Full native mode (16 bit A,X,Y)
* X = low word of parameter block pointer
* Y = high word of parameter block pointer
*
* Parameter list:
* $00 Pointer to 8 byte password (key)
* $04 Pointer to 8 byte data to encrypt
* $08 Pointer to 8 byte result
*
* The routine creates room on the stack for its own zero
* page use.
*
**********************************************************
MACHINE M65816
EXPORT DES
DES PROC
DirectPage record 1
savedD ds.w 1
Zp0 ds.l 1
Zp1 ds.l 1
savedB ds.b 1
endr
*
* create a stack frame
*
phb ;save current data bank
phk
plb ;data bank = program bank
pha ; make room for locals
pha
pha
pha
phd
tsc
tcd
with DirectPage
*
* save parameter list location
*
stx Zp0 ;save parameter list pointer
sty Zp0+2
*
* save key in our work area
*
lda (Zp0) ;save key
sta Zp1
ldy #$02
lda (Zp0),y
sta Zp1+2
;
ldy #$06 ;move all eight bytes of key
des1 lda (Zp1),y
sta key,y
dey
dey
bpl des1
*
* save password in our work area
*
ldy #$04
lda (Zp0),y
sta Zp1
iny
iny
lda (Zp0),y
sta Zp1+2
;
ldy #$06 ;move all eight bytes of key
des2 lda (Zp1),y
sta random,y
dey
dey
bpl des2
;
;
;
*
* initialize the count
*
ldx #0
des4 ;
stz des_count,x
inx
inx
cpx #32
bne des4
;
; save our zero page values here - for some reason they are getting trashed
; when we do the encoding routines.....
;
lda Zp0
sta saveZp0
lda Zp0+2
sta saveZp0+2
;
sep #$30
LONGA OFF
LONGI OFF
;
jsr keysched
jsr encode
*
* save result
*
Rep #$30
LONGA ON
LONGI ON
;
; restore Zp0 here - why is it getting trashed in our encoding routines above?
;
lda saveZp0
sta Zp0
lda saveZp0+2
sta Zp0+2
;
ldy #$08
lda (Zp0),y
sta Zp1
iny
iny
lda (Zp0),y
sta Zp1+2
;
ldy #$06 ;move all eight bytes of key
des3 lda des_work1,y
sta (Zp1),y
dey
dey
bpl des3
*
* Restore stack and exit
*
pld
pla ; remove locals
pla
pla
pla
plb ;restore data bank
rtl
;
;
**************************************************
*
* keysched : key schedule
*
* this module takes 64 bits key and generates
* the sixteen 48-bit keys k(1),k(2),...,k(16)
*
* entry : none
*
* exit : none
*
*
**************************************************
keysched ;
sep #$30
LONGA OFF
LONGI OFF
ldx #0
key1 ;
stx des_x ;
lda pc1tbl,x
sta remainder
lda #8
sta des_count
key2 ;
dec des_count
sec
lda remainder
sbc #08
sta remainder
beq key22 ;= 0 ?
bcs key2 ;> 0 ?
;
key22 ;
clc
lda remainder
adc #8
sta remainder
;
ldx remainder
bne key24 ;x = 0 ?
ldx #8 ;set to 8, if yes
key24 ;
dex
lda des_msk,x
ldy des_count
clc
and key,y
beq key3
sec
key3 ;
ldx #$07
key4 ;
rol des_work1,x
php
dex
bmi key5
plp
bra key4
;
key5 ;
plp
ldx des_x
inx
cpx #56
bne key1
;
*
* divide pc1 result into c0/d0
*
ldx #0
key6 ;
lda des_work2,x
sta des_cd,x
inx
cpx #7
bne key6
;
*
* rotate c and d left by rotate(n) times
*
key9 ;
ldx #0
keya ;
stx des_x ;save # of times
;
ldy #0
keyb ;
clc
lda des_cd ;save left most bit(cn)
rol a
php
;
lda des_msk+3 ;save left most bit(dn)
clc
and des_cd+3
beq keyb0
sec
keyb0 ;
ldx #6
keyc ;
rol des_cd,x
dex
bpl keyc
;
lda des_cd+3
and #%11101111 ;clear right most bit(cn)
sta des_cd+3
;
lda #0
plp ;restore left most bit(cn)
ror a ;move left most bit(cn)
ror a ;to right most bit(cn)
ror a
ror a
ora des_cd+3
sta des_cd+3
;
ldx des_x
iny
lda rotat_left,x
sta des_temp
cpy des_temp
bne keyb
;
*
* permutation 2
*
ldy #0
keye ;
sty des_y ;
lda pc2tbl,y
sta remainder
lda #7 ;7 bytes toal for cn+dn
sta des_count
keyf ;
dec des_count
sec
lda remainder
sbc #08
sta remainder
beq keyf0 ;= 0 ?
bcs keyf ;> 0 ?
;
keyf0 ;
clc
lda remainder
adc #8
sta remainder
;
ldx remainder
bne keyf2 ;x = 0 ?
ldx #8 ;set to 8, if yes
keyf2 ;
dex
lda des_msk,x
ldy des_count
clc
and des_cd,y
beq key0
sec
key0 ;
ldx #7
key01 ;
rol des_work1,x
php
dex
bmi key02
plp
bra key01
;
key02 ;
plp
ldy des_y
iny
cpy #48
bne keye
;
*
* move result of perm 2 to k(n)
*
ldx #0
key03 ;
lda des_work3,x
ldy des_k
sta k1,y
inc Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
######################################################################
#
# This MakeFile contains the build rules for the new and improved
# Assembly AppleShare CDEV.
#
#
# by Mark Day
#
# Modification History:
# 23-Jul-91 MSD First try
# 10-Sep-91 MSD Added a new source file: AutoLogon.aii
# 20-Sep-91 MSD Added new shell variables to control listings
# and debugging code/symbols.
#
######################################################################
######################################################################
#
# You can set the values of the following variables to
# control the generation of listings and whether symbols
# will be imbedded in the code. You can either set a shell
# variable and export it, or define them on the command line.
#
# ASCDEVListFlag "-l" to generate listings, empty otherwise
# ASCDEVSymFlag 1 to generate debugging symbols and code
#
######################################################################
######################################################################
#
# The AppleShare file itself
#
######################################################################
AppleShare Ä AppleShare.code AppleShare.r
RezIIGS AppleShare.r -o AppleShare -t "C7 " -c "pdos"
######################################################################
#
# The AppleShare code resource
#
######################################################################
AppleShare.code Ä AppleShare.aii.obj AutoLogon.aii.obj globals.aii.obj DES.aii.obj
linkiigs -x -lseg:$1000 AppleShare ¶
AppleShare.aii.obj ¶
AutoLogon.aii.obj ¶
globals.aii.obj ¶
DES.aii.obj ¶
-o AppleShare.code ¶
{ASCDEVListFlag} > AppleShare.map
######################################################################
#
# The individual source/object files
#
######################################################################
AppleShare.aii.obj Ä AppleShare.aii AppleShareEqu.aii
AsmIIGS -d DebugSymbols=0{ASCDEVSymFlag} {ASCDEVListFlag} AppleShare.aii
AutoLogon.aii.obj Ä AutoLogon.aii AppleShareEqu.aii
AsmIIGS -d DebugSymbols=0{ASCDEVSymFlag} {ASCDEVListFlag} AutoLogon.aii
globals.aii.obj Ä globals.aii AppleShareEqu.aii
AsmIIGS -d DebugSymbols=0{ASCDEVSymFlag} {ASCDEVListFlag} globals.aii
DES.aii.obj Ä DES.aii
AsmIIGS -d DebugSymbols=0{ASCDEVSymFlag} {ASCDEVListFlag} DES.aii
|
||||
@@ -0,0 +1 @@
|
||||
;======================================================================
;
; Globals.aii
;
; This file contains the global data used by the CDEV that must be
; imbedded in the CDEV itself.
;
; 26-Aug-91 MSD Changed the FILogin record to be an FILogin2 call.
; 23-Sep-91 MSD Added new variable, saveNameOnly. If the high bit is
; set, then SelectVols should default to Save My Name Only.
; 4-Mar-93 DAL Added AFPVersion21 and hasAFP21.
;======================================================================
print push,off
include 'E16.Control'
include 'AppleShareEqu.aii'
print pop
export (myID,myWindow,connWindow,setPassWind):data
export (lastWhen,lastWhere,dblClick,lastZone):data
export (zoneMembers,zoneListH):data
export (GMZBuffer):data
export (srvrListSize,srvrMembers,srvrListH):data
export (taskRecord,userName,oldUserName):data
export (windOrigin,volWindow,cryptKey):data
export (volListH,volMembers):data
export (norMask,dimMask,serverAddress):data
export (whichWindow,whichControl):data
export (whichPt,vOffset,itemNum):data
export (checkBoxH,checkRect):data
export (vpWindow,checkCount):data
export (selectedUAM,serverPassword):data
export (wereHosed,messageHandle):data
myID dc.w 0 ; my Memory Manager user ID
myWindow dc.l 0 ; will put my GrafPort here
wereHosed dc.w 0 ; non-zero if fatal error
messageHandle dc.l 0 ; handle to message center data
lastWhen dc.l 0 ; time of last mousedown
lastWhere dc.l 0 ; last mousedown point (v,h)
dblClick dc.w 0 ; non-zero if we detected a double-click
lastZone dc.w 0 ; item number of last zone selected
zoneMembers dc.l 0 ; handle to member array of zone list
zoneListH dc.l 0 ; handle to zone list control
srvrMembers dc.l 0 ; handle to server list member array
srvrListH dc.l 0 ; handle to server list control
srvrListSize dc.w 0 ; number of items in server list
volListH dc.l 0 ; handle to volume list control
volMembers dc.l 0 ; handle to volume list member array
ATGetInfo record export
dc.b 0,2
dc.w 0
dc.l 0 ; completion routine return address
dc.w 0 ; thisNet
dc.b 0 ; aBridge
dc.b 0 ; hardwareID
dc.w 0 ; romVers
dc.b 0 ; node number
endr
GZL2 record export
dc.b 0,$3C ; sync GetZoneList2
dc.w 0 ; result
dc.l 0 ; completion routine
dc.w ZoneBufSize ; buffer size
dc.l 0 ; buffer pointer
dc.w 1 ; start index
dc.b 4,2 ; retry count,interval
dc.w 0 ; number of zones returned
dc.l 0 ; zipWork (set to 0 on first call)
dc.l 0 ; reserved
endr
GMZBuffer dcb.b 33,0 ; my zone will be returned here
GetMyZone record export
dc.b 0,$1A ; sync GetMyZone
dc.w 0 ; result
dc.l 0 ; completion routine
dc.l GMZBuffer ; buffer pointer
dc.b 2,4 ; retry interval,count
dc.l 0 ; reserved
endr
LookupEntity record export
export (LookupType,LookupZone):data
pstr '=' ; any object
LookupType pstr 'AFPServer' ; type server
LookupZone dcb.b 34,0 ; room for zone name plus 1 extra
; byte to make it even length
endr
LookupName record export
dc.b $80,$10 ; async LookupName
dc.w 0 ; result
dc.l 0 ; completion routine
dc.l LookupEntity ; entity
dc.b 4,$FF ; retry 255 seconds, every second
dc.w 0 ; reserved
dc.w SrvrBufSize ; buffer length
dc.l 0 ; buffer pointer
dc.b $FF ; max of 255 matches
dc.b 0 ; actual matches
endr
NBPKill record export
dc.b 0,$46 ; sync NBPKill
dc.w 0 ; result
dc.l LookupName ; param block pointer
endr
windOrigin dc.l 0
connWindow dc.l 0 ; Connect as... window pointer
volWindow dc.l 0 ; volume list window pointer
vpWindow dc.l 0 ; volume password dialog
setPassWind dc.l 0 ; set password dialog
taskRecord ds ExtTaskRec
whichWindow dc.l 0 ; result from FindWindow
whichControl dc.l 0 ; result from FindControl
whichPt dc.l 0 ; point during event hook
vOffset dc.w 0 ; offset from top of list in pixels
itemNum dc.w 0 ; item number in list
checkBoxH dc.l 0 ; handle to check box control
checkRect dc.w 0,0,0,0 ; rectangle where check boxes live
checkCount dc.w 0 ; number of checkboxes checked
serverAddress dc.l 0 ; address of server we're connecting to
selectedUAM dc.w 0 ; 0 = cancelled, 1 = Guest,
; 2 = ClearText, 3 = RandNumExchange
userName ds.b 34 ; Str32 and terminating zero byte
oldUserName ds.b 34
serverPassword ds.b 10 ; 8 bytes plus length and zero byte
subText record export
dc.l 0 ; point to "*0" (server name)
dc.l userName ; for *1
dc.l 0 ; fill in with pointer to volume name
endr
cryptKey dc.b $5A,$2F,$42,$2B,$E2,$34,$BA,$5D
dimMask DC.B $55,$AA,$55,$AA,$55,$AA,$55,$AA
norMask DC.B $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
checkBoxTempl record export
dc.w 8 ; pCount
dc.l 100 ; control ID
dc.w 0,0,0,0 ; bounding rectangle
dc.l $82000000 ; procRef
dc.w 0 ; flags, control visible
dc.w fCtlProcRefNotPtr ; more flags, fCtlProcRefNotPtr
dc.l 0 ; refcon
dc.l emptyPStr ; title reference
dc.w 0 ; initial value
emptyPStr dc.b 0 Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
#
# BuildAll {Parmeters}
#
# This builds the 10 cDevs that Darryl builds, the control panel
# NDA and and CDEVINIT.
#
# All options are passed on the BuildProgram script.
#
##################################################################
# The following code permits this script to be executed from
# anywhere, and for subsidiary scripts to do anything they
# want to the directory prefixes without messing up the
# overall build.
# CRUCIAL ASSUMPTION: All subdirectories containing control panel
# source are in the directory containing this script file.
# Jim Merritt thanks Jim Mensch for digging up the regular expression
# in the evaluate command below, and John Dance for supplying
# a foolproof way for a shellscript to come up with its own full
# pathname. Wotta great bunch of guys!
set myparent `files -f {Command}`
(evaluate "{myparent}" =~ /(([Â:]*:)+)¨1[Â:]*/ ) > Dev:Null
set myparent "{¨1}"
IF "{myparent}" == ""
echo "*** ERROR: Cannot determine script home directory."
exit
END
#
# Copy our special files into PiigsInclude
#
directory {myparent}CtlPanelIntfs:
duplicate -y CDEVMgr.pii ¶
CDEVMgrData.aii ¶
NewInterface.pii ¶
ResMgr.pii ¶
{PIIGSInclude}
directory {myparent}CtlPanelNDA:
BuildProgram {Parameters} CtlPanel.NDA
#directory {myparent}CDEV.INIT:
#BuildProgram {Parameters} CDEV.Init
directory {myparent}MonitorCDEV:
BuildProgram {Parameters} Monitor
directory {myparent}RamDiskCDEV:
BuildProgram {Parameters} RAMDisk
directory {myparent}KeyboardCDEV:
BuildProgram {Parameters} Keyboard
directory {myparent}GeneralCDEV:
BuildProgram {Parameters} General
directory {myparent}SoundCDEV:
BuildProgram {Parameters} Sound
directory {myparent}PrinterCDEV:
BuildProgram {Parameters} Printer
directory {myparent}TimeCDEV:
BuildProgram {Parameters} Time
directory {myparent}ModemCDEV:
BuildProgram {Parameters} Modem
directory {myparent}SlotsCDEV:
BuildProgram {Parameters} Slots
directory {myparent}DirectConnectCDEV
BuildProgram {Parameters} DirectConnect
directory {myparent}AppleShareCDEV
BuildProgram {Parameters} AppleShare
directory {myparent}NetPrinterCDEV
BuildProgram {Parameters} NetPrinter
directory {myparent}NamerCDEV
BuildProgram {Parameters} Namer
directory {myparent}MIDICDEV
BuildProgram {Parameters} Midi
directory {myparent}SetStartCDev
Echo "# `Date -t` --- This is actually building SetStart!"
BuildProgram All
directory {myparent}FolderPrivCDEV
BuildProgram {Parameters} FolderPriv
Directory {MyParent}NetWorkCDev
BuildProgram {Parameters} NetWork
Directory {MyParent}SoundCDev:Sounds
BuildProgram {Parameters} Sounds
directory {myparent}
|
||||
@@ -0,0 +1 @@
|
||||
{$toolErrorchk-}
{$a+}
{$longGlobals+}
unit CDEVMGR;
interface
uses
QDIntf, GSIntf, MiscTools, Prodos16, RESMgr;
const
machineCDEV = 1; { called when rebuilding cdev.data to see if cdev should be included }
BootCDEV = 2; { boot time init call or install call - no params}
ShutDownCDEV = 3; { reserved for future use}
InitCDEV = 4; { called when being shown - data1 = windowPtr}
CloseCDEV = 5; { called when being removed - data1 = windowPtr}
EventsCDEV = 6; { called when an event - data1 = ptr to event record}
CreateCDEV = 7; { called so that CDEV can create its controls inline - data1 = window}
AboutCDEV = 8; { called so that CDEV can create its about text inline - no params}
RectCDEV = 9; { called so that CDEV can dynamically compute its rectangle}
HitCDEV = 10;{ called when ctl is "hit" - data1 = Hdl to Ctl hit, data2 = Ctl Id}
RunCDEV = 11;{ caled when da run is called}
reserved1 = 12;{ reserved for future use}
reserved2 = 13;{ reserved for future use}
reserved3 = 14;{ reserved for future use}
NeverUsed1 = 15;{ this will never be used}
NeverUsed2 = 16;{ this will never be used}
{ wantReserved0 = 1; }
wantMachine = 1;
wantBoot = 2;
wantShutDown = 4;
wantInit = 8;
wantClose = 16;
wantEvents = 32;
wantCreate = 64;
wantAbout = 128;
wantRect = 256;
wantHit = 512;
wantRun = 1024;
wantReserved1 = 2048;
wantReserved2 = 4096;
wantReserved3 = 8192;
updateSSfromBRAM= 16384;
CanBeUnActive = 32768;
CDEV_ResType = $8018;
FLAG_ResType = $8019;
TwoRect_ResType = $801A;
rCodeResource = $8017;
CDEV_FileType = $C7;
CDEV_AuxType = 0;
CDEVDATA_FileType = $00;
CDEVDATA_AuxType = $00;
fCtlActive = $8000;
fCtlCanBeActive = $4000;
fCtlWantEvents = $2000;
fCtlProcRefNotPtr = $1000;
type
str32 = string[32];
str15 = string[15];
str8 = string[8];
FlagsHdl = ^FlagsPtr;
FlagsPtr = ^FlagsRec;
FlagsRec = packed record
CDEVFlags : Integer; { messages we respond to & Flags}
Enabled : boolean; { are we enabled?}
Version : byte; { version # of the control panel it works with 1 = 1.0}
Machine : byte; { what machine do we need to be run 0,1 = old GS; 2 = tenspeed}
Reserved : byte; { reserved byte}
DataRect : Rect; { really the width & height; top, left = 0}
name : str15; { name of the CDEV, upper/lower case}
author : str32; { name of the author}
versStr : str8; { version of the CDEV}
end;
IconHdl = ^IconPtr;
IconPtr = ^IconRec;
IconRec = packed record
kind : Integer; { always -1 = color}
size : Integer; { always 280}
height : Integer;{ always 20}
width : Integer; { always 28}
image : packed array[0..19,0..13] of byte;
mask : packed array[0..19,0..13] of byte;
end;
CDEVFake = ^CDEV;
CDEV = record
path : str255; { full path, including file name of the CDEV}
flags : FlagsRec; { flags from above}
icon : IconRec; { icon from above}
reserved : array[1..4] of integer;
end;
CDEVHeader = record
identifier : Integer; { identifier, 'DL'}
version : Integer; { should be 1}
lastMachine : Integer;{ last machine this was run on}
Count : integer; { # of CDEV's below}
reserved : array[1..4] of longint; { reserved for future use}
end;
CDEVArray = array[1..1] of CDEV;
CDEVHdl = ^CDEVPtr;
CDEVPtr = ^CDEVRec;
CDEVRec = record
header : CDEVHeader; { header from above}
CDEVS : CDEVArray; { the CDEV's}
end;
DITLHdl = ^DITLPtr;
DITLPtr = ^DITLRec;
DITLRec = record
theRefs : array[1..1] of longint;
end;
SavePosHdl = ^SavePosPtr;
SavePosPtr = ^SavePosRec;
SavePosRec = record
rect320 : Rect;
rect640 : Rect;
end;
function GetAndUpdateCDEVS : CDEVHdl;
function UpperString(s : str255) : str255;
procedure QuickSort(i,j : Integer; var A : CDEVArray);
implementation
function GetCodeResConverter : Ptr; tool $3, $34;
function Disp(message : Integer; data1, data2 : Longint; thecode : ptr) : Longint; external;
procedure die; inline $00;
function GetAndUpdateCDEVS : CDEVHdl;
type
weirdness = record
buffsize : integer;
resultsize : integer;
result : packed array[1..128] of char;
end;
var
p: P16ParamBlk;
dirDate, dirTime : Integer;
index, i : integer;
fileID : Integer;
DataHandle : CDEVHdl;
newSize : Longint;
flagH : FlagsHdl;
IconH : IconHdl;
CDEVDataPtr : StringPtr;
CDEVDirPtr : StringPtr;
pascalName : string[128];
savePrefix : string[128];
CDEVDataPath : string[32];
CDEVDirPath : string[32];
currentName : weirdness;
dummy : Ptr;
Atemp,XTemp,YTemp,PTemp : integer;
scr : longint;
currCDEVCode : Ptr;
tempHdl : Handle;
label 1,2;
begin
FWEntry(Atemp,XTemp,YTemp,PTemp,$FE1F); {ytemp holds the machine rom #}
CDEVDataPath := '*/SYSTEM/CDEVS/CDEV.DATA';
CDEVDirPath := '*/SYSTEM/CDEVS';
CDEVDataPtr := @CDEVDataPath;
CDEVDirPtr := @CDEVDirPath;
GetAndUpdateCDEVS := nil;
currentName.buffSize Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
;;; CDEVMgrData - data for the code resource that builds the cdev.data files.
;
; Michael V. Stein 05/10/90.
;
; © Copyright Apple Computer, 1990.
blanks off
;; equates.
;; include files.
* no longer needed {gab}
* include 'm16.util'
;; macros.
;; main program.
file proc
;; exported addresses.
export disp
disp
; rewritten by Greg Branche
lda 6,s ;get high 16-bits of 32-bit destination pointer
tay ;save in Y for a second
lda 4,s ;get low 16-bits
dec a ;prepare for eventual RTL
tax ;save in X
pla ;retrieve low 16-bits of return address
sta 3,s ;put back on stack, overwriting destination pointer
sep #$20 ;8-bit accumulator
pla ;retrieve high 8-bits of return address
sta 4,s ;put back on stack
tya ;get high 8-bits of destination pointer
sta 1,s ;put on stack
rep #$20 ;back to 16-bit accumulator
phx ;put low 16-bits of destination pointer on stack
rtl ;and 'return' to destination
endp
end
|
||||
@@ -0,0 +1 @@
|
||||
/*
*/
#ifndef __types__
#include <types.h>
#endif
#ifndef __quickdraw__
#include <quickdraw.h>
#endif
#ifndef __misctool__
#include <misctool.h>
#endif
#ifndef __resmgr__
#include <resmgr.h>
#endif
#ifndef __newcontrols__
#define __newcontrols__
#define MachineCDEV 1
#define BootCDEV 2
#define ShutDownCDEV 3
#define InitCDEV 4
#define CloseCDEV 5
#define EventsCDEV 6
#define HitCDEV 7
#define CreateCDEV 8
#define AboutCDEV 9
#define RectCDEV 10
#define reserved4 11
#define reserved5 12
#define reserved6 13
#define reserved7 14
#define reserved8 15
#define reserved9 16
#define wantMachine 1
#define wantBoot 2
#define wantShutDown 4
#define wantInit 8
#define wantClose 16
#define wantEvents 32
#define wantHit 64
#define wantCreate 128
#define wantAbout 256
#define wantRect 512
#define wantReserved2 1024
#define wantReserved3 2048
#define wantReserved4 4096
#define wantReserved5 8192
#define wantReserved6 16384
#define CanBeUnActive 32768
#define CDEV_ResType 0x8018
#define FLAG_ResType 0x8019
#define TwoRect_ResType 0x801a
#define CDEV_FileType 0xc7
#define CDEV_AuxType 0
#define CDEVDATA_FileType 0x00
#define CDEVDATA_AuxType 0x00
#define fCtlActive 0x8000
#define fCtlCanBeActive 0x4000
#define fCtlWantEvents 0x2000
#define fCtlProcRefNotPtr 0x1000
#define simpleButtonControl 0x80000000
#define checkControl 0x82000000
#define radioControl 0x84000000
#define scrollBarControl 0x88000000
#define growControl 0x8a000000
#define statTextControl 0x81000000
#define editLineControl 0x83000000
#define editTextControl 0x85000000
#define popUpControl 0x87000000
#define listControl 0x89000000
#define iconButtonControl 0x8b000000
#define pictureControl 0x8d000000
typedef String(8) Str8;
typedef String(15) Str15;
typedef String(32) Str32;
typedef struct NewCtlRec {
struct NewCtlRec **ctlNext; /* CtlRec - Handle of next control. */
GrafPortPtr ctlOwner; /* CtlRec - Pointer to control's window. */
Rect ctlRect; /* CtlRec - Enclosing rectangle. */
Byte ctlFlag; /* CtlRec - Bit flags. */
Byte ctlHilite; /* CtlRec - Highlighted part. */
Integer ctlValue; /* CtlRec - Control's value. */
LongProcPtr ctlProc; /* CtlRec - Control's definition procedure. */
LongProcPtr ctlAction; /* CtlRec - Control's action procedure. */
Longint ctlData; /* CtlRec - Reserved for CtrlProc's use. */
Longint ctlRefCon; /* CtlRec - Reserved for application's use. */
Pointer ctlColor; /* CtlRec - Pointer to appropriate color table. */
char ctlReserved[0x10];
Longint ctlID;
integer ctlMoreFlags;
integer ctlVersion;
} NewCtlRec, *NewCtlRecPtr, **NewCtlRecHndl ;
typedef struct FlagsRec {
Integer CDEVFlags; /* messages we need to respond to*/
byte Enabled; /* are we enabled?*/
byte Version; /* version # of the control panel it works with*/
byte Machine; /* what machine do we need to be run*/
byte System; /* what system do we need to be run*/
Rect DataRect; /* really the width & height; top, left = 0*/
Str15 name; /* name of the CDEV, upper/lower case*/
Str32 author; /* name of the author */
Str8 versStr; /* version of the CDEV */
} FlagsRec,*FlagsPtr,**FlagsHdl;
typedef struct IconRec {
Integer kind; /* always -1 = color*/
Integer size; /* always 280*/
Integer height;/* always 20*/
Integer width; /* always 28*/
char image[20][14];
char mask[20][14];
} IconRec, *IconPtr, **IconHdl;
typedef struct CDEV {
Str255 path; /* full path, including file name of the CDEV*/
FlagsRec flags; /* flags from above*/
IconRec icon; /* icon from above*/
integer reserved[5];
} CDEV, *CDEVFake;
typedef struct CDEVHeader {
Integer identifier; /* identifier, 'DL'*/
Integer version; /* should be 1*/
integer Count; /* # of CDEV's below*/
longint reserved[5]; /* reserved for future use*/
} CDEVHeader;
typedef struct CDEVRec {
CDEVHeader header; /* header from above*/
CDEV CDEVS[1]; /* the CDEV's*/
} CDEVRec,*CDEVPtr,**CDEVHdl;
typedef struct DITLRec {
longint theRefs[2];
} DITLRec, *DITLPtr, **DITLHdl;
typedef struct editLineCtl {
integer pCount; /* in this case - 7*/
longint ctlID; /* 1,2,3...*/
Rect ctlRect; /* the rect*/
longint ctlProcRef; /* $80000000*/
integer ctlFlag;/* 2*/
integer ctlMoreFlags;/* 2*/
longint ctlRefCon; /* 0 */
integer ctlMaxSize;
longint ctlDefaultRef;
integer ctlTextSize;
} editLineCtl, *editLinePtr, **editLineHndl;
typedef struct listCtlRec {
integer pCount;
longint ID;
Rect ctlRect;
longint ctlProcRef;
integer ctlFlag;
integer ctlMoreFlags;
longint ctlRefCon;
integer ctlListSize;
integer ctlListView;
integer ctlListType;
integer ctlListStart;
longint ctlListDraw;
integer ctlListMemHeight;Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
/*
*/
#ifndef __quickdraw__
#include <quickdraw.h>
#endif
#ifndef __event__
#include <event.h>
#endif
#ifndef __newinterface__
#define __newinterface__
#define wInControl 0x21
typedef struct NEWEventRecord {
EventRecord oldRec;
longint wmLastClick;
integer wmclickcount;
longint wmtaskData2;
longint wmtaskData3;
longint wmtaskData4;
} NEWEventRecord;
typedef struct simpleButtonRec {
integer pCount; /* in this case - 7*/
longint ctlID; /* 1,2,3...*/
Rect ctlRect; /* the rect*/
longint ctlProcRef; /* $80000000*/
integer ctlFlag;/* 2*/
integer ctlMoreFlags;/* 2*/
longint ctlRefCon; /* 0 */
longint TitleRef; /* resource id of string*/
longint colorRef;
} simpleButtonRec, *simpleButtonPtr, **simpleButtonHdl;
typedef struct RadioButtonRec {
integer pCount; /* in this case - 7*/
longint ctlID; /* 1,2,3...*/
Rect ctlRect; /* the rect*/
longint ctlProcRef; /* $80000000*/
integer ctlFlag;/* 2*/
integer ctlMoreFlags;/* 2*/
longint ctlRefCon; /* 0 */
longint TitleRef; /* resource id of string*/
Integer InitialValue; /* inital value*/
longint colorRef;
} RadioButtonRec, *RadioButtonPtr, **RadioButtonHdl;
typedef struct CheckButtonRec {
integer pCount; /* in this case - 7*/
longint ctlID; /* 1,2,3...*/
Rect ctlRect; /* the rect*/
longint ctlProcRef; /* $80000000*/
integer ctlFlag;/* 2*/
integer ctlMoreFlags;/* 2*/
longint ctlRefCon; /* 0 */
longint TitleRef; /* resource id of string*/
Integer InitialValue; /* inital value*/
longint colorRef;
} CheckButtonRec, *CheckButtonPtr, **CheckButtonHdl;
extern pascal void ResBootInit() inline(0x011e,dispatcher);
extern pascal Ptr LGetPathName2() inline(0x2211,dispatcher);
extern pascal integer TaskMasterDA() inline(0x5f0e,dispatcher);
extern pascal NewCtlRecHndl NewControl2() inline(0x3110,dispatcher);
extern pascal NewCtlRecHndl GetCtlHandleFromID() inline(0x3010,dispatcher);
extern pascal longint GetCtlID() inline(0x2a10,dispatcher);
extern pascal Ptr GetCodeResConverter() inline(0x3610,dispatcher);
#endif
|
||||
@@ -0,0 +1 @@
|
||||
unit newinterface;
uses qdintf, gsintf;
const
simpleButton = $80000000;
checkBox = $82000000;
radio = $84000000;
srollBar = $88000000;
grow = $8A000000;
statText = $81000000;
editline = $83000000;
editText = $85000000;
popUp = $87000000;
list = $89000000;
iconButton = $8B000000;
pictCtl = $8D000000;
wInControl = $21;
type
NEWEventRecord = record
oldRec : eventrecord;
wmLastClick : longint;
wmclickcount : integer;
wmtaskData2 : longint;
wmtaskData3 : longint;
wmtaskData4 : longint;
wmLastClickPt : Point;
end;
simpleButtonHdl = ^simpleButtonPtr;
simpleButtonPtr = ^simpleButtonRec;
simpleButtonRec = record
pCount : integer; { in this case - 7}
ctlID : longint; { 1,2,3...}
ctlRect : rect; { the rect}
ctlProcRef : longint; { $80000000}
ctlFlag : integer;{ 2}
ctlMoreFlags : integer;{ 2}
ctlRefCon : longint; { 0 }
TitleRef : longint; { resource id of string}
colorRef : longint;
end;
RadioButtonHdl = ^RadioButtonPtr;
RadioButtonPtr = ^RadioButtonRec;
RadioButtonRec = record
pCount : integer; { in this case - 7}
ctlID : longint; { 1,2,3...}
ctlRect : rect; { the rect}
ctlProcRef : longint; { $80000000}
ctlFlag : integer;{ 2}
ctlMoreFlags : integer;{ 2}
ctlRefCon : longint; { 0 }
TitleRef : longint; { resource id of string}
InitialValue : Integer; { inital value}
colorRef : longint;
end;
CheckButtonHdl = ^CheckButtonPtr;
CheckButtonPtr = ^CheckButtonRec;
CheckButtonRec = record
pCount : integer; { in this case - 7}
ctlID : longint; { 1,2,3...}
ctlRect : rect; { the rect}
ctlProcRef : longint; { $80000000}
ctlFlag : integer;{ 2}
ctlMoreFlags : integer;{ 2}
ctlRefCon : longint; { 0 }
TitleRef : longint; { resource id of string}
InitialValue : Integer; { inital value}
colorRef : longint;
end;
MenuItemHdl = ^MenuItemPtr;
MenuItemPtr = ^MenuItemRec;
MenuItemRec = packed record
version : Integer;
ItemID : Integer;
ItemChar : Char;
ItemAltChar : Char;
ItemCheck : Integer;
ItemFlag : Integer;
ItemTitleRef : Longint; {top 2 bits set for title is resource id}
end;
MenuH = ^MenuP;
MenuP = ^MenuR;
MenuR = record
version : integer;
menuID : integer;
menuFlag : integer; {top 4 bits are set = menu title & item are resources}
menuTitleRef : longint;
Items : array[1..1] of Longint;
end;
PopUpHdl = ^PopUpPtr;
PopUpPtr = ^PopUpRec;
PopUpRec = record
pCount : integer; { in this case - 9}
ctlID : longint; { 1,2,3...}
ctlRect : rect; { the rect}
ctlProcRef : longint; { $87000000}
ctlFlag : integer;{ 0}
ctlMoreFlags : integer;{ fCtlProcRefNotPtr + 2}
ctlRefCon : longint; { 0 }
TitleWidth : Integer; { stringwidth(title) }
MenuRefRef : longint; { resource id of menu}
InitialValue : Integer; { inital value (item id)}
end;
function LGetPathName2(memID, fileNum : integer) : Ptr; tool $11, $22;
function TaskMasterDA(mask : integer; event : NEWeventrecord) : integer; tool 14, $5F;
function NewControl2(wind : windowPtr; inputType : Integer;
reference : longint) : ControlHandle; tool 16,$31;
function GetCtlHandleFromID(theWind : WindowPtr; id : longint) : ControlHandle; tool 16, $30;
function GetCtlID(ctlHdl : Controlhandle) : longint; tool 16, $2A;
procedure AddToRunQ(addr : procPtr); tool $05, $1f;
procedure RemoveFromRunQ(addr : procPtr); tool $05, $20;
function GetCodeResConverter : Ptr; tool $3, $34;
function GetCtlParamPtr : Ptr; tool $10, 35;
procedure SetCtlParamPtr(p : Ptr); tool $10,34;
FUNCTION TaskMaster2(EventMask : Integer; Event: NewEventRecord):Integer;Tool 14,29;
procedure SetKeyTranslation(trans : integer); tool 6, $1C;
function GetKeyTranslation : integer; tool 6, $1B;
procedure PHB; inline $8B;
procedure PHK; inline $4B;
procedure PLB; inline $AB;
end.
|
||||
@@ -0,0 +1 @@
|
||||
/*
My implementation of Darryl Lovato's pascal implementation of the resource manager interface
*/
#ifndef __quickdraw__
#include <quickdraw.h>
#endif
#ifndef __resmgr__
#define __resmgr__
#define rIcon 0x8001
#define rPicture 0x8002
#define rControlList 0x8003
#define rControlTemplate 0x8004
#define rWindow 0x8005
#define rString 0x8006
#define rStringList 0x8007
#define rMenuBar 0x8008
#define rMenu 0x8009
#define rMenuItem 0x800A
#define rTextForLETextbox2 0x800B
#define rCtlDefProc 0x800C
#define rCtlColorTbl 0x800D
#define rCDEVCode 0x8018
#define rCDEVFlags 0x8019
#define rTwoRects 0x801a
#define login 1
#define logout 2
typedef struct ResourceRec {
int resType;
Longint resID;
} ResourceRec;
extern pascal void ResBootInit() inline(0x011e,dispatcher);
extern pascal void ResStartup() inline(0x021e,dispatcher);
extern pascal void ResShutdown() inline(0x031e,dispatcher);
extern pascal Integer ResVersion() inline(0x041e,dispatcher);
extern pascal void ResReset() inline(0x051e,dispatcher);
extern pascal boolean ResStatus() inline(0x061e,dispatcher);
extern pascal void CreateResFile() inline(0x091e,dispatcher);
extern pascal Integer OpenResFile() inline(0x0a1e,dispatcher);
extern pascal void CloseResFile() inline(0x0b1e,dispatcher);
extern pascal void AddRes() inline(0x0c1e,dispatcher);
extern pascal void UpdateResFile() inline(0x0d1e,dispatcher);
extern pascal Handle LoadRes() inline(0x0e1e,dispatcher);
extern pascal void RemoveRes() inline(0x0f1e,dispatcher);
extern pascal void MarkResChange() inline(0x101e,dispatcher);
extern pascal void SetCurResFile() inline(0x111e,dispatcher);
extern pascal Integer GetCurResFile() inline(0x121e,dispatcher);
extern pascal void SetCurResApp() inline(0x131e,dispatcher);
extern pascal Integer GetCurResApp() inline(0x141e,dispatcher);
extern pascal Integer HomeResFile() inline(0x151e,dispatcher);
extern pascal void WriteRes() inline(0x161e,dispatcher);
extern pascal void ReleaseRes() inline(0x171e,dispatcher);
extern pascal void DetatchRes() inline(0x181e,dispatcher);
extern pascal Longint UniqueResID() inline(0x191e,dispatcher);
extern pascal void SetResID() inline(0x1a1e,dispatcher);
extern pascal Integer GetResAttr() inline(0x1b1e,dispatcher);
extern pascal void SetResAttr() inline(0x1c1e,dispatcher);
extern pascal Longint GetResSize() inline(0x1d1e,dispatcher);
extern pascal void MatchResHandle() inline(0x1e1e,dispatcher);
extern pascal Integer GetOpenFileRefNum() inline(0x1f1e,dispatcher);
extern pascal Integer CountTypes() inline(0x201e,dispatcher);
extern pascal integer GetIndType() inline(0x211e,dispatcher);
extern pascal Longint CountRes() inline(0x221e,dispatcher);
extern pascal Handle GetIndRes() inline(0x231e,dispatcher);
extern pascal void SetResLoad() inline(0x241e,dispatcher);
extern pascal void SetResFileDepth() inline(0x251e,dispatcher);
extern pascal Handle GetMapHandle() inline(0x261e,dispatcher);
extern pascal void ResConverter() inline(0x281e,dispatcher);
#endif
|
||||
@@ -0,0 +1 @@
|
||||
{ resource manager pascal interface}
unit ResMgr;
interface
uses
QDIntf, GSIntf;
const
rIcon = $8001;
rPicture = $8002;
rControlList = $8003;
rControlTemplate = $8004;
rWindow = $8005;
rString = $8006;
rStringList = $8007;
rMenuBar = $8008;
rMenu = $8009;
rMenuItem = $800A;
rTextForLETextbox2 = $800B;
rCtlDefProc = $800C;
rCtlColorTbl = $800D;
login = 1; {for resource converter}
logout = 2;
type
ResourceRec = record
resType : Integer;
resID : Longint;
end;
procedure ResBootInit; tool 30, 1;
procedure ResStartup(memoryID : integer); tool 30, 2;
procedure ResShutdown; tool 30, 3;
function ResVersion : Integer; tool 30, 4;
procedure ResReset; tool 30, 5;
function ResStatus : integer; tool 30, 6;
procedure CreateResFile(auxType : Longint;
fileType, access : Integer; fileName : Ptr);tool 30, 9;
function OpenResFile(access : integer;
mapAddr : Ptr; fileName : Ptr) : Integer; tool 30, 10;
procedure CloseResFile(id : Integer); tool 30, 11;
procedure AddRes(theHandle : handle;
attr, resType : Integer; resId : Longint); tool 30, 12;
procedure UpdateResFile(memoryID : Integer); tool 30, 13;
function LoadRes(resType : Integer; resID : Longint) : Handle; tool 30, 14;
procedure RemoveRes(resType : Integer; resID : Longint); tool 30, 15;
procedure MarkResChange(changed : boolean; resType : Integer;
resID : Longint); tool 30, 16;
procedure SetCurResFile(memoryID : Integer); tool 30, 17;
function GetCurResFile : Integer; tool 30, 18;
procedure SetCurResApp(memoryID : Integer); tool 30, 19;
function GetCurResApp : Integer; tool 30, 20;
function HomeResFile(theType:Integer; resID : Longint) : Integer; tool 30, 21;
procedure WriteRes(resType : Integer; resID : Longint); tool 30, 22;
procedure ReleaseRes(purgeLevel : integer;
resType : Integer; resID : Longint); tool 30, 23;
procedure DetatchRes(resType : integer; resID : Longint); tool 30, 24;
function UniqueResID(IDRange, resType : Integer) : Longint; tool 30, 25;
procedure SetResID(newID : Longint;
resType : Integer; resID : Integer); tool 30, 26;
function GetResAttr(resType : Integer; resID : Longint) : Integer; tool 30, 27;
procedure SetResAttr(theAttr, resType : integer; resID : Longint); tool 30, 28;
function GetResSize(resType : Integer; resID : Longint) : Longint; tool 30, 29;
procedure MatchResHandle(var foundRec : ResourceRec;
theHand : Handle); tool 30, 30;
function GetOpenFileRefNum(fileId : Integer) : Integer; tool 30, 31;
function CountTypes : Integer; tool 30, 32;
function GetIndType(index : integer) : integer; tool 30, 33;
function CountRes(resType : Integer) : Longint; tool 30, 34;
function GetIndRes(resType: integer; index: longint) : Handle; tool 30, 35;
procedure SetResLoad(load : boolean); tool 30, 36;
procedure SetResFileDepth(numToSearch : Integer); tool 30, 37;
function GetMapHandle(fileId : Integer) : Handle; tool 30, 38;
procedure ResConverter(converter : Ptr; theType : Integer; flags : integer); tool 30,40;
procedure ResDebug(on : integer); tool 30, $29;
implementation
end.
|
||||
Whitespace-only changes.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
*******************************************************************************
*
* Control Panel NDA 2.1
*
* Copyright Apple Computer, Inc. 1991-1993
* All Rights Reserved
*
* by David A. Lyons, started 20-Jan-91
*
*******************************************************************************
*
* REVISION HISTORY
*
* Version 2.0 for System 6.0
*
* 20-Jan-91 Dave Lyons
* Initial coding. Took about 2.5 hours to get the shell working.
* The list of CDevs is hard-coded, and it cycles through to the
* next one each time you open the DA. The battery-RAM updating
* is working, even!
*
* 13..14-Feb-91 DAL
* Making this into a for-real alpha-quality thing so I can check it
* in soon.
*
* 18-Feb-91 DAL
* Can I code on adrenaline? Yes, I Think SO! Not really alpha yet,
* but let's see what I can do in the next five hours...
*
* 19-Feb-91 DAL
* Still Going (thud, thud, thud, thud). Kinda works, in a minimal
* sort of way.
*
* 20-Feb-91 DAL
* Successfully builds all its data structures in memory and displays
* the scrolling list of icons!
*
* 21-Feb-91am DAL
* Really starting to cook now. Might even work right with multiple
* CDevs open, even! (Later...working good.)
*
* 25-Feb-91am DAL
* Looks like this is going on the 6.0d26 build. So let's fix it up
* some more, put in the About box and Help & stuff.
*
* Finished WhatAccessRequest routine, so we'll open things up read-only
* if we booted off of AppleShare.
*
* Kludged Run events for one window only, and got the data file stuff
* working.
*
* === released on 6.0d26 ===
*
* 26-Feb-91 DAL
* Dim out the About and Help buttons when there are no CDevs selected.
* Make the first CDev be selected by default.
*
* Uses VersionString to build version text from the rVersion resource.
*
* 27-Feb-91 DAL
* Fixed Run events so they won't dispatch to a NIL or invalid window.
* Fixed GlobalToLocal and LocalToGlobal calls on rectangles!
* Now I use ResetMember2 instead of NextMember2 to scan for CDevs to
* open. This way they are no longer selected when the open is done.
* Now puts up a watch cursor around opening CDevs.
*
* 28-Feb-91 DAL (2.0d3)
* When calling HitCDEV for a nonextended control, I now pass $FFFFFFFF
* for the control ID. Some existing CDevs were counting on getting a
* large value here, and I was passing zero before.
*
* Adding some better error handling. Instead of crashing if there isn't
* enough memory, it just does nothing.
*
* 2-Mar-91 DAL (2.0d4)
* Stripping leading blanks from CDev names in the list.
*
* 3-Mar-91 DAL (2.0d4)
* We accept SendRequest($0F01) from MenuKey to implement Apple-ESC
* as our hotkey to open up the Control Panels window (will make
* this configurable later). Hilites the first menu title around
* opening self.
* Centers CDev rectangles better vertically than before.
* Now sets the port to the CDev window during Create and Init messages.
*
* 13-Mar-91 DAL (2.0d5)
* Was neglecting to invalidate an icon that was deselected, in the case
* that I got an error trying to open it.
*
* 14-Mar-91 DAL
* Take a whack at the palette manager!
*
* === released on 6.0d29 ===
*
* 22-Mar-91 DAL (2.0d6)
* Control Panel's own resource fork is now opened read-only on
* AppleShare, so multiple users can use it.
* Tweaked the little palette manager so that UseStandardPalette
* doesn't do anything if we're already using our standard palette.
* In 320 mode now we use a color table with the same colors as the
* standard 640-mode colors.
*
* 30-Mar-91 DAL (2.0d7)
* Now we draw the boot icons by calling ShowBootInfo (Misc Tools).
*
* 1-Apr-91 DAL (2.0d8)
* Took out X coordinate fudging for drawing an icon in the list;
* they were drawing too far to the right. Just force it even
* instead.
* We now validate the CDev.Data.2.0 header fields.
* New routine ClosingCDevWindow cleans up while we're closing.
* Added new field owbCDevItemPtr to the window block structure.
* Ack! Twilight was not preserving the current resource file
* when I gave it an EventsCDEV message. Fixed so that it doesn't
* matter.
* Now sets current resource file when handling an Action or Close.
* Double-clicking a CDev that is already open just brings it to the
* front.
* Help button is enabled only if exactly one icon is selected.
* Changed data file name to "CDev.Data" (not "CDev.Data.2.0").
* CDev.Data file is now created as invisible.
*
* === released on 6.0d30 ===
*
* 7-Apr-91 DAL (2.0d9)
* Change hotkey from Apple-ESC to Apple-Shift-ESC to avoid conflicting
* with the Installer and Platinum Paint.
* Added WaitCursor and InitCursor in doAboutBox, InitCursor on open.
* Finished code to zoom CDevs closed and mark their icons closed.
*
* === released on 6.0d31 ===
*
* 16-Apr-91 DAL (2.0d10)
* Fix opening/closing of CDevs so that if the CDev puts up a modal
* dialog of some sort, which calls GetNextEvent, that it Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
Set Echo 1
|
||||
@@ -0,0 +1 @@
|
||||
/*************************************************************
*
* Control Panel 2.0 resources
*
* Copyright 1991-1993 Apple Computer, Inc.
* All Rights Reserved
*
*************************************************************
*
* REVISION HISTORY
*
* 13-Feb-91 Dave Lyons
* Here it is.
*
* 19-Feb-91 DAL
* Commented the control templates a little.
* Took out extra stuff in version-string LETextBox2 resource.
*
* 25-Feb-91 DAL
* Added rVersion(1) and rComment(2) resources.
*
* 22-Mar-91 DAL
* Version 2.0d6.
*
* 30-Mar-91 DAL
* Version 2.0d7.
*
* 1-Apr-91 DAL
* Version 2.0d8.
*
* 7-Apr-91 DAL
* Version 2.0d9.
*
* 16-Apr-91 DAL
* Version 2.0d10.
*
* 17-Apr-91 DAL
* Version 2.0d11.
*
* 19-Apr-91 DAL
* Version 2.0d11. Added Apple-H key equiv for Help button.
*
* 30-Apr-91 DAL
* Version 2.0d12.
*
* 13-May-91 DAL
* Version 2.0d13.
*
* 3-Jun-91 DAL
* Version 2.0d14. Uses new rVersion template; fixed the
* Apple-H key equivalent (modifiers were wrong).
* Added rIcon($58) for X-ing out a CDev we couldn't load.
*
* 4-Jun-91 DAL
* Changed keyCareBits from $3B00 to $3900 so that Apple-shift-H
* and Apple-shift-? will work.
*
* 13-Jun-91 DAL
* Added ellipsis to About button. Version 2.0d15.
*
* 24-Jun-91 DAL
* Version 2.0d16.
* Made the About... button invisible.
*
* 25-Jun-91 DAL
* Version 2.0d17.
*
* 27-Jun-91 DAL
* Version 2.0d18.
* Removed dead stuff (About... button).
*
* 8-Jul-91 DAL
* Version 2.0d19.
*
* 23-Jul-91 DAL
* Version 2.0d20.
*
* 20-Aug-91 DAL
* Version 2.0d21 for 6.0d46+.
*
* 3..4-Sep-91 DAL
* Version 2.0d22 for 6.0d47.
* Added rTwoRects(1) to record main window position.
*
* 9-Sep-91 DAL
* Version 2.0d23 for 6.0d48.
*
* 12-Sep-91 DAL
* Version 2.0d24 for 6.0d49.
*
* 24-Sep-91 DAL
* Version 2.0d25 for 6.0d51.
*
* 2-Oct-91 DAL
* Version 2.0d26 for 6.0d52.
*
* 12-Oct-91 DAL
* Version 2.0d27 for 6.0d53.
*
* 25-Oct-91 DAL
* Version 2.0d28 for 6.0d55.
*
* 29-Oct-91 DAL
* Removed the "X" resource (moved it to Sys.Resources).
*
* 30-Oct-91 DAL
* Version 2.0d29 for 6.0d56.
*
* 11-Nov-91 DAL
* Version 2.0d30 for 6.0d57.
*
* 19-Nov-91 DAL
* Version 2.0d31 for 6.0d59.
*
* 3-Dec-91 DAL
* Version 2.0d32 for 6.0d60.
*
* 9-Dec-91 DAL
* Version 2.0d33 for 6.0d61.
*
* 27-Jan-92 DAL
* Version 2.0d34 for 6.0d66.
*
* 5-Feb-92 DAL
* Version 2.0d35 for 6.0d70 (GM1?).
*
* 7-Feb-92 DAL (for d70)
* Version 2.0 final.
* Adjusted horizontal position of the version string control.
*
*************************************************************
*
* 16-Mar-92 DAL (for 6.0.1d2)
* Version 2.1d1.
*
* 2-Jul-92 DAL
* Version 2.1d6.
*
* 15-Jul-92 DAL (for 6.0.1d7)
* Version 2.1d7.
*
* 12-Aug-92 DAL (for 6.0.1d9)
* Version 2.1d9.
*
* 3-Sep-92 DAL (for 6.0.1d10)
* Version 2.1d10.
*
* 28-Oct-92 DAL (for 6.0.1d12)
* Version 2.1d12.
*
* 3-Mar-93 SS (for 6.0.1d14)
* Version 2.1d14.
*
* 16-Mar-93 SS (for 6.0.1d15)
* Version 2.1d15.
*
* 1-Apr-93 SS (for 6.0.1d16)
* Version 2.1 (release)
*
* 22-Apr-93 DAL (for 6.0.1d17)
* Moved version number to make it pretty.
*
*************************************************************/
#include "typesiigs.r"
#define CTLLST_00001003 $1003
#define CTLTMP_00000001 1
#define CTLTMP_00000002 2
#define CTLTMP_00000003 3
// #define CTLTMP_00000004 4
#define CTLTMP_00000005 5
/* #define PSTR_00010002 $10002 */
#define PSTR_00010003 $10003
#define PSTR_00010004 $10004
#define PSTR_00010005 $10005
#define WPARAM1_00000FFA 1
#define WCOLOR_00000001 $07ff0001
resource rVersion(1) {
{ 2, 1, 0, release, $00 },
verUS,
"Control Panel",
"Copyright 1990-93 Apple Computer, Inc."
};
resource rComment(2) {
"To use this Desk Accessory, put it in the Desk.Accs folder "
"inside your System folder. The next time you start your system, "
"ÒControl PanelsÓ will appear under the Apple menu."
};
// --- Control List Definitions
resource rControlList (CTLLST_00001003, $0000) {
{
CTLTMP_00000001, // control 1
CTLTMP_00000002, // control 2
CTLTMP_00000003, // control 3
// CTLTMP_00000004, // control 4
CTLTMP_00000005, // control 5
};
};
/* List control, ID=1 */
resource rControlTemplate (CTLTMP_00000001, $0000) {
$00000001, // ID
{ 2, 10,105,106}, // rect
listControl {{
$0000, // flag
$3400, // moreFlags
$00000000, // refCon
$0000, // listSize
$0003, // listView
$0000, // listType
$0001, // listStart
// $00000000, // listDraw (pointer to draw routine)
$0021, // listMemHeight
$0012, // listMemSize
Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
;;; cbp - check battery parameters.
;
; Michael V. Stein 05/01/90.
;
; © Copyright Apple Computer, 1990.
blanks off
;; equates.
aug_param equ $5e bit 0 set means no closed captioning
;bit 1 set means standard time
; clear if daylight savings time
;bit 2 set means not to have auto daylight savings
; clear means to have auto daylight savings
;bit 3 and 4 are the amount of menublink to have
;; include files.
include '::commonmacros.h'
include 'm16.menu'
include 'm16.misctool'
;; main program.
file proc
;; exported addresses.
export cbp
cbp phb
phk
plb
jsr cad check auto daylight savings
*** jsr cmb check menublink
plb
rtl
;; ats - adjust the time by seconds.
;
; entry [a, x] = amount of seconds to adjust clock.
;
; exit clock is adjusted.
ats sta atsa save change for now
stx atsa+2
pha space for result
pha space for result
pushw #6 get current time based on seconds
pushl #0
pushl #buff buffer to use
ldx #$3703
jsl $e10000 convert seconds
; adjust the seconds.
lda 1,s
clc
adc atsa
sta 1,s
lda 1+2,s
adc atsa+2
sta 1+2,s
plx lo word of seconds
ply hi word of seconds
pha space for result
pha space for result
pushw #7 set current time based on seconds
phy hi word of seconds
phx lo word of seconds
pushl #buff buffer to use
pushw #$e1e1 kludge to get around bug in misc tools
plb kludge to get around bug in misc tools
plb kludge to get around bug in misc tools
ldx #$3703
jsl $e10000 convert seconds
pla
plx
phk kludge to get around bug in misc tools
plb kludge to get around bug in misc tools
rts
atsa ds.b 2
buff ds.b 10
;; cad - check auto daylight savings.
;
; entry battery RAM is as defined above.
;
; exit If the machine thinks it is not synched with the
; real status of daylight savings, the clock is either
; advanced or decreased by an hour.
cad ldx #aug_param
jsr rbp read battey parameter
sta cada
tax
and #$4
bne cad3 if no auto daylight savings check
phx
jsr gds get daylight savings flag
pla
and #2
bne cad1 if machine thinks this is standard time
; machine thinks this is daylight savings time.
bcc cad3 if it actually is daylight savings
; fall back one hour.
lda cada
ora #$2 set bit 1 - it is standard time
pha save new value for now
lda #-3600
ldx #^-3600
bra cad2
; machine thinks that this is standard time.
cad1 bcs cad3 if actually is standard time
; spring ahead one hour.
lda cada
and #$fd
pha
lda #3600
ldx #^3600
cad2 jsr ats adjust time in seconds
pla
ldx #aug_param
jmp wbp write battery parameter and return
cad3 rts
cada dc.w 0
;; cmb - check menu blink.
;
; entry none.
;
; exit menu blink is set as battery params dictate.
;
;
;cmb ldx #aug_param
; jsr rbp read battery parameter
; lsr a
; lsr a
; lsr a
; and #$3 amt of menublink to use
; pha
; _SetMItemBlink
; rts
;
;; gds - get daylight status.
;
; entry none.
;
; exit (c) set if standard time, clear if daylight savings.
gds pha space for result
pha space for result
pha space for result
pha space for result
_ReadTimeHex
lda 6,s get month and filler
and #$ff remove filler
cmp #3
bcc gds1a if not at least april, standard time
cmp #3
bne gds3 if not april
; see if past the first sunday in april.
lda 5,s
and #$ff get day of month
cmp #6+1
bcs gds9 if definetly past the first sunday of the month
tax
stx gdsa save for now
lda 8,s get day of week
and #$ff remove extra garbage
gds1 cmp #1
beq gds2 if found the first sunday of the month
dea
dex
bpl gds1 if more to check in the month
gds1a bra gds8 if definetly standard time
gds2 cpx gdsa
bne gds9 if past the first sunday of april
; today is the first sunday of april.
lda 3,s get hour and year
and #$ff remove year
cmp #2
bcs gds9 if in daylight savings
bra gds8 if standard time
gds3 cmp #9
bcc gds9 if defintely daylight savings
bne gds8 if defintely standard time
lda 5,s
and #$ff get day of month in low bye
cmp #30-6
bcc gds9 if definetly in daylight savings
tax
stx gdsa
lda 8,s get day of week
and #$ff remove extra garbage
gds4 cmp #1
beq gds7 if found the last sunday of the month
ina
cmp #8
bcc gds5 if haven't wrapped
lda #1 reset to sunday
gds5 inx
cpx #30+1
bcc gds4 if more to check in the month
bra gds8 if defintely standard time
gds7 cpx gdsa
bne gds9 if before the last sunday of the month
; today is the last sunday of october.
lda 3,s get hour and year
and #$ff remove year
cmp #2
bra gds10 (c) set if standard time
gds8 sec flag standard time
bra gds10
gds9 clc flag daylight savings time
gds10 plx clear off stack
plx
plx
plx
rts
gdsa dc.w 0 scratch value
;; rbp - read battery parameter.
;
; entry (x) = parameter to read.
;
; exit (a) = value of parameter.
rbp pha space for result
phx parameter to read
_ReadBparam
pla get value
rts
;; Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
# File: makefile
# Target: CtlPanel.NDA
# Created: Wednesday, February 13, 1991 DAL
CtlPanel.NDA ÄÄ ControlPanel.NDA.Load ControlPanel.NDA.Res
delete -i CtlPanel.NDA
duplicate -y -d ControlPanel.NDA.load CtlPanel.NDA
duplicate -y -r ControlPanel.NDA.res CtlPanel.NDA
if {AutoDuplicate} == 1
DuplicateIIGS -y -mac CtlPanel.NDA ControlPanel
End
ControlPanel.NDA.res ÄÄ CtlPanel.rez
reziigs CtlPanel.rez -o ControlPanel.NDA.res
ControlPanel.NDA.Load Ä CtlPanel.aii.obj cbp.aii.obj makefile
linkiigs ¶
## -l -s >ControlPanel.map ¶
-lseg:$1000 main ¶
CtlPanel.aii.obj cbp.aii.obj ¶
-o ControlPanel.NDA.Load -t NDA
cbp.aii.obj Ä cbp.aii Makefile ::commonmacros.h
asmiigs cbp.aii
.aii.obj Ä .aii
asmiigs {default}.aii
|
||||
@@ -0,0 +1 @@
|
||||
This source file is no longer in use.
Replaced by the DC.AII and DIRECTCONNECT.R files
Tim Harrington 3/29/89
|
||||
@@ -0,0 +1 @@
|
||||
This source file is no longer in use.
Replaced by the DC.AII and DIRECTCONNECT.R files
Tim Harrington 3/29/89
|
||||
@@ -0,0 +1 @@
|
||||
/*******************************************************************/
/*
/* DIRECTCONNECT.r
/*
/* Copyright (C) 1988-1992
/* Apple Computer, Inc.
/* All Rights Reserved
/*
/* This file contains the source of the resources needed to build the
/* Direct Connect CDEV.
/*
/*******************************************************************/
#include "typesiigs.r"
resource rIcon (1) {
0x8000, /* Kind */
20, /* Height */
28, /* Width */
$"00000000000FFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFF0FFFFFFF000000000"
$"0000000000F0FFFFFFF0FFFFFFFF"
$"FFFFFFFFF0F0FFFFFFF0FCCCCCCC"
$"DDDDDDDDD0F0FFFFFFF0FFFFFFFF"
$"DDDDDDDDD0F0FFFFFFF0FCCCCCCF"
$"DDDDDDDDD0F0FFFFFFF0FFFFFFFF"
$"DDDDDDDDD0F0FFFFFFF0FCCCCCCC"
$"DDDDDDDDD0F0FFFFFFF0FFFFFFFF"
$"DDDDDDDDD0F0FFFFFFF0FFFCCCCC"
$"DDDDDDDDD0F0FFFFFFF0FFFFFFFF"
$"0000000000F0FFFFFFF0FCCCCCFC"
$"FFFFFFFFFFF0FFFF0000FFFFFFFF"
$"00000000000FFFFF0FF0FCCCCCCF"
$"FFFFFFFFFF0FFFFF0FF000000000"
$"FFFFFFFFFF0000000FFFFFFFFFFF"
$"FFFFFFFFFF0FFFFF0FF8FFFFFFFF"
$"33333333330000000FF4FCCCFFFF"
$"FFFFFFFFFF0FFFFF0FFFFFFFFFFF"
$"00000000000FFFFF000000000000",
$"fffffffffff00000000000000000"
$"ffffffffffff0000000fffffffff"
$"ffffffffffff0000000fffffffff"
$"ffffffffffff0000000fffffffff"
$"ffffffffffff0000000fffffffff"
$"ffffffffffff0000000fffffffff"
$"ffffffffffff0000000fffffffff"
$"ffffffffffff0000000fffffffff"
$"ffffffffffff0000000fffffffff"
$"ffffffffffff0000000fffffffff"
$"ffffffffffff0000000fffffffff"
$"ffffffffffff0000000fffffffff"
$"ffffffffffff0000ffffffffffff"
$"fffffffffff00000ffffffffffff"
$"fffffffffff00000ffffffffffff"
$"ffffffffffffffffffffffffffff"
$"ffffffffffffffffffffffffffff"
$"ffffffffffffffffffffffffffff"
$"fffffffffff00000ffffffffffff"
$"fffffffffff00000ffffffffffff";
};
read rCDEVCode (1,Convert) "DIRECTCONNECT.Load";
resource rCDEVFlags (1) {
wantInit+wantClose+wantCreate+wantAbout, /* CDEV Flags */
1, /* Enabled */
1, /* Version */
1, /* Machine */
4, /* System */
{0,0,131,200}, /* DataRect {0,0,160,200} */
"DC Printer", /* Name */
"Scott Kuechle & Tim Harrington", /* Author */
"v1.1"; /* VersStr */
};
|
||||
@@ -0,0 +1 @@
|
||||
This source file is no longer in use.
Replaced by the DC.AII and DIRECTCONNECT.R files
Tim Harrington 3/29/89
|
||||
@@ -0,0 +1 @@
|
||||
This source file is no longer in use.
Replaced by the DC.AII and DIRECTCONNECT.R files
Tim Harrington 3/29/89
|
||||
@@ -0,0 +1 @@
|
||||
This source file is no longer in use.
Replaced by the DC.AII and DIRECTCONNECT.R files
Tim Harrington 3/29/89
|
||||
@@ -0,0 +1 @@
|
||||
This source file is no longer in use.
Replaced by the DC.AII and DIRECTCONNECT.R files
Tim Harrington 3/29/89
|
||||
@@ -0,0 +1 @@
|
||||
This source file is no longer in use.
Replaced by the DC.AII and DIRECTCONNECT.R files
Tim Harrington 3/29/89
|
||||
@@ -0,0 +1 @@
|
||||
This source file is no longer in use.
Replaced by the DC.AII and DIRECTCONNECT.R files
Tim Harrington 3/29/89
|
||||
@@ -0,0 +1 @@
|
||||
CDEV = DirectConnect
{CDEV} Ä {CDEV}.Load ś
{CDEV}.r
reziigs {CDEV}.r -o {CDEV} -t "C7 " -c "pdos"
if {dup} # test whether we should duplicateiigs
duplicateiigs -m -y {CDEV} {CDEV}
end
{CDEV}.Load Ä ś
dc.aii.obj ś
sul.aii.obj
LinkIIGS -x -lseg scott ś
dc.aii.obj ś
sul.aii.obj ś
-o {CDEV}.Load
dc.aii.obj Ä dc.aii
asmiigs dc.aii
sul.aii.obj Ä sul.aii
asmiigs sul.aii
|
||||
@@ -0,0 +1 @@
|
||||
This source file is no longer in use.
Replaced by the DC.AII and DIRECTCONNECT.R files
Tim Harrington 3/29/89
|
||||
@@ -0,0 +1 @@
|
||||
This source file is no longer in use.
Replaced by the DC.AII and DIRECTCONNECT.R files
Tim Harrington 3/29/89
|
||||
@@ -0,0 +1 @@
|
||||
This source file is no longer in use.
Replaced by the DC.AII and DIRECTCONNECT.R files
Tim Harrington 3/29/89
|
||||
@@ -0,0 +1 @@
|
||||
This source file is no longer in use.
Replaced by the DC.AII and DIRECTCONNECT.R files
Tim Harrington 3/29/89
|
||||
@@ -0,0 +1 @@
|
||||
*******************************************************************************
*
* DirectConnect CDEV
*
*
* Copyright 1988,1989 Apple Computer, Inc.
* All rights reserved
*
*
* Written by : Tim Harrington
* and
* Scott Kuechle
*
*
*******************************************************************************
*
* Revision History
*
* 1.0e14 3/21/89 TGH -First try at this thing.
* 1.0d16 3/29/89 TGH -First public release.
* 1.1d1 3/20/90 MVS Version 1.1
* User can now select LaserWriter so postscript files
* can be generated. Lists are now sorted. Makes sure
* that starting selection is always visible.
* A whole bunch of changes by Monte.
* 8/15/91 BAK Added dialog if error on read or write PRINTER.SETUP.
* 8/16/91 BAK If AppleShare FST is the boot FST (ie, we booted from
* the network), then the path to PRINTER.SETUP is as
* follows: "{GetUserPath FST specific call}:Printer.Setup".
*
*******************************************************************************
msb off
string asis
INCLUDE 'M16.UTIL'
INCLUDE 'M16.GSOS'
INCLUDE 'M16.CONTROL'
INCLUDE 'M16.MISCTOOL'
INCLUDE 'M16.LIST'
INCLUDE 'M16.MEMORY'
INCLUDE 'M16.INTMATH'
INCLUDE 'M16.PRINT'
include 'M16.QUICKDRAW'
include 'M16.WINDOW'
include 'M16.DIALOG'
include 'e16.dialog'
INCLUDE 'E16.CONTROL'
ENTRY bogusCDEV,\
InitCDEV,\
CloseCDEV,\
CreateCDEV,\
AboutCDEV
ENTRY C2Printer,CPort
ENTRY WriteData
ENTRY screenF :data
import sul
zp0 equ 0 ;Zero page use
zp1 equ zp0+4
zpsize equ zp1+4 ;Length of zero page.
MemRecSize equ 5 ;Size of each member record.
*##############################################################################
*
* Below is the main entry point for this CDEV. All messages (commands)
* passed to the CDEV by the Control Panel go through this point. This CDEV
* handles only 4 of the standard CDEV calls. These are listed below:
*
* Call Name Call Number
* --------- -----------
* INIT 4
* CLOSE 5
* CREATE 7
* ABOUT 8
*
* ON ENTRY: C,X,Y = Unknown
* Stack = Result Space (Long)
* Message (Word)
* Data1 (Long)
* Data2 (Long)
* Return Address (3 Bytes)
*
* Message = Call Number
* Data1 = Window Grafport
* Data2 = Unused
*
* ON EXIT C,X,Y = Changed
* Stack = Result (Long)
*
* Result = 0 (always)
*
*##############################################################################
main PROC
ENTRY Data1,Data2
ENTRY ControlList
ENTRY AboutList
ENTRY MErrorList
ENTRY Mem1RecH,Mem2RecH
ENTRY MyID
ENTRY List1Count,List2Count
ENTRY List1ID,List2ID
ENTRY CreateError
phb ;Save old data reg
phk ;Set data reg = prog reg
plb
lda 5,s ;Load DATA2 off the stack
sta Data2 ;and store it locally.
lda 7,s
sta Data2+2
lda 9,s ;Load DATA1 off the stack
sta Data1 ;and store it locally.
lda 11,s
sta Data1+2
lda 13,s ;Load MESSAGE off the
sta Message ;stack and store it locally.
lda 1,s ;Bump the stack up to prepare
sta 11,s ;to take off the 3 parameters
lda 3,s ;that we stored about.
sta 13,s
PullWord ;Get rid of MESSAGE space
PullLong ;Get rid of DATA1 space
PullLong ;Get rid of DATA2 space
lda Message ;Load the call number
cmp #12 ;Compare againts max+1
bcs ret_addr ;If >= max+1, just leave.
pea ret_addr-1 ;Push our return address
asl a ;Times 2 into word table
tax ;Move into index reg
lda cdev_calls,x ;Load the address of call handler
pha ;Push the address of routine on the stack
rts ;Jump to the call handler
ret_addr lda #0 ;Make sure we return zeros.
sta 5,s
sta 7,s
plb ;Restore NDAs data bank register
rtl ;Return to Control Panel NDA.
Message dc.w 0 ;Local storage for MESSAGE
Data1 dc.l 0 ;Local storage for DATA1
Data2 dc.l 0 ;Local storage for DATA2
MyID dc.w 0
CreateError dc.w 0 ;0 = no error, 1 = error
cdev_calls dc.w bogusCDEV-1 ;0 ;Null
dc.w bogusCDEV-1 ;1 ;MachineCDEV
dc.w bogusCDEV-1 ;2 ;BootCDEV
dc.w bogusCDEV-1 ;3 ;ShutdownCDEV
dc.w InitCDEV-1 ;4
dc.w CloseCDEV-1 ;5
dc.w bogusCDEV-1 ;6 ;EventsCDEV
dc.w CreateCDEV-1 ;7
dc.w AboutCDEV-1 ;8
dc.w bogusCDEV-1 ;9 ;RectCDEV
dc.w bogusCDEV-1 ;10 ;HitCDEV
dc.w bogusCDEV-1 ;11 ;RunCDEV
ControlList
dc.l List2Control
dc.l List1Control
dc.l SText1Control ;Port:
dc.l SText2Control ;Printer:
dc.l 0
LeftEdge equ 10
RightEdge equ 190
TL1Vert equ 18
BR1Vert equ 60
TL2Vert equ 79
BR2Vert equ 121
TL3Vert equ 8
BR3Vert equ 18
TL4Vert equ 69
BR4Vert equ 79
List1Control dc.w 14 ;PCount
List1ID dc.l 1 ;ID number
dc.w TL1Vert
dc.w LeftEdge
dc.w BR1Vert
dc.w RightEdge
dc.l $89000000 ;listcontrol ID
dc.w 0 ;Flag
dc.w $1401+fCtlCanBeTarget+fCtlWantEvents ;More Flags
dc.l 0 ;Ref con
List1Count dc.w 0
dc.w 0 ;Number seen
dc.w 6 ;Single selection Pascal strings
List1Start dc.w 1 ;1st member seen
dc.l 0 ;Draw routine
dc.w 10 ;Height
Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
This source file is no longer in use.
Replaced by the DC.AII and DIRECTCONNECT.R files
Tim Harrington 3/29/89
|
||||
@@ -0,0 +1 @@
|
||||
This source file is no longer in use.
Replaced by the DC.AII and DIRECTCONNECT.R files
Tim Harrington 3/29/89
|
||||
@@ -0,0 +1 @@
|
||||
;;; sul - sort uppercase list.
;
; Michael V. Stein 02/21/90.
;
; © Apple, 1990.
blanks off
;; equates.
;; imported addresses.
;; include files.
include 'm16.list'
include 'm16.util2'
;; main program.
main proc
export sul
sul pushlong #cue ;compare uppercase elements
phy ;hi word to list handle
pha ;lo word to list handle
_SortList2
rts
;; cue - compare uppercase elements.
;
; entry none.
;
; exit none.
memberA equ 4+2
memberB equ memberA+4
cue phd
tsc
tcd use stack as a direct page
phb save data bank
phk
plb
ldy #$02
lda [memberA] dereference first handle
tax
lda [memberA],y
sta memberA+2
stx memberA
lda [memberB] dereference second handle
tax
lda [memberB],y
sta memberB+2
stx memberB
shortmx
lda [memberA]
cmp [memberB] compare it to memberB
bcc cue1 if length(memberB) >= length(memberA)
lda [memberB]
cue1 sta min shortest length of either string
ldy #$00
cue2 iny
lda [memberB],y
jsr cal capitalize a letter
sta temp
lda [memberA],y
jsr cal capitalize a letter
cmp temp
bne cue5 we have a difference
cpy min chars are the same so check if more bytes to check
bcc cue2 no more bytes to check
cue4 lda [memberA] the shortest string is less than the longer
cmp [memberB] set carry if a >= b
cue5 longmx carry set if a >= b
lda 0+2
sta 8+2
lda 2+2
sta 10+2
plb restore data bank
pld restore direct page
pla
pla
pla
pla
rtl
min ds.b 1
temp ds.b 1
;; cal - capitalize a letter.
;
; entry none.
;
; exit none.
longa off
longi off
cal cmp #'a'
bcc cal1 if not lowercase
cmp #'z'+1
bcs cal1 if not lowercase
sbc #$20-1 (c) clear
cal1 rts
endp
end
|
||||
@@ -0,0 +1 @@
|
||||
/* Max C interface to the CDEV Manager by Greg Branche
* (based on the MAX Pascal interface file by Darryl Lovato)
* Copyright (c) 1989 by Apple Computer, Inc.
*/
#ifndef __CDev__
#define __CDev__
#define MachineCDEV 1 /* machine test, return 0 if NOT ok to run on this machine */
#define BootCDEV 2 /* boot time init call or Install call - no parms */
#define ShutDownCDEV 3 /* shut down or de-install the CDEV - no parms */
#define InitCDEV 4 /* called when being shown - data1 = windowPtr */
#define CloseCDEV 5 /* called when being removed - data1 = windowPtr */
#define EventsCDEV 6 /* called when an event - data1 = ptr to event record */
#define CreateCDEV 7 /* called so that a CDEV can create its controls inline - data1 = window */
#define AboutCDEV 8 /* called so that a CDEV can create its about text inline - no parms */
#define RectCDEV 9 /* called so that a CDEV can dynamically compute its rectangle data1 = rectprr */
#define HitCDEV 10 /* called when ctl is "hit" - data1 = Hdl to ctl hit, data2 = Ctl Id */
#define RunCDEV 11 /* called when daRun is called */
#define reserved1 12 /* reserved for Apple Computer's future use */
#define reserved2 13 /* reserved for Apple Computer's future use */
#define reserved3 14 /* reserved for Apple Computer's future use */
#define NeverUsed1 15
#define NeverUsed2 16
#define wantMachine 1 /* these flags are set in the CDEV flags resource to tell the Control */
#define wantBoot 2 /* panel which of the above messages the CDEV actually needs */
#define wantShutDown 4
#define wantInit 8
#define wantClose 16
#define wantEvents 32
#define wantCreate 64
#define wantAbout 128
#define wantRect 256
#define wantHit 512
#define wantRun 1024
#define wantReserved1 2048
#define wantReserved2 4096
#define wantReserved3 8192
#define updateSSfromBRAM 16384 /* this is for use by Apple Computer, Inc ONLY! <- I mean it! */
#define canBeInactive 32768 /* set this bit if the cdev can be made inactive by the user */
#endif
|
||||
@@ -0,0 +1 @@
|
||||
/*###########################################################*/
/*# #*/
/*# File: FolderPriv.c #*/
/*# Version: 1.0 #*/
/*# Author: #*/
/*# Copyright: (c) 1992 by Apple Computer, Inc. #*/
/*# #*/
/*# Description: This file contains the cdev C #*/
/*# routine used by the FolderPriv CDEV. #*/
/*# #*/
/*###########################################################*/
#include <Types.h>
#include <GSOS.h>
#include <Quickdraw.h>
#include <Font.h>
#include <Memory.h>
#include <IntMath.h>
#include <Event.h>
#include <ProDOS.h>
#include <Locator.h>
#include <Control.h>
#include <Window.h>
#include <List.h>
#include <Scrap.h>
#include <Dialog.h>
#include <Menu.h>
#include <Desk.h>
#include <StdFile.h>
#include <QDAUX.h>
#include <Print.h>
#include <MiscTool.h>
#include <LineEdit.h>
#include <Resources.h>
#include "CDEV.h"
#include "rDefs.h" /* resource ID definitions */
extern unsigned SaveDB();
extern void RestoreDB();
GSString255 *getPath();
#define free(ptr) DisposeHandle(FindHandle(ptr))
/*###########################################################*/
/*# Actual CDEV, this is called by the control panel #*/
/*###########################################################*/
#define getUserPath 0x0008
#define getDefPrivileges 0x000e
#define setDefPrivileges 0x000f
#define setAccessRights 0x0001
#define setOwnerName 0x0002
#define setGroupName 0x0004
typedef struct {
char reserved;
char world;
char group;
char owner;
} AccessRec;
struct {
unsigned pCount;
unsigned fileSysID;
unsigned commandNum;
unsigned flags;
unsigned unused; /* actually, the high word of flags */
AccessRec access;
union {
ResultBuf255 *out;
GSString255 *in;
} ownerName;
union {
ResultBuf255 *out;
GSString255 *in;
} groupName;
} privParms;
struct {
unsigned buflen;
unsigned namelen;
} namebuf; /* used as a GS/OS result buffer */
IORecGS ioParms = {
4, /* pCount */
0, /* refNum */
(Pointer) &privParms, /* dataBuffer */
sizeof(privParms) /* transferCount */
};
struct {
unsigned pCount;
GSString255 *pathname;
unsigned access;
unsigned fileType;
} createParms = { 3, NULL, 0xE7, 0x5A};
NameRecGS destroyParms = { 1, NULL};
unsigned long masterValues[] = {
0, /* custom */
0x07000000, /* private */
0x07070700, /* public */
0x07040400, /* drop box */
0x07030300 /* bulletin board */
};
boolean fstActive = FALSE;
/* This routine is eventually linked and then placed into a cdev code resource.
The only requirements are that this routine is at the beginning of the resource
so if the CDEV has any other routines they must follow this one. The cdev's resource
fork is always opened when a call to the cdev is made. The cdev can also assume
that the current port is set to the ctl panel window except in the boot message,
where quickdraw isn't even started, and in the about message, where it is the port
of the help window. All normal managers will be stared up for all calls except
the boot call, which will only have miscTools & Resource Manager started. */
pascal long CDEV(message,data1, data2)
int message;
long data1;
long data2;
{
CtlRecHndl tempCtl;
WindowPtr window;
GSString255 *pathname;
int retCode;
int refNum;
unsigned i;
unsigned oldDBR;
unsigned ctlValue;
oldDBR = SaveDB(); /* set up DBR correctly */
retCode = 0; /* initialize the function result to zero, so that we will work in
future versions of the Control Panel! */
switch(message) {
case BootCDEV:
/* If the wantBoot flag is set, this routine will be called during the
startup sequence. The control panel takes care of drawing the "boot"
icon. When this call is made, the machine state is bad at best.
QuickDraw is not even started up. The parameters to this call are
undefined. */
privParms.pCount = 3; /* set up parameter block */
privParms.fileSysID = appleShareFSID;
privParms.commandNum = getUserPath; /* GetUserPath call */
FSTSpecific(&privParms); /* make the call to see if AppleShare is available */
if(_toolErr == invalidFSTID) /* if AppleShare isn't around... */
* (int *) data1 = 1; /* ... draw X through icon */
else if((refNum = /* assignment */ OpenFile()) >= 0) {
ioParms.refNum = refNum;
ioParms.pCount = 4;
ReadGS(&ioParms);
i = _toolErr; /* save any error from the Read call */
ioParms.pCount = 1;
CloseGS(&ioParms);
if(i) /* did we have a problem reading? */
break; /* yes, just forget it */
privParms.pCount = !(privParms.flags & setAccessRights)
? 3 : (privParms.flags & setOwnerName ? 5 : 4);
privParms.fileSysID = appleShareFSID;
privParms.commandNum = setDefPrivileges;
privParms.ownerName.in = NULL;
FSTSpecific(&privParms);
if(_toolErr) /* was there an error? */
* (int *) data1 = 1; /* yes, draw X through icon */
}
break;
case MachineCDEV:
/* This is called
Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
//###########################################################
//# #
//# File: FolderPriv.r #
//# Version: 1.0 #
//# Author: #
//# Copyright: (c) 1992 by Apple Computer, Inc. #
//# #
//# Description: This file contains the resource #
//# definitions used by the FolderPriv #
//# CDEV #
//# #
//#---------------------------------------------------------#
//# #
//# Development History: #
//# #
//# Who Date The Modification #
//# --- -------- ---------------- #
//# GAB 01/21/91 Initial release #
//# #
//###########################################################
//###########################################################
//# Read any standard includes & define our own #
//###########################################################
#include "typesiigs.r" // include the type definitions
#include "rDefs.h" // include defines
//###########################################################
//# Read the resources built elsewhere #
//###########################################################
read rCDEVCode (1, Convert) "FP.Code"; // this is the code resource
//###########################################################
//# Define our resources #
//###########################################################
resource rVersion (1) {
{
1,0,0, // major, minor, bug fix version numbers
release, 0 // non-final release #
},
verUS, // country code
"FolderPriv",
"Copyright © 1992, Apple Computer, Inc., All Rights Reserved"
};
resource rCDEVFlags (1) {
wantBoot +
wantHit +
wantInit +
wantMachine +
wantCreate +
wantAbout +
wantClose, // CDEV flags
1, // enabled = True
1, // Version = 1
1, // Machine = v1 ROMs or higher
6, // System = v6.0 or higher
{0,0,125,261}, // DataRect - top left MUST be 0,0
"FolderPriv", // Name
"Greg Branche", // Author
"v1.0"; // Version String
};
//###########################################################
//# Define About Box resources #
//###########################################################
resource rControlTemplate (AboutID) {
AboutID, // control ID
{38,5,128,280}, // rect
statTextControl {{
0, // flags
0b0001000000000010, // more flags
0, // refCon
AboutID
}},
};
resource rTextForLETextBox2 (AboutID) {
"This Control Panel allows you to set the default privilege level that "
"will be assigned to new folders created on AppleShare¨ file servers."
};
//###########################################################
//# Define Warning Message resources #
//###########################################################
resource rAlertString (noFSTtext) {
"73/AppleShare is currently not active. If you continue, any changes "
"that you make will not take effect until the next time the machine "
"is restarted with AppleShare enabled./#1/^#6"
$"00"
};
//###########################################################
//# Define menu resources #
//###########################################################
/* Source code created by DesignMaster */
resource rControlList (myCtrlList) {{
serverDefsBox, /* control resource id for Use Server Defaults check box */
separator1, /* control resource id for separator statText */
masterPopup, /* control resource id for Master PopUp */
separator2, /* control resource id for separator statText */
foldersPopup, /* control resource id for See Folders PopUp*/
filesPopup, /* control resource id for See Files PopUp */
changesPopup, /* control resource id for Make Changes PopUp */
ownerCheckBox, /* control resource id for Owner is... check box */
};};
//----------------------------------------------------------------------------------
// Common strings used by multiple menus
#define nobodyString 0x00000010
#define ownerString 0x00000011
#define groupString 0x00000012
#define oAndGString 0x00000013
#define everyoneString 0x00000014
resource rPString (nobodyString) {
"Nobody"
};
resource rPString (ownerString) {
"Owner"
};
resource rPString (groupString) {
"Group"
};
resource rPString (oAndGString) {
"Owner & Group"
};
resource rPString (everyoneString) {
"Everyone"
};
//----------------------------------------------------------------------------------
// Use Server Defaults check box control
resource rControlTemplate (serverDefsBox) {
serverDefsBox, /* control id */
{3,14,15,247}, /* control rectangle */
CheckControl{{ /* control type */
0x0001, /* flags */
0x1002, /* more flags */
0, /* ref con */
serverDefsBox, /* title reference */
0x0001 /* inital value */
}};
};
resource rPString (serverDefsBox) {
"Use Server Defaults"
};
//----------------------------------------------------------------------------------
// separator bar frame control
resLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
#############################################################
# #
# File: MakeFile #
# Version: 1.0 #
# Author: #
# Copyright: (c) 1991 by Apple Computer, Inc. #
# #
# Description: This file contains the commands needed #
# to build the FolderPriv CDEV for the #
# IIgs #
# #
#-----------------------------------------------------------#
# #
# Development History: #
# #
# Who Date The Modification #
# --- -------- ---------------- #
# GAB 01/21/91 Initial release #
# #
#############################################################
FolderPriv ÄÄ FP.Code FolderPriv.r rDefs.h
RezIIgs FolderPriv.r -o FolderPriv -t "C7 " -c "pdos"
FolderPriv.obj Ä FolderPriv.c rDefs.h CDev.h
CIIgs FolderPriv.c -o FolderPriv.obj
FP.Code Ä FolderPriv.obj
LinkIIgs -w -x ¶
-l >FP.map ¶
-lib "{CIIGSLibrary}CLib" ¶
-lseg $1000:CDev ¶
FolderPriv.obj ¶
"{CIIGSLibrary}Clib"(@main,@~globals,@~arrays) ¶
-o FP.Code
|
||||
Loaded 100 of 1469 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user