Megalextoria
Retro computing and gaming, sci-fi books, tv and movies and other geeky stuff.

Home » Digital Archaeology » Computer Arcana » Apple » Apple II » Hires Bit Twiddler trivial app for editing two byte hires patterns
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Hires Bit Twiddler trivial app for editing two byte hires patterns [message #366549] Sat, 21 April 2018 10:06 Go to next message
sicklittlemonkey is currently offline  sicklittlemonkey
Messages: 570
Registered: October 2012
Karma: 0
Senior Member
Ok, this is almost pointless, since most of us surely wrote such things
as teens back in the day. But since I felt the need to write it, I thought
I may as well post it to the internet, where one day, someone might find it
useful or interesting. And this would be the place. ; - )

8000:20 2F FB 20 B7 80 20 E2 F3 A9 00 A8 85 02 A9 20
8010:85 03 A2 20 A5 00 91 02 C8 A5 01 91 02 C8 D0 F4
8020:E6 03 CA D0 EF 86 24 A9 15 85 25 A5 00 20 92 80
8030:A5 01 20 92 80 AD 00 C0 10 FB 8D 10 C0 C9 9B D0
8040:03 4C 2F FB C9 89 B0 16 29 0F 0A AA F0 02 CA CA
8050:BD DD 80 85 00 E8 BD DD 80 85 01 4C 09 80 C9 A0
8060:D0 0B A5 00 A6 01 85 01 86 00 4C 09 80 C9 D9 B0
8070:C4 C9 B8 08 29 0F A8 90 01 88 A9 01 88 30 03 0A
8080:D0 FA 28 B0 06 45 00 85 00 90 04 45 01 85 01 4C
8090:09 80 85 04 A9 80 AA 25 04 F0 04 A9 B1 D0 02 A9
80A0:B0 20 ED FD 8A 4A D0 EE A9 A0 20 ED FD A5 04 20
80B0:DA FD A9 A0 4C ED FD A2 00 A0 17 BD C6 80 20 ED
80C0:FD E8 88 D0 F6 60 8D 8D B7 B6 B5 B4 B3 B2 B1 B0
80D0:A0 A0 A0 A0 C8 C7 C6 C5 C4 C3 C2 C1 8D 00 00 2A
80E0:55 55 2A 7F 7F 80 80 AA D5 D5 AA FF FF
8000G

Instructions:
It edits the bytes in $00 and $01 and fills the hires screen with them.
The bits are shown, and the keys to toggle the bits are printed above them.
So 7 to 0 toggle the bits in byte 0, and H to A toggle the bits in byte 1.
Ctrl-A to Ctrl-H set the bytes to hires colours 0 to 7, Space swaps the
bytes, and Esc exits. Then if you like you can change $00 or $01 and
restart with 8000G.

The reason for it is this question:
https://retrocomputing.stackexchange.com/q/6271/71
My answer has a screenshot of it:
https://retrocomputing.stackexchange.com/a/6309/71

Cheers,
Nick.
Re: Hires Bit Twiddler trivial app for editing two byte hires patterns [message #366550 is a reply to message #366549] Sat, 21 April 2018 11:48 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: John Brooks

On Saturday, April 21, 2018 at 7:06:43 AM UTC-7, Nick Westgate wrote:
> Ok, this is almost pointless, since most of us surely wrote such things
> as teens back in the day. But since I felt the need to write it, I thought
> I may as well post it to the internet, where one day, someone might find it
> useful or interesting. And this would be the place. ; - )
>
> 8000:20 2F FB 20 B7 80 20 E2 F3 A9 00 A8 85 02 A9 20
> 8010:85 03 A2 20 A5 00 91 02 C8 A5 01 91 02 C8 D0 F4
> 8020:E6 03 CA D0 EF 86 24 A9 15 85 25 A5 00 20 92 80
> 8030:A5 01 20 92 80 AD 00 C0 10 FB 8D 10 C0 C9 9B D0
> 8040:03 4C 2F FB C9 89 B0 16 29 0F 0A AA F0 02 CA CA
> 8050:BD DD 80 85 00 E8 BD DD 80 85 01 4C 09 80 C9 A0
> 8060:D0 0B A5 00 A6 01 85 01 86 00 4C 09 80 C9 D9 B0
> 8070:C4 C9 B8 08 29 0F A8 90 01 88 A9 01 88 30 03 0A
> 8080:D0 FA 28 B0 06 45 00 85 00 90 04 45 01 85 01 4C
> 8090:09 80 85 04 A9 80 AA 25 04 F0 04 A9 B1 D0 02 A9
> 80A0:B0 20 ED FD 8A 4A D0 EE A9 A0 20 ED FD A5 04 20
> 80B0:DA FD A9 A0 4C ED FD A2 00 A0 17 BD C6 80 20 ED
> 80C0:FD E8 88 D0 F6 60 8D 8D B7 B6 B5 B4 B3 B2 B1 B0
> 80D0:A0 A0 A0 A0 C8 C7 C6 C5 C4 C3 C2 C1 8D 00 00 2A
> 80E0:55 55 2A 7F 7F 80 80 AA D5 D5 AA FF FF
> 8000G
>
> Instructions:
> It edits the bytes in $00 and $01 and fills the hires screen with them.
> The bits are shown, and the keys to toggle the bits are printed above them.
> So 7 to 0 toggle the bits in byte 0, and H to A toggle the bits in byte 1.
> Ctrl-A to Ctrl-H set the bytes to hires colours 0 to 7, Space swaps the
> bytes, and Esc exits. Then if you like you can change $00 or $01 and
> restart with 8000G.
>
> The reason for it is this question:
> https://retrocomputing.stackexchange.com/q/6271/71
> My answer has a screenshot of it:
> https://retrocomputing.stackexchange.com/a/6309/71
>
> Cheers,
> Nick.

BTW: the commonly-used secondary NTSC colors are hard to see in 2 bytes since they require long dither patterns.

The title screen of Rescue Raiders or Bard's Tale have good examples of secondary NTSC colors via HGR dithering.

-JB
@JBrooksBSI
Hires Bit Twiddler trivial app for editing two byte hires patterns [message #366558 is a reply to message #366549] Sat, 21 April 2018 13:41 Go to previous messageGo to next message
Michael AppleWin Debu is currently offline  Michael AppleWin Debu
Messages: 1262
Registered: March 2013
Karma: 0
Senior Member
Nice little utility Nick!

I'm biased but I would also recommend my two graphical bit editors, HGRBYTE and DHGRBYTE, for manual graphics bit manipulation of HGR and DHGR respectively.
https://github.com/Michaelangel007/apple2_hgrbyte

IJKL = cursor movement
00 =
Shift-# to toggle bit #.
Re: Hires Bit Twiddler trivial app for editing two byte hires patterns [message #366574 is a reply to message #366550] Sat, 21 April 2018 16:23 Go to previous messageGo to next message
sicklittlemonkey is currently offline  sicklittlemonkey
Messages: 570
Registered: October 2012
Karma: 0
Senior Member
On Sunday, 22 April 2018 03:48:53 UTC+12, John Brooks wrote:
> BTW: the commonly-used secondary NTSC colors are hard to see in 2 bytes since they require long dither patterns.

Thanks John. I wrote plenty of graphics routines using dithered fill etc
(for my graphic adventure - What else? ; - ) as a young teen.

Then again I grew up with RGB, then a PAL //e, which differ from NTSC.

Cheers,
Nick.
Re: Hires Bit Twiddler trivial app for editing two byte hires patterns [message #366575 is a reply to message #366558] Sat, 21 April 2018 16:29 Go to previous messageGo to next message
sicklittlemonkey is currently offline  sicklittlemonkey
Messages: 570
Registered: October 2012
Karma: 0
Senior Member
On Sunday, 22 April 2018 05:41:13 UTC+12, Michael 'AppleWin Debugger Dev' wrote:
> I'm biased but I would also recommend my two graphical bit editors, HGRBYTE and DHGRBYTE, for manual graphics bit manipulation of HGR and DHGR respectively.

Nice one Michael. I should have guessed you would have done something similar.

I was even going to use Shift-# like you to toggle bits, but then I realised
it would be different on real Apple II's, e.g. Shift-2 being @ vs " etc.
And it needed to edit two bytes simultaneously and fill the whole screen.

Very specific to this Q&A, but I thought I'd share.

Cheers,
Nick.
Re: Hires Bit Twiddler trivial app for editing two byte hires patterns [message #366578 is a reply to message #366575] Sat, 21 April 2018 17:56 Go to previous messageGo to next message
Michael AppleWin Debu is currently offline  Michael AppleWin Debu
Messages: 1262
Registered: March 2013
Karma: 0
Senior Member
> I should have guessed you would have done something similar.

:-)

> I was even going to use Shift-# like you to toggle bits, but then I realised
> it would be different on real Apple II's

Yeah, I noticed that problem too with my versions. :-/

On the plus side both of my utilities support hex input (appending to last byte), making it super fast to enter in bytes. (Something I wish sector editors would support)

Your idea of using A .. H for the 2nd byte is quite good! I might have to borrow that! :-) If I'm not mistaken I think I may have some unused keys left -- the bottom keys: ZXCVBNM are free. Sadly the 8th hi-bit key would use ',' which is already mapped to "Shift Byte left" -- but still, and extra 7-bit toggles for the adjacent byte would be super convenient.

Have you considered maybe using the (middle) home row instead ASDFGHJK ?

(I'll try to provide a patch later.)

P.S.
This will mark up the data (keys) in AppleWin:

ASC 80C6:80D3
ASC 80D4:80DC
Re: Hires Bit Twiddler trivial app for editing two byte hires patterns [message #366591 is a reply to message #366549] Sat, 21 April 2018 23:26 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: frank_o_rama

Interesting program.

Alternating the "C4" and "44" combo seems to give some interesting yellows/blues and browns/magentas that aren't typically associated with the HGR palette.

76543210 HGFEDCBA
01000100 44 11000100 C4

f
Re: Hires Bit Twiddler trivial app for editing two byte hires patterns [message #366593 is a reply to message #366574] Sun, 22 April 2018 00:34 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: John Brooks

On Saturday, April 21, 2018 at 1:23:46 PM UTC-7, Nick Westgate wrote:
> On Sunday, 22 April 2018 03:48:53 UTC+12, John Brooks wrote:
>> BTW: the commonly-used secondary NTSC colors are hard to see in 2 bytes since they require long dither patterns.
>
> Thanks John. I wrote plenty of graphics routines using dithered fill etc
> (for my graphic adventure - What else? ; - ) as a young teen.
>
> Then again I grew up with RGB, then a PAL //e, which differ from NTSC.
>
> Cheers,
> Nick.

> Then again I grew up with RGB, then a PAL //e, which differ from NTSC.

I meant that Apple II game artists would hand-dither to get secondary NTSC colors like yellow, brown, pink, and dark green.

BTW: The IIGS is not capable of generating secondary NTSC colors correctly, either via RGB output or the composite output.

-JB
Re: Hires Bit Twiddler trivial app for editing two byte hires patterns [message #366607 is a reply to message #366575] Sun, 22 April 2018 11:02 Go to previous messageGo to next message
Michael AppleWin Debu is currently offline  Michael AppleWin Debu
Messages: 1262
Registered: March 2013
Karma: 0
Senior Member
Nick,

Here is the patch I mentioned to use the middle home keys A..K for the second byte.

Binary:

806D:4C F0 80
80D4:CB CA C8 C7 C6 C4 D3 C1
80F0:A0 07 D9 D4 80 F0 10 88 10 F8 A0 07 D9 C8 80 F0
8100:09 88 10 F8 4C 09 80 38 B0 01 18 98 49 FF 29 07
8110:A8 08 4C 7A 80


Source:
ORG $80F0

LDY #$7
FindKey2
CMP $80D4,Y
BEQ Byte2
DEY
BPL FindKey2

LDY #$7
FindKey1
CMP $80C8,Y
BEQ Byte1
DEY
BPL FindKey1
JMP $8009

Byte2
SEC ; Flag: A XOR Byte $01
BCS Trampoline
Byte1
CLC ; Flag: A XOR Byte $00
Trampoline
TYA
EOR #$FF
AND #$07
TAY
PHP
JMP $807A


AppleWin markup text input commands:

ASC 80C6:80C7
ASC 80C8:80CF
ASC 80D0:80D3
ASC 80D4:80DB

Cheers
Michael
Re: Hires Bit Twiddler trivial app for editing two byte hires patterns [message #366608 is a reply to message #366591] Sun, 22 April 2018 11:12 Go to previous messageGo to next message
Michael AppleWin Debu is currently offline  Michael AppleWin Debu
Messages: 1262
Registered: March 2013
Karma: 0
Senior Member
Frank,

There is *also* 2-consecutive scanline dithering as well on some CRTs / TVs.

i.e. It IS possible to get yellow by mixing these 2 scanlines:

a) Row 1: Green
b) Row 2: Orange

e.g.

10 HGR
20 FOR Y=0 TO 63:FOR X=0 TO 7
30 HCOLOR=INT(Y/8)
31 HPLOT X*32,Y*2 TO X*32+30,Y*2
32 HCOLOR=X
33 HPLOT X*32,Y*2+1 TO X*32+30,Y*2+1
40 NEXT:NEXT

You can see my notes on AppleWin issue #502
https://github.com/AppleWin/AppleWin/issues/502

And a picture of real hardware:
https://user-images.githubusercontent.com/7876796/31980070-0 08b38f4-b8ff-11e7-8cd3-b13d1b981c3a.jpg

These quirks are what we love/hate about the Apple 2 graphics. :-)
Re: Hires Bit Twiddler trivial app for editing two byte hires patterns [message #366616 is a reply to message #366608] Sun, 22 April 2018 13:45 Go to previous message
Anonymous
Karma:
Originally posted by: frank_o_rama

Yes I think I had the hex codes wrong for yellow above, as well. Seems to happen everytime I stray from AppleWin and try things out on Virtual ][ instead. :)

F

On Sunday, April 22, 2018 at 8:12:02 AM UTC-7, Michael 'AppleWin Debugger Dev' wrote:
> Frank,
>
> There is *also* 2-consecutive scanline dithering as well on some CRTs / TVs.
>
> i.e. It IS possible to get yellow by mixing these 2 scanlines:
>
> a) Row 1: Green
> b) Row 2: Orange
>
> e.g.
>
> 10 HGR
> 20 FOR Y=0 TO 63:FOR X=0 TO 7
> 30 HCOLOR=INT(Y/8)
> 31 HPLOT X*32,Y*2 TO X*32+30,Y*2
> 32 HCOLOR=X
> 33 HPLOT X*32,Y*2+1 TO X*32+30,Y*2+1
> 40 NEXT:NEXT
>
> You can see my notes on AppleWin issue #502
> https://github.com/AppleWin/AppleWin/issues/502
>
> And a picture of real hardware:
> https://user-images.githubusercontent.com/7876796/31980070-0 08b38f4-b8ff-11e7-8cd3-b13d1b981c3a.jpg
>
> These quirks are what we love/hate about the Apple 2 graphics. :-)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Create new partition on hard drive in ProDOS
Next Topic: DMS Electronics C12 RGB Colour Card
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Apr 25 06:22:59 EDT 2024

Total time taken to generate the page: 0.01630 seconds