VDC Mouse Pointer routine?

Started by mikeebean, June 25, 2010, 08:29 AM

Previous topic - Next topic

0 Members and 4 Guests are viewing this topic.

mikeebean

I've written a BASIC program which uses the 80-column screen, and I'd really like to be able to add mouse support. In the past I used the mouse in joystick mode and had a little reversed square move around the screen. This was a terrible hassle for the user and slowed down my program immensely, to the point where I abandoned it at the thought of going back to 40-columns.

Does anyone know of any existing ML routines that would facilitate a mouse pointer for me? I'm a beginning ML programmer, and the idea of trying my hand at the VDC is nightmarish! Thanks for any advice!

Michael

PS. I might even consider using the 40-column screen with 80-column emulation if it's the only way to get that mouse pointer! But I know this tends to be illegible. Or maybe there's a cartridge/add-on that will do it?

BigDumbDinosaur

You didn't indicate if you are running the VDC in text or bitmap mode.  If the former, you are limited in what you can do for a mouse pointer, as it has to either be one of the standard characters defined in video RAM (VRAM) or a redefinition of one character to act as the pointer.

If you are running the display in bitmap mode, then it's a matter of developing an arrow shape and working out an algorithm to move it about.  Either case, it's not going to be a trivial thing to implement.  BTW, have you taken a look at BASIC 8?
x86?  We ain't got no x86.  We don't need no stinking x86!

mikeebean

#2
Bitmap mode is likely to be outside my comfort level, unless there's a routine for putting up text. The program I have is simple BASIC, and I'm pretty much relying on pre-built routines for anything involving VDC assembly. Thank you for the reminder on BASIC 8, I've heard it mentoned many times, but never put much thought into it. I'll certainly check it out.

Michael

EDIT: It looks as if BASIC 8 isn't readily available to check out, it looks like I'll just have to stick to the reversed character routine for a bit longer!

RobertB

Quote from: mikeebean on June 27, 2010, 12:43 PMIt looks as if BASIC 8 isn't readily available to check out...
Some of, if not all of, Basic 8 is at  http://ftp.pokefinder.org

             Writing from Portland, Oregon,
             Robert Bernardo
             Fresno Commodore User Group
             http://videocam.net.au/fcug
             July 24-25 Commodore Vegas Expo v6 - http://www.portcommodore.com/commvex

airship

#4
BASIC 8's @CHAR command lets you print characters to the 80-column bitmap screen. The supplemental BASIC 8 Toolkit disk allows you to create and implement your own mouse pointers.

You'll want the BASIC 8 manual, How to get the Most Out of BASIC 8 book, and BASIC 8 Toolkit manual, as well.

As for BASIC 8 itself, the best way to get it is to buy Dan's Megabit ROM for the C128's internal ROM socket. Then search for various BASIC 8 demos on Commodore web sites. The GENIE archive has a nice assortment.

It's a fantastic product, probably the best commercial product ever released for the C128.

Edit: Here's a sample mouse/pointer routine from the BASIC 8 manual:

10 TRAP 140:REM PRESS RUN/STOP KEY TO EXIT PROGRAM
20 @WALRUS,O:REM 16K MODE
30 @MODE,O:REM USE MODE 0 SCREENS
40 @SCREEN,O:REM USE SCREEN 0, MONOCHROME
50 @COLOR,0,4,0:REM SET COLOR
60 @CLEAR,O:REM CLEAR SCREEN
70 @DRWMODA,1,0,0,0,0,0,0:@DRWMODB,0,0,0:REM JAM 1 MODE
80 MX=320:MY=100:REM INITIAL X,Y
85 OX=MX:OY=MY:REM SAVE VALUES
90 @MOUSE, 1,0,MX,MY:REM USE 1351 MOUSE
100 @PTR, 1,MX,MY,O:REM USE ARROW POINTER (0) AT MX,MY
110 MX=@MOUSE,2,0:MY=@MOUSE,2,1:REM FIND NEW MX,MY
115 IF MX=OX AND MY=OY THEN GOTO 110:REM ANY MOVEMENT?
120 @PTR,1,MX,MY,O:REM REP0SITION POINTER AT NEW MX,MY
125 OX=MX:OY=MY:REM UPDATE OLD VALUES
130 GOTO 110:REM CONTINUE TO CHECK FOR MOVEMENT
140 @PTR,O:@MOUSE,O:REM TURN OFF POINTER AND MOUSE READER
150 @TEXT:REM RETURN TO TEXT MODE

Serving up content-free posts on the Interwebs since 1983.
History of INFO Magazine

mikeebean

Thank you guys for all of this info! I will look at the manuals on Pokefinder, and look up Dan's Megabit ROM. I'll post again if/when I get further along on my project.

mikeebean

BASIC 8 is very nice! Printing text to the bitmap screen is a bit awkward, but more versatile. It's well worth it for the mouse pointer aspect. The manual is a bit difficult, I had to play around to figure out how to print variables. BASIC 8 might do the trick for me!

mikeebean

#7
BASIC 8 is a neat add-on with potential, but for this particular project, it's turning out to be cumbersome. Maybe it's me, but rewriting the program is slowing it down a lot. Not sure if it's BASIC 8 or my method. I'm assigning each bit of text to a string variable and sending it to a routine to print to the screen. The real problem is dynamic keyboard input. It really needs assembly to be workable, and I'm just too green in 128 assembly.

Having recently discovered that I'm actually capable of making *working* GEOS programs, I might shelve the BASIC language version for now. I know, I know, but I enjoy GEOS when kept in its proper perspective. Yeah it's kinda clunky and slow (like my BASIC 8 version is becoming,) but it lets me concentrate on the application's purpose instead of printing and input routines, plus I can still use the mouse. I could just go do it on a PC, but it's more fun on a Commodore!

Michael

RobertB

Quote from: mikeebean on July 17, 2010, 09:44 AM...I enjoy GEOS when kept in its proper perspective. Yeah it's kinda clunky and slow...
If you have a Turbomaster CPU (for 64 mode) or a SuperCPU, GEOS is much faster.  :)

            Back from the United Kingdom,
            Robert Bernardo
            Fresno Commodore User Group
            http://videocam.net.au/fcug
            July 24-25 Commodore Vegas Expo 2010 - http://www.portcommodore.com/commvex

mikeebean

Robert-

I'd love a Super CPU! My birthday is in December!   ;D

Michael

marquisor

Are there special GEOS development kits available?
preserve what you deserve

RobertB

     There is GeoProgrammer and the improved version, Concept.

            Back from the United Kingdom,
            Robert Bernardo
            Fresno Commodore User Group
            http://videocam.net.au/fcug
            July 24-25 Commodore Vegas Expo 2010 - http://www.portcommodore.com/commvex

mikeebean

GeoProgrammer is really nice. Concept is for Wheels, not sure if applications assembled with Concept will work in GEOS. You write the apps in geoWrite and assemble/link them with geoProgrammer or Concept. GeoWrite is a pain to code in at first, but it's not too bad when you get the hang of it.

I can only find the geoProgrammer 64 disk image, and some patches to make it 128 compatible. I don't know how the patched version compares to the 128 version or if there ever was a 128 version released. So far I've had no problems, except for the whole 40/80 thing. Still trying to figure that one out.

Michael

RobertB

Quote from: mikeebean on July 18, 2010, 11:48 AM
GeoProgrammer is really nice. Concept is for Wheels, not sure if applications assembled with Concept will work in GEOS.
GeoStereoSID Player was written in Concept, but it works both in GEOS and in Wheels.  Concept is supposed to be very compatible.
QuoteI can only find the geoProgrammer 64 disk image, and some patches to make it 128 compatible. I don't know how the patched version compares to the 128 version or if there ever was a 128 version released.
A 128 version was never released, but look at

          http://www.commodore128.org/index.php?topic=2178.0

                Packing for Las Vegas and CommVEx,
                Robert Bernardo
                Fresno Commodore User Group
                http://videocam.net.au/fcug
                July 24-25 Commodore Vegas Expo 2010 - http://www.portcommodore.com/commvex


RobertB

Quote from: marquisor on July 17, 2010, 04:24 PM
Are there special GEOS development kits available?
Oh... and there is GeoCom.  You can find it at

          http://ftp.pokefinder.org/index.php?s=geocom&m=0&h=100

                Packing for Las Vegas and CommVEx,
                Robert Bernardo
                Fresno Commodore User Group
                http://videocam.net.au/fcug
                July 24-25 Commodore Vegas Expo 2010 - http://www.portcommodore.com/commvex