gpt4 book ai didi

graphics - 有没有办法从 Applesoft Basic 访问 Apple 2 上的 DHR

转载 作者:行者123 更新时间:2023-12-02 00:39:05 26 4
gpt4 key购买 nike

在带有 80 列卡的 Apple 2 上使用 Applesoft Basic 时,是否可以仅使用 POKE 创建 DHR 图形?

我找到了许多使用第三方扩展的解决方案,例如 Beagle Graphics ,但我真的很想自己实现它。我搜索了我的 Nibble 杂志收藏和基本书籍,但找不到任何详细信息。

维基百科:

Double High-Resolution The composition of the Double Hi-Res screen is very complicated. In addition to the 64:1 interleaving, the pixels in the individual rows are stored in an unusual way: each pixel was half its usual width and each byte of pixels alternated between the first and second bank of 64KB memory. Where three consecutive on pixels were white, six were now required in double high-resolution. Effectively, all pixel patterns used to make color in Lo-Res graphics blocks could be reproduced in Double Hi-Res graphics. The ProDOS implementation of its RAM disk made access to the Double Hi-Res screen easier by making the first 8 KB file saved to /RAM store its data at 0x012000 to 0x013fff by design. Also, a second page was possible, and a second file (or a larger first file) would store its data at 0x014000 to 0x015fff. However, access via the ProDOS file system was slow and not well suited to page-flipping animation in Double Hi-Res, beyond the memory requirements.

维基百科说 DHR 使用 64:1 隔行扫描,但没有给出实现的引用。此外,维基百科说您可以使用/RAM 磁盘进行访问,但同样没有提供实现引用。

我正在编写一个小程序来绘制 Connet 圆圈模式的简单版本。速度并不像分辨率那么重要。

最佳答案

comp.sys.apple2.programmer 的一名成员回答了我的问题:http://groups.google.com/group/comp.sys.apple2.programmer/browse_thread/thread/b0e8ec8911b8723b/78cd953bca521d8f

基本上,您从 80 列卡映射到辅助内存中。然后在 HR 屏幕上绘制并戳到您要调亮/调暗的像素的 DHR 内存位置。

最好的完整例程是:

  5 HGR : POKE 49237,0 : CALL 62450 : REM clear hires then hires.aux 
6 POKE 49246,0 : PG = 49236
7 SVN = 7 : HCOLOR= SVN : P5 = .5
9 GOTO 100
10 X2 = X * 4 : CL = CO : TMP = 8 : FOR I = 3 TO 0 STEP -1 : BIT = CL >= TMP:
CL = CL - BIT * TMP : TMP = TMP * P5
20 X1 = X + I: HCOLOR= SVN * BIT
30 XX = INT (X1 / SVN): H = XX * P5: POKE PG + (H= INT (H)),0
40 XX = INT (( INT (H) + (( X1 / SVN) - XX)) * SVN + P5)
50 HPLOT XX,Y: POKE PG, 0: NEXT : RETURN
100 FOR CO = 0 TO 15 : C8 = CO * 8
110 FOR X = C8 TO C8 + SVN: FOR Y = 0 TO 10 : GOSUB 10 : NEXT : NEXT
120 NEXT
130 REM color is 0 to 15
140 REM X coordinate is from 0 to 139
150 REM Y coordinate is from 0 to 191

关于graphics - 有没有办法从 Applesoft Basic 访问 Apple 2 上的 DHR,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3390066/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com