Jump to content
IGNORED

Java mobile games to Atari lynx games (Theory)


Europatari

Recommended Posts

1 hour ago, enthusi said:

RISC-V will be great again! ;-)

 

 

RISC-V is no real competitor for ARM ISA, to "open", no guidance. Much confusion with the different layers. Sure a lot of academic and esp. the Chinese jump on it as it is free.

IMHO, RISC-V will like go the Linux way: Hundreds of different version that share a minimum.

Link to comment
Share on other sites

6 hours ago, karri said:

Yep. Doing a new 3D engine is perhaps not the easiest way to familiarize yourself with a new architecture. Some simple 1 minute game in C or BLL would have been a good introduction to existing tools.

 

It is also possible to get a fairly decent starting point by creating something in C and compiling it with --add-source to an asm file.

 

There is also a lot of optimizers available like:

 


  -O                Optimize code
  -Oi                Optimize code, inline more code
  -Or                Enable register variables
  -Os                Inline some known functions
  -T                Include source as comment
  --check-stack            Generate stack overflow checks
  --disable-opt name        Disable an optimization step
  --enable-opt name        Enable an optimization step
  --register-space b        Set space available for register variables
  --register-vars        Enable register variables

A simple compilation like


cc65 -t lynx -O -T game.c -o game.s

creates a nice asm source file that allows you to look in detail for how the cc65 planned to optimize the code.


You can then use cl65 to compile the asm file and link the final executable.


cl65 -t lynx -o game.lnx  -C lynx.cfg game.s lynx.lib

 

It was a calculated risk, though given how little time I was left with for an actual game (about 3 days), I cut it way too close for comfort :lol:

 

I love --add-source, it's phenomenal being able to instantly see each line of C code translated. Gives you an instant view of what desperately needs to be rewritten in ASM.

 

Not sure about the optimization switches. I was regularly running into code that didn't even compile into working one. Simple things like Array [X] += variable

 

Thus, I wouldn't trust the optimizations. I rather rewrote most critical parts of the pipeline in ASM.

 

Still, compared to what is available on Jaguar, CC65 is absolutely incredible.

  • Thanks 1
Link to comment
Share on other sites

5 hours ago, laoo said:

I agree 100%. On 6502 there is just no sweet spot and you have to choose which resource to manage better - CPU time and memory usage, or... your life-time, and there is no such compiler that will "generate exact same code you would have written by hand".

 

To be precise: I agree with your overall observation, but the TLDR part is a matter of personal decision and preferences what kind of game or games you want to produce. I have my paid job, writing games is my hobby and personally I spend on it as much time as I want (or actually how much my wife allows me to).

Technically, my compiler isn't really a compiler, it's more of an Advanced Macro Expander :lol:

But, it does create exact same code as written by hand, simply because I learnt the hard way that a marginally faster manual code is absolutely not worth the money it costs to produce and maintain in future.

 

I get your point as a hobby, till recently, I could have spent a weekend on some stupid academic exercise (I used to not care if the code was throwaway), but now I view each page of code in terms of long-term refactorability, which was not a concern at all, when it was just aimless weekend hobby.

4 hours ago, enthusi said:

This goes for any 80ies 6502-based game. They were all written in assembly by hand (with very few exceptions).

You can reverse it and rewrite it and in C64-land that did and does happen in fact :)

Except for compiled BASIC (horrible, horrible, horrible) you can read almost any routine in a disassembly rather well.

Personally, I believe that you only want hand-written assembly in 6502/65C02.

I actually don't want completely hand-written ASM. It's a waste of money for components that aren't critical to performance.

 

Now, I'm not arguing the point that my compo game has very little gameplay inside (~3 days worth of coding). But, there's no freaking way I would have anything remotely playable if I didn't use CC65 and write all gameplay in C.

 

From last year experience on Jaguar with this new language, I found out I need an environment that is very easy to quickly prototype in and very easy to return to.

 

 

So, I want the same on Lynx. If I can sell 60-80 copies of Lynx game, that would cover my living costs (that I project to be about 6 months from now, once some credit card payments fall off) and I could actually spend 6-8 weeks of work on it. When you have the engine, tools, exporters and a tested workflow, you can do some really nice stuff in 6 weeks :)

 

 

Now, that I experienced life outside of corporate environment, there's no bloody way I wanna go back to that absurd lifestyle :lol:

 

Link to comment
Share on other sites

26 minutes ago, Europatari said:

and also, i said, that it could be possible with the class files to reprogramm the java game to a gba game, not only lynx

It should be clear by now, that you can't "reprogram" a Java game. You can get inspired by the GFX and sounds and maybe check the logic.
But using the (de-compiled) Sources directly is impractical not to say useless.

Link to comment
Share on other sites

1 minute ago, Europatari said:

okay, i am just upset, that mercury meltdown or luxor cannot be ported to the Atari lynx :(

I do not know these, but they can be ported. But not by just taking the .jar file. As Karri noted, you cannot just grab some GFX and scale it down to the Lynx rez.

Link to comment
Share on other sites

A bit more seriously. The only way you can make use of Java sources is to learn more easily about game mechanics. Back in the days, when arcade games were ported to home computers, the teams usually only had a machine in their office, no sources or whatever. Sometimes just video footage of the game being played even! So Java or whatever sources would help alot to get (non trivial) dependencies right.

You might even try to convert some of the original art or at least use it as basis. But when coding for any 8bit plattform you will always want to work close to the hardware. This means assembler or maybe C with hardware critical parts in assembler (libraries). Decisions by the developer for a smartphone plattform will differ ENORMEOUSLY from what is required on a 64K RAM system.

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

13 minutes ago, enthusi said:

A bit more seriously. The only way you can make use of Java sources is to learn more easily about game mechanics. Back in the days, when arcade games were ported to home computers, the teams usually only had a machine in their office, no sources or whatever. Sometimes just video footage of the game being played even! So Java or whatever sources would help alot to get (non trivial) dependencies right.

You might even try to convert some of the original art or at least use it as basis. But when coding for any 8bit plattform you will always want to work close to the hardware. This means assembler or maybe C with hardware critical parts in assembler (libraries). Decisions by the developer for a smartphone plattform will differ ENORMEOUSLY from what is required on a 64K RAM system.

 

Good reading closely related to "porting a game": http://bizzley.com/ (=> download)

Edited by 42bs
  • Like 1
Link to comment
Share on other sites

15 hours ago, 42bs said:

I do not know these, but they can be ported. But not by just taking the .jar file. As Karri noted, you cannot just grab some GFX and scale it down to the Lynx rez.

 

I was able to recover this super secret Crysis prototype for Atari Lynx, so does Lynx run Crysis? Maybe! ?

 

lynx-crysis.thumb.jpg.4ad5034bd51243eac3558f419ec8888f.jpg

  • Like 1
  • Haha 2
Link to comment
Share on other sites

4 hours ago, necrocia said:

 

I was able to recover this super secret Crysis prototype for Atari Lynx, so does Lynx run Crysis? Maybe! ?

 

lynx-crysis.thumb.jpg.4ad5034bd51243eac3558f419ec8888f.jpg

Ah, Lynx III with high-color display.

 

On Lynx II it would look like this:lynx-crysis_16.jpg.5926e1cf4a9b2108c8f47a9d87c26dee.jpg
 

Not that bad.

Edited by 42bs
  • Like 3
Link to comment
Share on other sites

2 minutes ago, solo/ng said:

I 100% disagree here.

You sure can, except my Jaguar compiler has been doing this for last year, for both 68000 and RISC targets.

 

Things like looping, math expressions, conditions - those all have pre-determined set of instructions that the compiler merely replaces within the source code.  Some features are more complex than others to implement, yes.

 

Conditions are more complex, as at the moment you find the "if" keyword you don't know yet if there is an accompanying "else" branch (or how deep it goes). Hence, you must be able to handle all scenarios, which gets messy with the labels.

 

But, other than conditions, everything else is straight replacement. How is that exactly impossible ? 

Link to comment
Share on other sites

Just now, solo/ng said:

And if so - why we didnt see it on the Lynx game of yours? In game all I see is few simple polygons, without rotations or anything. 

Oh, you haven't read this thread even, as I mentioned it already.

 

On Lynx, I don't have this compiler implemented yet - but as it will save me a lot of effort in future, I soon will.

 

Why on earth would I want to rotate the polygons there :) ?!? Makes no sense to me why to waste performance on that.

Link to comment
Share on other sites

The rotation was just an example. You showed us cool looking screenshots (the word screenshot is important here) and I was actually excited to see what you submit.

Then I saw a super simple "road" that can be done even without any 3D calculations at all. On a stock A800. Where is the stuff!; )

 

Back in the days we had a realtime 3D engine on A800 (that could render for example 128 triangles tourus with backface culling and lightsourcing - in ~15 frames). All realtime, no precalc.

So I know "a little" how stuff like this can or cant be done on 6502. So the phrase "Performance-wise, my compiler will generate exact same code you would have written by hand" is just wrong and please dont say stuff like that because is false. It triggered me;).

 

Will wait for the finished compiler then!.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...