Skip to content

Commit

Permalink
feat: improved display of high memory of 1000MB+
Browse files Browse the repository at this point in the history
  • Loading branch information
kg68k committed Jul 28, 2022
1 parent 53afc4a commit 6aca306
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
28 changes: 26 additions & 2 deletions src/si.s
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ emu_ver_type:
emu_ver: .ds 1
emu_type: .ds 1

high_mem_area: .ds.l 2
mem_width: .ds.l 1

has_scsiex_type:.ds.b 1
scsiex_type: .ds.b 1

Expand Down Expand Up @@ -562,6 +565,8 @@ arg_end:
tst.b (opt_pow_flag,a6) ;--all,--cutよりも優先
bne benchmark_only

bsr init_misc2

bsr print_si_version
bsr print_emulator
bsr print_host
Expand Down Expand Up @@ -688,6 +693,23 @@ emu_check_exit:
DOS _EXIT


* 初期化いろいろ(メイン表示直前) -------------- *

init_misc2:

;メモリ容量の表示桁数
bsr Memory_GetHighArea
movem.l d0-d1,(high_mem_area,a6)
sub.l d0,d1 ;ハイメモリなしの場合は d1=0
moveq #3,d0
cmpi.l #1000*1024*1024,d1
bcs @f
moveq #4,d0
@@: move.l d0,(mem_width,a6)

rts


*┌────────────────────────────────────────┐
*│ System Information のバージョン │
*└────────────────────────────────────────┘
Expand Down Expand Up @@ -2226,7 +2248,7 @@ print_high_memory:
lea (sp),a0
STRCPY a1,a0,-1

bsr Memory_GetHighArea
movem.l (high_mem_area,a6),d0-d1
move.l d1,d2
beq print_himem_notinst
sub.l d0,d2 ;ハイメモリのバイト数
Expand All @@ -2253,6 +2275,8 @@ print_memory_sub:
bsr Memory_AreaToString
move.b #' ',(a0)+
move.l d2,d0
moveq #0,d1
move.l (mem_width,a6),d1
bsr Memory_SizeToString

move.b #' ',(a0)+
Expand Down Expand Up @@ -2293,7 +2317,7 @@ print_sram:
move.l d2,d0
lsr.l #8,d0
lsr.l #2,d0 ;キロバイト単位
moveq #.sizeof.('256'),d1 ;ハイメモリの最大 '256MB' に揃える
move.l (mem_width,a6),d1
bsr fe_iusing

lea (sramsize_kb,pc),a1
Expand Down
6 changes: 2 additions & 4 deletions src/si_memory.s
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ Memory_GetHighFreeSize::
move.l d1,-(sp)
moveq #_HIMEM_GETSIZE,d1
IOCS _HIMEM
move.l d1,d0
move.l (sp)+,d1
rts

Expand Down Expand Up @@ -190,23 +191,20 @@ Memory_AreaToString::
;メモリ容量を文字列化する。
;in
; d0.l ... バイト数
; d1.l ... 最小桁数
; a0.l ... 文字列バッファ(今のところ16バイトあれば足りる)
;out
; a0.l ... 文字列末尾のアドレス(NUL を指す)
;break d0
Memory_SizeToString::
move.l d1,-(sp)
clr d0
swap d0
lsr #4,d0 ;1024*1024で割ってメガバイト単位に変換

moveq #.sizeof.('256'),d1
bsr fe_iusing

move.b #'M',(a0)+
move.b #'B',(a0)+
clr.b (a0)
move.l (sp)+,d1
rts


Expand Down

0 comments on commit 6aca306

Please sign in to comment.