From c6e96f35926513de828b8511c0091224a6491f40 Mon Sep 17 00:00:00 2001 From: pjht Date: Mon, 14 Nov 2022 11:02:05 -0600 Subject: [PATCH] Move ROM to separate git repository --- config.toml | 4 +-- ram_map.c | 53 ------------------------------- rom/build_rom.sh | 5 --- rom/rom.68k | 79 ----------------------------------------------- rom/rom.bin | Bin 178 -> 0 bytes rom/rom.elf | Bin 924 -> 0 bytes rom/rom.ld | 5 --- 7 files changed, 2 insertions(+), 144 deletions(-) delete mode 100755 ram_map.c delete mode 100755 rom/build_rom.sh delete mode 100644 rom/rom.68k delete mode 100755 rom/rom.bin delete mode 100755 rom/rom.elf delete mode 100644 rom/rom.ld diff --git a/config.toml b/config.toml index e6f2324..b894b81 100644 --- a/config.toml +++ b/config.toml @@ -1,8 +1,8 @@ -symbol_tables = ["rom/rom.elf"] +symbol_tables = [] [[cards]] type = "rom" -image = "rom/rom.bin" +image = "../rom/rom.bin" [[cards]] type = "ram" diff --git a/ram_map.c b/ram_map.c deleted file mode 100755 index 3c8d5be..0000000 --- a/ram_map.c +++ /dev/null @@ -1,53 +0,0 @@ -#include - -uint8_t find_all_ram_cards(uint8_t* buf /* a1 */) { - uint8_t len = 0; // move.b 0, d0 - void* curr_card = (void*)0xff0000; // a0 = 0xff0000 - while(1) { // farc_loop: - curr_card += 0x100; // lea (0x100, a0), a0 - uint8_t type = *((uint8_t*)(curr_card+0xff)); // move.b (0xff, a0), d0 - if (type == 0) { // beq.b farc_done - break; - } - if (type != 2) { // cmp.b #0x2, d0; bne.b farc_loop - continue; - } - *buf = (uint8_t)((uint32_t)curr_card>>16); - buf += 1; // inc a1 - len += 1; // inc d1 - } // bra.b farc_loop - // farc_done: - return len; -} - -void sort_ram_cards(uint8_t* buf) { - uint8_t len = find_all_ram_cards(buf); - // Insertion sort buf using the aligment of the cards - uint8_t i = 1; - while(1) { - if (i >= len) { - break; - } - uint8_t num = buf[i]; - void* card = (void*)((uint32_t)num<<16); - *((uint32_t*)card)=0xfffffffe; - uint32_t x = ~(*((uint32_t*)card)) + 1; - uint8_t j = i - 1; - while(1) { - if (j == 0) { - break; - } - uint8_t num = buf[j]; - void* card = (void*)((uint32_t)num<<16); - *((uint32_t*)card)=0xfffffffe; - uint32_t aj = ~(*((uint32_t*)card)) + 1; - if (aj <= x) { - break; - } - buf[j + 1] = buf[j]; - j = j - 1; - } - buf[j + 1] = buf[i]; - i = i + 1; - } -} diff --git a/rom/build_rom.sh b/rom/build_rom.sh deleted file mode 100755 index c2181c2..0000000 --- a/rom/build_rom.sh +++ /dev/null @@ -1,5 +0,0 @@ -#! /bin/bash -x -m68k-elf-as -m68010 --register-prefix-optional -o rom.o rom.68k -m68k-elf-ld -z max-page-size=1 -T rom.ld -o rom.elf rom.o -m68k-elf-objcopy -O binary rom.elf rom.bin - diff --git a/rom/rom.68k b/rom/rom.68k deleted file mode 100644 index b5a9d22..0000000 --- a/rom/rom.68k +++ /dev/null @@ -1,79 +0,0 @@ - .long fakestack, start -start: - move.b #0x1, d0 | Find the ROM card - bra.b find_first_card -romfindret: - move.l a0, a6 | Save the ROM card IO base in a6 for later - lea (0xF0, a6), a7 | Set up the stack at the end of the ROM's IO space RAM - bsr.b find_largest_ram | Find the largest RAM card and put the IO base in a5 - move.l a0, a5 - move.l d0, d7 - move.b #0x4, d0 | Find a storage card and put the IO base in a4 - bsr.b find_first_card - move.l a0, a4 - | Transfer the bootsector load code to the ROM's - | built in RAM at the start of it's IO space - move.w #(ramcode_end - ramcode), d0 | Put the length of the ramcode in d0 - move.w #ramcode, a0 | Put the address of the ramcode in a0 - move.l a6, a1 | Put the start of the ROM's IO space RAM in a0 - ramcode_loop: - move.b (a0)+, (a1)+ | Transfer a byte of ramcode to the ROM's IO space RAM - dbra d0, ramcode_loop | Loop back if there is more to transfer - jmp (a6) | Jump to the ramcode - stop #0x2700 - -ramcode: - move.b #0x0, (0xFE, a6) | Disable the ROM - move.l #0x1, (a5) | Enable the RAM at base 0x0 - move.l d7, a7 - | Load sector 0 to 0x0 - move.l #0x0, (a4) | Set the sector number to 0 - | Transfer 0x100 (256) bytes from the storage card's data register to 0x0 - move.w #0x0, a1 | Load a1, the destination address register, with 0x0 - move.w #0xFF, d0 | Load d0 with the sector size - 1. - sector_loop: - move.b (4, a4), (a1)+ | Transfer a byte of sector data to the destination - dbra d0, sector_loop | Loop back if there is more to transfer - jmp (0x0).W | Jump to the loaded sector - - stop #0x2700 -ramcode_end: - -nop | Padding to make sure ramcode_end and find_first_card are different - -| Finds the first card with the type in d0.b, and returns it's IO base address in a0, or 0 if not found -| Clobbers d1 -find_first_card: - move.l #0xff0000, a0 | a0 holds the address of the current card -ffc_loop: - lea (0x100,a0), a0 | adda.l #$100,a0 ; Move to the next card - move.b (0xff, a0), d1 | Load the type of the card into d1 - beq.b ffc_done | If the type is 0 (empty slot), we have scanned all cards, so exit the loop - cmp.b d0, d1 | If the card is the type we want, return with the address in a0 - beq.b ffc_done - bra.b ffc_loop | Loop back and check the next card -ffc_done: - rts - -| Finds the largest RAM card, and returns it's IO base address in a0 and size in d0, or 0 if not found -| Clobbers d1, a1 -find_largest_ram: - move.l #0x0, d0 | d0 holds the size of the largest RAM card found - move.w #0x0, a0 | a0 holds the address of the largest RAM card found - move.l #0xff0000, a1 | a1 holds the address of the current card -flr_loop: - lea (0x100,a1), a1 | adda.l #$100,a0 ; Move to the next card - move.b (0xff, a1), d1 | Load the type of the card into d1 - beq.b flr_done | If the type is 0 (empty slot), we have scanned all cards, so exit the loop - cmp.b #0x2, d1 | If the card isn't a RAM card, skip it - bne.b flr_loop - move.l (0x4, a1), d1 | Load the card's size into d1 - cmp.l d0, d1 | If the current size is less than the largest size found, go back to the start of the loop - ble.b flr_loop - move.l d1, d0 | Store the size and address of the new largest card in d0 and a0 - move.l a1, a0 - bra.b flr_loop | Loop back and check the next card -flr_done: - rts -fakestack: - .long romfindret diff --git a/rom/rom.bin b/rom/rom.bin deleted file mode 100755 index 258e4775669ff61a2eef6afaba0c4bcaab2cb95d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 178 zcmZQz00R!Y8isWOHVljj5jr0J?-)KLW@vfnF#tta65TXB3~U&53~Cr`l>CHl1fKZ+ z$M2e7kvfBH4N&httvx`JQO{iiL^Bux#ek~+3%y}r0jm7v_k)1}q}H!cp@!i<1B2rW zMg}1bhX3hon;6oW55mlI==+UY64|Nco-R&(mp6@GO%oF$bX^0sNk9K K$gdP=fe-*^wJ_oU diff --git a/rom/rom.elf b/rom/rom.elf deleted file mode 100755 index b04fb750c6f29eb3a22d36bf5eb30cac599cf360..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 924 zcmah|O=}ZT6g@MhU!YKfpddn;P190BC|w3YiZy~v5en^YGR{X*n`F|LDYOuB!Gr76*4~IBgtix*Vtu?lGpWOs$#J2x%Z(YU;V!ss-THz>+3|Hh5%Jj|K!0MhSt z&oSmFv!r*6ahB6}$zSI5GP&7F{OgR@x&9`3JEynF>p8tkUd!o#d@rZ_~l+qSaMi7YsiRLO1NumvNKbP8|0!2>m2h8IL0WFA3sah^S*)B)Z~;NqC$9)xk+O z@m??|D$8xdGK2Y$|L6O($hXf