Search found 160 matches

by aa-dav
Fri May 08, 2020 8:03 pm
Forum: NESdev
Topic: Aren't you afraid that NES Maker would just bring lazy noobs
Replies: 138
Views: 76872

Re: Aren't you afraid that NES Maker would just bring lazy noobs

I would add in support of assembler another thing. IMHO, one of the main reasons it's hard to program in assembler is hardness of revisiting old code. While you work on the current task it looks easy because you keep in mind that every instruction in series is supposed to do. But after a while it's ...
by aa-dav
Thu May 07, 2020 8:01 pm
Forum: NESdev
Topic: Why does this basic program crash FCEUX?
Replies: 44
Views: 13359

Re: Why does this basic program crash FCEUX?

rox_midge wrote: Thu May 07, 2020 7:45 pm Does mapper 4 not support simultaneous PRG-RAM and CHR-RAM?
Yes. Show your header description again, we will check it.
by aa-dav
Thu May 07, 2020 6:21 pm
Forum: NESdev
Topic: Optimizing scroll changes after MMC3 IRQs
Replies: 34
Views: 10448

Re: Optimizing scroll changes after MMC3 IRQs

How about heavy metal magic - relaying on hdraw-ignited IRQ, but not waste scanline time, but fill it with useful calculations with fixed clock times (do not cross page boundaries, tune up branches and so on)? So, time will not be wasted and time limit will be reached. ZX Spectrum has modern games w...
by aa-dav
Wed May 06, 2020 9:35 am
Forum: NESdev
Topic: Optimizing scroll changes after MMC3 IRQs
Replies: 34
Views: 10448

Re: Optimizing scroll changes after MMC3 IRQs

What if IRQ handler will be placed in RAM and lda variable will be converted to lda # value which will be updated inplace? Also, extreme variant: do not use Y (or X) register outside IRQ while IRQ can be triggered. So, first instruction of IRQ is stx $2006 and after that X can be used but in the end...
by aa-dav
Mon May 04, 2020 9:27 pm
Forum: NESdev
Topic: ASM6F - Confused how to load a 16-bit pointer into RAM
Replies: 8
Views: 3421

Re: ASM6F - Confused how to load a 16-bit pointer into RAM

I use this in CA65: ; store_addr dest, addr - save address into word in memory ; To avoid lengthy fragments of the same code: ; lda # < addr ; load LSB of addr ; sta dest ; save to first byte of dest ; lda # > addr ; load MSB of addr ; sta dest + 1 ; save to second byte of dest ; let's define macro ...
by aa-dav
Mon May 04, 2020 3:19 am
Forum: NESdev
Topic: Aren't you afraid that NES Maker would just bring lazy noobs
Replies: 138
Views: 76872

Re: Aren't you afraid that NES Maker would just bring lazy noobs

... Never use variable++, only ++variable. ... Oh, thanks for hints, especially for this one. I forgot about post-increment complexity completely. This really helps compiler to do inplace pointer increments. I could not understand why so simple thing isn't implemented yet. However, yes, pointer act...
by aa-dav
Sun May 03, 2020 10:41 pm
Forum: NESdev
Topic: Aren't you afraid that NES Maker would just bring lazy noobs
Replies: 138
Views: 76872

Re: Aren't you afraid that NES Maker would just bring lazy noobs

It's interesting for me to compare optimized C code. Let's rewrite it as mentioned above: pass parameters as pointers in zero-page: extern char *src, *dst; #pragma zpsym( "src" ) #pragma zpsym( "dst" ) void str_cpy() { while ( *dst++ = *src++ ); } cc65 -Oirs produces next asm: .i...
by aa-dav
Sun May 03, 2020 9:16 pm
Forum: NESdev
Topic: Aren't you afraid that NES Maker would just bring lazy noobs
Replies: 138
Views: 76872

Re: Aren't you afraid that NES Maker would just bring lazy noobs

although yours have to write pretty bad C for it to be 10 times slower I would say opposite: you have to write pretty bad C code to speed up things. Let's get this typical C code (which is really spirit of C language): void str_cpy( char *dst, char *src ) { while ( *dst++ = *src++ ); } And compile ...
by aa-dav
Sun May 03, 2020 7:57 am
Forum: NESdev
Topic: Aren't you afraid that NES Maker would just bring lazy noobs
Replies: 138
Views: 76872

Re: Aren't you afraid that NES Maker would just bring lazy noobs

In my opinion/experience 8-bit systems of NES era comply with rule: assemblers produce code with max speed, compilers (like C) are slower by ten times and interpreters (like Basic) are slower than compilers by ten times again. For NES where we have to fit in vdraw/vblank narrow limits it can be seri...
by aa-dav
Sun May 03, 2020 4:28 am
Forum: NESdev
Topic: Where to enable/disable IRQ in MMC3?
Replies: 7
Views: 3384

Re: Where to enable/disable IRQ in MMC3?

I think

Code: Select all

sei ; Disable IRQ
sta MMC3_IRQ_OFF	; Disable mapper interrupts
in the beginning of Reset Is too short to worry about pending interrupts or whatsoever.
I suppose that any of these two instructions is enough, but both of them eliminates any questions. So why bother?
by aa-dav
Sat May 02, 2020 6:24 am
Forum: NESdev
Topic: Altering the hscroll in MMC3 IRQ results in one row of pixels lagging behind
Replies: 5
Views: 2857

Re: Altering the hscroll in MMC3 IRQ results in one row of pixels lagging behind

You should read https://wiki.nesdev.com/w/index.php/PPU_scrolling (if not already). Especially this part: ... Because about 4 pixels of timing jitter are normally unavoidable, $2005 should be written a little bit early (once hblank begins, it is too late). The resulting glitch at the end of the line...
by aa-dav
Fri May 01, 2020 6:50 am
Forum: NESdev
Topic: Why does this basic program crash FCEUX?
Replies: 44
Views: 13359

Re: Why does this basic program crash FCEUX?

...8K on the parallax tile set... What do you mean by 'parallax tiles'? Parallax as I know usually is per-scanline technique. Do you mean second-background imitation like in Sword Master https://youtu.be/_GSfLqJUcOM?t=64 ? It's done by switching 1k bank of CHR-ROM: http://i93.fastpic.ru/big/2017/09...
by aa-dav
Thu Apr 30, 2020 6:55 am
Forum: NESdev
Topic: Background is still grey with intensify blues
Replies: 4
Views: 2557

Re: Background is still grey with intensify blues

Original tutorial contains this bug (at the end of the page): https://taywee.github.io/NerdyNights/ne ... stapp.html
However source code in supplied archive master.zip is correct.
(in light of neighbor topic: another step on the same rake)
by aa-dav
Wed Apr 29, 2020 9:22 pm
Forum: NESdev
Topic: Why does this basic program crash FCEUX?
Replies: 44
Views: 13359

Re: Why does this basic program crash FCEUX?

I swear to god, despite all evidence to the contrary, that I'm not an idiot. Quote from wiki: If a rake lies in the ground with the teeth facing upwards, as shown on the top picture, and someone accidentally steps on the teeth, the rake's handle can swing rapidly upwards, colliding with the victim'...
by aa-dav
Tue Apr 28, 2020 8:03 am
Forum: NESdev
Topic: NES Rotozoom
Replies: 20
Views: 8209

Re: NES Rotozoom

Just for your information: loops and increments are cool, simple and fast. But also we need to precalculate these increments and other params to do what we need. And at this point matrix calculus is very useful. This code is example in delphi/free pascal how to render rotozoomed sprites in software:...