Previous Thread
Next Thread
Print Thread
Page 2 of 4 1 2 3 4
Joined: Feb 2014
Posts: 1,184
Likes: 218
G
Very Senior Member
Very Senior Member
G Offline
Joined: Feb 2014
Posts: 1,184
Likes: 218
ok, after getting the compumate to work, I thought why not see if I could get the cassette running?

taking the cassette code from the apf and patching it in and after a day of trying to figure out why it didn't work



[Linked Image from i.imgur.com]

[Linked Image from i.imgur.com]


[Linked Image from i.imgur.com]

[Linked Image from i.imgur.com]

Joined: Feb 2014
Posts: 1,184
Likes: 218
G
Very Senior Member
Very Senior Member
G Offline
Joined: Feb 2014
Posts: 1,184
Likes: 218
Testing out the cassette on the Compumate, saving/loading basic programs seems to work, saving/loading pictures and saving/loading music seems to work.

(The Compumate has 3 different modes, basic, graphics and music mode.

[Linked Image from i.imgur.com]

(loaded from a saved cassette picture)

[Linked Image from i.imgur.com]

(loaded from a saved music file)

One thing I think that the Compumate could have done was to allow assembly language programs to be loaded into the 2k memory, like the Commavid Magicard. That would have been interesting.


Recently, I've been hearing about the Frob which was a development system for the 2600 which had 4k of memory and hooked up to the Apple II. You could write the 4k ram from the Apple II and then let the Atari 2600 have access. It could also pass data back and forth between the Apple and the 2600. I've been thinking about how to do something like that in mame, converting the a2600 into an apple slot card.

1 member likes this: =CO=Windler
Joined: Jan 2021
Posts: 193
Likes: 10
=
Senior Member
Senior Member
= Offline
Joined: Jan 2021
Posts: 193
Likes: 10
Originally Posted by Golden Child
One thing I think that the Compumate could have done was to allow assembly language programs to be loaded into the 2k memory, like the Commavid Magicard. That would have been interesting.

As a kid I expected the Compumate to be crippled by design with intentionally blocking joystick ports and lacking machine code support (unlike my ZX81 it had no poke, peek, usr) due to somekind of contract with Atari to prevent hobbyists from making actual games for the 2600 that could potentially compete with commercial ones. (Much later Apple banned from their appstores everything that could load external code (including C64 emulators) to protect the monopoly on selling iPhone software.)

But may be they just cheapened the thing with simplified hardware (blocking joyports as address lines, keeping BASIC rom smaller), much like most toy laptops did and so prevented hobbyists from serious programming on it. The atrocious manual of the Sound FX Phasor shows what attitude electronic toy companies had.

https://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=121640#Post121640

Last edited by =CO=Windler; 04/10/25 02:49 AM.

MAY THE SOFTWARE BE WITH YOU!

{weltenschule.de}
Joined: Feb 2014
Posts: 1,184
Likes: 218
G
Very Senior Member
Very Senior Member
G Offline
Joined: Feb 2014
Posts: 1,184
Likes: 218
[Linked Image from i.imgur.com]

Thought I'd try to see if I could get the frob going, I can get the explorer running, don't know what I'm doing but it does seem to be able to change some of the values.

Joined: Jul 2011
Posts: 171
Likes: 7
T
Senior Member
Senior Member
T Offline
Joined: Jul 2011
Posts: 171
Likes: 7
Originally Posted by Golden Child
[Linked Image from i.imgur.com]

Thought I'd try to see if I could get the frob going, I can get the explorer running, don't know what I'm doing but it does seem to be able to change some of the values.

The Frob support is USEFUL, because I am smack dab in the middle of making a comprehensive deep dive video on it (4+ hrs long), and this makes the interactive portions a whole lot more straightforward!

-Thom

Joined: Feb 2014
Posts: 1,184
Likes: 218
G
Very Senior Member
Very Senior Member
G Offline
Joined: Feb 2014
Posts: 1,184
Likes: 218
Ok, I put up my Frob stuff on a github branch if you'd like to give it a spin.



https://github.com/goldnchild/mame/tree/frob



Once you compile it, then you can add -sl1 frob to put the frob in slot 1 for example.



./mame apple2e -sl1 frob -flop1 FROBDV13.DSK



and once the frob code is loaded, you can use numpad minus to reset the a2600.



Also you may want to turn down your sound (the sliders in mame are useful for this) because the a2600 will screech when you start up.

Joined: Jul 2011
Posts: 171
Likes: 7
T
Senior Member
Senior Member
T Offline
Joined: Jul 2011
Posts: 171
Likes: 7
The Frob even works with the AMON/FMON debugger.

Thank you, this is actually useful, and I will be able to vastly improve the video I am making, because of it.


Joined: Feb 2014
Posts: 1,184
Likes: 218
G
Very Senior Member
Very Senior Member
G Offline
Joined: Feb 2014
Posts: 1,184
Likes: 218
I thought I'd see if I could make the Compumate load a cassette file that's already been converted into binary,

It took a lot of fiddling, but I think I've finally got it!

Using the Apf as a model,

Code
static int compumate_output_bit(int16_t *buffer, int sample_pos, bool bit)
{
	int samples = 0;
	int samples_per[] = {8, 5};  // 10,5 works, 8,5 is close to actual timing (samples per half cycle)
	int cycles_per[] = {1, 2};   // compumate has 1 cycle for a 0 bit, 2 cycles for a 1 bit

	for (int i = 0; i < cycles_per[bit]; i++)
	{
		samples += compumate_put_samples(buffer, sample_pos + samples, samples_per[bit], WAVEENTRY_LOW);
		samples += compumate_put_samples(buffer, sample_pos + samples, samples_per[bit], WAVEENTRY_HIGH);
	}
	return samples;
}

static int compumate_output_byte(int16_t *buffer, int sample_pos, uint8_t byte)
{
	int samples = 0;
	uint8_t i;

	samples += compumate_output_bit (buffer, sample_pos + samples, 0);  // 1 start bit of zero

	/* data */
	for (i = 0; i<8; i++)
		samples += compumate_output_bit (buffer, sample_pos + samples, ((byte >> i) & 1));

	for (i = 0; i<4; i++)
		samples += compumate_output_bit (buffer, sample_pos + samples, 1);  // 4 stop bits

	return samples;
}





I couldn't figure out what was happening when it didn't work, so I saved out the wave data to examine it in Audacity, importing it as raw data.


Code

static int compumate_bin_handle_cassette(int16_t *buffer, const uint8_t *bytes)
{
	uint32_t sample_count = 0;

	/* start */
	for (int i = 0; i < HEADER_LENGTH; i++)  // roughly 900 bytes of 0xff as header for 10 seconds (can be much much less)
		sample_count += compumate_output_byte(buffer, sample_count, 0xff);

	/* data */
	for (int i = 0; i < compumate_image_size; i++)
	{
		sample_count += compumate_output_byte(buffer, sample_count, bytes[i]);
	}	

	if (buffer)
	{
		FILE* fp=fopen("RAWDATA","wb");
		if(fp)
		{	
			fwrite(buffer,sample_count*2,1,fp);
			fclose(fp);
		}
	}
	return sample_count;
}





[Linked Image from i.imgur.com]


Then I could compare it to data that was saved out by the compumate.

Comparing an actual save (top) with the generated wave data (bottom):

(start bit) 0 (end start) (data, lsb first) 1 1 0 0 1 0 1 0 (stop bits begin) 1 1 1 1 (stop bits end)

[Linked Image from i.imgur.com]

Last edited by Golden Child; 04/20/25 03:02 AM.
1 member likes this: =CO=Windler
Joined: Jan 2021
Posts: 193
Likes: 10
=
Senior Member
Senior Member
= Offline
Joined: Jan 2021
Posts: 193
Likes: 10
The datasette frequency/pitch seems to differ. Is perhaps one version PAL and the other NTSC with a different quartz?


MAY THE SOFTWARE BE WITH YOU!

{weltenschule.de}
Joined: Feb 2014
Posts: 1,184
Likes: 218
G
Very Senior Member
Very Senior Member
G Offline
Joined: Feb 2014
Posts: 1,184
Likes: 218
The difference between the NTSC and PAL a2600 is < 1%.

One of the things that makes it look different is that the top track is 44100 and the lower track is 22050 and that can make it not quite line up graphically.

It's close, but not 100% exact.

I wanted to use round numbers, to get it 100% exact I'd have to go to floating point numbers or keep track of fractional parts.

The 1 bits are probably just a bit too long and the 0 bits are probably a bit too short.


Over a typical load, the difference in length is < 1%.

[Linked Image from i.imgur.com]


(on this picture, the top is 44100 that is an actual save, the second track is 22050, and the third track is 11025, the length difference is 16.204 versus 16.140 seconds)

Last edited by Golden Child; 04/20/25 08:58 AM.
Page 2 of 4 1 2 3 4

Link Copied to Clipboard
Who's Online Now
4 members (yugffuts, R. Belmont, Reznor007, Augusto), 128 guests, and 3 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,363
Posts122,479
Members5,082
Most Online1,283
Dec 21st, 2022
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Powered by UBB.threads™ PHP Forum Software 8.0.0