English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 23 August 2017, 02:24   #241
haps
Rumpig
 
haps's Avatar
 
Join Date: Aug 2006
Location: The bottom of the bottle
Age: 92
Posts: 243
Quote:
Originally Posted by emufan View Post
Code:
$  cat disk.rom | hexdump -v -e '16/1   "x%02X," "\n"' | \
sed -e s/x/\\\\x/g | sed -e s/","//g | sed -e s/$/\"/g |  sed -e s/^/\"/g
You sure like abusing the poor little cat!

Hexdump will quite happily take a file as an arg.


Code:
hexdump -v -e '16/1   "x%02X," "\n"' disk.rom
haps is offline  
Old 23 August 2017, 14:31   #242
Marlon_
AmigaDev.com
 
Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
Emufan, if you're running Win 10 it's probably easier to use the Linux subsystem than running cygwin.
Marlon_ is offline  
Old 23 August 2017, 23:54   #243
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 676
WOW! Literally windows 10 is the best AAA OS for x64 machines hahaha!
xboxown is offline  
Old 24 August 2017, 13:35   #244
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
i have win7 here, and i abuse cat this way since ever i guess

not much but at least SDDApple is more or less useable.
i "fixed" the asl requester (F1 and F2) to load a diskimage - i think this can
be put into kegs for example.

SDDApple keys - some i've changed:
F1 and F2 -> load disk 1 and 2
RCTRL + F3 -> boot/reset
RALT + RCTRL + F3 -> boot/reset - dunno exactly the diff to above
Keypad / and * -> cpu multiplier/frameskip
Keypad - and + -> graphics mode
RAlt + Keypad + and - -> scanlines on/off
F6 fullscreen / windowmode
F7 / F8 volume level
RCTRL + ESC -> quit emulator

there are some commandline options: sddapple.exe ?

once a disk is insert, it may do nothing, hit reset ( RCTRL+F3) and type PR#6,
so it will boot. sound seems not working at all.

i've tested this PR#6 command in kegs aswell, could not successfully boot a 140kb dsk,
but at least the command is there aswell. and it differs, if using rom 01 or 03 version.

zone: SDDApple68k-WIP.lha

Last edited by emufan; 24 August 2017 at 13:42.
emufan is offline  
Old 24 August 2017, 17:01   #245
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 676
If we can find away to optimize the code to run faster in real amiga hardware (vampire) combination then we have reached the goal! This does everything I need from applewin or kegs. The only problem it is slow in refresh rate and performance due to bad coding from the author itself.
xboxown is offline  
Old 24 August 2017, 18:26   #246
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
i rebuild with some optimisation:
-O2 -m68030 -fomit-frame-pointer
-O2 -m68040 -fomit-frame-pointer
-O2 -m68060 -fomit-frame-pointer

are there any other or better options?

and use the keypad * and / keys to adjust the speed/frameskip value
zone: SDDApple680x0-WIP.lha
emufan is offline  
Old 24 August 2017, 18:54   #247
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 676
Quote:
Originally Posted by emufan View Post
i rebuild with some optimisation:
-O2 -m68030 -fomit-frame-pointer
-O2 -m68040 -fomit-frame-pointer
-O2 -m68060 -fomit-frame-pointer

are there any other or better options?

and use the keypad * and / keys to adjust the speed/frameskip value
zone: SDDApple680x0-WIP.lha
Seeing as how we solved the emulation of Apple // SDDApple is now even better than apple 2000e and that is the achievement I wanted to reach anyways.

With this I can play Adventure Construction Set and with Apple2000e it cannot even do that...

Now comes the optimization part. If you can look at the code with the looping or if statement or anything that you think can be rewritten with less CPU execution and optimization and even the concept of recursive calling to perform same take with less CPU execution then we are increasing performance by a huge shot.

Another thing I can think of, of increasing performance is if you have an actual real Amiga with Vampire card with you. If you do and you have knowledge of assembly and AMMX programming skill, you can add in AMMX technology into it to enhance performance. But if not then that is fine. The best I can think of, is to go through each line of code and optimize the code to require less CPU execution. If we can increase the FPS by 10 points only that is it..just 10 points then we have reached optimal performance peek and we will not notice the difference between it and say....a real Apple // for example. At that point we can release it. If you think it is not possible and you have reached your final road in all of this...then let us now release it to the public into aminet so other people can enjoy this. You can also release the source code with it, this way...someone who have assembly language or knowledge of AMMX technology and have vampire and want to tackle it for learning purpose and enhancement it gives the opportunity for that person to optimize it and release it to the public with better enhancement.

I have no doubt in my inner heart with Vampire we have the optimal hardware power and raw power to make this SDDApple run in fast performance that match bar with PPC Amiga NG or x86 Windows easily. What it needs are skilled programmers to do skillful optimization and coding skill to make the performance peek. Observe how they managed to make a game that seem impossible, possible in Atari and Atari is even more inferior in hardware space than said Amiga+Vampire combination.

Look at SymbOS an OS that is multitasking with firefox and video player that run on stock MSX computer. If all of this is possible I have no doubt that this is possible.
xboxown is offline  
Old 24 August 2017, 21:16   #248
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
code optimization I cannot do, thats beyond my ability

but I had the impression, using the above options, the example Alf game was alot faster.
still no clue what keys to use to run arround, but moving on screen was really faster.

I'm looking at the missing sound, compared with kegs, and changed some varaible,
but still refuses to work:
Code:
#define SOUND_SAMPLE_RATE 20500 //	44100
#define SOUND_MAX_SAMPLE	2048
#define SOUND_MAX_BUFFER	512 // SOUND_MAX_SAMPLE*8
#define SOUND_MAX_C030_TIMES	18000
...
static SDL_AudioSpec	*sound_desired;
...

	sound_desired = (SDL_AudioSpec *)malloc(sizeof(SDL_AudioSpec));
	if (sound_desired == NULL) {
	  sound_available = 0;		// no sound
          sputs ("Sound could not be enabled");
          printf ("Sound #1 could not be enabled\n");
          return 1;
	}

	sound_desired->freq	= 20500; //SOUND_SAMPLE_RATE;
    sound_desired->format   = AUDIO_S16SYS; //AUDIO_U16
	sound_desired->channels	= 2; // 1
	sound_desired->samples	= 512; //SOUND_MAX_SAMPLE
	sound_desired->callback	= sound_callback;
	sound_desired->userdata	= NULL;

	if ( SDL_OpenAudio(sound_desired, NULL /*sound_obtained*/) < 0 ) {
	  sound_available = 0;		// no sound
          sputs ("Sound could not be enabled");
          printf ("Sound #2 could not be enabled\n");
          return 1;
	}
...
static void sound_callback(void *userdata, Uint8 *stream, int len) {
	register unsigned int i;
	register unsigned int source_index;
	register unsigned int compare_index;
	register unsigned int lastval;

	source_index = sound_playposition;
	compare_index = sound_addposition;
	lastval = sound_lastval;
	for (i=SOUND_MAX_SAMPLE; i; i--) {
	  if (source_index == compare_index) {
	    *stream++ = lastval;	// silence
	    *stream++ = lastval >> 8;	// silence
	  }
	  else {
	    lastval   = sound_buffer[source_index];
	    *stream++ = lastval;
	    *stream++ = lastval >> 8;
	    source_index = (source_index + 1) & (SOUND_MAX_BUFFER - 1);
	  }
	} // for
	sound_playposition = source_index;
	sound_lastval	     = lastval;
      } // sound_callback
after SDL_OpenAudio i get "Sound #2 could not be enabled" in the shell,
in snoopdos i can see the emu is talking to ahi.
any idea what i have to set additionaly ?

#1) sdl_config_amigaos.h lists:
Code:
/* Enable audio driver (requires threading!) */
#define SDL_AUDIO_DRIVER_AHI	1
is this threading related to SDL_Mutex stuff?

Last edited by emufan; 25 August 2017 at 00:43.
emufan is offline  
Old 24 August 2017, 22:43   #249
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 676
If it is using AHI then you are going to drop performance by an enormous amount. If there is away to use PAULA for audio output then that would be great!
xboxown is offline  
Old 25 August 2017, 00:46   #250
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
i have no idea how to pump data to paula, SDL is a bit easier i think.
for the sake of completeness, i thought enabling it would be good,
may add a switch to enable/disable it, but it should work i think.
emufan is offline  
Old 25 August 2017, 01:10   #251
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 676
So would you be releasing this now to aminet and to the public with the source code inside the package?

emufan, what do you think of porting the latest version of NES to Amiga?
xboxown is offline  
Old 25 August 2017, 01:40   #252
NovaCoder
Registered User
 
NovaCoder's Avatar
 
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,400
Quote:
Originally Posted by emufan View Post
code optimization I cannot do, thats beyond my ability

but I had the impression, using the above options, the example Alf game was alot faster.
still no clue what keys to use to run arround, but moving on screen was really faster.

I'm looking at the missing sound, compared with kegs, and changed some varaible,
but still refuses to work:
Code:
#define SOUND_SAMPLE_RATE 20500 //	44100
#define SOUND_MAX_SAMPLE	2048
#define SOUND_MAX_BUFFER	512 // SOUND_MAX_SAMPLE*8
#define SOUND_MAX_C030_TIMES	18000
...
static SDL_AudioSpec	*sound_desired;
...

	sound_desired = (SDL_AudioSpec *)malloc(sizeof(SDL_AudioSpec));
	if (sound_desired == NULL) {
	  sound_available = 0;		// no sound
          sputs ("Sound could not be enabled");
          printf ("Sound #1 could not be enabled\n");
          return 1;
	}

	sound_desired->freq	= 20500; //SOUND_SAMPLE_RATE;
    sound_desired->format   = AUDIO_S16SYS; //AUDIO_U16
	sound_desired->channels	= 2; // 1
	sound_desired->samples	= 512; //SOUND_MAX_SAMPLE
	sound_desired->callback	= sound_callback;
	sound_desired->userdata	= NULL;

	if ( SDL_OpenAudio(sound_desired, NULL /*sound_obtained*/) < 0 ) {
	  sound_available = 0;		// no sound
          sputs ("Sound could not be enabled");
          printf ("Sound #2 could not be enabled\n");
          return 1;
	}
...
static void sound_callback(void *userdata, Uint8 *stream, int len) {
	register unsigned int i;
	register unsigned int source_index;
	register unsigned int compare_index;
	register unsigned int lastval;

	source_index = sound_playposition;
	compare_index = sound_addposition;
	lastval = sound_lastval;
	for (i=SOUND_MAX_SAMPLE; i; i--) {
	  if (source_index == compare_index) {
	    *stream++ = lastval;	// silence
	    *stream++ = lastval >> 8;	// silence
	  }
	  else {
	    lastval   = sound_buffer[source_index];
	    *stream++ = lastval;
	    *stream++ = lastval >> 8;
	    source_index = (source_index + 1) & (SOUND_MAX_BUFFER - 1);
	  }
	} // for
	sound_playposition = source_index;
	sound_lastval	     = lastval;
      } // sound_callback
after SDL_OpenAudio i get "Sound #2 could not be enabled" in the shell,
in snoopdos i can see the emu is talking to ahi.
any idea what i have to set additionaly ?

#1) sdl_config_amigaos.h lists:
Code:
/* Enable audio driver (requires threading!) */
#define SDL_AUDIO_DRIVER_AHI	1
is this threading related to SDL_Mutex stuff?
Hiya,

Upload your latest workspace and I'll have a go a optimize it for the real deal (or just bugger it up completely )

Are you using my old AGA SDL to build this thing or Bernard's even older RTG SDL?

AHI is not as slow as people think it is, you just have to configure your Amiga properly to use it

[ Show youtube player ]

Using native Paula will always be quicker of course but it's not a big difference.
NovaCoder is offline  
Old 25 August 2017, 01:47   #253
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
hey Nova

i'll upload what i have, using rtg sdl based on SDL-Amiga - there were some undefinied things,
so i rebuild it. will include the src of "my" version.

#1) zoned: SDDApple-AmiDevCpp.zip
folders
SDDApple: the current src ( project file sddapple.dev)
SDL: includes and lib
SDL-AmigaSrc: src of current rtg sdl, Makefile.cross with compiler of AmiDevCpp


#2) btw: updated 680x0 builds - too much debuging output, when it does "sound clicks". whatever those sound clicks are

zoned: SDDApple_680x0-WIP.lha

Last edited by emufan; 25 August 2017 at 02:01.
emufan is offline  
Old 25 August 2017, 02:04   #254
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 676
Quote:
Originally Posted by NovaCoder View Post
Hiya,

Upload your latest workspace and I'll have a go a optimize it for the real deal (or just bugger it up completely )

Are you using my old AGA SDL to build this thing or Bernard's even older RTG SDL?

AHI is not as slow as people think it is, you just have to configure your Amiga properly to use it

[ Show youtube player ]

Using native Paula will always be quicker of course but it's not a big difference.

GO CRAZY NOVACODER!!!

xboxown is offline  
Old 25 August 2017, 09:37   #255
drHirudo
Amiga user
 
drHirudo's Avatar
 
Join Date: Nov 2008
Location: Sofia / Bulgaria
Posts: 456
Thumbs up

Quote:
Originally Posted by emufan View Post
i have win7 here, and i abuse cat this way since ever i guess

not much but at least SDDApple is more or less useable.
i "fixed" the asl requester (F1 and F2) to load a diskimage - i think this can
be put into kegs for example.
I've used pretty much the same ASL code in both SDDApple ang KEGS. I was adding ASL requesters to my ports, since it much easier to use with them, than having to manually type RAM:apple2/disk1.dsk for example.
So if you "fixed" the asl requester in SDDApple, you shall be able to use it in KEGS as well
drHirudo is offline  
Old 25 August 2017, 09:47   #256
drHirudo
Amiga user
 
drHirudo's Avatar
 
Join Date: Nov 2008
Location: Sofia / Bulgaria
Posts: 456
Quote:
Originally Posted by xboxown View Post
Seeing as how we solved the emulation of Apple // SDDApple is now even better than apple 2000e and that is the achievement I wanted to reach anyways.

With this I can play Adventure Construction Set and with Apple2000e it cannot even do that...
SDDApple is one of the crappiest emulator out there. It doesn't support any advanced Apple II cards or features. Currently the best Apple II 8-bit emulator experience that you can get on Amiga is by using ApplePC via PC emulator. I don't know if the Vampire emulates PC fast enough (with PCx or PC-Task), but you shall try it for Double-low res, double hi-res games and extra memory. Here is a video of me demonstrating ApplePC on AmigaOS 4.
[ Show youtube player ]
drHirudo is offline  
Old 25 August 2017, 16:06   #257
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by drHirudo View Post
I've used pretty much the same ASL code in both SDDApple ang KEGS. I was adding ASL requesters to my ports, since it much easier to use with them, than having to manually type RAM:apple2/disk1.dsk for example.
So if you "fixed" the asl requester in SDDApple, you shall be able to use it in KEGS as well
i already thought, it was your SDDApple

i had a problem with IAsl, finaly defined it as a dummy only and removed the IAsl from the function.
then there was the filerequester which wont disapear after choosing a disk, so i exchanged SDL_KEYDOWN and SDL_KEYUP case, and it was working
but it is really a "simple" function, so no problem putting it into another emu, like kegs, where you can only change disks in the config file.

#1) are you able to use 140kb dsk Apple2 files with your kegs version?
do they boot/run, maybe using PR#6 ?

@xboxown: do you have an a600 with vampire?
since i changed some keys to keypad, this would not work, so I have to change them again to some Fx keys.

@NovaCoder: SDDApple compiles with vbcc:
Code:
vc -c99 -DNEWCPU -DREE  main.c cpu.c mem.c disk.c massstor.c dasm.c pixmap.c \
knock.c sound.c libSDL.a libSDL_image.a -lauto -o SDDApple68k.exe
just one include fcntl.h removed, replaced some "//" and
changed "O_RDONLY : O_RDWR" to "0 : 1"
some unresolved references when linking, I could not fix, maybe you can.
the idea was, vbcc may produce more optimized code, faster emulation.

Last edited by emufan; 25 August 2017 at 16:32.
emufan is offline  
Old 25 August 2017, 16:29   #258
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 676
Quote:
Originally Posted by emufan View Post
i already thought, it was your SDDApple

i had a problem with IAsl, finaly defined it as a dummy only and removed the IAsl from the function.
then there was the filerequester which wont disapear after choosing a disk, so i exchanged SDL_KEYDOWN and SDL_KEYUP case, and it was working
but it is really a "simple" function, so no problem putting it into another emu, like kegs, where you can only change disks in the config file.

#1) are you able to use 140kb dsk Apple2 files with your kegs version?
do they boot/run, maybe using PR#6 ?

@xboxown: do you have an a600 with vampire?
since i changed some keys to keypad, this would not work, so I have to change them again to some Fx keys.

@NovaCoder: SDDApple compiles with vbcc:
Code:
vc -c99 -DNEWCPU -DREE  main.c cpu.c mem.c disk.c massstor.c dasm.c pixmap.c \
knock.c sound.c libSDL.a libSDL_image.a -lauto -o SDDApple68k.exe
some unresolved references when linking, I could not fix, maybe you can.
the idea was, vbcc may produce more optimized code, faster emulation.
I only have an Amiga 500 with vampire
xboxown is offline  
Old 25 August 2017, 16:35   #259
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by xboxown View Post
I only have an Amiga 500 with vampire
ah, ok, but changing the keys makes sense for A600 users

do those keypad keys work "-" "+" "/" "*" "ralt +" ralt -"?
should give response in bottom line of emulator window.

#1) amiga got alt keys? *re-added*

Last edited by emufan; 25 August 2017 at 16:41.
emufan is offline  
Old 25 August 2017, 16:39   #260
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 676
Amiga do have alt key. All the keys above mentioned should work.

xboxown 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
Porting SDL2 to Amiga copse request.Other 3 30 November 2017 17:46
Porting an Amiga game to PC CYBER_SLUNK Coders. General 4 31 January 2017 19:14
Porting Photoshop to Amiga KONEY Coders. General 25 29 December 2016 23:49
Porting PhotoChrome ST/e to Amiga. pandy71 request.Other 0 09 February 2015 15:12
Porting Qt Framework to Amiga OS enviroments Pyromania Coders. General 2 24 July 2013 06:42

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 01:07.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.13288 seconds with 16 queries