changeset 2930:e93ace49362e

rominfo.asm: Fix booting from ROMPak The ROM addresses to copy from had to be changed when building with ROMPak=1. rominfo/vectors: Add comment about address value dependencies between these two files.
author Tormod Volden <debian.tormod@gmail.com>
date Sat, 18 Jan 2014 21:56:00 +0100
parents 8629f64b7dd3
children 5d8613134a64
files level1/modules/rominfo.asm level1/modules/vectors.asm
diffstat 2 files changed, 16 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/level1/modules/rominfo.asm	Sat Jan 18 21:44:44 2014 +0100
+++ b/level1/modules/rominfo.asm	Sat Jan 18 21:56:00 2014 +0100
@@ -21,9 +21,14 @@
 rev      set   $01
 edition  set   1
 
-* Untested!
+* Tested (for level 1) on XRoar
+* The ROMPak must be autostarting by firing FIRQ
+* 
          IFNE  ROMPak
-         jmp   $C000+start
+         jmp   $C000+start+3      Offset 3 due to this line
+PakOffs  equ   $C000-$8000
+         ELSE
+PakOffs  equ   0
          ENDC
 
          mod   eom,name,tylg,atrv,start,size
@@ -172,7 +177,7 @@
          sta   $FFDD                   SET   M1
 
 * ROM relocation code -- copies the boot track into $2600
-RelROM   ldx   #$AE00                  src address (ROM)
+RelROM   ldx   #$AE00+PakOffs          src address (ROM)
          ldy   #$2600                  dst address (RAM)
          IFNE  H6309
          ldw   #$1200
@@ -180,11 +185,11 @@
          ELSE
 copyloop ldd   ,x++                    get 2 bytes from src
          std   ,y++                    put 2 bytes to dst
-         cmpx  #$AE00+$1200            at end?
-         blo   copyloop                nope, copy more...
+         cmpx  #$AE00+$1200+PakOffs    at end?
+         bne   copyloop                nope, copy more...
          ENDC
 * BOOT relocation code -- copies the bootfile into $2600+$1200
-RelBOOT  ldx   #$8000
+RelBOOT  ldx   #$8000+PakOffs
          ldy   #$2600+$1200
          IFNE  H6309
          ldw   #$2E00
@@ -192,7 +197,7 @@
          ELSE
 cpy2loop ldd   ,x++
          std   ,y++
-         cmpx  #$8000+$2E00
+         cmpx  #$8000+$2E00+PakOffs
          blo   cpy2loop
          ENDC
          jmp   $2602                   jump to OS rel code
--- a/level1/modules/vectors.asm	Sat Jan 18 21:44:44 2014 +0100
+++ b/level1/modules/vectors.asm	Sat Jan 18 21:56:00 2014 +0100
@@ -10,6 +10,10 @@
 * Comment
 * ------------------------------------------------------------------
 
+*
+* Note that the $8015 value for the RESET vector must match the
+* offset of the "start" label in rominfo.asm
+*
         IFP1
         use     defsfile
         ENDC