Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - z80man

Pages: 1 ... 29 30 [31] 32 33 ... 62
451
TI Z80 / Re: BimBall -- AKA super wallball
« on: March 21, 2011, 02:15:30 am »
Hockey could look pretty cool, but I'm not so sure if the calc could handle all the ai. Maybe a version with less players such as 3 per side instead of 6. I also thought baseball could be possible too. for basetball, not the actual game, but maybe something more like a free throwing game you sometimes see at arcades where the basket moves around.

and Ashbad, that looks great. I just need to go find my usb cable now.  :thumbsup:

452
Casio Calculators / Re: Casio Prizm documentation
« on: March 19, 2011, 04:42:44 am »
I'll need to start dissecting those eActivities. Need to go find some because I deleted all of them from my calc. Links to apps would be pretty cool. Maybe they even provide args to the apps to open them in a certain way.

453
Computer Programming / Re: Arrays
« on: March 19, 2011, 03:34:31 am »
Thanks Goplat. Almost everything is working now. With a few more edits, optimizations, removal of debugs, documentation, and a better sample program, Spectrum should be ready for release tomorrow.

Side Note:
My eyes lit up with happiness when I saw R0 increment on the register screen. :angel:  I became crestfallen when my branching statement epically failed.  :P

454
TI Z80 / Re: The Mighty Jill Off
« on: March 19, 2011, 03:28:21 am »
The shadows do look nice, but maybe if you cut those then you could do half byte tiles.(unless you are already doing that)  Then if the map is 1000 tiles tall the map data would be a much more reasonable 8000 bytes. Plus I thought Axe can only compile one page apps so 16000 bytes of data would leave no room for code.

455
TI Z80 / Re: The Mighty Jill Off
« on: March 19, 2011, 02:29:37 am »
That really depends on the size of the entire map. If you can fit it into ram then by all means make it just one continuous room. Or if you are compiling to an app, I assume that the map data is static so you wouldn't need to overwrite it and you wouldn't have to do rooms. 

456
Computer Programming / Re: Arrays
« on: March 19, 2011, 02:12:04 am »
Well another error, but I bet it is the last difficult to fix one because everything else is easy to trace or has already been solved. I have one function in my program that takes the current instruction (type short) then runs through an else if block to find the corresponding instruction type. Because each instruction has several variations of its own type I preform an & to remove the dynamic bits of that instruction to leave only the static ones.
Code: [Select]
if (ADD_v == instruction & ADD_v) 
ADD();

else if (MOVi_v == instruction & MOVi_v)
MOVi();

else if (ADDi_v == instruction & ADDi_v)
ADDi();

else if (MOVLi_v == instruction & MOVLi_v) 
MOVLi();
You might recognize these as SH3 opcodes.(don't worry there are many more in my code) The first instruction in memory is $7001 aka ADD $01,R0. Now I have a debug statement right after data is loaded into instruction and that reads $7001 as expected. Now this instruction is represented by ADDi_v which is defined earlier as $7000. So if I do $7001 & $7000, I should get $7000 which would equal ADDi_v. But my program doesn't seem to respond to this for some reason.

Edit: changed MOVi_v to ADDi_v. Just a typo

457
Computer Programming / Re: Arrays
« on: March 19, 2011, 01:53:32 am »
The hex I put in my previous post was just the output from a hex editor. Otherwise the data was already in a compiled format. I did debug my file input routine and that worked too. It just took a few edits to the memory routine to get it working. And the data was stored in memory in big endian format. When it was read from memory, it was then it was converted to little endian to be operated upon. Now it looks like just a few more things to debug, then the prog will be ready for its first official release.

458
ASM / Re: Really Long Source Code
« on: March 19, 2011, 12:57:44 am »
@FloppusMaximus, by any chance did you ever try assembling Mimas with Mimas. I don't know if it's possible or not with all those macros and stuff, but it would be pretty cool.

459
Computer Programming / Re: Arrays
« on: March 18, 2011, 10:51:26 pm »
bump

Well I tried this new code here which yields some results, but isn't perfect. The issue is that when I read the first index from the array, type short, I get a result of $3d44 which isn't contained anywhere in the file I used for the input.
Code: [Select]
char * memory = new char[0xFFFF];


int readmemory_long(int pointer)
{
unsigned int r_pointer = pointer - 0xA4000000;
if (r_pointer > 0x1FFFFF) return 0;
int temp = int(memory[r_pointer]) * 0x1000000;
temp |= int(memory[r_pointer + 1]) * 0x10000;
temp |= int(memory[r_pointer + 2]) * 0x100;
temp |= int(memory[r_pointer + 3]);
return ntohl(temp);
}

short readmemory_word(int pointer)
{
unsigned int r_pointer = pointer - 0xA4000000;
if (r_pointer > 0x1FFFFF) return 0;
short temp = short(memory[r_pointer]) * 0x100;
temp |= short(memory[r_pointer + 1]);
return ntohs(temp);
}
Code: (input file) [Select]
70 01 71 01 8B FD FF FE
Code: (input code) [Select]
PC = 0xA4000000;
ifstream program("spectrum.data", ios::in|ios::binary);
if(!program.is_open())
{
cout << "Error opening spectrum.data";
cin.get();
return -1;
}
program.seekg(0, ios::beg);
int program_counter;
char buffer;
program.read(&buffer, 1);
int prog_index;
while(program.good())
{
writememory_byte(prog_index + 0xA4000000, buffer);
prog_index++;
program.seekg(prog_index);
program.read(&buffer, 1);
}
So for the first instruction I should be getting a value of $7001, but I get the 3d44 instead. In the other code block I have the code for reading the input file, but I don't believe there is any error there.

460
Casio Calculators / Re: Casio Prizm documentation
« on: March 18, 2011, 08:45:03 pm »
eActivity is a file format for the Prizm. Casio thinks of it as an education tool, but I see it as a potential pdf like viewer. It can hold customizable text, pictures, and a few gui elements. Maybe I will make an editor some time later.

461
Miscellaneous / Re: One File VS Multiple Files
« on: March 18, 2011, 02:58:01 pm »
Usually what I'll do for C++ is write everything in small multiple files, then before compiling I will copy and paste everything into one large file as it makes it easier to debug. And I can easily copy everything back because I use large distinctive headers for each file. Otherwise all those #include statements just seem to bug me.

462
Computer Programming / Arrays
« on: March 18, 2011, 02:11:27 am »
Sometimes I really miss programming in asm, but it can be difficult to do on x86 systems. So basically my problem is that I have an array of chars, but I need to read and write multiple types from it. Ranging from 32 bit longs, 16 bit words, and 8 bit bytes. Now the solution would be easy in asm, but this is C++ here which thinks that restricting a programmer from low-level access is a good thing.
Code: [Select]
char * memory = new char[0xFFFF];


int readmemory_long(int pointer)
{
unsigned int r_pointer = pointer - 0xA4000000;            //converts given pointer to the array address
if (r_pointer > 0x1FFFFF) return 0;
return ntohl(memory[r_pointer]);                    //ntohl(), converts data to little endian (I hope :P) issue here
                                                               // I want to get the 32 bit value at this address
}
void writememory_long(int pointer, int data)
{
unsigned int r_pointer = pointer - 0xA4000000;
if (r_pointer > 0x1FFFFF) return;
memory[r_pointer] = htonl(data);                //converts data to big endian: same issue
}
I was considering using for loops, but that could be kinda tricky. Any ideas/examples would be smiled upon  :)

463
Computer Programming / Re: PPTX converter
« on: March 17, 2011, 11:37:04 pm »
I don't think this would be a small program. By my best guess pptx is a compressed version of ppt. I had made two identical powerpoints and saved one as a ppt and the other as pptx. I then opened up the files in a hex editor. I was able to find the text from the ppt but not in the the pptx. The format seems very complex and I doubt microsoft would be willing to give out details on it.

464
Site Feedback and Questions / Re: Site funding and maintenance
« on: March 17, 2011, 01:12:01 am »
I quickly just drew up an idea for what the t-shirts could look like. Obviously they are not perfect, but I think they get the point across. The only problem was that the site I designed them at charged $23 per shirt with only three colors in use. I can probably find a local screen printer with a much lower rate though.


465
Casio Calculators / Re: PRIZM Emu
« on: March 16, 2011, 02:11:55 pm »
Once again sorry for the triple post, but I have found the part that is heavily slowing the code down.
Code: [Select]
bool end = true;     //if false then end execution
int speed;       //speed in Hz
int tempspeed = time(0);       //second counter
while (end)      //main loop
{
     cout << " \b";      //space then backspace for every command. Program fails without it ?
     end = decode();            //execution. returns if false if code ends
     speed++;                     //increments speed in Hz for every instruction
     if (tempspeed != time(0);      //checks if timer has changed
     {
          display_reg(speed);        // shows content of registers and speed
          speed = 0;                   //resets variables
          tempspeed = time(0);
     }
}
This is a section of the main function. The slowdown comes from the lone cout statement that has to run with every loop. For some reason if I remove it, the program then has a fatal error as soon as it boots up.

Pages: 1 ... 29 30 [31] 32 33 ... 62