QBasic and QB64 Discussion Board

[QB Forum Archives (1999-2009)/ ] [QB FAQ] [QB Links and Downloads] [Subforums and Chat Room] [Search]

QB64.Net Homepage   QB/QB64 Keywords   QB Graphics Forum   Homework Policy



full screen with qb64 on windows 7

by (no login)

how do you get to full screen with qb64 with windows 7

Posted on Jul 2, 2010, 11:51 AM

Respond to this message   

Return to Index


What problems you having? Ask here....QB64 (LINK)

by (Login burger2227)
R



    
This message has been edited by burger2227 on Jul 2, 2010 2:33 PM
This message has been edited by burger2227 on Jul 2, 2010 2:32 PM

Posted on Jul 2, 2010, 2:31 PM

Respond to this message   

Return to Index


* Alt + Enter keyboard combination doesn't work?

by Ben (no login)

Posted on Jul 2, 2010, 3:06 PM

Respond to this message   

Return to Index


Full screen is NOT supported by Vista or Windows 7.

by Solitaire (no login)

I don't know about QB64 on Vista or Windows 7, since I'm still using Windows XP, which does support full screen mode. Old 16-bit software (such as QB) can go to full screen with Alt-Enter, but the newer OSs no longer support 16-bit software.

Maybe someone else can explain the technicalities behind it.

If you press Alt-Enter on Vista (or Windows 7) it will tell you "No Way" (in a lot more words than that). I think QB64 tries to emulate the old functions but inside the allowed window mode. I'm not sure if it currently supports the blinking text, as I described in a previous post. Check the QB64 sub-forum for more information.

Posted on Jul 2, 2010, 3:11 PM

Respond to this message   

Return to Index


* QB 64 supports blinking text and full screen text and graphics windows in XP to 7.

by (Login The-Universe)
Admin

Posted on Jul 3, 2010, 8:19 AM

Respond to this message   

Return to Index


Two ways...

by (Login qb432l)
R

Either include at the top of your code, the command _FULLSCREEN, or when the program is running, press Alt+Enter. I have Windows 7 and know that either of these methods works fine.

-Bob



    
This message has been edited by qb432l on Jul 2, 2010 7:14 PM

Posted on Jul 2, 2010, 7:07 PM

Respond to this message   

Return to Index


I will add this for problem situations...

by (Login The-Universe)
Admin

Some monitors will reject the initial Alt+ Enter key press and display an "out of rage" message. If this is what you are experiencing, just wait until that message appears and press Alt + Enter again. It will then go to full screen. Unfortunately, the QB64 _FULLSCREEN command fails on these types of monitors. sad.gif

Pete

Posted on Jul 3, 2010, 9:32 AM

Respond to this message   

Return to Index


The program should check the _FULLSCREEN function

by (Login burger2227)
R

The _FULLSCREEN function returns the present mode setting of the screen window.


Syntax:

full = FULLSCREEN

Returns:

0 = _OFF (any non-0 value means fullscreen is on)
1 = _STRETCH
2 = _SQUAREPIXELS

Note: It cannot be assumed that calling _FULLSCREEN will succeed. It cannot be assumed that the type of full screen will match the requested one. So, always check the _FULLSCREEN function.


Warning: Despite your software, the user's hardware, drivers and monitor may not function in some modes. Thus, it is highly recommended that you manually confirm with the user whether the switch to full screen was successful. This can be done "quietly" in some cases by getting the user to click on a button on screen with their mouse or press an unusual key. If the user does not respond after about 8 seconds, switch them back to windowed mode.

Posted on Jul 3, 2010, 10:57 AM

Respond to this message   

Return to Index


Odd question perhaps, but it is Forum itself managed by QBasic code?

by (Login QootyKev)

I am a bit 'deer-in-headlights' over the novel format of this messageboard, with its old tree-style threads and spartan appearance.

Was wondering if maybe the pages are generated by a QBasic program out of novelty?

Posted on Jul 1, 2010, 5:08 PM

Respond to this message   

Return to Index


* sorry, "is this forum", not "it is forum"

by (Login QootyKev)

Posted on Jul 1, 2010, 5:08 PM

Respond to this message   

Return to Index


* Naw Pete is still stuck in SCREEN 0!

by (Login burger2227)
R

Posted on Jul 1, 2010, 5:15 PM

Respond to this message   

Return to Index


* This is a commonly used Network54.com forum format. They ain't/aint fancy.

by (Login The-Universe)
Admin

Posted on Jul 1, 2010, 6:02 PM

Respond to this message   

Return to Index


* ahh ok, thanks! i'm not afraid to try old things

by (Login QootyKev)

Posted on Jul 1, 2010, 6:46 PM

Respond to this message   

Return to Index


*I believe it's either, "Them isn't fancy", or "Them aren't not fancy".

by (Login qb432l)
R

*

Posted on Jul 2, 2010, 7:10 PM

Respond to this message   

Return to Index


*What an interesting idea...

by (no login)

Posted on Jul 1, 2010, 11:50 PM

Respond to this message   

Return to Index


It's been done already...

by (Login The-Universe)
Admin


Arteleus put up a mock QBasic Forum based on a QB model, and before that, qbguy made one that used QB with CGI.

Pete

Posted on Jul 2, 2010, 3:07 AM

Respond to this message   

Return to Index


* Well Pete, nobody has done a page in SCREEN 0. Give it a shot...

by (Login burger2227)
R

Posted on Jul 2, 2010, 4:26 AM

Respond to this message   

Return to Index


PHP actually (*URL)

by (Login Mikrondel)
Moderator

http://qbforum.dreamhosters.com/

Took me several hours.

And there's no reason why a QB program *couldn't* generate a more modern-looking forum. But a QB64 forum, now that's an idea...

Posted on Jul 2, 2010, 7:32 PM

Respond to this message   

Return to Index


QB64 TCP/IP would make it more doable...

by (Login The-Universe)
Admin


And it is pretty easy to generate the pages into HTLM and use HTML forms to send the posts back to the QB64 program to be processed. Security would be the trick. As much fun as it would be to set up a QB64 forum made with QB64, it wouldn't be worth the Notepad it's written on if it wasn't secure.

Anyway, imagination at work, and maybe something will come of this thread in the near future. I'll certainly be supportive of any and all ideas that lead to the eventual and successful merger of the QBasic Forum and the QB64 Forum; but all of us need to see how we feel about that concept.

Pete

Posted on Jul 2, 2010, 8:36 PM

Respond to this message   

Return to Index


Security?

by (Login Mikrondel)
Moderator

All you need is someone experienced to keep an eye on the code, and regular off-site backups. That gives you enough security to make a successful attack quite unlikely, and the ability to recover from one. If worst comes to worst you could change web host, which you can't really do with Network54.

Posted on Jul 2, 2010, 9:05 PM

Respond to this message   

Return to Index


Yeah, you make that sound easy, but it's not.

by (Login The-Universe)
Admin

All the additions to a forum that involve registration, email notification, backups, etc., etc., etc., takes gobs and gobs of extra coding.

I'll edit in that a doable option would be to use third party backup and email notification software and piggyback as much work as posible to HTML and Javascript, but then you have to ask yourself how mucj of it is really a QB64 accomplishment?

Pete

PS 1 gob = 1000 mob.



    
This message has been edited by The-Universe on Jul 3, 2010 8:21 AM

Posted on Jul 3, 2010, 8:13 AM

Respond to this message   

Return to Index


*Well now you're just tempting me

by (Login Mikrondel)
Moderator

Posted on Jul 4, 2010, 12:57 AM

Respond to this message   

Return to Index


* Well the word for the day is... pot stirring. :)

by (Login The-Universe)
Admin

Posted on Jul 4, 2010, 4:13 AM

Respond to this message   

Return to Index


Vista and the first character of a SHELL "DIR report

by (Login QootyKev)

Hiyas

Regardless of what anyone says about Vista, I have numerous reports of people ABLE TO GET IT TO RUN my QBasic program. Many cannot, but some can. no DOSBox, no nuffin, just downloaded OLDDOS.EXE, probably AUTOEXEC.NT and ran QBASIC via a batch file.

Every now and then, though, I get this report. They can run it, all is smooth, until the program is checking for other files and/or directories on the drive.

The following code exists within one part of Qooty:

=====================================
SHELL "dir *.* /b > temp.tmp"

FoundUtils% = 0
FoundData% = 0
FoundComments% = 0
OPEN "temp.tmp" FOR INPUT AS #1
WHILE EOF(1) = 0
LINE INPUT #1, dummy$
IF UCASE$(dummy$) = "UTILS" THEN FoundUtils% = 1
IF UCASE$(dummy$) = "DATA" THEN FoundData% = 1
IF UCASE$(dummy$) = "COMMENTS" THEN FoundComments% = 1
WEND
CLOSE #1
KILL "temp.tmp"

ThreeDirs% = FoundUtils% + FoundData% + FoundComments%

IF ThreeDirs% IF FoundComments% = 0 THEN ErrorMessage$ = "Program Files Missing (COMMENTS folder)."
IF FoundData% = 0 THEN ErrorMessage$ = "Program Files Missing (DATA folder)."
IF FoundUtils% = 0 THEN ErrorMessage$ = "Program Files Missing (UTILS folder)."

OPEN "ErrorLog.dat" FOR APPEND AS #1
PRINT #1, "Something's missing ..."
PRINT #1, "Comments folder count : "; FoundComments%
PRINT #1, "Data folder count : "; FoundData%
PRINT #1, "Utils folder count : "; FoundUtils%
CLOSE #1

GOTO ShowErrorMessage

END IF
=====================================

The error message gives them the following :

-----------------
Something's missing ...
Comments folder count : 0
Data folder count : 0
Utils folder count : 0

Contents of directory :
??????.
. ?????.
OMMENTS.
ATA ???.
RRORLOG.AT
AME ???.AS
ENU ???.AS
LDDOS ?.XE
??????.AT
BASIC ?.XE
BASIC ?.LP
EMP ???.MP
TILS ??.

This log created 06-30-2010
Error type - Program Files Missing (UTILS folder).
-------------------------

They confirm that they haven't removed the first letter from all the files, but JUST LOOK AT IT!!! rofl

Every file name, and every extension, and every file name, has the first character removed! I keep looking for a scroll bar!

On top of that, its inserting query marks.

Has anyone seen this? Have they seen a solution?

I know the general rule is "well, Vista doesn't support it". But it supports it for some of these folks so far as any prog that doesn't require accessing other files.

Just desperate. happy.gif

Thanks!

Kev

Posted on Jun 30, 2010, 5:44 AM

Respond to this message   

Return to Index


64-bit Vista SUCKS... but a 32-bit Vista OS will run QB....

by (Login The-Universe)
Admin

But it still SUCKS!

Anyway, problems caused by M$ when they change operating systems include the command line DIR feature and the way it displays the data. 98 and XP are quite different, and I can't rmember the differences, it any, between XP and Vista. My point is that checking the file generated by the DIR SHELL would be the place to start your investigation.

A possible shortcut solution would be to try:

SHELL "cmd /c dir *.* /b > temp.tmp"

I have to admit your example looks weird, as if the SHELL dir is chopping off the first letter and replacing some parts of the returned files with wildcards. That I've never seen before.

If all else fails, you may need to write your own custom DIR function. It can be done with interrupts, and there is some stuff on the forum by Plasma, somewhere, that doea that; however, it too was made for pre-XP operating systems.

I suppose another solution would be to use error trapping instead of SHELL dir to see if those files you are hunting for exist.

Good luck,

Pete

Posted on Jun 30, 2010, 9:57 AM

Respond to this message   

Return to Index


Thanks Pete ... I just remembered where I'd seen it before ...

by (Login QootyKev)

The first letter missing from the files and extensions was familiar to me.

I just remembered it happened when I attempted to run the same program on a Mac using DOSBox!

There's an oddity!

Thanks for your response! I have searched google all over and had just found the cmd /c which I have now asked a guinea pig with Vista to try. Someone, somewhere, says it can work! I'd never heard of cmd /anything until tonight ...

I didn't know there could be 32 or 64 bit Vistas ... can you give me a quick briefing on how someone can determine which bittage their Vista is?

And yeah, maybe I should employ better file exist checks happy.gif I know there's better ones, you guys have shown me not too long ago :D

Posted on Jun 30, 2010, 10:28 AM

Respond to this message   

Return to Index


Re: Thanks Pete ... I just remembered where I'd seen it before ...

by (Login The-Universe)
Admin

http://support.microsoft.com/kb/827218

Of course, an easier way is to try to run QB. If it runs, it's 32-bit OS and if it fails, it is 64.

I think there are some Windows 7 / 32-OS systms in some netbooks, too. Anyway, the fact that 32-bit OS's are soon to be gone the way of the dinosaur is apparent, and this is way I recommend converting QB programs to QB64.

Pete

Posted on Jun 30, 2010, 11:07 AM

Respond to this message   

Return to Index


Thanks again, I'm gonna start compiling some demographics from the guinea pigs

by (Login QootyKev)

I'll use that Microsoft link on 'em, thanks.

Running QB ... yeah, but there's people keep coming up with new ways to fail simple instructions, so I might get reports of QB not working when it actually would work fine had they not been fools.

Re QB64, yeah, I've tried it, but it doesn't like my program very much. Its taken me 18 years to get it where it is, and I don't fancy another 18 rewriting the whole sam hill thing happy.gif

Will try every now and then, though.

Posted on Jun 30, 2010, 10:26 PM

Respond to this message   

Return to Index


Re: QB64 doesn't like my program much...

by (Login qb432l)
R

How long ago did you try it? In its current release, it is virtually 100% compatible with QB code. Might be worth another look.

-Bob

Posted on Jul 1, 2010, 2:57 PM

Respond to this message   

Return to Index


* About two or three months ago

by (Login QootyKev)

Posted on Jul 1, 2010, 4:59 PM

Respond to this message   

Return to Index


*QB64 has been 99.99% QB compatible since January of this year. Might work now.

by (Login qb432l)
R

*

Posted on Jul 1, 2010, 8:03 PM

Respond to this message   

Return to Index


* Thanks, I'll give it another burl!

by (Login QootyKev)

Posted on Jul 1, 2010, 8:15 PM

Respond to this message   

Return to Index


Nah same deal

by (Login QootyKev)

I still can't get QB64 to understand my program ... I think I am just too archaic.

Posted on Jul 1, 2010, 8:59 PM

Respond to this message   

Return to Index


32-bit Vista yay ... cmd /c fixed everything!

by (Login QootyKev)

Fantastic, just worked out that my prog will work fine on Vista if a) its 32-bit (thanks Pete) and b) all my SHELL commands start with "cmd /c"

Ecstatic!

Posted on Jul 1, 2010, 7:01 AM

Respond to this message   

Return to Index


* You're/your weclome. Happy coding.

by (Login The-Universe)
Admin

Posted on Jul 1, 2010, 10:30 AM

Respond to this message   

Return to Index


* "You're welcome" is correct.

by Solitaire (no login)

Posted on Jul 1, 2010, 10:58 AM

Respond to this message   

Return to Index


* Yes, I know/no.

by (Login The-Universe)
Admin

Posted on Jul 1, 2010, 11:42 AM

Respond to this message   

Return to Index


*"You're" is correct, "weclome" is a know-no.

by (Login qb432l)
R

*

Posted on Jul 1, 2010, 8:07 PM

Respond to this message   

Return to Index


Determining when an OS requires CMD /C .

by (Login burger2227)
R

FUNCTION CMD$
OS$ = ENVIRON$("OS") ' OS$ can be DIM SHARED in main program if needed
IF LEN(OS$) THEN CMD$ = "CMD /C " ELSE CMD$ = "COMMAND /C "
END FUNCTION


SHELL CMD$ + "start /min notepad /p " + filename$ 'prints file

Posted on Jul 1, 2010, 12:59 PM

Respond to this message   

Return to Index


There's some stuff I'd never seen before!

by (Login QootyKev)

Thanks Clippy!

Now, any idea what a few of these might look like?

Mine says Windows_NT

What would people with Vista (32- and 64-bit) get returned?

Posted on Jul 1, 2010, 4:44 PM

Respond to this message   

Return to Index


There are 2 ways to read settings.

by (Login burger2227)
R

'You can use ENVIRON$ to find out a lot of things, like the PC username:

CLS : s = 1
COLOR 11: LOCATE 2, 27: PRINT "DOS Environment Variables": PRINT
DO WHILE ENVIRON$(s) <> ""
COLOR 14: PRINT s; ENVIRON$(s)
s = s + 1
IF s MOD 20 = 0 THEN
LOCATE 24, 25: PRINT "Press Any Key to continue!";
DO: SLEEP: LOOP UNTIL INKEY$ <> ""
CLS
COLOR 11: LOCATE 2, 27: PRINT "DOS Environment Variables": PRINT
END IF
LOOP
COLOR 11: LOCATE 24, 2: PRINT "End of list! Press Any Key!"
DO: SLEEP: LOOP UNTIL INKEY$ <> ""

'You can use the value string names listed to pick which setting to return.

CLS
Prompt$ = ENVIRON$("PROMPT")
User$ = ENVIRON$("USERNAME")
Puter$ = ENVIRON$("COMPUTERNAME")
OpSys$ = ENVIRON$("OS")
Blaster$ = ENVIRON$("BLASTER")
COLOR 14: LOCATE 15, 25: PRINT "DOS Prompt = "; Prompt$
LOCATE 16, 25: PRINT " User Name = "; User$
LOCATE 17, 25: PRINT " Computer = "; Puter$
LOCATE 18, 25: PRINT "OS Version = "; OpSys$
LOCATE 19, 25: PRINT " Blaster = "; Blaster$


'I don't know what VISTA or 7 will return, but Win 9x return little.

'Ted



    
This message has been edited by burger2227 on Jul 1, 2010 6:13 PM

Posted on Jul 1, 2010, 5:10 PM

Respond to this message   

Return to Index


Or you could use interrupt 21 like normal people

by Ben (no login)

And forget about all this incompatibility and temporary files. And enjoy the speed increase and felxibility.


Look at example #3
http://support.microsoft.com/kb/41447


Here I wrote a program for QBasic 1.1 based on this method.
http://www.network54.com/Forum/648955/thread/1263963711/Explorer

Posted on Jul 1, 2010, 6:35 PM

Respond to this message   

Return to Index


Thanks Ben ... yikes though ...

by (Login QootyKev)

Thanks very much Ben, interesting stuff, but unfortunately it looks wayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy too complicated for me.

I will give it a try though.

Edit : Okay one example is what I currently do, and another one may not be TOO complicated for me (DIR$) ... I'll play around with it.

Posted on Jul 1, 2010, 6:44 PM

Respond to this message   

Return to Index


* That has NOTHING to do with our discussion moron!

by (Login burger2227)
R

Posted on Jul 1, 2010, 7:54 PM

Respond to this message   

Return to Index


* Sorry, seemed relevant to me!

by (Login QootyKev)

Posted on Jul 1, 2010, 8:01 PM

Respond to this message   

Return to Index


*Clippy, stop calling people names. It's not very nice. You should apologize.

by Solitaire (no login)

Posted on Jul 2, 2010, 3:15 PM

Respond to this message   

Return to Index


*Hear hear. Ben should be more observant of netiquette but that doesn't make him a moron

by (Login Mikrondel)
Moderator

Posted on Jul 2, 2010, 9:44 PM

Respond to this message   

Return to Index


to be honest, I think it was Ben's inferring I was "abnormaL" that prompted the post

by (Login QootyKev)

I usually just assume something like that is what we call here sa "shitstir" :D ... but maybe Clippy thought he was being abusive.

Posted on Jul 2, 2010, 9:57 PM

Respond to this message   

Return to Index


* You meant pot stirring. At this forum, we refer to the container, not the contents.

by (Login The-Universe)
Admin

Posted on Jul 3, 2010, 8:17 AM

Respond to this message   

Return to Index


* "pot stirring" ... haha, did you just make that up?

by (Login QootyKev)

Posted on Jul 3, 2010, 8:07 PM

Respond to this message   

Return to Index


* One of my guinea pigs has finally responded

by (Login QootyKev)

His 32-bit Vista returned an environment of Windows_NT

So this renders ENVIRON$ useless for my purposes.

I want a way for my QBasic program to be able to tell whether someone is using Vista sad.gif

Posted on Jul 5, 2010, 7:38 PM

Respond to this message   

Return to Index


QB on Vista will only work in text mode inside a window.

by Solitaire (no login)

You cannot run in full screen mode.
You cannot run any screen other than Screen 0.
You cannot use blinking background colors -- it will only show up as a solid background to the text line.

I'm sure there are other restrictions -- and this is with the 32 bit version; 64 bits won't run at all.

Posted on Jun 30, 2010, 12:16 PM

Respond to this message   

Return to Index


Or to sum up what you're/your stating, Vista SUCKS!

by (Login The-Universe)
Admin


I always forget the full sceen part, because I don't program graphics. Nice addition.

Thanks,

Pete

Posted on Jun 30, 2010, 12:30 PM

Respond to this message   

Return to Index


Full screen needed in text mode (SCREEN 0) even if you don't program graphics.

by Solitaire (no login)

As I mentioned above, the blinking text (any color value between 16 - 31) doesn't work inside a window. Try the following in full screen, and again inside a window (Alt-Enter to toggle) to see the difference.

CLS
COLOR 25, 5
PRINT "Hello World"
COLOR 7, 0

Posted on Jul 2, 2010, 9:04 AM

Respond to this message   

Return to Index


full screen with qb64

by (no login)

how do you get to full screen with qb64 with windows 7

Posted on Jul 2, 2010, 11:50 AM

Respond to this message   

Return to Index


Yeah, though that's all irrelevant to me

by (Login QootyKev)

Sometimes the fullscreen can be inviting ... but screen modes and blinking colours don't come into it in my case.

Must be a pain for people who do graphics and weird stuff like that, though.

The pain of the artiste.

Posted on Jun 30, 2010, 10:36 PM

Respond to this message   

Return to Index


Same here. I'm just a SCREEN ZERO Hero at heart. (Left brains rule!)

by (Login The-Universe)
Admin


And please TheBOB, don't post as: Corpus Callosum and tell me "I'd post my opinion, but I don't want to get in the middle of this!"

Pete happy.gif

Posted on Jul 1, 2010, 10:38 AM

Respond to this message   

Return to Index


*Right.

by (Login qb432l)
R

*

Posted on Jul 1, 2010, 3:02 PM

Respond to this message   

Return to Index


* Oops, apparently I "left" you an opening.

by (Login The-Universe)
Admin



    
This message has been edited by The-Universe on Jul 1, 2010 3:07 PM

Posted on Jul 1, 2010, 3:07 PM

Respond to this message   

Return to Index


There's this internet book on VGA and optimizing and stuff

by Ben (no login)

http://www.phatcode.net/res/224/files/html/index.html


VGA Section:
http://www.phatcode.net/res/224/files/html/ch23/23-01.html


I'm not sure if you've seen this one before, it got some good information. It is boring as hell to read, but it's a good reference.

Posted on Jun 29, 2010, 9:15 PM

Respond to this message   

Return to Index


INP and OUT

by (Login PhyloGenesis)
Moderator

I read that these two functions read and write directly to and from the given address, unlike PEEK and POKE, but what is the real difference? How does QB64 deal with the fact that the ports are not the same as they were, and can't be accessed the same way either? Also, how does QB64 handle OUT &H3C7? What did QBasic actually do when you did that? I don't understand how that prepares it to take input values. What hardware port is taking this color information?

PhyloGenesis

Posted on Jun 29, 2010, 5:32 PM

Respond to this message   

Return to Index


QB64 emulates the ports, it doesn't directly access any hardware with OUT

by Ben (no login)

PEEK & POKE read & write to memory. RAM. INP & OUT send signals to hardware ports, you know what I mean. Although, some hardware has its own memory and some hardware ports are memory mapped and what not. Hardware port &h3c7, &h3c8 and &h3c9 take the color information. These color ports are well documented here:

http://www.osdever.net/FreeVGA/vga/colorreg.htm

VGA has its own processor type thing which with its own logic does things like prepare ports for input based on what you tell it. Much like the CPU's activities based on the instructions you give it. I'm not expert on this stuff though, so all I said could be 100% wrong.

Posted on Jun 29, 2010, 9:07 PM

Respond to this message   

Return to Index


Some ports are blocked nowadays.

by (Login burger2227)
R

OUT &H3C8, 6 prepares the color port to be changed using OUT &H3C9, setting. RGB values 0 to 63. QB64 32 bit values 0 to 255.

&H3C7 prepares the color port to be read with INP. You can then read the RGB color settings.

OUT &H3C7, 6 'color attribute to read

red = INP(&H3C9)
green = INP(&H3C9)
blue = INP(&H3C9)

Every 3 reads the next higher color attribute settings are read.

There is software like Port Talk that can open LPT or COM port access for Qbasic. Dunno when QB64 will be able to do that.

Posted on Jun 29, 2010, 9:26 PM

Respond to this message   

Return to Index


It's simple enough, but overcomplicated

by (Login Mikrondel)
Moderator

A processor has a bunch of address pins, a bunch of data pins, and a read/write pin.

If the read/write pin is set to read, this is understood as meaning "whoever is in charge of address [xyz] please tell send my data pins the appropriate data".

If the read/write pin is set to write, this is understood as meaning "whoever is in charge of address [xyz], I have placed some data on my data pins".


You may expect that if you write to some address and later read from the same address, you will get the same data that you previously wrote. THIS MAY NOT BE TRUE IF THE ADDRESS DOES NOT SIGNIFY A RAM CHIP.

For example, the BIOS is stored on ROM chips. You can write whatever the heck you want to address 0xFC000, but the writes will be ignored, and reads will always produce the same thing. The region 0xA0000 to 0xC0000 is mapped to the VGA card (which treats reads and writes differently in certain modes) and so on. Modern network cards, hard disk controllers, USB controllers, and such stuff all get memory regions assigned to them.

Note that only the OS can access these regions. When normal programs try to access "memory", they only ever get RAM.


Now, the overcomplicated part. Whether it was for making assembly programming easier or reducing chip costs or making it harder to blow up your system by mistake or other reasons, Intel decided to make TWO buses- the "memory bus" that was accessible with MOV instructions, and the "IO bus" that was accessible with INP/OUT instructions.

Nearly all I/O operations apart from text/graphics output on the PC were done with I/O ports. But these days they are rarely used except for legacy devices.



> I read that these two functions read and write directly to and from the given address, unlike PEEK and POKE

Under DOS, PEEK and POKE read and write directly to "memory space". INP and OUT read and write directly to "IO space". They're different hardware namespaces, if you like.

Under NTDVM and DOSBOX, PEEK and POKE access virtual memory, and INP and OUT are emulated or virtualised.

> what is the real difference?

The difference is some hardware operations are done with PEEK and POKE, and some hardware operations are done with INP and OUT. This is due to design choices made by IBM and other manufacturers. VGA for instance exposes its display memory in memory space but is configured (changing screen modes, etc.) in IO space. PEEK and POKE can also be used to access data in RAM and that sort of thing.

> How does QB64 deal with the fact that the ports are not the same as they were, and can't be accessed the same way either?

QB64 doesn't even use VGA itself, it uses the SDL library. So it would have to emulate VGA-related INP, OUT, PEEK and POKEs, and translate them to the SDL API where applicable.

> I don't understand how that prepares it to take input values. What hardware port is taking this color information?

IBM published a programming interface for VGA, and those port addresses and OUT procedures are described there. DOSBOX internally has a "virtual VGA card" that conforms to that interface. I believe (could be wrong) that when running fullscreen, NTVDM actually tries to get the graphics card into a compatible state and essentially lets the program talk to the graphics card almost directly. When running in pure DOS you actually DO have total access to the graphics card...

Posted on Jul 2, 2010, 8:28 PM

Respond to this message   

Return to Index


*That was very informative, and will help a lot, thank you!

by (Login PhyloGenesis)
Moderator

*

Posted on Jul 22, 2010, 6:01 PM

Respond to this message   

Return to Index


qbasic homework

by (no login)

I am taking a QBASIC class and to all you this is probably so simple. I need some help. I posted the homework assignment below. If anyone can help I would appreciate it!





PART A:

Write a structured modularized program named PROB3A to input a stamp price from the keyboard. Based on the stamp price, create a screen display of a single spaced 12 line chart showing the cost of from 1 to 12 stamps. Use a For/Next loop to control the printing of the chart.



PART B. – Rewrite PROB3A as PROB3B to include two additional keyboard input values – one for the beginning number of stamps in the chart, and one for the ending number of stamps.

PART C – Rewrite PROB3A as PROB3C to list the prices for the following number of stamps: 5, 10, 15, 20, 25, 30, 35, 40, 45, and 50

Posted on Jun 29, 2010, 8:27 AM

Respond to this message   

Return to Index


Re: qbasic homework

by Ben (no login)

Looks pretty basic, did you just start the course? I'm not sure what a "structured modularized program" is, but here's a start.

'PART A
INPUT "stamp price"; x
PRINT "stamps", "price"
FOR i = 1 TO 12
PRINT i, i * x
NEXT


'PART B
INPUT "stamp price"; x
INPUT "beginning number"; x1
INPUT "ending number"; x2
PRINT "stamps", "price"
FOR i = x1 TO x2
PRINT i, i * x
NEXT


'PART C
INPUT "stamp price"; x
PRINT "stamps", "price"
FOR i = 5 TO 50 STEP 5
PRINT i, i * x
NEXT

Posted on Jun 29, 2010, 12:12 PM

Respond to this message   

Return to Index


QUIT HELPING CHEATERS! BAN THEM BOTH!

by (Login burger2227)
R

BEN does not follow ANY rules here!

1) Forget using *

2) Help homework cheats

3) Include "dirty" words in code

4) Continually act like the little jerk he is

Why have rules here if nobody enforces them?

AT LEAST REMOVE THE HOMEWORK ANSWERS FGS!

How can ANYBODY here call themselves "moderator"?

Posted on Jun 30, 2010, 11:52 AM

Respond to this message   

Return to Index


OMG - I really should ban Ben for using the dirty word "Stamps"

by (Login The-Universe)
Admin


Thank God he didn't follow up with something worse, like envelope!

Solitaire could have axed his post if she wanted to and as for me, I really don't think what Ben posted was much in the way of help, more an example of how to get started.

Anyway, I doubt we are going to get a ton of homework posts here any more, as we are running out of Third World countries that still teach QBasic. And what on Earth is a Second World Country? My guess would be Canada, but soon I will have to rely on them for welfare support, so I better not put that in print... ah oops, too late.

I'll admit Ben has had a bit of a rough go of it here, but he has contributed much more interesting stuff than he has been a "problem" to the community, don't you agree?

The other thing is that I'm not a strict rules hound, the principles matter more to me than absolute rules.

All other comments (except for Canada) welcomed.

Pete

Posted on Jun 30, 2010, 12:02 PM

Respond to this message   

Return to Index


I didn't delete Ben's posts because:

by Solitaire (no login)

1- He only posted hints on getting started, not the solutions.
2- I'm on a different computer (with no editing privileges) and didn't feel like re-logging on to Network54 just to edit Ben's posts (and then having to relog again later).

Posted on Jun 30, 2010, 12:10 PM

Respond to this message   

Return to Index


Makes good sense to me...

by (Login The-Universe)
Admin


And Phylo probably had a similar reasoning, meaning it was more an example on how to get started than a "cheat" on the assignment. That leaves Galleon, who doesn't see QB homework assignments as a threat to the development of QB64, and Artilius, who was Ben in a past life. happy.gif

Pete

Posted on Jun 30, 2010, 12:34 PM

Respond to this message   

Return to Index


* They do seem to have an unatural "affinity" for each other. :-}> (my goatee)

by (Login burger2227)
R

Posted on Jun 30, 2010, 1:02 PM

Respond to this message   

Return to Index


* More like a natural "infinity" but when it comes to infinity, who's counting? :)

by (Login The-Universe)
Admin

Posted on Jun 30, 2010, 1:04 PM

Respond to this message   

Return to Index


My reasoning matched yours pretty much.

by (Login PhyloGenesis)
Moderator

I thought he actually did do the homework, but I didn't see as really making much difference. If it did, it's more likely to help than hurt,,, 'cause then it might bring more people, most of which might not stay, but a few of them will.

Now I'm glad I didn't though, since apparently he didn't give the guy the answers.

PhyloGenesis

Posted on Jun 30, 2010, 4:05 PM

Respond to this message   

Return to Index


* He meant yours/your'res. :)

by (Login The-Universe)
Admin

Posted on Jun 30, 2010, 4:13 PM

Respond to this message   

Return to Index


*huh?

by (Login PhyloGenesis)
Moderator

*

Posted on Jun 30, 2010, 4:18 PM

Respond to this message   

Return to Index


It's/its one of those you had to be there thingies... URL*

by (Login The-Universe)
Admin

Posted on Jul 1, 2010, 10:34 AM

Respond to this message   

Return to Index


* Note: Phylo used "yours" correctly.

by Solitaire (no login)

Posted on Jul 1, 2010, 10:56 AM

Respond to this message   

Return to Index


* I'm OK with him using "mine" correctly, provided he gives/give's it back.

by (Login The-Universe)
Admin

Posted on Jul 3, 2010, 8:54 AM

Respond to this message   

Return to Index


Pete should make YOU moderator

by Ben (no login)

Posted on Jun 30, 2010, 5:31 PM

Respond to this message   

Return to Index


Did you read the homework policy?

by Solitaire (no login)

http://www.network54.com/Realm/QBasicFAQ/QBasicHomework.html

We will not do your homework for you. You won't learn anything that way, and it won't be fair to other students in your class who do their own work. You must show that you have made an attempt to solve the problem. Then post the code you have so far and let us know which part you are having trouble with. Someone will try to help you by giving you hints. But eventually you need to figure out how to do it yourself.

Posted on Jun 29, 2010, 12:29 PM

Respond to this message   

Return to Index


what?

by gopus (Login gopus)

What could possibly be so difficult about managing this forum that people have no time to manage it?

Posted on Jun 25, 2010, 11:54 AM

Respond to this message   

Return to Index


Okay I offer my services...

by gopus (Login gopus)

I understand that pete can no longer look after the forum. Obviously, I am the best choice as new moderator, so I humbly accept the position. I have been here the longest, was the one who had qbasic.com forum placed on network54.com, and I had the most dealings with Mallard and Mac.

Posted on Jun 25, 2010, 12:02 PM

Respond to this message   

Return to Index


* PLUS your a jerk! LOL

by (Login burger2227)
R

Posted on Jun 25, 2010, 12:29 PM

Respond to this message   

Return to Index


*Ah, you remind me so much of Zip!

by (no login)

Posted on Jun 25, 2010, 4:46 PM

Respond to this message   

Return to Index


Who are you?

by Unseen Machine (no login)

I have only been using this forum for 7 months or so, so i dont really know anyone, YOU however, in those 7 months (as far as i know) have not contributed, asked anything or helped anyone, except badgering on about changing the colors of the forum and being a MOD. Why should you be allowed to moderate something you dont participate in? And as for accepting the posistion, who offered it to you?

I dont say this often, but i agree with CLIPPY on this one.

Posted on Jun 29, 2010, 1:08 PM

Respond to this message   

Return to Index


well...

by gopus (no login)

Obviously, I have helped in many subtle and sophisticated ways that are beyond your comprehension. You do know, as most people do, that color scheme affects work environment and critical thinking skills right? There has been a plethora of research. My changing the color scheme would no doubt increase productivity amongst all the members of the community.

Posted on Jul 15, 2010, 2:24 PM

Respond to this message   

Return to Index


Pete, can you update my download link?

by (Login burger2227)
R

I just found a great place that makes the download immediate. My other site was making people wait 20 seconds to download if you were not a member.

Dropbox is slick! You add your files to their folder on your PC. It then automatically becomes available online to download. (The Dropbox program is active in task bar.)

Here is the new link:

http://dl.dropbox.com/u/8440706/Q-Basics.zip

Thanks,

Ted





    
This message has been edited by burger2227 on Jun 24, 2010 2:53 PM

Posted on Jun 24, 2010, 2:38 PM

Respond to this message   

Return to Index


I'm sorry, that work is not part of the Obama Stimulus Program.

by (Login The-Universe)
Admin


But if you can think of something really stupid, like paying for free school lunches when schools out, paving roads that are already paved, etc., then I'd be happy to help.

Pete

PS I just recently updated that page, grrr... to fix a zip file for TheBOB. I think it used to download, but then N54 switched to case-sensitive file names. I got rid of some QB links that are no more on that page, too, and added Unseen's new site. Anyway, I will get to it soon, which usually means over the weekend.



Posted on Jun 25, 2010, 7:52 PM

Respond to this message   

Return to Index


* Thanks, you Republicans ain't so bad.

by (Login burger2227)
R

Posted on Jun 25, 2010, 8:25 PM

Respond to this message   

Return to Index


*Thanks, Pete! (just read this for the first time).

by (Login qb432l)
R

*

Posted on Jun 26, 2010, 10:38 PM

Respond to this message   

Return to Index


OK Clippy, your new link is up. Also Bob...

by (Login The-Universe)
Admin


I know you've been busy rioting at the G20; so I didn't expect you to see the post about your zip file. Glad I got the download working again. It's too good to be without it.

Pete

- Hey, did you get that 5.0 California earthquake I sent you last week?

Posted on Jun 27, 2010, 7:47 PM

Respond to this message   

Return to Index


Thanks again, Pete -- also for the quake...

by (Login qb432l)
R

It's a rare occurrence around these parts. I had just laid down for my after lunch nap when my bed started rocking rythmically. It was like being young again, but without the responsibility. Nothing like your California quakes, of course. My brother was down there when a big one hit. He was staying in a Motel and said that the entire swimming pool emptied in a few seconds. Wow!

And the G20 protests? A few hundred jerks all trying to get their 15 minutes at the same time. Oh, well. The conference was apparently a success.

Anyway, I appreciate your fixing the link.

-Bob

Posted on Jun 27, 2010, 10:07 PM

Respond to this message   

Return to Index


protests

by Ben (no login)

if I were the ruler of Canada, I'd surely give them a reason to protest. But the streets would be empty, they'd be scared to death hiding in their houses.

Posted on Jun 28, 2010, 4:18 PM

Respond to this message   

Return to Index


Sounds like the motels I stay at...

by (Login The-Universe)
Admin


If I had a nickel for every quarter I spent in those rooms, well, I'd still be renting them, but seriously those above ground plastic pools don't even do well in those 5.0 jobbers!

Pete

PS I know, the media here just airs the small percent of people, who probably crossed the border from the US, who are rioting. Honestly, I don't know why you guys don't put up fence. And a billion dollars for security... hmm, since the prim focus is on how to reduce deficits, you would think the $%$% ^%^& fools would have picked a cheaper place, like on an aircraft carrier.

Posted on Jun 28, 2010, 5:21 PM

Respond to this message   

Return to Index


* I didn't reduce the debt! I gave it all to my buddies like ENRON and BP teehee...

by (Login burger2227)
R



    
This message has been edited by burger2227 on Jun 28, 2010 9:22 PM

Posted on Jun 28, 2010, 9:21 PM

Respond to this message   

Return to Index


Hey, not a bad idea about the carrier...

by (Login qb432l)
R

Just think of the Sultan's yacht they could have floated in Toronto harbor for that 1.3 billion: easy to defend against protesters (blub, blub), and when the G20 was over, they could have sold it to Obama at a profit.

-Bob

Posted on Jun 29, 2010, 2:05 AM

Respond to this message   

Return to Index


* Thanks, I'll give you one Obama joke for that...

by (Login burger2227)
R

Posted on Jun 28, 2010, 2:31 AM

Respond to this message   

Return to Index


* No thanks, over half of the American voters took care of that for you. :(

by (Login The-Universe)
Admin

Posted on Jun 28, 2010, 6:03 AM

Respond to this message   

Return to Index


What is the LOF maximum return?

by (Login burger2227)
R

I made this program in QB64, but it won't work in Qbasic. LOF(1) returns 0.

TYPE TagInfo
Tg AS STRING * 3
Title AS STRING * 30
Artist AS STRING * 30
Album AS STRING * 30
Year AS STRING * 4
Comment AS STRING * 30
Genre AS STRING * 1
END TYPE
DIM Tags AS TagInfo
DIM tag AS STRING * 3

LINE INPUT "Enter MP3 file name(program will add .MP3): ", MP3$

MP3$ = MP3$ + ".MP3"
OPEN MP3$ FOR BINARY AS #1
start& = LOF(1) - 127
print start&, LOF(1)
GET #1, start& , tag
PRINT tag
DO: LOOP UNTIL INKEY$ <> ""

IF tag = "TAG" THEN

GET #1, start& , Tags ' get all of the info

PRINT "Title: "; Tags.Title
PRINT "Artist: "; Tags.Artist
PRINT "Album: "; Tags.Album
PRINT "Year: "; Tags.Year
PRINT "Comment: "; Tags.Comment
PRINT ASC(Tags.Genre)

END IF
CLOSE #1

I dunno....

Thanks

Ted

Posted on Jun 22, 2010, 6:05 PM

Respond to this message   

Return to Index


That suggests that the file didn't exist. LOF should be able to handle files up to 2GB

by (Login Mikrondel)
Moderator

I got LOF on a 27MB file correctly, anyhow.

Posted on Jun 22, 2010, 6:59 PM

Respond to this message   

Return to Index


"LOF should be able to handle files up to 2GB"?... try 9223372036GB

by (no login)

The GFS update changed a lot of things, including the capabilities of QB64. The LOF size is now returned as a 64 bit integer value.

Posted on Jun 23, 2010, 4:48 AM

Respond to this message   

Return to Index


* Good to know! Will adjust WIKI accordingly.

by (Login burger2227)
R

Posted on Jun 23, 2010, 10:05 AM

Respond to this message   

Return to Index


*Clippy had problems in QBasic, not QB64, as far as I understand

by (Login Mikrondel)
Moderator

Posted on Jun 23, 2010, 10:18 PM

Respond to this message   

Return to Index


*You're right Artelius (PS. All hail Julia Gillard...rofl)

by (no login)

Posted on Jun 25, 2010, 4:49 PM

Respond to this message   

Return to Index


*Yes, congratulations to all down under on your new female prime minister!

by (Login qb432l)
R

*

Posted on Jun 25, 2010, 5:12 PM

Respond to this message   

Return to Index


*P.S. We Canadians had one, but only briefly (Kim Campbell).

by (Login qb432l)
R

*

Posted on Jun 25, 2010, 5:14 PM

Respond to this message   

Return to Index


So what you're stating Bob is that (you're/your) in favor of having a female down under?

by (Login The-Universe)
Admin


Just kidding, and trying to stay "Swiss" for the (you're/your) forum battle.

But seriously, no woman would ever make it as leader of the United States of America; although I suspect it would stimulate the tech industry. I mean just think of it, all the Cruise "ms"iles would have to be reprogrammed to ask for directions on the way to the target. happy.gif

Pete

PS If Blondie stops by and reads this, I'm as good as dead.

Posted on Jun 25, 2010, 6:53 PM

Respond to this message   

Return to Index


My proposal on the your/you're debate...

by (Login qb432l)
R

I propose we spell it "yourrr", as if we have an accent. Anyone calling us on it would then be politically incorrect: a much worse crime than misspelling OR pedantry.

-Bob

Posted on Jun 26, 2010, 2:51 AM

Respond to this message   

Return to Index


The trouble is, when it comes to being P.C., I'm a M.A.C.

by (Login The-Universe)
Admin


Make Any Comments.

Pete

PS And the person who started the P.C. movement should be hit over the head repeatedly with a participation trophy. happy.gif

Posted on Jun 26, 2010, 3:24 AM

Respond to this message   

Return to Index


*Julia Gillard, Australia's new alpha male. Bleh.

by (Login Mikrondel)
Moderator

Posted on Jun 25, 2010, 7:41 PM

Respond to this message   

Return to Index


* Couldn't posibly be any worse than America's fairly new alpha mule.

by (Login The-Universe)
Admin

Posted on Jun 25, 2010, 7:46 PM

Respond to this message   

Return to Index


* Arrrgh! Qbasic was looking in the other folder, LOL! Thanks anyhow...

by (Login burger2227)
R

Posted on Jun 22, 2010, 7:30 PM

Respond to this message   

Return to Index


Rs232 Signal levels

by Tom (no login)

Hey all basicly i been programing some rs232 stuff using windows .

Now i wanted to hold the tx line high to test somehardware so i done that using the
out 1019,64 ; which brings pin 7 high

but !!!! by rs232 specifications if u set a high bit output the rs232 line should invert to say minus -12v.... and if u set a low bit it goes 12 v plus !!

By using the out command above this does the oppsite to the rs232 specifcations.

So am i right in saying that windows normaly inverts this signal and where im using dos it is doin as i say and not inverting it like in the rs232 Specifation.

Cheers for anyhelp on this tom :)

Posted on Jun 20, 2010, 3:19 PM

Respond to this message   

Return to Index


Try looking at my demo. It shows how to work with Serial ports. LINK

by (Login burger2227)
R

Posted on Jun 20, 2010, 5:22 PM

Respond to this message   

Return to Index


Thx for help good demo :) doesnt explain my inverted singals thou

by tom (no login)

Cheers for that demo seems really helpful good work there if u made it :).I will proberly use that for furture programing referneces but still is does explain bout the inverted rs232 line signals that im getting :). oh i and i meant pin3 not 7 .

Posted on Jun 21, 2010, 6:37 AM

Respond to this message   

Return to Index


Re: Thx for help good demo :) doesnt explain my inverted singals thou

by (Login burger2227)
R

Hardware Properties
------------------------------------


Devices which use serial cables for their communication are split into two categories. These are DCE (Data Communications Equipment) and DTE (Data Terminal Equipment.) Data Communications Equipment are devices such as your modem, TA adapter, plotter etc while Data Terminal Equipment is your Computer or Terminal.

The electrical specifications of the serial port is contained in the EIA (Electronics Industry Association) RS232C standard. It states many parameters such as -

1. A "Space" (logic 0) will be between +3 and +25 Volts.
2. A "Mark" (Logic 1) will be between -3 and -25 Volts.
3. The region between +3 and -3 volts is undefined.
4. An open circuit voltage should never exceed 25 volts. (In Reference to GND)
5. A short circuit current should not exceed 500mA. The driver should be able to handle this without damage. (Take note of this one!)

Above is no where near a complete list of the EIA standard. Line Capacitance, Maximum Baud Rates etc are also included. For more information please consult the EIA RS232-C standard. It is interesting to note however, that the RS232C standard specifies a maximum baud rate of 20,000 BPS!, which is rather slow by today's standards. A new standard, RS-232D has been recently released.

Serial Ports come in two "sizes", There are the D-Type 25 pin connector and the D-Type 9 pin connector both of which are male on the back of the PC, thus you will require a female connector on your device. Below is a table of pin connections for the 9 pin and 25 pin D-Type connectors.

Serial Pinouts (D25 and D9 Connectors)



--------------------------------------



D-Type-25 Pin No. D-Type-9 Pin No. Abbreviation Full Name
Pin 2...............Pin 3..............TD Transmit Data
Pin 3...............Pin 2..............RD Receive Data
Pin 4...............Pin 7..............RTS Request To Send
Pin 5...............Pin 8..............CTS Clear To Send
Pin 6...............Pin 6..............DSR Data Set Ready
Pin 7...............Pin 5..............SG Signal Ground
Pin 8...............Pin 1..............CD Carrier Detect
Pin 20..............Pin 4..............DTR Data Terminal Ready
Pin 22..............Pin 9..............RI Ring Indicator

Table 1 : D Type 9 Pin and D Type 25 Pin Connectors

Pin Functions



--------------------------------------------------------------------------------


Abbreviation Full Name Function
TD Transmit Data Serial Data Output (TXD)
RD Receive Data Serial Data Input (RXD)
CTS Clear to Send This line indicates that the Modem is ready to exchange data.
DCD Data Carrier Detect When the modem detects a "Carrier" from the modem at the other end of the phone line, this Line becomes active.
DSR Data Set Ready This tells the UART that the modem is ready to establish a link.
DTR Data Terminal Ready This is the opposite to DSR. This tells the Modem that the UART is ready to link.
RTS Request To Send This line informs the Modem that the UART is ready to exchange data.
RI Ring Indicator Goes active when modem detects a ringing signal from the PSTN.

Posted on Jun 22, 2010, 6:29 PM

Respond to this message   

Return to Index


Thx

by tom (no login)

Cheers for your help dude i understand that bit thou what i was trying to say when i apply my logical 1 i was getting the +12 v rather than the -12 i should get ....

Anyways i kinda worked my way round that another question thou since u seem to know a lot bout rs232 is there a specific idle time length between bytes i.e between the start and stop bits cheers tom :)

Posted on Jun 24, 2010, 2:44 AM

Respond to this message   

Return to Index


Use the web........LINK

by (Login burger2227)
R

Posted on Jun 24, 2010, 8:34 AM

Respond to this message   

Return to Index


parallel port

by Ben (no login)

i know you know about the parallel port and i was wondering say i have 8 buttons connnected to the parallel port say if i were to use 1 button per data pin i would be limited to 8 buttons but there is this thing i think called a mulitpleksor or something that could take the 8 inputs and make them into say 3 outputs with binary you know how to practically implement this type of system without any fancy equipmnent

Posted on Jun 24, 2010, 8:07 PM

Respond to this message   

Return to Index


hmm

by .. (no login)

ahh a multiplexer basicly you use an address line to choose which data you want on the data line.

http://www.labri.fr/perso/strandh/Teaching/AMP/Common/Strandh-Tutorial/multiplexer.jpg

Posted on Jun 26, 2010, 10:41 AM

Respond to this message   

Return to Index


no not like this

by Ben (no login)

but anyway, how would you synchronize the address line with the demultiplexer on the other side?

Posted on Jun 26, 2010, 6:40 PM

Respond to this message   

Return to Index


Two approaches

by (Login Mikrondel)
Moderator

1) Use a multiplexer. 3 output pins of the parallel port select the address. Multiplexer output is connected to an input pin. Your software cycles through all the addresses, reading the input pin.

This approach is essentially a "query->response" approach.

If you don't like using 3 output pins, you can use 1 instead, and put a counter on the outside that counts from 0 to 7 based on the pulses on the output pin. But it is tricky to synchronise the software and hardware counters.


2) Use 3 input pins. Assume no more than 1 button will be pressed at once. You can have 7 buttons (numbered 1 through 7) and the binary values for all the currently pressed buttons are just ORed together. So if a single button is pressed you get a number from 1 to 7. If no button is pressed you get 0. If more than one button is pressed you get garbage.



    
This message has been edited by Mikrondel on Jul 2, 2010 8:30 PM

Posted on Jun 26, 2010, 11:10 PM

Respond to this message   

Return to Index


Voltages

by (Login burger2227)
R

Hardware Properties
------------------------------------


Devices which use serial cables for their communication are split into two categories. These are DCE (Data Communications Equipment) and DTE (Data Terminal Equipment.) Data Communications Equipment are devices such as your modem, TA adapter, plotter etc while Data Terminal Equipment is your Computer or Terminal.

The electrical specifications of the serial port is contained in the EIA (Electronics Industry Association) RS232C standard. It states many parameters such as -

1. A "Space" (logic 0) will be between +3 and +25 Volts.
2. A "Mark" (Logic 1) will be between -3 and -25 Volts.
3. The region between +3 and -3 volts is undefined.
4. An open circuit voltage should never exceed 25 volts. (In Reference to GND)
5. A short circuit current should not exceed 500mA. The driver should be able to handle this without damage. (Take note of this one!)

Above is no where near a complete list of the EIA standard. Line Capacitance, Maximum Baud Rates etc are also included. For more information please consult the EIA RS232-C standard. It is interesting to note however, that the RS232C standard specifies a maximum baud rate of 20,000 BPS!, which is rather slow by today's standards. A new standard, RS-232D has been recently released.



    
This message has been edited by burger2227 on Jun 22, 2010 6:40 PM

Posted on Jun 22, 2010, 6:29 PM

Respond to this message   

Return to Index


Grammar/Spelling/Punctuation alert: "your" vs. "you're"

by English Syntax Police (Login Solitaire1)
S

As a schoolteacher myself, I find it very annoying when I see this mistake used by native English-speaking people. Programmers are aware of syntax errors in writing code, but they should also be aware that written English communication syntax will also reflect on them personally in the business world.

Several people (who shall remain unnamed, but who are native English speakers) have committed this blunder, and used "your" when the correct English usage should have been "you're."

your = personal possessive pronoun which means belonging to you

you're = contraction of "you" and "are"

Example: "After you're done looking at the time, give me your watch."

-------------------------------------------------------------------------

Note: The same blunder occurs when people don't know the difference between "its" and "it's."

its = possessive pronoun meaning belonging to it

it's = contraction of "it" and "is"

Example: "The animal is inside of its cage, but it's unable to get out."







    
This message has been edited by Solitaire1 on Jun 20, 2010 10:28 AM
This message has been edited by Solitaire1 on Jun 20, 2010 9:57 AM

Posted on Jun 20, 2010, 9:28 AM

Respond to this message   

Return to Index


* Your RIGHT teacher! TELL EM OFF! BAN THEM! Grrrrrr!

by (Login burger2227)
R

Posted on Jun 20, 2010, 5:18 PM

Respond to this message   

Return to Index


* You're left. I'm right.

by Teacher (Login Solitaire1)
S



    
This message has been edited by Solitaire1 on Jun 20, 2010 7:11 PM
This message has been edited by Solitaire1 on Jun 20, 2010 7:09 PM

Posted on Jun 20, 2010, 7:08 PM

Respond to this message   

Return to Index


Pet Peeve

by (Login MarineDon)
R

You're absolutely correct, Solitaire. Also, there
are three uses of "THERE/THEIR/THEY'RE"

There, as in "over there" (direction)
Their, as in "it is their car" (possession)
They're, as in "they're from Arkansas" (contraction of they + are)

Another pet peeve. "A lot" is
often, most ofter, spelled as
"alot". The expression "a lot",
meaning "much", is two separate
words.

Regards, Don Smith

Posted on Jun 20, 2010, 5:49 PM

Respond to this message   

Return to Index


* What I hate is GRUMPY OLD MEN! So count me alot in on that!

by (Login burger2227)
R

Posted on Jun 20, 2010, 6:01 PM

Respond to this message   

Return to Index


*Hey, Clippy, allowance should be made for Grumpy Old Men

by (Login MarineDon)
R

Posted on Jun 20, 2010, 8:37 PM

Respond to this message   

Return to Index


I agree alot - its a big problem. Their all important rules. Watch you're grammer.

by (Login Mikrondel)
Moderator

Jokes aside - I don't mind if people make a mistake now and then, but constant grammatical errors make me sad. :( It's not that hard!

Also if your browser doesn't have a spell check, get Opera :D

Posted on Jun 20, 2010, 9:26 PM

Respond to this message   

Return to Index


RE: As a schoolteacher myself, I find it very annoying when...

by (no login)

As a teacher myself, I know that the effects my comments have on others are far more powerful than the content which I'm delivering. Is there a hidden curriculum behind you're post?

Moshi boku wa nihongo de chotto machigau suru, kedo, anata wa imi wakaru... sore wa daijobu to omou.

Posted on Jun 21, 2010, 5:03 AM

Respond to this message   

Return to Index


yea my english is bad especialy when im typing

by tom (no login)

yea my english is bad especialy when im typing because i type to quick miss typing things as u prob spotted in my above posts haha

Posted on Jun 21, 2010, 6:39 AM

Respond to this message   

Return to Index


* would of

by (Login QootyKev)

Posted on Jul 1, 2010, 5:06 PM

Respond to this message   

Return to Index


Look into the center for about a minute

by Ben (no login)

may require additional delay on fast computers/qb64

DEFINT A-Z
DIM x(10000)
DIM y(10000)
DIM z(10000)
SCREEN 7, , 1, 0
CIRCLE (50, 50), 50, 15, , , 1
PAINT (50, 50), 15
GET (0, 0)-(100, 100), x(0)
LINE (0, 0)-(100, 100), 15, BF
CIRCLE (50, 50), 50, 0, , , 1
PAINT (50, 50), 0
GET (0, 0)-(100, 100), z(0)
DO
j = j + 1
k = j MOD 6
SCREEN , , 1, 0
LINE (0, 0)-(319, 199), 0, BF
FOR i = k TO 100 + k STEP 6
LINE (160, 100 - i)-(160 + i, 100)
LINE -(160, 100 + i)
LINE -(160 - i, 100)
LINE -(160, 100 - i)
LINE (160, 100 - i - 1)-(160 + i + 1, 100)
LINE -(160, 100 + i + 1)
LINE -(160 - i - 1, 100)
LINE -(160, 100 - i - 1)
NEXT
PUT (110, 50), x(0), AND
GET (110, 50)-(210, 150), y(0)
SCREEN , , 3, 0
LINE (0, 0)-(319, 199), 0, BF
FOR i = 50 - k TO 260 - k STEP 6
LINE (160, 100 - i)-(160 + i, 100)
LINE -(160, 100 + i)
LINE -(160 - i, 100)
LINE -(160, 100 - i)
LINE (160, 100 - i - 1)-(160 + i + 1, 100)
LINE -(160, 100 + i + 1)
LINE -(160 - i - 1, 100)
LINE -(160, 100 - i - 1)
NEXT
SCREEN , , 2, 0
PCOPY 3, 2
PUT (110, 50), z(0), AND
PUT (110, 50), y(0), XOR
PCOPY 2, 0
WAIT &H3DA, 8
LOOP UNTIL INP(&H60) = 1
SYSTEM


Posted on Jun 19, 2010, 9:28 PM

Respond to this message   

Return to Index


* OMG I'm bbbbbbbllllliiiiiinnnd %#@!

by (Login burger2227)
R

Posted on Jun 19, 2010, 11:20 PM

Respond to this message   

Return to Index


*And after your done with what caused the blindness, have a look at Ben's program! :)

by (Login The-Universe)
Admin

Posted on Jun 19, 2010, 11:59 PM

Respond to this message   

Return to Index


* OMG %#@! YOU $%^@#!!!

by Ben (no login)

(content deleted)



    
This message has been edited by MCalkins on Mar 31, 2012 11:07 PM

Posted on Mar 31, 2012, 10:20 PM

Respond to this message   

Return to Index


*Hah I love it

by (Login Mikrondel)
Moderator

Posted on Jun 20, 2010, 1:58 AM

Respond to this message   

Return to Index


Great effect, but a problem (maybe only on my computer)...

by (Login qb432l)
R

A white triangle is forming on the left, like a folded piece of paper. I assume that the pattern is meant to be uniform throughout the entire screen. Does anyone else see that, or is it just on my computer?

-Bob

Posted on Jun 20, 2010, 10:02 AM

Respond to this message   

Return to Index


Are you using qb64?

by Ben (no login)

It may be that.
I know qb64 doesn't clip the lines yet

Posted on Jun 20, 2010, 7:34 PM

Respond to this message   

Return to Index


*Good call, Ben. It runs perfectly in QBasic (using DOSBox).

by (Login qb432l)
R

*

Posted on Jun 20, 2010, 9:03 PM

Respond to this message   

Return to Index


Should use windows ntvdm

by Ben (no login)

it's supposed to be optical illusion you know, it has to run fast

Posted on Jun 21, 2010, 9:06 AM

Respond to this message   

Return to Index


*No biggie - it ran fast in QB64, only with a graphical flaw - even QB was pretty good.

by (Login qb432l)
R

*

Posted on Jun 21, 2010, 11:19 AM

Respond to this message   

Return to Index


Microsoft Escher PDS follow-on

by (no login)

I was heavy into Microsoft PDS programming in the last 80s and early 90s. I developed a tool called VFM (Virtual Form Manager) that was marketed commercially before PDS was dropped for Visual Basic. However, I do know Microsoft was developing a follow-on to PDS 7.1 code-named "Escher". I have a copy of it and am trying to resurrect it from ancient floppies. The code is dated June 12, 1992. I tried googling the product but found nothing. Does anybody know anything about it?

I am excited to find QB64 but find 640x480 a bit restrictive. Can the _IMAGES be used to create "virtual" screens larger than 640x480 (text). That's essential what my product did. VFM was a screen editor and development library that handled all the windowing commands.

I still have copies of my Quickbasic Journal magazine. Ahh....the good old days when programming was fun and easy!

Steve

Posted on Jun 17, 2010, 3:53 PM

Respond to this message   

Return to Index


use _newimage

by Unseen Machine (no login)

scrn& = _newimage(1000,800,32)

screen scrn

This will give you a scren 1000 * 800 with 32 bit colors. The size is only limited by your os.

you can still have multiple pages in QB64.

Posted on Jun 17, 2010, 6:20 PM

Respond to this message   

Return to Index


RE: Virtual screens

by G (no login)

Yes!

Surfaces totally independent of the actual 'screen' can be created. _PUTIMAGE move the data on these surfaces about. Text surfaces can be created with _NEWIMAGE(x,y,0) where 0 means compatible with screen 0. Unfortunately _PUTIMAGE cannot be used to transfer the contents of text surfaces so although they are fully functional (with their own font, color, locate position, etc) you will have to manually reference these to transfer their contents using the screen() function (NOT THE SCREEN STATEMENT) and calling _DEST appropriately beforehand. It is actually quite easy to create your own window copier sub which accesses text windows.

I'm sure QB64's inbuilt 2D system is more than powerful enough for what your program requires.

Good luck

Posted on Jun 17, 2010, 10:24 PM

Respond to this message   

Return to Index


* any graphic screen can do text too.

by (Login burger2227)
R

Posted on Jun 17, 2010, 11:39 PM

Respond to this message   

Return to Index


SETMEM in QB64

by (Login MarineDon)
R

I wish to use Ethan Winer's EXECUTE.BAS but
it uses SETMEM which is not currently
supported in QB64. Is there another QB64
command which will do the same thing?
EXECUTE.BAS takes the place of SHELL to
run other executable programs.

Here's the link to EXECUTE.BAS at Ethan Winer's website:
http://www.ethanwiner.com/execute.bas

Here's Ethan Winer's 'Articles" web page:
http://www.ethanwiner.com/articles.html

Here's the QB64 Wiki on SETMEM:
http://qb64.net/wiki/index.php?title=SETMEM

Regards, Don Smith

Ethan Winer's comments on EXECUTE.BAS:
Execute is a combination demo and BASIC Function that lets you
run another program. But unlike SHELL it retrieves that program's
DOS exit code. You specify the program name, and optional
parameters, and it returns 0 for success or the ERRORLEVEL if one
was set by the program

Posted on Jun 17, 2010, 12:28 PM

Respond to this message   

Return to Index


For now, why not use a batch file to retrieve the exit code? (URL)

by (no login)

http://www.chebucto.ns.ca/~ak621/DOS/ExitCode.html

Posted on Jun 17, 2010, 1:18 PM

Respond to this message   

Return to Index


Yes, but

by (Login MarineDon)
R

Dear Galleon:

Yes, but SETMEM really doesn't have anything to do
with errorlevel codes. It has to do with memory.
In EXECUTE.BAS, Ethan Winer's comments on SETMEM are:
.
.
Dummy& = SETMEM(-600000) 'free up memory for the program being run
.
.
Done:
Dummy& = SETMEM(600000) 'reclaim the memory relinquished eariler


In QB64, I have REMARKED OUT (') the lines beginning with "Dummy&" in
EXECUTE.BAS and it will not work.

It would be great, I think, to somehow incorporate EXECUTE.BAS in
QB64 with a command like _LOADEXEC.

Regards, Don Smith

Posted on Jun 17, 2010, 2:36 PM

Respond to this message   

Return to Index


* QB64 doesn't need more memory if I can recall!

by (Login burger2227)
R

Posted on Jun 17, 2010, 6:24 PM

Respond to this message   

Return to Index


If thats the case what about CPU?

by Unseen Machine (no login)

My mp3 player uses 98% of my cpu, i have a 2ghz processor and 1.25gb of ram. Can i do anything to sort this out?

Posted on Jun 17, 2010, 6:43 PM

Respond to this message   

Return to Index


* Is it running in a loop? Use SLEEP or _LIMIT to lower CPU.

by (Login burger2227)
R



    
This message has been edited by burger2227 on Jun 17, 2010 8:23 PM

Posted on Jun 17, 2010, 8:00 PM

Respond to this message   

Return to Index


*Use the _LIMIT or _DELAY commands to manage cpu usage in QB64

by G (no login)

Posted on Jun 17, 2010, 10:14 PM

Respond to this message   

Return to Index


_LIMIT 30 should be built in as a default...

by (Login The-Universe)
Admin


Automatically compiled into the DO/LOOP, because our community needs more government control and oversite!

Now if you will excuse me, I have to get to the GOLF, not The Gulf, the GOLF!

[linked image]

- B.O.

Posted on Jun 18, 2010, 9:19 AM

Respond to this message   

Return to Index


* Big ******** deal!

by (Login burger2227)
R

Posted on Jun 18, 2010, 10:52 AM

Respond to this message   

Return to Index


Re: * Big ******** deal!

by (Login The-Universe)
Admin

[linked image]

Posted on Jun 18, 2010, 1:42 PM

Respond to this message   

Return to Index


Middle mouse button my ASCII...

by (Login The-Universe)
Admin

Does anyone have a program that works with there middle mouse button using CALL INTERRUPT?

I have two infra-red mice and neither will accept the code for a the middle mouse button:

Sample routine -

DECLARE SUB MDRIVER (EX, B$)

TYPE RegType
AX AS INTEGER
BX AS INTEGER
CX AS INTEGER
DX AS INTEGER
BP AS INTEGER
SI AS INTEGER
DI AS INTEGER
FLAGS AS INTEGER
DS AS INTEGER
ES AS INTEGER
END TYPE

DIM SHARED MOUSE$
DIM SHARED Registers AS RegType
DIM SHARED LB, RB, MB, DX, CX, IDENTIFY

SCREEN 0, 0, 0, 0
FOR i = 1 TO 25
COLOR i MOD 16
LOCATE i, 1: PRINT i;
NEXT
COLOR 7, 0
EX = 1: CALL MDRIVER(EX, B$)
DO
EX = 2: CALL MDRIVER(EX, B$)
LOOP UNTIL INKEY$ = CHR$(27) OR B$ <> ""
EX = -1: CALL MDRIVER(EX, B$)
SYSTEM

SUB MDRIVER (EX, B$)
STATIC MOUSEACT

REM INITIATE MOUSE
IF MOUSEACT = 0 THEN
Registers.AX = 0: GOSUB CALLI
MOUSEACT = 1
END IF

IF EX = 1 THEN
Registers.AX = 1: GOSUB CALLI
EXIT SUB
END IF

IF EX = -1 THEN
REM HIDES MOUSE IF A KEY WAS PRESSED FOR NEXT MOUSE LOOP
Registers.AX = 2: GOSUB CALLI
EXIT SUB
END IF

Registers.AX = 3: GOSUB CALLI

REM MOUSE LOCATION (USES X AND Y TO CONVERT TO 25 * 80 SCREEN SIZE)
DX = Registers.DX
CX = Registers.CX
X = DX \ 8 + 1: Y = CX \ 8 + 1

REM MOUSE BUTTONS
LB = Registers.BX AND 1
RB = (Registers.BX AND 2) \ 2
MB = (Registers.BX AND 4) \ 4

IF LB <> 0 THEN
IDENTIFY = SCREEN(X, Y, 1)
LOCATE 1, 6: PRINT SPACE$(74);
LOCATE 1, 6: PRINT "Position:"; X; "x"; Y; " Color Attribute:"; IDENTIFY
END IF

IF MB <> 0 THEN
LOCATE 1, 47: PRINT "Middle Button";
END IF

IF RB <> 0 THEN
LOCATE 1, 67: PRINT "Right Button";
END IF


EXIT SUB

CALLI:
CALL INTERRUPT(&H33, Registers, Registers)
RETURN

END SUB

Posted on Jun 15, 2010, 9:17 PM

Respond to this message   

Return to Index


* The middle button works on my 98 machine. Not my XP.

by (Login burger2227)
R

Posted on Jun 15, 2010, 9:44 PM

Respond to this message   

Return to Index


* The OS or I wonder if it has something to do with the mouse driver?

by (Login The-Universe)
Admin

Posted on Jun 15, 2010, 10:09 PM

Respond to this message   

Return to Index


This SUB should display 3 buttons

by (Login burger2227)
R

SUB MouseStart
Regs.AX = 0
CALL INTERRUPT(&H33, Regs, Regs)
IF Regs.AX <> -1 THEN
PRINT "The Cat must have got the mouse!"
ELSE : PRINT "Mouse Found!,"; Regs.BX; "Buttons"
END IF
END SUB



    
This message has been edited by burger2227 on Jun 15, 2010 10:16 PM

Posted on Jun 15, 2010, 10:15 PM

Respond to this message   

Return to Index


Thanks, I ran it and it returned 2 buttons.

by (Login The-Universe)
Admin

Apparently, the mouse driver for the XP is set up in some way that the system cannot detect the middle button, or for some reason, the OS is blocking assess to it.

I get 3 buttons on my 98, though, and the middle button works, go figure.

I used your code in this routine to test both systems:

------------------------------------

DECLARE SUB MDRIVER (EX, B$)

TYPE RegType
AX AS INTEGER
BX AS INTEGER
CX AS INTEGER
DX AS INTEGER
BP AS INTEGER
SI AS INTEGER
DI AS INTEGER
FLAGS AS INTEGER
DS AS INTEGER
ES AS INTEGER
END TYPE

DIM SHARED REGS AS RegType
DIM SHARED LB, RB, MB

CLS
CALL MDRIVER(EX, B$)
SYSTEM

SUB MDRIVER (EX, B$)

REM Clippy's Mouse Button Detection Routine -----------
REGS.AX = 0
CALL INTERRUPT(&H33, REGS, REGS)
IF REGS.AX -1 THEN
PRINT " The Cat must have got the mouse!"
ELSE : PRINT " Mouse Found!": PRINT REGS.BX; "Buttons"
END IF
REM ---------------------------------------------------

X = REGS.BX
DO
REGS.AX = 3
CALL INTERRUPT(&H33, REGS, REGS)
LOCATE 3, 1
LB = REGS.BX AND 1
RB = (REGS.BX AND 2) \ 2
MB = (REGS.BX AND 4) \ 4
SELECT CASE X
CASE 0: EXIT DO
CASE 1: PRINT " Left Button"; LB
CASE 2: PRINT " Left Button"; LB, "Right Button"; RB
CASE 3: PRINT " Left Button"; LB, "Middle Button"; MB, "Right Button"; RB
END SELECT
LOOP
END SUB

-------------------------------------------------------

Thanks for posting it, it was a bigh help. happy.gif

Pete



    
This message has been edited by The-Universe on Jun 16, 2010 1:15 AM

Posted on Jun 16, 2010, 1:11 AM

Respond to this message   

Return to Index


* Your welcome. I use LOCATE before the SUB call to place the PRINTs.

by (Login burger2227)
R

Posted on Jun 16, 2010, 8:54 AM

Respond to this message   

Return to Index

 Copyright © 1999-2014 Network54. All rights reserved.   Terms of Use   Privacy Statement