GithubHelp home page GithubHelp logo

robhagemans / pcbasic Goto Github PK

View Code? Open in Web Editor NEW
356.0 356.0 47.0 18.77 MB

PC-BASIC - A free, cross-platform emulator for the GW-BASIC family of interpreters

Home Page: http://www.pc-basic.org

License: Other

Python 80.24% Shell 0.20% Batchfile 0.01% AGS Script 1.01% BASIC 18.51% FreeBasic 0.02% Visual Basic 6.0 0.03%
basic emulator gwbasic ibm-pc interpreter pcjr python retrocomputing tandy

pcbasic's People

Contributors

andy5995 avatar rbergen avatar robhagemans avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pcbasic's Issues

Unexplainable Windows crash

image
I'm not exactly sure what causes this because it straight-up crashes without any error, but this is the program i'm using. It might have to do with drawing and using play "P8" to wait between screen updates.

10 screen 1: cls: line (0,0)-(320,200),0,bf
15 let kee$=inkey$
20 locate 23,1:print "loading... plz wait - press q to quit"
30 for x=100 to 0 step -1
40 let c=c+1
50 if c>3 then: let c=0
60 line (x,x)-(0,0),c,bf
70 next
80 if (kee$="q") or (kee$="Q") then: cls: end
80 play "P8"
90 goto 15

Before, it crashed a few seconds after starting, and with this slightly-different code (which is different because PC-BASIC crashed so I couldn't recover my program), it now crashes when I press a key.
I couldn't find any log files in C:\Program Files (x86)\PC-BASIC or %USERPROFILE%, so good luck figuring out why exactly this causes a crash.

Crash when assigning to KEY$

I didn't realise that KEY was a reserved KEYword (pun intended) so I had a KEY$=INKEY$ in the code which resulted in a hard crash.

PC-BASIC 15.08.3                                                                
(C) Copyright 2013--2015 Rob Hagemans.                                          
60300 Bytes free                                                                
Ok                                                                              
KEY$="Me so stupid..."  
2016-01-08 12:22:37.473 pcbasic[29835:1095836] 12:22:37.473 WARNING:  140: This application, or a library it uses, is using the deprecated Carbon Component Manager for hosting Audio Units. Support for this will be removed in a future release. Also, this makes the host incompatible with version 3 audio units. Please transition to the API's in AudioComponent.h.
ERROR: Unhandled exception
Traceback (most recent call last):
  File "/Users/rob/pc-basic/packaging/osx/build/installer/out00-PYZ.pyz/pcbasic.__main__", line 169, in start_basic
  File "/Users/rob/pc-basic/packaging/osx/build/installer/out00-PYZ.pyz/pcbasic.run", line 46, in start
  File "/Users/rob/pc-basic/packaging/osx/build/installer/out00-PYZ.pyz/pcbasic.run", line 60, in run_once
  File "/Users/rob/pc-basic/packaging/osx/build/installer/out00-PYZ.pyz/pcbasic.statements", line 170, in parse_statement
  File "/Users/rob/pc-basic/packaging/osx/build/installer/out00-PYZ.pyz/pcbasic.statements", line 2255, in exec_key
  File "/Users/rob/pc-basic/packaging/osx/build/installer/out00-PYZ.pyz/pcbasic.statements", line 2260, in exec_key_define
  File "/Users/rob/pc-basic/packaging/osx/build/installer/out00-PYZ.pyz/pcbasic.expressions", line 111, in parse_expression
  File "/Users/rob/pc-basic/packaging/osx/build/installer/out00-PYZ.pyz/pcbasic.expressions", line 119, in parse_operators
  File "/Users/rob/pc-basic/packaging/osx/build/installer/out00-PYZ.pyz/pcbasic.expressions", line 920, in value_operator
  File "/Users/rob/pc-basic/packaging/osx/build/installer/out00-PYZ.pyz/pcbasic.vartypes", line 306, in equals
TypeError: 'NoneType' object is not subscriptable
'```

EDIT statement causes PC-BASIC to crash when a protected file is loaded and `--strict-protect` is on

https://sourceforge.net/p/pcbasic/discussion/bugs/thread/c42d61f4/

To reproduce the bug, simply create any sort of program, even a simple

10 print "Hello world!"

will do. Then, save it as a protected file:

save "HELLO",P

Finally, start PC-BASIC with --strict-protect, load the file, and try to use an EDIT statement:

LOAD "HELLO"
EDIT 10

PC-BASIC will crash. The expected result is probably "Illegal function call", however.

Windows 10 makes INI file hard to access

moved from robhagemans/robhagemans.github.io@532e6c3#commitcomment-21778772

This is not the place for my comments, but this is the first place I found that might get a response from Rob. Your PC-BASIC looks like it will allow me to continue to use my 35 year old programs. Great! the problem I have is the limit on printing. I cannot get the print-trigger=page option to work. I am using windows 10. I found and made changes to the INI file. Nothing seems to have effect. I went so far as to put the options in the Defailt file, still no change. I m unable to start PCBASIC from my command prompt either. Any Help? I have joined GitHub as BigJoe3, Thanks

Error on install on Ubuntu 14.04 LTS

I found your PCBasic app and desired to try it. However, I can't seem to install it. I've installed the prerequisites and downloaded the ansipipe.py file and placed it in the pcbasic subfolder of the root compressed folder. I then tried to run pcbasic.py and setup.py (Manual says install.py which I can't seem to locate in the folder structure... ). My attempt resulted in a BSOD that pointed me to the following log file info:

PC-BASIC crash log

EXCEPTION
version 16.12.0rc0
platform Linux-4.4.0-97-generic-x86_64-with-Ubuntu-14.04-trusty
statement

values.py:89, wrapped_fn
values.py:262, from_repr
numbers.py:264, from_str
numbers.py:171, from_int
TypeError: expected a writeable buffer object

This is a bug in PC-BASIC.
Sorry about that. Please file a bug report at
https://github.com/robhagemans/pcbasic/issues
Please include the messages above and as much information as you can about what you were doing and how this happened. If possible, please attach the log file
/home/ - replaced for security - /.local/share/pcbasic-dev/pcbasic-crash-20171017-9wnEAk.log
This file contains detailed information about your program and this crash.
Thank you!

Traceback (most recent call last):
File "/home/ - replaced for security - /pcbasic-master/pcbasic/basic/session.py", line 382, in _handle_exceptions
yield
File "/home/ - replaced for security - /pcbasic-master/pcbasic/basic/session.py", line 298, in interact
self._prompt = not self._store_line(line)
File "/home/ - replaced for security - /pcbasic-master/pcbasic/basic/session.py", line 326, in _store_line
self.interpreter.direct_line = self.tokeniser.tokenise_line(line)
File "/home/ - replaced for security - /pcbasic-master/pcbasic/basic/converter/tokeniser.py", line 117, in tokenise_line
outs.write(self.tokenise_number(ins))
File "/home/ - replaced for security - /pcbasic-master/pcbasic/basic/converter/tokeniser.py", line 280, in tokenise_number
PC-BASIC crash log

EXCEPTION
version 16.12.0rc0
platform Linux-4.4.0-97-generic-x86_64-with-Ubuntu-14.04-trusty
statement

values.py:89, wrapped_fn
values.py:262, from_repr
numbers.py:264, from_str
numbers.py:171, from_int
TypeError: expected a writeable buffer object

This is a bug in PC-BASIC.
Sorry about that. Please file a bug report at
https://github.com/robhagemans/pcbasic/issues
Ple return self._values.from_repr(word, allow_nonnum=False).to_token()
File "/home/ - replaced for security - /pcbasic-master/pcbasic/basic/values/values.py", line 89, in wrapped_fn
return fn(*args, **kwargs)
File "/home/ - replaced for security - /pcbasic-master/pcbasic/basic/values/values.py", line 262, in from_repr
return self.new_integer().from_str(word)
File "/home/ - replaced for security - /pcbasic-master/pcbasic/basic/values/numbers.py", line 264, in from_str
return self.from_int(int(dec_repr.strip(BLANKS)))
File "/home/ - replaced for security - /pcbasic-master/pcbasic/basic/values/numbers.py", line 171, in from_int
struct.pack_into(intformat, self._buffer, 0, in_int)
TypeError: expected a writeable buffer object

==== Screen ========================================================================================
+--------------------------------------------------------------------------------+
1|EXCEPTION \ 9
2\version 16.12.0rc0 \ 20
3\platform Linux-4.4.0-97-generic-x86_64-with-Ubuntu-14.04-trusty \ 64
4\statement \ 10
5\ \ 0
6\values.py:89, wrapped_fn \ 24
7\values.py:262, from_repr \ 24
8\numbers.py:264, from_str \ 24
9\numbers.py:171, from_int \ 24
10\TypeError: expected a writeable buffer object \ 45
11\ \ 0
12\This is a bug in PC-BASIC. \ 26
13\Sorry about that. Please file a bug report at \ 45
14\ https://github.com/robhagemans/pcbasic/issues \ 47
15\Please include the messages above and as much information as you can about what \ 80
16\you were doing and how this happened. If possible, please attach the log file \ 77
17\ /home/ - replaced for security - /.local/share/pcbasic-dev/pcbasic-crash-20171017-H3rCp8.log \ 72
18\This file contains detailed information about your program and this crash. \ 74
19\Thank you! | 10
20|Okÿ | 3
21|10 print 5 | 10
22| | 0
23| | 0
24| | 0
25| | 0
+--------------------------------------------------------------------------------+
==== Scalars =======================================================================================

==== Arrays ========================================================================================

==== Strings =======================================================================================

==== Program Buffer ================================================================================
00 0000 (ENDS)
==== Program =======================================================================================
==== Options =======================================================================================
[u'pcbasic.py']

Failed to initialise sound.

Release: 15.8.10
Plateform: win 10 (64bit)

I am getting following warning constantly
WARNING: Failed to initialise sound. Sound will be disabled.

When running pcbasic with this conmmand
pcbasic -bqe="beep" --nosound=false

and also no beep is produced

Require Python 2.7.12+ for PC-BASIC 16.12

Older versions of Python make PC-BASIC crash due to http://bugs.python.org/issue22113
which was solved in 2.7.12:

  • Issue #22113: struct.pack_into() now supports new buffer protocol (in particular accepts writable memoryview).

Include requirement in docs, & installer. Check on startup and fail gracefully, avoid confusing crash message.

Leading padding in printing output

When I output something simple by printing it with either "LPRINT" or printing a listing with "LLIST", each line gets padded with leading NULL 0's in text file output, and whitespace in printing output. The number of padded characters is increased with each new line printed (see attached file). Is this a bug, or a feature I don't understand?
test_output.zip

Crash on PLAY "P"

16.12:

EXCEPTIONversion   16.12.0rc0platform  Linux-4.4.0-66-generic-x86_64-with-Ubuntu-16.04-xenialstatement :PLAY "p" interpreter.py:107, loopinterpreter.py:96, parsestatements.py:90, parse_statementsound.py:347, play_UnboundLocalError: local variable 'length' referenced before assignment

15.08:

EXCEPTION                                                                       
:PLAY "p"                                                                                                                                                       
run.py:66, run_once                                                             
    if not statements.parse_statement():                                        
statements.py:198, parse_statement                                              
    elif c == tk.PLAY:    exec_play(ins)                                        
statements.py:574, exec_play                                                    
    state.console_state.sound.play((mml0, mml1, mml2))                          
sound.py:318, play                                                              
    if length > 0:                                                              
UnboundLocalError: local variable 'length' referenced before assignment    

cannot loading file even path exist

version: 15.8.10
platform: win 10 (64 bit)

getting Path not found when calling pcbasic with --run="D:\path\to\a.BAS" but the a.bas is present here. i also tried / and \\ instead of \. but getting same error.

when i call pcbasic**.exe** with same parameters the pcbasic just run and than closes automatically without displaying any message

Crash when copying text from top right to bottom left in SCREEN 1

On screen 1, with the mouse select from top-right corner to the end (line 25) at the bottom-left corner release the left-click of mouse.

In 15.08.11:

EXCEPTION                                                                       
:SCREEN 1                                                                                                                                                       
video_pygame.py:948, check_events                                               
    clipboard.copy(mouse=True)                                                  
video_pygame.py:1140, copy                                                      
    backend.copy_clipboard(start[0], start[1], stop[0], stop[1]-1, mouse)       
backend.py:642, copy_clipboard                                                  
    start_row, start_col, stop_row, stop_col), mouse)                           
backend.py:1218, get_text                                                       
    if self.vpage.row[r-1].double[c-1] == 2:                                    
IndexError: list index out of range    

In 16.12:

EXCEPTIONversion   16.12.0rc0platform  Linux-4.4.0-66-generic-x86_64-with-Ubuntu-16.04-  xenialstatement :SCREEN 1 inputmethods.py:100, waitinputmethods.py:111, check_eventsinputmethods.py:156, _check_inputdisplay.py:1606, get_textIndexError: list index out of range

cannot run program using run parameter

version: 15.8.10
platform: windows 10 (64 bit)

getting following error when calling pcbasic with --load="a.bas".

ERROR: Unhandled exception
Traceback (most recent call last):
  File "E:\branch1508\packaging\windows\build\installer\out00-PYZ.pyz\pcbasic.__main__", line 164, in start_basic
  File "E:\branch1508\packaging\windows\build\installer\out00-PYZ.pyz\pcbasic.__main__", line 316, in open_native_or_doe
  File "E:\branch1508\packaging\windows\build\installer\out00-PYZ.pyz\pcbasic.devices", line 97, in open_file
  File "E:\branch1508\packaging\windows\build\installer\out00-PYZ.pyz\pcbasic.disk", line 440, in open
  File "E:\branch1508\packaging\windows\build\installer\out00-PYZ.pyz\pcbasic.disk", line 647, in open_diskfile
IOError: [Errno 22] Invalid argument

"a.bas" doesn't exist but i think it must raise ERROR: Path not found error as in previous verisons

15.08.11 regression: SHELL command fails on Windows with shell=native

See https://sourceforge.net/p/pcbasic/discussion/general/thread/550a1227/

On Windows, when setting shell=native, the SHELL command does not show a prompt but rather opens an empty and unresponsive CMD window. Linux is not affected.

This looks like it may be related to commit 8f251aa which supposedly fixed a problem where SHELL "start notepad" blocked until the notepad application had finished.
Perhaps this one: https://sourceforge.net/p/pcbasic/discussion/general/thread/8ea835c8

Not sure if both issues can be solved at once

See also here: https://sourceforge.net/p/pcbasic/discussion/bugs/thread/b1d43fc6

Accented French characters in PC-Basic

Trying to use codepage 850 or 863, the French accented characters are shown on the screen preceded by an apostrophe or a bracket ( Seems default codepage 437 does the same )
à appears as `à
ô also shown as [ô

è gives `è

and â appears as [â
The characters are produced by a combination of two keys and the printed result is the first key itself followed by the character

also, I cannot get uppercase accented characters for those letters.

I use Win 7 Pro

Thank you for your attention.
Claude

IF ... == ... raises exception (?)

I was tinkering and typed something like this into the command line (i.e. "immediate mode" or something, I guess):

if "STRING ONE" == "STRING TWO" then print "UH OH"

I got this (copied from the console, not the PCBASIC window, but it's the same thing really):

ERROR: Traceback (most recent call last):
  File "build/pcbasic/run.py", line 66, in run_once
  File "build/pcbasic/statements.py", line 114, in parse_statement
  File "build/pcbasic/statements.py", line 1563, in exec_if
  File "build/pcbasic/expressions.py", line 117, in parse_expression
KeyError: '\xe7\xe7'

I have no idea what this means (that is, I don't know how PCBASIC works on the inside, so it's just a cryptic KeyError to me.) I assumed that meant you might want to hear about it.

I've tested with a few other immediate mode IF statements and equality (empty strings, arbitrary strings, numbers...) and PRINT, same result.

It seems like using a single = actually works as expected. So the error is just down to my not being so familiar with BASIC. Still I would expect a Syntax error or something, not this, so maybe it's worth hearing about. I don't know. Doing this in GWBASIC in DOSBOX (yes... I have no good reason to do this, I know...) does seem to give an ordinary syntax error.

I'm using the stable release version (0.15*.) I'm not using the 0.16 version because it froze up my computer multiple times when I tried.

The very first ON TIMER(n) statement gets trapped immediately

Reported by Francis Lee https://sourceforge.net/p/pcbasic/discussion/bugs/thread/8249e7f7/

I was learning and testing ON KEY / ON TIMER statement, and I believe I found a bug in ON TIMER(n) stetement implementation. Below is the code I was experimenting with:

10 CLS
15 PRINT "Press UP arrow key to exit...
20 ON KEY(11) GOSUB 80
30 KEY(11) ON
32 ON TIMER(1) GOSUB 100
34 TIMER ON
40 FOR I=1 TO 10
50 PRINT "Hello, World!
60 NEXT I
70 GOTO 70
80 KEY(11) OFF:PRINT "Removing KEY(11) trap setting...
90 END
100 PRINT "Hello, every one second!
110 RETURN 70 'go to infinite loop

I was expecting "Hello, World!" to be printed first 10 times, followed by "Hello, every one second!" later every one second, however, "Hello, World!" never gets printed at all. "Hello, every one second!" gets printed immediately after TIMER ON statement. BTW, print statement without the terminating double quote was written intentionally in such style after learning that LOAD/SAVE/CHDIR statement works fine like.

error when try acess port com1

I have a basica code who already run ok on ms-dos, but im trying to make it running on windows, and using pc-basic i put on pcbasic.ini the following line

com1=PORT:COM2

and my port com2 its a serial usb, i load the program and when i run i got
bug_pcbasic

DEBUG: watches don't work (16.12)

_debug "watch('ve');"

DEBUG: <type 'exceptions.AttributeError'> 'Session' object has no attribute 'expression_parser'
  File "/home/rob/Projects/basic-project/pc-basic/pcbasic/basic/debug.py", line 220, in debug_step
    val = self.session.expression_parser.parse(outs)

Improve default config file and INI file documentation

Make default config file clearer for users who do not know INI files and/or do not read documentation.
Clarify in file and documentation that # introduces a comment and leading # and whitespace must be removed to activate an option.

Perhaps show command-line errors on start screen as well so they do not get lost.

error: video system not initialized

I'm trying to get this running in a docker container. I start with the python:2 official docker image as a base and layer on the prerequisites and install pcbasic. When I create a new container and try to run a script, I get the following.

Traceback (most recent call last):
  File "build/pcbasic/__main__.py", line 148, in start_basic
  File "build/pcbasic/__main__.py", line 265, in prepare_console
  File "build/pcbasic/backend.py", line 837, in init_video
  File "build/pcbasic/video_pygame.py", line 336, in init
error: video system not initialized

I modified the installation script so that it would work non-interactively using the defaults. This is the output of the installation process.

Step 10/10 : RUN ./install-noprompt.sh
 ---> Running in b8fa1d1dd03f
cat: data/VERSION: No such file or directory
INSTALLATION SCRIPT

APT package manager found

SUMMARY OF WHAT WILL BE DONE:
I will install PC-BASIC to directory /opt/pcbasic/
I will create a symbolic link /usr/bin/pcbasic
I will create a symbolic link /usr/share/man/man1/pcbasic.1.gz
I will create a desktop menu entry /usr/share/applications/pcbasic.desktop
I will create an icon /usr/share/icons/pcbasic.png
I will create an uninstall script /opt/pcbasic//uninstall.sh
I will install the packages python2.7 python-xdg python-pygame python-numpy python-serial python-parallel python-pexpect xsel

Installing APT packages python2.7 python-xdg python-pygame python-numpy python-serial python-parallel python-pexpect xsel ...
Reading package lists...
Building dependency tree...
Reading state information...
python2.7 is already the newest version.
python2.7 set to manually installed.
The following extra packages will be installed:
  dbus fonts-freefont-ttf libasound2 libasound2-data libasyncns0
  libblas-common libblas3 libcaca0 libcap-ng0 libdbus-1-3 libdirectfb-1.2-9
  libflac8 libfluidsynth1 libgfortran3 libjack-jackd2-0 libjson-c2 liblapack3
  libmad0 libmikmod3 libogg0 libopenal-data libopenal1 libopus0 libportmidi0
  libpulse0 libsamplerate0 libsdl-image1.2 libsdl-mixer1.2 libsdl-ttf2.0-0
  libsdl1.2debian libsmpeg0 libsndfile1 libvorbis0a libvorbisenc2
  libvorbisfile3 libwrap0 libx11-xcb1 libxi6 libxtst6 musescore-soundfont-gm
  tcpd
Suggested packages:
  dbus-x11 libasound2-plugins alsa-utils jackd2 libportaudio2 opus-tools
  pulseaudio fluidsynth timidity gfortran python-dev python-nose
  python-numpy-dbg python-numpy-doc python-pexpect-doc python-wxgtk3.0
  python-wxgtk
The following NEW packages will be installed:
  dbus fonts-freefont-ttf libasound2 libasound2-data libasyncns0
  libblas-common libblas3 libcaca0 libcap-ng0 libdbus-1-3 libdirectfb-1.2-9
  libflac8 libfluidsynth1 libgfortran3 libjack-jackd2-0 libjson-c2 liblapack3
  libmad0 libmikmod3 libogg0 libopenal-data libopenal1 libopus0 libportmidi0
  libpulse0 libsamplerate0 libsdl-image1.2 libsdl-mixer1.2 libsdl-ttf2.0-0
  libsdl1.2debian libsmpeg0 libsndfile1 libvorbis0a libvorbisenc2
  libvorbisfile3 libwrap0 libx11-xcb1 libxi6 libxtst6 musescore-soundfont-gm
  python-numpy python-parallel python-pexpect python-pygame python-serial
  python-xdg tcpd xsel
0 upgraded, 48 newly installed, 0 to remove and 28 not upgraded.
Need to get 21.3 MB of archives.
After this operation, 55.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] Abort.

Compiling Python modules ...
Listing build/ ...
Listing build/doc ...
Listing build/pcbasic ...
Compiling build/pcbasic/__init__.py ...
Compiling build/pcbasic/__main__.py ...
Compiling build/pcbasic/ansi.py ...
Compiling build/pcbasic/ansipipe.py ...
Compiling build/pcbasic/audio_beep.py ...
Compiling build/pcbasic/audio_none.py ...
Compiling build/pcbasic/audio_pygame.py ...
Compiling build/pcbasic/backend.py ...
Compiling build/pcbasic/basictoken.py ...
Compiling build/pcbasic/bytestream.py ...
Compiling build/pcbasic/cassette.py ...
Compiling build/pcbasic/clipboard.py ...
Listing build/pcbasic/codepage ...
Compiling build/pcbasic/config.py ...
Compiling build/pcbasic/console.py ...
Listing build/pcbasic/data ...
Compiling build/pcbasic/debug.py ...
Compiling build/pcbasic/devices.py ...
Compiling build/pcbasic/disk.py ...
Compiling build/pcbasic/draw_and_play.py ...
Compiling build/pcbasic/error.py ...
Compiling build/pcbasic/expressions.py ...
Compiling build/pcbasic/flow.py ...
Listing build/pcbasic/font ...
Compiling build/pcbasic/fp.py ...
Compiling build/pcbasic/graphics.py ...
Compiling build/pcbasic/machine.py ...
Compiling build/pcbasic/memory.py ...
Compiling build/pcbasic/modes.py ...
Compiling build/pcbasic/plat.py ...
Compiling build/pcbasic/ports.py ...
Compiling build/pcbasic/print_and_input.py ...
Compiling build/pcbasic/printer.py ...
Compiling build/pcbasic/program.py ...
Compiling build/pcbasic/protect.py ...
Compiling build/pcbasic/pygame_android.py ...
Compiling build/pcbasic/redirect.py ...
Compiling build/pcbasic/representation.py ...
Compiling build/pcbasic/reset.py ...
Compiling build/pcbasic/rnd.py ...
Compiling build/pcbasic/run.py ...
Compiling build/pcbasic/scancode.py ...
Compiling build/pcbasic/shell.py ...
Compiling build/pcbasic/sound.py ...
Compiling build/pcbasic/state.py ...
Compiling build/pcbasic/statements.py ...
Compiling build/pcbasic/timedate.py ...
Compiling build/pcbasic/tokenise.py ...
Compiling build/pcbasic/typeface.py ...
Compiling build/pcbasic/unicodepage.py ...
Compiling build/pcbasic/util.py ...
Compiling build/pcbasic/var.py ...
Compiling build/pcbasic/vartypes.py ...
Compiling build/pcbasic/video_ansi.py ...
Compiling build/pcbasic/video_cli.py ...
Compiling build/pcbasic/video_curses.py ...
Compiling build/pcbasic/video_none.py ...
Compiling build/pcbasic/video_pygame.py ...
Compiling build/pcbasic.py ...

Copying program files ...
Creating symlinks ...
Creating menu entry ...
Creating icon ...
Creating uninstaller ...



10      CLS
Checking dependencies ...
checking Python module xdg ... installed
checking Python module pygame ... installed
checking Python module numpy ... installed
checking Python module serial ... NOT INSTALLED
checking Python module parallel ... NOT INSTALLED
checking Python module pexpect ... installed

WARNING: The following Python modules were not found:  serial parallel
Please install them separately to ensure all PC-BASIC functionality works correctly.

INSTALLATION COMPLETED.

Any ideas?

16.12: String temporaries overwrite permanent strings

the function clear in pcbasic\basic\memory\memory.py, should clear all the non persistent variables after each session loop. It triggers the function _preserve_scalars in pcbasic\basic\memory\memory.py:

@contextmanager
def _preserve_scalars(self, names, string_store):
"""Preserve COMMON variables."""
# copy all variables that need to be preserved
common = {name: self.scalars.get(name)
for name in names if name in self.scalars}
yield
for name, value in common.iteritems():
if name[-1] == '$':

            #length, address = self.strings.copy_to(string_store, *value.to_pointer()) #Original
            #value = self.values.new_string().from_pointer(length, address) #Original

            #Issue: The value of the strings appears as 'detached' after the copy to string_store, and therefore they are not preserved correctly. This has to be fixed, if not the value is lost. Alternative:
            #1- Obtain the memory pointer and len of the actual value
            #2- Copy the value to the string_store, and obtain the new length and new memory address in this new store.
            #3- Update the value info with the new memory address

            length1, address1 = value.to_pointer()
            length2, address2 = self.strings.copy_to(string_store, length=length1,address=address1)
            value =self.values.from_str_at(string_store._strings[address2], address2)

        self.scalars.set(name, value)

is this solution good enough?
In this reassignment, what is the goal?, I understand that it is copying only the values of the persistent strings to new memory addresses, update the binding value-address, and then clearing all the old values and addresses that should not be persistent, not?.

Copy-paste in 16.12 omits newlines

Copying from exception screen in 16.12, the text pasted does not include newlines:

EXCEPTIONversion   16.12.0rc0platform  Linux-4.4.0-66-generic-x86_64-with-Ubuntu-16.04-xenialstatement :SCREEN 1 inputmethods.py:100, waitinputmethods.py:111, check_eventsinputmethods.py:156, _check_inputdisplay.py:1606, get_textIndexError: list index out of range This is a bug in PC-BASIC.Sorry about that. Please file a bug report at  https://github.com/robhagemans/pcbasic/issuesPlease include the messages above and as much information as you can about what you were doing and how this happened. If possible, please attach the log file  /home/rob/.local/share/pcbasic-dev/pcbasic-crash-20170612-BRWE2D.logThis file contains detailed information about your program and this crash.Thank you!

Ok 

Compile source code

Hi,
I am trying to compile the source code but I do not know exactly how to do that. I have tried to execute "/packaging/source/build.sh" script but it fails. I am using Ubuntu 15.04 and I have already install all the dependencies, that are needed.

Thanks =D

Crash on resuming during program run (16.12 regression)

10 for i = 1to 10000:print i: next

Ctrl+C during run

./pcbasic.py --resume
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/rob/Projects/basic-project/pc-basic/pcbasic/main.py", line 157, in run_session
    session = state.zunpickle(state_file).attach(iface)
  File "/home/rob/Projects/basic-project/pc-basic/pcbasic/state.py", line 82, in zunpickle
    return pickle.loads(zlib.decompress(f.read()))
TypeError: Required argument 'object' (pos 1) not found

Holding button during beep loop causes crash

image
Specifically: My code will let you hold down a button and it will beep after a counter goes up to 22 (starting at 3), so holding down the button when the counter is up will cause this crash.
I made a special program that's only purpose is to cause this crash:

10 LET KEE$=INKEY$
20 IF KEE$="c" THEN: BEEP
30 GOTO 10

Hold C to trigger it.
I have tested this in GWBASIC, and it does not cause any crash, only extreme ear pain.

Crash in TVIEW.BAS

https://sourceforge.net/p/pcbasic/discussion/general/thread/6270c85d/


10:45:52 rob@bandicoot:~/Downloads/TVIEW_85.ZIP.1$ ~/Projects/basic-project/pc-basic/pcbasic.py -l=TVIEW.BAS --preset=pcjr
ERROR: Traceback (most recent call last):
  File "/home/rob/Projects/basic-project/pc-basic/pcbasic/basic/session.py", line 381, in _handle_exceptions
    yield
  File "/home/rob/Projects/basic-project/pc-basic/pcbasic/basic/session.py", line 291, in interact
    self.interpreter.loop()
  File "/home/rob/Projects/basic-project/pc-basic/pcbasic/basic/interpreter.py", line 107, in loop
    self.parse()
  File "/home/rob/Projects/basic-project/pc-basic/pcbasic/basic/interpreter.py", line 96, in parse
    self.parser.parse_statement(ins)
  File "/home/rob/Projects/basic-project/pc-basic/pcbasic/basic/parser/statements.py", line 90, in parse_statement
    self._callbacks[c](parse_args(ins))
  File "/home/rob/Projects/basic-project/pc-basic/pcbasic/basic/display.py", line 681, in screen_
    self.screen(mode, colorswitch, apagenum, vpagenum, erase)
  File "/home/rob/Projects/basic-project/pc-basic/pcbasic/basic/display.py", line 755, in screen
    self.mode.video_segment*0x10, self.video_mem_size)
  File "/home/rob/Projects/basic-project/pc-basic/pcbasic/basic/modes.py", line 311, in get_memory
    bytes = [0]*num_bytes
TypeError: can't multiply sequence by non-int of type 'float'


10:46:48 rob@bandicoot:~/Downloads/TVIEW_85.ZIP.1$ ~/Projects/basic-project/branch1508/pcbasic.py -l=TVIEW.BAS --preset=pcjr
ERROR: Traceback (most recent call last):
  File "/home/rob/Projects/basic-project/branch1508/pcbasic/run.py", line 66, in run_once
    if not statements.parse_statement():
  File "/home/rob/Projects/basic-project/branch1508/pcbasic/statements.py", line 169, in parse_statement
    elif c == tk.SCREEN:    exec_screen(ins)
  File "/home/rob/Projects/basic-project/branch1508/pcbasic/statements.py", line 2501, in exec_screen
    screen.screen(mode, color, apagenum, vpagenum, erase)
  File "/home/rob/Projects/basic-project/branch1508/pcbasic/backend.py", line 1026, in screen
    self.mode.set_memory(self.mode.video_segment*0x10, save_mem)
  File "/home/rob/Projects/basic-project/branch1508/pcbasic/modes.py", line 688, in set_memory
    bytes_to_interval(bytes[ofs:ofs+length], self.ppb))
  File "/home/rob/Projects/basic-project/branch1508/pcbasic/backend.py", line 1355, in put_interval
    video.put_interval(pagenum, x, y, colours, mask)
  File "/home/rob/Projects/basic-project/branch1508/pcbasic/video_pygame.py", line 1272, in put_interval
    ref |= colours
TypeError: ufunc 'bitwise_or' output (typecode 'l') could not be coerced to provided output parameter (typecode 'B') according to the casting rule ''same_kind''


PC-Basic Bug

I wrote a little program to approximate Pi. I received an error message about a bug in PC-Basic.

100 K=-1
102 PI#=0#
105 K=K+1
106 IF K=101 THEN GOTO 150
110 L=2K+1
115 PI#=PI#+4#
((-1)^K/L*(1#/(2#^L)+1#/(3#^L))
130 PRINT "K= ";K;"PI= ";PI#
140 GOTO 105
150 END

William

TypeError

As I was entering simple programs to test new things, specifically printing with lprint, I came across this error:

EXCEPTION
version 16.12.0rc0
platform Windows-10-10.0.14393-SP0
statement 30 LPRINT "X is ", X

statements.py:90, parse_statement
files.py:649, lprint_
formatter.py:32, format
formatter.py:65, _print_comma
TypeError: write() got an unexpected keyword argument 'can_break'
This is a bug in PC-BASIC.Sorry about that.

I am wondering if it is even allowed to use a comma in lprint output formatting, but I am new and still learning how everything works, so I was trying new things with formatting and printing.

pcbasic-crash-20161208-1a4hjk.zip

In case it matters, I have printing redirected to a file "output.txt" as I don't even have a printer right now.

Commenting out ansipipe leads to an error.

Hi,
I tested this in Ubuntu in WSL (AKA BashOnWindows) on Windows 10 and it worked well! Now I wanted to test it on my web hotel https://www.one.com/ via ssh, but then git clone --recursive didn't work completely, see error below. The problems are with ansipipe. Since this web hotel doesn't have gcc I doubt that ansipipe could work even if I could download it because it seems to be a C program in source form. I saw you mentioned in #1 that ansipipe was not necessary and could be commented out. I did this in the file ./pcbasic/main.py , but that led to an error. I could type system to quit BASIC.

  EXCEPTION
  version   16.12.0rc0
  platform  Linux-4.4.39-20170104-1142-143834a-x86_64-with-glibc2.7
  statement

  values.py:89, wrapped_fn
  values.py:262, from_repr
  numbers.py:264, from_str
  numbers.py:171, from_int
  TypeError: expected a writeable buffer object

  This is a bug in PC-BASIC.
  Sorry about that. Please file a bug report at
    https://github.com/robhagemans/pcbasic/issues
  Please include the messages above and as much information as you can about wha  you were doing and how this happened. If possible, please attach the log file
    /home/orbin.se/.local/share/pcbasic-dev/pcbasic-crash-20170925-Q1jBwI.log
  This file contains detailed information about your program and this crash.
  Thank you!
  Ok?

$ git clone --recursive https://github.com/robhagemans/pcbasic
Cloning into 'pcbasic'...
remote: Counting objects: 32393, done.
remote: Total 32393 (delta 0), reused 0 (delta 0), pack-reused 32393
Receiving objects: 100% (32393/32393), 12.08 MiB | 6.00 MiB/s, done.
Resolving deltas: 100% (22432/22432), done.
Checking out files: 100% (2386/2386), done.
Submodule 'ansipipe' (git://github.com/robhagemans/ansipipe.git) registered for path 'pcbasic/ansipipe'
Cloning into 'pcbasic/ansipipe'...
fatal: unable to connect to github.com:
github.com[0: 192.30.253.113]: errno=Connection timed out
github.com[1: 192.30.253.112]: errno=Connection timed out

Clone of 'git://github.com/robhagemans/ansipipe.git' into submodule path 'pcbasic/ansipipe' failed
$ arch
x86_64

16.12 regression: `--keys` crashes with non-ascii arguments

../pcbasic.py --keys="£"
ERROR: Unhandled exception
Traceback (most recent call last):
  File "/home/rob/Projects/basic-project/pc-basic/pcbasic/main.py", line 33, in main
    run(*arguments)
  File "/home/rob/Projects/basic-project/pc-basic/pcbasic/main.py", line 69, in run
    launch_session(settings)
  File "/home/rob/Projects/basic-project/pc-basic/pcbasic/main.py", line 142, in launch_session
    kwargs=settings.get_launch_parameters())
  File "/home/rob/Projects/basic-project/pc-basic/pcbasic/config.py", line 559, in get_launch_parameters
    launch_params.update(self.get_session_parameters())
  File "/home/rob/Projects/basic-project/pc-basic/pcbasic/config.py", line 462, in get_session_parameters
    'keystring': self.get('keys').decode('string_escape').decode('utf-8'),
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa3' in position 0: ordinal not in range(128)

getting path not found even file exists

version: 15.8.9-10
platform: windows 10 (32 bit)

I again getting file not found even file exists and also not empty. Command used

"D:\Documents\Nauman Umer\New folder\electron-quick-start\PC-BASIC\pcbasic.com" --load="D:\Documents\Nauman Umer\New folder\electron-quick-start\PC-BASIC\ART.BAS" --convert=A

File:
ART.zip
snap:
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.