2,049

(18 replies, posted in Nintendo Handhelds)

Tip: Samples sound much better on DMG than on GBC or GBA.

belial wrote:
nitro2k01 wrote:

An integer table, even 16-bit integer, is better than that float table

I bet i misunderstand you and maybe this should be discussed somewhere else, but why using an integer table? An integer table of sine values would contain exactly 3 entries {-1, 0 1}.

Oh, you need to scale it, of course. If you want an object to swing 40 pixels from side to side in a sinusoidal curve, you could pre-calculate y=int(20*sin(x)). Actually you could probably get away with calculating 10*sin(x) and multiplying the table values by 2.

Which brings me to another point... Integer multiplication and even division by 2 and multiples of 2 is cheap. It can be easily written as a shift operation. y=4*x is equivalent to y=x<<2 for example.

Another trick, which I don't think the C compiler has support for, is fixed-point arithmetic. You could for example define that in an 8-bit number, the lower two bits are the decimal part and the upper six bits are the integer part. So, for example, you could represent a number like 5.75 without rounding:

Bin: 0001 01.11

This would of course be stored in an 8-bit register as hex: $17 (Bin: 00010111)
The logic is that bits below decimal point get the values 1/2, 1/4, 1/8 etc.

Adding two of these numbers works all the same like any other number of that bit size. If you multiply two numbers fixed-point numbers however, you must realign the number. Consider that you multiply 2*3 in the notation above:

"2.00" = Bin: 0000 10.00 = Hex: $08
"3.00" = Bin: 0000 11.00 = Hex: $0C

$08 * $0C = $60
Bin: 0110 0000 = Hex: $60

Here you need to divide by 4, or as it can also be done, shift right twice, to get the correct answer:

Bin: 0001 10.00 = "6.00"

However, when you multiply fixed-point * actual integer, you don't need the realignment step.

I think any tutorial to programming an 8-bit CPU should talk about binary numbers and 8-bit math tricks. Not as a thing that you need to go through by necessity, but as something that is actually useful. But maybe that scares people off?

Oh, and you're right that there's seems to be a lack of GB tutorial. There's one though...
http://gameboy.mongenel.com/ <- and click GBC ASMSchool
It's geared towards ASM however. Which I personally think is the way to go in the long run.

Maybe I should get my ass off the couch and actually write a tutorial myself. I've been wanting to do this for a while, but lazy and stupid in the same as being an elitist dickhead is almost a guarantee that you'll never manage to write something you're satisfied with.

Now I'm going to sound like a massive dick, but I don't like this paper at all.

It's actually mostly factually correct as far as I could tell when skimming it through, but it feels very rushed. There are a few couple of small things that are wrong, like calling the MBC BSC, but that less important. But what I'm more worried about is that I'm wondering if the complete noob is actually going to learn anything substantial from the paper. It's written in such a way that I'm getting the feeling it was made to meet a school deadline, not out of a genuine will to teach. A lot of things could be probably be described in more understandable ways.

I'm bothered by the theory sections about transistor/logic and NTSC. They don't really fit in. The transistor/logic section could probably be scrapped. If you know about these things, you do. If you don't, that short text isn't going to make much of a difference for you. The NTSC section could probably be replaced with an actual diagram of how the screen is drawn, and when you can and can't write to it.

Then there's the coding guidelines. The first 3 points are sound advice, but last one isn't really. The <=, < etc operators typically have no or a very small overhead compared to == and !=. we only have a limited time window to perform our calculations (vertical synchronisation phase) <- That's not really correct. Just because you can't write freely to the display during most of the time doesn't mean you can't do math. And why make a float table of sine values? An integer table, even 16-bit integer, is better than that float table. And even so, theres no explanation on how you're actually supposed to use the lookup table.

The whole idea that the Gameboy is well documented but it is difficult to collect all the distributed informations on the internet. is largely untrue. There are a couple of good collected sources. Most importantly PANDocs which is a collection of a lot of small documents (some of them quoted in the paper) that was assembled about 10 years ago. It's both more informative and accurate than the quoted sources. (No undocumented GB cart pins etc...) Then there's devrs.com/gb which has many dead links nowadays but is still a good starting place. A little more research would've revealed those.

The paper doesn't at all mention that there are in fact commercial flashcarts for sale to this date. See here for example.

So uhm yeah... I'm sorry for the complete smackdown, but I honestly think a lot of things in the paper could have been better. Forward this post to Belial (or maybe not.)

2,052

(7 replies, posted in Nintendo Handhelds)

BTW, I'm moving this thread to the Handhelds forum. (Also, welcome to CM.org!)

2,053

(7 replies, posted in Nintendo Handhelds)

All of the old LPT port Gameboy cartridge devices require direct access to the LPT which USB-LPT adapters typically can't provide. I don't think I recall I've heard a USB-LPT adapter success story, ever.

2,054

(17 replies, posted in General Discussion)

goto80 wrote:

not to brag, but my myspace is completely massive. someone put an autoplay of Darude or something in the comments.

I also listened to the song you uploaded... Whoa! GOTO80 burping into the SID's filter...

jikoo wrote:

Me, I have no problem on my myspace profile. I use Adblock Plus (add-on for Firefox) = no advertise.

goto80 wrote:

...someone put an autoplay of Darude or something in the comments.

You can desactive HTML in comments. I hate autoplay too ! So now, all is ok ! No advertise and no autoplay player.

DUUUUDE!! You're missing the point of the joke. (The joke xeing Myspace.)

NO CARRIER: Hmm, so there are NES mappers like that... I guess I should rephrase my question: 999-IN-1 apparently doesn't support just any mapper, right? (Unless the NSF format is constructed to normally reside in a non-fixed bank on mappers that have fixed banks?) How difficult is it to find a suitable donor cart that is theoretically compatible? (Because that's how you do it right? Donor cart+EEPROM socket...)

And yes, I understand the concept of copying code to RAM. I've made a whole little "framework", if you could call it that, for Gameboy to allow code execution in RAM. (Framework=Useful routines and macros to realign jumps and loads, and a simple specification for a general purpose loader.) This is useful for two things: 1) Code that modifies flash memory on supported cartridges. (Such as my LittleFM.) 2) Allows code to be loaded into RAM, after which you can remove the cartridge and have the program keep running. The latter is only really stable on GBC.

On Gameboy, (which doesn't suffer from a mapper hell wink ) I'm used to having a 16 kB "Bank 0" which cannot be swapped out, and a selectable 16 kB bank. Bank 0 is where the int vectors are at and it's generally expected to be available. Thus, you can't do multi-ROMs without special mapper support. (Only available in flashcart MBC's)

How do NES mappers work in this respect?

2,057

(14 replies, posted in Nintendo Handhelds)

Smartboy is a decent product, but they've been known to have some delivery problems in the past because their goods got caught in customs. I think you should ask Kitsch if he's aplnning to restock on smartboys before trying to buy directly from SB.

My original intention was to make a function that logs all edits, so staff can review them afterwards. But like so many other things, I never got to it.

Akira: What's wrong with keeping old trade threads? And why is it more important to purge sales threads than any other threads? It's not like they're in the way of anything. On the contrary, keeping old sales threads saves the track record of each buyer and seller which might be interesting for future buyers/sellers.

Sorry, I closed the wrong topic... Reopened.

2,060

(14 replies, posted in Nintendo Handhelds)

Are you sure it's using a serial cable and not a parallel cable? If it connects to the 25-pin port on the computer, then it's using the parallel port. In that case, you're pretty much out of luck. If it's actually using the serial (9-pin) port then it might actually work. There were 25-pin serial ports, but don't be fooled... If your thing connected to a 25-pin port on the computer, it was probably a parallel port device.

That said, the only thing you need their linker device for is to update he flash memory. Backing up the SRAM should be possible from any Gameboy linker device, such as Smartboy or Bleepbloop's first generation linker. The problem is getting ahold of one of those these days.

2,061

(14 replies, posted in Commodore Computers)

goto80 wrote:

if it's piezoelectric i suppose it's analogue...?

Au contraire, mon ami! Most probably you only have access to a register to set the voltage to the piezo to high or low.

This kind of stuff reminds of Mr Beep's ZX Spectrum stuff.

2,062

(19 replies, posted in General Discussion)

The break is over, kids! Get back to the classroom!

mGB is probably the best option for that. LSDj can only be MIDI-controlled through the keyboard mode, which sucks ass.
I'd personally opt for syncing LSDj with a computer master and compose side by side, however. A little more work, but LSDj gives you a good amount of control, that a PC-side sequencer won't be able to give you.

2,064

(22 replies, posted in General Discussion)

In the end, are you aiming to release this as modern game (Game Maker, Flash) or, eg as a NES ROM?