Jump to content
IGNORED

Bus stuffing


Yosikuma

Recommended Posts

Basically an external CPU (such as the ARM in the Harmony, or whatever was in The Graduate) and the internal CPU put data on the data bus at the same time. If done correctly, the external CPU will override the internal CPU. A possible Kernel for bus stuffing would look like this:

 

    ldx #$FF
KernelLoop:
    sta WSYNC
    stx GRP0 ; reads from DS_GRP0
    stx COLUP0 ; reads from DS_COLUP0
    stx COLUP1 ; reads from DS_COLUP1
    stx COLUPF ; reads from DS_COLUPF
    stx ENABL ; reads from DS_ENABL
    stx ENAM0 ; reads from DS_ENAM0
    stx ENAM1 ; reads from ENAM1
    stx PF0 ; reads from DS_PF0
    stx PF1 ; reads from DS_PF1
    stx PF2 ; reads from DS_PF2
    lda #<DS_CONTROL ; datastream like 
    bne KernelEvent ; end-of-kernel, reposition object
    stx GRP1 ; reads from DS_GRP1 - GRP1 on VDEL so it is not time critical
    SLEEP ?? ; delay before updating playfield for right side of screen
    stx PF0 ; reads from DS_PF0 for other half of screen
    stx PF1 ; reads from DS_PF1
    stx PF2 ; reads from DS_PF2
    jmp KernelLoop

where the extern CPU would override the stx instructions, making it possible to update a TIA register in just 3 cycles.

  • Like 1
Link to comment
Share on other sites

Did you (or anyone else) manage to get it working on Harmony yet?

batari's done some tests that prove it will work.

 

I've worked on a spec for a new BUS bankswitching format. I've implemented it in Stella, but haven't looked at it since last September so don't recall where I left off. I've been feeling the urge to work on it again, though it'll be after my home issues are taken care of.

 

Once I'm done somebody else will need to implement it for the Harmony/Melody as I'm not familiar with ARM assembly.

Link to comment
Share on other sites

I've worked on a spec for a new BUS bankswitching format. I've implemented it in Stella, but haven't looked at it since last September so don't recall where I left off. I've been feeling the urge to work on it again, though it'll be after my home issues are taken care of.

 

Once I'm done somebody else will need to implement it for the Harmony/Melody as I'm not familiar with ARM assembly.

 

Darrell - Can you send me the BUS bank-switching spec that you have produced - I'm interested in coding it up for the Harmony/Melody?

 

Why no C/C++?

Maybe I should eventually learn ARM Assembler.

 

Thomas - The bank-switching/bus-stuffing code is timing critical so it is better to code it up in ARM assembly. You should definitely learn ARM assembler - it is very friendly for coding directly by hand. The 16-bit THUMB instruction set is quite close to 6502 and will take you about a day to learn. The 32-bit ARM instruction set is great for short fragments of high performing code as you can do a lot with each instruction. The new Cortex THUMB2 instruction set combines the best aspects of THUMB/ARM but isn't applicable to the Harmony/Melody (which is an ARM7TDMI chip).

 

A very quick tour of ARM assembly written by a friend of mine can be found here:

http://www.davespace.co.uk/arm/introduction-to-arm/

 

The best references for ARM programming are the official ARM manuals and Gameboy Advance programming resources:

ARM/THUMB quick reference: http://infocenter.arm.com/help/topic/com.arm.doc.qrc0001l/QRC0001_UAL.pdf

ARM7 Manual: https://ece.uwaterloo.ca/~ece222/ARM/ARM7-TDMI-manual-pt3.pdf

GBATEK ARM CPU guide: http://problemkaputt.de/gbatek.htm#armcpureference

ARM Whirlwind tour: http://www.coranac.com/tonc/text/asm.htm

 

Chris

Edited by cd-w
  • Like 2
Link to comment
Share on other sites

Darrell - Can you send me the BUS bank-switching spec that you have produced - I'm interested in coding it up for the Harmony/Melody?

 

 

Sure thing! Give me a few days so I can review what I was doing, write up some notes about it, and migrate my Stella BUS driver from 4.6.1 to the current version of Stella so we have something to compare against.

  • Like 1
Link to comment
Share on other sites

Sure thing! Give me a few days so I can review what I was doing, write up some notes about it, and migrate my Stella BUS driver from 4.6.1 to the current version of Stella so we have something to compare against.

Thanks Darrell - looking forward to it.

 

Chris

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...