Tumgik
#might redraw and turn it into a mini print
ni053791 · 8 months
Text
Tumblr media
5:00 am
1K notes · View notes
atariaction · 5 years
Text
Mini Character Editor: BASIC Tenliners Contest 2019 entry
Tumblr media
One of the great features of the Atari computers was the ability to redefine the character set. Normally, the character set — the collection of letters, numbers, punctuation, and special symbols that the computer can display — is pulled from ROM, where it can’t be changed. But the Atari had the ability to look elsewhere in memory for the character set. Using that feature, you could create customized characters, put them in RAM, then tell the computer to use your custom character set. With that, you might change the standard letter A into a fancy script A, or into a little spaceship.
Back in the day most of us used Atari BASIC, and you could tell when a game was going to use a custom character set: PLEASE WAIT. When that message appeared, it would mean a delay of 30 to 40 seconds while the program copied the character set from ROM to RAM. Actually installing custom characters was very fast; the slow-verhead was in BASIC copying the whole set around memory. If a programmer was sophisticated enough to write a machine language subroutine, the same job could be done in a fraction of a second. I certainly wasn’t, and apparently neither were most of the programmers who had type-in games published in Compute!, Antic, and other computer magazines.
Happily, TurboBASIC XL has a memory move command, which does same work with the speed of machine language, removing the interminable wait to copy characters around.
Here’s how I set up a custom character set in another program I wrote, Poke Pig:
CH=(PEEK(106)-16)*256:’Define a chunk of RAM under the “top” of BASIC’s memory space. This is enough space to hold the character set. The memory location of the start of that space is put into variable CH.
MOVE 57344,CH,1024:’Copy the character set from its location in ROM (it starts at 57344 and is 1024 bytes) to the space we set aside in RAM. This is the part that used to take 30-40 seconds.
DIM F$(8):’This program only defines one special character, which will replace the # character. We’ll put the data for this character in F$. We need 8 bytes for that character data. Changing two characters would take 16 bytes, and so on.
F$="\E7\DB\81\42\99\99\42\3C":'Here’s the data for the new # character. Here it’s a bunch of hex numbers. In the listing that will be represented by a mess of eight ATASCII characters. The Mini Character Editor program generates these hex numbers (and the ATASCII version) based on your drawing.
MOVE ADR(F$),CH+24,8:’Copy the custom character, in F$, which is 8 bytes, replacing the # character, which is located at CH+24.
POKE 756,CH/256:’Tell the computer to start using our copy of the character set instead of the official ROM version.
So, that mess of hex codes in F$. Each hex number represents one row in the eight lines of a character. Normally I would draw the 8x8 character on graph paper, then convert each row to its binary number, then convert that number to its hex or ATASCII equivalent.
The Mini Character Editor program lets you draw a character using the joystick, see it instantly in the Atari’s five graphics modes (BASIC modes 0,1, 2, 4 and 5), and see the hex code and ATASCII string so you can install that graphic in your own program.
In addition to drawing with the joystick, there are four keyboard commands for manipulating the graphic: H for horizontal flip, V for vertical flip, D to move everything down one line, R to move everything right one space.
When you’re ready to install the graphic in your own program, copy down the hex numbers by hand (there are only 8 of them!) or BREAK out the program and type_ ?A$_ to get the ATASCII version to export into your program. 
Mini Character Editor fits in ten 120-character lines. Because it is not a game, i qualifies for the WILD category of the 10-line BASIC contest. I think it’s my first program to use a custom display list, which I (re?)learned about from the book The Creative Atari.
Here's the code:
'mini character editor 'Feb 3 2019 by @KevinSavetz 'use joystick to design a character set character 'H=horizontal flip, V=vertical flip 'D=move everything down, R=move everything right DIM F$(8),F(9) 'F in the main container for the data of the drawn character. 'F$ contains the data in string format GR.3:POKE 752,1 'start with BASIC mode 3, but we'll tweak that later. Turn off cursor. CH=(PEEK(106)-16)*256 'space for custom character set SC=DPEEK(88) 'top of screen RAM 'set up display list DL=DPEEK(741):'display list POKE DL+16,4:'MODE 4 @ SC+100 POKE DL+17,5:'MODE 5 @ SC+140 POKE DL+18,6:'MODE 6(BASIC MODE 1) @ SC+180 DPOKE DL+19,1799:'2 LINES OF MODE 7(BASIC MODE 2) @ SC+200 & SC+220 DPOKE DL+21,514:'2 LINES OF MODE 2(BASIC MODE 0) @ SC+240 & SC+280 POKE DL+23,0:'skip a line POKE DL+24,2:'2 LINES OF MODE 2(BASIC MODE 0) @ SC+320 & SC+360 FOR I=25 TO 31:POKE DL+I,0:NEXT I:'many blank lines 'print ! characters in the various screen modes FOR I=SC+100 TO SC+280 STEP 40 POKE I,1:POKE I+3,1:POKE I+4,1 NEXT I 'and some more in the text window ?"! ! !! !!!" ?" ! !! !!!" 'install RAM character set MOVE 57344,CH,1024 'replace ! with our custom character MOVE ADR(F$),CH+8,8:POKE 756,CH/256 'draw box around editing window COLOR 3:PLOT 0,0:DRAWTO 9,0:DRAWTO 9,9:DRAWTO 0,9:DRAWTO 0,0 X=1:Y=1 'main loop DO IF R<0:'re-draw contents of editing window FOR J = 1 TO 8:'for each row in the byte... FOR I = 1 TO 8:'look at each bit... COLOR SGN(F(J) & (2^((9-I)-1))) 'set color to 1 if the bit is set, 0 if not PLOT I,J:'draw the bit NEXT I NEXT J ENDIF IF R:'if R<>0, update hex/ATASCII display POKE $57,0:'prepare to print in text window ?CHR$(156);:'clear the text line FOR I=1 TO 8 F$(I,I)=CHR$(F(I)):'copy the data to F$ ?"\";HEX$(F(I));:'show the 8 bytes as hex NEXT I:?" "; FOR I=1 TO 8:'show the 8 bytes as ATASCII IF F(I)<>155 ?CHR$(27);CHR$(F(I));:'normal case ELSE ?" ";:'if character is CR (27) show space instead. CR messes display. ENDIF NEXT I POKE $57,3:'back to drawing in GR.3 MOVE ADR(F$),CH+8,8:'copy the new character to the active character set ENDIF R=0:'redraw defaults to off COLOR SGN(F(Y) & (2^((9-X)-1))): PLOT X,Y:'draw current bit S=STICK(0):'get joystick position Y=Y+((S=13)-(S=14)):'move up/down? X=X+(S=7)-(S=11):'move left/right? IF X<1:X=8:ENDIF:'stay in bounds of the drawning box IF Y<1:Y=8:ENDIF IF X>8:X=1:ENDIF IF Y>8:Y=1:ENDIF P=PEEK(764):'was a key pressed? IF (P=58):'d to move everything down FOR J=9 TO 1 STEP -1:'for each byte F(J)=F(J-1):'copy every byte to next byte. F(9) is temp storage only. NEXT J F(1)=F(9):'move bottom line to top R=-1:'put in order for full redraw ENDIF IF (P=40):'r to move everything right FOR J=1 TO 8:'for each byte Q=F(J) & 1:'copy rightmost bit (LSB) to temporary storage Q F(J)=TRUNC(F(J)/2):'divide byte by 2 to shift bits right F(J)= F(J) + 128*Q:'copy old rightmost bit to leftmost bit NEXT J R=-1:'put in order for full redraw ENDIF IF (P=57):'h for horizontal flip FOR J=1 TO 8:'for each byte Q=0:'working byte FOR I=1 TO 8:'for each bit in the byte Q=Q+(SGN (F(J) & (2^(I-1))) * 2^((9-I)-1)) 'add to working byte: ' SGN [make 0 or 1] ( ' (the current row bitwise-and ' the value of the current bit (1,2,4,8,16...))) ' * the value of the opposite bit (128,64,16,8,4...) 'So: if the 1 bit is on, add 128 to the working byte, 'if the 2 bit is on, add 64 to the working byte, and so on. 'This was not easy to figure out, nor to figure out all over 'again the next day to write these comments NEXT I F(J)=Q:'install reversed byte NEXT J R=-1:'put in order for full redraw ENDIF IF (P=16):'v for vertical flip FOR J=1 TO 4:'for bytes 1 to 4 Q=F(J):'temp copy of byte F(J)=F(9-J):'copy 8 to 1, 7 to 2, 6 to 3, 5 to 4 F(9-J)=Q:'copy 1 to 8, 2 to 7, 3 to 6, 4 to 5 NEXT J R=-1:'put in order for full redraw ENDIF ' there was no room for this, but might be fun to add ' IF (PEEK(764)=45):'t to turn (rotate) ' ENDIF POKE 764,255:'clear keyboard buffer IF(STRIG(0)=0):'if trigger is pressed F(Y) = F(Y) EXOR (2^((9-X)-1)):'toggle current bit R=1:'only redraw hex/atascii PAUSE 4:'slow things down a tad ENDIF COLOR 2:PLOT X,Y:'show cursor PAUSE 4 LOOP
0 notes
Text
“Back in 2002, Steven Appleby inadvertently outed himself in a comic strip about a cross-dressing superhero saving fashion victims from pinstripes and overalls. The strip, published in the Guardian, brought “Dragman” swooping down to earth in a mauve ballgown and yellow wig. Although Appleby had been out for several years to his close friends and family, he realises now that the new character embodied an urge to go further. “I’d had enough of leading a double life. Cross-dressing in secret once or twice a week felt dishonest and stifling,” recalls the 64-year-old artist. “I’d learned to be comfortable with being a transvestite and now I was desperate to live as one.”
Eighteen years later, Dragman is back as the star of his own book. His adventures take him from the tip of the Shard to a fetish club deep beneath London’s railway arches, on the trail of a serial killer who specialises in murdering transvestites. But before he can solve the crimes he has first to overcome the enmity of a superhero community that is not only transphobic but has banned any rescue that is not strictly covered by insurance. By instinctively saving a young girl as she plummets off a rooftop, Dragman has outlawed himself.
Appleby created the book at his studio on a busy south London street, where he opens the door to a colourful gathering. His wife, Nicola Sherring – to whom he remains married though they separated many years ago “as a biblical couple” – is sharing a sandwich with Charlie, a scarlet cockatoo, who sits on her shoulder, watched jealously by Una, an accident-prone one-eyed pug (named from Edward Gorey’s The Gashlycrumb Tinies – “U is for Una who slipped down a drain”). Sherring is responsible for colouring the book while Charlie plays a bit part in it, swooping around a conservatory. “He wasn’t meant to be in it at all, but Nicola sneaked him in, says Appleby, “so I had to redraw a whole spread.”
AdvertisementHide
The relationship between fiction and autobiography is seldom as delicately nuanced as it is in Appleby’s protagonists. Like Dragman’s alter ego August, he discovered his transvestism after trying on a woman’s stocking that he found down the back of a sofa at the age of 19. Like August’s long-suffering wife Mary, Sherring was a carpenter when the couple met. “She came to make bookshelves for my flat and we just got on so well that I kept finding more jobs for her to do, and then we fell in love.”
While August keeps his secret locked up in boxes in the attic, Appleby was honest with Sherring from the start – even though he admits that their marriage involved a certain amount of denial. “I assumed my other issues would fade into the background or even go away, because I certainly hadn’t fallen in love ever before. And so I thought, wow this is amazing, maybe it’s the antidote.”
Sherring already had two sons and they had two more together. When their younger boys were nearring the end of primary school, Appleby felt he had to tell them. “I was feeling increasingly itchy about it – not depressed, but just kind of incomplete,” he says. “I wanted to be a joined-up person and I also didn’t want to have this secret from the family and particularly from my boys.” With a couple of friends, he and Sherring went off to a wig shop. “I wanted something short, so people wouldn’t notice a change, but then I put on this style (he pats his trademark black bob), and all of them said, ‘that’s the one’.”
Back home, his sons “didn’t bat an eyelid. They were probably watching TV or playing computer games.” On a car journey to their Northumberland holiday cottage a while later, a school friend started moaning about how embarrassing her parents were. “I said to them ‘What must I be like?’ And they replied ‘Oh no, Dad, you’re not embarrassing at all. You don’t wear lace dresses to school like you do at night.’”
The cottage, which used to belong to Appleby’s mother, provides a link to his childhood, which was spent in a leaky old vicarage near the Scottish border. He was born in Newcastle upon Tyne, the oldest of four children. His mother was Canadian and his father worked for his family’s quarrying firm, which was slowly going bust. After a local Church of England primary school, where he won prizes for plasticine modelling, he boarded at a Quaker school from the age of 11. “I loathed it to begin with, but in the end I wouldn’t wish it away,” he says. “It’s that mixed thing, because I have huge respect for the Quakers and I still have friends from school.”
He hung out in the art room and got involved in a band, going on to do art and design at Manchester Polytechnic, “mainly because I found art fun, and because my academic subjects weren’t brilliant”. The experience delivered an existential shock. “Suddenly I found lots of people could draw much better than me.” He dropped out for a while to join a band, before returning to do graphic design at Newcastle Polytechnic, followed by illustration at the Royal College of Art, where he was tutored by Quentin Blake. “He taught me that you didn’t have to be a brilliant drawer if your drawings have personality. You can draw a car really badly, as long as it has the spirit of a car.” He flips the book open on a sweetly wonky green Mini, in which Dragman tootles around when he is being August.
AdvertisementHide
This revelation didn’t entirely cure his sense of inadequacy, and he took a job at a design firm, Assorted iMaGes, founded by a college friend, Malcolm Garrett. Together they ran high-profile campaigns for bands such as Buzzcocks and Duran Duran. “Malcolm would design the album covers and I’d do the other things like playing cards or bubblegum cards. It was fun, but after a few years I got frustrated, because you’re doing it for other people.”
One of the first characters he created was Captain Star, an obsolete astronaut stranded on a distant planet with an outsized ego, who was invented for a strip in New Musical Express and went on to become the star of a TV animation series voiced by Richard E Grant and Adrian Edmondson. Commissions from Punch, the Guardian and the Times followed. He collected his work into a series of books that make him appear to be a self-help guru: Normal Sex was followed by Men: The Truth and The Truth About Love. His Loomus cartoons about a small boy and his dysfunctional parents, which ran for 11 years in the Guardian Family section, were published as Steven Appleby’s Guide to Life.
It’s all a question of curation, he says. “So for Normal Sex, I collected everything I’d ever done about sex and divided it into sections.” Published in black and white in 1993, its opening pages are a characteristic mix of awkward truths and absurdist humour: “Some individuals are attracted only to themselves. Other confused people believe they may belong to a hitherto undiscovered sex. Of course creepie-crawlies have sexual worries too. Worms have trouble deciding which end is which …”
Dragman is his first venture into sustained narrative, and it has already been optioned for a live action TV adaptation. In some ways, he says, it’s a strange choice of subject because “I’m not crazy about superheroes at all, but I loved the Batman series that I watched in the 1960s and, looking back, I probably wanted to be Catwoman.” He read the Dandy and the Beano alongside his sister’s comics, Bunty and Diana. “I did move on to superhero comics a bit, but not all that much. Then I got into science fiction. I loved Philip K Dick, particularly, because nothing in his books was ever quite what it appeared to be, and that seemed to be reality to me. Maybe it reflected the secret life that I had.”
Which brings us back to the question of gender. Unlike Dragman, Appleby doesn’t have a transvestite alias, though he lives full-time in woman’s clothes. He briefly investigated gender reassignment but decided against it, citing his encounter with “Colin the mouse man” – a pest-controller – as an example of both the challenges and rewards. “Colin arrived at the door and I opened it and said, ‘Hi. I’m Stephen. I changed my image a few years ago,’ and he laughed, and we had this whole conversation. On his second visit he brought me a couple of leopard print screwdrivers, with little fluffy bits, and said ‘I was given these for Christmas. I thought you might like them.’”
He now lives partly in his studio and partly back at the family home with Sherring and her partner, a son and his girlfriend, a nephew, and, of course, Charlie and Una. Friendship is important to him, cropping up time and again in his professional life. When he wanted to try out the ideas in Dragman, it was to a member of his old school band that he turned.
The book is full of Appleby’s unique brand of punning fun. If it has a message, it’s that it pays to be honest, and capitalism isn’t honest: it steals souls. Its warning is knitted into a plot that is indebted to hard-boiled detective fiction and soap opera, as well as to his own experience of the cross-dressing scene.
“I would know people as Deirdre or Susan and have no idea what their male name is, or whether they’re a plumber or a lawyer,” he says. “I just feel so lucky that the world allows me to be myself. ””
Check out this cool man who wears whatever clothes he wants, without feeling the need to chemically alter his appearance or pretend it affects anything other than his dress sense!
0 notes