mirror of
https://github.com/nippur72/apple1-videocard-lib.git
synced 2024-05-28 18:41:30 +00:00
fix typos
This commit is contained in:
parent
de7e42b429
commit
33b42ecfc5
51
README.md
51
README.md
|
@ -1,17 +1,17 @@
|
||||||
# apple1-videocard-lib
|
# apple1-videocard-lib
|
||||||
|
|
||||||
Library and demos for the "Apple-1 Graphic Card" by P-LAB,
|
Library and demos for the "Apple-1 Graphic Card" by P-LAB,
|
||||||
featuring the TMS9918 Video Display Processo by Texas Instruments.
|
featuring the TMS9918 Video Display Processor by Texas Instruments.
|
||||||
|
|
||||||
## Repo structure
|
## Repo structure
|
||||||
|
|
||||||
```
|
```
|
||||||
demo a demo program that makes use of the library
|
demo/ a demo program that makes use of the library
|
||||||
docs TMS9918 and Apple1 manuals
|
docs/ TMS9918 and Apple-1 manuals
|
||||||
kickc target configuration files for KickC
|
kickc/ target configuration files for KickC
|
||||||
lib the library files to include in your project
|
lib/ the library files to include in your project
|
||||||
tetris a demo game
|
tetris/ a demo game
|
||||||
tools some build tools
|
tools/ some build tools
|
||||||
```
|
```
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
@ -22,12 +22,11 @@ with the "Apple-1 Graphic Card" board by [P-LAB]() or any
|
||||||
other video card that maps the TMS9918 in the `$CC00`-`$CC01`
|
other video card that maps the TMS9918 in the `$CC00`-`$CC01`
|
||||||
memory range of the Apple-1.
|
memory range of the Apple-1.
|
||||||
|
|
||||||
The library is written in C with [KickC](https://gitlab.com/camelot/kickc/-/releases)
|
The library is written in C with [KickC](https://gitlab.com/camelot/kickc/-/releases), a very efficient 6502 C compiler.
|
||||||
which is a very efficient 6502 C compiler.
|
|
||||||
|
|
||||||
## Choice of the screen mode
|
## Choice of the screen mode
|
||||||
|
|
||||||
The library only supports screen modes 1 and 2 (screen 0 and screen 3 not
|
The library supports screen modes 1 and 2 only (screen 0 and screen 3 not
|
||||||
being very useful). Both are 256x192 pixels but there are some differences
|
being very useful). Both are 256x192 pixels but there are some differences
|
||||||
you should consider when evaluating which mode to use:
|
you should consider when evaluating which mode to use:
|
||||||
|
|
||||||
|
@ -115,7 +114,7 @@ screen2_puts(16, 12, col, "HELLO");
|
||||||
|
|
||||||
Some example code:
|
Some example code:
|
||||||
```c
|
```c
|
||||||
// writes the value 42 at the VRAM location 8000
|
// writes the value 42 at VRAM location 8000
|
||||||
tms_set_vram_write_addr(8000);
|
tms_set_vram_write_addr(8000);
|
||||||
TMS_WRITE_DATA_PORT(42);
|
TMS_WRITE_DATA_PORT(42);
|
||||||
|
|
||||||
|
@ -125,7 +124,7 @@ byte val = TMS_READ_DATA_PORT;
|
||||||
```
|
```
|
||||||
|
|
||||||
When using the default values that came with `SCREEN1_TABLE[]` and `SCREEN2_TABLE[]`,
|
When using the default values that came with `SCREEN1_TABLE[]` and `SCREEN2_TABLE[]`,
|
||||||
the VRAM is organized according the following memory map:
|
VRAM is organized according the following memory map:
|
||||||
```c
|
```c
|
||||||
// ZONE RANGE NAME YOU CAN USE IN C
|
// ZONE RANGE NAME YOU CAN USE IN C
|
||||||
// ===========================================================
|
// ===========================================================
|
||||||
|
@ -200,35 +199,35 @@ from the `lib/` directory in your C source files.
|
||||||
Compile your sources with the KickC compiler, the `tools/`
|
Compile your sources with the KickC compiler, the `tools/`
|
||||||
directory contains a `build.bat` script example for Windows.
|
directory contains a `build.bat` script example for Windows.
|
||||||
|
|
||||||
There are three configurations you can target with the KickC
|
There are three configurations you can target with the switches `-t target -targetdir thisrepopath/kickc` of the KickC compiler:
|
||||||
compiler switches `-t target -targetdir thisrepopath/kickc`:
|
|
||||||
|
|
||||||
- apple1
|
- `apple1`
|
||||||
- apple1_jukebox
|
- `apple1_jukebox`
|
||||||
- vic20
|
- `vic20`
|
||||||
|
|
||||||
#### Target "apple1"
|
#### Target "apple1"
|
||||||
|
|
||||||
With this target, the compiled program will start at `$280` in
|
With this target, the compiled program will start at `$0280` in
|
||||||
the free RAM on the Apple-1 (please make sure you have enough RAM).
|
the free RAM of the Apple-1 (please make sure you have enough RAM).
|
||||||
|
|
||||||
TODO: add reference to `hexdump.js`
|
(TODO: add reference to `hexdump.js`)
|
||||||
|
|
||||||
#### Target "apple1_jukebox"
|
#### Target "apple1_jukebox"
|
||||||
|
|
||||||
This target is for expansion Cards that provide a ROM storage in
|
This target is for expansion cards that provide a ROM storage in
|
||||||
the range `$4000`-`$7FFF`, as:
|
the range `$4000`-`$7FFF`, as:
|
||||||
- the "CodeTank" EEPROM daughterboard of the "Apple-1 Graphic Card"
|
- the "CodeTank" EEPROM daughterboard of the "Apple-1 Graphic Card"
|
||||||
- "Juke-Box Card" FLASH
|
- "Juke-Box Card" FLASH
|
||||||
|
|
||||||
In this target configuration, the program is split into two segments:
|
In this target configuration, the program is split into two segments:
|
||||||
- the "Code" that resides in ROM at `$4000`
|
- the `Code` that resides in ROM at `$4000`
|
||||||
- the "Data" that resides in RAM at `$0280`
|
- the `Data` that resides in RAM at `$0280`
|
||||||
(this because the program needs to change the "Data").
|
|
||||||
|
The split is required because the program needs to write on the `Data` segment (e.g. when changing the value of a variable).
|
||||||
|
|
||||||
The only issue is that the "Data" segment needs to be initialized
|
The only issue is that the "Data" segment needs to be initialized
|
||||||
with the startup values (for example, the value that a global `int` variable
|
with the correct startup values (for example, the value that
|
||||||
takes before it's used).
|
a global `int` variable takes before it's used).
|
||||||
|
|
||||||
The "Data" initialization needs to be done manually in the C program
|
The "Data" initialization needs to be done manually in the C program
|
||||||
by explicitly calling `apple1_eprom_init()` in `main()`. The function
|
by explicitly calling `apple1_eprom_init()` in `main()`. The function
|
||||||
|
|
Loading…
Reference in New Issue
Block a user