PDA

View Full Version : DHGR, graphics and read/write questions



Rockbadger
September 4th, 2014, 03:51 PM
Hello, My first time posting greetings to you all. :)


I'm trying to resurrect my 80's apple programming days. I'm running Winapple in enhanced IIe mode on Acer with Win 7. I use Beagle Graphics to get into DHGR mode and Beagle Program Writer for editing. I'm programming in applesoft BASIC.

I am writing a RPG which requires moving between different programs (Temple, Guild, Market, etc). Sometimes pressing the desired key, EG: 'M' for Market doesn't always work. The program just prints “RUN MARKET” (see below) and ends (because I put an END line. I know it shouldn't be necessary but I use it for testing purposes so my program doesn't wander off to strange locations. It'll be removed later).

I created a sequence of programs. INTRO checks a text file I created called PSLOT to see which of 4 slots is available to use, and allows the user to chose which one they want to assign to themselves. Completion of INTRO runs FIRSTVISIT (where characters are created). Completion of FIRSTVISIT runs MARKET where characters can heal, purchase, level up, save, etc. Market was originally one very large program. I have broken it up into individual programs. Since doing that my MARKET program no longer runs the relevant selection (IE: if in MARKET program and the user types 'G' for guild the guild program won't load). Is my coding below correct? What else may cause this not to work?

Problem 1-
Input line
190 VTAB 22 : PRINT ”VISIT >” : VTAB22 : HTAB9 : GETZZ$
Which do I use?
200 IF ZZ$ = “M” THEN PRINT CHR$ (4);”RUN STORE”
210 IF ZZ$ = “G” THEN PRINT CHR$ (4);”RUN GUILD”
...etc,
-= or =-
200 IF ZZ$ = “M” THEN 290
(210-280) other IF statements
285 ?"RUN ERROR 285":END (for my debugging purposes)
290 PRINT CHR$(4);”RUN STORE”
295 END

Problem 2-
When reading/writing data I use
10 PRINT CHR$ (4); “OPEN CHAR1”: PRINT CHAR$ (4); “WRITE/OPEN CHAR1”
20 ?NA$, ?AR$, ?PO..... (and so on)
30 PRINT CHR$ (4); “CLOSE CHAR1”

This usually works. In problems 1 & 2 the words “RUN STORE” or “OPEN CHAR1” appear on screen. I'm pretty sure that shouldn't happen. Even if it does load the desired program I'm sure they shouldn't appear on screen. I've successfully been saving/loading character data as different programs load, but it still doesn't feel 'right'.

Problem 3-
How do I get my own program to “BRUN DHGR” on Beagle Graphics automatically? DHGR converts the display from 40 columns to 80. At the moment I have to load it manually, but that won't be suitable for a finished product. I tried PRINT CHR$ (4);”BRUN DHGR” but that didn't work. Do I need some lines of code? Or is the another way to get a program to run in 80 columns?

Problem 4-
Both Beagle Graphics and Graphics Magician do not recognise my mouse or graphics tablet. The cursor remains jammed in the top left corner of GM, but the crosshairs at the border of the screen will move as I move my mouse or pen. In both programs I get some sort of keyboard capability- but you can't draw with a keyboard, lol. Is there a solution to this? Graphics Magician is sluggish in recognising keyboard entries.
or
Is it possible to create suitable resolution images in Photoshop and them somehow get them into a useable state for either of those two programs, or directly loadable into mine?

Thanks heaps for reading.

olePigeon
September 4th, 2014, 05:51 PM
I'm afraid I can't help you programming-wise, but I'd LOVE to see the RPG when you're done. :D

david__schmidt
September 5th, 2014, 06:24 AM
Problem 1-
Input line
190 VTAB 22 : PRINT ”VISIT >” : VTAB22 : HTAB9 : GETZZ$
Which do I use?
200 IF ZZ$ = “M” THEN PRINT CHR$ (4);”RUN STORE”
210 IF ZZ$ = “G” THEN PRINT CHR$ (4);”RUN GUILD”
...etc,
-= or =-
200 IF ZZ$ = “M” THEN 290
(210-280) other IF statements
285 ?"RUN ERROR 285":END (for my debugging purposes)
290 PRINT CHR$(4);”RUN STORE”
295 END

Either will work (except for the running part - more on that later). It's a matter of coding style and preference. Your input loop should be checking for upper and lower case characters, depending on what computer the user is sitting at. Then give some gentle guidance (or just ask again for input) if the wrong thing is typed.



In problems 1 & 2 the words “RUN STORE” or “OPEN CHAR1” appear on screen.
That's because in order for the DOS commands to actually work, they have to be at the left margin of the screen. Your HTAB is changing that. What you can do to correct it is just say:
30 PRINT : PRINT CHR$ (4); “CLOSE CHAR1”



Problem 3-
How do I get my own program to “BRUN DHGR” on Beagle Graphics automatically? DHGR converts the display from 40 columns to 80.
You should be able to just BRUN it as part of your init program (paying attention to the issue raised in problem 2).



Problem 4-
[mumble about graphics tablet - I have no idea]
or
Is it possible to create suitable resolution images in Photoshop and them somehow get them into a useable state for either of those two programs, or directly loadable into mine?
Bill Buckels does a lot of work in this space. Visit:
http://appleoldies.ca/graphics/index.htm