Skip to content

Commit 4bca65e

Browse files
authored
Merge pull request #626 from b3rendsh/master
MSX fix memory and base year
2 parents 2d0ebf4 + cbfa6d9 commit 4bca65e

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

Source/HBIOS/hbios.asm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1957,7 +1957,8 @@ ROMRESUME:
19571957
#ENDIF
19581958
;
19591959
#IF (MEMMGR == MM_MSX)
1960-
LD A,((ROMSIZE + RAMSIZE) / 16) - 2 + RAMBIAS * 2
1960+
RAMSEG .EQU ((ROMSIZE + RAMSIZE) / 16) - 2 + (RAMBIAS * 2)
1961+
LD A,RAMSEG
19611962
OUT (MPGSEL_2),A
19621963
INC A
19631964
OUT (MPGSEL_3),A

Source/HBIOS/rp5rtc.asm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,9 @@ RP5RTC_SETTIM:
324324

325325
LD B, REG_1YEAR
326326
LD A, (RP5RTC_YR)
327+
; 2-DIGIT YEAR IS RELATIVE TO BASE YEAR 1980
328+
ADD A,$20 ; ADD OFFSET
329+
DAA ; BCD
327330
CALL RP5RTC_WRVL
328331

329332
LD B, MODE_ALRMST
@@ -378,6 +381,9 @@ RP5RTC_RDTIM:
378381

379382
LD B, REG_1YEAR
380383
CALL RP5RTC_RDVL
384+
; 2-DIGIT YEAR IS RELATIVE TO BASE YEAR 1980
385+
SUB $20 ; SUBSTRACT OFFSET
386+
DAA ; BCD
381387
LD (RP5RTC_YR), A
382388

383389
RET

0 commit comments

Comments
 (0)