Author Topic: Nintendo Switch or Wii or 32k Atari 2600 support?  (Read 890 times)

0 Members and 1 Guest are viewing this topic.

Offline madscijr

  • Seasoned Forum Regular
  • Posts: 295
Nintendo Switch or Wii or 32k Atari 2600 support?
« on: February 20, 2022, 10:57:30 am »
I'm just curious how impossible it would be to get QB64 to compile applications for these platforms? I'd imagine you would need the equivalent C routines and libraries (and for Atari VCS, kernel routines and some kind of i/o layer). It would just be neat to be able to make games for these consoles in QB64...

Offline _vince

  • Seasoned Forum Regular
  • Posts: 422
Re: Nintendo Switch or Wii or 32k Atari 2600 support?
« Reply #1 on: February 20, 2022, 04:11:57 pm »
I do recall that someone was able to make games for the Nintendo DS using FreeBASIC (another similar QB-like language).  The process involved using the multiplatform low-level C output version of the compiler but that is as far as I know and as much of an answer as I can provide in that regard.

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
Re: Nintendo Switch or Wii or 32k Atari 2600 support?
« Reply #2 on: February 20, 2022, 06:38:31 pm »
I'm just curious how impossible it would be to get QB64 to compile applications for these platforms?

Completely.

Most consoles have their own hardware architecture with custom assembly code for it. The only hope would be that the console ran on a C++ compatible architecture. And even that would leave a butt load of problems.

It would be simpler and quicker just to learn the base assembly and compile it for the console.
Granted after becoming radioactive I only have a half-life!

Offline madscijr

  • Seasoned Forum Regular
  • Posts: 295
Re: Nintendo Switch or Wii or 32k Atari 2600 support?
« Reply #3 on: February 21, 2022, 09:55:41 pm »
Thank you for your response.

Completely.

Most consoles have their own hardware architecture with custom assembly code for it. The only hope would be that the console ran on a C++ compatible architecture. And even that would leave a butt load of problems.

It would be simpler and quicker just to learn the base assembly and compile it for the console.

I suppose if that was going to happen, someone would have done it by now.

I was thinking more along the lines of enumerating the basic functions the QB64 commands use -basic stuff like managing and manipulating variables, arithmetic and logical operations, drawing pixels to the screen, etc.- and creating wrapper functions or a compatibility layer to bridge QB64's compiler with the target platform. Using a "divide and conquer" approach, it shouldn't be impossible to arrive at, if not optimized, at least working executables for the target platforms for which C compilers are available?

Offline madscijr

  • Seasoned Forum Regular
  • Posts: 295
Re: Nintendo Switch or Wii or 32k Atari 2600 support?
« Reply #4 on: February 21, 2022, 10:08:52 pm »
I do recall that someone was able to make games for the Nintendo DS using FreeBASIC (another similar QB-like language).  The process involved using the multiplatform low-level C output version of the compiler but that is as far as I know and as much of an answer as I can provide in that regard.

Thanks for your reply.

The reason I was wondering if this might be possible is that since QB64 generates C code, all you would need would be a compatibility layer to make QB64's output work with the target system. I am by no stretch of the imagination a C expert or even a C programmer (I used it in school, and hated it, and these days probably wouldn't be able to get "hello world" to compile) but I know it's been the lingua franca of low-level coding for decades, so I would expect almost every system to have a C compiler available.

So as long as someone is willing and able to dive into QB64's C output for all the different commands, and the C equivalent of the various commands' functionality on the target system, that they could either tweak (or more probably completely rewrite) QB64's compiler output or write a compatibility layer between the existing generated QB64 C output and the target system's existing C libraries, to arrive at QB64 being able to generate working programs.

Anyway, that's what my layman's brain was musing. I'll just stop here before I embarass myself any further, lol.
« Last Edit: February 21, 2022, 10:13:58 pm by madscijr »

Offline madscijr

  • Seasoned Forum Regular
  • Posts: 295
Re: Nintendo Switch or Wii or 32k Atari 2600 support?
« Reply #5 on: February 23, 2022, 12:24:28 pm »
Update: I did some research (links below) and for the Atari 2600 at least,
coding in C or anything but straight assembly doesn't seem trivial.

Then again there was that Batari BASIC (I never got it running myself)
so it is possible to develop a dialect of BASIC to make games for the Atari VCS.

Now for the Switch or even the Wii, those are relatively recent systems
(compared to older PCs which run QuickBasic and QB64)
which should be advanced enough and have the resources
and available C compilers to at least be doable as target QB64 platforms,
given some work (therein lies the rub! It's beyond me!)



Creating Atari 2600 games in BASIC with batari-Basic:
https://bataribasic.com/

https://github.com/batari-Basic/batari-Basic

https://atariage.com/forums/forum/65-batari-basic/

It works with Visual Studio?
https://marketplace.visualstudio.com/items?itemName=chunkypixel.bataribasic

More info
https://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html



Programming the Atari 2600 in C:

https://www.reddit.com/r/gamedev/comments/8r4ox5/emulating_or_coding_the_atari_2600_games_in_c/

https://cc65.github.io/doc/atari2600.html

https://retrocomputing.stackexchange.com/questions/8640/were-some-atari-2600-games-written-in-c

https://atariage.com/forums/topic/202589-atari-2600-libraries-for-c-compilers/


« Last Edit: February 25, 2022, 11:40:46 am by madscijr »