Author Topic: Project looking for Programmer (I can't do it myself)  (Read 18439 times)

0 Members and 1 Guest are viewing this topic.

Offline Daniel3D

  • Newbie
  • Posts: 62
Re: Project looking for Programmer (I can't do it myself)
« Reply #105 on: December 14, 2021, 06:34:30 am »
Wow. This has become way more complicated than I expected when I posted the original help request.
I really appreciate the work you are doing so short before Christmas.

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
Re: Project looking for Programmer (I can't do it myself)
« Reply #106 on: December 26, 2021, 03:54:16 pm »
@Daniel3D
Merry Christmas


there are further development.
This is my function to search files and show them into a ScrollList and let to the user to select them.

Now you see it as a single program, but I must only integrate it into the original program (I must see for duplicating of name of variables and of labels, moreover I must test that it doesn't run into memory overflow/ out of stack as in previous  experience).

Code: QB64: [Select]
  1. DIM F$(1 TO 1000), S(1 TO 1000) AS STRING * 2, n AS INTEGER, a AS INTEGER, i AS INTEGER, max AS INTEGER
  2. n = 0
  3. NameFile$ = "filedir.tmp"
  4. ON ERROR GOTO Nofile
  5. COLOR 7, 0
  6. SHELL "dir  /b> " + NameFile$
  7. OPEN NameFile$ FOR INPUT AS #1
  8.  n = n + 1
  9.    LINE INPUT #1, F$(n)
  10.    S(n) = "  "
  11. KILL NameFile$
  12.  max = n
  13.  
  14. GOSUB AllList
  15. GOSUB ChoiceList
  16.  
  17.  
  18. Nofile:
  19.  PRINT " Error "; FileName$ + " not found!"
  20.  END
  21.  
  22. AllList:
  23. ' debug GOSUB to show the whole list
  24. FOR a = 1 TO max STEP 1
  25. PRINT F$(a) + S(a)
  26. IF a MOD 15 = 0 THEN SLEEP 2
  27.  
  28. ChoiceList:
  29. a = 0
  30. k$ = ""
  31. IF i = 0 THEN i = 1: n = i
  32. ' 183 · 186º 189 ½ 196 Ä 211 Ó 214  Ö                                                                      
  33.  
  34.  ' here is the output of list
  35.  COLOR 7, 0
  36.  IF i < n OR i > (n + 15) THEN n = i
  37.  LOCATE 4, 23
  38.  PRINT "ÖÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ·"
  39.  FOR a = n TO n + 15 STEP 1
  40.    IF a > max THEN M$ = SPACE$(15) ELSE M$ = " " + F$(a) + S(a) + SPACE$(15 - LEN(F$(a)) - 3)
  41.    IF a = i THEN COLOR 15, 0
  42.    LOCATE , 23
  43.    PRINT "º" + M$ + "º"
  44.    IF a = i THEN COLOR 7, 0
  45.  NEXT a
  46.  LOCATE , 23
  47.  PRINT "ÓÄÄÄÄÄÄÄÄÄÄÄÄÄÄĽ"
  48.  LOCATE , 23
  49.  PRINT CHR$(24) + CHR$(25) + " move, S select, D done"
  50.  
  51.  
  52.  
  53.  ' here is the user input from keyboard
  54.  DO
  55.     k$ = UCASE$(INKEY$)
  56.  ' it switches the selector
  57.     IF k$ = "S" THEN IF S(i) = "  " THEN S(i) = "<-" ELSE S(i) = "  "
  58.     ' down
  59.     IF k$ = CHR$(0) + "P" THEN IF i < max THEN i = i + 1
  60.      'up
  61.     IF k$ = CHR$(0) + "H" THEN IF i > 1 THEN i = i - 1
  62.     IF k$ = "D" THEN RETURN ' all selection has been done
  63.  LOOP UNTIL k$ <> ""
  64.  
  65.  


please run it under DOSBox in the a folder that is DOS compatible,  you can run also it into QB64 BUT you'll get the long name of files if you don't run into a DOS folder, so the ScrollList will be a bit messing up!
Otherwise you must use the right switch of DIR command to get the short name of files into the list created.

Let me know what do you think about this.
Programming isn't difficult, only it's  consuming time and coffee

Offline Daniel3D

  • Newbie
  • Posts: 62
Re: Project looking for Programmer (I can't do it myself)
« Reply #107 on: December 29, 2021, 10:38:18 am »
Hi.
It looks good. I don't understand it all. So I may ask weird questions.
I think that you use command line for the list.
Can that not also be done with interrupts? Or am I mixing things up?

Your first line f$(1 to1000) does that create 1000 of something to use in list's? I think that may be a bit heavy.
I don't have problems with it. Just an impression..

Offline Daniel3D

  • Newbie
  • Posts: 62
Re: Project looking for Programmer (I can't do it myself)
« Reply #108 on: December 29, 2021, 01:45:56 pm »
Maybe split lists in groups?
Game files - are known.
Tracks - list only tracks
Cars - list only cars.
Mods. - list files minus game, track and car files

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
Re: Project looking for Programmer (I can't do it myself)
« Reply #109 on: December 29, 2021, 05:12:52 pm »
Hi Daniel3D
fine for getting your feedbacks...

1. About using interrupt in DOS mode:
I prefer to use SHELL command because it is speeder than  getting files of folder using 16 bit interrupts
(as you already know using interrupt we must use some DOS services in a specific order for getting the list of files = much code for reaching the same point)
moreover there is FILES keyword in QBasic (see here https://wiki.qb64.org/wiki/FILES) that it uses to print on the screen the result of its calling.

2. arrays too huge

1000 is a generic target. The original files are about 120 plus mod files = (about) 400 ?! In other words 400 files are a good upper limit about the amount of files that can be in the main folder of the game ?

3. using 4 groups for the scrollListbox
      Game Files are in the list that you have posted before
      getting files list in the folder we can extract the 3 different lists: Tracks, Cars and Mods
please think about this and gimme a confirm to let me go on.

Programming isn't difficult, only it's  consuming time and coffee

Offline Daniel3D

  • Newbie
  • Posts: 62
Re: Project looking for Programmer (I can't do it myself)
« Reply #110 on: December 29, 2021, 06:48:33 pm »
Ok.
1. Clear.. I get your reasoning. Don't know much about interrupts, just know that they exist. So keep going.

2. I think 500 should be enough. I could increase it later if there is need. But I don't expect so.

3. Just a thought. Let's see how it functions as it is now.
Edit:But if we run into problems it may be a solution.
Edit2: I don't know if it is a lot of work. But filtering out tracks and cars in separate lists saves a lot of space on screen.
Cars are 4files per car. Only one name needs to be shown.
Tracks are 1 to 3 files per track. Also only one name needed.
« Last Edit: December 30, 2021, 06:37:52 am by Daniel3D »

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
Re: Project looking for Programmer (I can't do it myself)
« Reply #111 on: January 02, 2022, 10:47:39 am »
Happy New Year Daniel5

ok
1. you needn't to use interrupt (how much time you and I have saved because I have no pre-built library for DOS interrupt and I have to build it from stratch)

2. for now MAX = 500

3.
this is the options: actual state, one kind of file at time,  multiple files at time
see screenshot
  [ You are not allowed to view this attachment ]  

let me know your preferences

Waiting your feedback  again Happy New Year
Programming isn't difficult, only it's  consuming time and coffee

Offline Daniel3D

  • Newbie
  • Posts: 62
Re: Project looking for Programmer (I can't do it myself)
« Reply #112 on: January 02, 2022, 05:32:49 pm »
An happy new year to you as well.

I prefer the option with one kind of file.
Multiple columns makes it to complex I think.

So you can install the game (no listings needed)
Or a list of either cars, tracks or all other files (probably containing mod programs like agar)

Offline Daniel3D

  • Newbie
  • Posts: 62
Re: Project looking for Programmer (I can't do it myself)
« Reply #113 on: January 04, 2022, 08:27:57 am »
For the car listing.
With the amount of cars and the limited naming possiblity
I would like for you to add the full car name in a separate box (above the list)
The target file is the corresponding car****.Res file.
I posted a script for that before, but that written in freebasic.
I have that script now in a QB version.
If you can add that I would very appreciate it.
Code: QB64: [Select]
  1. Function ExtractCarName$ (filename$)
  2.  f% = FreeFile
  3.  Open filename$ For Binary Access Read As f%
  4.  s$ = Space$(100)
  5.  Get #f%, , s$
  6.  n% = InStr(s$, "gnam")
  7.  Get #f%, n% + 16, l&
  8.  l& = l& + 39
  9.  s$ = Space$(255)
  10.  Get #f%, l&, s$
  11.  n% = InStr(s$, Chr$(0))
  12.  If n% Then s$ = Left$(s$, n% - 1) Else s$ = Left$(s$, 40)
  13.  Close f%
  14.  
  15.  ExtractCarName$ = s$
This code that has been used in several programs.
So I don't expect trouble with it.
If there is something with it I can't help you, so leave it then.
Don't worry about it. It's extra and can be fixed later if needed.

Thanks again.
« Last Edit: January 05, 2022, 12:19:59 am by Daniel3D »

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
Re: Project looking for Programmer (I can't do it myself)
« Reply #114 on: January 05, 2022, 09:44:13 am »
Hi Daniel3D
fine this function extracting name of car from file of car.
I'll try it so in a second moment I can integrate it.

Soon final version of installer. I'm testing it in Qbasic in DosBox for windows.
See Later
Programming isn't difficult, only it's  consuming time and coffee

Offline Daniel3D

  • Newbie
  • Posts: 62
Re: Project looking for Programmer (I can't do it myself)
« Reply #115 on: January 05, 2022, 01:23:48 pm »
O wow.
Amazing 😁

Offline Daniel3D

  • Newbie
  • Posts: 62
Re: Project looking for Programmer (I can't do it myself)
« Reply #116 on: January 21, 2022, 03:27:52 pm »
@TempodiBasic everything alright? Can I do something for you?

Offline Richard

  • Seasoned Forum Regular
  • Posts: 364
Re: Project looking for Programmer (I can't do it myself)
« Reply #117 on: February 20, 2022, 06:31:49 am »
@TempodiBasic

Is your program in a somewhat usable form - as I would be interested in trying out in bare metal mode on a newer style CPU?

Offline Daniel3D

  • Newbie
  • Posts: 62
Re: Project looking for Programmer (I can't do it myself)
« Reply #118 on: February 22, 2022, 04:34:35 am »
Hi Richard.

TempodiBasic has not been online for a while now. Life happens. I am sure he will come around eventually.

Anyway. @Richard I would appreciate it if you could test the program when it is available. It should work just fine, but I don't have a bare metal setup to test that myself.
In september a new realease is planned (a year later than originally intended) so there is time for TempodiBasic. If it is ready before July I'm happy.

In the meantime, you could check http://forum.stunts.hu/index.php there are some things happening in the STUNTS world.

Offline NOVARSEG

  • Forum Resident
  • Posts: 509
Re: Project looking for Programmer (I can't do it myself)
« Reply #119 on: March 15, 2022, 08:06:01 am »
I know ASM but it is really hard to do ASM in QB64. I'm not saying impossible - and I have tried by disassembling QB64 code but my lack of compiler knowledge makes that a challenge.  I just do not have the time or patience to tweak QB64 code nor would I want to other than for pure amusement.

Your best bet is to try to write the entire game in QB64 which is not easy but a lot easier than trying to emulate ASM code in QB64 or get into the really brainy world of API functions etc.