Centralize and reorganize a few macros.
This commit is contained in:
parent
eca2ddda6f
commit
601752d5a7
@ -23,7 +23,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: fbreg.h,v 1.1 1999/01/09 02:44:49 yokota Exp $
|
||||
* $Id: fbreg.h,v 1.2 1999/01/19 11:31:11 yokota Exp $
|
||||
*/
|
||||
|
||||
#ifndef _DEV_FB_FBREG_H_
|
||||
@ -99,6 +99,23 @@ typedef struct video_switch {
|
||||
vi_diag_t *diag;
|
||||
} video_switch_t;
|
||||
|
||||
#define save_palette(adp, pal) \
|
||||
(*vidsw[(adp)->va_index]->save_palette)((adp), (pal))
|
||||
#define load_palette(adp, pal) \
|
||||
(*vidsw[(adp)->va_index]->load_palette)((adp), (pal))
|
||||
#define get_mode_info(adp, mode, buf) \
|
||||
(*vidsw[(adp)->va_index]->get_info)((adp), (mode), (buf))
|
||||
#define set_video_mode(adp, mode) \
|
||||
(*vidsw[(adp)->va_index]->set_mode)((adp), (mode))
|
||||
#if 0 /* XXX conflicts with syscons' set_border() */
|
||||
#define set_border(adp, border) \
|
||||
(*vidsw[(adp)->va_index]->set_border)((adp), (border))
|
||||
#endif
|
||||
#define set_origin(adp, o) \
|
||||
(*vidsw[(adp)->va_index]->set_win_org)(adp, o)
|
||||
|
||||
/* XXX - add more macros */
|
||||
|
||||
/* video driver */
|
||||
typedef struct video_driver {
|
||||
char *name;
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: logo_saver.c,v 1.4 1999/01/16 10:20:16 des Exp $
|
||||
* $Id: logo_saver.c,v 1.5 1999/02/05 12:40:15 des Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -97,7 +97,11 @@ logo_saver(video_adapter_t *adp, int blank)
|
||||
/* switch to graphics mode */
|
||||
if (blanked <= 0) {
|
||||
pl = splhigh();
|
||||
set_video_mode(adp, scrmode, logo_pal, 0);
|
||||
set_video_mode(adp, scrmode);
|
||||
load_palette(adp, logo_pal);
|
||||
#if 0 /* XXX conflict */
|
||||
set_border(adp, 0);
|
||||
#endif
|
||||
blanked++;
|
||||
vid = (u_char *)adp->va_window;
|
||||
bpsl = adp->va_line_width;
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: rain_saver.c,v 1.1 1998/12/31 13:41:40 des Exp $
|
||||
* $Id: rain_saver.c,v 1.2 1999/01/11 03:18:50 yokota Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -68,7 +68,11 @@ rain_saver(video_adapter_t *adp, int blank)
|
||||
/* switch to graphics mode */
|
||||
if (blanked <= 0) {
|
||||
pl = splhigh();
|
||||
set_video_mode(adp, M_VGA_CG320, rain_pal, 0);
|
||||
set_video_mode(adp, M_VGA_CG320);
|
||||
load_palette(adp, rain_pal);
|
||||
#if 0 /* XXX conflict */
|
||||
set_border(adp, 0);
|
||||
#endif
|
||||
blanked++;
|
||||
vid = (u_char *)adp->va_window;
|
||||
splx(pl);
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: syscons.h,v 1.45 1999/01/11 03:18:29 yokota Exp $
|
||||
* $Id: syscons.h,v 1.46 1999/01/19 11:31:19 yokota Exp $
|
||||
*/
|
||||
|
||||
#ifndef _DEV_SYSCONS_SYSCONS_H_
|
||||
@ -215,10 +215,6 @@ scr_stat *sc_get_scr_stat(dev_t dev);
|
||||
|
||||
void copy_font(scr_stat *scp, int operation, int font_size, u_char *font_image);
|
||||
void set_border(scr_stat *scp, int color);
|
||||
#define save_palette(adp, pal) \
|
||||
(*vidsw[(adp)->va_index]->save_palette)((adp), (pal))
|
||||
#define load_palette(adp, pal) \
|
||||
(*vidsw[(adp)->va_index]->load_palette)((adp), (pal))
|
||||
|
||||
void sc_touch_scrn_saver(void);
|
||||
void sc_clear_screen(scr_stat *scp);
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: warp_saver.c,v 1.3 1998/12/31 13:38:59 des Exp $
|
||||
* $Id: warp_saver.c,v 1.4 1999/01/11 03:18:55 yokota Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -81,7 +81,11 @@ warp_saver(video_adapter_t *adp, int blank)
|
||||
/* switch to graphics mode */
|
||||
if (blanked <= 0) {
|
||||
pl = splhigh();
|
||||
set_video_mode(adp, M_VGA_CG320, warp_pal, 0);
|
||||
set_video_mode(adp, M_VGA_CG320);
|
||||
load_palette(adp, warp_pal);
|
||||
#if 0 /* XXX conflict */
|
||||
set_border(adp, 0);
|
||||
#endif
|
||||
blanked++;
|
||||
vid = (u_char *)adp->va_window;
|
||||
splx(pl);
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: logo_saver.c,v 1.4 1999/01/16 10:20:16 des Exp $
|
||||
* $Id: logo_saver.c,v 1.5 1999/02/05 12:40:15 des Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -97,7 +97,11 @@ logo_saver(video_adapter_t *adp, int blank)
|
||||
/* switch to graphics mode */
|
||||
if (blanked <= 0) {
|
||||
pl = splhigh();
|
||||
set_video_mode(adp, scrmode, logo_pal, 0);
|
||||
set_video_mode(adp, scrmode);
|
||||
load_palette(adp, logo_pal);
|
||||
#if 0 /* XXX conflict */
|
||||
set_border(adp, 0);
|
||||
#endif
|
||||
blanked++;
|
||||
vid = (u_char *)adp->va_window;
|
||||
bpsl = adp->va_line_width;
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: rain_saver.c,v 1.1 1998/12/31 13:41:40 des Exp $
|
||||
* $Id: rain_saver.c,v 1.2 1999/01/11 03:18:50 yokota Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -68,7 +68,11 @@ rain_saver(video_adapter_t *adp, int blank)
|
||||
/* switch to graphics mode */
|
||||
if (blanked <= 0) {
|
||||
pl = splhigh();
|
||||
set_video_mode(adp, M_VGA_CG320, rain_pal, 0);
|
||||
set_video_mode(adp, M_VGA_CG320);
|
||||
load_palette(adp, rain_pal);
|
||||
#if 0 /* XXX conflict */
|
||||
set_border(adp, 0);
|
||||
#endif
|
||||
blanked++;
|
||||
vid = (u_char *)adp->va_window;
|
||||
splx(pl);
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: saver.h,v 1.15 1999/01/11 03:18:42 yokota Exp $
|
||||
* $Id: saver.h,v 1.16 1999/01/16 10:20:13 des Exp $
|
||||
*/
|
||||
#include <machine/apm_bios.h>
|
||||
#include <machine/console.h>
|
||||
@ -35,16 +35,5 @@
|
||||
|
||||
#include <dev/syscons/syscons.h>
|
||||
|
||||
#define set_video_mode(adp, mode, pal, border) \
|
||||
{ \
|
||||
(*vidsw[(adp)->va_index]->set_mode)((adp), (mode)); \
|
||||
(*vidsw[(adp)->va_index]->load_palette)((adp), (pal)); \
|
||||
(*vidsw[(adp)->va_index]->set_border)((adp), (border)); \
|
||||
}
|
||||
#define get_mode_info(adp, mode, buf) \
|
||||
(*vidsw[(adp)->va_index]->get_info)((adp), (mode), (buf))
|
||||
#define set_origin(adp, o) \
|
||||
(*vidsw[(adp)->va_index]->set_win_org)(adp, o)
|
||||
|
||||
extern scr_stat *cur_console;
|
||||
extern char scr_map[];
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: warp_saver.c,v 1.3 1998/12/31 13:38:59 des Exp $
|
||||
* $Id: warp_saver.c,v 1.4 1999/01/11 03:18:55 yokota Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -81,7 +81,11 @@ warp_saver(video_adapter_t *adp, int blank)
|
||||
/* switch to graphics mode */
|
||||
if (blanked <= 0) {
|
||||
pl = splhigh();
|
||||
set_video_mode(adp, M_VGA_CG320, warp_pal, 0);
|
||||
set_video_mode(adp, M_VGA_CG320);
|
||||
load_palette(adp, warp_pal);
|
||||
#if 0 /* XXX conflict */
|
||||
set_border(adp, 0);
|
||||
#endif
|
||||
blanked++;
|
||||
vid = (u_char *)adp->va_window;
|
||||
splx(pl);
|
||||
|
Loading…
x
Reference in New Issue
Block a user