Skip to content

Commit 080f5c7

Browse files
committed
use new values for bdos extensions
1 parent 357d877 commit 080f5c7

File tree

14 files changed

+928
-2239
lines changed

14 files changed

+928
-2239
lines changed

aztec/rssrdr.c

Lines changed: 148 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -1,148 +1,148 @@
1-
#include <stdio.h>
2-
3-
#define ITEMS_SHOWN_BEFORE_RELOAD 200 /* 200 * 10 seconds average = ~30 minutes */
4-
5-
char * g_feeds[] =
6-
{
7-
"https://rss.nytimes.com/services/xml/rss/nyt/World.xml",
8-
"https://www.theguardian.com/world/rss",
9-
"https://feeds.washingtonpost.com/rss/world",
10-
"https://feeds.npr.org/1001/rss.xml",
11-
0, /* mark the end of the list */
12-
};
13-
14-
char g_rss_item[ 2048 ]; /* set to the bdos DMA address for storing an RSS item */
15-
int g_sleep = 1;
16-
17-
void bdos_sleep( ms ) unsigned int ms;
18-
{
19-
bdos( 106, ms );
20-
} /*bdos_sleep*/
21-
22-
int bdos_feed_load_rss( pfeeds ) char * pfeeds[];
23-
{
24-
return bdoshl( 107, pfeeds );
25-
} /*bdos_feed_load_rss*/
26-
27-
int bdos_item_load_rss( item ) int item;
28-
{
29-
bdos( 26, g_rss_item ); /* set dma address */
30-
return bdos( 108, item );
31-
} /*bdos_item_load_rss*/
32-
33-
int bdos_kbhit()
34-
{
35-
return bdos( 6, 0xff );
36-
} /*bdos_kbhit*/
37-
38-
char * strchr( p, c ) char * p; char c;
39-
{
40-
while ( *p )
41-
{
42-
if ( *p == c )
43-
return p;
44-
p++;
45-
}
46-
47-
return 0;
48-
} /*strchr*/
49-
50-
int chars_to_sp( p ) char * p;
51-
{
52-
char * start = p;
53-
while ( *p && ' ' != *p )
54-
p++;
55-
56-
return p - start;
57-
} /*chars_to_sp*/
58-
59-
void slow_print( p ) char * p;
60-
{
61-
int col = 1;
62-
char * pnext, x;
63-
64-
while ( *p )
65-
{
66-
if ( bdos_kbhit() )
67-
exit( 1 );
68-
69-
x = *p;
70-
if ( x > 0 ) /* skip extended ascii characters */
71-
{
72-
if ( ' ' == x )
73-
{
74-
int nextsp = chars_to_sp( p + 1 );
75-
if ( ( nextsp + col + 1 ) >= 80 )
76-
{
77-
col = 0;
78-
putchar( '\n' );
79-
p++;
80-
continue;
81-
}
82-
}
83-
col++;
84-
putchar( x );
85-
p++;
86-
if ( g_sleep )
87-
bdos_sleep( 33 );
88-
}
89-
}
90-
91-
putchar( '\n' );
92-
} /*slow_print*/
93-
94-
int main( argc, argv ) int argc; char * argv[];
95-
{
96-
int count, ok, i, j, shown;
97-
int feed_len, title_len;
98-
char * ptitle, * pdescription;
99-
100-
if ( argc > 1 )
101-
g_sleep = 0;
102-
103-
shown = ITEMS_SHOWN_BEFORE_RELOAD;
104-
105-
do
106-
{
107-
if ( shown >= ITEMS_SHOWN_BEFORE_RELOAD )
108-
{
109-
shown = 0;
110-
puts( "<loading rss feeds>" );
111-
count = bdos_feed_load_rss( g_feeds );
112-
113-
if ( 0 == count )
114-
{
115-
puts( "no rss results" );
116-
exit( 1 );
117-
}
118-
}
119-
120-
for ( i = 0; i < count; i++ )
121-
{
122-
ok = bdos_item_load_rss( i );
123-
if ( ok )
124-
{
125-
shown++;
126-
feed_len = strlen( g_rss_item );
127-
ptitle = g_rss_item + feed_len + 1;
128-
title_len = strlen( ptitle );
129-
pdescription = ptitle + title_len + 1;
130-
slow_print( g_rss_item );
131-
slow_print( ptitle );
132-
slow_print( pdescription );
133-
putchar( '\n' );
134-
135-
/* sleep for 2 seconds. exit if any key is pressed */
136-
137-
for ( j = 0; g_sleep && j < 20; j++ )
138-
{
139-
if ( bdos_kbhit() )
140-
exit( 1 );
141-
bdos_sleep( 100 );
142-
}
143-
}
144-
}
145-
} while ( 1 );
146-
147-
return 0;
148-
} /*main*/
1+
#include <stdio.h>
2+
3+
#define ITEMS_SHOWN_BEFORE_RELOAD 200 /* 200 * 10 seconds average = ~30 minutes */
4+
5+
char * g_feeds[] =
6+
{
7+
"https://rss.nytimes.com/services/xml/rss/nyt/World.xml",
8+
"https://www.theguardian.com/world/rss",
9+
"https://feeds.washingtonpost.com/rss/world",
10+
"https://feeds.npr.org/1001/rss.xml",
11+
0, /* mark the end of the list */
12+
};
13+
14+
char g_rss_item[ 2048 ]; /* set to the bdos DMA address for storing an RSS item */
15+
int g_sleep = 1;
16+
17+
void bdos_sleep( ms ) unsigned int ms;
18+
{
19+
bdos( 181, ms );
20+
} /*bdos_sleep*/
21+
22+
int bdos_feed_load_rss( pfeeds ) char * pfeeds[];
23+
{
24+
return bdoshl( 182, pfeeds );
25+
} /*bdos_feed_load_rss*/
26+
27+
int bdos_item_load_rss( item ) int item;
28+
{
29+
bdos( 26, g_rss_item ); /* set dma address */
30+
return bdos( 183, item );
31+
} /*bdos_item_load_rss*/
32+
33+
int bdos_kbhit()
34+
{
35+
return bdos( 6, 0xff );
36+
} /*bdos_kbhit*/
37+
38+
char * strchr( p, c ) char * p; char c;
39+
{
40+
while ( *p )
41+
{
42+
if ( *p == c )
43+
return p;
44+
p++;
45+
}
46+
47+
return 0;
48+
} /*strchr*/
49+
50+
int chars_to_sp( p ) char * p;
51+
{
52+
char * start = p;
53+
while ( *p && ' ' != *p )
54+
p++;
55+
56+
return p - start;
57+
} /*chars_to_sp*/
58+
59+
void slow_print( p ) char * p;
60+
{
61+
int col = 1;
62+
char * pnext, x;
63+
64+
while ( *p )
65+
{
66+
if ( bdos_kbhit() )
67+
exit( 1 );
68+
69+
x = *p;
70+
if ( x > 0 ) /* skip extended ascii characters */
71+
{
72+
if ( ' ' == x )
73+
{
74+
int nextsp = chars_to_sp( p + 1 );
75+
if ( ( nextsp + col + 1 ) >= 80 )
76+
{
77+
col = 0;
78+
putchar( '\n' );
79+
p++;
80+
continue;
81+
}
82+
}
83+
col++;
84+
putchar( x );
85+
p++;
86+
if ( g_sleep )
87+
bdos_sleep( 33 );
88+
}
89+
}
90+
91+
putchar( '\n' );
92+
} /*slow_print*/
93+
94+
int main( argc, argv ) int argc; char * argv[];
95+
{
96+
int count, ok, i, j, shown;
97+
int feed_len, title_len;
98+
char * ptitle, * pdescription;
99+
100+
if ( argc > 1 )
101+
g_sleep = 0;
102+
103+
shown = ITEMS_SHOWN_BEFORE_RELOAD;
104+
105+
do
106+
{
107+
if ( shown >= ITEMS_SHOWN_BEFORE_RELOAD )
108+
{
109+
shown = 0;
110+
puts( "<loading rss feeds>" );
111+
count = bdos_feed_load_rss( g_feeds );
112+
113+
if ( 0 == count )
114+
{
115+
puts( "no rss results" );
116+
exit( 1 );
117+
}
118+
}
119+
120+
for ( i = 0; i < count; i++ )
121+
{
122+
ok = bdos_item_load_rss( i );
123+
if ( ok )
124+
{
125+
shown++;
126+
feed_len = strlen( g_rss_item );
127+
ptitle = g_rss_item + feed_len + 1;
128+
title_len = strlen( ptitle );
129+
pdescription = ptitle + title_len + 1;
130+
slow_print( g_rss_item );
131+
slow_print( ptitle );
132+
slow_print( pdescription );
133+
putchar( '\n' );
134+
135+
/* sleep for 2 seconds. exit if any key is pressed */
136+
137+
for ( j = 0; g_sleep && j < 20; j++ )
138+
{
139+
if ( bdos_kbhit() )
140+
exit( 1 );
141+
bdos_sleep( 100 );
142+
}
143+
}
144+
}
145+
} while ( 1 );
146+
147+
return 0;
148+
} /*main*/

aztec/ttt.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -429,24 +429,24 @@ struct CPMTimeValue
429429

430430
void print_time_now()
431431
{
432-
/* This CP/M BDOS call of 105 is only implemented in NTVCM -- it's not a standard CP/M 2.2 call */
432+
/* This CP/M BDOS call of 180 is only implemented in NTVCM -- it's not a standard CP/M 2.2 call */
433433

434434
struct CPMTimeValue t;
435435
t.h = t.m = t.s = t.l = 0;
436436

437-
bdos( 105, &t );
437+
bdos( 180, &t );
438438
printf( "current time: %02d:%02d:%02d.%02d\n", t.h, t.m, t.s, t.l );
439439
} /*print_time_now*/
440440

441441
long get_ms()
442442
{
443-
/* This CP/M BDOS call of 105 is only implemented in NTVCM -- it's not a standard CP/M 2.2 call */
443+
/* This CP/M BDOS call of 180 is only implemented in NTVCM -- it's not a standard CP/M 2.2 call */
444444

445445
long h, m, s, l;
446446
struct CPMTimeValue t;
447447
t.h = t.m = t.s = t.l = 0;
448448

449-
bdos( 105, &t );
449+
bdos( 180, &t );
450450
h = t.h;
451451
m = t.m;
452452
s = t.s;

0 commit comments

Comments
 (0)