Author Topic: QB 4.5 Android  (Read 9392 times)

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
QB 4.5 Android
« on: August 19, 2013, 08:16:41 PM »
For those that can't let it go and want to take it with them. I have attached the adosbox.apk and an installed (unpacked) version of QB 4.5 that you unzip in your /sdcard/qb45 directory on your Android device. It runs very well and it can even run Doom from what I read. Touch acts as your mouse. It might be a good home for PBDOS 3.5.

FYI - If you add files (adb, ...) to your QB 4.5 directory while the aDosBox is running, you will need to restart the emulator to see the new file(s).



Note: The screen copy and reduction didn't do what this really looks like justice.



Code: [Select]
' Qbasic Mandelbrot set program
CLS : SCREEN 13

' This makes a nice rainbow palette

FOR t% = 0 TO 192
LINE (t%, 195)-(t%, 199), t%
NEXT t%
PALETTE 193, 1973790

FOR p& = 0 TO 63 STEP 2
a% = a% + 1
PALETTE a%, 63 + 256 * p&
PALETTE a% + 32, 63 - p& + 63 * 256
PALETTE a% + 64, 256 * 63 + p& * 65536
PALETTE a% + 96, (63 - p&) * 256 + 63 * 65536
PALETTE a% + 128, p& + 65536 * 63
PALETTE a% + 160, (63 - p&) * 65536 + 63
NEXT p&

' screen size
sx% = 320
sy% = 190
xmax = 2: ymax = 2: xmin = -3: ymin = -2
FOR y% = 0 TO sy%
FOR x% = 0 TO sx%
p = xmin + x% * (xmax - xmin) / sx%
q = ymin + y% * (ymax - ymin) / sy%
it% = 0
cx = 0: cy = 0
here:
xn = cx * cx - cy * cy + p
yn = 2 * cx * cy + q
r = xn * xn + yn * yn
IF r > 4 OR it% > 192 THEN GOTO plt
it% = it% + 1
cx = xn: cy = yn
GOTO here
plt:
PSET (x%, y%), 1 + it%
NEXT x%: NEXT y%
SLEEP 0





Note: The pre-compiled 0.74 version of DOSBox (see examples above)  that I had attached to this post has been removed. Please use the native compiled version you will find in a later post.
« Last Edit: August 21, 2013, 06:11:05 PM by JRS »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: QB 4.5 Android
« Reply #1 on: August 20, 2013, 09:20:50 AM »
I'm glad I found something that will get folks to try working with Android and not think that their new tablet is only a toy for the kids.

I'm not trying to create interest in DOS again with posting this. I have some issues with the RTB SDL keyboard handling and the author of C4droid suggested I get aDosBox (open source) as it used SDL 2 and the keyboard handling works fine with it. I thought if might be fun to pull some for those old QB favorites out of the box and give them another spin on Android (Linux) OS.

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: QB 4.5 Android
« Reply #2 on: August 20, 2013, 02:58:51 PM »
I misunderstood what the C4droid author was telling me and realized the DOSBox he was referring to was a C4droid SDL example project. I compiled the DOSBox emulator (I thought compiling SQL3 was a stress tester) and once completed I was very happy with the results compared to the aDosBox.apk I posted previously. (more screen real estate used, faster, fonts rescale with portrait and landscape modes and has the C4droid on screen keyboard activation and arrow keys background image controls) This make this project much more interesting knowing that I can customize a DOS emulator and recompile it local.  8) Attached is the new DOSBox I compiled and resulting dosbox.apk.





Full res portrait mode



PBDOS 3.5



43/50 mode



PB on fire



Native compiled DOSBox attached
« Last Edit: August 21, 2013, 06:13:29 PM by JRS »