Search found 50 matches

by ehaliewicz
Thu Mar 31, 2016 6:06 pm
Forum: Tools
Topic: Sozobon source code changes?
Replies: 17
Views: 21400

Re: Sozobon source code changes?

neozeed wrote:
ehaliewicz wrote:Do you specifically need a C compiler or just runtime code generation of some sort?

I wanted a tiny and portable c compiler (linker and assembler ).

I may just give up, or start debugging.
Or write your own :D
by ehaliewicz
Wed Mar 30, 2016 8:25 pm
Forum: SGDK
Topic: Raster Effect with Gendev ( SGDK)
Replies: 33
Views: 32823

Re: Raster Effect with Gendev ( SGDK)

alko wrote:
alko wrote:Shalom.

Please show me the complete source code of this effect (vertical scaling).
:oops: It is even possible to implement by means of SGDK?
What are you trying to do? Scaling sprites vertically?

Edit: nevermind, read the first page of the thread
by ehaliewicz
Tue Mar 29, 2016 10:40 pm
Forum: Tools
Topic: Sozobon source code changes?
Replies: 17
Views: 21400

Re: Sozobon source code changes?

Do you specifically need a C compiler or just runtime code generation of some sort?
by ehaliewicz
Wed Mar 02, 2016 9:13 pm
Forum: SGDK
Topic: C optimizations
Replies: 20
Views: 12502

Re: C optimizations

cero wrote:OP: Port the cpu-heavy parts to your host machine and profile there, with the superior tools available.
You'll want to be careful with this idea. Modern CPUs are very different from something like the 68k, and what works well on one might not work well on another.
by ehaliewicz
Tue Feb 09, 2016 8:52 pm
Forum: SGDK
Topic: Is it possible to 'scale' sprites?
Replies: 25
Views: 16411

Re: Is it possible to 'scale' sprites?

Manveru wrote:f the console sprites did not save 2 colors per byte, it will be a lot faster.
Agreed. I converted to bytes before rotating, which definitely incurs a large performance hit, but manipulating nibbles probably wouldn't have astounding performance either.
by ehaliewicz
Fri Feb 05, 2016 5:41 pm
Forum: SGDK
Topic: Is it possible to 'scale' sprites?
Replies: 25
Views: 16411

Re: Is it possible to 'scale' sprites?

I don't know if this is what you are asking for, but you can try. I did and i have good results, but slow if you update it every frame: http://www.drdobbs.com/architecture-and-design/fast-bitmap-rotation-and-scaling/184416337 I've also used this technique. If I remember correctly, it would instantl...
by ehaliewicz
Tue Jan 12, 2016 6:34 pm
Forum: Megadrive/Genesis
Topic: Pointer Tables and Jump Tables By Example
Replies: 12
Views: 9929

Re: Pointer Tables and Jump Tables By Example

You're right about bsr (a0), my mistake, however pc-relative addressing would have taken more text to explain, and I was going for a simple example of the principle of a jump table, not an optimized or practical real-world example, as already mentioned. Fourth. He actually branches to pointer data, ...
by ehaliewicz
Tue Jan 12, 2016 3:04 am
Forum: Megadrive/Genesis
Topic: Pointer Tables and Jump Tables By Example
Replies: 12
Views: 9929

Re: Pointer Tables and Jump Tables By Example

Ok, let me try to describe a bit better what's going on It will probably help if you have Easy68k and step through the code a line at a time. example_1: ;; load example value into d0, could be any number with any range of entries in the jump table ;; different size entries will necessitate different...
by ehaliewicz
Mon Jan 11, 2016 1:12 am
Forum: Megadrive/Genesis
Topic: Pointer Tables and Jump Tables By Example
Replies: 12
Views: 9929

Re: Pointer Tables and Jump Tables By Example

The reason your example is equivalent to a switch statement is because the code in the table uses JSR, so the routines will always return to the next entry in the table. A simple example of a jump table would be something like this. Sorry it's not a real world example, but the code works. ;; dispatc...
by ehaliewicz
Wed Dec 30, 2015 12:15 am
Forum: Megadrive/Genesis
Topic: Are there any good/elaborate ASM tutorials around?
Replies: 11
Views: 9691

Re: Are there any good/elaborate ASM tutorials around?

The example code you have would do this move.l d0, -(a2) // moves the 32-bit value in d0 to the address pointed to by a2, decrementing it by 4 before addressing move.l d2, (a4)+ // moves the 32-bit value in d2 to the address pointed to by a4, incrementing it by 4 after addressing the increment/decre...
by ehaliewicz
Wed Nov 18, 2015 11:02 pm
Forum: SGDK
Topic: Issue swapping out palette colors
Replies: 3
Views: 2952

Re: Issue swapping out palette colors

This is because those drawText calls do not actually draw to the screen, but are essentially telling the VDP to draw those tiles later on, after the setPaletteColor changes have been made. There are two solutions, change the palette mid-frame (during horizontal interrupts), or use multiple palettes ...
by ehaliewicz
Tue Apr 28, 2015 6:07 pm
Forum: Megadrive/Genesis
Topic: Cycle accurate emulation: Exodus 2.0 + Open Source Release
Replies: 10
Views: 7536

90% performance improvement over the previous version?
That's seriously impressive.
by ehaliewicz
Fri Mar 13, 2015 4:01 am
Forum: SGDK
Topic: Setting the transparency color to use with Sprites
Replies: 1
Views: 2554

Yes, the first color in the palette is transparent.
by ehaliewicz
Wed Mar 04, 2015 12:26 am
Forum: Megadrive/Genesis
Topic: Interesting Code Snippets and Other Stuff
Replies: 2
Views: 3523

Here's a piece of code I saw the other day for computing signum of a 32-bit integer.

Code: Select all

// c version
int signum(n) {
    if (n < 0) { return -1;}
    else if (n > 0) { return 1; }
    else { return 0; }
}

// optimized version
add.l d0, d0
subx.l d1, d1
negx.l d0
addx.l d1, d1