Rgb2Hires/Readme.md

74 lines
3.3 KiB
Markdown
Raw Permalink Normal View History

2020-11-13 00:03:50 +00:00
# Rgb2Hires
2023-10-31 15:13:36 +00:00
Rgb2Hires is a set of tools to help convert a modern RGB image (JPEG, PNG) to the HIRES format for Apple II computers, either as a binary export or an assembly listing.
2021-02-15 20:49:54 +00:00
2023-10-31 15:13:36 +00:00
The colors of the RGB image can be approximate: Rgb2Hires will match them with the nearest HIRES color.
2021-02-15 20:49:54 +00:00
## Apple II colors
RGB values of the targeted colors:
* **BLACK**: 00 00 00
* **WHITE**: FF FF FF
* **BLUE**: 07 A8 E0
* **ORANGE**: F9 56 1D
* **GREEN**: 43 C8 00
* **VIOLET**: BB 36 FF
## Projects
2021-01-25 23:21:52 +00:00
This repository contains three "PC" projects:
2023-10-31 15:13:36 +00:00
* **libRgb2Hires**: a library to convert an RGB image to the Apple II's HIRES format
* **Picture**: a program to convert an RGB png to a binary or an ASM excerpt that can be loaded into the HIRES memory pages of an Apple II. An optional **live preview** can be displayed: its window will simulate an RGB monitor and will show the result, including color clashing and artifacts.
* Source image must be 140x192. Pixels are anamorphic: they will be displayed twice as wide as they are tall.
* Source image must contains six colors: BLACK, WHITE, ORANGE, GREEN, BLUE and PURPLE. The colors may be an approximation of the six Apple II colors. Please refer to the provided pic.
* **Tile**: given an RGB png tile sheet that satisfies the same requirements as above, it extracts a 14x16 tile and converts it to ASM data. The lines forming the tile data **are not interleaved** as in a HIRES framebuffer.
2020-11-13 00:03:50 +00:00
And one Apple II project:
2023-10-31 15:13:36 +00:00
* **Loader**: a program that will load and display a picture generated by the *Picture* program. A bash script is provided as an example to load the picture and the loader onto an image disk. [AppleCommander](https://applecommander.github.io/) is required to do so. Once in ProDOS, just type *-DISPLAY*.
2021-02-01 23:35:49 +00:00
__Note:__ For more information about the "Hires" format and its limitations, you can refer to my [website](https://www.xtof.info/hires-graphics-apple-ii.html).
2018-10-06 22:37:44 +00:00
2021-02-15 20:49:54 +00:00
## Build from sources
2021-01-25 23:21:52 +00:00
### Dependencies
The dependencies are managed by [conan.io](https://conan.io/). Please refer to [their documentation](https://docs.conan.io/en/latest/installation.html) for installation instructions.
2021-01-25 23:21:52 +00:00
2022-06-18 12:53:44 +00:00
The build system is managed by CMake.
2023-10-31 15:13:36 +00:00
2021-01-25 23:21:52 +00:00
### How to build
2022-06-18 12:53:44 +00:00
```bash
mkdir build && cd build
conan install ..
cmake .. -DCMAKE_BUILD_TYPE=RELEASE
cmake --build . --config release -j
```
2021-01-25 23:21:52 +00:00
## Apple II project (Loader)
2018-10-06 22:37:44 +00:00
2020-11-13 00:03:50 +00:00
### Dependencies
* [CC65](https://cc65.github.io/cc65/)
2023-10-31 15:13:36 +00:00
* The crosscompiler suite. Please provide an environment variable *CC65_HOME* pointing to your CC65 folder.
2021-01-25 23:21:52 +00:00
2022-06-18 12:53:44 +00:00
### How to build
2021-01-25 23:21:52 +00:00
2023-10-31 15:13:36 +00:00
A makefile is provided. Just run
2022-06-18 12:53:44 +00:00
```bash
make
```
2021-01-27 23:09:45 +00:00
## Test
2023-10-31 15:13:36 +00:00
* A correct source image, *testPicture.png*, is provided as an example. Convert it using the application *Picture*, then copy it onto a disk image along with the Apple II loader. You can use or refer to the provided script in the *Loader_Apple2* folder.
* Another source image, *testTile.png*, is provided to test that the correct tile is converted and extracted using the application *Tile*.
2021-02-14 22:43:24 +00:00
### Demo
2023-10-31 15:13:36 +00:00
The live preview can help to visualise color clashing and artifacts. You can edit your file using *Photoshop* or any other application. The *Preview* window will be updated each time the file is saved.
2021-02-14 22:43:24 +00:00
2021-02-14 22:58:19 +00:00
<a href="https://pub.xtof.info/github/demo-rgb2hires.mp4">
<img src="https://pub.xtof.info/github/demo-rgb2hires.png"/>
</a>