PDA

View Full Version : BholeDC



quzar
August 11th, 2004, 00:00
Here is the first private release of BholeDC. I would like to ask that this not be made public yet nor for any of you to release branches of this source, although there is nothing really stopping you from doing so.

Here is the elf: http://www.screamcast.net/staff/Quzar/BholeDC.zip

And here is the source: http://www.screamcast.net/staff/Quzar/BholeDCsrc.zip

I have it loading games from CD and it can currently play Moonbugs, Round 42, Styx, and Exterminator.

Ill post links to these if anybody asks, but their legality would be relatively questionable, since they are considered abandonware...

wraggster
August 11th, 2004, 00:14
In this forum, i shouldnt worry about abadonware, its private and so as you would in private you do as you please. (well mostly butyou get what i mean)

Good Luck with the project

quzar
August 11th, 2004, 00:53
Yea, i know, but i would rather not that people later on say things like "Well he was spreading warez, nobody could see it cause it was private, but yea he was!!!!!!1111"

Toh-Ava
August 11th, 2004, 04:25
well, currently one can say the biggest version is mine (i'm still running some fixes on it...), i already implemented actual IRQ 0 and did some changes to the 8086 emulation code...

but so far i haven't seen a real change with the game i'm checking (livingstone), when i see it, i will post the code here (And a least of changes...)

if anyone wants to get what i've done so far, just e-mail me or something

quzar
August 11th, 2004, 05:58
ah yea, sorry if i made it seem the other way, i just wanted for the people here to be able to see what is currently running on the dreamcast. ill email you soon to ask for the changes so that i can implement them.

again, sorry if i made it seem like mine was up to date or better than the PC version.

Kamjin
August 11th, 2004, 20:39
Toh-Ava & Quzar,

If you guys could take a look and see if this *functions with the updates, and Toh-Ava, an executable would be nice, I've copied a slew of stuff off 360k's when I was testing, wouldn't mind giving a go again, alot just had corruption, and keyboard issues.

Transylvania relased to public by polaware
http://www.magictree.com/polarware/zip/TransylvaniaPC.zip

Main site.
http://www.magictree.com/polarware/polarware.htm


Didn't notice quzar posted the source.. but if you could add that to the test suite ;).. now to see if I fixed that blinking sdl problemm

quzar
August 13th, 2004, 00:15
Im gonna be working on making the PC and DC versions sync up. toh-ava asked me to do it and ill get it done as soon as i have a significant amount of time to do so. Basically, they will be worked on in relative unison, with the only difference being at some points " ifdef(Dreamcast) "

Toh-Ava
August 13th, 2004, 06:10
quzar, this is going to be more harder than i think...
the reason is... right now i'm running code fixes on my version, i think the only we can do it as if you put all your code on #ifdef (DREAMCAST)

and i will put it in by looking at both sources...

btw, if you do a bug fix of your own, mark it in some way i can understand (#ifdef QUZAR???) so that i can put it in as well...

btw, i checked that transylvania thing, i get a blank console like screen, but instead of writing the normal strings, i get all sorts of garbage, i'll get to work on it right after i'm done with some other game (livingstone, it's already playable, but has some glitches)

Toh-Ava
August 18th, 2004, 17:16
livingstone is fully playable, now i'm going to focus on the transylvania thingy someone has sent me...

quzar - please send me the changes in your version, so i can put them in mine, and then send you the result.

quzar
August 19th, 2004, 00:15
livingstone is fully playable, now i'm going to focus on the transylvania thingy someone has sent me...

quzar - please send me the changes in your version, so i can put them in mine, and then send you the result.


I'm sorry, but I'm leaving home today for college. I am driving, so I wont be there for around 3 days. I just got a laptop, and have started setting up my dev env on it, but i dont know if i can get it ready in time ( i leave in ~3 hours and havnt even finished packing yet). If you really want the dreamcast stuff in now, just take it from the source posted. if not, then as soon as i have time (i might be able to work on it on the road) I will make sure to make a version that can be Dreamcast or PC. Again, sorry for not being able to do it soon, I just dont have the time at the moment.

Ian_micheal
August 23rd, 2004, 08:32
SDL has a problem with double buffering it hardly works leaves you with blinking and flickering try putting the bit depth at 32bpp. Some times it fixes or helps these problems. Mostly this only helps mouse related problems.

I have Had a lot of problems with blinking my self just lately.With some code for a simple pong clone i wrote very annoying.

Toh-Ava
August 23rd, 2004, 09:37
transylvania thingy is now fully working
any other games people want?

btw, for a windows version, you can e-mail me if you want

for a dreamcast version... i'll be attempting to import quzar's changes to my current version

---
after edit:

TO QUZAR, but may be of interest to others:
luckily, i can see exactly which parts of code you wrote, the reason is, my editor left 0x0A after each line, your editor left a 0x0D, 0x0A...

so i can see your lines as lines ending with weird marks, it's excellent, and it's lucky, but it's merely an editor bug, right now i will be incoporating your changes, but i highly recommend using #defines next time... your changes will be incorporated to my code with an addition of #ifdef QUZAR

another thing, i am not going to import all of your changes to the routines that write to report_file, i am simply going to replace:

report_file = fopen("report","w");

with this:

#ifdef QUZAR
report_file = stdout;
#else
report_file = fopen("report","w");
#endif


-----
and yet another edit:

i have some problem with quzar's code, in his file_open, he tries to open a file from the CD, then copy it or something, then he closes it, and sends the invalid handle of the closed file as an fhandle, it seems wrong but i'm not certain, anyone else care to check this?

i know little of the dreamcast, so if quzar or anyone else can help i would be very thankful

Kamjin
August 23rd, 2004, 22:22
Muchos Gracias for the Transylvania!!!
I suggest you have Wraggster host the files for you here, for both the PC, and DC versions..

For what to work on next it seemed that the most requested stuff out of the old thread was the Duke Nukem, *Commander Keen, and Wolfenstein, I did notice a lemmings as well, although that would probably be hard to come by.

Oh yeah.. I'd actually like to play it, if you could mail it over to [email protected] it would be much apreciated!!

BlackAura
August 24th, 2004, 01:23
Toh-Ava - At the moment, KallistiOS doesn't have a proper stdio library, so simply setting the file handle to "stdout" won't work, because stdout doesn't exist. That's probably what the rest of the changes were for.

Might be easier to just wrap everything that writes to report_file up in a wrapper function, so you could just do something like:
void ReportWrite(message)
#ifdef _arch_dreamcast
printf(message);
#else
fprintf(report_file, message);
#endif
}

Toh-Ava
August 24th, 2004, 04:18
thanks everyone, there's just one problem, transylvania writes to a file (called dj), quzar's code for open_file seems wrong to me, can someone take a look at it,
just search for the routine int21_fileopen
quzar does this:



size_of_file = fs_copy(buffer, buffer1);
fhandles[i] = tempfile;
fclose(tempfile);
//fhandles[i] = fopen(fname,"r+b");
rewind(fhandles[i]);


and from then on, other routines use fhandles[i] as needed, the problem is, how can they use a handle that's closed... is this code wrong, or is that some weird dreamcast thingy i don't understand? if so, can someone look at the entire openfile routine that quzar wrote in his dreamcast conversion and help me with it?

what writable media does the dreamcast has? has it got some kind of a "memory card" thingy? will i have to program my own "file system" because the memory card is just raw writings without a file system? some games will need to be able to write...
i assume you can't write to the CD, and the RAM will purge, that's all the things i think quzar's code handles... if anyone can explain this to me in more depth i would be very thankful

wraggster
August 24th, 2004, 11:18
anything you need be it webspace etc, ill sort out :)

quzar
August 24th, 2004, 12:02
sorry for not having answered yet, for storage on the dreamcast, we use the /ram/ directory, which KOS sees as a rw dir. I think my code might be faulty there, with the way it closes the file handle, but im not sure, that was new to me and i had to look it up in order to find how to do it. The way i assumed it would work would be that the file handle stores the information about where the file is, regarless of whether or not it is opened.

The reason i did all that was because on a PC, you are reading the information from the hard drive, so files it creates can be written/read normally. On the DC however, all the game files are presumably stored on the CD, so if a file was being accessed for the purpose of reading and writing as opposed to just reading, it would copy the file to the ram and change where it looks for it to the ram disk.

For the report file, i would just send all that is being written to printf (there is no stdout on the DC).

Also, yes, from now on, anything i do to it will be with '#ifdef QUZAR', most authors just dont care that much about the Dreamcast ports so they end up being branches, where the ported is responsible for having to keep it up to date and all, and i did almost all of that in one day, so i didnt think of doing anything like that. From now on ill make sure to do so though, as well as document changes in the journal.

Ill start becoming availible again starting today for work and such on these things, but i JUST moved into my dorm, so yea, things are just a tad bit hectic =P

Kamjin
August 24th, 2004, 18:48
Since you're now.. well I was going to say studying.. but beer.. females.. hehe.. Take the courses serious, but also make time to enjoy it while it lasts!!!

I was going to help Toh-Ava with sectioning out your code chunks, but since you're back (and able to actually compile it..) I'll just sit back and read... errr SQL :'(...

I was mentioning to him on an email about saving, but I'll push that on to you, since you're using a Ramdisk, some sort of method would be nice to then push things onto the vmu, and load it back into ramdisk prior the execution, I guess this would be wishlist material..

Now onto that SDL can't compile.. I'm getting really annoyed with this.. I can't get SDL stuff to execute, they always panic out.. I even reverted back to my original setup.. getting sick of endlessly building the toolchain..
does the DCFreedev have everything in there already?

Toh-Ava
August 25th, 2004, 07:51
from my check, it appears the average size for duke nukem 1's save files are about 50...

no, not 50k, and not 50M. 50 bytes!!!

a memory card will be able to handle it...

but on second thought, i didn't even get duke to run yet...

quzar
August 25th, 2004, 15:31
Since you're now.. well I was going to say studying.. but beer.. females.. hehe.. Take the courses serious, but also make time to enjoy it while it lasts!!!

I was going to help Toh-Ava with sectioning out your code chunks, but since you're back (and able to actually compile it..) I'll just sit back and read... errr SQL :'(...

I was mentioning to him on an email about saving, but I'll push that on to you, since you're using a Ramdisk, some sort of method would be nice to then push things onto the vmu, and load it back into ramdisk prior the execution, I guess this would be wishlist material..

Now onto that SDL can't compile.. I'm getting really annoyed with this.. I can't get SDL stuff to execute, they always panic out.. I even reverted back to my original setup.. getting sick of endlessly building the toolchain..
does the DCFreedev have everything in there already?




oh, dude, if you want to do anything with it, don't feel like i am at all a barrier. As long as toh-ava doesnt mind, then i surely dont (short of just thowing out all my stuff and being like.. looky what i ported! ;) ). I have plenty of other things that i understand more that i can work on (i really cant see me advancing this past getting it to work properly on the DC, at least not at this time).

Kamjin
August 25th, 2004, 21:30
oh, dude, if you want to do anything with it, don't feel like i am at all a barrier. As long as toh-ava doesnt mind, then i surely dont (short of just thowing out all my stuff and being like.. looky what i ported! *;) ).

I was just going isolate the code chunks you wrote,
and pass them over to toh-ava. Actually my plate is full
(more like overflowing) with just the stuff I'm working on.. and work itself.. and He had asked about saving and how it was handled on the DC, so I had started to explain.. 'nuff on this.. I actually want to skip down there.



I have plenty of other things that i understand more that i can work on (i really cant see me advancing this past getting it to work properly on the DC, at least not at this time).
This is actually a descent project for that exact reason. the more you work with the code, the more you'll understand what's going on, and that inturn will give
you an insight into the PC architechture.. for instance I
had mentioned that it could seriously use a set of
8259's when you get some free time, grab a spec, and try to emulate them..even if you fail miserably at it, you'll still walk away with more than you started out with.

Just in case I did slightly step on a toe, don't take it the wrong way. I always try to be as helpful as possible, (sometimes.. er.. most of the time going overboard into techiebabel), if someone asks, and I know or can do, I'll always help out.

quzar
August 26th, 2004, 17:25
well i didnt feel at all like you were stepping on my toes man, so dont worry bout that (if you were). If anything I kind of stole it from you because you were gonna try to get it working, but your dev env was farked, and when i saw that i gave it a go (without askin you or anything). But I just figured you woulnt mind

Also, I dont really understand very well how emulation works at all. I mean, I can see how it works from one that exists, but i dont think i could ever make one from scratch lol.

Well, anyways, ill try to get more functionality into the DC side of it.

Kamjin
August 26th, 2004, 19:12
Also, I dont really understand very well how emulation works at all. I mean, I can see how it works from one that exists, but i dont think i could ever make one from scratch lol.
Well, anyways, ill try to get more functionality into the DC side of it.

You're saying that now, just keep an eye on the changes that toh makes, keep this as a reference
http://www-2.cs.cmu.edu/afs/cs/user/ralf/pub/WWW/files.html
and you'll need this
ftp://ftp.simtel.net/pub/simtelnet/msdos/info/helppc21.zip

and we'll see in a few months!

on a side note...
MY DEV IS STILL FARKED!!! I've narrowed it down to the SDL mixer.. are there different versions of it out there I'm using the 1.2.4???

quzar
August 26th, 2004, 23:25
woah... that is a CS CMU SITE!!!! I could actually go to the dude and ask him about that stuff!

Ralf Brown eh? maybe some time if i decide to try to learn this seriously ( i would rather have actually taken a course in C prior to doing so...) but yea that is cool.

sorry about the dev env. if it makes you feel any better i could never set my own up. Mekanizer was kind enough to transfer over his whole setup through MSN of all things lol. 50mb rard.

Kamjin
August 27th, 2004, 17:49
Ralph Brown, his name is known among those with a little grey hair, he published a an excellent book on the PC interupt list, which became the online version. Based on the link he's probably still staff there.

I think I'm gonna try that dcfreedev, and see if I have any luck with that..

Toh-Ava
September 4th, 2004, 00:13
next going i'm beginning some army training... (long story), i'll be back in a month, but then i only have 2 weeks before i return to uni, anyhow, i wanted to say that's the reason BHole will probably slow down a bit (that and the fact that duke nukem is annoying me)

anyhow, if anyone wants the latest version
(it runs Duke Nukem, gives u opening screen and menu, then crashes :)
he is welcomed to e-mail me and i will give it to him

thank you and good morning

quzar
September 6th, 2004, 17:39
Toh-ava: What did you do with the other stuff I changed? I only see one thing in there, but you said that you had taken everything modified by me and put it in #ifdef QUZAR things.

I found one part of the code where i could replace what i had added in the new code, although it was done very sloppily. Im going through it now to try to find the rest of what i had modified and see if i cant fix it back.

quzar
September 6th, 2004, 21:47
Just now i started getting errors compiling this. it hadnt happened before, and i dont understand it. the errors do not make sense and the things each file says is wrong ( such as the & or unsigned) are not in the files. what can i do?

Toh-Ava
September 7th, 2004, 01:30
a) i said i begun putting your stuff, but didn't finish, the "using closed file handle" thingy confused me

b) i can only give my friendly guess...

the error is kos.h related (i don't get it because i didn't #define QUZAR). my guess is that you should run a "\r\n" ---> "\n" conversion, or vice versa. i also used to have illogical errors in these cases, just use a text converter program to convert UNIX style files to DOS style files, and use it on BHole.c

btw, after you do the conversion, your code will look the exact same as mine, so after you're done, all of your code needs to be in #ifdefs

quzar
September 7th, 2004, 05:44
how would i run a \r\n to \n conversion?

also, i am trying to integrate all my code using my original port version, all in #ifdef / #ifndef QUZAR s. Sorry for the misunderstanding, i thought that since you could see what code i had written, you had converted it all.

atani
September 7th, 2004, 08:50
how would i run a \r\n to \n conversion?

also, i am trying to integrate all my code using my original port version, all in #ifdef / #ifndef QUZAR s. Sorry for the misunderstanding, i thought that since you could see what code i had written, you had converted it all.


EOL Chars are not very likely to cause a compilation failure outside of your own source code. This is a compilation failure of the header files from KOS itself... I am going to guess that your KOS has not changed, correct?

If it has not, then the failure is coming likely from the c file that is including the KOS headers...

Most likely it is a new header that is incompatible with KOS. From my experience, kos.h should be the first header you include in the c files.. This prevents a lot of incompatibilities issues with the headers..

quzar
September 7th, 2004, 11:59
that fixed it ;D thanks mr atani

toh-ava: what is the deal with int21_makefcb? it seems it occurs in the main bhole file and also in its own file, so which is the one that is proper and why are there two?

Toh-Ava
September 7th, 2004, 16:03
check out the Makefile, it does not compile makefcb.c
it's the same as Bhole.weird.c
leftovers from things i did

a compiler would never allow two procedures with the same names (however, two macros is possible, and i'm afraid some BHole code actually messes up like that, and you get no warnings because the macros are the exact same, so it does not matter, but it's still ugly, and once you'l change one of them, you'll get warnings because the second remained the same)

Ian_micheal
September 13th, 2004, 15:42
Since you're now.. well I was going to say studying.. but beer.. females.. hehe.. Take the courses serious, but also make time to enjoy it while it lasts!!!

I was going to help Toh-Ava with sectioning out your code chunks, but since you're back (and able to actually compile it..) I'll just sit back and read... errr SQL :'(...

I was mentioning to him on an email about saving, but I'll push that on to you, since you're using a Ramdisk, some sort of method would be nice to then push things onto the vmu, and load it back into ramdisk prior the execution, I guess this would be wishlist material..

Now onto that SDL can't compile.. I'm getting really annoyed with this.. I can't get SDL stuff to execute, they always panic out.. I even reverted back to my original setup.. getting sick of endlessly building the toolchain..
does the DCFreedev have everything in there already?





Have you tryed the pre-compiled versions of the mixer and SDL libs i have on my site. If you have error free kos 1.1.9 then these will work with out fail SDL mixer is pre patched for stereo and OGG support.

Kamjin
September 13th, 2004, 21:17
Have you tryed the pre-compiled versions of the mixer and SDL libs i have on my site. If you have error free kos 1.1.9 then these will work with out fail SDL mixer is pre patched for stereo and OGG support.


I thought I had checked your site ??? and didn't see them...I knew I got them there originally..
Did anyone try them on 1.2.0? if not I'll just put back the 1.1.9.

Thanks!!!!!!

quzar
September 13th, 2004, 23:21
hrm, apparently there is some opcode making it crash. if/when you read this toh, maybe you could enlighten me on some way to debug this...

Toh-Ava
September 15th, 2004, 06:41
i'm on a 4 day vacation, can you please give me more details? (celebrating the jewish version of sylvester)

Ian_micheal
September 16th, 2004, 02:03
Well kos-1.1.9 i use if you get the one's for neogeocd *cd audio will also work along with SDL joystick events stereo and ogg support. I have not released the one's with mp3 support since smpeg i ported will only work in mono mode.


http://imrtechnology.ngemu.com/examples.htm

Has working sdl libs for kos1.1.9 what i use for every thing i compiled them with compiler flags that should make them error free.

quzar
September 16th, 2004, 02:50
i'm on a 4 day vacation, can you please give me more details? (celebrating the jewish version of sylvester)

hrm i didnt realize that what i said could make it seem like i know which opcode is crashing it. the problem is i dont know, and i dont really know how to debug from that point.

maybe some sleep will help.... u_u

Ian_micheal
October 1st, 2004, 00:56
I was doing some testing of the first source release tested a lot of games but could only get the games you named to work. Is there a windows version of the builds to try out of the new source from the pc author?

When i compiled it got no errors. the old dc source release on the first page.

Good work was playing moon bugs lol

quzar
October 1st, 2004, 09:35
Yea, i need to get my ass in gear and keep working on this. Havnt touched it in a while. The problem is that when i first ported it i didnt take into account continued updates, so now the extra changes he has made i tried to report it but did something wrong. Just need to go through my parts of the code.


As for compatibility, the emulator was actually written around these games from what i understand, so I would understand it if they are the only ones that work =P

Ian_micheal
October 1st, 2004, 21:59
Ahh ok i tryed a heap of old games some only 1k old dos games from 1981 till about 1990 only the ones i got working were the ones stated.

Is there windows version of the new version or a site to get it?

quzar
October 2nd, 2004, 00:16
No, there isnt, and toh-ava is currently busy and one be back until mid october i think. I fixed up a few things in the sources today, but it still just crashes. Ill try to work with debugging it further to see what i messed up.

Toh-Ava
October 6th, 2004, 09:38
i'm back, but to tell the truth, i have no idea what causes the crashes, it works fine for me, so i'll assume it's some dreamcast thingy...

my guess is that somehow the init_opcode routine doesn't get called, or works wrong???

Ian_micheal
October 7th, 2004, 07:58
To my understanding this was built around the games it loads does it run dos in any form or any other software but the games thats stated that work. Ive not had an luck finding a windows version to test out. Dreamcast version is of the older version.

quzar
October 7th, 2004, 12:26
At this point I'm calling shenanigans on gcc/my toolchain/kos, because i sent it to someone else to test and compiling with their (newer) versions it doesnt even crash, it just hangs.

quzar
October 8th, 2004, 11:12
Well i was right. For some reason my dev environment does not like things that assume little endian =\

replacing this:
ret = *(unsigned short*)(__memory__+(cs <<4)+ip);

With this:
ret = __memory__[(cs <<4)+ip] + (__memory__[(cs <<4)+ip+1] << 8);

solved the problem. I believe that I now know how to fix Neopop =). Also, either today or tomorrow I'm getting a 2nd hand keyboard so i can continue the testing with this.

New sources/ bin will be up soon and maybe a formal release.

quzar
October 9th, 2004, 17:33
New bin and src uploaded. DC version working again and in sync with the PC version.

Here is the bin: http://www.screamcast.net/staff/Quzar/BholeDC.zip

And here is the source: http://www.screamcast.net/staff/Quzar/Bhole4src.zip

Oh, and the menu is fixed so it doesnt skip around any more, but it IS unfortunately limited to 30 files (which should be more than you will have anyways, since it only lists .exe, .com, and .img).

Eventually ill put a nicer menu (at least for a public release).

Toh-Ava
October 10th, 2004, 09:40
quzar's sources should compile under windows cygwin as well... if anyone needs a Makefile, send me an e-mail