From 3250e57da50f8acbf3170f584c5d55ad391e5bec Mon Sep 17 00:00:00 2001 From: Christophe Meneboeuf Date: Thu, 8 Dec 2016 22:20:09 +0100 Subject: [PATCH] Erratum: Loader's mli.asm was not committed --- .gitignore | 1 - Loader_Apple2/Makefile | 2 +- Loader_Apple2/src/mli.asm | 53 +++++++++++++++++++++++++++++++++++++++ Readme.md | 24 ++++++++++++------ 4 files changed, 70 insertions(+), 10 deletions(-) create mode 100644 Loader_Apple2/src/mli.asm diff --git a/.gitignore b/.gitignore index 70b5ba8..b5e94ca 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ RgbToHiRes.vcxproj.user RgbToHiRes.VC.* *.sln *.bin -*.asm **/.vs **/Debug **/Release diff --git a/Loader_Apple2/Makefile b/Loader_Apple2/Makefile index cf0110f..0954141 100644 --- a/Loader_Apple2/Makefile +++ b/Loader_Apple2/Makefile @@ -3,7 +3,7 @@ APPLE2_CC := $(CC65_HOME)/bin/cc65 APPLE2_SRC := src/file_io.c src/mli.asm src/main.c APPLE2_MAP := hires.map APPLE2_CFLAGS := -Oirs -v -t apple2 -APPLE2_OUT := bin/hires.a2 +APPLE2_OUT := bin/loader.a2 all: directories apple2 diff --git a/Loader_Apple2/src/mli.asm b/Loader_Apple2/src/mli.asm new file mode 100644 index 0000000..a0515c9 --- /dev/null +++ b/Loader_Apple2/src/mli.asm @@ -0,0 +1,53 @@ +; Rgb2Hires +; Copyright (C) 2016 Christophe Meneboeuf +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation, either version 3 of the License, or +; (at your option) any later version. +; +; This program is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see . + + + +; +; Handling calls to Apple ProDOS 8 MLI +; + + .import __dos_type + .import popa + + .export _call_to_mli + +.code + +_call_to_mli: + ; Store parameters + STA Mli_Param + STX Mli_Param+1 + ; Store call number + JSR popa + STA Mli_Call + + ;+ DEBUG +; CMP #$CE +; BNE continue +;debug: JMP debug +;continue: + ;- DEBUG + + ; Call MLI and return + JSR $BF00 ; MLI call entry point +Mli_Call: + .byte $00 +Mli_Param: + .addr $00 + RTS + + .code diff --git a/Readme.md b/Readme.md index 2500329..0057ad4 100644 --- a/Readme.md +++ b/Readme.md @@ -1,24 +1,32 @@ #Rgb2Hires -This program coverts an RGB image to the Apple II's "HiRes" format. Provided it complies with its constraints: +This program converts an RGB image to the Apple II's "HiRes" format. Provided it complies with this format's constraints: * Source image must be 140x280. Pixels are anamorphic: twice wider than tall. -* Source image must contains six colors : BLACK, WHITE, ORANGE, GREEN, BLUE and PURPLE +* Source image must contains six colors : BLACK, WHITE, ORANGE, GREEN, BLUE and PURPLE For more information about the "Hires" format and its limitations, please refer to Wikipedia: https://en.wikipedia.org/wiki/Apple_II_graphics#High-Resolution_.28Hi-Res.29_graphics -## Compiling +## Compiling + +This repository contains two projects: +* Rgb2Hires, the conversion programm running on a PC +* Loader, for testing purposes. This program runs on Apple II hardware and displays an HiRes binary file named *test.picture* and located on the same disk. ### Rgb2Hires -The source is provided as a Visual Studio project. It's standard C++11 without any Windows dependency so it should compile on Linux and macOs without any modification. +The source is provided as a Visual Studio project. Howerver, it is standard C++11 without any Windows dependency, so it should compile on Linux and macOs without any modification. #### Dependencies -* Magick++ : On Windows, you have provide an environment variable called *MAGICK_HOME* and pointing to the ImageMagick folder. +* Magick++ + * On Windows, you have provide an environment variable called *MAGICK_HOME* and pointing to the ImageMagick folder. + * On Linux, install libmagick++-dev ### Loader (for Apple II) -This program will compile as an Apple II executable that you can run on the actual hardware. +This program will compile as an Apple II executable that you can run on the actual hardware. +It is a Makefile project and must be crosscompiled using **[CC65](https://cc65.github.io/cc65/)** + #### Dependencies -* CC65: Please provide an environment variable, *CC65_HOME*, pointing to your CC65 folder. +* CC65: The crosscompiler suit. Please provide an environment variable, *CC65_HOME* pointing to your CC65 folder. # Running -A correct source image, *test.png*, is provided as an example. Convert it into a file named *test.picture* as the Apple II Loader will try to load and display a file called like that. +A correct source image, *test.png*, is provided as an example. Convert it into a file named *test.picture* and copy it along the Apple II *Loader*, then execute on the actual hardware ;)