You are not logged in.
Lost Password?

All Posts (jorgeche)




#1
Re: General Bug Thread
Posted on: 9/13 20:36
Nintendoid!
Joined 2006/3/15
Ecuador
234 Posts
PVBCC 3rdCoderLong Time User (13 Years)
Quote:

boye wrote:
Post any VUEngine bugs that you have found here.
Also, hooray for me for making the first thread in this subforum!


What are those "bugs" you are talking about?





Just kidding. ;)

Let's open the floodgates! LOL
Top

Topic | Forum


#2
Re: Random numbers
Posted on: 6/13 3:42
Nintendoid!
Joined 2006/3/15
Ecuador
234 Posts
PVBCC 3rdCoderLong Time User (13 Years)
You use those functions as follows:

int yourRandomNumber = randnum(randseed(), 51) + 1;
// randnum will return a value between 0 and 50 inclusively, ie: 0, 1,... , 50, hence the need to add 1

But I don't like to use them since randseed performs poorly when used inside an intensive loop (with little benefit according to my experience, that is, the number of passes it does doesn't increase that much the "randomness"); and randnum is not safe since it doesn't check if the randnums parameter is non zero and, on top of that, there is no action taken for negative numbers since the result of the modulo operation is implementation-defined for them.

In place of those, you can use these (they are not mine, but Isaku Wada's, 2002):

long randomSeed()
{
static u32 seed = 7; /* Seed value */

if(!seed)
{
seed = 7;
}

seed ^= seed << 13;
seed ^= seed >> 17;
seed ^= seed << 5;
return (seed);
}

int random(long seed, int randnums)
{
return seed & randnums ? (int)(abs(seed) % abs(randnums)) : 0;
}

These will output the same numbers everytime since there is no way to produce real random numbers within this universe that I'm aware of besides, maybe, the rate of atom decaying... Anyway, you can add some randomness to the output by including values that come "from outside the system", like the user input and the elapsed time or the number of clock ticks. For example:

int random(long seed, int randnums)
{
// _accumulatedUserInput is a global variable where you store or accumulate the user input so far
// _ticks is a global variable where you store the amount of clock ticks so far

seed += _accumulatedUserInput + _ticks;
return seed && randnums ? (int)(abs(seed) % abs(randnums)) : 0;
}
Edited by jorgeche on 2019/6/13 3:53
Top

Topic | Forum


#3
Re: A newer GCC compiler.
Posted on: 2018/12/20 14:21
Nintendoid!
Joined 2006/3/15
Ecuador
234 Posts
PVBCC 3rdCoderLong Time User (13 Years)
Quote:

Yep, I had to change/fix a bunch of things to get the Linux compilation working again, and those should probably help the compilation on OSX.

I've found a site talking about how to compile GCC on OSX, and I may take a look at it myself if somebody doesn't beat me to it!


Hey Elmer!

I already compiled it on macOS Mojave, but I didn't really documented the process and it was kind of messy and hackish since I had to even modify one of the config.guess files, among other things. Anyway, I'm still porting our preprocessor before being able to successfully build any of our demos, so, I'm not 100% sure that the compiler is working fine.

Quote:

I really hope that you guys take a look at using the C++ support in VUEngine since you're already using an object-oriented design.

Using basic Embedded C++ language features should allow you to make your code a lot more readable/debuggable than using all of those cunning-but-fragile macros.


The plan is to evaluate, in the middle term, if it is feasible given the complexity and memory requirements of the engine. But right now we want to concentrate in implementing a complete game instead of keep pushing developer features. Anyway, thanks to the preprocessor, the code is around 85% based on C++'s syntax (the only missing syntax feature is proper method calling), so, that part of the port should be really easy. The hard part will be, first, to customize the memory handling since I don't have enough experience on the inners of C++'s compiler and linker so I don't know if it is possible to instruct it to allocate the virtual tables in specific memory regions or even if they can just be computed at compile time and placed in the ROM area (we load them in DRAM instead of WRAM because they amount to more than 10 KB and they are populated at runtime); and second, to handle the allocation of dynamic objects, although I guess we just have to override the new operator and just use our own MemoryPool to avoid the usage of the heap.

jorgeche
Edited by jorgeche on 2018/12/20 14:43
Top

Topic | Forum


#4
Re: Mellot Programmer
Posted on: 2018/12/12 23:44
Nintendoid!
Joined 2006/3/15
Ecuador
234 Posts
PVBCC 3rdCoderLong Time User (13 Years)
Quote:

speedyink wrote:
So I've been enjoying mine for a couple hours now, I've successfully "duplicated" one of my cartridges, which is pretty damn cool.

Only thing is I can't seem to get the 128mbit Mario video demo from the patreon to flash. When I choose the file from the SD card I get a 'SD Card ERROR!' message. It's weird because it worked totally fine for the 32mbit rom I dumped and then flashed to the same 128mbit cart.

The SD card is a 4gb sandisk card formatted to FAT32.

Any ideas?


Rename the file in the SD card to something shorter. I got an error when using the default name of the ROM from the Patreon page. Use something short and without dashes, like vplayer.vb, and give it another try.
Top

Topic | Forum


#5
Re: Installer Version of VBDE?
Posted on: 2018/12/9 17:32
Nintendoid!
Joined 2006/3/15
Ecuador
234 Posts
PVBCC 3rdCoderLong Time User (13 Years)
Hi RetroDan,

We will have to wait for KR1553 for a response on the possibility of an installer, since he handles that part of VBDE. But in the meantime, maybe I can help you solve the issue starting IDEA.

First things first, I'm not sure which program KR1553 recommends to unzip the file, but I usually use 7zip. It seems to being able to handle anything.

Second, which version of Windows are you using? (please include the number of bits and the edition [home, pro, etc.]) I usually don't have to install .NET in anything that isn't Windows XP (yup, I still use it, LOL). Windows 7 and above don't complaint at all and work out of the box, although I never use the home editions, so that may be the problem.

From the error, it seems to be related to a faulty dll in your system. Did you try this:

https://answers.microsoft.com/en-us/wi ... a1-4f3c-b2f0-7eb72df05b2a

jorgeche
Top

Topic | Forum


#6
Re: System Register 31 and its Hidden Secrets
Posted on: 2018/4/19 17:24
Nintendoid!
Joined 2006/3/15
Ecuador
234 Posts
PVBCC 3rdCoderLong Time User (13 Years)
Hi Guy:

I tried to implement a custom abs function based on your findings, but I guess the compiler that I'm using doesn't have support for the system registers 26-31.

Given that I don't want to bother ElmerPCFX and I don't want to go through the whole process of trying to compile the compiler again, I would like to know if there is any way to write the hex op code for the stsr and ldsr instructions in my C code without having to hack the ROM directly.

jorgeche

Attach file:



png  error.png (113.51 KB)
230_5ad8b4ae335d3.png 1284X684 px
Top

Topic | Forum


#7
Re: For my next project...
Posted on: 2017/4/15 2:32
Nintendoid!
Joined 2006/3/15
Ecuador
234 Posts
PVBCC 3rdCoderLong Time User (13 Years)
Quote:

VirtualChris schrieb:
I deleted it using Robocopy. But what's weird is that VDBE worked for a while and then stopped because the name got too long. How did it get too long?


I'm not sure about how VBDE's makefile handles the building of its sample projects, since I only work with the VUEngine, but that makefile is a port of the VUEngine's so the problem may be related to what I previously pointed. For the moment, just delete the release folder each time you compile until KR1553 can chime in.
Edited by jorgeche on 2017/4/15 2:46
Top

Topic | Forum


#8
Re: For my next project...
Posted on: 2017/4/15 1:30
Nintendoid!
Joined 2006/3/15
Ecuador
234 Posts
PVBCC 3rdCoderLong Time User (13 Years)
Quote:

VirtualChris wrote:
I can't delete the release folder. It says it's too long.


https://superuser.com/questions/78434/ ... oo-long-for-normal-delete
Top

Topic | Forum


#9
Re: For my next project...
Posted on: 2017/4/15 1:12
Nintendoid!
Joined 2006/3/15
Ecuador
234 Posts
PVBCC 3rdCoderLong Time User (13 Years)
Quote:

VirtualChris wrote:
I opened the file "release" and it had a file folder called "release" and I opened it and it had a file folder called "release." It goes to infinity apparently. It's a wonder I still have room on my hard drive.


This generally happens when the incorrect bulding type is passed to the makefile. Make sure that you replicated exaclty the folder structure of the VBDE sample projects, delete the release folder, and try to compile from VBDE's Notepad++ again (I guess you're using that).
Top

Topic | Forum


#10
Re: Wario Ware: Virtual Boy
Posted on: 2017/3/31 0:37
Nintendoid!
Joined 2006/3/15
Ecuador
234 Posts
PVBCC 3rdCoderLong Time User (13 Years)
Quote:

Inheritance doesn't automatically make scaleable software, abstraction does. But abstraction is not exclusive to OOP or inheritance. A function is a form of abstraction.


And inheritance is a form of abstraction too. But since abstraction makes scalable software, according to you, then inheritance makes scalable software.

I didn't say that there were no other means of making scalable software, nor did I say that abstraction is exclusive to OOP, don't put words in my mouth.

Quote:

Maybe we just pass it to a function then as a const parameter?

void step( const unsigned time );


I don't see what would be the purpose of adding "const", besides self documentation, to a functions' argument that is not a pointer, since you can copy the variable's value into a non constant variable and modify it. But the point wasn't self documentation.

Quote:

Global state can be a problem, but at the same time, all games need it. It's crazy to work in languages that forbid global state...

If we are trying to reuse memory space for game structs, why not use a union? It's a language feature instead of a macro.


You're using a straw man argument and moving the goalposts. I didn't say that globals are to be forbidden, I just implied that they preferably are to be avoided if possible. And I was only responding to your concern about how classes attributes "indicates multiple time variables", which is false, since it is not necessarily the case.

Quote:

The purpose of inheritance is to reuse DATA...


I don't want to derail the thread, whose initial idea is very good, into a discussion about programming paradigms and concepts. If you think that there is no real advantage in the usage of OOP features or libraries that abstracts part of the problem of providing a single interface to work with multiple game mechanics, you're more than welcome to pursue your project as you see fit.

I'm out.
Top

Topic | Forum