1 /*
2 * KCemu -- The emulator for the KC85 homecomputer series and much more.
3 * Copyright (C) 1997-2010 Torsten Paul
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 #include <stdlib.h>
21
22 #include "kc/system.h"
23
24 #include "ui/generic/ui_base.h"
25
26 #include "libdbg/dbg.h"
27
UI_Base(void)28 UI_Base::UI_Base(void) {
29 _width = 0;
30 _height = 0;
31 _dirty_size = 0;
32
33 _dirty = 0;
34 _bitmap = 0;
35 }
36
~UI_Base(void)37 UI_Base::~UI_Base(void) {
38 }
39
40 void
create_buffer(int buffer_size)41 UI_Base::create_buffer(int buffer_size) {
42 _bitmap = new byte_t[buffer_size];
43 memset(_bitmap, 0, buffer_size);
44 }
45
46 void
set_real_screen_size(int width,int height)47 UI_Base::set_real_screen_size(int width, int height) {
48 _width = width;
49 _height = height;
50 }
51
52 byte_t *
get_buffer(void)53 UI_Base::get_buffer(void) {
54 return _bitmap;
55 }
56
57 byte_t *
get_dirty_buffer(void)58 UI_Base::get_dirty_buffer(void) {
59 return _dirty;
60 }
61
62 int
get_dirty_buffer_size(void)63 UI_Base::get_dirty_buffer_size(void) {
64 return _dirty_size;
65 }
66
67 int
get_real_width(void)68 UI_Base::get_real_width(void) {
69 if (_width == 0) {
70 DBG(0, form("KCemu/internal_error",
71 "KCemu: call to UI_Base::get_real_width() while width is still 0!\n"));
72 abort();
73 }
74 return _width;
75 }
76
77 int
get_real_height(void)78 UI_Base::get_real_height(void) {
79 if (_height == 0) {
80 DBG(0, form("KCemu/internal_error",
81 "KCemu: call to UI_Base::get_real_height() while height is still 0!\n"));
82 abort();
83 }
84 return _height;
85 }
86
87 void
generic_signal_v_retrace(bool value)88 UI_Base::generic_signal_v_retrace(bool value) {
89 }
90
91 int
generic_get_mode(void)92 UI_Base::generic_get_mode(void) {
93 return 0;
94 }
95
96 void
generic_set_mode(int mode)97 UI_Base::generic_set_mode(int mode) {
98 }
99