Search found 26 matches

by wonder
Fri Jan 24, 2020 10:26 am
Forum: Homebrew Projects
Topic: My Platformer Framework
Replies: 10
Views: 13295

Re: My Platformer Framework

Hi!

Yes, I'm still actively working on it. There's still a lot to do, I would say the current progress is around 30%-40%.

Here's the current build. :beer: :D
by wonder
Sun Jan 12, 2020 2:15 am
Forum: NESdev
Topic: MMC3 Scanline Counter - Nestopia / Mesen / FCEUX
Replies: 4
Views: 403

Re: MMC3 Scanline Counter - Nestopia / Mesen / FCEUX

For what it's worth, Nintendulator doesn't seem to like this ROM either, displaying nothing but a screen full of "B"s. It seems that I might have created some confusion with the GIF (now replaced) I originally posted. On 8bitworkshop this is the scanline counter MMC3 example: https://8bitworkshop.c...
by wonder
Sat Jan 11, 2020 2:49 am
Forum: NESdev
Topic: MMC3 Scanline Counter - Nestopia / Mesen / FCEUX
Replies: 4
Views: 403

MMC3 Scanline Counter - Nestopia / Mesen / FCEUX

Hi guys! I need your help... :/ I wrote some code based on the 8bitworkshop MMC3 Scanline Counter example ( https://8bitworkshop.com/v3.5.0/?file=irq.c&platform=nes ) and once I downloaded the ROM, I noticed that the split/scrolling didn't work on Nestopia nor Mesen. It works only on FCEUX and 8bitw...
by wonder
Fri Nov 15, 2019 1:05 am
Forum: NESdev
Topic: Putting together variable names with macros in cc65
Replies: 15
Views: 5397

Re: Putting together variable names with macros in cc65

If you want some insight as to how the preprocessor works, you can investigate the result of the preprocessor with the -E flag . Something like this will output a file that has had all the macro preprocessing applied: cc65 -E -o thing.pre thing.c Exactly! :) Furthermore, you can try the pre-process...
by wonder
Thu Nov 14, 2019 4:10 pm
Forum: NESdev
Topic: Putting together variable names with macros in cc65
Replies: 15
Views: 5397

Re: Putting together variable names with macros in cc65

I'm a little bit confused by your post, but isn't this enough? #define DECLARE_NUMBER_WITH_POSTFIX(postfix) \ int Number##postfix DECLARE_NUMBER_WITH_POSTFIX(A); Live: https://godbolt.org/z/3qXXQY I've been doing a lot of similar stuff with macros lately, maybe this can help: sprite.h #define DECLAR...
by wonder
Sat Nov 09, 2019 5:06 am
Forum: Homebrew Projects
Topic: My Platformer Framework
Replies: 10
Views: 13295

Re: My Platformer Framework

New version: https://i.ibb.co/DzQrwWC/index.gif Note: The gif framerate is sped-up. The game runs at 60fps, nonetheless. So I managed to achieve a huge performance upgrade by writing a customized unrolled memcpy in assembly. While I recognize that using plain arrays (or an struct of arrays) is supe...
by wonder
Mon Nov 04, 2019 7:08 am
Forum: NESdev
Topic: Sin table and fixed point arithmetic in C
Replies: 8
Views: 3914

Re: Sin table and fixed point arithmetic in C

@wonder , just do a rule of three: +------------+-------------+ | real value | fixed point | +------------+-------------+ | 1.0 | 256 | | 0.5 | 128 | | 0.1 | 26 | +------------+-------------+ Thanks @NOOPr!! :beer: Wow, the solution was so simple I almost feel ashamed of asked such a question in th...
by wonder
Mon Nov 04, 2019 5:05 am
Forum: NESdev
Topic: Sin table and fixed point arithmetic in C
Replies: 8
Views: 3914

Re: Sin table and fixed point arithmetic in C

Hi guys! Thank you for the fast replies! :) @Memblers, @dougeff So let me see if I'm on the right track: static int velocity_x; void update() { // if it was a float: velocity_x += 0.1f; velocity_x += ??? position_x += velocity_x >> 8; } Assuming the code is correct, what goes on the ??? mark?
by wonder
Sun Nov 03, 2019 6:16 am
Forum: NESdev
Topic: Sin table and fixed point arithmetic in C
Replies: 8
Views: 3914

Sin table and fixed point arithmetic in C

Hi! I've been trying to understand how to implement fixed point arithmetic in C, but I can't wrap my head around it. Are there any specific C tutorials around? I'd like to start experimenting with a sine table (an analog clock demo, for example) but I'm kinda lost without decimals. One possible appr...
by wonder
Sun Sep 22, 2019 1:43 pm
Forum: NESdev
Topic: Difference between RAM and cartridge SRAM?
Replies: 23
Views: 8168

Difference between RAM and cartridge SRAM?

Hi! I'd like to apologize in advance for posting such a n00b question, but I'm having some trouble understanding the difference between the RAM (0000h-07FFh) and SRAM (6000h-7FFFh). CPU Memory Map (16bit buswidth, 0-FFFFh) 0000h-07FFh Internal 2K Work RAM (mirrored to 800h-1FFFh) 2000h-2007h Interna...
by wonder
Sun Sep 22, 2019 1:28 pm
Forum: Homebrew Projects
Topic: My Platformer Framework
Replies: 10
Views: 13295

Re: My Platformer Framework

If your char matrix[x,y] is kept in RAM, then this would be that. But I'm guessing you're keeping it in ROM, since it should need 960 bytes for each full screen and keeping it in RAM would take up almost half the available RAM on NROM. Yep! That's right, I'm keeping it in ROM (in C all I had to do ...
by wonder
Sun Sep 22, 2019 2:16 am
Forum: Homebrew Projects
Topic: My Platformer Framework
Replies: 10
Views: 13295

Re: My Platformer Framework

Hello again! Do each entity check it's collision against whatever tiles are loaded into the nametables behind them? Yes, but I'm not using the nametable itself. I'm using a grid object char matrix[x][y] = {{...}, {...}, ...}; . Is that what you're doing when using your P2B() function? P2B means "pix...
by wonder
Sat Sep 21, 2019 4:18 am
Forum: Homebrew Projects
Topic: My Platformer Framework
Replies: 10
Views: 13295

Re: Unnamed Platformer Framework

Good work so far! The jump physics do feel a little odd to me. Maybe a little too fast vertically in comparison to the horizontal velocity? I'm not sure. Thanks!! Indeed, I'm still not fully satisfied with the current velocity/acceleration values, there's still a lot of room for improvement. :) Thi...
by wonder
Wed Sep 18, 2019 2:49 pm
Forum: NESdev
Topic: 8bitworkshop - online IDE now supports NES
Replies: 19
Views: 12772

Re: 8bitworkshop - online IDE now supports NES

Uses some slow code examples. Locals. Ints where u char would suffice. Arrays of structs. Bitfields. String.h functions. Are bitfields slow? I'm using them and the generated assembly code is pretty clean: Example: // Actor status union { struct { unsigned int impact_bounce : 2, can_double_jump : 1,...
by wonder
Wed Sep 18, 2019 2:43 pm
Forum: NESdev
Topic: Update to my tutorial in C
Replies: 29
Views: 24200

Re: Update to my tutorial in C

@Dougeff, in neslib.h you have the following declaration: //set sprite in OAM buffer, chrnum is tile, attr is attribute, sprid is offset in OAM in bytes //returns sprid+4, which is offset for a next sprite // Note: sprid removed for speed void __fastcall__ oam_spr(unsigned char x,unsigned char y,uns...