From ef18a9ca24cdca4b082a0899dd6a18cf2c4d4ecf Mon Sep 17 00:00:00 2001 From: Erik Hemming Date: Wed, 2 Nov 2022 23:13:38 +0100 Subject: [PATCH 01/13] LIST/NOLIST includes --- poseidon/loader.s | 4 +++- xaudio/src/replay_audio.s | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/poseidon/loader.s b/poseidon/loader.s index 7035011..0b23fc6 100644 --- a/poseidon/loader.s +++ b/poseidon/loader.s @@ -17,15 +17,17 @@ MAX_ROM_TAGS = 32 ;ENABLE_KPRINTF + NOLIST include exec/exec.i include exec/nodes.i include exec/resident.i include exec/libraries.i include lvo/exec_lib.i include kprintf.i + LIST - jmp S + jmp (S)(pc) moveq.l #-1,d0 rts diff --git a/xaudio/src/replay_audio.s b/xaudio/src/replay_audio.s index ea0656f..f05c3df 100644 --- a/xaudio/src/replay_audio.s +++ b/xaudio/src/replay_audio.s @@ -106,7 +106,6 @@ VERSTAG MACRO include lvo/exec_lib.i include lvo/expansion_lib.i include lvo/timer_lib.i - LIST ************************************************************************* @@ -189,6 +188,7 @@ FALSE EQU 0 Start: IFD STANDALONE_TESTCODE + LIST move.l 4.w,a6 lea .replayBase(pc),a0 @@ -743,6 +743,7 @@ audio: ; incbin "084_classicbrk-24.aif" ; incbin "Casio-MT-45-16-Beat.wav" ELSE + LIST moveq #-1,d0 rts ENDC ; STANDALONE_TESTCODE @@ -2454,7 +2455,7 @@ ga_Copyright: lea .copyright(pc),a0 move.l a0,d0 rts -.copyright dc.b " 2022 All rights reserved",0 +.copyright dc.b "� 2022 All rights reserved",0 even ga_Version: From 4955cc6b93f7431dfa999c0da38fca3bfd944d6f Mon Sep 17 00:00:00 2001 From: Erik Hemming Date: Wed, 2 Nov 2022 11:13:16 +0100 Subject: [PATCH 02/13] set serper to 115kbps from kprintf macro --- addmem/kprintf.i | 7 ++++--- eth/kprintf.i | 2 ++ oled/kprintf.i | 8 ++++++-- poseidon/kprintf.i | 7 ++++--- rtc/kprintf.i | 8 ++++++-- rtg/replay.card.asm | 7 ++++--- sdcard/kprintf.i | 8 ++++++-- usb/kprintf.i | 7 ++++--- xaudio/src/kprintf.i | 7 ++++--- 9 files changed, 40 insertions(+), 21 deletions(-) diff --git a/addmem/kprintf.i b/addmem/kprintf.i index 3599a33..1b0e9c6 100644 --- a/addmem/kprintf.i +++ b/addmem/kprintf.i @@ -56,6 +56,8 @@ kprintf MACRO bra.b _kprintf_end _kprintf: movem.l d0-d1/a0-a3/a6,-(sp) move.l $4.w,a6 +; jsr -504(a6) ; _LVORawIOInit (execPrivate7) + move.w #(3546895/115200),$dff032 move.l 28(sp),a0 lea 32(sp),a1 lea .putch(pc),a2 @@ -72,10 +74,9 @@ _kprintf: movem.l d0-d1/a0-a3/a6,-(sp) movem.l (sp)+,d0-d1/a0-a3/a6 rts -.putch: movem.l d0-d1/a0-a1/a6,-(sp) - move.l $4.w,a6 +.putch: exg.l a3,a6 jsr -516(a6) ; _LVORawPutChar (execPrivate9) - movem.l (sp)+,d0-d1/a0-a1/a6 + exg.l a6,a3 rts _kprintf_end: ENDC diff --git a/eth/kprintf.i b/eth/kprintf.i index 34d5b38..51f8057 100644 --- a/eth/kprintf.i +++ b/eth/kprintf.i @@ -59,6 +59,8 @@ kprintf MACRO _kprintf: movem.l d0-d2/a0-a3/a6,-(sp) movea.l $4.w,a6 +; jsr -504(a6) ; _LVORawIOInit (execPrivate7) + move.w #(3546895/115200),$dff032 lea .dos(pc),a1 moveq.l #36,d0 ; fputc is kick 2.x+ diff --git a/oled/kprintf.i b/oled/kprintf.i index 03ab712..7c56f85 100644 --- a/oled/kprintf.i +++ b/oled/kprintf.i @@ -54,6 +54,8 @@ kprintf MACRO bra.b _kprintf_end _kprintf: movem.l d0-d1/a0-a3/a6,-(sp) move.l $4.w,a6 +; jsr -504(a6) ; _LVORawIOInit (execPrivate7) + move.w #(3546895/115200),$dff032 move.l 28(sp),a0 lea 32(sp),a1 lea .putch(pc),a2 @@ -70,8 +72,10 @@ _kprintf: movem.l d0-d1/a0-a3/a6,-(sp) movem.l (sp)+,d0-d1/a0-a3/a6 rts -.putch: move.l a3,a6 - jmp -516(a6) ; _LVORawPutChar (execPrivate9) +.putch: exg.l a3,a6 + jsr -516(a6) ; _LVORawPutChar (execPrivate9) + exg.l a6,a3 + rts _kprintf_end: ENDC diff --git a/poseidon/kprintf.i b/poseidon/kprintf.i index 05011c1..48dca04 100644 --- a/poseidon/kprintf.i +++ b/poseidon/kprintf.i @@ -54,6 +54,8 @@ kprintf MACRO bra.b _kprintf_end _kprintf: movem.l d0-d1/a0-a3/a6,-(sp) move.l $4.w,a6 +; jsr -504(a6) ; _LVORawIOInit (execPrivate7) + move.w #(3546895/115200),$dff032 move.l 28(sp),a0 lea 32(sp),a1 lea .putch(pc),a2 @@ -70,10 +72,9 @@ _kprintf: movem.l d0-d1/a0-a3/a6,-(sp) movem.l (sp)+,d0-d1/a0-a3/a6 rts -.putch: movem.l d0-d1/a0-a1/a6,-(sp) - move.l $4.w,a6 +.putch: exg.l a3,a6 jsr -516(a6) ; _LVORawPutChar (execPrivate9) - movem.l (sp)+,d0-d1/a0-a1/a6 + exg.l a6,a3 rts _kprintf_end: ENDC diff --git a/rtc/kprintf.i b/rtc/kprintf.i index e367dd6..d951427 100644 --- a/rtc/kprintf.i +++ b/rtc/kprintf.i @@ -58,6 +58,8 @@ kprintf MACRO bra.b _kprintf_end _kprintf: movem.l d0-d1/a0-a3/a6,-(sp) move.l $4.w,a6 +; jsr -504(a6) ; _LVORawIOInit (execPrivate7) + move.w #(3546895/115200),$dff032 move.l 28(sp),a0 lea 32(sp),a1 lea .putch(pc),a2 @@ -74,8 +76,10 @@ _kprintf: movem.l d0-d1/a0-a3/a6,-(sp) movem.l (sp)+,d0-d1/a0-a3/a6 rts -.putch: move.l a3,a6 - jmp -516(a6) ; _LVORawPutChar (execPrivate9) +.putch: exg.l a3,a6 + jsr -516(a6) ; _LVORawPutChar (execPrivate9) + exg.l a6,a3 + rts _kprintf_end: ENDC diff --git a/rtg/replay.card.asm b/rtg/replay.card.asm index 53d76bf..3c15352 100644 --- a/rtg/replay.card.asm +++ b/rtg/replay.card.asm @@ -139,6 +139,8 @@ MEMF_REPLAY EQU (1<<14) bugprintf: movem.l d0-d1/a0-a3/a6,-(sp) move.l $4.w,a6 +; jsr -504(a6) ; _LVORawIOInit (execPrivate7) + move.w #(3546895/115200),$dff032 move.l 28(sp),a0 lea 32(sp),a1 lea .putch(pc),a2 @@ -155,10 +157,9 @@ bugprintf: movem.l (sp)+,d0-d1/a0-a3/a6 rts -.putch: move.l a6,-(sp) - move.l a3,a6 +.putch: exg.l a3,a6 jsr -516(a6) ; _LVORawPutChar (execPrivate9) - move.l (sp)+,a6 + exg.l a6,a3 rts _bugprintf_end: rts diff --git a/sdcard/kprintf.i b/sdcard/kprintf.i index a2b3692..0bfad52 100644 --- a/sdcard/kprintf.i +++ b/sdcard/kprintf.i @@ -52,6 +52,8 @@ kprintf MACRO bra.b _kprintf_end _kprintf: movem.l d0-d1/a0-a3/a6,-(sp) move.l $4.w,a6 +; jsr -504(a6) ; _LVORawIOInit (execPrivate7) + move.w #(3546895/115200),$dff032 move.l 28(sp),a0 lea 32(sp),a1 lea .putch(pc),a2 @@ -68,8 +70,10 @@ _kprintf: movem.l d0-d1/a0-a3/a6,-(sp) movem.l (sp)+,d0-d1/a0-a3/a6 rts -.putch: move.l a3,a6 - jmp -516(a6) ; _LVORawPutChar (execPrivate9) +.putch: exg.l a3,a6 + jsr -516(a6) ; _LVORawPutChar (execPrivate9) + exg.l a6,a3 + rts _kprintf_end: ENDC diff --git a/usb/kprintf.i b/usb/kprintf.i index 53f9245..84eca9d 100644 --- a/usb/kprintf.i +++ b/usb/kprintf.i @@ -54,6 +54,8 @@ kprintf MACRO bra.b _kprintf_end _kprintf: movem.l d0-d1/a0-a3/a6,-(sp) move.l $4.w,a6 +; jsr -504(a6) ; _LVORawIOInit (execPrivate7) + move.w #(3546895/115200),$dff032 move.l 28(sp),a0 lea 32(sp),a1 lea .putch(pc),a2 @@ -70,10 +72,9 @@ _kprintf: movem.l d0-d1/a0-a3/a6,-(sp) movem.l (sp)+,d0-d1/a0-a3/a6 rts -.putch: movem.l d0-d1/a0-a1/a6,-(sp) - move.l $4.w,a6 +.putch: exg.l a3,a6 jsr -516(a6) ; _LVORawPutChar (execPrivate9) - movem.l (sp)+,d0-d1/a0-a1/a6 + exg.l a6,a3 rts _kprintf_end: ENDC diff --git a/xaudio/src/kprintf.i b/xaudio/src/kprintf.i index bf90785..414fc49 100644 --- a/xaudio/src/kprintf.i +++ b/xaudio/src/kprintf.i @@ -52,6 +52,8 @@ kprintf MACRO bra.b _kprintf_end _kprintf: movem.l d0-d1/a0-a3/a6,-(sp) move.l $4.w,a6 +; jsr -504(a6) ; _LVORawIOInit (execPrivate7) + move.w #(3546895/115200),$dff032 move.l 28(sp),a0 lea 32(sp),a1 lea .putch(pc),a2 @@ -68,10 +70,9 @@ _kprintf: movem.l d0-d1/a0-a3/a6,-(sp) movem.l (sp)+,d0-d1/a0-a3/a6 rts -.putch: move.l a6,-(sp) - move.l a3,a6 +.putch: exg.l a3,a6 jsr -516(a6) ; _LVORawPutChar (execPrivate9) - move.l (sp)+,a6 + exg.l a6,a3 rts _kprintf_end: ENDC From fc8d298a7c072e6e3cc289669ae10a5409228811 Mon Sep 17 00:00:00 2001 From: Erik Hemming Date: Wed, 2 Nov 2022 23:14:19 +0100 Subject: [PATCH 03/13] [rtc] remove kprintf kludge --- rtc/kprintf.i | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtc/kprintf.i b/rtc/kprintf.i index d951427..168513f 100644 --- a/rtc/kprintf.i +++ b/rtc/kprintf.i @@ -15,8 +15,8 @@ kprintf MACRO IFD ENABLE_KPRINTF - cmp.l #$baadc0de,0.l ; kludge to dynamically enable/disable printf's - bne.b .skip\@ +; cmp.l #$baadc0de,0.l ; kludge to dynamically enable/disable printf's +; bne.b .skip\@ ifnc "","\9" move.l \9,-(sp) From 3092491fd9f458dfd0b4131f1a4ed155dc9d2d41 Mon Sep 17 00:00:00 2001 From: Erik Hemming Date: Wed, 2 Nov 2022 23:18:04 +0100 Subject: [PATCH 04/13] [eth] add reseteth test --- eth/Makefile | 3 + eth/reseteth.s | 277 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 280 insertions(+) create mode 100644 eth/reseteth.s diff --git a/eth/Makefile b/eth/Makefile index 640c6d7..3327917 100644 --- a/eth/Makefile +++ b/eth/Makefile @@ -13,6 +13,9 @@ $(TARGET): $(INCLUDES) $(TARGET): $(SOURCE) $(VASM) $< -o $@ -L $(LISTFILE) $(VASM_FLAGS) -I $(INC_ASM) -I $(SANA2)/include +reseteth: reseteth.s + $(VASM) $< -o $@ -L $(LISTFILE) $(VASM_FLAGS) -I $(INC_ASM) -I $(SANA2)/include + clean: rm -rf $(TARGET) $(LISTFILE) diff --git a/eth/reseteth.s b/eth/reseteth.s new file mode 100644 index 0000000..cbf99bc --- /dev/null +++ b/eth/reseteth.s @@ -0,0 +1,277 @@ +ENABLE_KPRINTF + + include "enc624.i" + include "kprintf.i" + +HW_ResetEth: + kprintf "Reset ETH" + lea ($40000000+$00300000),a0 + + kprintf " > Wait EUDAST stable.." + +; 1. Write 1234h to EUDAST. +; 2. Read EUDAST to see if it now equals 1234h. If +; it does not, the SPI/PSP interface may not be +; ready yet, so return to step 1 and try again. + + moveq.l #100,d1 + move.w #$1234,d0 +.notrdy move.w d0,(EUDAST,a0) + cmp.w (EUDAST,a0),d0 + beq.b .psprdy + bsr Wait25us + dbf d1,.notrdy + bra .error + +.psprdy + kprintf " > Write/Readback .." + moveq.l #0,d0 + moveq.l #0,d1 + moveq.l #0,d2 + moveq.l #0,d3 + moveq.l #0,d4 + moveq.l #0,d5 + move.w #32-1,d0 +.rwtest move.w d0,d1 + and.l #%11111,d1 + or.w #$100,d1 ; reserved bit 8, set high + move.w d1,(MIREGADR,a0) + move.w (MIREGADR,a0),d2 + move.w (MIREGADR,a0),d3 + move.w (MIREGADR,a0),d4 + move.w (MIREGADR,a0),d5 + bsr Wait25us + kprintf " > %04lx vs %04lx,%04lx,%04lx,%04lx",d1,d2,d3,d4,d5 +; cmp.w d1,d0 +; bne .error + dbf d0,.rwtest + + kprintf " > Wait CLKRDY .." + +; 3. Poll CLKRDY (ESTAT<12>) and wait for it to +; become set. + + moveq.l #100,d1 +.noclk btst #ESTATB_CLKRDY,(ESTATH,a0) + bne.b .clkrdy + bsr Wait25us + dbf d1,.noclk + bra .error + +.clkrdy + kprintf " > Issue a System Reset .." + +; 4. Issue a System Reset command by setting +; ETHRST (ECON2<4>). +; 5. In software, wait at least 25 s for the Reset to +; take place and the SPI/PSP interface to begin +; operating again. + + moveq.l #100,d1 + move.w #ECON2F_ETHRST,(ECON2SET,a0) +.waitrst bsr Wait25us + btst #ECON2B_ETHRST,(ECON2L,a0) + beq.b .resetok + dbf d1,.waitrst + bra .error + +.resetok + kprintf " > Check EUDAST .." + +; 6. Read EUDAST to confirm that the System Reset +; took place. EUDAST should have reverted back +; to its Reset default of 0000h. + + tst.w (EUDAST,a0) + bne .error + + kprintf " > Wait PHY .." + +; 7. Wait at least 256 s for the PHY registers and +; PHY status bits to become available + + bsr Wait250us + + + kprintf " > Reset PHY .." + +; 7.5 PHY Subsystem Reset +; The PHY module may be reset by setting the PRST bit +; (PHCON1<15>). The PHY register contents all revert +; to their default values. + +; * The POR and System Resets automatically perform a +; * PHY Reset, so this step does not need to be performed +; * after a System or Power-on Reset. + + moveq.l #PHCON1,d0 + move.w #PHCON1F_PRST,d1 + bsr HW_WritePhy + +; It is recom mended that, after issuing a Reset, the host controller +; polls PRST and waits for it to be cleared by hardware +; before using the PHY. + + kprintf " > Wait PHY .." + + moveq.l #100,d7 +.waitphy moveq.l #PHCON1,d0 + bsr HW_ReadPhy + and.w #PHCON1F_PRST,d0 + beq.b .ok + bsr Wait25us + dbf d7,.waitphy + + bra .error + +.ok + ; read PHY regs + + moveq.l #PHCON1,d0 + bsr HW_ReadPhy + kprintf " > PHCON1 = $%04lx ($1000)",d0 + + moveq.l #PHSTAT1,d0 + bsr HW_ReadPhy + kprintf " > PHSTAT1 = $%04lx ($7809)",d0 + + moveq.l #PHANA,d0 + bsr HW_ReadPhy + kprintf " > PHANA = $%04lx ($01e1)",d0 + + moveq.l #PHANLPA,d0 + bsr HW_ReadPhy + kprintf " > PHANLPA = $%04lx ($xxxx)",d0 + + moveq.l #PHANE,d0 + bsr HW_ReadPhy + kprintf " > PHANE = $%04lx ($0000)",d0 + + moveq.l #PHCON2,d0 + bsr HW_ReadPhy + kprintf " > PHCON2 = $%04lx ($0002)",d0 + + moveq.l #PHSTAT2,d0 + bsr HW_ReadPhy + kprintf " > PHSTAT2 = $%04lx ($xx0x)",d0 + + moveq.l #PHSTAT3,d0 + bsr HW_ReadPhy + kprintf " > PHSTAT3 = $%04lx ($0040)",d0 + + ; DONE + + kprintf " > Reset done." + move.l #0,d0 + rts + +.error: kprintf " > Reset failed." + move.l #1337,d0 + rts + +Wait25us: move.l d0,-(sp) + move.w #25,d0 +.wait tst.b $bfe001 ; approx 1us + dbf d0,.wait + move.l (sp)+,d0 + rts + +Wait250us: move.w d0,-(sp) + move.w #250,d0 +.wait tst.b $bfe001 ; approx 1us + dbf d0,.wait + move.w (sp)+,d0 + rts + +HW_ReadPhy: +; To read from a PHY register: +; 1. Write the address of the PHY register to read +; from into the MIREGADR register +; (Register 3-1). Make sure to also set reserved +; bit 8 of this register. +; 2. Set the MIIRD bit (MICMD<0>, Register 3-2). +; The read operation begins and the BUSY bit +; (MISTAT<0>, Register 3-3) is automatically set +; by hardware. +; 3. Wait 25.6 s. Poll the BUSY (MISTAT<0>) bit to +; be certain that the operation is complete. While +; busy, the host controller should not start any +; MIISCAN operations or write to the MIWR +; register. When the MAC has obtained the register +; contents, the BUSY bit will clear itself. +; 4. Clear the MIIRD (MICMD<0>) bit. +; 5. Read the desired data from the MIRD register. +; For 8-bit interfaces, the order that these bytes +; are read is unimportant. + +; move.l g_MachEnc(a6),a0 + + and.l #%11111,d0 +; kprintf "Read PHY reg $%lx",d0 + + or.w #$100,d0 ; reserved bit 8, set high + + moveq.l #10,d1 +.busy move.w d0,(MIREGADR,a0) + bsr Wait25us + bset #MICMDB_MIIRD,(MICMDL,a0) + + bsr Wait25us + + btst #MISTATB_BUSY,(MISTATL,a0) + beq.b .done + + bsr Wait25us + dbf d1,.busy + bra.b .error + +.done + bsr Wait25us + bclr #MICMDB_MIIRD,(MICMDL,a0) + bsr Wait25us + move.w (MIRD,a0),d0 +; kprintf " > $%lx",d0 + rts + +.error: kprintf " > PHY read %lx failed.",d0 + moveq.l #-1,d0 + rts + +HW_WritePhy: +; To write to a PHY register: +; 1. Write the address of the PHY register to write to +; into the MIREGADR register. Make sure to also +; set reserved bit 8 of this register. +; 2. Write the 16 bits of data into the MIWR register. +; The low byte must be written first, followed by +; the high byte. +; 3. Writing to the high byte of MIWR begins the +; MIIM transaction and the BUSY (MISTAT<0>) +; bit is automatically set by hardware. + +; move.l g_MachEnc(a6),a0 + + and.l #%11111,d0 +; kprintf "Write PHY reg $%lx data %lx",d0,d1 + + or.w #$100,d0 ; reserved bit 8, set high + + bsr Wait25us + move.w d0,(MIREGADR,a0) + bsr Wait25us + move.w d1,(MIWR,a0) + bsr Wait25us + + moveq.l #10,d1 +.busy bsr Wait25us + btst #MISTATB_BUSY,(MISTATL,a0) + beq.b .done + dbf d1,.busy + bra.b .error + +.done bsr HW_ReadPhy ; not needed + rts + +.error: kprintf " > PHY write %lx failed.",d0 + moveq.l #-1,d0 + rts From 915e6cd6f63b7ae15f385a9819fafe73aa812a6d Mon Sep 17 00:00:00 2001 From: Erik Hemming Date: Mon, 7 Nov 2022 21:39:04 +0100 Subject: [PATCH 05/13] Make usb_eth.autoconfig 8MB (to include timer registers) --- usb/addconfig.s | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usb/addconfig.s b/usb/addconfig.s index cad9b35..9c04506 100644 --- a/usb/addconfig.s +++ b/usb/addconfig.s @@ -34,7 +34,7 @@ VERSION = 1 REVISION= 0 -VERSTRING dc.b 'usb_eth.autoconfig 1.1 (15.3.2022) ZorroIII config for Replay USB/Ethernet Card',13,10,0 +VERSTRING dc.b 'usb_eth.autoconfig 1.2 (7.11.2022) ZorroIII config for Replay USB/Ethernet Card',13,10,0 even romtag: dc.w RTC_MATCHWORD @@ -64,7 +64,7 @@ AddBoardConfig: .VENDOR = 5060 ; Replay .PRODUCT = 16 ; usb .SERIAL = $12345678 -.BOARDSIZE = $7 ; %111 = 4MB +.BOARDSIZE = $0 ; %000 = 8MB movem.l d1/a0/a1,-(sp) moveq #0,d0 movea.l 4.w,a6 @@ -99,7 +99,7 @@ AddBoardConfig: movea.l d0,a0 move.l #$40000000,cd_BoardAddr(a0) - move.l #$00400000,cd_BoardSize(a0) + move.l #$00800000,cd_BoardSize(a0) lea cd_Rom(a0),a1 move.b #ERT_ZORROIII+.BOARDSIZE,er_Type(a1) move.b #.PRODUCT,er_Product(a1) From 3bea5471de28cd9f0d93500f9109647d86fc41fa Mon Sep 17 00:00:00 2001 From: Erik Hemming Date: Mon, 7 Nov 2022 21:40:51 +0100 Subject: [PATCH 06/13] add timer example --- timer/Makefile | 34 ++++++++++++++++++++++++++++++++++ timer/main.c | 43 +++++++++++++++++++++++++++++++++++++++++++ timer/timer.s | 31 +++++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 timer/Makefile create mode 100644 timer/main.c create mode 100644 timer/timer.s diff --git a/timer/Makefile b/timer/Makefile new file mode 100644 index 0000000..23df207 --- /dev/null +++ b/timer/Makefile @@ -0,0 +1,34 @@ +AS = $(VASM) +CC = $(VC) +LD = $(VLINK) + +ASFLAGS := -quiet -Fhunk -kick1hunks -nosym -m68000 -no-opt +CFLAGS := -v -O2 -size -cpu=68060 -c99 -k -sc -DDEBUG +LDFLAGS := -sc -Bstatic -Cvbcc -nostdlib -Rshort -b amigahunk -s + +TARGET := timer +OBJECTS := main.o timer.o +INCLUDE := $(wildcard *.h) $(wildcard *.s) + +CRT0 = $(VBCC)/targets/m68k-amigaos/lib/startup.o +LDLIBS = -L$(VBCC)/targets/m68k-amigaos/lib -lvc + +.EXPORT_ALL_VARIABLES: + +.PHONY: clean + +all: $(TARGET) + +clean: + rm -f $(TARGET) $(OBJECTS) $(OBJECTS:.o=.asm) *.txt + +$(TARGET) : $(OBJECTS) Makefile | buildenv + $(LD) $(LDFLAGS) $(CRT0) $(OBJECTS) $(LDLIBS) -o $@ -M$@.txt + +%.o: %.c $(INCLUDE) Makefile | buildenv + $(CC) $(CFLAGS) -c $< -o $@ + +%.o: %.s Makefile | buildenv + $(AS) $< -o $@ -L $<.txt $(ASFLAGS) -I $(INC_ASM) + +include ../Makefile.build diff --git a/timer/main.c b/timer/main.c new file mode 100644 index 0000000..582b280 --- /dev/null +++ b/timer/main.c @@ -0,0 +1,43 @@ +#include +#include + +#include + +#define NUMRUNS (10) +#define NUMITERATIONS (10000) + +uint32_t runAsmCode(__reg("d0") uint32_t iterations); +uint32_t getCpuCycle() = + "\tmoveq.l\t#0,d0\n" + "\trept 100\n" + "\tsub.l\t$40400000,d0\t;read CPU clock\n" + "\tadd.l\t$40400000,d0\n" + "\tendr\n"; + +static uint32_t sample() +{ + return getCpuCycle(); +} + +int main() +{ + uint32_t result[NUMRUNS]; + + // Calibrate the cost of reading the cycle counter + Disable(); + for (int i = 0; i < NUMRUNS; ++i) + result[i] = sample(); + Enable(); + for (int i = 0; i < NUMRUNS; ++i) + printf("REPT 100 took %d cycles\n", (int)result[i]); + + // Measure the 5c/7instr loop + Disable(); + for (int i = 0; i < NUMRUNS; ++i) + result[i] = runAsmCode(NUMITERATIONS); + Enable(); + for (int i = 0; i < NUMRUNS; ++i) + printf("%d iterations took %d cycles\n", NUMITERATIONS, (int)result[i]); + + return 0; +} diff --git a/timer/timer.s b/timer/timer.s new file mode 100644 index 0000000..39c3d2f --- /dev/null +++ b/timer/timer.s @@ -0,0 +1,31 @@ + +; Example program +; This runs a 5-cycle code loop for N iterations (provided in D0), +; and then returns (in D0) the number of CPU cycles used. + + PUBLIC _runAsmCode + +_runAsmCode: + + bset.b #1,$bfe001 ; trigger logic analyzer + tst.b $bfe001 ; delay due to SIO on the 060db + move.l $40400000,a0 ; sample cpu clock counter + +.iter: + addx.l d1,d1 ; pOEP-only + addx.l d1,d1 ; pOEP-only + addx.l d1,d1 ; pOEP-only + addx.l d1,d1 ; pOEP-only + + add.l d1,d1 ; pOEP|sOEP + subq.l #1,d0 ; pOEP|sOEP + bne.s .iter ; is predicted and folded, takes 0 cycles + + sub.l $40400000,a0 ; sample cpu clock counter + bclr.b #1,$bfe001 ; reset logic analyzer + + moveq.l #0,d0 + sub.l a0,d0 + + rts + From b6a139fb2357ae9f20a26376f1f22b0d596ec1a0 Mon Sep 17 00:00:00 2001 From: Erik Hemming Date: Wed, 9 Nov 2022 19:59:56 +0100 Subject: [PATCH 07/13] add cpufreq to replay.rom --- build_rom.sh | 2 +- cpufreq/Makefile | 42 ++++++++++++++ cpufreq/cpufreq.c | 118 +++++++++++++++++++++++++++++++++++++++ cpufreq/kprintf.c | 44 +++++++++++++++ cpufreq/kprintf.h | 11 ++++ cpufreq/main.c | 138 ++++++++++++++++++++++++++++++++++++++++++++++ cpufreq/payload.s | 18 ++++++ cpufreq/start.c | 41 ++++++++++++++ 8 files changed, 413 insertions(+), 1 deletion(-) create mode 100644 cpufreq/Makefile create mode 100644 cpufreq/cpufreq.c create mode 100644 cpufreq/kprintf.c create mode 100644 cpufreq/kprintf.h create mode 100644 cpufreq/main.c create mode 100644 cpufreq/payload.s create mode 100644 cpufreq/start.c diff --git a/build_rom.sh b/build_rom.sh index 47ba962..7432618 100755 --- a/build_rom.sh +++ b/build_rom.sh @@ -1,7 +1,7 @@ #!/bin/bash set -e -romtool -v build -o replay.rom -t ext -s 128 -e f00000 -a f00010 -r 01.10 -f bootrom/bootrom.bin addmem/AddReplayMem poseidon/PoseidonLoader rtc/battclock.resource usb/usb_eth.autoconfig usb/replayusb.device eth/replayeth.device sdcard/replaysd.device rtg/Replay.card xaudio/Devs/AHI/replay.audio +romtool -v build -o replay.rom -t ext -s 128 -e f00000 -a f00010 -r 01.10 -f bootrom/bootrom.bin addmem/AddReplayMem poseidon/PoseidonLoader rtc/battclock.resource usb/usb_eth.autoconfig usb/replayusb.device eth/replayeth.device sdcard/replaysd.device rtg/Replay.card xaudio/Devs/AHI/replay.audio cpufreq/cpufreq.exe printf "000001: 11" | xxd -r - replay.rom romtool copy -c replay.rom replay.rom romtool info replay.rom diff --git a/cpufreq/Makefile b/cpufreq/Makefile new file mode 100644 index 0000000..dbb22e5 --- /dev/null +++ b/cpufreq/Makefile @@ -0,0 +1,42 @@ +AS = $(VASM) +CC = $(VC) +LD = $(VLINK) + +ASFLAGS := -quiet -Fhunk -kick1hunks -nosym -m68000 -no-opt +CFLAGS_CLI := -v -O2 -size -cpu=68060 -c99 -k -sc #-DDEBUG +CFLAGS := -v -O2 -size -cpu=68060 -fastcall -nostdlib -c99 -k -sc #-DDEBUG +LDFLAGS := -sc -Bstatic -Cvbcc -nostdlib -Rshort -b amigahunk -s + +TARGET := cpufreq.exe cpufreq.cli +OBJECTS_CLI := cpufreq.o +OBJECTS := start.o main.o kprintf.o payload.o +INCLUDE := $(wildcard *.h) $(wildcard *.s) + +CRT0 = $(VBCC)/targets/m68k-amigaos/lib/startup.o +LDLIBS = -L$(VBCC)/targets/m68k-amigaos/lib -lvc + +.EXPORT_ALL_VARIABLES: + +.PHONY: clean + +all: $(TARGET) + +clean: + rm -f $(TARGET) $(OBJECTS_CLI) $(OBJECTS_CLI:.o=.asm) $(OBJECTS) $(OBJECTS:.o=.asm) *.txt + +cpufreq.exe : $(OBJECTS) Makefile | buildenv + $(LD) -sc $(OBJECTS) -o $@ -M$@.txt -b amigahunk + +cpufreq.cli : cpufreq.o Makefile | buildenv + $(LD) $(LDFLAGS) $(CRT0) cpufreq.o $(LDLIBS) -o $@ -M$@.txt + +%.o: %.c $(INCLUDE) Makefile | buildenv + $(CC) $(CFLAGS) -c $< -o $@ + +%.o: %.s Makefile | buildenv + $(AS) $< -o $@ -L $<.txt $(ASFLAGS) -I $(INC_ASM) + +payload.o: cpufreq.cli # payload embeds the cpufreq command +cpufreq.o: CFLAGS=$(CFLAGS_CLI) + +include ../Makefile.build diff --git a/cpufreq/cpufreq.c b/cpufreq/cpufreq.c new file mode 100644 index 0000000..57db829 --- /dev/null +++ b/cpufreq/cpufreq.c @@ -0,0 +1,118 @@ +// +// WWW.FPGAArcade.COM +// +// REPLAY Retro Gaming Platform +// No Emulation No Compromise +// +// cpufreq - CLI tool for updating the 68060 CPU clock frequency +// Copyright (C) Erik Hemming +// +// This software is licensed under LPGLv2.1 ; see LICENSE file +// +// + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#define PRODUCTID (32) +#define MANUFACTURER (5060) + +#define TEMPLATE "FREQ/N/A" +#define OPT_FREQ 0 +#define OPT_COUNT 1 + +#define CPU_CLKDIV (0x100) + +int main (void) +{ + uint32_t* result[OPT_COUNT] = { 0 }; + struct RDArgs* args = ReadArgs(TEMPLATE, (LONG *)result, NULL); + + printf(">> FPGAArcade Replay 68060db CPU Frequency Control <<\n\n"); + + struct Library* ExpansionBase = OpenLibrary(EXPANSIONNAME, 0); + if (!ExpansionBase) + { + printf("ERROR: Unable to open '%s'\n", EXPANSIONNAME); + return 1337; + } + + struct ConfigDev* cd = (struct ConfigDev*)FindConfigDev(NULL, MANUFACTURER, PRODUCTID); + if (cd) + { + printf("68060db config device found (%04d/%02d).\n", MANUFACTURER, PRODUCTID); +#ifdef DEBUG + printf(" cd_BoardAddr = %p\n", cd->cd_BoardAddr); + printf(" cd_BoardSize = %lu bytes\n", cd->cd_BoardSize); + printf(" er_Type = $%02x\n", cd->cd_Rom.er_Type); + printf(" er_Flags = $%02x\n", cd->cd_Rom.er_Flags); + printf(" er_SerialNumber = $%08lx\n", cd->cd_Rom.er_SerialNumber); + printf(" er_InitDiagVec = $%04x\n", cd->cd_Rom.er_InitDiagVec); + + struct DiagArea* da = *(struct DiagArea**)&cd->cd_Rom.er_Reserved0c; + printf(" er_DiagArea = %p\n", (APTR)da); + if (da) + { + APTR da_DiagPoint = da->da_DiagPoint ? (APTR)((intptr_t)da + (int16_t)da->da_DiagPoint) : 0; + APTR da_BootPoint = da->da_BootPoint ? (APTR)((intptr_t)da + (int16_t)da->da_BootPoint) : 0; + const char* da_Name = da->da_Name ? (char*)((intptr_t)da + (int16_t)da->da_Name) : 0; + + printf(" da_Config = $%02x\n", da->da_Config); + printf(" da_Flags = $%02x\n", da->da_Flags); + printf(" da_Size = $%04x\n", da->da_Size); + printf(" da_DiagPoint = %p\n", da_DiagPoint); + printf(" da_BootPoint = %p\n", da_BootPoint); + printf(" da_Name = %p (%s)\n", (APTR)da_Name, da_Name ? da_Name : ""); + + } + printf("\n"); +#endif + uint32_t freq_opt = 0; + + if (args != NULL) + { + freq_opt = *result[OPT_FREQ]; + + printf("Setting CPU CLK to %lu MHz\n", freq_opt); + + FreeArgs(args); + } + else + { + printf("usage: cpufreq \n"); + } + + if (freq_opt > 0) + { + uint16_t* cpu_clk = (uint16_t*)((intptr_t)cd->cd_BoardAddr + CPU_CLKDIV); + + uint16_t data = 0x8000 | (freq_opt & 0xff); +#ifdef DEBUG + printf("Writing 0x%x of cpu_clk ( %p )\n", data, (APTR)cpu_clk); +#endif + Disable(); + *cpu_clk = data; + CacheClearU(); + Enable(); +#ifdef DEBUG + printf("\nDONE!\n"); +#endif + } + } + else + { + printf("68060db config device NOT FOUND (%04d/%02d).\n", MANUFACTURER, PRODUCTID); + } + + CloseLibrary(ExpansionBase); + + return 0; +} diff --git a/cpufreq/kprintf.c b/cpufreq/kprintf.c new file mode 100644 index 0000000..288cb88 --- /dev/null +++ b/cpufreq/kprintf.c @@ -0,0 +1,44 @@ +// +// WWW.FPGAArcade.COM +// +// REPLAY Retro Gaming Platform +// No Emulation No Compromise +// +// cpufreq - CLI tool for updating the 68060 CPU clock frequency +// Copyright (C) Erik Hemming +// +// This software is licensed under LPGLv2.1 ; see LICENSE file +// +// + +#include +#include + +#include + +#ifdef DEBUG + +static void set_uart_speed(__reg("d0") uint32_t c) = "\tmove.w\td0,$dff032\n"; +static void RawPutChar(__reg("d0") uint32_t c, __reg("a6") struct ExecBase* SysBase) = "\tjsr\t-516(a6)\n"; + +static void raw_put_char(__reg("d0") uint32_t c, __reg("a3") struct ExecBase* SysBase) +{ + RawPutChar(c, SysBase); +} + +void kprintf(const char *format, ...) +{ + va_list args; + struct ExecBase* SysBase = *((struct ExecBase **) (4L)); + + set_uart_speed(3546895/115200); + + va_start(args, format); + + RawDoFmt((STRPTR) format, (APTR) args, + raw_put_char, (APTR) SysBase); + + va_end(args); +} + +#endif diff --git a/cpufreq/kprintf.h b/cpufreq/kprintf.h new file mode 100644 index 0000000..83b40fb --- /dev/null +++ b/cpufreq/kprintf.h @@ -0,0 +1,11 @@ +#pragma once +#ifndef KPRINTF_H +#define KPRINTF_H + +#ifdef DEBUG +void kprintf(const char* fmt, ...); +#else // DEBUG +#define kprintf(...) do { } while(0) +#endif // DEBUG + +#endif diff --git a/cpufreq/main.c b/cpufreq/main.c new file mode 100644 index 0000000..f829ad8 --- /dev/null +++ b/cpufreq/main.c @@ -0,0 +1,138 @@ +// +// +// tf-rom - resident CLI command test for 'cpufreq' +// Copyright (c) Erik Hemming +// +// This software is licensed under MIT ; see LICENSE file +// +// + +#include + +#include +#include +#include +#include + +#include "kprintf.h" + +void* Init(__reg("d0") APTR libraryBase , __reg("a0") BPTR segList, __reg("a6") struct ExecBase* SysBase); +int Run(__reg("d0") ULONG argc, __reg("a0") APTR argp, __reg("a3") BPTR segList); +int Launch(__reg("d0") ULONG argc, __reg("a0") APTR argp, __reg("a1") APTR entry, __reg("a3") BPTR seglist); + +extern struct Resident romtag; +extern uint8_t cpufreq; +extern int end; + +static __section(CODE) struct SegListTrampoline +{ + ULONG next; + UWORD jmp; + APTR address; +} trampoline = +{ + .next = 0, + .jmp = 0x4ef9, + .address = (APTR)Run +}; + +void* Init( __reg("d0") APTR libraryBase, + __reg("a0") BPTR segList, + __reg("a6") struct ExecBase* SysBase ) +{ + kprintf("Init() => %s", romtag.rt_IdString); + + struct DosLibrary* DOSBase = (struct DosLibrary*)OpenLibrary(DOSNAME, 36); + + if (DOSBase) { + kprintf("AddSegment(segList=%08lx => jumpto=%08lx)\n", MKBADDR(&trampoline), trampoline.address); + int ret = AddSegment("cpufreq", MKBADDR(&trampoline), CMD_INTERNAL); + kprintf(" => success = %08lx\n", ret); + + CloseLibrary((struct Library*)DOSBase); + } + else + { + kprintf("Failed to open dos.library\n"); + } + + return 0; +} + +static uint32_t Copy( __reg("d1") void* readhandle, // Autodocs says D1,A0,D0 + __reg("d2") void* buffer, // but is incorrect! + __reg("d3") uint32_t length, // It matches Read() ... + __reg("a6") struct DosLibrary* DOSBase ) +{ + struct ExecBase * SysBase = *(struct ExecBase **)4; + uint8_t** p = readhandle; + + uint32_t available = (ULONG)&end - (ULONG)*p; + if (available < length) + length = available; + + CopyMem(*p, buffer, length); + *p += length; + + return length; +} + +static void* Alloc( __reg("d0") uint32_t size, + __reg("d1") uint32_t flags, + __reg("a6") struct ExecBase* SysBase ) +{ + return AllocMem(size, flags); +} +static void Free( __reg("a1") void* memory, + __reg("d0") uint32_t size, + __reg("a6") struct ExecBase* SysBase ) +{ + FreeMem(memory, size); +} + +int Run(__reg("d0") ULONG argc, __reg("a0") APTR argp, __reg("a3") BPTR segList) +{ + struct ExecBase* SysBase = *((struct ExecBase **) (4L)); + struct DosLibrary* DOSBase = (struct DosLibrary*)OpenLibrary(DOSNAME, 36); + + if (!DOSBase) { + kprintf("DOS failed\n"); + return 1337; + } + + { + uint8_t* fh = &cpufreq; + LONG funcs[] = { (LONG)Copy, (LONG)Alloc, (LONG)Free }; + LONG stackSize = 0; + kprintf("InternalLoadSeg(%08lx)...\n", fh); + segList = InternalLoadSeg((BPTR)&fh, 0, funcs, &stackSize); + kprintf(" => segList = %08lx (%08lx)\n", segList, BADDR(segList)); + } + + if (!segList) { + kprintf("segList is NULL\n"); + return 1337; + } + + { + kprintf("segTable =\n"); + int hunkNr = 0; + for (BPTR *hunk = BADDR(segList), next; hunk; next = *hunk, hunk = BADDR(next)) + { + kprintf(" [%ld] => %08lx\n", hunkNr++, hunk); + } + } + + kprintf("Launch(argc = %08ld, argp = %08lx, entry=%08lx, segList=%08lx)\n", + argc, argp, BADDR(segList+1), segList); + int ret = Launch(argc, argp, BADDR(segList+1), segList); + kprintf(" => error = %08ld\n", ret); + + { + kprintf("InternalUnLoadSeg(%08lx)\n", segList); + InternalUnLoadSeg(segList, Free); + } + + CloseLibrary((struct Library*)DOSBase); + return ret; +} diff --git a/cpufreq/payload.s b/cpufreq/payload.s new file mode 100644 index 0000000..3161c7e --- /dev/null +++ b/cpufreq/payload.s @@ -0,0 +1,18 @@ + + xdef @Launch + xdef _cpufreq + xdef _end + + section CODE + +@Launch movem.l d2-d7/a2-a6,-(sp) + jsr (a1) + movem.l (sp)+,d2-d7/a2-a6 + rts + + cnop 0,4 + +_cpufreq + incbin cpufreq.cli + +_end: diff --git a/cpufreq/start.c b/cpufreq/start.c new file mode 100644 index 0000000..ae8bd1c --- /dev/null +++ b/cpufreq/start.c @@ -0,0 +1,41 @@ +// +// WWW.FPGAArcade.COM +// +// REPLAY Retro Gaming Platform +// No Emulation No Compromise +// +// cpufreq - CLI tool for updating the 68060 CPU clock frequency +// Copyright (C) Erik Hemming +// +// This software is licensed under LPGLv2.1 ; see LICENSE file +// +// + +#include +#include + +#include +#include + +void* Init(); +int Run(); +extern int end; + +int Start() +{ + return Run(); +} + +__section(CODE) struct Resident romtag = +{ + .rt_MatchWord = RTC_MATCHWORD, + .rt_MatchTag = &romtag, + .rt_EndSkip = &end, + .rt_Flags = RTF_AFTERDOS, + .rt_Version = 1, + .rt_Type = NT_UNKNOWN, + .rt_Pri = 0, + .rt_Name = "cpufreq", + .rt_IdString = "cpufreq 1.0 (8.11.2022)\n\r", + .rt_Init = (APTR)Init +}; From 10a8506715f59f1ef5b00a146c75a46ef7d40322 Mon Sep 17 00:00:00 2001 From: Erik Hemming Date: Wed, 9 Nov 2022 20:01:00 +0100 Subject: [PATCH 08/13] Add INIT kprintf to battclock --- rtc/battclock.s | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rtc/battclock.s b/rtc/battclock.s index 2f29edb..b728ad4 100644 --- a/rtc/battclock.s +++ b/rtc/battclock.s @@ -625,6 +625,8 @@ initStruct: DC.L 0 InitResource: + kprintf "INIT: %s",#VERSTRING + movem.l a2/a3/a6,-(sp) move.l #0,a2 ; for no resource case From 83715b802cb0109f2e69664e4ac8f92cec38041c Mon Sep 17 00:00:00 2001 From: Erik Hemming Date: Wed, 9 Nov 2022 21:37:29 +0100 Subject: [PATCH 09/13] [xaudio] fix (c) sign --- xaudio/Devs/AHI/replay.audio | Bin 3632 -> 3632 bytes xaudio/src/replay_audio.s | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/xaudio/Devs/AHI/replay.audio b/xaudio/Devs/AHI/replay.audio index c35b2699cc7960edb507e0077e14488b3fc9fb3e..52ea0c857bebf954b05c9e025cf9345684c9dbe1 100644 GIT binary patch delta 18 acmdlWvq5Hq0|(=w$qpRSn`1bxumS)+iUv9W delta 16 XcmdlWvq5Hq1IJ`X4(ZL&99LNZG0z2f diff --git a/xaudio/src/replay_audio.s b/xaudio/src/replay_audio.s index f05c3df..f2ca39b 100644 --- a/xaudio/src/replay_audio.s +++ b/xaudio/src/replay_audio.s @@ -2455,7 +2455,7 @@ ga_Copyright: lea .copyright(pc),a0 move.l a0,d0 rts -.copyright dc.b "� 2022 All rights reserved",0 +.copyright dc.b "© 2022 All rights reserved",0 even ga_Version: From d3939acd65fccf9d016f5d304db380f018aeb590 Mon Sep 17 00:00:00 2001 From: Erik Hemming Date: Wed, 9 Nov 2022 21:37:58 +0100 Subject: [PATCH 10/13] [usb] rebuild usb_eth.autoconfig (8MB) --- usb/usb_eth.autoconfig | Bin 496 -> 496 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/usb/usb_eth.autoconfig b/usb/usb_eth.autoconfig index 0782dba342dbf22ae7ed3e3e7fb408e7c5929120..2bef866586793ea3e636e733409030e128e33c66 100644 GIT binary patch delta 35 rcmeys{DFCbCA*P=hPj@h;Y5eyybTNt3@Xkq7zBj&Ff>dSVY~wXyz~lA delta 35 rcmeys{DFCbCA*=5hM}pR@kEE?ybcTu3@Xkq7zBj&Ftkq=VY~wXxU>os From 8208169cb665bcfedc577785ae2d9a43fae8de39 Mon Sep 17 00:00:00 2001 From: Erik Hemming Date: Wed, 9 Nov 2022 21:38:30 +0100 Subject: [PATCH 11/13] [usb[ rebuild PoseidonLoader (kick fix) --- poseidon/PoseidonLoader | Bin 476 -> 468 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/poseidon/PoseidonLoader b/poseidon/PoseidonLoader index 142e9d0de3a0d86a047eabf64299e3279a312fdc..66ae0141bba85e6640fb8178041b1953d7c12036 100644 GIT binary patch delta 88 zcmcb^e1&;}IBzlo1M^D;28Lw6UkuYGs^v&|{Q>d{7#JA4n3x!{fb1?HwgciB8`p6% aDzXAuAW#IvWk6g9#7#il2E;(X{0RVM#}GLH delta 96 zcmcb@e2000IDZNQ1M^D;28I;BpFncXM3o#Fze2A+Kz0cO17jZ(6GIk|-3P=DKs;yT fDo#dKHXsWGn1Hwph^v6O35eT(xC@AZfcX;u?nDtP From 41b3f9f3724eafa7b84e59ed539661bbe6f9ea12 Mon Sep 17 00:00:00 2001 From: Erik Hemming Date: Wed, 9 Nov 2022 21:38:49 +0100 Subject: [PATCH 12/13] Rebuild oled.exe example --- oled/oled.exe | Bin 12032 -> 12044 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/oled/oled.exe b/oled/oled.exe index eb13cda78787855fbe6890c678d2c396eff98456..6b24a6675d2beca4fa1b020d2bccef25593d54db 100644 GIT binary patch delta 76 zcmV-S0JHyqUW{Il7aO_&00Zd&01LWcNJ!_v@+^1&1T*{q9su9)GLb4S5XVkVuKoPY iOHOr2=l}j;vXNvV0g$nVGW*?CN delta 69 zcmV-L0J{H-UVvVZ7ZbMt00Zd&01LNZJV@uj@+^1&1d%c>3@l4d?*05o=l}j;zL9Yp b27V0+0AZZ5lH~ybxRZDSO95=N!~#ext#2Dk From 8e425fc2ceb1ee903347d9706cfe9f834a28a4da Mon Sep 17 00:00:00 2001 From: Erik Hemming Date: Wed, 9 Nov 2022 21:39:39 +0100 Subject: [PATCH 13/13] [replay.rom] Bump version and rebuild --- build_rom.sh | 2 +- replay.rom | Bin 131072 -> 131072 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/build_rom.sh b/build_rom.sh index 7432618..157435e 100755 --- a/build_rom.sh +++ b/build_rom.sh @@ -1,7 +1,7 @@ #!/bin/bash set -e -romtool -v build -o replay.rom -t ext -s 128 -e f00000 -a f00010 -r 01.10 -f bootrom/bootrom.bin addmem/AddReplayMem poseidon/PoseidonLoader rtc/battclock.resource usb/usb_eth.autoconfig usb/replayusb.device eth/replayeth.device sdcard/replaysd.device rtg/Replay.card xaudio/Devs/AHI/replay.audio cpufreq/cpufreq.exe +romtool -v build -o replay.rom -t ext -s 128 -e f00000 -a f00010 -r 01.11 -f bootrom/bootrom.bin addmem/AddReplayMem poseidon/PoseidonLoader rtc/battclock.resource usb/usb_eth.autoconfig usb/replayusb.device eth/replayeth.device sdcard/replaysd.device rtg/Replay.card xaudio/Devs/AHI/replay.audio cpufreq/cpufreq.exe printf "000001: 11" | xxd -r - replay.rom romtool copy -c replay.rom replay.rom romtool info replay.rom diff --git a/replay.rom b/replay.rom index 7f9a1319954df5f122ccd4fef806b61fecfc2618..37d460a641572ba62132e3f5a3d11489711c7bdb 100644 GIT binary patch delta 11954 zcmbt)4|r2mw(mO0p&ml0p|lX&ST-SqP+}8m#lpmzq=AN5(o(=-<}#T6I{_>-*1}Y7 zUz3)?REFnN4$ncxVfxMI=OA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