[go: up one dir, main page]

Menu

[r813]: / src / lib / coco / width.c  Maximize  Restore  History

Download this file

27 lines (19 with data), 569 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "_coco.h"
// Returns true for success, false if arg is invalid.
//
byte width(byte columns)
{
if (!isCoCo3) {
return FALSE;
}
if (columns != 32 && columns != 40 && columns != 80) {
return FALSE;
}
asm("PSHS", "U,Y"); // protect against BASIC routine
asm("LDB", columns);
asm("JSR", "$F643"); // inside the WIDTH command
asm("PULS", "Y,U");
textScreenWidth = columns;
textScreenHeight = (columns == 32 ? 16 : 24);
return TRUE;
}