TODO
====
+- Try to play with squish_control.
+- Make 80x50 mode configurable. This will be a bit tricky as various code
+ changes were necessary including to constants.
+- Inverse text could be clearer, especially when also bright/bold.
- Now that upwards smooth scrolling has been implemented:
- May be possible to do the same for downwards
- May need to support sending XOFF/XON to control speed, if too fast it
Ironically the result will be more portable on common unix.
And much cleaner once consolidated.
- Maybe add an option for HIRES/color mode.
-- It'd be nice to support 80x50, 132x50, etc...
- It'd require analogtv code changes.
- Would be nice for analogtv to simulate amber or green display
optionally. And to also support a less blurry mode simulating
screens with higher phosphor.
Most used command by the author:
hacks/analogterm -geometry 1364x1024 -no-threads
+
+1150x1024 seems decent when in 80x50
+hacks/analogterm -geometry 1056x1024 -no-threads
+hacks/analogterm -geometry 912x1024 -no-threads
+hacks/analogterm -no-threads -geometry 960x1000
+
+# 960x1000 is now the default since the 80x50 mode was introduced.
+# Setting the right window size for the text to be clearer is a bit tricky.
+hacks/analogterm -no-threads
#define countof(x) (sizeof((x))/sizeof((*x)))
#define SCREEN_COLS 80
-#define SCREEN_ROWS 25
+#define SCREEN_ROWS 50
\f
return;
}
- if (st->scroll_slow && st->cursy == 24 && offset == -1)
+ if (st->scroll_slow && st->cursy == 49 && offset == -1)
smooth = true;
/* Only one line to clear */
void
at_goto(analogterm_state_t *st, int r, int c)
{
- if (r > 24) r = 24;
+ if (r > 49) r = 49;
if (c > 79) c = 79;
st->cursy = r;
uint32_t *cptr, *ctptr;
uint16_t *mptr, *mtptr;
- for (y = 0; y < 25; y++) {
+ for (y = 0; y < 50; y++) {
for (cptr = st->textlines_char[y], ctptr = &cptr[80];
cptr < ctptr; cptr++)
*cptr = ' ';
/* Default scrolling region to full screen, 0-based */
sim->st->scroll_top = 0;
- sim->st->scroll_bottom = 24; /* XXX Use definition/macro */
+ sim->st->scroll_bottom = 49; /* XXX Use definition/macro */
sim->st->scroll_slow = false;
/* Create font */
analogterm_graphics3_height);
sim->stepno=0;
- at_goto(sim->st,24,0);
+ at_goto(sim->st,49,0);
sim->st->lastchar = (uint32_t)-1;
sim->next_actiontime=0.0;
works great except with random screen garbage in text mode, when we
end up redrawing the whole screen every second */
int row, col;
- for (row=(st->gr_mode ? 20 : 0); row<25; row++) {
+ for (row=(st->gr_mode ? 20 : 0); row<50; row++) {
for (col=0; col<80; col++) {
uint16_t m = st->textlines_mode[row][col];
if ((m & TMODE_BLINK) != 0) {
analogtv_setup_sync(sim->inp, /* XXX 1 */0, 0);
analogtv_setup_frame(sim->dec);
- for (textrow = 0; textrow < 25; textrow++) {
+ for (textrow = 0; textrow < 50; textrow++) {
int row;
int rowmul = textrow * 8;
int soffset = (textrow >= st->scroll_top ? smooth_scroll_offset : 0);
typedef struct analogterm_state {
unsigned char hireslines[192][80];
- uint32_t textlines_char[25][80]; /* XXX Use definition/macro */
- uint16_t textlines_mode[25][80];
+ uint32_t textlines_char[50][80]; /* XXX Use definition/macro */
+ uint16_t textlines_mode[50][80];
int gr_text;
enum {
A2_GR_FULL=1,
* 2022 Adapted to analogterm by Matthew Mondor.
* Altered brightness and sharpness and added optional green, amber, gray,
* cyan and blue monochrome modes.
+ * Added double vertical resolution support for 80x50 text.
*/
#ifdef HAVE_JWXYZ
/* XXX Original
it->horiz_desync=frand(10.0)-5.0;
it->squeezebottom=frand(5.0)-1.0; */
- it->horiz_desync=frand(6.0)-3.0;
- it->squeezebottom=frand(3.0)-1.0;
+ it->horiz_desync=frand(4.0)-2.0;
+ it->squeezebottom=frand(2.0)-0.5;
#ifdef DEBUG
printf("analogtv: prefix=%s\n",prefix);
If it's very close (2.5%) to a multiple of VISLINES, make it exact
For example, it maps 1024 => 1000.
*/
- float percent = 0.15;
- float min_ratio = 4.0 / 3.0 * (1 - percent);
+ /* float percent = 0.15; XXX Orig */
+ /*float percent = 0.075;*/
+ float percent = 0.30;
+/* float min_ratio = 4.0 / 3.0 * (1 - percent); XXX Orig */
+ float min_ratio = 2.0 / 4.0 * (1 - percent);
float max_ratio = 16.0 / 9.0 * (1 + percent);
float ratio;
- float height_snap=0.025;
+ /* float height_snap=0.025; XXX Orig */
+ float height_snap=0.05;
hlim = it->xgwa.height;
wlim = it->xgwa.width;
max_ratio = 10;
#endif
- if (wlim < 266 || hlim < 200)
+ if (wlim < 266 || hlim < 400)
{
wlim = 266;
- hlim = 200;
+ hlim = 400;
# ifdef DEBUG
fprintf (stderr,
"size: minimal: %dx%d in %dx%d (%.3f < %.3f < %.3f)\n",
unsigned int pix;
/* XXX Make this command-line and/or sequence configurable */
-#define AMBERCRT
+#define GREENCRT
for (rpf=rgbf; rpf!=rgbf_end; rpf+=3) {
#ifdef AMBERCRT
int ntscri=rpf[0]*levelmult;
}
totsignal *= it->agclevel;
- ncl = 0.95f * it->crtload[lineno-1] +
- 0.05f*(baseload +
+ ncl = 0.98f * it->crtload[lineno-1] +
+ 0.02f*(baseload +
(totsignal-30000)/100000.0f +
- (slineno>184 ? (slineno-184)*(lineno-184)*0.001f * it->squeezebottom
+ (slineno>368 ? (slineno-368)*(lineno-368)*0.001f * it->squeezebottom
: 0.0f));
/*diff=ncl - it->crtload[lineno];*/
/*bigloadchange = (diff>0.01 || diff<-0.01);*/
*/
enum {
/* We don't handle interlace here */
- ANALOGTV_V=262,
+ ANALOGTV_V=524,
ANALOGTV_TOP=30,
- ANALOGTV_VISLINES=200,
+ ANALOGTV_VISLINES=400,
ANALOGTV_BOT=ANALOGTV_TOP + ANALOGTV_VISLINES,
/* This really defines our sampling rate, 4x the colorburst
/* MAX_LINEHEIGHT corresponds to 2400 vertical pixels, beyond which
it interpolates extra black lines. */
- ANALOGTV_MAX_LINEHEIGHT=12
+ ANALOGTV_MAX_LINEHEIGHT=24
};
"*TVContrast: " ANALOGTV_DEF_CONTRAST, \
"*Background: Black", \
"*use_cmap: 0", \
- "*geometry: 800x600", \
+ "*geometry: 960x1000", \
"*fpsSolid: True", \
THREAD_DEFAULTS \
ANALOGTV_DEFAULTS_SHM