Jump to content
IGNORED

Prince of Persia


José Pereira

Recommended Posts

How large is the runtime ? That might actually be No 1 problem here...

...

What exactly do you mean by structs being slowest ? Got some example how cc65 handles it ?

 

The linked runtime size depends on the functions used, but even for no C lib calls there is still a few KB of code to handle C language itself (f.e. arithmetic operations on datatypes etc.).

 

The example of slow structs is there:

http://www.cc65.org/mailarchive/2010-09/8593.html

Link to comment
Share on other sites

The linked runtime size depends on the functions used, but even for no C lib calls there is still a few KB of code to handle C language itself (f.e. arithmetic operations on datatypes etc.).

 

The example of slow structs is there:

http://www.cc65.org/...10-09/8593.html

Wow. That "compiled" result of struct access, like, *reallly* sucks...

 

However, you also showed the perfect workaround - it's the ages-old optimization trick (which is still very relevant even on today's PCs) - using SoA (structure of arrays) instead of AoS (array of structures). Just without the encapsulating structure.

 

That's something that I could still easily work with, since the readability is only slightly reduced.

 

Although, feature, by feature, we're getting closer to ASM :grin:

 

And, since you can combine ASM with C in CC65, one has always the option to go berserk if really needed :skull:

 

Are the conditions (if (x<57)) compiled also so excessively ?

Link to comment
Share on other sites

Are the conditions (if (x<57)) compiled also so excessively ?

 

It depends. The best you can do is to regularly look at the generated code and optimize it from the C language, but then you loose most of the advantages of using C.

I think in the next project I would use MADS. With macros the code can be really readable. For examples take a look at the thread of the new GUI development http://www.atariage.com/forums/topic/154520-new-gui-for-the-atari-8-bit/

Link to comment
Share on other sites

It depends. The best you can do is to regularly look at the generated code and optimize it from the C language, but then you loose most of the advantages of using C.

I think in the next project I would use MADS. With macros the code can be really readable. For examples take a look at the thread of the new GUI development http://www.atariage....he-atari-8-bit/

What's your preferred solution to integrate MADS with cc65?

Link to comment
Share on other sites

It depends. The best you can do is to regularly look at the generated code and optimize it from the C language, but then you loose most of the advantages of using C.

I think in the next project I would use MADS. With macros the code can be really readable. For examples take a look at the thread of the new GUI development http://www.atariage....he-atari-8-bit/

OMG.

 

MADS looks incredibly awesome !

Not only does it allow to define your own macros, which is probably No 1 feature for making code more readable, but you can define structures, enums, arrays, functions with arguments, multiple mnemonics at single line, 5 levels of labels, and even if.else.endif.

Plus, you can break down the source code into multiple source files and it even has conditional compilation (ifdef).

 

 

You can absolutely create an order-of-magnitude more readable code with MADS compared to old-style ASM of 80`s...

Link to comment
Share on other sites

I set the STARTADDRESS value of the linker config file to put the CC65 generated code above the MADS code.

Then I merge the MADS generated executable with CC65 generated code with my own tool "merge-xex" (in the attached archive).

Thanks a lot! So it's possible to get the best of both worlds into one program!

Link to comment
Share on other sites

I set the STARTADDRESS value of the linker config file to put the CC65 generated code above the MADS code.

Then I merge the MADS generated executable with CC65 generated code with my own tool "merge-xex" (in the attached archive).

Sounds great. Does it mean you can use all symbols (variables,functions) of C code inside MADS ?
Link to comment
Share on other sites

BTW, the original assembler was Merlin.

 

This thread triggered some musing over actually building JM's old code. The nice guys over at 6502.org, who by the way would not put up with Emkay at all, have a thread going on this very topic. http://forum.6502.org/viewtopic.php?f=2&t=2223&sid=69167246757f3c415cf323e11684b8b5

 

About mid thread down on the first page one of them linked to the Merlin documentation. That project is an Apple build, BTW. Lots of good hints in there now, and if they are successful, an excellent baseline for an Atari project.

  • Like 2
Link to comment
Share on other sites

BTW, the original assembler was Merlin.

 

This thread triggered some musing over actually building JM's old code. The nice guys over at 6502.org, who by the way would not put up with Emkay at all, have a thread going on this very topic. http://forum.6502.org/viewtopic.php?f=2&t=2223&sid=69167246757f3c415cf323e11684b8b5

 

About mid thread down on the first page one of them linked to the Merlin documentation. That project is an Apple build, BTW. Lots of good hints in there now, and if they are successful, an excellent baseline for an Atari project.

 

ROTFL

 

Going to use that forum leads people to stop doing development on the A8 instantly, because it's what happens regulary .... with or without me ;)

 

Sometimes I have to make myself clear what people were commonly using 8 bits and code them.

Calling themselves "professionals" while being not able to control some code on an 8 bit machine, and also even forget slightest things and don't understand simple mechanics. Talking in the deepeset dirt language to hide their own flaws.

 

Seems I have a masochistical syndrome ... ;)

 

Well, luckily the A8 HAS some clever coders, so it's not all useless. Even if it was better to have a look at the polish Atari forum.

 

Link to comment
Share on other sites

I'd be more concerned about someone who considers themselves an authority when their last game was written back when I was a small child who could just about PRINT his name on the screen. I've learned *everything* in the time you've been kicking around whining that nobody does things according to your great plan.

 

Quite literally everything. I've gone from that to an actual professional software engineer. We're talking the hours spent coding in the back bedroom, the education, the degree, actually finding a job, working through several products and the release of products that have an audience of literally millions of users.

 

The funny thing is there's people in this thread who have done a bloody sight more than I have in the same time that put me to bloody shame!

 

Now back to you again. what do you see? what have you done?

 

Nothing. Nada. Sod all. Ni una puta cosa.

 

So why don't you just break the bloody cycle, and get off peoples backs? You're just sounding more pathetic by the post.

  • Like 10
Link to comment
Share on other sites

Annotations from a newbie.

I've been here for round about two month and I really like this forum, because of the a many A8 enthusiasts I found here. I also like the discussions here. In order to keep a discussion running, different point of views are needed. Even if dont agree with every input of Emkay, but if all opinions would go into the same direction the sticking points couldn't be figured out as well. Sometimes even a 'wrong' way leads surprisingly to a new solution.

For me respect is most important, even if the viewpoints differ. Hey, we all still like A8!

Therefore I'm looking foreward to the next discussion...

  • Like 1
Link to comment
Share on other sites

Sorry about the Emkay-based negativity there - I like a good technical discussion as much as the next low-level hardware-obsessed geek, regardless of which machine so long as it has an interesting chipset. It's just that he does rather grind you down after a few years of repeating the same kind of thing :)

 

I'm beginning to think my next little project ought to be an assembler source file cleanser that can take esoteric source formats such as the PoP source and clean them up to work on more popular assemblers. It fits in around other things I'm working on at the moment and would probably be a useful thing to have...

  • Like 6
Link to comment
Share on other sites

Sorry about the Emkay-based negativity there - I like a good technical discussion as much as the next low-level hardware-obsessed geek, regardless of which machine so long as it has an interesting chipset.

I did notice a lot of attacks on emkay recently. Frankly, I have to admire his patience and level of understanding, because in every other reply of every thread someone feels an insatiable urge to kick into him.

 

It's just that he does rather grind you down after a few years of repeating the same kind of thing :)

Dude, this is teh interwebs ("Honey - are you going to bed ? I can't. Someone is wrong on the internet !") ! Just ignore him if he raises your blood pressure :)

Personally, even though his replies may be borderline at times, he is still a great discussion facilitator and tends to dig out lots of technical information from people.

I've seen it in many threads - if it weren't for him, lots of technical discussions wouldn't have half as much information (people would just keep it to themselves) and, what is even more important, technical conclusions.

 

If coding is not his sh*t, why do I see in every other thread someone asking him to go out and do the sh*t ? He just states the obvious - techniques A and B and C have been developed, there is a general understanding how they work. Ergo, they CAN be implemented and are EASY to do so, now that we have the knowledge about them. He doesn't need to be excellent coder to state that.

 

Frankly, some of you have taken longer to argue with him, then it would take you to actually roll up the sleeves and do the sh*t themselves ! But, that's human nature :)

 

I'm beginning to think my next little project ought to be an assembler source file cleanser that can take esoteric source formats such as the PoP source and clean them up to work on more popular assemblers. It fits in around other things I'm working on at the moment and would probably be a useful thing to have...

Assuming a high-level language like Java, C#, a parser that would translate/emulate the few missing instructions from one CPU to another CPU of the same family is a question of one weekend, at most.

It's so easy, it could easily be a coder's job interview excercise...

 

If you gave me a table of the new instructions (and preprocessor translations) and their respective emulation (push regs, emulate, pop regs back) I could easily fit them into my VisualBasic -> C translator (that I'm working on for Atari Jaguar - that will effectivelly allow one to code under VisualStudio IDE and use VisualBasic, that gets coverted to C code , that is then (via a batch script) compiled and fed to Jaguar emulator) and I could run it over the PoP source myself.

 

Of course, you would still have to look around the nearby code, if it doesn`t do anything suspicious and might have to check nearby jumps if they don`t have absolute values and other stuff.

But you`d get the compileable codebase very, very soon - compared to fiddling with a page of code (or two), manually...

Link to comment
Share on other sites

I'm pretty sure sack is talking about a Merlin and old friends to MADS type of filter rather than a CPU to CPU filter. If so, that would help things along as the barrier to building things would be that much lower. If so, yes a very useful thing to have.

 

The reason he gets either noted for not coding, or asked to code is "the obvious" sometimes just isn't and one needs to have some experiences to understand when that's true. This also impacts projects in that expectations for them often do not align with the realities of doing them.

Link to comment
Share on other sites

I have tried to get information out of him, and it's like getting blood out of a stone. All you get is more of his 'nobody will ever build my perfect tool' mentality - even when you ask direct questions about WHAT should be implemented in it and HOW.

 

So you try and have a conversation whilst ignoring his presence and he stomps into the middle of it, claims his superiority and just pisses all over it. What I'm working on I'm pretty much back to discussing amongst a small group of people elsewhere to be honest - it's easier that way.

 

 

On the technical front - I have toyed with converting code to an intermediate format from sources and then rewriting code for other chips as an experiement, but in this case I was just thinking of something to sanitise XASM/MERLIN/ACME/BBC BASIC sources so that I can pull shared logic from apple/c64/atari/BBC sources and build graphics frameworks around them. It'd still leave a lot of work to do, but at least it'd be the more interesting work, rather than a fun evening filtering DC.B/!byte/EQUB statements and fixing labels, ROL/ROR statements, macros, etc.

Edited by sack-c0s
Link to comment
Share on other sites

I did notice a lot of attacks on emkay recently. Frankly, I have to admire his patience and level of understanding, because in every other reply of every thread someone feels an insatiable urge to kick into him.

 

People treat him as he deserves.

 

Dude, this is teh interwebs ("Honey - are you going to bed ? I can't. Someone is wrong on the internet !") ! Just ignore him if he raises your blood pressure :)

Personally, even though his replies may be borderline at times, he is still a great discussion facilitator and tends to dig out lots of technical information from people.

I've seen it in many threads - if it weren't for him, lots of technical discussions wouldn't have half as much information (people would just keep it to themselves) and, what is even more important, technical conclusions.

 

I did put emkay to ignore-list long time ago but it does not help, because he still destroys interesting threads. He is not a discussion facilitator but a troll who people try to convince with technical arguments. They would share the same technical knowledge if you ask but would not be discouraged by childish behavior.

 

If coding is not his sh*t, why do I see in every other thread someone asking him to go out and do the sh*t ? He just states the obvious - techniques A and B and C have been developed, there is a general understanding how they work. Ergo, they CAN be implemented and are EASY to do so, now that we have the knowledge about them. He doesn't need to be excellent coder to state that.

 

Move it to any other creative activity like writing, painting or composing.

"Techniques A and B and C have been developed, there is a general understanding how they work. Ergo, they CAN be implemented and are EASY to do so, now that we have the knowledge about them."

So why not everyone is Shakespear, Rembrandt or Beethoven? If you want to have the BEST RESULTS it requires skill, experience, patience and hours and hours of work. I would call this opposite - a HARD work. People who never do anything call things EASY. They are usually idiots or ignorants but they will never find that out, because that would require them to try to do things themselves.

I have ignored emkay after his trolling in RastaConverted thread. To create this tool it was months of programming, debugging, testing and reading papers about Atari internals, 6502 and Antic timings, color quantization techniques, color distance algorithms, dithering, optimizations in large search spaces etc. Everything in a precious free time. And then some asshole comes and puts in every post how easy the things are...

Edited by ilmenit
  • Like 9
Link to comment
Share on other sites

Just a note that the CC65 suite does come with a good assembler of its own (CA65) and this has a powerful macro engine too that's worth a look at. But MADS does have a bigger user base and is well maintained, plus integrated well with the WUDSN Eclipse IDE environment which has a good following too.

  • Like 4
Link to comment
Share on other sites

Yeah and it even can "simulate" other assembler syntax :)

Okay, it probably needs a lot work, but if you have more then one source file it should be useful.

BTW, for one time job like the PoP code, it might be a big help to use some regex for most part of the conversion.

 

 

@Emkay-bashing:

It is correct that he has some knowledge and I still love his sound-experiments. But, as a lot of people have said, it's easy to talk, but harder to actually do something.

this is something you ONLY realize when you actually code it. I am not saying he (or who ever) should actually spend months coding a game with a technique. But sitting down some days and only try it out. One might realize that it is easy to list/explain all possible tricks the A8 can do, but combining them is NOT that easy, as they party contradict themselves.

 

And just for the record, Emkay is on my ignore list as well. If he posts something useful I rely on other people to quote it. ;)

 

 

A bit more on topic: As I pointed out already, I am coding a simple engine for J'n'R-style games ATM. I do the collision checks with the environment on a char-basis.

Did that in MJO and it worked quit well. I do not use an extra collision map. I just aggregate chars. E.g. char 0..Nb are "background" no collision, char Nb+1..Nc are foreground, so a collision with the player blocks the player and finally the "harming chars" collision with these player dies. As long as you are dealing with non-movable blocks its really quick and simple.

For collision with moving sprites I use bounding-box checks for now. As there are at most 8 sprites on screen this is quick enough. IIRC my last test took 1 scan-line (114cycle) for 3 enemy sprites.

 

If Jose finds a possibility to use four interleaved char-sets instead of eight, a quick test with the engine could be done. Expanding the sprites from 9x16 to 13x24 isn't much of a problem.

Link to comment
Share on other sites

CrtXL you know that to PoP 3sections translated into charmode are 8charlines tall each.

From my 'in privat' work in the last days it seems I can pack/join all the levels (the rocks and yellowish palace) data in 8charsets = 8KBs.

As it still would not have almost no repeat ed chars it would be, probably, be the same if using 4 Interleaved charsets.

This way you would have 4charsets data/4KBs for the rocks and more 4 for the palace that it is the same thing.

 

I have one level all converted and char/tiles that is between, around 30->40chars on eachone of the 8charsets.

Then, if going into 4 there's no more than 80chars per each charset. 48 free chars are more than enough for the guys and other moving things.

 

I'll send you that level and some guys sprites frames tomorrow.

Thanks.

Link to comment
Share on other sites

Move it to any other creative activity like writing, painting or composing.

"Techniques A and B and C have been developed, there is a general understanding how they work. Ergo, they CAN be implemented and are EASY to do so, now that we have the knowledge about them."

 

So why not everyone is Shakespear, Rembrandt or Beethoven? If you want to have the BEST RESULTS it requires skill, experience, patience and hours and hours of work. I would call this opposite - a HARD work. People who never do anything call things EASY. They are usually idiots or ignorants but they will never find that out, because that would require them to try to do things themselves.

Isn't that example with Shakespear (et al) a bit extreme ? There were thousands of great artists, who produced phenomenal work, yet were never famous, despite the quality of their work. It's art after all.

 

Now, I did chose a poor wording by saying "EASY". Of course, it's a hard work, since you do the programming in your free time (which is a very precious commodity for anyone in their late 30's-40's), although I am probably skewed on what constitutes a hard work, especially after spending a decade creating 3D engines across all APIs and many HW platforms, games, tools and everything else the game needs (in my free time).

So, an unfortunate effect of that is, that I consider PoP thing, quite literally, easy from the gameplay standpoint (note, that I'm not referring to all those gfx-mode combination techniques researched recently), since it is barely 1% of effort I put into the 3D stuff, especially if you do it in C - which, as has been unfortunately shown to me in last 2 pages, will be a no-go for A800 since the cc65 produces extremely inefficient ASM code for even the very basic language constructs - thus ASM will be a necessity and the amount of coding work thus may very well be multiplied by perhaps even a factor of 5 (or more).

 

 

I have ignored emkay after his trolling in RastaConverted thread. To create this tool it was months of programming, debugging, testing and reading papers about Atari internals, 6502 and Antic timings, color quantization techniques, color distance algorithms, dithering, optimizations in large search spaces etc. Everything in a precious free time. And then some asshole comes and puts in every post how easy the things are...

Well, one could be obviously see that he had some serious deficit in the knowledge-base of Color Space :) I did, however stop following that thread somewhere in the middle, so I may not know the whole history...

BTW, did you create the rastaconverter ? It's one sick awesome achievement !

 

 

 

 

Question for Jose - do you happen to have the art assets for walls that would only be in 4 colors ? Meaning, no special gfx mode technique would be needed ? I am asking because that is something I could start working with. Of course, in worst case, I could just reduce the colors manually in Paint Shop Pro, but it would be great if we had a 4-color version of the art assets - and I figured it doesn't hurt to ask :)

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...