Jump to content

calamari

Members
  • Content Count

    369
  • Joined

  • Last visited

Everything posted by calamari

  1. Agreed.. learn the easy stuff first. I'd check out QuickBasic (or Qbasic). That comes with Windows 3.1, 95 or 98. There is a decent helpfile with example code. Once you get that down you can move on to assembly language and then other stuff. calamari
  2. Anything in RAM will need to get there from ROM or from your program running. Yeah, it might be hard to use it all calamari
  3. When making the 5200BAS RAM/ROM map I decided to move a few things around.. so here is a new version. Also snuck in another idea from John for a variable specified sprite height. Version 1.96, 12Oct2002 * Fixed CLS so it can be used when screen memory is moved * Changed VTRIGR vector to $0000 as in the documentation * Moved default VDSLST from $BC20 to $BC16 to fill a gap * Moved default CHARSET from $A000 to $B800 * PUT statement can now use the FROMH variable for height calamari
  4. It has been added to the FAQ as section 3.1. note that I also just made a few changes to 5200BAS so the memory map only reflects 1.96, not 1.95. Anything you want.. some areas are in use as shown in the FAQ, but otherwise do whatever you want with it. You are correct that any RAM you use will need to be filled by your program, as RAM is lost when the power is turned off. Well, I'm not sure.. I use DEBUG.EXE but I'm sure that would not be the first choice for most people. You might try Microsoft Codeview or Borland Turbo Debugger.. but they are also for x86. Can anyone else suggest a good general purpose hex editor? calamari
  5. Cafeman, Erasing for 10-15 minutes with this Datarase II seems to do the job. calamari
  6. By default $B000 is the PRINT string area (for example if you said PRINT "Hello World" then the "Hello World" would be at $B000, followed by an $FF delimiter. There is no real range for the string area, it only writes what you use. If you are tight on space then find an empty ROM area (there are usually gaps here and there) and move your strings to the gap with the SET statement. I recommend using some kind of hex editor so you can see where the empty spaces are. Or, if you don't plan on using PRINT "" at all, don't worry about $B000 and just overwrite it. There is other stuff in the $Bxxx area too, come to think of it. I'll write up a 5200BAS memory usage map (for the default settings) and post a link here when it's done. calamari
  7. sounds cool.. but the screenshots are broken for me. Were they taken down? calamari
  8. Cafeman-- Post your title screen Display List, DLI, VBI, and credit card number. We'll take care of it calamari
  9. Due to a special request by John Swiderski, I've added a new feature to 5200BAS: Version 1.95, 04Oct2002 * Added ability to draw sprites upside down by using a negative height value Thanks John for all your great ideas and suggestions. calamari
  10. Thomas suggested using a global variable. Here is my new test code: unsigned char z=10; //global variable void main() { ++z; } Here is the compiled result: .segment "DATA" _z: .byte $0A ; -------------------- ; void main () ; -------------------- .segment "CODE" .proc _main jsr enter ldx #$00 inc _z lda _z jsr leave rts .endproc This code is looking a lot better with the global variable. ldx #$00 and lda _z seem to be unused in this case. I did some other experiments, and declaring all variables as global is clearly the way to go, but you still have to be very careful with your code. z+=w; is good, but z=z+w; involves a subroutine call to do the addition. z+=1; compiles the same as ++z;, good. z*=2; and z<<=2; both call a subroutine instead of shifting left. ++w[1]; worked well. Loops seem to produce decent code. Nothing is optimized though. With a do...while loop and a --z; inside the loop there are duplicate lda _z's next to each other. You'd definitely want to clean up the source after compiling to remove the extraneous code. Jetboot: Now, obviously I'm biased in this area, but... as far as converting goes, translating from Atari Basic to 5200BAS shouldn't be a big deal. You'll have access to Quickbasic style program control statements: multiple line/nested IF/ELSE/END IF, AND and OR in IF are accepted, you can test for ZFLAG, CFLAG, etc (to save cycles), DO...LOOP (WHILE/UNTIL), FOR...NEXT, SELECT CASE. Unlike C, you would have to break down any algebraic expressions into pieces. For example, you might rewrite Q=W+2 as A=W:A=A+2:Q=A. This should not be too big a deal for most expressions and gives you full control. Once you get the basic program translated, compile it. Then copy & paste the relevant asm code into your main program. calamari
  11. Wow, that's pretty impressive.. but way more joystick than I'm looking for. Maybe I'll have to sacrifice an NES controller and convert it for PC. calamari
  12. Jetboot, I checked into cc65 (the 6502 C compiler). Unfortunately, it doesn't seem to produce very optimized code (in fact it says in the docs that it doesn't try to optimize at all). Which is too bad, because C should be a good language for optimizations. I decided to do some tests to see how it treated a straightforward program. Here was my code: void main() { //docs say unsigned char is best unsigned char z=0x10; //docs say use predec over post dec ++z; } Here was what I was expecting it to look something like: lda #$10 sta Z inc Z Here is what I got instead: lda #$10 jsr pusha ldy #$00 ldx #$00 clc lda #$01 adc (sp),y sta (sp),y ldy #$01 My poor, poor program. Z was promoted to a 16-bit value (why? My variable type was unsigned char), Z was accessed indirectly like an array (adds 1 cycle, plus cycles for having to zero out Y), and ADC was used to do the increment, completely destroying any savings I might have seen. If someone knows how to produce tight code with this thing, PLEASE let me know. I think it would be very cool to have a C compiler for 5200. It shouldn't be too hard to make a 5200 target for cc65 (there is an Atari 800 target). But, with this kind of code output it would be impossible to use it for anything but the simplest programs. calamari p.s. does anyone know the algorithm to systematically produce combinations like this: ABC ACB BAC BCA CAB CBA (and also for ABCD or ABCDE, etc, or for combinations like AB-ABC, where it would be AB-ABC, BA-ABC, AB-ACB, BA-ACB, etc? I am experimenting with the idea of an optimizing expression parser, but I want it to make sure it uses the best form of the expression that will lead to the fewest cpu cycles, and that means rearranging the expression in all possible ways.
  13. The most faithful emulator I've seen (and the one I've been using for 5200 programming) is Atari800 for MS-DOS, but I'd guess the Windows version is similar. It does the best job I've seen with music & sound effects, and also properly emulates the weird GTIA trick modes. It still has problems, they all do... it just seems to have less of them. And it's also open source, so if I wasn't so lazy I guess I could fix the bugs. calamari
  14. Are there any inexpensive digital PC joysticks out there that are really arcade style? A lot claim it, but they don't look like any arcade stick I've ever seen. What I mean is the round ball handle and metal shaft, kinda like the NES Advantage. I have a Cyborg 3-D and it's great for flight sims but not as good for MAME. Thanks, calamari
  15. Ahh.. yes any string literals you use will be placed starting at $B000. You can change this location with the SET statement. Other variables must be DEFINE'd. Just FYI, the string storage is "smart" meaning that if you print "YELLOW" then you print "LOW", it doesn't store "LOW" as a second string. print "YELL" would require a second string because of the termination character. calamari
  16. calamari

    EPROM burner

    I started to design one before I got my burner. But it turned out that the EPROM burner is just fine on its own. I do most of the testing on the emulator anyways. calamari
  17. calamari

    TASM

    Since I plan to sell Solitaire carts I registered my TASM software so I would be legit. I would assume that the other 5200 programmers have too, or they used DASM which is free. TASM is a good assembler and works the best with 5200BAS. When you register he sends you the latest version on disk (with source code!), a printed manual, and you also get technical support. calamari
  18. I suggest that you read the Player & Missile graphics section of Atari System Reference Manual (not the 5200 one this time). Also read the Display list chapter of the same reference work. calamari
  19. There is an example of how to use players in the River Racer game. I've updated it a little and added comments so the code is easier to understand. calamari
  20. Yeah you can always write directly to screen memory if you want to (that's how I did PRINT ). You can even change the location of screen memory, using the SET statement. You aren't trapped in, the commands I made are just to make your life easier. Write your whole program in straight ASM, 5200BAS won't mind calamari
  21. I'm not sure how clear that was, so here is an example program: TEMPL=123:GOSUB PRINTVAR DO:LOOP PRINTVAR: RIGHT:RIGHT:RIGHT TEMPH=10 DO A=TEMPL:IF ZFLAG=TRUE THEN EXIT DO DIV8:A=A+48 PRINT CHR$(A):LEFT LOOP RETURN calamari
  22. Not directly, but you can make your own printing routine by dividing by 10 and printing remainders: For example: if Z=123, then 123/10=12 remainder 3 (see DIV8 and DIV16), so we print a 3 (in reality you'd have to convert the decimal number to ascii (add 48 ) or atascii, depending on where "0" is in your character set). Then you store the 12 back in Z and divide again, etc. So 12/10=1 remainder 2, print 2, store 1.. 1/10=0 remainder 1, print 1. The number is now zero so we're done printing. Of course that will print 321 rather than 123, so you use LEFT rather than RIGHT. Either that, opr store the remainders in an array and print them out backwards. Printing larger numbers will require a bit more work to juggle the two halves of the 16-bit number, but it's doable. That's how I'm printing how much cash you have won or lost in Solitaire. calamari
  23. Yeah, I wrote it in QuickBasic Extended 7.0. QBX 7.0 is nice because it is possible to access interrupts directly. That makes having a mouse pointer easier. I was just looking at the program and noticed that it flashed an "F" while loading. That bothered me so it's been fixed and a new version 1.21 is uploaded calamari
  24. There is now a small FAQ up on the 5200BAS page. Thanks for all your questions! calamari
  25. Can you post a few lines of your sprite data? Make sure to use both the high and low nibble.. for example to have 8 dots across, use $FF. Using $0F or $F0 would only give 4 dots. $55 or $AA would only give every other dot. There is also SIZEP0, SIZEP1, etc, to control the width (give a value 0-3)but those shouldn't leave empty spaces. For more info on SIZEP0 see Mapping the Atari, there is a good description of it starting at $D008 (which is $C008 in the 5200). HTH, calamari
×
×
  • Create New...