English Amiga Board


Go Back   English Amiga Board > Other Projects > project.Amiga Game Factory

 
 
Thread Tools
Old 21 September 2018, 17:24   #221
Raybeez
Registered User

Raybeez's Avatar
 
Join Date: Nov 2014
Location: Gdansk / Poland
Age: 39
Posts: 4
Understood, if I will find any help I will write You.
Raybeez is offline  
Old 23 September 2018, 17:53   #222
zzbylu
Saberman

zzbylu's Avatar
 
Join Date: Dec 2016
Location: Kielce/Poland
Posts: 94
HoMM II on the real Amiga 1200/030 - gameplay:
[ Show youtube player ]
zzbylu is offline  
Old 23 September 2018, 23:54   #223
saimon69
J.M.D - Bedroom Musician

 
Join Date: Apr 2014
Location: los angeles,ca
Posts: 1,040
Beside the 128 megabytes and the 50 mhz FPU that is mostly my A1200 config in italy (viper EC030/42mhz+FPU+32 MB ram) - now Meynaf would go mad at me more - since i still need to finish all audio tracks - but i wonder if that code could be a bit optimized, in-field graphics could be reduced of colors, audio rediced to lower rate or the C2P could use an approach similar to shapeshifter EVD - but that is just me since am no coder
saimon69 is offline  
Old 24 September 2018, 09:56   #224
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 46
Posts: 3,501
Quote:
Originally Posted by saimon69 View Post
Beside the 128 megabytes and the 50 mhz FPU that is mostly my A1200 config in italy (viper EC030/42mhz+FPU+32 MB ram) - now Meynaf would go mad at me more - since i still need to finish all audio tracks - but i wonder if that code could be a bit optimized, in-field graphics could be reduced of colors, audio rediced to lower rate or the C2P could use an approach similar to shapeshifter EVD - but that is just me since am no coder
Of course the code can still be optimised, but not in the ways you suggest.

Reducing colors isn't realistic because many effects expect 256 colors, and these particular 256 colors. There is notably palette cycling that would fail miserably, shadowing done by reading on-screen pixels and darkening them, etc.

Decreasing the rate of audio would only bring quality loss - audio does not currently take significant cpu time.

And the C2P already updates partial screen regions (else it would be real damned slow, believe me - even the mouse pointer would be so sluggish you'd want to just throw the game !).

But it's C++, and the code is largely sub-optimal.
Some parts have been rewritten in asm already.
However it's basically huge...
meynaf is offline  
Old 25 September 2018, 14:51   #225
NovaCoder
Registered User
NovaCoder's Avatar
 
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 3,691
Quote:
Originally Posted by meynaf View Post
This is in theory possible, but I have no knowledge about these. The game has mainly been made for A1200/030 with just AGA.

Last version has had some code cleanup in this area (c2p in include file rather than being buried deep in the game itself) so now it's just a matter of how to use these graphics cards.
If someone can give me simple code for handling some (often partial) copy of 640x480x8 chunky frame buffer to the video mem, then i might do this.
Also i need to setup this under Winuae so i can test if the code works.
You would need this kind of thing..

PHP Code:
#include <proto/exec.h>
#include <proto/intuition.h>
#include <proto/graphics.h>

#include <cybergraphics.h>
#include <proto/cybergraphics.h>
 
struct Library *CyberGfxBase NULL;


/** Global Hardware window */
static struct Window *_hardwareWindow NULL;


/** Hardware screen */
static struct Screen *_hardwareScreen NULL;



CyberGfxBase OpenLibrary ("cybergraphics.library"0);
if (
CyberGfxBase == NULL) {
    
SDL_SetError("Can't open cybergraphics.library\n");
    return -
1;
}  

<
SNIP Open screen and windowchoose display mode>    
    
static 
void RTG_UpdateRects(int numrectsSDL_Rect *rects)
{
    
int i;
    
Sint16 dirtyStartdirtyEnd;
    
UBYTEsrc;
    
UBYTE *base_address;
    
APTR video_bitmap_handle NULL;
        

    
// Seed.
    
dirtyStart SDL_VideoSurface->h;
    
dirtyEnd 0;
    
    
    
// Find dirty strip extents.
    
for (0numrectsi++) {
        
SDL_Rect *rects i;
        if (!
r) {
          continue;
        }

        if (
r->dirtyStart) {
            
dirtyStart r->y;
        }
        
        if ((
r->r->h) > dirtyEnd) {
            
dirtyEnd = (r->r->h);
        }
    }

              
    
src = (UBYTE*)SDL_VideoSurface->pixels + (dirtyStart SDL_VideoSurface->w);
    
     
    
// Check whether the palette was changed.
    
if (_paletteDirtyEnd != 0) {
        
RTG_updatePalette();
    }
        
    
    
video_bitmap_handle LockBitMapTags(_hardwareScreen->ViewPort.RasInfo->BitMap,
                                         
LBMI_BASEADDRESS, (ULONG)&base_address,
                                         
TAG_DONE);
    if (
video_bitmap_handle) {
        
base_address = (base_address + (dirtyStart SDL_VideoSurface->w));
        
CopyMemQuick(srcbase_address, (SDL_VideoSurface->* (dirtyEnd dirtyStart)));
    }

    if (
video_bitmap_handle) {
        
UnLockBitMap (video_bitmap_handle);
    }

NovaCoder is offline  
Old 25 September 2018, 15:06   #226
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 46
Posts: 3,501
Quote:
Originally Posted by NovaCoder View Post
<SNIP - Open screen and window, choose display mode>
That part may well be the biggest problem, in fact.


Quote:
Originally Posted by NovaCoder View Post
Code:
    // Check whether the palette was changed.
    if (_paletteDirtyEnd != 0) {
        RTG_updatePalette();
    }
How to transmit actual palette data ?
meynaf is offline  
Old 25 September 2018, 15:46   #227
NovaCoder
Registered User
NovaCoder's Avatar
 
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 3,691
Quote:
Originally Posted by meynaf View Post
That part may well be the biggest problem, in fact.



How to transmit actual palette data ?
PHP Code:
int RTG_SetVideoMode(int widthint heightint bppUint32 flags)
{
    
ULONG modeId INVALID_ID;

    
 
    
// Automatically choose the best mode.
    
modeId BestCModeIDTags(
                
CYBRBIDTG_Depthbpp,
                
CYBRBIDTG_NominalWidthwidth,
                
CYBRBIDTG_NominalHeightheight,
                
TAG_DONE);


    
// Verify the mode choosen.
    
if (modeId != INVALID_ID) {
        if (
GetCyberIDAttr(CYBRIDATTR_DEPTHmodeId) != bpp) {
            
modeId INVALID_ID;
        }
    
        if (
GetCyberIDAttr(CYBRIDATTR_WIDTHmodeId) != width) {
           
modeId INVALID_ID;
        }
    
        if (
GetCyberIDAttr(CYBRIDATTR_HEIGHTmodeId) != height) {
           
modeId INVALID_ID;
        }
    }

    if (
modeId == INVALID_ID) {
        
SDL_SetError("Couldn't find a CyberGFX Screen for requested mode");
        return(-
1);
    }
    
    
// Create the hardware screen.
    
_hardwareScreen CreateHardwareScreen(modeIdwidthheightbpp);
    if (!
_hardwareScreen ) {
        
SDL_SetError("Couldn't create a Hardware Screen for requested mode");
        return(-
1);
    }
    

     
    
_hardwareWindow CreateHardwareWindow(widthheight);
    if (!
_hardwareWindow) {
        
SDL_SetError("Couldn't create a Hardware Window for requested mode");
        return(-
1);
    }                
   
    



    
/* We're done */
    
return(1);

PHP Code:
static struct ScreenCreateHardwareScreen(ULONG modeIdint widthint heightint depth) {

    return 
OpenScreenTags(NULL,
                     
SA_Depthdepth,
                     
SA_DisplayIDmodeId,
                     
SA_Top0,
                     
SA_Left0,
                     
SA_Widthwidth,
                     
SA_Heightheight,
                     
SA_TypeCUSTOMSCREEN,
                     
SA_QuietTRUE,
                     
SA_ShowTitleFALSE,
                     
SA_DraggableFALSE,
                     
SA_ExclusiveTRUE,
                     
SA_AutoScrollFALSE,
                     
TAG_DONE);        
}

static 
struct WindowCreateHardwareWindow(int widthint height) {

    return 
OpenWindowTags(NULL,
                      
WA_Left0,
                    
WA_Top0,
                    
WA_Widthwidth,
                    
WA_Heightheight,
                    
WA_PubScreen, (ULONG)_hardwareScreen,
                    
WA_BackdropFALSE,
                    
WA_BorderlessFALSE,
                    
WA_ActivateTRUE,
                    
WA_SimpleRefreshTRUE,
                    
WA_NoCareRefreshTRUE,
                    
WA_ReportMouseTRUE,
                    
WA_RMBTrapTRUE,
                      
WA_IDCMPIDCMP_RAWKEY|IDCMP_MOUSEMOVE|IDCMP_DELTAMOVE|IDCMP_MOUSEBUTTONS,
                      
TAG_END);

PHP Code:
// Palette data
static SDL_Color *_currentPalette;
static 
int _paletteDirtyStart_paletteDirtyEnd;

static 
void RTG_updatePalette() {
    
    
int inumberOfEntries;
    
ULONG  _rtgPalette[256*2];
     
#ifdef DEBUG_PALETTE    
    
SDL_LogDebugMsgchar ("RTG_updatePalette()\n");

    
SDL_LogDebugMsgchar("RTG_updatePalette() - _paletteDirtyStart = %d\n"_paletteDirtyStart);
    
SDL_LogDebugMsgchar("RTG_updatePalette() - _paletteDirtyEnd = %d\n"_paletteDirtyEnd);
#endif

    
numberOfEntries = (_paletteDirtyEnd _paletteDirtyStart);

    for ( 
i=0numberOfEntriesi++ ) {
        
_rtgPalette[i*3+1] = _currentPalette[_paletteDirtyStart i].r<<24;
        
_rtgPalette[i*3+2] = _currentPalette[_paletteDirtyStart i].g<<24;
        
_rtgPalette[i*3+3] = _currentPalette[_paletteDirtyStart i].b<<24;
    }

    
_rtgPalette[0] = (numberOfEntries << 16) + _paletteDirtyStart;

    
// Terminator: NEEDED
    
_rtgPalette[((numberOfEntries 3) + 1)] = 0x00000000;

    
LoadRGB32(&_hardwareScreen->ViewPort_rtgPalette);


    
// Reset.
    
_paletteDirtyStart 256;
    
_paletteDirtyEnd 0;

NovaCoder is offline  
Old 25 September 2018, 16:48   #228
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 46
Posts: 3,501
Ok.
Now i need to setup RTG under winuae. Just adding rtg board is easy, but how to setup it so that the above can work ? I don't even have cybergraphics.library (btw, do all rtg setups use this ?).
meynaf is offline  
Old 28 July 2019, 20:45   #229
Seiya
Registered User

Seiya's Avatar
 
Join Date: Nov 2014
Location: Italy
Posts: 930
hello, i reopen this thread to ask if there is a way to play music? i see from option in the game that is possible to play with MIDI. This porting can play music?
By the way, excellent porting for Amiga.
Seiya is offline  
Old 29 July 2019, 08:36   #230
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 46
Posts: 3,501
Quote:
Originally Posted by Seiya View Post
hello, i reopen this thread to ask if there is a way to play music? i see from option in the game that is possible to play with MIDI. This porting can play music?
By the way, excellent porting for Amiga.
No, unfortunately there is no music. It's on the todo list, maybe one day (when i find a good solution).
Options exist to play either MIDI or CD but changing them will have no effect. Note that Mac version could not play MIDI either (actually, XMI).
meynaf is offline  
Old 29 July 2019, 10:50   #231
Seiya
Registered User

Seiya's Avatar
 
Join Date: Nov 2014
Location: Italy
Posts: 930
ok, thanks
Seiya is offline  
Old 11 August 2019, 06:36   #232
saimon69
J.M.D - Bedroom Musician

 
Join Date: Apr 2014
Location: los angeles,ca
Posts: 1,040
well, i was tasked to do the music, and seems still got a lot to do; i did listen cold lately at what i did and i admit more than half of it is not as good as it should be

Am busy with two jobs right now and several gigs for other projects but would love to have this on my pedigree too, and done better than is now, hoping that all those projects give me better skills than in 2016

Last edited by saimon69; 11 August 2019 at 07:07.
saimon69 is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Graphical Problems with Bubble Heroes Marskilla support.FS-UAE 7 18 August 2014 00:15
Heroes of Might and Magic mattbarton.exe Retrogaming General Discussion 7 25 April 2010 04:01
Heroes of the Lance xaind HOL contributions 1 07 January 2010 15:31
Heroes of Might and Magic III almost made it to the Atari! Shoonay Nostalgia & memories 10 31 May 2009 08:02
Heroes of the lance... keil81 support.Games 3 16 December 2001 12:26

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:32.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.07959 seconds with 14 queries