Search found 147 matches

by ThePerfectK
Mon May 08, 2023 6:13 pm
Forum: Programming Discussion
Topic: Beginner question about DreamSDK R2
Replies: 3
Views: 246

Re: Beginner question about DreamSDK R2

To force C++11 you need to pass your compiler the -std=c++11 or -std=gnu++11 flag in your makefile rules. I don't use DreamSDK but I would imagine there is a makefile definition somewhere like CXXFLAGS += "blah" where you can add -std=c++11 or -std=gnu++11.
by ThePerfectK
Sat Apr 01, 2023 3:00 pm
Forum: Programming Discussion
Topic: How to define a variable at a specific memory location, and whether it's cached or not
Replies: 9
Views: 919

Re: How to define a variable at a specific memory location, and whether it's cached or not

Not at the moment, but maybe in the future. I think it's better to keep stuff like that someplace like here, since the Internet Archive can find it and it's less likely to get lost than a proprietary, closed site. I get that too, a vast majority of help I've gotten from DCemulation has been relativ...
by ThePerfectK
Mon Mar 13, 2023 6:49 pm
Forum: Programming Discussion
Topic: How to define a variable at a specific memory location, and whether it's cached or not
Replies: 9
Views: 919

Re: How to define a variable at a specific memory location, and whether it's cached or not

With careful management, you could theoretically access 4 banks of memory simultaneously with minimal performance penalty as each independent ram chip has a single sense amplifier that covers two 2048kb banks each. Would you mind clarifying this? I thought that regardless of the physical ram arrang...
by ThePerfectK
Mon Mar 06, 2023 2:21 am
Forum: Programming Discussion
Topic: How to define a variable at a specific memory location, and whether it's cached or not
Replies: 9
Views: 919

Re: How to define a variable at a specific memory location, and whether it's cached or not

I'm not sure that method is a good way to do it. Manually setting addresses of variables in the linker script seems error prone, and I'm worried that GCC will overlap variables in RAM this way. For example, if a large normal, cached buffer is declared, and gets placed to it ranges from 0x8c100000 t...
by ThePerfectK
Mon Feb 13, 2023 1:37 pm
Forum: Programming Discussion
Topic: How to define a variable at a specific memory location, and whether it's cached or not
Replies: 9
Views: 919

How to define a variable at a specific memory location, and whether it's cached or not

I wanted to take a quick second to, in an abridged manner, show how you can make sure a variable is defined where you want it to be at an absolute memory address. The advantage of being able to do this is that you can define multiple memory blocks at specific locations to prevent them from destroyin...
by ThePerfectK
Thu Jan 05, 2023 3:27 pm
Forum: Programming Discussion
Topic: Reading serial port peripherals [SOLVED]
Replies: 4
Views: 581

Re: Reading serial port peripherals [SOLVED]

Thank you so much for not only diving into this topic, but keeping the thread updated with not just your successes, but also your failures. That stuff helps so much, there have been so many topics that I've been able to work out only because decades ago some people took the time to document their ef...
by ThePerfectK
Wed Nov 30, 2022 3:24 am
Forum: Programming Discussion
Topic: Reading serial port peripherals [SOLVED]
Replies: 4
Views: 581

Re: Reading serial port peripherals

there is a libary in kernel/arch/dreamcast/include/dc that is intended for scif (serial communication inferface with FIFO). Here is the header: http://gamedev.allusion.net/docs/kos-current/scif_8h.html And more appropriately, here's the source, as used by dcload: https://github.com/Kochise/dreamcast...
by ThePerfectK
Fri Jul 15, 2022 7:08 am
Forum: Programming Discussion
Topic: Bump Mapping sample
Replies: 13
Views: 2804

Re: Bump Mapping sample

Holy crap that is kind of awesome. I wonder why no games used it. A few games do in fact use it. The best known example is this coin in Shenmue 2: https://i1056.photobucket.com/albums/t366/Esppiral/REVERSO_zps59210cb9.gif The technique is also outlined in the official Dreamcast development manuals:...
by ThePerfectK
Wed May 11, 2022 5:31 pm
Forum: Programming Discussion
Topic: PVR Spritesheets Turorial
Replies: 6
Views: 800

Re: PVR Spritesheets Turorial

You can render to a framebuffer texture, then rotate the texture, which would rotate the entire screen, but be aware that rendering to a framebuffer on the dreamcast consumes an entire vsync cycle. This is because you command the PVR to draw to the texture, and the PVR draws at vsync completion, so ...
by ThePerfectK
Fri May 06, 2022 12:28 am
Forum: Programming Discussion
Topic: PVR Spritesheets Turorial
Replies: 6
Views: 800

Re: PVR Spritesheets Turorial

What do you mean by "rotate objects"? Do you mean, rotate the texture on the polygon you are drawing, or do you mean rotate the entire polygon? Both are done in the draw_sprite() function according to the tutorial. A polygon is defined as two vertices in the example: float x0, float y0, fl...
by ThePerfectK
Fri May 06, 2022 12:02 am
Forum: Programming Discussion
Topic: Newbie need help
Replies: 1
Views: 534

Re: Newbie need help

There are multiple ways to accomplish what you are describing, and how you accomplish them will radically change the behavior and what is being demonstrated. If all you want is some text on your screen, the easiest way to do this is to use the bios font. The example for this is is under kos/examples...
by ThePerfectK
Thu Apr 07, 2022 3:33 pm
Forum: Programming Discussion
Topic: How Do I Create Vmu Animations?
Replies: 6
Views: 759

Re: How Do I Create Vmu Animations?

Making stand alone VMU applications is exponentially harder than even writing a dreamcast application to control the VMU in-controller. You'll either be writing it in LC86000 Microprocessor assembly, or you're going to write it for an embedded ARM Cortex M32 emulator (https://dmitry.gr/?r=05.Project...
by ThePerfectK
Tue Mar 29, 2022 8:38 pm
Forum: Programming Discussion
Topic: How Do I Create Vmu Animations?
Replies: 6
Views: 759

Re: How Do I Create Vmu Animations?

This question can be parsed in a number of ways. Do you mean how to animate the screen of a VMU that is currently attached to a Dreamcast controller, through a homebrew dreamcast title? Do you mean how to create a stand alone VMU application, and manipulate the VMU screen to produce an animation? Or...
by ThePerfectK
Tue Mar 29, 2022 8:33 pm
Forum: Programming Discussion
Topic: How to convert elf to bin?
Replies: 3
Views: 991

Re: How to convert elf to bin?

I see you are having problems in this and the other topic you made, and both stem from the same misunderstanding. Let me give you a quick primer on folders and command line interfaces in both windows and linux. When you issue a command from the terminal, what you are doing is calling out to a specif...
by ThePerfectK
Wed Feb 09, 2022 4:18 pm
Forum: Programming Discussion
Topic: How to convert elf to bin?
Replies: 3
Views: 991

Re: How to convert elf to bin?

the KOS toolchain should have built sh-elf-objcopy. Use the following command to convert the elf to an unscrambled binary: sh-elf-objcopy -R .stack -O binary file.elf file.bin If you wish to run the binary from an actual CD, you'll need to scramble the bin first using scramble from the KOS utils fol...
by ThePerfectK
Wed Feb 09, 2022 12:27 am
Forum: Programming Discussion
Topic: Detecting cache misses?
Replies: 2
Views: 540

Re: Detecting cache misses?

so just a heads up, following up on this, using sh-elf-objdump and looking at the disassembled code that gcc spits out after compilation, it seems the counter is indeed behaving correctly. O3 optimization makes judging the order and count of cache misses (and other countable occurances from the perf...
by ThePerfectK
Sat Feb 05, 2022 12:22 am
Forum: Programming Discussion
Topic: Detecting cache misses?
Replies: 2
Views: 540

Detecting cache misses?

I want to be able to detect cache misses so I can better profile some code. I see DreamHAL has a perfctr module that looks like it can count cache misses but I'm not sure how to read the results correctly. It appears that you can dedicate one of the two perf counters inside the SH4 to various tasks ...
by ThePerfectK
Tue Mar 09, 2021 6:13 pm
Forum: Programming Discussion
Topic: KOS, Visual Studio Code & gdb
Replies: 20
Views: 7325

Re: KOS, Visual Studio Code & gdb

So I sat down and decided to try and adapt this to work with windows vscode while writing a tutorial to get it all set up. Thus far everything is straight forward, except I'm having an enormous amount of trouble actually generating sh-elf-gdb.exe in windows with python support. MingGW includes gdb.e...
by ThePerfectK
Thu Feb 11, 2021 5:56 pm
Forum: Programming Discussion
Topic: KOS, Visual Studio Code & gdb
Replies: 20
Views: 7325

Re: KOS, Visual Studio Code & gdb

This is terrific! I've gotten all this stuff going with QTCreator before, but I know way more people use VS Code. Thanks so much for this tutorial!!
by ThePerfectK
Fri Jul 03, 2020 2:37 am
Forum: Programming Discussion
Topic: Issue with enviroment creation script for KallistiOS
Replies: 4
Views: 1441

Re: Issue with enviroment creation script for KallistiOS

that guide is super super out of date. I've actually rewritten the setup portion many times since then, those instructions outright don't work anymore. One day I'll post the updated version once it's finished.