Author Topic: CGDoom  (Read 77858 times)

0 Members and 1 Guest are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: CGDoom
« Reply #30 on: June 29, 2012, 05:35:26 pm »
Since DOSbox is an emulator, wouldn't it be incredibly slow though? Or would it be just fine for very old games from the '80s for example?

Offline seana11

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 15
  • Rating: +4/-0
    • View Profile
Re: CGDoom
« Reply #31 on: July 01, 2012, 03:18:45 pm »
Quote from: DJ_O
Ok I understand your concern. That said, a demo is possible for a contest, but if it's just the first level, it might lose a few points due to being too easy and short. And the contest ends in two weeks, so I guess time would definitively be an issue.

It does not end in 2 weeks!  It ends in August. 

Quote from: MPope
BTW: that would be also nice project. DOSBox on Prizm :-)

Even better: make it bash. 
« Last Edit: July 01, 2012, 03:23:07 pm by seana11 »

Offline flyingfisch

  • I'm 1337 now!
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1620
  • Rating: +94/-17
  • Testing, testing, 1...2...3...4...5...6...7...8..9
    • View Profile
    • Top Page Website Design
Re: CGDoom
« Reply #32 on: July 01, 2012, 09:12:46 pm »
Quote from: DJ_O
Ok I understand your concern. That said, a demo is possible for a contest, but if it's just the first level, it might lose a few points due to being too easy and short. And the contest ends in two weeks, so I guess time would definitively be an issue.

It does not end in 2 weeks!  It ends in August. 

Quote from: MPope
BTW: that would be also nice project. DOSBox on Prizm :-)

Even better: make it bash. 

or csh
or bsh
or ssh
or... well, ANY sh type shell!

DOSBox would be sorta cool cuz we could play old games on it :)



Quote from: my dad
"welcome to the world of computers, where everything seems to be based on random number generators"



The Game V. 2.0

Offline seana11

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 15
  • Rating: +4/-0
    • View Profile
Re: CGDoom
« Reply #33 on: July 01, 2012, 10:09:23 pm »
"
Quote from: DJ_O
Ok I understand your concern. That said, a demo is possible for a contest, but if it's just the first level, it might lose a few points due to being too easy and short. And the contest ends in two weeks, so I guess time would definitively be an issue.

It does not end in 2 weeks!  It ends in August. 

Quote from: MPope
BTW: that would be also nice project. DOSBox on Prizm :-)

Even better: make it bash. 

or csh
or bsh
or ssh
or... well, ANY sh type shell!

DOSBox would be sorta cool cuz we could play old games on it :)

ASHs to ASHs, DOS to DOS

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: CGDoom
« Reply #34 on: July 01, 2012, 10:56:57 pm »
Quote from: DJ_O
Ok I understand your concern. That said, a demo is possible for a contest, but if it's just the first level, it might lose a few points due to being too easy and short. And the contest ends in two weeks, so I guess time would definitively be an issue.

It does not end in 2 weeks!  It ends in August. 
I meant the Omnimaga contest.

Offline MPoupe

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 168
  • Rating: +30/-1
  • The coder of yesterday
    • View Profile
    • My web site about Casio calculator
Re: CGDoom
« Reply #35 on: July 02, 2012, 04:41:21 am »
System ERROR
ADDRESS (R)
TARGET = A1524CCD
PC        = 00305BA0
I did some deeper research and it seems it is write exception. The (R) probably means real address.
I updated my Prizm simulator to map simulated flash into the read only memory (by MapViewOfFile(hMap,FILE_MAP_READ,...);
so it throwed an exception on write. I fixed a small bug so then it worked in the simulator, but not in real HW. And I found the source:
Code: [Select]

typedef struct
{
  const short       width; // bounding box size
  const short height;
  const short leftoffset; // pixels to the left of origin
  const short topoffset; // pixels below the origin
  const int columnofs[8]; // only [width] used
  // the [0] is &columnofs[width]
} patch_t;

// posts are runs of non masked source pixels
typedef struct
{
    byte topdelta; // -1 is the last post in a column
    byte length; // length data bytes follows
} post_t;

// column_t is a list of 0 or more post_t, (byte)-1 terminated
typedef post_t column_t;

//RANGECHECK undefined

#define SHORT(x) LTOH16(x) //swap bytes in word (on Prizm)
#define LONG(x) LTOH32(x) //swap bytes in dword (on Prizm)
#define SCREEN_COUNT 2
#define ASSERT(x)
#define SCREENWIDTH 320 //DOOM screen width

void V_DrawPatchX(int x,int y,int scrn,const patch_t* patch)
{
  int  count;
  int  col;
  const column_t* column;
  byte* desttop;
  byte* dest;
  const byte* source;
  int  w;

  y -= SHORT(patch->topoffset);
  x -= SHORT(patch->leftoffset);
#ifdef RANGECHECK
  if (x<0 ||x+SHORT(patch->width) >SCREENWIDTH || y<0 || y+SHORT(patch->height)>SCREENHEIGHT  || (unsigned)scrn>4)
  {
    //printf("Patch at %d,%d exceeds LFB\n", x,y );
    // No I_Error abort - what is up with TNT.WAD?
    //printf("V_DrawPatch: bad patch (ignored)\n");
    return;
  }
#endif

  if (!scrn)
    V_MarkRect (x, y, SHORT(patch->width), SHORT(patch->height));

  col = 0;
  ASSERT(SCREEN_COUNT > scrn);
  desttop = screens[scrn]+y*SCREENWIDTH+x;

  w = SHORT(patch->width);
  for ( ; col<w ; x++, col++, desttop++)
  {
    column = (const column_t *)((const byte *)patch + LONG(patch->columnofs[col]));
    // step through the posts in a column
    while (column->topdelta != 0xff )
    {
      source = (const byte *)column + 3;
      dest = desttop + column->topdelta*SCREENWIDTH;
      count = column->length;

      while (count--)
      {
        *dest = *source;
        source++;
        dest += SCREENWIDTH;
      }
      column = (const column_t *)(  (const byte *)column + column->length + 4 );
    }
  }   
}

extern int giMaxPatchInFlash;
void V_DrawPatch(int x,int y,int scrn,const patch_t* patch)
{
#ifdef WORK_WITH_COPY
  if(PTR_TO_FLASH(patch))
  {
    memcpy(VRAM,patch,giMaxPatchInFlash);
    patch = (const patch_t*)VRAM;
  }
#endif
  V_DrawPatchX(x,y,scrn,patch);
}
The function V_DrawPatchX() is used to draw any entity to the screen buffer (simplest thing is a letter of message "Picked weapon", (called for each letter)). On windows it works (patch points to HW protected readonly memory), on Prizm it throws an access exception. If I copy the buffer to RAM (by wrapper) , then it works (on Prizm). So it seems the compiler generates some writes to read only pointer.

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: CGDoom
« Reply #36 on: July 02, 2012, 10:03:10 am »
@Jim: According to Kerm C++ is already doable on the Prizm. pSDL probably needs to be developed further though.

Offline flyingfisch

  • I'm 1337 now!
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1620
  • Rating: +94/-17
  • Testing, testing, 1...2...3...4...5...6...7...8..9
    • View Profile
    • Top Page Website Design
Re: CGDoom
« Reply #37 on: July 02, 2012, 03:10:25 pm »
@Jim: According to Kerm C++ is already doable on the Prizm. pSDL probably needs to be developed further though.

yes, C++ is doable. talk to SimonLothar or AHelper for more info



Quote from: my dad
"welcome to the world of computers, where everything seems to be based on random number generators"



The Game V. 2.0

Offline MPoupe

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 168
  • Rating: +30/-1
  • The coder of yesterday
    • View Profile
    • My web site about Casio calculator
Re: CGDoom
« Reply #38 on: July 09, 2012, 05:05:33 am »
System ERROR
ADDRESS (R)
TARGET = A1524CCD
PC        = 00305BA0
Damn stupid bug. Reading word from A1524CCD ;-)
Fix: read per bytes.

Offline MPoupe

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 168
  • Rating: +30/-1
  • The coder of yesterday
    • View Profile
    • My web site about Casio calculator
Re: CGDoom
« Reply #39 on: July 15, 2012, 12:49:37 pm »
Hello,
I slightly improved cgdoom.
Updated controls:
arrows - movement
[menu] - exit
[exit] - map on/off
[optn] - pause
[vars] - (hack) switch between smooth and fast movement
[F1]~[F6]+[Shift] - select weapon 1 ~ 7
[Exe] - use (open door, use switch)
[ 0 ] - step left
[.] - step right
[->] - idclip
[^] - iddqd + idkfa
[alpha] - fire
[F<->D] - show free memory in the pool
[ + ] - larger screen
[-] - smaller screen

New features:
- use directly flash memory when possible (saved ~ 150 KB in the first room of the attached wad).
   This doesn't work for areas which are in 2 different areas (file fragmentation). So less fragments -> better.
- show only each second frame (smooth mode) or each fourth frame (fast mode), switch by [vars]
   It seems playable when in smooth mode and overclocked to 87 MHz (94 MHz doesn't work for me)
- other wad files may work (I tried full wad from Doom I and Doom II on simulator - worked; another wads (Heretic, Hexen and TNT do NOT work).
   If you want to use it, try it in simulator first.
- support for composite textures was limited to 8KB to save RAM. It seems 8 KB is enough for switches (they use composite textures). Larger composite textures are cripled - see an image.



Notes for simulator:
- simulator is much faster than calculator, because your PC is much faster. Run it on as slow PC as possible :-)
- on first run it creates flash.bin file to simulate flash for direct access. Can be safely removed later (will recreate).
- Important: delete flash.bin if you change doom.wad file !


Todo:
- multiple keys at a time (currently I use GetKeyPRGM)
- do not use VRAM (do we have some demo code talking directly with LCD registers for MiniSDK ?) Use VRAM as RAM.
- Find each usable byte of RAM (do we have any detailed map of memory ?) and use it.
Currently I use (except globals & stack):system stack, heap,save VRAM buffer


Offline critor

  • Editor
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2079
  • Rating: +439/-13
    • View Profile
    • TI-Planet
Re: CGDoom
« Reply #40 on: July 15, 2012, 01:01:56 pm »
- other wad files may work (I tried full wad from Doom I and Doom II on simulator - worked; another wads (Heretic, Hexen and TNT do NOT work).

Hi MPoupe.

I don't know which wads you've used, nor which Doom engine you are porting.

nDoom is a port of the original Doom I / Doom II engine.

Hexen and Heretic games are using a modified version of the original Doom engine, and their wads are incompatible with nDoom.
(in Hexen and Heretic, you have an item menu and you can fly for example...)

You can find a total conversion of the Heretic game compatible with the original Doom engine here:
http://tiplanet.org/forum/archives_voir.php?id=3897

All consequent wads which have worked with nDoom (and so are compatible with the original Doom engine) are available here:
http://tiplanet.org/forum/archives_list.php?id=Niveaux%20Doom%20Nspire

Hope it helps.
« Last Edit: July 15, 2012, 01:02:41 pm by critor »
TI-Planet co-admin.

Offline apcalc

  • The Game
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1393
  • Rating: +120/-2
  • VGhlIEdhbWUh (Base 64 :))
    • View Profile
Re: CGDoom
« Reply #41 on: July 15, 2012, 01:34:21 pm »
Looks nice, great pic! :)


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: CGDoom
« Reply #42 on: July 15, 2012, 02:50:44 pm »
Nice updates MPoupe :), Keep it up! Also glad you added frame skipping. It can help sometimes and we don't necessarily need max FPS considering Doom on the SNES ran at like 8 FPS :P

Offline totoyo

  • LV3 Member (Next: 100)
  • ***
  • Posts: 68
  • Rating: +2/-0
    • View Profile
    • Planète-Casio
Re: CGDoom
« Reply #43 on: July 15, 2012, 05:36:42 pm »
I trying this new version :D !
Sorry for my bad english, i'm french. Thanks :-)

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: CGDoom
« Reply #44 on: July 16, 2012, 12:07:21 am »
94 MHz seems to work fine for me, the framerate is pretty decent :D

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.