Jump to content

Tom

Members
  • Content Count

    446
  • Joined

  • Last visited

Posts posted by Tom


  1. Antic is an intelligent DMA device and it follows a simple program called a Display List to generate the screen but when it needs a byte from RAM it asserts the HALT line to the 6502, does a read (or many), then releases the 6502. A text mode screen can cause a 30% speed penalty on the CPU.

    993560[/snapback]

     

    *jaw drops* :-o

     

    But that defeats the entire point of a DMA transfer! It might as well use the 6502 to do the dirty work if it's going to halt it!

     

    Was this some sort of misplaced attempt at multi-processor synchronization, or was there some sort of technical reason introduced that they didn't take the time to iron out?

    993568[/snapback]

     

    Eh, DMA controllers generally need to halt the CPU, after all they're going to use the bus autonomically, which isn't going to work if the CPU at the same time messes around with it.

    The reason why one makes DMA devices is that they're still faster because they "know" what to do without fetching instructions from program memory. On the GBA, large memory copies are often better done using the DMA controller. During the copy operation, the CPU is halted, but overall copying memory using the DMA controller is still faster, because for copying with the CPU you'd have to write a loop, and the CPU will spend large amounts of time fetching the same few instructions over and over again. The DMA controller on the other hand reads/writes just data.

     

    Or am I getting something utterly wrong here ?


  2. Well, I managed to change the graphics for the walking smurf animation in the disassembly, reassembling worked fine. If you posted an actual modified source code snippet that actually breaks the binary (for you), people might be able to help you.


  3. Sorry, you're doing obviously something wrong, but I really don't know what it could be (the command I posted above is correct)

     

    You don't need to put files in specific directories, but you must either pass the full path to the input file to dd, or you change to the directory the input file is in and only pass the file's name, without path information.

     

    Iirc Cygwin also doesn't treat filenames case sensitive (Unix systems do so), so it shouldn't matter wether you pass "X.FOO" or "x.FOo" for a filename.


  4. A standard Unix utility. Everybody running Windows should have a Cygwin or GnuWin32 installation.

    982357[/snapback]

     

     

    downloaded it and used cygwin and I keep getiing this error message and I don't know why:

     

    dd: opening '8kfile.bin' : No such file or directory

     

    Any idea's? Do I need to use a specfic directory? I tried copying my 8kfile.bin into the cygwin working directory but no go.

    982523[/snapback]

     

    You did use the correct filenames, right ? "8krom.bin", "bank0.bin" and "bank1.bin" in my first post were of course only placeholders. You have to substitute them with the real filenames you want to use. If that isn't the problem, post the whole command line you're using.


  5. Why a hex editor ? All you need is dd.

     

    dd if=8krom.bin of=bank0.bin count=4096 bs=1
    dd if=8krom.bin of=bank1.bin count=4096 bs=1 skip=4096
    

     

    Simple and powerful.


  6. Would our "version" of it take our brand of Basic and produce CV assembly code, which would then be handled by a regular Z80A assembly compiler?

     

    Would be a good idea. There are several very good open source Z80 assemblers available, so why bother with rolling your own machine code generation backend.


  7. Philipp,

    I think you have some small errors in your crt0.s. I don't think the EI/RETI sequence is correct for RST 8 through 30. The RST instructions are basically calls with an implicit address (0008h, 0010h, 0018h, 0020h, 0028h, 0030h). The BIOS has at these locations JP instructions to the cartridge header, and I think instead of EI/RETI you should put a RET instruction in there.

     

    .dw start  ; where to start execution of program.
    ei          ; RST 0x08
    reti    	
    ei          ; RST 0x10
    reti
    ei          ; RST 0x18
    reti
    ei          ; RST 0x20
    reti
    ei          ; RST 0x28
    reti
    ei          ; RST 0x30
    reti
    ei          ; RST 0x38 - spinner interrupt
    reti
    jp nmi      ; NMI
    nop
    

     

    Should become

     

    .dw start  ; where to start execution of program.
    ret        ; RST 0x08
    nop
    nop
    ret        ; RST 0x10
    nop
    nop
    ret        ; RST 0x18
    nop
    nop
    ret        ; RST 0x20
    nop
    nop
    ret        ; RST 0x28
    nop
    nop
    ret        ; RST 0x30
    nop
    nop
    ei         ; RST 0x38 - spinner interrupt
    reti
    jp nmi     ; NMI
    nop
    


  8. Ok, I found a BIOS disassembly. They point to buffers in RAM which some BIOS functions use. If you don't call those particular BIOS functions, the pointers can contain *any* value.

     

    (The whole point in this seems to be to let the programmer have control over where these buffers are placed, since they can be fairly large. You could probably even overlay some them.)


  9. It's fairly easy to write a program for the Atari 7800 that supports PAL *and* NTSC (autodetecting the console type). Converting existing games might be more difficult. Basically to convert an NTSC game to PAL you'd have to insert additional empty lines into the display list. If there's not enough RAM left for that or you have to move stuff around in RAM to make space, then things will get really amusing :)


  10. From reading these books, I know that BASIC is being translated into machine language by the computer so it can perform the tasks you program from BASIC

    (sorry if this is ignorant - I'm a newbie to this!!).   So, I wonder - is there a source that will let me know how the computer translates the BASIC commands?

     

    For instance, if I type in plot or print from BASIC  - what set of commands does the computer change that into ?

    That's not how Atari BASIC works. BASIC is not directly translated into assembly code, it's interpreted. The BASIC interpreter steps through the program, looks at the commands and calls assembly routines that perform the commands.

     

    The BASIC code is only translated into a form that is simpler to read by the BASIC interpreter. This is done during *editing*. If you type in PRINT, what is actually stored in the program being edited is a byte with the value 20h. But this is not a 6502 opcode, it's only a token that tells the BASIC interpreter to call the routine that performs the PRINT command when the program is executed.

     

    Here's a description of the Atari BASIC file format :http://www2.asw.cz/~kubecj/afmtbas.htm

     

    It doesn't show which routines actually get called for the different BASIC commands. You'd need a BASIC/BIOS disassembly for that.


  11. This is information I got from Al a while ago about EF bankswitching:

     

    The bankswitching uses "hot spots" like F8, F4, and F6 bankswitching. There are 16 4K banks - hotspots for the 64K version were defined by Paul Slocum (whom we designed this board for originally):

     

    1FE0 => BANK0

    1FE1 => BANK1

    1FE2 => BANK2

    1FE3 => BANK3

    1FE4 => BANK4

    1FE5 => BANK5

    1FE6 => BANK6

    1FE7 => BANK7

    1FE8 => BANK8

    1FE9 => BANK9

    1FEA => BANK10

    1FEB => BANK11

    1FEC => BANK12

    1FED => BANK13

    1FEE => BANK14

    1FEF => BANK15


  12. I had been thinking about doing some sort of bankswitching, but I wasn't sure of the best way to do it.  It looks like you've found an effective way of keeping the banks separate.

     

    It might have made sense to use a more advanced code generator than DASM in the first place (ca65/ld65 come to mind). But what do I care, I don't use bB, I just watch its progress when I'm bored enough at work :)


  13. DASM can assemble code out of order. It just can't do so for raw binaries (the -f3 switch). As a workaround which neither involves modifying DASM (you don't want to do that, believe me) nor modifying bBasic you could try using RAS mode (the -f2 switch).

     

    From the DASM manual:

     

    2  RAS (Random Access Segment)
    
    The output file contains one or more hunks.  Each hunk consists
    of a 2 byte origin (LSB,MSB), 2 byte length (LSB,MSB), and that
    number of data bytes.  The hunks occur in the same order as
    initialized segments in the assembly.  There are no restrictions
    to segment ordering (i.e. reverse indexed ORG statements are
    allowed).  The next hunk begins after the previous hunk's data,
    until the end of the file.
    

     

    You would have to write a small tool to remove the hunk headers and convert everything back into a raw rom image. This is an ugly hack too, but easy to pull of.

×
×
  • Create New...