Yes, I had considered mapping it twice, at $0080 and $ff80, but I don't think it's worth the effort.
Neil
Yeah, unless the two bytes were critical to making it fit, I couldn't see mapping it twice. If it came up just a little bit too long, I'd be more inclined to mapping a second much smaller DPROM with just the 16byte LED segment table into the I/O space, so it's still available if the main DPROM is switched out of the memory map.
I do believe the shifting the data byte digit in will always be smaller than "typing across", but I may keep juggling it to see how close it can get. At the very least it might make a test program to type in at $0200 with the DROM micro-monitor that can be entered in under a page of code.
For instance, it just dawned on me this morning that, given that NMI service is not going to be installed until after the DROM is turned off, there are two "free" hard-coded bytes at the top of they are of use.
It also occurred to me that, if just six display LCDs are selected, in addition to using the bottom one for the KEY read, and do the LCD digit / key row in base+1..6, the top select could be used to toggle the DROM off and the underlying access on, if a quad NAND is used for a /S /R latch and to generate the qualified /DIODE_RD and /MAIN_RD.
I think the loop target here may on a rare occasion cause a dropped key:
Code: Select all
loop_01:
lda keys
bpl loop_90 ; no key pressed...
This goes to the loop that waits until the key is released ... and it goes into the loop with the key not pressed, so should pass through to the following code ... but
if the first and second test were to occur just as the key line goes high, it will be treated as an already handled key that is waiting for release.
Actually, for a "Paleolithic" board, I do not mind that the LED's will glitch if you hold the key down ... it gives a side-effect form of hardware key press feedback.
The only opportunity I can see to make the base code directly smaller only saves two bytes, by cycle through the LEDs from right to left rather than left to right:
Code: Select all
...
ldy #0 ; not strictly required... will get there eventually
...
; update the display count; we have eight leds but we only drive six
; to save code space (we don't need to clear them)
iny
cpy #6
bne loop
ldy #0
bra loop
...
to:
Code: Select all
ldy #5 ; NB. might actually be required,
; IF using the other two selects for something else
...
; update the display count; we have eight leds but we only drive six
; to save code space (we don't need to clear them)
dey
bpl loop
ldy #5
bra loop
...