move all demos under a folder; use #include<> syntax
This commit is contained in:
parent
301eb433e9
commit
b17a7010d0
16
README.md
16
README.md
|
@ -206,13 +206,19 @@ while(1) {
|
|||
|
||||
### Building the source code
|
||||
|
||||
To link the library, simply `#include` the `tms9918.h` file
|
||||
from the `lib/` directory in your C source files.
|
||||
To link the library, simply `#include` the `tms9918.h` file
|
||||
in your C sources. The recommended way is to add the KickC
|
||||
command line switch `-includedir=thisrepo/lib` to your
|
||||
build script and then include the file with `#include <tms9918.h>`.
|
||||
|
||||
Compile your sources with the KickC compiler, the `tools/`
|
||||
directory contains a `build.bat` script example for Windows.
|
||||
The the `tools/` directory contains a simple `build.bat` script
|
||||
example (for Windows) that you can customize to your needs.
|
||||
|
||||
There are three configurations you can target with the switches `-t target -targetdir thisrepopath/kickc` of the KickC compiler:
|
||||
### Setting a machine target
|
||||
|
||||
There are three configurations you can target with
|
||||
the switches `-t target -targetdir thisrepo/kickc`
|
||||
of the KickC compiler:
|
||||
|
||||
- `apple1`
|
||||
- `apple1_jukebox`
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
@call ..\tools\build demo
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
#include "../lib/tms9918.h"
|
||||
#include <tms9918.h>
|
||||
|
||||
#include "demo_screen1.h"
|
||||
#include "demo_screen2.h"
|
|
@ -0,0 +1,2 @@
|
|||
@call ..\..\tools\build demo
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
@call ..\..\tools\build picshow
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
// image converted with: Convert9918 - A simple image converter for the TMS9918A
|
||||
// http://harmlesslion.com
|
||||
|
||||
#include "../lib/tms9918.h"
|
||||
#include <tms9918.h>
|
||||
|
||||
#pragma data_seg(Code)
|
||||
#include "pic_c.h"
|
||||
|
@ -20,18 +20,18 @@ void main() {
|
|||
tms_init_regs(SCREEN2_TABLE);
|
||||
screen2_init_bitmap(FG_BG(COLOR_WHITE,COLOR_BLACK));
|
||||
|
||||
// bulk copy color table to VRAM
|
||||
tms_set_vram_write_addr(TMS_COLOR_TABLE);
|
||||
for(word t=0; t<sizeof(pic_c); t++) {
|
||||
TMS_WRITE_DATA_PORT(pic_c[t]);
|
||||
}
|
||||
|
||||
// bulk copy pattern table to VRAM
|
||||
tms_set_vram_write_addr(TMS_PATTERN_TABLE);
|
||||
for(word t=0; t<sizeof(pic_p); t++) {
|
||||
TMS_WRITE_DATA_PORT(pic_p[t]);
|
||||
}
|
||||
|
||||
// bulk copy color table to VRAM
|
||||
tms_set_vram_write_addr(TMS_COLOR_TABLE);
|
||||
for(word t=0; t<sizeof(pic_c); t++) {
|
||||
TMS_WRITE_DATA_PORT(pic_c[t]);
|
||||
}
|
||||
|
||||
// bye
|
||||
while(apple1_getkey()!=CHR_RETURN);
|
||||
woz_puts("BYE!\r");
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 416 KiB After Width: | Height: | Size: 416 KiB |
|
@ -0,0 +1,2 @@
|
|||
@rem === BUILD TETRIS ===
|
||||
call ..\..\tools\build tetris
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
// TODO solve division by counter_factor
|
||||
|
||||
#include "../lib/tms9918.h"
|
||||
#include <tms9918.h>
|
||||
|
||||
#include "draw.h"
|
||||
#include "pieces.h"
|
|
@ -7,7 +7,8 @@
|
|||
"emulator": "x64sc",
|
||||
"defines": {
|
||||
"__APPLE1__": 1,
|
||||
"APPLE1": 1
|
||||
"APPLE1": 1,
|
||||
"__KICKC__": 1
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
"defines": {
|
||||
"__APPLE1__": 1,
|
||||
"APPLE1": 1,
|
||||
"APPLE1_JUKEBOX": 1
|
||||
"APPLE1_JUKEBOX": 1,
|
||||
"__KICKC__": 1
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
"emulator": "xvic",
|
||||
"defines": {
|
||||
"__VIC20__": 1,
|
||||
"VIC20": 1
|
||||
"VIC20": 1,
|
||||
"__KICKC__": 1
|
||||
}
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
@call ..\tools\build picshow
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
@rem === BUILD TETRIS ===
|
||||
call ..\tools\build tetris
|
|
@ -1,16 +1,17 @@
|
|||
@rem === BUILD SCRIPT ===
|
||||
|
||||
@SET TARGET=%1
|
||||
@SET TMS9918=..\..
|
||||
|
||||
@echo ======================== VIC20 ===================================================
|
||||
call kickc -targetdir ..\kickc\ -t VIC20_8K %TARGET%.c -o out\%TARGET%_vic20.prg -e
|
||||
call kickc -includedir %TMS9918%\lib -targetdir %TMS9918%\kickc\ -t VIC20_8K %TARGET%.c -o out\%TARGET%_vic20.prg -e
|
||||
copy out\%TARGET%.prg out\%TARGET%_vic20.prg
|
||||
|
||||
@echo ======================== APPLE 1 =================================================
|
||||
call kickc -targetdir ..\kickc\ -t apple1_jukebox %TARGET%.c -o out\%TARGET%_apple1.prg -e
|
||||
call kickc -includedir %TMS9918%\lib -targetdir %TMS9918%\kickc\ -t apple1_jukebox %TARGET%.c -o out\%TARGET%_apple1.prg -e
|
||||
|
||||
@rem builds the apple1 eprom file
|
||||
call node ..\tools\mkeprom out out\%TARGET%_apple1.bin
|
||||
call node %TMS9918%\tools\mkeprom out out\%TARGET%_apple1.bin
|
||||
|
||||
@rem clean up files
|
||||
@del out\apple1_codeseg.bin
|
||||
|
|
Loading…
Reference in New Issue