2020-01-10 20:17:23 +00:00
|
|
|
;
|
2020-05-02 17:46:06 +00:00
|
|
|
; 2020-01-29, Greg King
|
2020-01-10 20:17:23 +00:00
|
|
|
;
|
2020-05-02 17:46:06 +00:00
|
|
|
; unsigned short get_numbanks (void);
|
2020-01-10 20:17:23 +00:00
|
|
|
; /* Return the number of RAM banks that the machine has. */
|
|
|
|
;
|
|
|
|
; The Commander X16 version of MEMTOP returns with an extra value:
|
|
|
|
; The accumulator describes the number of RAM banks that exist on the hardware.
|
2020-05-02 17:46:06 +00:00
|
|
|
; A zero accumulator means that there are 256 RAM banks.
|
2020-01-10 20:17:23 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
.export _get_numbanks
|
|
|
|
|
|
|
|
.import MEMTOP
|
|
|
|
|
|
|
|
|
|
|
|
_get_numbanks:
|
|
|
|
sec
|
|
|
|
jsr MEMTOP
|
|
|
|
ldx #>$0000
|
2020-05-02 17:46:06 +00:00
|
|
|
cmp #<$0100 ; are there 256 banks?
|
|
|
|
bne :+
|
|
|
|
inx ; yes
|
|
|
|
: rts
|