Search found 478 matches

by r57shell
Sun Feb 07, 2016 5:46 pm
Forum: SGDK
Topic: Sprite display area
Replies: 1
Views: 2253

Re: Sprite display area

All that confusion comes from using ambigious things. "Sprite visible position" - is ambigious term. All what it can do, is confuse you. To describe sprite positioning on screen in complete way, all you have to do is to say: 1) all sprites is rects, axis aligned. 2) two axis: x, y. X is horizontal a...
by r57shell
Sun Jan 31, 2016 1:11 pm
Forum: SGDK
Topic: Is it possible to scroll two planes horizontally by line AND plane?
Replies: 5
Views: 4491

Re: Is it possible to scroll two planes horizontally by line AND plane?

POLYGAMe wrote:The problem is, since I've set the horizontal scroll to 'line' I can't scroll my background as one image.
wut :shock:
just put same value for each line.
by r57shell
Fri Jan 29, 2016 2:23 pm
Forum: SGDK
Topic: C optimizations
Replies: 20
Views: 12487

Re: C optimizations

In fact, no. Until recently, I didn't even know these tools exist, and since, I don't really see how they help. Code profiler providing info how long takes execution of each part of your program. In result, if something does spent most of CPU time, it means that it's your program bottleneck. If you...
by r57shell
Thu Jan 28, 2016 9:02 pm
Forum: SGDK
Topic: C optimizations
Replies: 20
Views: 12487

Re: C optimizations

if you wanna profile your code, write simple Lua script and use my version of gens. But, in plain result you'll get addresses. To get lines of source where it does slow, you have to compile your ROM with debug information, and somehow extract this debug info on your own. It's long way, I never did ...
by r57shell
Wed Jan 27, 2016 6:57 pm
Forum: SGDK
Topic: C optimizations
Replies: 20
Views: 12487

Re: C optimizations

if you wanna profile your code, write simple Lua script and use my version of gens. But, in plain result you'll get addresses. To get lines of source where it does slow, you have to compile your ROM with debug information, and somehow extract this debug info on your own. It's long way, I never did t...
by r57shell
Sun Jan 24, 2016 1:16 pm
Forum: SGDK
Topic: Some problems with code compilation
Replies: 10
Views: 5612

Re: Some problems with code compilation

Usage of global variables in C for noobs: 1) define variable in single header (*.h) with extern keyword. 2) define variable in single source (*.cpp) without extern keyword. If you wanna have different variables with same name in different sources (*.cpp) you should use static keyword. If you wanna d...
by r57shell
Thu Jan 21, 2016 5:38 pm
Forum: Controls
Topic: Joypads 3/6 Button Response Timings
Replies: 7
Views: 13041

Re: Joypads 3/6 Button Response Timings

I don't think that's a valid combination... (address registers can't have byte operations done on them) Yeah, when I check reference first, I somehow missed note for source: "For byte size operation, address register direct is not allowed" Because I thougth as in all other places it should be marke...
by r57shell
Thu Jan 21, 2016 2:58 pm
Forum: Controls
Topic: Joypads 3/6 Button Response Timings
Replies: 7
Views: 13041

Re: Joypads 3/6 Button Response Timings

You could probably shave off four cycles by using something like MOVE.B D0, (A0) (and having the $40/$00 in the register beforehand). You can't avoid those initial four cycles reading the opcode though, so that's as fast as it gets. Problem is that I'm using all d0-d7 to store results of joypad rea...
by r57shell
Wed Jan 20, 2016 2:37 pm
Forum: Controls
Topic: Joypads 3/6 Button Response Timings
Replies: 7
Views: 13041

Re: Joypads 3/6 Button Response Timings

And for what matters, two NOPs should be guaranteed to work because that's what Sonic 1 uses and nobody in their right mind would make a controller that doesn't work with that game. If it's true, then it should show not bigger than 4 for appropriate delays. Reason is: there are many implementations...
by r57shell
Wed Jan 20, 2016 12:04 am
Forum: SGDK
Topic: Mixing C and asm
Replies: 10
Views: 5464

Re: Mixing C and asm

but two labels ".ret" leads to error of "already defined"... :(
by r57shell
Wed Jan 20, 2016 12:01 am
Forum: Controls
Topic: Joypads 3/6 Button Response Timings
Replies: 7
Views: 13041

Joypads 3/6 Button Response Timings

Hooray! I made this nice ROM powered with SGDK. ( edit: ROM updated) edit2: Now it outputs even numbers. There is no way to wait odd count of cycles. And, now instead of 1/2/3 it shows 4 because smallest is NOP = 4 cycles. edit3: ROM updated, added 4 more variants for test: using new move.w a2,(a0) ...
by r57shell
Tue Jan 19, 2016 5:52 pm
Forum: SGDK
Topic: Mixing C and asm
Replies: 10
Views: 5464

Re: Mixing C and asm

As I see in code posted here... you're using syntax without "%". How do you use them? When I tried to compile assembly in SGDK, it required gcc syntax (actually GNU syntax). Oh, I see a bit above answer on this question. Sorry, I'm slowpoke :oops: Ok, to avoid deleting this post, I'll ask other ques...
by r57shell
Mon Jan 18, 2016 7:03 pm
Forum: Video Display Processor
Topic: VDP 128Kb Extended VRAM mode
Replies: 44
Views: 85386

Re: VDP 128Kb Extended VRAM mode

Yeah, a DMA memory operation takes the same number of cycles (4), but the clock is much faster as it's the VDP's current clock which is either MCLK/4 or MCLK/5 whereas the 68K's clock is MCLK/7. Wait, 1/MCLK = ~18.624 ns So, if DMA does read at speed MCLK/4 during 4 cycles, it means that it shoud r...
by r57shell
Mon Jan 18, 2016 6:43 pm
Forum: SGDK
Topic: Is it possible to 'mirror' the screen easily?
Replies: 23
Views: 12628

Re: Is it possible to 'mirror' the screen easily?

alko
That means that program you use sux :D
by r57shell
Fri Jan 15, 2016 8:04 pm
Forum: SGDK
Topic: Device ID in SGDK (joy.c)
Replies: 5
Views: 4362

Re: Device ID in SGDK (joy.c)

Ok, during looking into games assembly, I made this ROM for educational purposes.
https://gist.github.com/realmonster/ae8 ... 89f9b3be72