Lines Matching refs:mode

56 	// mode handling
58 virtual status_t Decode(int16 id, struct video_mode *mode);
59 virtual status_t Get(struct video_mode *mode) = 0;
60 virtual status_t Set(const struct video_mode *mode) = 0;
61 virtual status_t Unset(const struct video_mode *mode) { return B_OK; };
64 virtual status_t SetPalette(const struct video_mode *mode,
68 virtual int16 Width(const struct video_mode *mode=NULL);
69 virtual int16 Height(const struct video_mode *mode=NULL);
70 virtual int16 Depth(const struct video_mode *mode=NULL);
71 virtual int16 BytesPerRow(const struct video_mode *mode=NULL);
73 virtual void MakeLabel(const struct video_mode *mode, char *label,
86 uint16 mode;
115 compare = a->mode - b->mode;
123 /*! Insert the video mode into the list, sorted by resolution and bit depth.
129 video_mode *mode = NULL;
130 while ((mode = (video_mode *)list_get_next_item(&sModeList, mode))
132 int compare = compare_video_modes(videoMode, mode);
134 // mode already exists
142 list_insert_item_before(&sModeList, mode, videoMode);
162 ModeOps::Decode(int16 id, struct video_mode *mode)
164 mode->ops = this;
165 mode->mode = id;
171 ModeOps::Width(const struct video_mode *mode)
173 return mode ? mode->width : 0;
178 ModeOps::Height(const struct video_mode *mode)
180 return mode ? mode->height : 0;
185 ModeOps::Depth(const struct video_mode *mode)
187 return mode ? mode->bits_per_pixel : 0;
192 ModeOps::BytesPerRow(const struct video_mode *mode)
194 return mode ? mode->bytes_per_row : 0;
199 ModeOps::MakeLabel(const struct video_mode *mode, char *label, size_t len)
201 sprintf(label, "%ux%u %u bit (%s)", mode->width, mode->height,
202 mode->bits_per_pixel, mode->ops->Name());
216 virtual status_t Decode(int16 id, struct video_mode *mode);
217 virtual status_t Get(struct video_mode *mode);
218 virtual status_t Set(const struct video_mode *mode);
219 virtual status_t Unset(const struct video_mode *mode);
221 virtual status_t SetPalette(const struct video_mode *mode,
224 virtual void MakeLabel(const struct video_mode *mode,
275 // TODO: use TT video monitor detection and build possible mode list there...
282 STModeOps::Decode(int16 id, struct video_mode *mode)
284 mode->ops = this;
285 mode->mode = id;
289 mode->width = 320;
290 mode->height = 200;
291 mode->bits_per_pixel = 4;
294 mode->width = 640;
295 mode->height = 480;
296 mode->bits_per_pixel = 4;
299 mode->width = 320;
300 mode->height = 480;
301 mode->bits_per_pixel = 8;
304 mode->bits_per_pixel = 0;
308 mode->bytes_per_row = mode->width * mode->bits_per_pixel / 8;
314 STModeOps::Get(struct video_mode *mode)
320 return Decode(m, mode);
325 STModeOps::Set(const struct video_mode *mode)
329 if (mode == NULL)
335 dprintf("Switching to mode 0x%04x\n", mode->mode);
336 //VsetScreen(((uint32)0x00d00000), ((uint32)0x00d00000), 3, mode->mode);
337 Setscreen(-1, -1, mode->mode, 0);
338 if (Getrez() != mode->mode) {
339 dprintf("failed to set mode %d. Current is %d\n", mode->mode, fPreviousMode);
348 STModeOps::Unset(const struct video_mode *mode)
354 dprintf("Reverting to mode 0x%04x\n", fPreviousMode);
364 STModeOps::SetPalette(const struct video_mode *mode, const uint8 *palette)
366 switch (mode->bits_per_pixel) {
390 STModeOps::MakeLabel(const struct video_mode *mode, char *label,
393 ModeOps::MakeLabel(mode, label, len);
396 sprintf(label, " 0x%04x", mode->mode);
412 virtual status_t Decode(int16 id, struct video_mode *mode);
413 virtual status_t Get(struct video_mode *mode);
414 virtual status_t Set(const struct video_mode *mode);
415 virtual status_t Unset(const struct video_mode *mode);
417 virtual status_t SetPalette(const struct video_mode *mode,
420 virtual void MakeLabel(const struct video_mode *mode,
469 // TODO: use falcon video monitor detection and build possible mode list there...
496 FalconModeOps::Decode(int16 id, struct video_mode *mode)
505 mode->ops = this;
506 mode->mode = id;
508 mode->width = (id & 0x0008) ? 640 : 320;
509 mode->height = (vga ? (interlace ? 400 : 200) : (dbl ? 240 : 480));
512 mode->width = (mode->width * 12) / 10;
513 mode->height = (mode->width * 12) / 10;
515 mode->bits_per_pixel = 1 << (id & 0x0007);
516 mode->bytes_per_row = mode->width * mode->bits_per_pixel / 8;
522 FalconModeOps::Get(struct video_mode *mode)
528 return Decode(m, mode);
533 FalconModeOps::Set(const struct video_mode *mode)
537 if (mode == NULL)
543 dprintf("Switching to mode 0x%04x\n", mode->mode);
544 //VsetScreen(((uint32)0x00d00000), ((uint32)0x00d00000), 3, mode->mode);
545 VsetScreen(((uint32)0x00c00000), ((uint32)0x00c00000), 3, mode->mode);
546 //VsetScreen(((uint32)-1), ((uint32)-1), 3, mode->mode);
553 FalconModeOps::Unset(const struct video_mode *mode)
559 dprintf("Reverting to mode 0x%04x\n", fPreviousMode);
569 FalconModeOps::SetPalette(const struct video_mode *mode, const uint8 *palette)
571 switch (mode->bits_per_pixel) {
593 FalconModeOps::MakeLabel(const struct video_mode *mode, char *label,
596 ModeOps::MakeLabel(mode, label, len);
599 int16 m = mode->mode;
600 sprintf(label, " 0x%04x", mode->mode);
622 virtual status_t Decode(int16 id, struct video_mode *mode);
623 virtual status_t Get(struct video_mode *mode);
624 virtual status_t Set(const struct video_mode *mode);
625 virtual status_t Unset(const struct video_mode *mode);
627 virtual status_t SetPalette(const struct video_mode *mode,
630 virtual void MakeLabel(const struct video_mode *mode,
681 // TODO: use Milan video monitor detection and build possible mode list there...
708 MilanModeOps::Decode(int16 id, struct video_mode *mode)
712 info.devID = mode->mode;
715 mode->ops = this;
716 mode->mode = id;
724 mode->width = info.scrWidth;
725 mode->height = info.scrHeight;
726 mode->bits_per_pixel = info.scrPlanes;
727 mode->bytes_per_row = mode->width * mode->bits_per_pixel / 8;
733 MilanModeOps::Get(struct video_mode *mode)
742 return Decode(m, mode);
747 MilanModeOps::Set(const struct video_mode *mode)
751 if (mode == NULL)
757 dprintf("Switching to mode 0x%04x\n", mode->mode);
758 //VsetScreen(((uint32)0x00d00000), ((uint32)0x00d00000), 3, mode->mode);
759 //VsetScreen(((uint32)-1), ((uint32)-1), 3, mode->mode);
760 Setscreen(-1,mode->mode,MI_MAGIC,CMD_SETMODE);
767 MilanModeOps::Unset(const struct video_mode *mode)
773 dprintf("Reverting to mode 0x%04x\n", fPreviousMode);
783 MilanModeOps::SetPalette(const struct video_mode *mode, const uint8 *palette)
785 switch (mode->bits_per_pixel) {
808 MilanModeOps::MakeLabel(const struct video_mode *mode, char *label,
811 ModeOps::MakeLabel(mode, label, len);
814 int16 m = mode->mode;
815 sprintf(label, " 0x%04x", mode->mode);
848 virtual status_t Get(struct video_mode *mode);
849 virtual status_t Set(const struct video_mode *mode);
850 virtual status_t Unset(const struct video_mode *mode);
853 virtual int16 Width(const struct video_mode *mode=NULL);
854 virtual int16 Height(const struct video_mode *mode=NULL);
855 virtual int16 Depth(const struct video_mode *mode=NULL);
886 video_mode * mode;
888 mode = AllocMode();
889 if (mode == NULL)
892 Get(mode);
893 //mode->space = ;
894 mode->mode = 0;
895 mode->width = 800;
896 mode->height = 600;
897 mode->bits_per_pixel = 8;
898 mode->bytes_per_row = mode->width * mode->bits_per_pixel / 8;
900 add_video_mode(mode);
903 mode = AllocMode();
904 if (mode == NULL)
907 Get(mode);
908 //mode->space = ;
909 mode->mode = 0;
910 mode->width = 1024;
911 mode->height = 768;
912 mode->bits_per_pixel = 16;
913 mode->bytes_per_row = mode->width * mode->bits_per_pixel / 8;
915 add_video_mode(mode);
923 NFVDIModeOps::Get(struct video_mode *mode)
925 if (mode == NULL)
929 mode->width = Width();
930 mode->height = Height();
931 mode->bits_per_pixel = Depth();
932 mode->bytes_per_row = mode->width * mode->bits_per_pixel / 8;
933 dprintf("Get: %dx%d\n", mode->width, mode->height);
939 NFVDIModeOps::Set(const struct video_mode *mode)
941 if (mode == NULL)
947 (int32)Width(mode), (int32)Height(mode), (int32)Depth(mode));
949 (int32)Width(mode), (int32)Height(mode), (int32)Depth(mode));
958 NFVDIModeOps::Unset(const struct video_mode *mode)
960 if (mode == NULL)
982 NFVDIModeOps::Width(const struct video_mode *mode)
984 if (mode)
985 return ModeOps::Width(mode);
993 NFVDIModeOps::Height(const struct video_mode *mode)
995 if (mode)
996 return ModeOps::Height(mode);
1004 NFVDIModeOps::Depth(const struct video_mode *mode)
1006 if (mode)
1007 return ModeOps::Depth(mode);
1023 // find selected mode
1024 video_mode *mode = NULL;
1031 // "Default" mode special
1036 // "Standard VGA" mode special
1037 // sets sMode to NULL which triggers VGA mode
1040 mode = (video_mode *)subitem->Data();
1045 if (mode != sMode) {
1046 // update standard mode
1048 sMode = mode;
1066 item->SetHelpText("The Default video mode is the one currently configured "
1067 "in the system. If there is no mode configured yet, a viable mode will "
1072 video_mode *mode = NULL;
1073 while ((mode = (video_mode *)list_get_next_item(&sModeList, mode)) != NULL) {
1075 mode->ops->MakeLabel(mode, label, sizeof(label));
1078 item->SetData(mode);
1112 // in debug mode, we'll never show the logo
1185 dprintf("current video mode: \n");