2011-04-28 02:59:29 +03:00
|
|
|
/*
|
|
|
|
* ubb-vga.h - Output video on UBB with more or less VGA timing
|
|
|
|
*
|
|
|
|
* Written 2011 by Werner Almesberger
|
|
|
|
* Copyright 2011 Werner Almesberger
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef UBB_VGA_H
|
|
|
|
#define UBB_VGA_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
|
|
|
|
#define R_VAL (1 << 3)
|
|
|
|
#define G_VAL (1 << 0)
|
|
|
|
#define B_VAL (1 << 1)
|
|
|
|
#define Y_VAL (1 << 2)
|
|
|
|
|
|
|
|
|
2011-05-01 21:08:02 +03:00
|
|
|
struct mode {
|
|
|
|
const char *name; /* NULL for end of table */
|
|
|
|
int xres, yres;
|
|
|
|
int clkdiv; /* pixel clock = 336 MHz/(clkdiv+1) */
|
2011-05-02 02:59:38 +03:00
|
|
|
int vsync_lines; /* 2 lines, for official VGA */
|
|
|
|
int vfront_lines; /* 32 lines */
|
|
|
|
int vback_lines; /* 14 lines */
|
|
|
|
uint16_t hsync_cycles; /* 3.77 us */
|
|
|
|
uint16_t hback_cycles; /* 0.79 us */
|
|
|
|
uint16_t line_cycles; /* 31.77 us */
|
2011-05-01 21:08:02 +03:00
|
|
|
};
|
|
|
|
|
2011-05-01 21:16:01 +03:00
|
|
|
extern const struct mode *mode;
|
|
|
|
|
2011-05-01 21:08:02 +03:00
|
|
|
|
2011-04-28 02:59:29 +03:00
|
|
|
void *map(off_t addr, size_t size);
|
|
|
|
|
|
|
|
|
2011-05-02 03:50:20 +03:00
|
|
|
#define CYCLES(cy) ((cy)/112.0)
|
|
|
|
|
|
|
|
|
2011-04-28 07:18:03 +03:00
|
|
|
/* ccube.c */
|
|
|
|
|
|
|
|
uint8_t ccube_map(uint8_t r, uint8_t g, uint8_t b);
|
|
|
|
void ccube_init(void);
|
2011-04-28 06:38:13 +03:00
|
|
|
|
ubb-vga2: non-contiguous allocation of frame buffer memory
- ubb-vga.h (calloc_phys_vec), physmem.c: non-contiguous memory allocator
(for now, without really considering any mapping to physical memory)
- Makefile (OBJS): added physmem.o
- ubb-vga.h (grabfb), grabfb.c (grabfb): API change for non-contiguous
frame buffer
- ubb-vga.h (ppmimg), ppmimg.c (convert, ppmimg): API change for
non-contiguous frame buffer
- ubb-vga.h (tstimg), tstimg.c (pixel, color_bars, grill, grid, sides,
dot, line45, arc, printc, text, ctext, tstimg): API change for
non-contiguous frame buffer
- tstimg.c (tstimg): we no longer need to clear the frame buffer
- ubb-vga.c (frame, session, main): use a vector of line buffers instead
of a contiguous frame buffer
2011-04-29 19:04:02 +03:00
|
|
|
/* physmem.c */
|
|
|
|
|
|
|
|
void **calloc_phys_vec(size_t n, size_t size);
|
2011-04-30 03:15:27 +03:00
|
|
|
unsigned long *xlat_virt(void *const *v, size_t n);
|
ubb-vga2: non-contiguous allocation of frame buffer memory
- ubb-vga.h (calloc_phys_vec), physmem.c: non-contiguous memory allocator
(for now, without really considering any mapping to physical memory)
- Makefile (OBJS): added physmem.o
- ubb-vga.h (grabfb), grabfb.c (grabfb): API change for non-contiguous
frame buffer
- ubb-vga.h (ppmimg), ppmimg.c (convert, ppmimg): API change for
non-contiguous frame buffer
- ubb-vga.h (tstimg), tstimg.c (pixel, color_bars, grill, grid, sides,
dot, line45, arc, printc, text, ctext, tstimg): API change for
non-contiguous frame buffer
- tstimg.c (tstimg): we no longer need to clear the frame buffer
- ubb-vga.c (frame, session, main): use a vector of line buffers instead
of a contiguous frame buffer
2011-04-29 19:04:02 +03:00
|
|
|
|
2011-04-28 07:18:03 +03:00
|
|
|
/* grabfb.c */
|
2011-04-28 02:59:29 +03:00
|
|
|
|
ubb-vga2: non-contiguous allocation of frame buffer memory
- ubb-vga.h (calloc_phys_vec), physmem.c: non-contiguous memory allocator
(for now, without really considering any mapping to physical memory)
- Makefile (OBJS): added physmem.o
- ubb-vga.h (grabfb), grabfb.c (grabfb): API change for non-contiguous
frame buffer
- ubb-vga.h (ppmimg), ppmimg.c (convert, ppmimg): API change for
non-contiguous frame buffer
- ubb-vga.h (tstimg), tstimg.c (pixel, color_bars, grill, grid, sides,
dot, line45, arc, printc, text, ctext, tstimg): API change for
non-contiguous frame buffer
- tstimg.c (tstimg): we no longer need to clear the frame buffer
- ubb-vga.c (frame, session, main): use a vector of line buffers instead
of a contiguous frame buffer
2011-04-29 19:04:02 +03:00
|
|
|
void grabfb(void **f, int xres, int yres);
|
2011-04-28 02:59:29 +03:00
|
|
|
|
2011-04-28 06:38:13 +03:00
|
|
|
/* tstimg.c */
|
|
|
|
|
ubb-vga2: non-contiguous allocation of frame buffer memory
- ubb-vga.h (calloc_phys_vec), physmem.c: non-contiguous memory allocator
(for now, without really considering any mapping to physical memory)
- Makefile (OBJS): added physmem.o
- ubb-vga.h (grabfb), grabfb.c (grabfb): API change for non-contiguous
frame buffer
- ubb-vga.h (ppmimg), ppmimg.c (convert, ppmimg): API change for
non-contiguous frame buffer
- ubb-vga.h (tstimg), tstimg.c (pixel, color_bars, grill, grid, sides,
dot, line45, arc, printc, text, ctext, tstimg): API change for
non-contiguous frame buffer
- tstimg.c (tstimg): we no longer need to clear the frame buffer
- ubb-vga.c (frame, session, main): use a vector of line buffers instead
of a contiguous frame buffer
2011-04-29 19:04:02 +03:00
|
|
|
void tstimg(void **f, int xres, int yres);
|
2011-04-28 05:31:39 +03:00
|
|
|
|
2011-04-28 06:38:13 +03:00
|
|
|
/* ppmimg.c */
|
|
|
|
|
|
|
|
extern char *img_name;
|
|
|
|
|
ubb-vga2: non-contiguous allocation of frame buffer memory
- ubb-vga.h (calloc_phys_vec), physmem.c: non-contiguous memory allocator
(for now, without really considering any mapping to physical memory)
- Makefile (OBJS): added physmem.o
- ubb-vga.h (grabfb), grabfb.c (grabfb): API change for non-contiguous
frame buffer
- ubb-vga.h (ppmimg), ppmimg.c (convert, ppmimg): API change for
non-contiguous frame buffer
- ubb-vga.h (tstimg), tstimg.c (pixel, color_bars, grill, grid, sides,
dot, line45, arc, printc, text, ctext, tstimg): API change for
non-contiguous frame buffer
- tstimg.c (tstimg): we no longer need to clear the frame buffer
- ubb-vga.c (frame, session, main): use a vector of line buffers instead
of a contiguous frame buffer
2011-04-29 19:04:02 +03:00
|
|
|
void ppmimg(void **f, int xres, int yres);
|
2011-04-28 06:38:13 +03:00
|
|
|
|
2011-04-28 02:59:29 +03:00
|
|
|
#endif /* !UBB_VGA_H */
|