summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Smith2010-09-10 12:47:20 -0700
committerDuncan Smith2010-09-10 12:47:20 -0700
commit9720a70bb6ca148cd7e333049a74cb86792ee79b (patch)
tree1318faa95afa7f690309906c12275659a400316f
parent1af22b5bca4179bdac09b2d3c2cff07bc92d5d8f (diff)
Added stubs for putting the emulated screen into a TIOS-drawn window.
-rw-r--r--loader.c6
-rw-r--r--main.asm9
-rw-r--r--video.c18
3 files changed, 33 insertions, 0 deletions
diff --git a/loader.c b/loader.c
index 75654f4..fffd7fb 100644
--- a/loader.c
+++ b/loader.c
@@ -20,6 +20,7 @@ char writestr[16] = { 0x3E, 0x41, // LD A,'A'
};
void init_load(void);
+void unload(void);
void *deref_page(int);
void close_pages(void);
@@ -74,6 +75,11 @@ void init_load(void)
}
+void unload(void)
+{
+ return;
+}
+
/* Turns a page number into a pointer to a page. Returns NULL if not
* found, throws an error in other cases.
*/
diff --git a/main.asm b/main.asm
index 8c93f9c..b765fd3 100644
--- a/main.asm
+++ b/main.asm
@@ -49,9 +49,15 @@
__main:
movem.l d0-d7/a0-a6,-(sp)
bsr init_load
+ bsr display_setup
+
bsr emu_setup
lea emu_plain_op,a5
bsr emu_run
+ bsr emu_teardown
+
+ bsr display_teardown
+ bsr unload
movem.l (sp)+,d0-d7/a0-a6
rts
@@ -71,6 +77,9 @@ emu_setup:
rts
+emu_teardown:
+ rts
+
;; ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;; _ __ ___ ___ _ __ ___ ___ _ __ _ _ |||||||||||||||||||||||||||
diff --git a/video.c b/video.c
index 21ae989..1d9d0a3 100644
--- a/video.c
+++ b/video.c
@@ -5,6 +5,8 @@
*/
#include <graph.h>
+#include <wingraph.h>
+#include <alloc.h>
#define VIDEO_ROWMODE 0x01
@@ -28,11 +30,27 @@ char video_busy; // Always 0
char video_cur_row;
char video_cur_col;
+WINDOW *screen_window;
+
void video_write(char);
char video_read(void);
void *video_compute_address(void);
int video_compute_shift(void);
+void display_setup(void)
+{
+ screen_window = HeapAllocPtr(sizeof(WINDOW));
+ WinOpen(screen_window, MakeWinRect(10, 10, 106, 74), WF_SAVE_SCR | WF_TTY | WF_ROUNDEDBORDER | WF_TITLE, "TI-83+ Emulator");
+ WinActivate(screen_window);
+ return;
+}
+
+void display_teardown(void)
+{
+ WinClose(screen_window);
+ HeapFreePtr(screen_window);
+}
+
void video_write(char data)
{
int shift = video_compute_shift();