Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 19:38 27 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : MMBasic for Windows - betas

     Page 12 of 30    
Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4043
Posted: 12:04pm 22 Mar 2022
Copy link to clipboard 
Print this post

  matherp said  It won't work on anything that tests for CurrentLinePtr


Right, so the issue is that in MMB4W the implementation of OPTION CONSOLE SERIAL checks CurrentLinePtr because calling it outside a program would be a "bad idea" (TM) because MMB4W doesn't have a "proper" serial console.

Thanks,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9124
Posted: 12:05pm 22 Mar 2022
Copy link to clipboard 
Print this post

This does the same on CMM2

select case 1
case 1:option y_axis up
end select
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4043
Posted: 12:47pm 22 Mar 2022
Copy link to clipboard 
Print this post

It's a slow work day, try this:

> list
Option Console Both
Dim f$ = Dir$(Cwd$ + "/*.no-match")
Print "{" f$ "}"
>
> run
{,C:\home-thwill\git_sandbox\github/*.no-match}
>


Output should be, and is on the CMM2:

> run
{}
>


Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3150
Posted: 01:04pm 22 Mar 2022
Copy link to clipboard 
Print this post

  matherp said  The workround is to put the OPTION on a separate line from the case.

This is a good point to note. I'm frequently guilty of that construction, and don't know that I've been bitten, but I'll avoid it in the future.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1101
Posted: 11:28pm 02 Apr 2022
Copy link to clipboard 
Print this post

Problem with EDIT in 5.07.03b7.
Running MMBasic 5.07.03b7 under wine in Linux Mint 20.3.
When entering the editor 'EDIT', however many lines are entered, only the first line is saved.

EDIT works correctly under Windows 11 so I assume it is related to CR/LF issues between Linux and Windows.

It also works correctly under Linux in 5.07.03b2.

I realise that the W in the MMB4W means the program is written for Windows but it used to work under wine/Linux in earlier versions and now fails with b7 - any possibility of a fix?

Thanks,
Doug.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9124
Posted: 09:35am 03 Apr 2022
Copy link to clipboard 
Print this post

V5.07.03b8


MMBasic.zip


Fixes various bugs identified above
Fixes a difference in wine and normal windows in the treatment of fflush on a file open for read
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1101
Posted: 11:30pm 03 Apr 2022
Copy link to clipboard 
Print this post

  matherp said  V5.07.03b8

Fixes a difference in wine and normal windows in the treatment of fflush on a file open for read


Thanks Peter, all good with MMB4W b8 under wine.

Doug.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 479
Posted: 04:38am 04 Apr 2022
Copy link to clipboard 
Print this post

Hey Peter

I discover two issues running the MMBasic on wine (I don't know if they happen on Windows)

1) The page copy seems to do not respect the B argument. It is generating rendering artifacts.






option explicit
dim c,k1%,k2%
mode 3,1 ' 320x200
page write 1

do while 1
 timer=0
 ' Keyboard
 k1%=keydown(1):k2%=keydown(2)
 if k1%=120 then exit do

 ' Draw scene
 box 0,0,mm.hres,mm.vres/2,,rgb(cyan),rgb(cyan)
 box 0,mm.vres/2,mm.hres,mm.vres/2,,rgb(green),rgb(green)
 for c = 0 to MM.HRES
   line c,30,c,170,1,rgb(blue)
 next c  
 ? @(0,0) str$(1000/timer,0,2) ' FPS
 ' Copy memory page to screen
 page copy 1 to 0,b
loop

page write 0
cls
mode 1


2) Sometimes the interpreter closes with the following page fault:



This is the backtrace:


Unhandled exception: page fault on read access to 0x00000014 in 32-bit code (0x00443f74).
Register dump:
CS:0023 SS:002b DS:002b ES:002b FS:006b GS:0063
EIP:00443f74 ESP:7d4afea8 EBP:7d4aff08 EFLAGS:00010246(  R- --  I  Z- -P- )
EAX:00000000 EBX:00000000 ECX:00000000 EDX:7f7d0d97
ESI:283c1a68 EDI:20020200
Stack dump:
0x7d4afea8:  56711a0f 00000000 283c1a68 00000000
0x7d4afeb8:  7d4afef8 00441add 283c30c0 283c30c4
0x7d4afec8:  283c30c4 283c2c00 7d4aff00 004419f0
0x7d4afed8:  283c1a68 283c1adc 283c1ae4 00440d70
0x7d4afee8:  00000004 00000001 7d4afec0 00090048
0x7d4afef8:  7d4aff20 7d4aff30 00498f7d ffffffff
Backtrace:
=>0 0x00443f74 EntryPoint+0xffffffff() in mmbasic (0x7d4aff08)
 1 0x0043fc06 EntryPoint+0xffffffff() in mmbasic (0x7d4aff20)
 2 0x00446a3d EntryPoint+0xffffffff() in mmbasic (0x7d4aff3c)
 3 0x7bcb3b80 (0x7d4aff4c)
 4 0x7bcb3be3 (0x7d4affdc)
 5 0x7bcb3b72 (0x7d4affec)
0x00443f74 EntryPoint+0xffffffff in mmbasic: movl 0x14(%eax),%eax
Modules:
Module Address Debug info Name (40 modules)
PE  400000-28193000 Export          mmbasic
PE 7a840000-7a844000 Deferred        opengl32
PE 7b020000-7b023000 Deferred        kernelbase
PE 7b420000-7b5db000 Deferred        kernel32
PE 7b6f0000-7b6f8000 Deferred        oleaut32
PE 7bc30000-7bc34000 Deferred        ntdll
PE 7c970000-7c973000 Deferred        winepulse
PE 7c9a0000-7c9a4000 Deferred        mmdevapi
PE 7d830000-7d83f000 Deferred        setupapi
PE 7da70000-7da74000 Deferred        winex11
PE 7dfb0000-7dfb3000 Deferred        msvcr120
PE 7e0a0000-7e0a3000 Deferred        concrt140
PE 7e0c0000-7e0c4000 Deferred        imm32
PE 7e350000-7e353000 Deferred        api-ms-win-crt-locale-l1-1-0
PE 7e370000-7e373000 Deferred        api-ms-win-crt-filesystem-l1-1-0
PE 7e380000-7e383000 Deferred        api-ms-win-crt-math-l1-1-0
PE 7e3a0000-7e3a3000 Deferred        api-ms-win-crt-utility-l1-1-0
PE 7e3b0000-7e3b3000 Deferred        api-ms-win-crt-convert-l1-1-0
PE 7e3d0000-7e3d3000 Deferred        api-ms-win-crt-runtime-l1-1-0
PE 7e3e0000-7e3e3000 Deferred        api-ms-win-crt-stdio-l1-1-0
PE 7e400000-7e403000 Deferred        api-ms-win-crt-string-l1-1-0
PE 7e410000-7e413000 Deferred        api-ms-win-crt-heap-l1-1-0
PE 7e420000-7e423000 Deferred        vcruntime140
PE 7e440000-7e449000 Deferred        msacm32
PE 7e480000-7e4fd000 Deferred        winmm
PE 7e550000-7e554000 Deferred        gdiplus
PE 7e5e0000-7e5e4000 Deferred        dwmapi
PE 7e620000-7e624000 Deferred        ucrtbase
PE 7e760000-7e763000 Deferred        msvcp140
PE 7e860000-7e864000 Deferred        rpcrt4
PE 7e910000-7e938000 Deferred        ole32
PE 7ea60000-7ea63000 Deferred        shcore
PE 7ea90000-7ea98000 Deferred        shlwapi
PE 7eb10000-7f3e6000 Deferred        shell32
PE 7f520000-7f524000 Deferred        msvcrt
PE 7f5f0000-7f5f7000 Deferred        gdi32
PE 7f760000-7f848000 Deferred        user32
PE 7f980000-7f984000 Deferred        ws2_32
PE 7f9c0000-7f9c4000 Deferred        advapi32
PE 7ffd0000-7ffd4000 Deferred        version
Threads:
process  tid      prio (all id:s are in hex)
00000008 (D) Z:\home\leo\Documents\cmm2\MMBasic.exe
0000004d    0
0000004a    0 <==
00000049    0
00000032   15
00000031    0
00000030    0
0000002f    0
0000002c    0
0000002b    0
00000009    0
0000000e services.exe
00000024    0
0000001d    0
0000001a    0
00000013    0
00000010    0
0000000f    0
00000011 plugplay.exe
00000017    0
00000016    0
00000012    0
00000018 winedevice.exe
00000021    0
0000001e    0
0000001c    0
0000001b    0
00000019    0
0000001f explorer.exe
0000002a    0
00000029    0
00000028    0
00000020    0
00000022 winedevice.exe
00000027    0
00000026    0
00000025    0
00000023    0
System information:
   Wine build: wine-5.0 (Ubuntu 5.0-3ubuntu1)
   Platform: i386 (WOW64)
   Version: Windows 7
   Host system: Linux
   Host version: 5.4.0-105-generic
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9124
Posted: 07:05am 04 Apr 2022
Copy link to clipboard 
Print this post

Page copy does not implement the "B" or "D" as there is no way of knowing the raster timing. Without the copy in a tight loop as you have it the copy is so fast that you shouldn't normally see any issues. I'm seeing 1700FPS on your test vs a screen refresh rate of 60Hz hence the artefacts (the framebuffer is getting written 28 times for each screen refresh)

Can't help with the wine issue. Looks like it might be running out of memory and unable to page - can you set the pagefile size in wine?
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4043
Posted: 12:14pm 04 Apr 2022
Copy link to clipboard 
Print this post

Hi Peter,

This is related to @Chopperp's resurrection of the alpha thread https://www.thebackshed.com/forum/ViewTopic.php?FID=16&TID=14506&LastEntry=Y#184528

> Timer = 9000000000000000000
> Print Timer                                                                                                            
-4.128662258e+11


How are you storing the Timer ?

Is it not a 64-bit integer count of milliseconds ?

Best wishes,

Tom
Edited 2022-04-04 22:14 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9124
Posted: 12:27pm 04 Apr 2022
Copy link to clipboard 
Print this post

  Quote  How are you storing the Timer ?

unsigned 64-bit count of 1/10ths of microseconds which is good for >58000 years
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4043
Posted: 12:36pm 04 Apr 2022
Copy link to clipboard 
Print this post

Hmm, what "obvious" mistake am I making:

> Timer = Epoch(Now) * 1000
> Print DateTime$(Epoch(Now))
04-04-2022 13:38:32
> Print DateTime$(Timer \ 1000)
21-10-1963 04:05:12

Works on MMB4L .

EDIT: It's because Epoch(Now) * 1000 causes the Timer to rollover to -ve numbers, but I don't think it should, a 64-bit integer can store up to +9,223,372,036,854,775,807.

Best wishes,

Tom
Edited 2022-04-04 22:56 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9124
Posted: 01:22pm 04 Apr 2022
Copy link to clipboard 
Print this post

MMBasic.zip

   int64_t offset= getinteger(++cmdline) * frequency / 1000;
vs
   int64_t offset= getinteger(++cmdline) * (frequency / 1000);

where frequency on my PC is 10,000,000 but may vary between PCs

   QueryPerformanceFrequency((LARGE_INTEGER*) &frequency);
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4043
Posted: 01:35pm 04 Apr 2022
Copy link to clipboard 
Print this post

Thanks Peter,

I'll check the other updates out later in the week when I get some free time.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 479
Posted: 09:29pm 04 Apr 2022
Copy link to clipboard 
Print this post

  matherp said  Page copy does not implement the "B" or "D" as there is no way of knowing the raster timing. Without the copy in a tight loop as you have it the copy is so fast that you shouldn't normally see any issues. I'm seeing 1700FPS on your test vs a screen refresh rate of 60Hz hence the artefacts (the framebuffer is getting written 28 times for each screen refresh)

Can't help with the wine issue. Looks like it might be running out of memory and unable to page - can you set the pagefile size in wine?


Thank you Peter

I updated the code to control the scene repaiting. The left counter is from the main loop and the right one is from the screen rendering.



I think it is using the pagefile size from Linux. I'm not sure. I will take a look.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 07:18am 05 Apr 2022
Copy link to clipboard 
Print this post

  thwill said  I've returned back to trying to get SAAINT running in MMB4W

All of us dedicated SAAINT users are wanting to know if you have succeeded.  

Bill
Keep safe. Live long and prosper.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4043
Posted: 09:05am 05 Apr 2022
Copy link to clipboard 
Print this post

  Turbo46 said  
  thwill said  I've returned back to trying to get SAAINT running in MMB4W

All of us dedicated SAAINT users are wanting to know if you have succeeded. 


Hi Bill,

I'm still working on it between other projects (and the day job), but I think it's probably almost there.

The SAAINT source-code explores the "haunted wing" of MMBasic File I/O which is of course one of those bits that Peter has to substantially rework for each MMBasic port. As a result I've been finding quite a few errors in MMB4W and have chosen to report them and wait for an official fix rather than working around them.

Best wishes,

Tom
Edited 2022-04-05 19:05 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4043
Posted: 12:50pm 05 Apr 2022
Copy link to clipboard 
Print this post

Hi Peter,

It's getting there, however:
> Dim out%(64)
> System "echo 'foo bar'", out%()
> LongString Print out%()
'foo bar

Note the terminating single-quote is missing; you're overtrimming the string when capturing in a long string.

You get it correct when capturing in a standard string:
> Dim s$
> System "echo 'foo bar'", s$
> Print s$
'foo bar'

Best wishes,

Tom
Edited 2022-04-05 22:50 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9124
Posted: 01:06pm 05 Apr 2022
Copy link to clipboard 
Print this post

  Quote  you're overtrimming the string when capturing in a long string.



MMBasic.zip
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4043
Posted: 01:17pm 05 Apr 2022
Copy link to clipboard 
Print this post

Thank you Peter, that's everything I know about now "fixed".

Adventurer's rejoice , I have SAAINT running on MMB4W, just need to do some tidying up and test I haven't broken the other platforms and then I'll provide a download link to a compatible version (perhaps this evening).

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
     Page 12 of 30    
Print this page
© JAQ Software 2024