Skip to content

Commit

Permalink
Unified image building
Browse files Browse the repository at this point in the history
  • Loading branch information
tomstorey committed Dec 22, 2020
1 parent 328af99 commit eed0997
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
5 changes: 3 additions & 2 deletions source/char_rom.s
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#if !defined(unified_image) || unified_image == 0
#target ROM
#code ROM, 0, 512

.org 0
#endif

; Char ROM is made up of 256 double words, each corresponding to
; one character able to be displayed.
Expand Down Expand Up @@ -294,5 +297,3 @@
.dw 0x0000 ; 253 0xFD 11111101 375
.dw 0x0000 ; 254 0xFE 11111110 376
.dw 0xFFFF ; 255 0xFF 11111111 377

.end
22 changes: 22 additions & 0 deletions source/clock.s
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
; Uncomment the below line if you are using the serial bootloader to
; load code and execute from RAM. Adjustments will be made to assemble
; the code appropriately for execution from RAM, as defined in the
; platform.inc file.
; #define serial_loading 1

; Revision A hardware used 74HC595 shift registers for the LED driver
Expand All @@ -6,6 +10,14 @@
; following flag to 1.
#define rev_a_hw 0

; Adjust the following setting accordingly, if you would like to build
; a unified ROM image containing application code, TZ ROM and char ROM
; in a single image, instead of individually.
;
; 0 = build only application code
; 1 = build unified image
#define unified_image 0

#target ROM
#include "platform.inc"
#include "ctc.inc"
Expand Down Expand Up @@ -526,5 +538,15 @@ wd_poke_task
#include "ctc_isr.s"
#include "c_lib.s"

#if unified_image == 1
.org TZ_ROM_BASE

#include "tz_rom.s"

.org CHAR_ROM_BASE

#include "char_rom.s"

#endif

.end
4 changes: 4 additions & 0 deletions source/platform.inc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ RAM_BASE .equ 0x7800
RAM_SZ .equ 1792
#else
ROM_BASE .equ 0
#if unified_image == 0
ROM_SZ .equ 24576
#else
ROM_SZ .equ 65536
#endif

RAM_BASE .equ 0x6000
RAM_SZ .equ 8192
Expand Down
5 changes: 4 additions & 1 deletion source/tz_rom.s
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#if !defined(unified_image) || unified_image == 0
#target ROM
#code ROM, 0, 8192

.org 0
#endif

; Correct as of Tue 31 Mar 2020

.org 0
;---- Entry 0
; This entry is reserved for blanking display lines
.db 0xFF
Expand Down

0 comments on commit eed0997

Please sign in to comment.