[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ANNC: ProDraw IIe released
"John B. Matthews" <nospam@nospam.invalid> wrote
I don't understand. If you don't use an assembler, what does the source
look like? The main event loop at $843 looks deceptively simple.
Hello John,
Simplicity indeed - blink and/or plot cursor, check keys, do over!
0843- 20 E1 10 JSR $10E1 ; Blink/Plot cursor
0846- 20 16 11 JSR $1116 ; Check keypress
0849- 4C 43 08 JMP $0843 ; Do it again
It's at the check keys routine, where stuff gets ridiculously strange.
Some checks have routines built in, others do JSRs, which in turn
do JSRs, JMPs, JSRs, etc., etc., etc. Yikes-fest '09.
1122- AD 10 C0 LDA $C010 r:KBDSTRB ; Determine key
1125- 85 00 STA $00 ; and do
function
(Note: the STA $00 is pointless here, I figured that out early on, but
never got around to compressing my code and eliminating it.)
1127- C9 88 CMP #$88 ; <--
1129- D0 10 BNE $113B ; Decrement color
112B- C6 08 DEC $08
112D- A5 08 LDA $08 ; ZP $08 is where color status
byte is
112F- C9 FF CMP #$FF
1131- D0 04 BNE $1137
1133- A9 0F LDA #$0F
1135- 85 08 STA $08
1137- 20 D2 10 JSR $10D2
113A- 60 RTS
113B- C9 95 CMP #$95 ; -->
113D- D0 10 BNE $114F ; Increment color
113F- E6 08 INC $08
1141- A5 08 LDA $08 ; ZP $08 is where color status byte
is
1143- C9 10 CMP #$10
1145- D0 04 BNE $114B
1147- A9 00 LDA #$00
1149- 85 08 STA $08
114B- 20 D2 10 JSR $10D2
114E- 60 RTS
114F- C9 D3 CMP #$D3 ; S
1151- D0 10 BNE $1163 ; Change plot status
1153- C6 09 DEC $09
1155- A5 09 LDA $09 ; ZP $09 is where plot status byte
is
1157- C9 FF CMP #$FF
1159- D0 04 BNE $115F
115B- A9 01 LDA #$01
115D- 85 09 STA $09
115F- 20 A6 10 JSR $10A6
1162- 60 RTS
and so forth down to ...
1362- C9 D4 CMP #$D4 ; T
1364- D0 04 BNE $136A
1366- 20 EF 27 JSR $27EF ; Display text, wait for keypress
1369- 60 RTS
136A- C9 AA CMP #$AA ; *
136C- D0 04 BNE $1372
136E- 20 48 0A JSR $0A48 ; Force UNDO, ignore undo status
1371- 60 RTS
1372- 60 RTS ; Actual end of keypress
checking
At the onset of the project, I had a good flow going, but near the end
I had to trace and re-trace my steps numerous times to ensure I wasn't
JMPing out of a JSR, and so forth. The main reason I haven't pub-
lished the source yet, is I had to go over it again and make sure the
myriad of routines I changed were accurate to the program as it is
on the disk image. I'm pretty close to done now, and will most
likely provide an updated download with the source included.
Why all the changes to routines? Initially I wrote a simple text
interface at the bottom then about 3/4 the way through writing
the program, I updated it to what is there now. Thus a lot of the
routines that relied upon data down in that area needed to be
gone-over and rewritten to make it seamless.
How do I come up with my source? I write the program in the Apple
emulator, then pop open Ciderpress and do a copy-paste into a text
editor and comment it up to remind me what the heck the current
routine is doing. :) So it's a slow process, but works ok for me.
Very nice. The help screen and palette are delightful.
Heh well thank you very much, I am particularly happy with
the way my color palette turned out - so crafty blending the
inverse text into the actual colors. Not to mention, I drew
it while at work, so technically was getting paid to do so.
(Yes, I was caught up on everything else I had to do for
actual work-work at that point.)
I'll post back when I have the source finished and up on my
website for download.
Cheers,
Craig