flat assembler
Message board for the users of flat assembler.
![]() Goto page Previous 1, 2, 3, 4 Next |
Author |
|
revolution
filox wrote: Sorry but where i can find sources of Hobbybasic? |
|||
![]() |
|
system error
This is good. Keep it coming, bro!
|
|||
![]() |
|
filox
revolution wrote:
No source, only EXE and Demo.bas |
|||
![]() |
|
sleepsleep
hi filox,
you could try pm picnic for source etc |
|||
![]() |
|
filox
Picnic wrote: Hi filox, the source is not available, at least not yet. Hobby Basic has still some way to go. I want to extend the command list, find methods to make the intepreter faster, add features like user procedures with parameters and local variables and some other ideas i have. This is done somewhat slowly, the only days i can steal some time to work are the weekends. Hi picnic, if u can share code with us, we can help you possibly to improve it faster and i'm interested in it for educational scope ![]() |
|||
![]() |
|
Picnic
Some minor improvements and bug fixes i noticed.
Hobby Basic Version 0.7.9 Miscellaneous Hobby Basic stuff. Code: rem MISC.BAS rem Hobby Basic Interpreter cmdline$ = V0 rem Do not write above this line dim argv$[8] argc = split(cmdline$,' ',argv$[]) title 'Let''s Hobby' screen -1,-1 if V0 < 80 then screen 80,25,300 cls ? 'Current Directory' ? 'Hobby Basic Path' ? 'File Path' ? 'File Name' ? 'Windows Path' ? 'Interpreter Version' ? 'Windows Version' ? 'Host Name' ? 'Local IP Adrress' ? 'Window Title' ? 'Screen Resolution' ? 'Window Pixels' ? 'Window Cells' ? 'Cell Pixels' ? 'File Bytes' ? 'Tick Counter' ? 'Local Time' for i = 0 to 9 at 25,i,PATH(i) next view 1 at 25,10,(STR(V0)+'x'+STR(V1)) screen -1,-1 at 25,11,(STR(V2)+'x'+STR(V3)) at 25,12,(STR(V0)+'x'+STR(V1)) info 0,0 at 25,13,(STR(V3&0xFF)+'x'+STR(V3>>16)) at 25,14,SIZE(PATH(2)) for i = 0 to argc - 1 at 0,i+17,('CmdLine Argv$[' + STR(i) +']') at 25,i+17,argv$[i] next @@# at 25,15,STR(TICK(0)) at 25,16,STR(TICK(1)) if KEY(27) then cls : end wait 1 goto @b ![]() Last edited by Picnic on 19 Jan 2021, 13:26; edited 15 times in total |
|||
![]() |
|
Picnic
I have uploaded a new version with minor improvements and bug fixes.
Hobby Basic Version 0.8.0 RGB colors in console. Code: sub RGB(r,g,b) rets (b<<16)|(g<<8)|r ends screen 80,25 rgbc 1,RGB(68,36,52) rgbc 2,RGB(48,52,109) rgbc 3,RGB(218,212,94) rgbc 4,RGB(109,170,44) for n = 0 to 139 x = 4 * (n % 20) y = 4 * (n / 20) color (x+y)/16,0 paint x,y,4,4,' ',1 next inkey : cls : end ![]() Last edited by Picnic on 08 Jan 2021, 22:22; edited 61 times in total |
|||
![]() |
|
avcaballero
Hello, it is very interesting. I was very fond of qbasic. I'd just say that it would be nice to see your page in English, Greek is a bit hard for me
![]() |
|||
![]() |
|
Picnic
I have uploaded a new version with minor improvements and bug fixes.
Hobby Basic Version 0.9.7 P2P Drawing via UDP sockets in console. Changes appear in real time between the 2 PC's. Code: rem P2P Drawing via UDP sockets rem Click left mouse button to paint a cell rem Click right mouse button to clear a cell rem Swap the connection ports between the hosts rem Set ipv4$ to remote computer address '192.168.1.xxx' getmouse() fix mouse:x=V0:y=V1:btn=V2:wait 1 LOCAL_PORT = 50001 REMOTE_PORT = 50002 ipv4$ = 'localhost' px = -1 py = -1 if OPEN(LOCAL_PORT) = -1 then alert 0x10,'socket error ',STR(V0) : end title 'P2P Drawing via UDP sockets running on ',PATH(8) cursor 0,0 color 0,0 cls do getmouse() if (btn = 1 or btn = 2) if btn = 2 then c = 0 else c = 0x2588 do : getmouse() if (x <> px or y <> py) pen 15 at x,y,CHR(c) px = x py = y ! send data string a$ = STR((((x<<7)|y)<<15)|c) n = SEND(ipv4$,REMOTE_PORT,a$) endif until btn = -1 endif ! handle incoming messages while LEN(QUEUE(1)) n = VAL(QUEUE(0)) x = BITS(n,28,7) y = BITS(n,21,7) c = BITS(n,14,15) pen 9 at x,y,CHR(c) endw until KEY(27) n = CLOSE() : end ![]() Last edited by Picnic on 08 Jan 2021, 14:45; edited 35 times in total |
|||
![]() |
|
Robocod
Source code?
|
|||
![]() |
|
sts-q
|
|||
![]() |
|
Picnic
I have uploaded a new version with minor improvements and bug fixes.
Hobby Basic Version 1.0.5 A Xonix like game written in Hobby Basic. Code: rem XONIX.BAS rem Hobby Basic Interpreter sub enemyMove(i) color 0,0 : at x[i],y[i],' ' x[i] = x[i] + dx[i] : if grid[x[i],y[i]] = OK then dx[i] = -dx[i] : x[i] = x[i] + dx[i] y[i] = y[i] + dy[i] : if grid[x[i],y[i]] = OK then dy[i] = -dy[i] : y[i] = y[i] + dy[i] color 12,12 : at x[i],y[i],' ' ends sub drop(x,y) if grid[x,y] = 0 then grid[x,y] = -1 if grid[x-1,y] = 0 then drop(x-1,y) if grid[x+1,y] = 0 then drop(x+1,y) if grid[x,y-1] = 0 then drop(x,y-1) if grid[x,y+1] = 0 then drop(x,y+1) ends sub status() local a$ = 'Score ' + STR(score) + ' Xn ' + STR(lives) + ' Full ' + STR(perc) + '%' title a$ ends S = 1 C = 60 R = 30 CX = C / 2 CY = R / 2 CR = (C - 2) * (R - 2) TAIL = 0xAA0020 delay = 70000 dim grid[C,R] load PATH('DATA\XONIX.TXT'),xonix$ if V0 = -1 then alert 0x30,PATH(3),'missing file' screen C,R cursor 0,0 color 0,2 : cls : ? xonix$ block 0,0,39,6,700 intro# color 0,15 : cls : title 'Xonix!' block CX-19,CY-5,700 at CX-9,CY-8,'H o b b y B a s i c' at CX-13,CY+4,'P r e s s A t o S t a r t' pen 10 : i = 0 : k = 0 : lives = 3 : enemyCount = 1 : score = 0 do store CX-19+i,CY-5,2,6 paint CX-19+i,CY-5,2,6,-1,1 wait 120000 : restore i = (i + 2) % 120 k = KEY(-1) & 0x5F if k = 27 then alert 0x4|0x20,'Xonix','Do you want to exit ?': if V0 = 6 then cls : end until k = 'A' for i = 0 to CX : move 1,0,CX,R,0,0 : move CX,0,CX,R,CX+1,0 : wait 20000 : next start# dim x[enemyCount] dim y[enemyCount] dim dx[enemyCount] dim dy[enemyCount] OK = ((0x11 + (enemyCount % 8) * 17) << 16) | 0x20 x = 0 : y = 0 : dx = 0 : dy = 0 : m = 0 : n = 0 : perc = 0 : t = TICK() for i = 0 to enemyCount - 1 x[i] = RND() % CX + 10 y[i] = RND() % CY + 5 dx[i] = (RND() % 3 - 1)|1 dy[i] = (RND() % 3 - 1)|1 next wait 500000 : color 0,0 : cls : status() for i = 0 to R - 1 for j = 0 to C - 1 if i = 0 or j = 0 or i = R-1 or j = C-1 then grid[j,i] = OK else grid[j,i] = 0 next next grab 0,0,C,R,grid[],1 a$ = 'S t a g e ' + STR(enemyCount) pen 15 : at CX-6,CY,a$ wait 1500000 erase CX-6,CY,15,-1,-1 total = score Game = TRUE main# if KEY(27) then Game = FALSE : lives = 1 if KEY(37) then dx = -1 : dy = 0 if KEY(39) then dx = 1 : dy = 0 if KEY(38) then dx = 0 : dy = -1 if KEY(40) then dx = 0 : dy = 1 if ~Game for i = 1 to R - 2 for j = 1 to C - 2 if grid[j,i] = TAIL then grid[j,i] = 0xCC0020 next next grab 0,0,C,R,grid[],2 wait 1000000 lives = lives - 1 if lives = 0 then color 0,15 : at CX-7,CY,'G a m e O v e r' : status() : inkey : goto intro goto start endif if TICK() - t > 50 x = x + dx y = y + dy if (x < 0) then x = 0 if (x > C - 1) then x = C - 1 if (y < 0) then y = 0 if (y > R - 1) then y = R - 1 if grid[x,y] = TAIL Game = FALSE elseif grid[x,y] = 0 grid[x,y] = TAIL m = 1 endif t = TICK() endif for i = 0 to enemyCount - 1 : enemyMove(i) : next if grid[x,y] = OK and m dx = 0 : dy = 0 : m = 0 : n = 0 for i = 0 to enemyCount - 1 : drop(x[i],y[i]) : next for i = 1 to R - 2 for j = 1 to C - 2 if grid[j,i] = -1 then grid[j,i] = 0 else grid[j,i] = OK : n = n + 1 next next if n > 0 then perc = (n * 100) / CR : score = total + n : status() endif for i = 0 to enemyCount - 1 if grid[x[i],y[i]] = TAIL then Game = FALSE : break next if ~Game then goto main grab 0,0,C,R,grid[],2 color 14,14 : at x,y,' ' if perc > 85 then enemyCount = enemyCount + 1 : goto start wait delay goto main ![]() Last edited by Picnic on 19 Jan 2021, 13:27; edited 7 times in total |
|||
![]() |
|
Picnic
I have uploaded a new version with minor improvements and (not so minor) bug fixes.
Hobby Basic Version 1.0.6 In the examples I added a simple text drawing program for the Windows console written in Hobby Basic. If someone could run the program in a Windows 10 environment and confirm that the mouse is working, I would appreciate it. I had some minor issues with Windows 10, I made some corrections and changes, but i haven't tested them since I don't have often access to Windows 10. ![]() How to create the standalone DRAW.EXE Type at the command-line: Code: hb EXAMPLES/DRAW.BAS -bind DRAW.EXE The standalone application will be created inside the HB folder. To open the apple image directly from the command-line, type: Code:
DRAW ART\APPLE.ANS
![]() Last edited by Picnic on 08 Jan 2021, 14:46; edited 11 times in total |
|||
![]() |
|
bitRAKE
I think I ran all of them on Windows 10.
About the mouse one: didn't indicate which button was double-clicked, and the middle button displays as the left button. This might be a limitation of the API - I don't know. I did find an error in the XONIX game. I was able to meet the edge at the same time as the red spot. This causes the area not to be filled until I completed another closing move. This typically is just a "one-off" error. Also, an error in DRAW.BAS, line 336, changed to "if p > 269 then break", and it seems to work. Was only missing 1200 baud modem sounds. ![]() Well done! |
|||
![]() |
|
Picnic
Thanks for taking the time running the examples bitRAKE, i appreciate that.
Quote: This might be a limitation of the API - I don't know. I think i have to update my code a bit. The interpreter using the same mouse routine since 2015. Quote: Also, an error in DRAW.BAS, line 336, changed to "if p > 269 then break", and it seems to work. Out of range!, i missed that, it's better this way. Code: if p > SIZE(charset[])-1 then break Quote: I did find an error in the XONIX game. I was able to meet the edge at the same time as the red spot. This causes the area not to be filled until I completed another closing move. This typically is just a "one-off" error. Oh come on now, how fast did you notice that. A true game tester ![]() |
|||
![]() |
|
bitRAKE
Another oddity is not being able to select a character from the codepage that characters are displayed with. The saved images display correctly, but limited character selection as seen in the picture. I was even able to crash the console by selecting different fonts. Windows 10 might be to blame here as they try to push everyone to Powershell.
Putting this in a batch file will compile all the examples: Code: FOR %%G IN (.\EXAMPLES\*.BAS) DO (HB "%%G" -bind ".\BIN\%%~nG.EXE")
|
||||||||||
![]() |
|
Picnic
Here is a different 16 color palette (for those who are going to try it).
Code: dim Default[16] = 0x000000,0x0000BB,0x00BB00,0x00BBBB,0xBB0000,0xBB00BB,0xBBBB00,\ 0xBBBBBB,0x555555,0x5555FF,0x55FF55,0x55FFFF,0xFF5555,0xFF55FF,0xFFFF55,0xFFFFFF Quote: Windows 10 might be to blame here as they try to push everyone to Powershell. I see it with the test programs I write. Some, while running smoothly on previous windows versions, behave differently in windows 10, even in the legacy console mode. Quote: Putting this in a batch file will compile all the examples: I like this. I can do it through HB as well. Something like that, Code: alert (0x4|0x20),"","Do you want to compile all the examples?" if V0 = 6 exec "if not exist BIN\NUL md BIN" exec "FOR %G IN (.\EXAMPLES\*.BAS) DO (HB ""%G"" -bind "".\BIN\%~nG.EXE"")" endif Thanks again bitRAKE. |
|||
![]() |
|
Picnic
Hello fasm users,
A small update which raises the interpreter version to 1.1.1 The PRINT AT command can display text while retaining the background color of empty cells. Code: screen 80,25 : cls for x = 0 to 7 color x,0 paint x*10,0,10,25,0x20,1 next for x = 1 to 15 pen x print at x,x,'Hobby Basic' next inkey : end ![]() Another feature is that now Hobby Basic can download and run a program located on a remote server. Do the test, open the command prompt in the HB folder and copy-paste: Code: HB.exe https://sites.google.com/site/hobbybasicfiles/TEST.BAS ![]() |
|||
![]() |
|
sleepsleep
Quote:
this feature sounds exciting and dangerous at the same time, |
|||
![]() |
|
Goto page Previous 1, 2, 3, 4 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.