Overview Features Coding ApolloOS Performance Forum Downloads Products Order Contact

Welcome to the Apollo Forum

This forum is for people interested in the APOLLO CPU.
Please read the forum usage manual.
Please visit our Apollo-Discord Server for support.



All TopicsNewsPerformanceGamesDemosApolloVampireAROSWorkbenchATARIReleases
Information about the Apollo CPU and FPU.

Writing 3D Engine for 68080 In ASMpage  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 

Vladimir Repcak

Posts 359
29 Jan 2020 08:28


Gunnar von Boehn wrote:

Vladimir Repcak wrote:

  Yeah, an audio interrupt at a rate 22050 will certainly eat some resources.
 

 
  This is not how you do Audio normally on AMIGA.
  AMIGA plays Audio with DMA.
  Our saga chipset has 8 DMA channels to play up to 8 streams of 8-16bit  samples in parallel. You point the DMA to a PCM-File in memory "WAVE" and tell it to play it.
  You don't have a IRQ per sample, but per WAVE file to play. 
  Playing Audio cost you about nearly no CPU time.
 
 

That is truly phenomenal news for me. Thank you. I was having anxiety about this already.

How long can the Wave file be ? Can it be 5 minutes ?

So the SAGA does the real-time mixing of all 8 streams for me ? Wow, that is awesome!



Nixus Minimax

Posts 416
29 Jan 2020 10:12


Vladimir Repcak wrote:
Note that especially blitter is the important part here - it clears framebuffer and fills it (including clipping), basically, for free

Hm, yes, for free. But what would you prefer:

-- being poor (few MIPS processor) but having a patron (blitter for free)

OR

-- being so rich that you can buy all the stuff you want yourself and much more (>100 MIPS processor)

?




Nixus Minimax

Posts 416
29 Jan 2020 10:16


Vladimir Repcak wrote:
How long can the Wave file be ? Can it be 5 minutes ?

It probably can but usually you have 1 sample per note and instrument and set the corresponding DMA pointers each time a new note is about to be played. This can be done with timer interrupts running at something below 1-second-granularity.

 
So the SAGA does the real-time mixing of all 8 streams for me ? Wow, that is awesome!

That's the Amiga-way.




Vladimir Repcak

Posts 359
29 Jan 2020 10:24


Gunnar von Boehn wrote:

Vladimir Repcak wrote:

  So, a parallel 5 MHz 68000 would be extremely helpful and would allow 68080 to just focus on number crunching and pixel pushing.
 

 
  The 68080 is roughly 300 times faster than 7 MHz 68000.
  So adding an extra 68000 would not make a difference.
 
  If you want to query user input this is no hassle for the 68080 CPU.
  A typical way to code this on AMIGA is writing your program in 2 threads. One doing the heavy computing work, and a second running in Vertical Blank IRQ, doing the user input and position calculation at a steady frequency of 50FPS.

Unfortunately, in our particular case it's all the difference :(

This is not a Jaguar where I have full control over IRQs and their priorities. Given that anybody can install anything on their Amiga, who knows what kind of OS/drivers (or anything else) will hook up into those IRQs. Plus, literally, I don't know what I don't know.

I cannot afford to finance that risk. How could I debug some random glitch/crash/issue related to IRQ occurring on some remote V4 that has been configured differently ?

The only sensible option right now is then to lock the framerate to 30 or 20 fps, which obviously means no resolution option or choosing details, as then it would be possible for the game to run at super low framerate which would be uncontrollable.

All my camera+AI+input code relies on independent execution from the render thread.

I have - no joke - spent tens of thousands of dollars of my living costs optimizing the hell out of it so it can run like this. I have registers in the game loop that are not changed (or restored from stack) for over 10,000 lines of code and never need to be reloaded from RAM!!!

Meaning even if render thread runs at 10 fps (not that I would allow it, but the option is there), the game still runs and controls at 60 fps yet everything is thread-safe.

There's a tremendous difference for a player if you have 60fps input on a non-60fps renderer.

Thank god I realized this now, as I literally just started porting all the engine code yesterday.

I'll happily revisit this approach for my second/third game on Vampire.



Vladimir Repcak

Posts 359
29 Jan 2020 10:59


Nixus Minimax wrote:

Vladimir Repcak wrote:
How long can the Wave file be ? Can it be 5 minutes ?

 
  It probably can but usually you have 1 sample per note and instrument and set the corresponding DMA pointers each time a new note is about to be played. This can be done with timer interrupts running at something below 1-second-granularity.

There's no need for that - it's a game not a 4 KB demo entry to SillyVenture compo :)

With 512 MB RAM and unlimited HDD space, we can create final mix at 44 kHz and not worry about it.

Besides, given the options in current DAWs and the amount of quality of LFO/modifiers you can use, a MOD player would sound like a PC speaker :)

Not to mention I would have to write such MOD player from scratch, which in itself is roughly a 4-6 week endeavour.

But, if we can just give SAGA the pointer and set the sampling frequency, I'm good :)

So, I can have 8 different sounds playing in parallel without having to worry about mixing them manually:
- main music track
- secondary shorter track (like Gameover, etc.)
- Sound FX for player ship
- Sound FX for shooting
- Sound FX for hit
- Sound FX for explosion
- Sound FX for enemy shooting
- Sound FX for collision

Correct ?

Nixus Minimax wrote:

 
So the SAGA does the real-time mixing of all 8 streams for me ? Wow, that is awesome!

 
  That's the Amiga-way.

So this is the one and only thing that is easier to get working on Amiga :)



Stefano Briccolani

Posts 586
29 Jan 2020 11:26


Vladimir, remember that if you aim to reach maximum user base, you must deal with 128 mb of ram and four channels. The 4500 vampirized people you see on vampire accelerator page are all v2 users.


Vladimir Repcak

Posts 359
29 Jan 2020 11:43


Nixus Minimax wrote:

Vladimir Repcak wrote:
Note that especially blitter is the important part here - it clears framebuffer and fills it (including clipping), basically, for free

 
  Hm, yes, for free. But what would you prefer:
 
  -- being poor (few MIPS processor) but having a patron (blitter for free)
 
  OR
 
  -- being so rich that you can buy all the stuff you want yourself and much more (>100 MIPS processor)
 
  ?
 
 

Blitter isn't 100% free, in my benchmarks, its impact is about ~5-7% if you do it well.

So, let's use my example of 640x240 @65,536 colors that I routinely use on jaguar and examine the work Blitter does for me that doesn't cost me a thing each frame.

640*240 = 153,600 pixels
FrameBuffer = 307,200 Bytes

Perhaps some of those will be execute on both pipes but perhaps there will be a 4-cycle bubble. I don't know.

ClearSreen: = 76,800 cycles
with fusing (writing 64-bits) we do 307,200 / 8 = 38,400 loop executions of 2 ops:
dbra
move

So, that's 38,400 * 2 = 76,800 cycles.

Now, let's say we have 2,000 scanlines in scene that happen to cover full screen.

ScanlineFill: = 307,200 cycles
Loop of a grand total of 153,600x of 2 ops:
move.w
dbra

Clipping: = 24,000 cycles
2,000 * 12 ops = 24,000 cycles

76,800 + 307,200 + 24,000 = 408,000 cycles per frame = 0.4M

If we want 60 fps, that's 408,000 * 60 = 24,480,000 = ~25 MIPS

There goes 25 MIPS. If our scene was more complex, the upper limit - well there is no upper limit - we could literally burn through it all :)

And, with parallel Blitter, the typical overdraw doesn't impact framerate. But with CPU drawing, if our overdraw is -say- 2x, we literally impact framerate by that much - every overdrawn pixel is occupying CPU.

So, we just lost 25 MIPS (and it will be more with more complex scenes) on not having parallel Blitter.

The 170 MIPS figure is hypothetical - with all the bubbles and complexity of the pipeline, getting even 85 MIPS will be a feat. But let's be overly optimistic that we can actually reach 85 MIPS.

So, we're down to 85-25 = 60 MIPS, right ?

Now, consider that Jag has two RISC chips, each 26.6 MHz - almost 54 MHz total.
And you have 68000, also working in parallel.

Of course, I don't argue that getting same level of performance on Vampire is significantly easier for a coder, as literally anybody can write a simple, serial code in Assembler that processes the 3D pipeline, stage by stage, without having to worry about multi-threaded engine design that supports different framerates for different engine components.

So, for flatshading, it's actually going to take a serious pipeline-optimizing effort on a Vampire to beat Jaguar. Crazy notion, eh :) ?



Vladimir Repcak

Posts 359
29 Jan 2020 11:47


Stefano Briccolani wrote:

Vladimir, remember that if you aim to reach maximum user base, you must deal with 128 mb of ram and four channels. The 4500 vampirized people you see on vampire accelerator page are all v2 users.

Right, 128 ! Thanks.
So, the audio got upgraded in V4, if V4 supports 8 channels.

I probably will need V2 too. How much do they run for now (whole combo with Amiga) ?




Wawa T

Posts 695
29 Jan 2020 12:08


Stefano Briccolani wrote:

The 4500 vampirized people you see on vampire accelerator page are all v2 users.

potential users. according to igors clarification these numbers represent the people, who cared to register their interest. the number of already served customers is a fraction of this figure.


Vladimir Repcak

Posts 359
29 Jan 2020 12:26


wawa t wrote:

Stefano Briccolani wrote:

  The 4500 vampirized people you see on vampire accelerator page are all v2 users.
 

 
  potential users. according to igors clarification these numbers represent the people, who cared to register their interest. the number of already served customers is a fraction of this figure.

Wait, what ?

Those ~4,500 is the number of actual HW boards out there, no ?

Gunnar, can you please clarify ?


Stefano Briccolani

Posts 586
29 Jan 2020 14:17


This number represents roughly the orders received by Igor for V500, v600 and v1200. Doesn't rapresent the real hardware delivered just because v1200 is in huge demand now and people place the interest but have to wait patiently their turn. In this number is surely included someone who changed idea and decided (or will decide) to not buy a Vampire (10%??), but this number doesn't include someone like me that deleted his interest after buying one (from Amiga shop and not from Igor) or just bought one from an Amiga shop without declaring interest.
  And obviously doesn't include v4 standalone boards delivered. So I think the 4500 number is pretty accurate if you project it in a 4-5 months perspective (and surely will grow significantly more over the next 2 years).


Gunnar von Boehn
(Apollo Team Member)
Posts 6207
29 Jan 2020 19:42


Vladimir Repcak wrote:

  - main music track
  - secondary shorter track (like Gameover, etc.)
  - Sound FX for player ship
  - Sound FX for shooting
  - Sound FX for hit
  - Sound FX for explosion
  - Sound FX for enemy shooting
  - Sound FX for collision
 
  Correct ?

Yes correct.
SAGA supports 8 PCM channels
Each channel can be 8bit or 16bit (you decide)
Each channel can have its own waveform,
and can have its own sample rate up to 56KHz
Each channel has its own volume.
And the SGAA chipset does mix all of them for you in 24bit Fidelity.
And yes the DMA does this for you without the CPU need to do much.

All the CPU needs to do is poke per channel
- StartPTR, Length, Bitrate, volume

This is very CPU friendly and for nearly no CPU cycles you can easily play music and SND-FX


Gunnar von Boehn
(Apollo Team Member)
Posts 6207
29 Jan 2020 19:50


Vladimir Repcak wrote:

  ClearSreen: = 76,800 cycles
  So, that's 38,400 * 2 = 76,800 cycles.
 

I think you count wrong.
The loop counts to 38K cycles for me.
 
 


Gunnar von Boehn
(Apollo Team Member)
Posts 6207
29 Jan 2020 19:54


Vladimir Repcak wrote:

  I cannot afford to finance that risk. How could I debug some random glitch/crash/issue related to IRQ occurring on some remote V4 that has been configured differently ?
 

I don't understand you fear and the problem you talk about.
Please explain again!
I think your fear is based on a misunderstading.
 


Vladimir Repcak

Posts 359
30 Jan 2020 00:12


Stefano Briccolani wrote:

This number represents roughly the orders received by Igor for V500, v600 and v1200. Doesn't rapresent the real hardware delivered just because v1200 is in huge demand now and people place the interest but have to wait patiently their turn. In this number is surely included someone who changed idea and decided (or will decide) to not buy a Vampire (10%??), but this number doesn't include someone like me that deleted his interest after buying one (from Amiga shop and not from Igor) or just bought one from an Amiga shop without declaring interest.
  And obviously doesn't include v4 standalone boards delivered. So I think the 4500 number is pretty accurate if you project it in a 4-5 months perspective (and surely will grow significantly more over the next 2 years).

Now I'm really confused.

So, just how many PHYSICAL/REAL (V2 + V4) are out there ?

Less than 500 in total ?


Stefano Briccolani

Posts 586
30 Jan 2020 03:14


@Vladimir
  Why less than 500?? It's more than three years that Igor produces vampire v2 boards. For real numbers you should ask Igor and Gunnar (if they want to share their sell data). My estimation is 3500-4000 Vampire delivered as today and 4000-4500 in 5 months from now.
  This is just my assumption based on the number shown on Apollo accelerator order page that doesn't take on account the v4 standalone boards.


Vladimir Repcak

Posts 359
30 Jan 2020 04:31


Well, I honestly have zero idea, other than what is said here. I did read recently that it's being assembled by 1 person, so that obviously severely restricts the shipping throughput (but keeps quality high).

So you think it's possible to have additional 3,000-4,000 units shipped by the end of this year ?

Meaning by the end of this year it could be in the range of <6,000 : 8,000> shipped units across all configs ?


Stefano Briccolani

Posts 586
30 Jan 2020 06:19


I personally think there is 'market space' to reach other 3000+ active Amiga enthusiasts. Maybe not in a year but in two-three years as production volumes at the moment is not on par with demand.
Understand that Vampire v2 accelerators are tied to the availability of old Commodore hardware,that's becoming every day more difficult and expensive to find.
V4 Standalone can potentially break the existing hardware availability limit (and it's already doing that) but as now, with it's price-tag, is not certainly a product for 'casual" audience. So doubling the numbers in two-three years is a possibility? Yes. Breaking those numbers and enlarge market space beyond Amiga active users will be the scope of a 5+ years strategy, I think. Just my opinion, of course.



Gunnar von Boehn
(Apollo Team Member)
Posts 6207
30 Jan 2020 08:15


Vladimir Repcak wrote:

  I did read recently that it's being assembled by 1 person,
 

  The V2 is sold on the market since several years.
  For some time the V2 was produced in 2 countries (Canada and Herzegovina(Europe) )
  Today the V2 is produced by professional soldering/manufacturing company and the end finish and testing is done by Igor (Herzegovina). The V4 is produced in Germany.
   
 
Vladimir Repcak wrote:

So you think it's possible to have additional 3,000-4,000 units shipped by the end of this year ?

The expected production volume is roughly 1000 units of V2 and 1000 units V4 for this year.
As the 2000 units are not enough to satify the demand
we did yesterday had an important meeting with the FPGA vendor (ALTERA) and some other company to discuss options
for most effectively increase our production volume.
Our goal is to increase the volume next year to better satisfy the increased demand.
 


Vladimir Repcak

Posts 359
30 Jan 2020 08:59


Stefano Briccolani wrote:

I personally think there is 'market space' to reach other 3000+ active Amiga enthusiasts. Maybe not in a year but in two-three years as production volumes at the moment is not on par with demand.
  Understand that Vampire v2 accelerators are tied to the availability of old Commodore hardware,that's becoming every day more difficult and expensive to find.
  V4 Standalone can potentially break the existing hardware availability limit (and it's already doing that) but as now, with it's price-tag, is not certainly a product for 'casual" audience. So doubling the numbers in two-three years is a possibility? Yes. Breaking those numbers and enlarge market space beyond Amiga active users will be the scope of a 5+ years strategy, I think. Just my opinion, of course.
 

OK, now I see what you meant. You didn't mean 4,000 additional ones (that would imply some mass manufacturing).
 
  You meant reaching the grand total of ~4,500 units within next 4 months.
 
  That's still fine with me. I won't start the 60-day pre-order campaign until I'm reasonably sure I can finish the game in 60 days, for which I need to have a playable level with some audio. Running stable 24/7 in a loop.
 
  Which, at the very soonest, might happen earliest in March, but given this is a new platform, it's hard to estimate as I simply don't know what I don't know.
 
  So, those 4 months should roughly correlate with me finishing the V4 build.
 
  But, from experience, there's been HW issues on Jaguar that set me back 2 weeks of debugging. So, I expect the unexpected.

posts 429page  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22