Search found 37 matches

by Hangin10
Mon Jan 28, 2019 1:50 pm
Forum: Homebrew Projects
Topic: Microgame compiler experiment (early WIP)
Replies: 21
Views: 15349

Re: Microgame compiler experiment (early WIP)

If you don't mind reinventing the wheel (writing your own parser) once you have the workings well defined, a VRML-style syntax would avoid quoting everything, comma separation between properties, and the need to put code in strings.
by Hangin10
Wed Nov 21, 2018 8:42 pm
Forum: General Stuff
Topic: Simple way to disable mouse middle click paste in linux?
Replies: 10
Views: 5620

Re: Simple way to disable mouse middle click paste in linux?

I didn't even know this was a thing. I've sometimes missed clicking the bookmarks toolbar in Firefox and ended up middle-click-pasting the same url into the middle of itself in the address bar. Not a clue what was happening (other than maybe Firefox constantly putting the url in the clipboard or som...
by Hangin10
Fri Oct 12, 2018 5:26 pm
Forum: NESdev
Topic: Writing my own assembler
Replies: 76
Views: 24277

Re: Writing my own assembler

yeah, I was confusing his assembler feature with the talk of the global jmp/label ret.
by Hangin10
Fri Oct 12, 2018 4:10 pm
Forum: NESdev
Topic: Writing my own assembler
Replies: 76
Views: 24277

Re: Writing my own assembler

Nevermind me. I get it now and could see it going either way.
by Hangin10
Fri Oct 12, 2018 3:39 pm
Forum: NESdev
Topic: Writing my own assembler
Replies: 76
Views: 24277

Re: Writing my own assembler

1. By far my most common label is a @Return: label in front of a nearby RTS statement. Maybe it's my style of coding, but I find that subroutines always has some branching conditions that exits early. So I realized it would be pretty nifty if I could just write a branch jump like this: LDA MyVar BE...
by Hangin10
Sat Apr 14, 2018 5:35 pm
Forum: General Stuff
Topic: Programming in C - questions
Replies: 17
Views: 5729

Re: Programming in C - questions

Some compilers (GCC in particular) will even optimize some loops into calls to memcpy/move/set functions.
by Hangin10
Mon Dec 18, 2017 6:44 pm
Forum: General Stuff
Topic: Can you write windows app in regular C++?
Replies: 25
Views: 6446

Re: Can you write windows app in regular C++?

Visual C++ for Windows Store/UWP apps is currently stuck using their proprietary C++/CX language that auto generates opaque regular C++ behind the scenes. They do plan to convert over to a new C++/Winrt "projection" that allows for native C++20 (so much co_await!). There's a github page here with pr...
by Hangin10
Sun Nov 05, 2017 11:49 pm
Forum: Newbie Help Center
Topic: How can I use dlls in Linux?
Replies: 5
Views: 2154

Re: How can I use dlls in Linux?

On Linux, dynamic libraries have the '.so' extension (for 'shared object') and are also what you link with. For me on Ubuntu (which I *think* installed with the command tepples gave, it's been awhile), the include is "#include <SDL2/SDL.h>" and then the link command has `pkg-config --cflags --libs s...
by Hangin10
Wed Sep 20, 2017 4:35 pm
Forum: General Stuff
Topic: Is it possible to program Raspberry Pi in assembly?
Replies: 91
Views: 13314

Re: Is it possible to program Raspberry Pi in assembly?

If it's just a gcc cross compiler, binutils (which has an assembler) will likely be in there somewhere as it has the linker.
You could also compile binutils yourself targeting arm.
by Hangin10
Sat Aug 26, 2017 9:22 pm
Forum: NESemdev
Topic: CPU writes to PPU Memory.
Replies: 6
Views: 2832

Re: CPU writes to PPU Memory.

That's one option. It takes being careful about when various things trigger catch up, like sprite-0-hit. In my case, I just chose to write my cpu as NES-specific as it has calls to ppu_cycles(3) throughout instructions after emulating each cycle, although sometimes that's not necessary as not every ...
by Hangin10
Sat Aug 26, 2017 8:30 pm
Forum: NESemdev
Topic: CPU writes to PPU Memory.
Replies: 6
Views: 2832

Re: CPU writes to PPU Memory.

That would not work for some instructions as it doesn't represent the two happening at the same time. For example, read-modify-write instructions (from nesdev.com/6502_cpu.txt): Read-Modify-Write instructions (ASL, LSR, ROL, ROR, INC, DEC, SLO, SRE, RLA, RRA, ISB, DCP) # address R/W description --- ...
by Hangin10
Mon May 15, 2017 9:00 pm
Forum: NESemdev
Topic: Implementing BEQ and other Branch Instructions?
Replies: 11
Views: 4735

Re: Implementing BEQ and other Branch Instructions?

Its tricky as the 5th is actually the 1st of the next opcode. So it depends on how your system is implemented but basically it only takes 4 cycles max, as the fetch opcode is the first cycle of the next opcode. bne takenNextPage - 1 load bne 1 - 2 load offset 2 - 3 add PCL 3 - 4 add PCH 4 takenNext...
by Hangin10
Sat May 13, 2017 10:57 pm
Forum: NESemdev
Topic: Implementing BEQ and other Branch Instructions?
Replies: 11
Views: 4735

Re: Implementing BEQ and other Branch Instructions?

(quietly updates his emulator to not have taken branches to a different page take 5 cycles) :beer:
by Hangin10
Fri Nov 08, 2013 6:04 pm
Forum: General Stuff
Topic: VB.NET Message Loop
Replies: 20
Views: 4320

Re: VB.NET Message Loop

I'm not sure if Form.Show() and Application.DoEvents() will work together (it's been forever since I've used C#), but maybe try: form.Show(); while( form not closed ) { //render Application.DoEvents(); } If it'll work like that you won't really need to override WndProc. Any code that comes after th...
by Hangin10
Fri Nov 08, 2013 4:56 pm
Forum: General Stuff
Topic: VB.NET Message Loop
Replies: 20
Views: 4320

Re: VB.NET Message Loop

I'm not sure if Form.Show() and Application.DoEvents() will work together (it's been forever since I've used C#), but maybe try:

form.Show();

while( form not closed )
{
//render
Application.DoEvents();
}

If it'll work like that you won't really need to override WndProc.