Re:Why MacPaint's Original Canvas was 416 Pixels Wide
by klodolph on Monday December 30, 2013 @03:29AM
(#6983693)
> In addition, there's no reason why one MOVEM can't contain data from multiple rows.
The screen buffer is 512x384 (24.5 KB, not 10.4 KB), so you have to copy one row at a time. The source and destination pointers have to increment by different amounts after each row (13 and 16 words, respectively). See the following lines in the article's assembly:
ADD #52, A0
ADD screenRow, A1
screenRow must be defined to 64.
Re:Why MacPaint's Original Canvas was 416 Pixels Wide
by teamonkey on Monday December 30, 2013 @10:37AM
(#6984988)
A fair point, although I think the M68K was fast enough to copy the remaining pixels with a few MOVE.L calls if need be.
[Edit] by which I mean, yes, you're right that the MOVEM can't cross line boundaries in this case, but the CPU should be fast enough to deal with longer lines by using a MOVEM and adding a few extra MOVEs to copy individual longwords. Shorter lines would simply require using fewer registers in the MOVEM.
Re:Why MacPaint's Original Canvas was 416 Pixels Wide
by kalleboo on Monday December 30, 2013 @09:11AM
(#6984640)
> I suspect the real reason for this weird resolution is boring memory constraints.
Things were indeed very tight
http://www.folklore.org/StoryView.py?story=MacPaint_Evolutio...
At the worst case, there was only
about 100 bytes free in MacPaint's heap
Re:Why MacPaint's Original Canvas was 416 Pixels Wide
by gaius on Monday December 30, 2013 @09:24AM
(#6984684)
The finished MacPaint consisted of 5,804 lines of Pascal code, augmented by another 2,738 lines of assembly language, which compiled into less than .05 megabytes of executable code
To put that into perspective, the date command alone on this Linux box is 49k.
Re:Why MacPaint's Original Canvas was 416 Pixels Wide
by colomon on Monday December 30, 2013 @10:17AM
(#6984910)
The one that breaks me is the Clock application on my Android phone is using 20.29 MB of the phone's memory at the moment. What could it possibly be doing to justify that?
Re:Why MacPaint's Original Canvas was 416 Pixels Wide
by ChickeNES on Monday December 30, 2013 @02:49PM
(#6986463)
Actually, screen RAM on the original Mac is not contiguous. The last byte on each "line" is used to provide 8 bit PWM sound. As each line is drawn on the screen the last byte in that "line" is sent to the digital to analog convertor instead of to the rasterizer.
In addition, there's no reason why one MOVEM can't contain data from multiple rows. For a 640x400 buffer like you find in the ST, each row requires approximately 1.5 MOVEM commands. No problem, since your buffer will have access to contiguous memory. Your second MOVEM call will copy the last half of the 1st row and the first half of the 2nd. Your buffer has to have a horizontal size that is a multiple of 32 pixels, but not 416.
I suspect the real reason for this weird resolution is boring memory constraints. If I'm reading the 68K code correctly, a MacPaint buffer was 416x200 - 10.4k. According to Wikipedia[1] MacPaint used 2 off-screen buffers = 20.8k. The ROM is 68k, then there's probably at least 1 system-reserved screen buffer of 10.4k. The OS has to fit in somewhere. That's quite a lot for a 128K machine.
Find the most comfortable painting layout where the horizontal canvas size is a multiple of 32 pixels and 2 buffers fit within 21k.
[1] http://en.wikipedia.org/wiki/Macpaint