Jump to content



PkK's Photo

PkK

Member Since 15 Sep 2005
OFFLINE Last Active Apr 23 2012 12:04 PM

Posts I've Made

In Topic: Updated versions of ColecoVision programming tools

Sun Jan 1, 2012 4:49 PM

View Postyouki, on Sun Jan 1, 2012 4:18 PM, said:

More information about the strange things that i have.

I have the feeling that there is problem when something is in RAM somewhere between 0x706F and 0x70A1.

My test_map was (before i put it in ROM) allocated between 0x706F and 0x70A1.

Now since i put the test_map in rom , i have another array that is now allocated between 0x7073 and 0x70A5 , and now this array have suddenly problems. (previously , before i move the test_map to rom, it was allocated between 0x70A5 and 0x70D7 , and i had no problem with that one)

You're probably overwriting that memory unintentionally from some other part of your program. Maybe a buffer overflow or writing via an unitialized pointer.

Philipp

In Topic: Updated versions of ColecoVision programming tools

Sun Jan 1, 2012 3:08 PM

View Postyouki, on Sun Jan 1, 2012 12:05 PM, said:

the Size of the _DATA area is 422 bytes.

But why this array goes in RAM ?, i would expect it goes in ROM.

how to make it goes in ROM?
Make it const.

Quote


screen1 , screen2, screen3 etc... are well in ROM.


the array contains only pointers to ROM. And its content is fixed and won't change.
The compiler doesn't know that without const:

const void* test_map[WORLD_SIZE_Y][WORLD_SIZE_X];

Is an array of pointers to const void*. It will be placed in RAM.

void* const test_map[WORLD_SIZE_Y][WORLD_SIZE_X];

Is a const array of pointers to void*. It will be placed in ROM.

const void* const test_map[WORLD_SIZE_Y][WORLD_SIZE_X];

Is a const array of pointers to const void*. It will be placed in ROM. And I believe this is what you want here.

Philipp

In Topic: Updated versions of ColecoVision programming tools

Sun Jan 1, 2012 5:29 AM

View Postyouki, on Sat Dec 31, 2011 2:17 PM, said:

[…]
Very strange, and seems very contextual.
I've tried to reproduce the issue, but couldn't (unsurprisingly, since you said it was context-dependant). My only guess at the moment is that maybe you're running out of RAM. There's only 1K in the ColecoVision, at the array needs 50 bytes. If there's lots of other things in RAM, maybe the stack is overwriting your global variables? What does your .map file state about the size of your _DATA area?

Quote

A side that , Can we found somewhere a version of PNG2CVS already compiled for windows?
Not yet.

Quote

i would need it, but don't want install cygwin and etc.. to compile it.
Thanks.
It shouldn't be hard to compile using a C compiler for Windows, such as MSVC or mingw, the only external dependency is libpng12, which can be found compiled for windows e.g. at http://gnuwin32.sour...ages/libpng.htm

Philipp

In Topic: Cos, Sin and Atan2

Tue Jul 12, 2011 6:13 AM

There's some fixed-point trigonometry functions in my libcvu library at
http://colecovision....ent/libcv.shtml
have a look at the cvu_f header in there.

Philipp

In Topic: SCJ3: Updated Demo

Mon May 30, 2011 5:58 AM

View PostPixelboy, on Sun May 29, 2011 6:27 PM, said:

Made it to the second level, but how come my plane can only go down and not up? Seriously, I can't gain altitude no matter what I do.

Joystick in air levels:

Left: Air brake.
Right: Engine.
Up/down: Elevator.

The fastest way to gain altitude is thus moving the joystick to the upper right.

Philipp