Skip to content

Commit 3d66f7a

Browse files
committed
Merge branch 'tedAI'
2 parents d3c5afb + e002595 commit 3d66f7a

15 files changed

+2069
-465
lines changed

Makefile

+5-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99

1010
# Space or comma separated list of cc65 supported target platforms to build for.
1111
# Default: c64 (lowercase!)
12-
TARGETS := c64, plus4, c128, pet
12+
#TARGETS := apple2
13+
TARGETS := c64, plus4, c128, pet, cx16
1314

1415
# Name of the final, single-file executable.
1516
# Default: name of the current dir with target name appended
@@ -27,15 +28,16 @@ CONFIG :=
2728

2829
# Additional C compiler flags and options.
2930
# Default: none
30-
CFLAGS =
31+
CFLAGS =
32+
#CFLAGS = -DDEBUG
3133

3234
# Additional assembler flags and options.
3335
# Default: none
3436
ASFLAGS =
3537

3638
# Additional linker flags and options.
3739
# Default: none
38-
LDFLAGS =
40+
LDFLAGS =
3941

4042
# Path to the directory containing C and ASM sources.
4143
# Default: src

Makefile.options

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_OPTIONS_=optsize

kkwork.code-workspace

+12-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,16 @@
33
{
44
"path": "."
55
}
6-
]
6+
],
7+
"settings": {
8+
"files.associations": {
9+
"6502.h": "c",
10+
"time.h": "c",
11+
"checks.h": "c",
12+
"string.h": "c",
13+
"cx16.h": "c",
14+
"chargen.h": "c",
15+
"stdio.h": "c"
16+
}
17+
}
718
}

src/apple2/chargen.c

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
const char dice[6][25] = {
3+
4+
{108, 98, 98, 98, 123,
5+
225, 160, 160, 160, 97,
6+
225, 160, 209, 160, 97,
7+
225, 160, 160, 160, 97,
8+
124, 226, 226, 226, 126},
9+
10+
{108, 98, 98, 98, 123,
11+
225, 160, 160, 209, 97,
12+
225, 160, 160, 160, 97,
13+
225, 209, 160, 160, 97,
14+
124, 226, 226, 226, 126},
15+
16+
{108, 98, 98, 98, 123,
17+
225, 160, 160, 209, 97,
18+
225, 160, 209, 160, 97,
19+
225, 209, 160, 160, 97,
20+
124, 226, 226, 226, 126},
21+
22+
{108, 98, 98, 98, 123,
23+
225, 209, 160, 209, 97,
24+
225, 160, 160, 160, 97,
25+
225, 209, 160, 209, 97,
26+
124, 226, 226, 226, 126},
27+
28+
{108, 98, 98, 98, 123,
29+
225, 209, 160, 209, 97,
30+
225, 160, 209, 160, 97,
31+
225, 209, 160, 209, 97,
32+
124, 226, 226, 226, 126},
33+
34+
{108, 98, 98, 98, 123,
35+
225, 209, 160, 209, 97,
36+
225, 209, 160, 209, 97,
37+
225, 209, 160, 209, 97,
38+
124, 226, 226, 226, 126}
39+
40+
};
41+
42+

src/apple2/io.c

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
2+
#include <6502.h>
3+
#include <apple2.h>
4+
#include <conio.h>
5+
#include "../io.h"
6+
#include "../chargen.h"
7+
8+
const unsigned char colTable = 5;
9+
const unsigned char colLegend = 14;
10+
11+
const unsigned char colBackground = 0;
12+
const unsigned char colBorder = 0;
13+
const unsigned char colText = 5;
14+
15+
const unsigned char colSplash = 4;
16+
const unsigned char colSplashRed = 2;
17+
18+
const unsigned char colTempValue = 11; // temporary roll:
19+
const unsigned char colEvenValue = 5; // even row roll: green
20+
const unsigned char colOddValue = 13; // odd row roll: light green
21+
const unsigned char colUpperSum = 4; // upper sum
22+
const unsigned char colLowerSum = 3; // lower sum
23+
const unsigned char colBonus = 2; // bonus
24+
const unsigned char colCurrentRollIdx = 8;
25+
26+
#define screen (unsigned char *)0x8000u
27+
28+
void sleep(int secs){
29+
30+
}
31+
32+
void startup(void)
33+
{
34+
clrscr();
35+
}
36+
37+
void initIO(void)
38+
{
39+
// TODO
40+
}
41+
42+
void initDiceDisplay() {
43+
// nothing to be done on PET
44+
}
45+
46+
void __fastcall__ _plotDice(unsigned char value, unsigned char x, unsigned char y, char r)
47+
{
48+
register unsigned char c;
49+
register unsigned char idx;
50+
51+
unsigned char *row1, *row2, *row3, *row4, *row5;
52+
idx = value - 1;
53+
if (r)
54+
r = 128;
55+
56+
row1 = (unsigned char *)screen + x + (40 * y);
57+
row2 = (unsigned char *)row1 + 40;
58+
row3 = (unsigned char *)row2 + 40;
59+
row4 = (unsigned char *)row3 + 40;
60+
row5 = (unsigned char *)row4 + 40;
61+
62+
if (value == 0)
63+
{
64+
for (c = 0; c < 5; ++c)
65+
{
66+
row1[c] = 32;
67+
row2[c] = 32;
68+
row3[c] = 32;
69+
row4[c] = 32;
70+
row5[c] = 32;
71+
}
72+
}
73+
else
74+
{
75+
for (c = 0; c < 5; ++c)
76+
{
77+
row1[c] = r + dice[idx][c];
78+
row2[c] = r + dice[idx][c + 5];
79+
row3[c] = r + dice[idx][c + 10];
80+
row4[c] = r + dice[idx][c + 15];
81+
row5[c] = r + dice[idx][c + 20];
82+
}
83+
}
84+
}
85+
86+
void plotDice(unsigned char nr, unsigned char value, char revers)
87+
{
88+
_plotDice(value, 35, nr * 5, revers);
89+
}
90+
91+
void eraseDie(unsigned char nr)
92+
{
93+
_plotDice(0, 35, nr * 5, 0);
94+
}

src/c64/io.c

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include <cbm.h>
33
#include <conio.h>
44
#include <c64.h>
5+
#include <string.h>
56
#include "../io.h"
67
#include "../chargen.h"
78

@@ -53,12 +54,16 @@ void installCharset(void)
5354
SEI();
5455
*procio = (*procio & 251);
5556
adr2 = (unsigned char *)49152u;
57+
adr1 = (unsigned char)
58+
memcpy(0xc000,0xd000,4096);
59+
/*
5660
for (adr1 = (unsigned char *)53248u; adr1 <= (unsigned char *)57343u; ++adr1)
5761
{
5862
*b = (unsigned char)adr1;
5963
*adr2 = *adr1;
6064
++adr2;
6165
}
66+
*/
6267
*procio = (*procio | 4);
6368
*screenP = (unsigned char)200;
6469

src/checks.c

-156
This file was deleted.

src/checks.h

-8
This file was deleted.

0 commit comments

Comments
 (0)