From ea32400df4d9b55015dce1c7128b7bc948b05616 Mon Sep 17 00:00:00 2001 From: uz Date: Sun, 1 May 2011 17:04:30 +0000 Subject: [PATCH] Removed two extra bytes from the TGI driver's header. Added "tgi_colors.s" and a missing mouse-driver support file. Added driver-module rules to the make-file. All changes by Greg King. git-svn-id: svn://svn.cc65.org/cc65/trunk@5004 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/geos/devel/Makefile | 24 +++++++++-- libsrc/geos/devel/geos-tgi.s | 72 +++++++++++++++----------------- libsrc/geos/devel/mcbdefault.s | 68 ++++++++++++++++++++++++++++++ libsrc/geos/devel/mouse_stddrv.s | 11 +++++ libsrc/geos/devel/tgi_colors.s | 8 ++++ 5 files changed, 140 insertions(+), 43 deletions(-) create mode 100644 libsrc/geos/devel/mcbdefault.s create mode 100644 libsrc/geos/devel/mouse_stddrv.s create mode 100644 libsrc/geos/devel/tgi_colors.s diff --git a/libsrc/geos/devel/Makefile b/libsrc/geos/devel/Makefile index bb5c4d719..53db0fb78 100644 --- a/libsrc/geos/devel/Makefile +++ b/libsrc/geos/devel/Makefile @@ -1,11 +1,11 @@ +# -*- make -*- # # Makefile for GEOS lib # for cc65 # -# %.o: %.s - @$(AS) -o $@ $(AFLAGS) $< + @$(AS) -g -o $@ $(AFLAGS) $< %.emd: %.o ../../runtime/zeropage.o @$(LD) -o $@ -t module $^ @@ -13,6 +13,12 @@ %.joy: %.o ../../runtime/zeropage.o @$(LD) -o $@ -t module $^ +%.mou: %.o ../../runtime/zeropage.o + @$(LD) -o $@ -t module $^ + +%.ser: %.o ../../runtime/zeropage.o + @$(LD) -o $@ -t module $^ + %.tgi: %.o ../../runtime/zeropage.o @$(LD) -o $@ -t module $^ @@ -21,9 +27,12 @@ S_OBJS = crt0.o \ fio_module.o \ joy_stddrv.o \ mainargs.o \ + mcbdefault.o \ + mouse_stddrv.o \ oserror.o \ oserrlist.o \ randomize.o \ + tgi_colors.o \ tgi_mode_table.o #-------------------------------------------------------------------------- @@ -33,9 +42,16 @@ EMDS = geos-vdc.emd JOYS = geos-stdjoy.joy +MOUS = #geos-stdmou.mou + +SERS = + TGIS = geos-tgi.tgi -all: $(S_OBJS) $(EMDS) $(JOYS) $(TGIS) +all: $(S_OBJS) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS) + +../../runtime/zeropage.o: + $(MAKE) -C $(dir $@) $(notdir $@) clean: - @$(RM) *.~ core $(S_OBJS) $(EMDS:.emd=.o) $(JOYS:.joy=.o) $(TGIS:.tgi=.o) + @$(RM) *.~ core $(S_OBJS) $(EMDS:.emd=.o) $(JOYS:.joy=.o) $(MOUS:.mou=.o) $(SERS:.ser=.o) $(TGIS:.tgi=.o) diff --git a/libsrc/geos/devel/geos-tgi.s b/libsrc/geos/devel/geos-tgi.s index a53d34ad6..fa5a326b2 100644 --- a/libsrc/geos/devel/geos-tgi.s +++ b/libsrc/geos/devel/geos-tgi.s @@ -1,7 +1,7 @@ ; -; Graphics driver for the 320x200x2 or 640x200x2 mode on GEOS 64/128 -; Maciej 'YTM/Elysium' Witkowiak -; 28-31.12.2002 +; Graphics driver for the 320x200x2 and 640x200x2 modes on GEOS 64/128 +; 2010-08-17, Maciej 'YTM/Elysium' Witkowiak +; 2010-08-18, Greg King .include "zeropage.inc" @@ -19,8 +19,8 @@ ; ------------------------------------------------------------------------ ; Constants -VDC_ADDR_REG = $D600 ; VDC address -VDC_DATA_REG = $D601 ; VDC data +VDC_ADDR_REG := $D600 ; VDC address +VDC_DATA_REG := $D601 ; VDC data VDC_DSP_HI = 12 ; registers used VDC_DSP_LO = 13 @@ -38,8 +38,8 @@ VDC_DATA = 31 .segment "JUMPTABLE" -; First part of the header is a structure that has a magic and defines the -; capabilities of the driver +; First part of the header is a structure that has a magic signature, +; and defines the capabilities of the driver. .byte $74, $67, $69 ; "tgi" .byte TGI_API_VERSION ; TGI API version number @@ -49,36 +49,36 @@ yres: .word 200 ; Y resolution pages: .byte 1 ; Number of screens available .byte 8 ; System font X size .byte 8 ; System font Y size - .res 4, $00 ; Reserved for future extensions - -; Next comes the jump table. Currently all entries must be valid and may point -; to an RTS for test versions (function not implemented). - - .word INSTALL - .word UNINSTALL - .word INIT - .word DONE - .word GETERROR - .word CONTROL - .word CLEAR - .word SETVIEWPAGE - .word SETDRAWPAGE - .word SETCOLOR - .word SETPALETTE - .word GETPALETTE - .word GETDEFPALETTE - .word SETPIXEL - .word GETPIXEL - .word LINE - .word BAR - .word TEXTSTYLE - .word OUTTEXT - .word 0 ; IRQ entry is unused + .word $100 ; Aspect ratio: 1.0 + +; Next comes the jump table. With the exception of IRQ, all entries must be +; valid, and may point to an RTS for test versions (function not implemented). + + .addr INSTALL + .addr UNINSTALL + .addr INIT + .addr DONE + .addr GETERROR + .addr CONTROL + .addr CLEAR + .addr SETVIEWPAGE + .addr SETDRAWPAGE + .addr SETCOLOR + .addr SETPALETTE + .addr GETPALETTE + .addr GETDEFPALETTE + .addr SETPIXEL + .addr GETPIXEL + .addr LINE + .addr BAR + .addr TEXTSTYLE + .addr OUTTEXT + .addr 0 ; IRQ entry is unused ; ------------------------------------------------------------------------ ; Data. -; Variables mapped to the zero page segment variables. Some of these are +; Variables mapped to the zero-page segment variables. Some of these are ; used for passing parameters to the driver. X1 = ptr1 @@ -99,12 +99,6 @@ BITMASK: .res 1 ; $00 = clear, $01 = set pixels OLDCOLOR: .res 1 ; colors before entering gfx mode -; Line routine stuff - -OGora: .res 2 -OUkos: .res 2 -Y3: .res 2 - ; Text output stuff TEXTMAGX: .res 1 TEXTMAGY: .res 1 diff --git a/libsrc/geos/devel/mcbdefault.s b/libsrc/geos/devel/mcbdefault.s new file mode 100644 index 000000000..665cc426e --- /dev/null +++ b/libsrc/geos/devel/mcbdefault.s @@ -0,0 +1,68 @@ +; +; Mouse callbacks for GEOS. +; +; GEOS has a built-in mouse architecture. Half of this file does nothing +; -- it exists merely to allow portable programs to link and run. +; +; 2.7.2001, Maciej 'YTM/Elysium' Witkowiak +; 2004-03-20, Ullrich von Bassewitz +; 2004-09-24, Greg King +; + +; .constructor init_pointer + .export _mouse_def_callbacks + +; .include "mouse-kernel.inc" +; .include "../inc/const.inc" +; .include "../inc/geossym.inc" + .include "../inc/jumptab.inc" + +; .macpack generic + +; The functions below must be interrupt-safe, +; because they might be called from an interrupt-handler. + +.code + +; -------------------------------------------------------------------------- +; Hide the mouse pointer. Always called with interrupts disabled. + +hide := MouseOff + +; -------------------------------------------------------------------------- +; Show the mouse pointer. Always called with interrupts disabled. + +show := MouseUp + +; -------------------------------------------------------------------------- +; Move the mouse pointer X position to the value in .XA. Always called with +; interrupts disabled. + +.proc movex + + rts + +.endproc + +; -------------------------------------------------------------------------- +; Move the mouse pointer Y position to the value in .XA. Always called with +; interrupts disabled. + +.proc movey + + rts + +.endproc + +; -------------------------------------------------------------------------- +; Callback structure + +.rodata + +_mouse_def_callbacks: + .addr hide + .addr show + .addr movex + .addr movey + + diff --git a/libsrc/geos/devel/mouse_stddrv.s b/libsrc/geos/devel/mouse_stddrv.s new file mode 100644 index 000000000..8792c27f0 --- /dev/null +++ b/libsrc/geos/devel/mouse_stddrv.s @@ -0,0 +1,11 @@ +; +; Name of the standard mouse driver +; +; 2010-01-25, Greg King +; +; const char mouse_stddrv[]; +; + .export _mouse_stddrv + + .rodata +_mouse_stddrv: .asciiz "geos-stdmou.mou" diff --git a/libsrc/geos/devel/tgi_colors.s b/libsrc/geos/devel/tgi_colors.s new file mode 100644 index 000000000..d965e6ff3 --- /dev/null +++ b/libsrc/geos/devel/tgi_colors.s @@ -0,0 +1,8 @@ +; +; Target-specific black & white values, for use by the target-shared TGI kernel +; + + .include "tgi-kernel.inc" + +tgi_color_black = $00 +tgi_color_white = $01 -- 2.39.5