added comments that try to explain video page flip
This commit is contained in:
80
BaS_gcc/flash_scripts/flash_firebee_bas.bdm
Executable file
80
BaS_gcc/flash_scripts/flash_firebee_bas.bdm
Executable file
@@ -0,0 +1,80 @@
|
|||||||
|
#!/usr/local/bin/bdmctrl
|
||||||
|
#
|
||||||
|
# firebee board initialization for bdmctrl
|
||||||
|
#
|
||||||
|
open $1
|
||||||
|
reset
|
||||||
|
sleep 10
|
||||||
|
|
||||||
|
wait
|
||||||
|
|
||||||
|
# Turn on MBAR at 0xFF00_0000
|
||||||
|
write-ctrl 0x0C0F 0xFF000000
|
||||||
|
|
||||||
|
# set VBR
|
||||||
|
write-ctrl 0x0801 0x00000000
|
||||||
|
|
||||||
|
#
|
||||||
|
# Init CS0 (BootFLASH @ E000_0000 - E07F_FFFF 8Mbytes)
|
||||||
|
write 0xFF000500 0xE0000000 4
|
||||||
|
write 0xFF000508 0x00001180 4
|
||||||
|
write 0xFF000504 0x007F0001 4
|
||||||
|
|
||||||
|
# SDRAM Initialization @ 0000_0000 - 1FFF_FFFF 512Mbytes
|
||||||
|
write 0xFF000004 0x000002AA 4 # SDRAMDS configuration
|
||||||
|
write 0xFF000020 0x0000001A 4 # SDRAM CS0 configuration (128Mbytes 0000_0000 - 07FF_FFFF)
|
||||||
|
write 0xFF000024 0x0800001A 4 # SDRAM CS1 configuration (128Mbytes 0800_0000 - 0FFF_FFFF)
|
||||||
|
write 0xFF000028 0x1000001A 4 # SDRAM CS2 configuration (128Mbytes 1000_0000 - 17FF_FFFF)
|
||||||
|
write 0xFF00002C 0x1800001A 4 # SDRAM CS3 configuration (128Mbytes 1800_0000 - 1FFF_FFFF)
|
||||||
|
write 0xFF000108 0x73622830 4 # SDCFG1
|
||||||
|
write 0xFF00010C 0x46770000 4 # SDCFG2
|
||||||
|
|
||||||
|
write 0xFF000104 0xE10D0002 4 # SDCR + IPALL
|
||||||
|
write 0xFF000100 0x40010000 4 # SDMR (write to LEMR)
|
||||||
|
write 0xFF000100 0x048D0000 4 # SDMR (write to LMR)
|
||||||
|
sleep 100
|
||||||
|
write 0xFF000104 0xE10D0002 4 # SDCR + IPALL
|
||||||
|
write 0xFF000104 0xE10D0004 4 # SDCR + IREF (first refresh)
|
||||||
|
write 0xFF000104 0xE10D0004 4 # SDCR + IREF (first refresh)
|
||||||
|
write 0xFF000100 0x008D0000 4 # SDMR (write to LMR)
|
||||||
|
write 0xFF000104 0x710D0F00 4 # SDCR (lock SDMR and enable refresh)
|
||||||
|
sleep 10
|
||||||
|
|
||||||
|
|
||||||
|
# use system sdram as flashlib scratch area.
|
||||||
|
# TODO: plugin flashing seems to work o.k. now for smaller binaries, while it doesn't for larger ones (EmuTOS) yet.
|
||||||
|
# This seems to be related to large flash buffers and PC-relative adressing of the plugin
|
||||||
|
flash-plugin 0x1000 0xf000 flash29.plugin
|
||||||
|
# notify flashlib that we have flash at address 0xE0000000, length 0x7FFFFF, plugin is flash29
|
||||||
|
flash 0xE0000000
|
||||||
|
|
||||||
|
# Erase flash from 0xE0000000 to 0xE00FFFFF (reserved space for BaS)
|
||||||
|
#
|
||||||
|
# Caution: sector offset numbers need to be the ones from the x16 address range
|
||||||
|
# column and they vary in size - needs to be exactly as in the data sheet (p. 9)
|
||||||
|
#
|
||||||
|
# contrary to documentation, it seems we need to erase-wait after each sector
|
||||||
|
|
||||||
|
erase 0xE0000000 0x00000
|
||||||
|
erase-wait 0xE0000000
|
||||||
|
erase 0xE0000000 0x01000
|
||||||
|
erase-wait 0xE0000000
|
||||||
|
erase 0xE0000000 0x02000
|
||||||
|
erase-wait 0xE0000000
|
||||||
|
erase 0xE0000000 0x03000
|
||||||
|
erase-wait 0xE0000000
|
||||||
|
erase 0xE0000000 0x04000
|
||||||
|
erase-wait 0xE0000000
|
||||||
|
erase 0xE0000000 0x05000
|
||||||
|
erase-wait 0xE0000000
|
||||||
|
erase 0xE0000000 0x06000
|
||||||
|
erase-wait 0xE0000000
|
||||||
|
erase 0xE0000000 0x07000
|
||||||
|
erase-wait 0xE0000000
|
||||||
|
erase 0xE0000000 0x08000
|
||||||
|
erase-wait 0xE0000000
|
||||||
|
erase 0xE0000000 0x10000
|
||||||
|
erase-wait 0xE0000000
|
||||||
|
blank-chk 0xE0000000 0x10000
|
||||||
|
load -v bas.elf
|
||||||
|
wait
|
||||||
80
BaS_gcc/flash_scripts/flash_m548x_bas.bdm
Executable file
80
BaS_gcc/flash_scripts/flash_m548x_bas.bdm
Executable file
@@ -0,0 +1,80 @@
|
|||||||
|
#!/usr/local/bin/bdmctrl
|
||||||
|
#
|
||||||
|
# m548x board initialization for bdmctrl
|
||||||
|
#
|
||||||
|
open $1
|
||||||
|
reset
|
||||||
|
sleep 10
|
||||||
|
|
||||||
|
wait
|
||||||
|
|
||||||
|
# Turn on MBAR at 0xFF00_0000
|
||||||
|
write-ctrl 0x0C0F 0xFF000000
|
||||||
|
|
||||||
|
# set VBR
|
||||||
|
write-ctrl 0x0801 0x00000000
|
||||||
|
|
||||||
|
#
|
||||||
|
# Init CS0 (BootFLASH @ E000_0000 - E07F_FFFF 8Mbytes)
|
||||||
|
write 0xFF000500 0xE0000000 4
|
||||||
|
write 0xFF000508 0x00001180 4
|
||||||
|
write 0xFF000504 0x007F0001 4
|
||||||
|
|
||||||
|
# SDRAM Initialization @ 0000_0000 - 1FFF_FFFF 512Mbytes
|
||||||
|
write 0xFF000004 0x000002AA 4 # SDRAMDS configuration
|
||||||
|
write 0xFF000020 0x0000001A 4 # SDRAM CS0 configuration (128Mbytes 0000_0000 - 07FF_FFFF)
|
||||||
|
write 0xFF000024 0x0800001A 4 # SDRAM CS1 configuration (128Mbytes 0800_0000 - 0FFF_FFFF)
|
||||||
|
write 0xFF000028 0x1000001A 4 # SDRAM CS2 configuration (128Mbytes 1000_0000 - 17FF_FFFF)
|
||||||
|
write 0xFF00002C 0x1800001A 4 # SDRAM CS3 configuration (128Mbytes 1800_0000 - 1FFF_FFFF)
|
||||||
|
write 0xFF000108 0x73622830 4 # SDCFG1
|
||||||
|
write 0xFF00010C 0x46770000 4 # SDCFG2
|
||||||
|
|
||||||
|
write 0xFF000104 0xE10D0002 4 # SDCR + IPALL
|
||||||
|
write 0xFF000100 0x40010000 4 # SDMR (write to LEMR)
|
||||||
|
write 0xFF000100 0x048D0000 4 # SDMR (write to LMR)
|
||||||
|
sleep 100
|
||||||
|
write 0xFF000104 0xE10D0002 4 # SDCR + IPALL
|
||||||
|
write 0xFF000104 0xE10D0004 4 # SDCR + IREF (first refresh)
|
||||||
|
write 0xFF000104 0xE10D0004 4 # SDCR + IREF (first refresh)
|
||||||
|
write 0xFF000100 0x008D0000 4 # SDMR (write to LMR)
|
||||||
|
write 0xFF000104 0x710D0F00 4 # SDCR (lock SDMR and enable refresh)
|
||||||
|
sleep 10
|
||||||
|
|
||||||
|
|
||||||
|
# use system sdram as flashlib scratch area.
|
||||||
|
# TODO: plugin flashing seems to work o.k. now for smaller binaries, while it doesn't for larger ones (EmuTOS) yet.
|
||||||
|
# This seems to be related to large flash buffers and PC-relative adressing of the plugin
|
||||||
|
flash-plugin 0x1000 0xf000 flash29.plugin
|
||||||
|
# notify flashlib that we have flash at address 0xE0000000, length 0x7FFFFF, plugin is flash29
|
||||||
|
flash 0xE0000000
|
||||||
|
|
||||||
|
# Erase flash from 0xE0000000 to 0xE00FFFFF (reserved space for BaS)
|
||||||
|
#
|
||||||
|
# Caution: sector offset numbers need to be the ones from the x16 address range
|
||||||
|
# column and they vary in size - needs to be exactly as in the data sheet (p. 9)
|
||||||
|
#
|
||||||
|
# contrary to documentation, it seems we need to erase-wait after each sector
|
||||||
|
|
||||||
|
erase 0xE0000000 0x00000
|
||||||
|
erase-wait 0xE0000000
|
||||||
|
erase 0xE0000000 0x01000
|
||||||
|
erase-wait 0xE0000000
|
||||||
|
erase 0xE0000000 0x02000
|
||||||
|
erase-wait 0xE0000000
|
||||||
|
erase 0xE0000000 0x03000
|
||||||
|
erase-wait 0xE0000000
|
||||||
|
erase 0xE0000000 0x04000
|
||||||
|
erase-wait 0xE0000000
|
||||||
|
erase 0xE0000000 0x05000
|
||||||
|
erase-wait 0xE0000000
|
||||||
|
erase 0xE0000000 0x06000
|
||||||
|
erase-wait 0xE0000000
|
||||||
|
erase 0xE0000000 0x07000
|
||||||
|
erase-wait 0xE0000000
|
||||||
|
erase 0xE0000000 0x08000
|
||||||
|
erase-wait 0xE0000000
|
||||||
|
erase 0xE0000000 0x10000
|
||||||
|
erase-wait 0xE0000000
|
||||||
|
blank-chk 0xE0000000 0x10000
|
||||||
|
load -v bas.elf
|
||||||
|
wait
|
||||||
@@ -608,7 +608,7 @@ irq6: // MFP interrupt from FPGA
|
|||||||
add.l #std_mmutr,d0
|
add.l #std_mmutr,d0
|
||||||
move.l d3,d1 // page 0?
|
move.l d3,d1 // page 0?
|
||||||
beq irq6_sca_pn0 // ja ->
|
beq irq6_sca_pn0 // ja ->
|
||||||
add.l #copyback_mmudr,d1 // sonst page cb
|
add.l #copyback_mmudr,d1 // sonst page cb
|
||||||
bra irq6_sca_pn1c
|
bra irq6_sca_pn1c
|
||||||
irq6_sca_pn0:
|
irq6_sca_pn0:
|
||||||
add.l #writethrough_mmudr|MCF_MMU_MMUDR_LK,d1 // page wt and locked
|
add.l #writethrough_mmudr|MCF_MMU_MMUDR_LK,d1 // page wt and locked
|
||||||
@@ -891,7 +891,9 @@ psc3_fertig:
|
|||||||
RTE
|
RTE
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* general purpose timer 0 (GPT0): video change, later also others
|
* general purpose timer 0 (GPT0): video change, later also others. GPT0 is used as
|
||||||
|
* input trigger. It is connected to the TIN0 signal of the FPGA and triggers everytime
|
||||||
|
* vbasehi is written to, i.e. when the video base address gets changed
|
||||||
*/
|
*/
|
||||||
handler_gpt0:
|
handler_gpt0:
|
||||||
move #0x2700,sr // disable interrupts
|
move #0x2700,sr // disable interrupts
|
||||||
@@ -900,31 +902,34 @@ handler_gpt0:
|
|||||||
movem.l d0-d4/a0-a1,(a7)
|
movem.l d0-d4/a0-a1,(a7)
|
||||||
|
|
||||||
mvz.b vbasehi,d0 // screen base address high
|
mvz.b vbasehi,d0 // screen base address high
|
||||||
cmp.w #2,d0 // lower than 0x200000?
|
cmp.w #2,d0 // screen base lower than 0x20000?
|
||||||
blt video_chg_end // yes
|
blt video_chg_end // yes, do nothing
|
||||||
cmp.w #0xd0,d0 // 0xd00000? - normal Falcon video area, map to 60d00000 (FPGA video memory)
|
cmp.w #0xd0,d0 // lower than 0xd00000? - normal Falcon video area, mapped
|
||||||
|
// to 60d00000 (FPGA video memory)
|
||||||
blt sca_other //
|
blt sca_other //
|
||||||
|
|
||||||
lea MCF_SLT0_SCNT,a0
|
lea MCF_SLT0_SCNT,a0
|
||||||
move.l (a0),_video_sbt // save time
|
move.l (a0),_video_sbt // save time
|
||||||
|
|
||||||
|
// FIXME: don't we need to get out here?
|
||||||
|
|
||||||
sca_other:
|
sca_other:
|
||||||
lsl.l #8,d0 // build screen start address from Atari register contents
|
lsl.l #8,d0 // build new screen start address from Atari register contents
|
||||||
move.b 0xffff8203,d0 // mid byt
|
move.b 0xffff8203,d0 // mid byt
|
||||||
lsl.l #8,d0
|
lsl.l #8,d0
|
||||||
move.b 0xffff820d,d0 // low byt
|
move.b 0xffff820d,d0 // low byt
|
||||||
move.l d0,d3
|
move.l d0,d3
|
||||||
|
|
||||||
video_chg_1page:
|
video_chg_1page:
|
||||||
// test ob page schon gesetzt
|
// check if page is already marked as video page
|
||||||
moveq #20,d4
|
moveq #20,d4
|
||||||
move.l d0,d2
|
move.l d0,d2
|
||||||
lsr.l d4,d2 // neue page
|
lsr.l d4,d2 // new page
|
||||||
move.l _video_tlb,d4
|
move.l _video_tlb,d4
|
||||||
bset.l d2,d4 // setzen als ge<EFBFBD>ndert
|
bset.l d2,d4 // set as changed
|
||||||
bne video_chg_2page // schon gesetzt gewesen? ja->weg
|
bne video_chg_2page // was it set already?
|
||||||
move.l d4,_video_tlb
|
move.l d4,_video_tlb
|
||||||
bsr cpusha // cache leeren
|
bsr cpusha // clear cache
|
||||||
|
|
||||||
video_copy_data:
|
video_copy_data:
|
||||||
move.l d4,_video_tlb
|
move.l d4,_video_tlb
|
||||||
@@ -932,7 +937,7 @@ video_copy_data:
|
|||||||
move.l d0,a0
|
move.l d0,a0
|
||||||
move.l a0,a1
|
move.l a0,a1
|
||||||
add.l #0x60000000,a1
|
add.l #0x60000000,a1
|
||||||
move.l #0x10000,d4 // die ganze page
|
move.l #0x10000,d4 // whole page
|
||||||
|
|
||||||
#define _DO_CPU_COPY
|
#define _DO_CPU_COPY
|
||||||
#ifndef _DO_CPU_COPY
|
#ifndef _DO_CPU_COPY
|
||||||
@@ -968,7 +973,7 @@ video_copy_data:
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
video_copy_data_loop:
|
video_copy_data_loop:
|
||||||
move.l (a0)+,(a1)+
|
move.l (a0)+,(a1)+ // copy video page contents to real screen
|
||||||
move.l (a0)+,(a1)+
|
move.l (a0)+,(a1)+
|
||||||
move.l (a0)+,(a1)+
|
move.l (a0)+,(a1)+
|
||||||
move.l (a0)+,(a1)+
|
move.l (a0)+,(a1)+
|
||||||
@@ -977,9 +982,9 @@ video_copy_data_loop:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// eintrag suchen
|
// eintrag suchen
|
||||||
move.l d0,MCF_MMU_MMUAR // addresse
|
move.l d0,MCF_MMU_MMUAR // adress
|
||||||
move.l #0x106,d4
|
move.l #0x106,d4
|
||||||
move.l d4,MCF_MMU_MMUOR // suchen -> schl<EFBFBD>gt neuen vor wenn keiner
|
move.l d4,MCF_MMU_MMUOR // search -> new one will be offered if not found
|
||||||
nop
|
nop
|
||||||
move.l MCF_MMU_MMUOR,d4
|
move.l MCF_MMU_MMUOR,d4
|
||||||
clr.w d4
|
clr.w d4
|
||||||
@@ -994,7 +999,7 @@ video_copy_data_loop:
|
|||||||
move.l d2,MCF_MMU_MMUOR // setzen vidoe maped to 60xxx only data
|
move.l d2,MCF_MMU_MMUOR // setzen vidoe maped to 60xxx only data
|
||||||
nop
|
nop
|
||||||
video_chg_2page:
|
video_chg_2page:
|
||||||
// test ob evt. anschliessende page gesetzt werden muss
|
// test of adjacent page is needed also
|
||||||
move.l d3,d0
|
move.l d3,d0
|
||||||
mvz.w 0xffff8210,d4 // byts pro zeile
|
mvz.w 0xffff8210,d4 // byts pro zeile
|
||||||
mvz.w 0xffff82aa,d2 // zeilen ende
|
mvz.w 0xffff82aa,d2 // zeilen ende
|
||||||
|
|||||||
Reference in New Issue
Block a user